29 #include "../../idlib/precompiled.h"
35 #define PATHSEPERATOR '/'
45 void Error(
const char *pFormat, ...)
50 va_start(arg_ptr, pFormat);
56 void Printf(
const char *pFormat, ...)
61 va_start(arg_ptr, pFormat);
67 void ErrorNum(
int nErr,
const char *pFormat, ...)
72 va_start(arg_ptr, pFormat);
83 va_start(arg_ptr, pFormat);
133 int LoadFile (
const char *filename,
void **bufferptr)
141 if ( filename ==
NULL || strlen(filename) == 0 ) {
145 f = fopen( filename,
"rb" );
151 ((
char *)buffer)[
length] = 0;
152 if ( (
int)
fread( buffer, 1, length, f ) !=
length ) {
153 Error(
"File read failure" );
173 src = path + strlen(path) - 1;
182 strcat (path, extension);
197 strcpy (path,basepath);
210 length = strlen(path)-1;
226 length = strlen(path)-1;
227 while (length > 0 && path[length] !=
'.')
230 if (path[length] ==
'/')
void DefaultPath(char *path, char *basepath)
void SetErrorHandlerNum(PFN_ERR_NUM pe)
void SetPrintfHandler(PFN_PRINTF pe)
void StripFilename(char *path)
void( PFN_PRINTF_NUM)(int nNum, const char *pFormat,...)
void( PFN_ERR_NUM)(int nNum, const char *pFormat,...)
PFN_PRINTF_NUM * g_pfnPrintfNum
void Error(const char *pFormat,...)
void ErrorNum(int nErr, const char *pFormat,...)
void Printf(const char *pFormat,...)
void DefaultExtension(char *path, char *extension)
int Q_filelength(FILE *f)
void PrintfNum(int nErr, const char *pFormat,...)
void( PFN_PRINTF)(const char *pFormat,...)
int LoadFile(const char *filename, void **bufferptr)
GLsizei const GLcharARB const GLint * length
void * Mem_ClearedAlloc(const int size)
void StripExtension(char *path)
void SetErrorHandler(PFN_ERR pe)
void( PFN_ERR)(const char *pFormat,...)
PFN_ERR_NUM * g_pfnErrorNum