]> de.git.xonotic.org Git - voretournament/voretournament.git/blob - misc/source/fteqcc-src/cmdlib.h
Add source for the new Vore Tournament logo. Uses clip art from http://www.openclipar...
[voretournament/voretournament.git] / misc / source / fteqcc-src / cmdlib.h
1 // cmdlib.h
2
3 #ifndef __CMDLIB__
4 #define __CMDLIB__
5
6 #include "progsint.h"
7
8 /*#include <stdio.h>
9 #include <string.h>
10 #include <stdlib.h>
11 #include <errno.h>
12 #include <ctype.h>
13 #include <sys/types.h>
14 #include <sys/stat.h>
15 #include <fcntl.h>
16 #include <stdarg.h>
17 #include <setjmp.h>
18 #include <io.h>
19
20 #ifdef NeXT
21 #include <libc.h>
22 #endif
23 */
24
25 // the dec offsetof macro doesn't work very well...
26 #define myoffsetof(type,identifier) ((size_t)&((type *)NULL)->identifier)
27
28
29 // set these before calling CheckParm
30 extern int myargc;
31 extern char **myargv;
32
33 //char *strupr (char *in);
34 //char *strlower (char *in);
35 int QCC_filelength (int handle);
36 int QCC_tell (int handle);
37
38 int QC_strcasecmp (const char *s1, const char *s2);
39
40 #ifdef _MSC_VER
41 #define QC_vsnprintf _vsnprintf
42 #else
43 #define QC_vsnprintf vsnprintf
44 #endif
45
46 #if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
47         #ifndef LIKEPRINTF
48                 #define LIKEPRINTF(x) __attribute__((format(printf,x,x+1)))
49         #endif
50 #endif
51 #ifndef LIKEPRINTF
52 #define LIKEPRINTF(x)
53 #endif
54
55 double I_FloatTime (void);
56
57 void    VARGS QCC_Error (int errortype, const char *error, ...) LIKEPRINTF(2);
58 int             CheckParm (char *check);
59
60
61 int     SafeOpenWrite (char *filename, int maxsize);
62 int     SafeOpenRead (char *filename);
63 void    SafeRead (int handle, void *buffer, long count);
64 void    SafeWrite (int handle, void *buffer, long count);
65 void    SafeClose(int handle);
66 int SafeSeek(int hand, int ofs, int mode);
67 void    *SafeMalloc (long size);
68
69
70 long    QCC_LoadFile (char *filename, void **bufferptr);
71 void    QCC_SaveFile (char *filename, void *buffer, long count);
72
73 void    DefaultExtension (char *path, char *extension);
74 void    DefaultPath (char *path, char *basepath);
75 void    StripFilename (char *path);
76 void    StripExtension (char *path);
77
78 void    ExtractFilePath (char *path, char *dest);
79 void    ExtractFileBase (char *path, char *dest);
80 void    ExtractFileExtension (char *path, char *dest);
81
82 long    ParseNum (char *str);
83
84
85 char *QCC_COM_Parse (char *data);
86 char *QCC_COM_Parse2 (char *data);
87
88 extern  char    qcc_token[1024];
89 extern  int             qcc_eof;
90
91
92
93 #endif