2 ===========================================================================
3 Copyright (C) 1997-2006 Id Software, Inc.
5 This file is part of Quake 2 Tools source code.
7 Quake 2 Tools source code is free software; you can redistribute it
8 and/or modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of the License,
10 or (at your option) any later version.
12 Quake 2 Tools source code is distributed in the hope that it will be
13 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Quake 2 Tools source code; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 ===========================================================================
38 typedef enum {false, true} qboolean;
39 typedef unsigned char byte;
42 // the dec offsetof macro doesn't work very well...
43 #define myoffsetof(type,identifier) ((size_t)&((type *)0)->identifier)
46 // set these before calling CheckParm
50 int Q_strncasecmp (char *s1, char *s2, int n);
51 int Q_strcasecmp (char *s1, char *s2);
53 int Q_filelength (FILE *f);
55 double I_FloatTime (void);
57 void Error (char *error, ...);
58 int CheckParm (char *check);
59 void ParseCommandLine (char *lpCmdLine);
61 FILE *SafeOpenWrite (char *filename);
62 FILE *SafeOpenRead (char *filename);
63 void SafeRead (FILE *f, void *buffer, int count);
64 void SafeWrite (FILE *f, void *buffer, int count);
66 int LoadFile (char *filename, void **bufferptr);
67 int LoadFileNoCrash (char *filename, void **bufferptr);
68 void SaveFile (char *filename, void *buffer, int count);
70 void DefaultExtension (char *path, char *extension);
71 void DefaultPath (char *path, char *basepath);
72 void StripFilename (char *path);
73 void StripExtension (char *path);
75 void ExtractFilePath (char *path, char *dest);
76 void ExtractFileName (char *path, char *dest);
77 void ExtractFileBase (char *path, char *dest);
78 void ExtractFileExtension (char *path, char *dest);
80 int ParseNum (char *str);
82 short BigShort (short l);
83 short LittleShort (short l);
85 int LittleLong (int l);
86 float BigFloat (float l);
87 float LittleFloat (float l);
90 char *COM_Parse (char *data);
92 extern char com_token[1024];
93 extern qboolean com_eof;
95 #define MAX_NUM_ARGVS 32
97 extern char *argv[MAX_NUM_ARGVS];