11 #define MAX_LINE_WIDTH 128
13 void strlwr (char * str)
15 while (*str) {*str = tolower (*str); str++; }
18 int filelength (int fd)
20 FILE *f = fdopen (dup(fd), "r");
21 fseek (f, 0, SEEK_END);
27 unsigned long _beginthread (void (*pfuncStart)(void *), unsigned unStackSize, void* pArgList)
39 void OutputDebugString (const char *str)
41 fprintf(stderr, "OutputDebugString: %s\n", str);
49 int MulDiv(int a, int b, int c)
51 /* slow long long version */
52 __extension__ long long aa = a;
53 __extension__ long long bb = b;
54 __extension__ long long cc = c;
56 __extension__ long long dd = aa * bb;
57 __extension__ long long ee = dd / cc;
67 void vm_free(void* ptr, char*, int)
72 void *vm_malloc(int size, char*, int)
77 char *vm_strdup(char const* str, char*, int)
82 void windebug_memwatch_init()
87 /* error message debugging junk */
88 int Log_debug_output_to_file = 0;
90 void load_filter_info(void)
95 void outwnd_printf(char* id, char* format, ...)
97 char tmp[MAX_LINE_WIDTH*4];
100 va_start (args, format);
101 vsprintf (tmp, format, args);
103 fprintf (stderr, "%s: %s", id, tmp);
104 if (!strcmp ("Error", id)) exit (1);
107 void outwnd_printf2(char* format, ...)
109 char tmp[MAX_LINE_WIDTH*4];
112 va_start (args, format);
113 vsprintf (tmp, format, args);
115 fprintf (stderr, "General: %s", tmp);
123 void Warning( char * filename, int line, char * format, ... )
128 void Error( char * filename, int line, char * format, ... )
133 void WinAssert(char * text,char *filename, int line)