| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
#ifndef __CMDLIB__ |
| 26 |
#define __CMDLIB__ |
| 27 |
|
| 28 |
#include <stdio.h> |
| 29 |
#include <string.h> |
| 30 |
#include <stdlib.h> |
| 31 |
#include <errno.h> |
| 32 |
#include <ctype.h> |
| 33 |
#include <time.h> |
| 34 |
#include <stdarg.h> |
| 35 |
|
| 36 |
#ifndef __BYTEBOOL__ |
| 37 |
#define __BYTEBOOL__ |
| 38 |
typedef enum {false, true} qboolean; |
| 39 |
typedef unsigned char byte; |
| 40 |
#endif |
| 41 |
|
| 42 |
|
| 43 |
#define myoffsetof(type,identifier) ((size_t)&((type *)0)->identifier) |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
extern int myargc; |
| 48 |
extern char **myargv; |
| 49 |
|
| 50 |
int Q_strncasecmp (char *s1, char *s2, int n); |
| 51 |
int Q_strcasecmp (char *s1, char *s2); |
| 52 |
|
| 53 |
int Q_filelength (FILE *f); |
| 54 |
|
| 55 |
double I_FloatTime (void); |
| 56 |
|
| 57 |
void Error (char *error, ...); |
| 58 |
int CheckParm (char *check); |
| 59 |
void ParseCommandLine (char *lpCmdLine); |
| 60 |
|
| 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); |
| 65 |
|
| 66 |
int LoadFile (char *filename, void **bufferptr); |
| 67 |
int LoadFileNoCrash (char *filename, void **bufferptr); |
| 68 |
void SaveFile (char *filename, void *buffer, int count); |
| 69 |
|
| 70 |
void DefaultExtension (char *path, char *extension); |
| 71 |
void DefaultPath (char *path, char *basepath); |
| 72 |
void StripFilename (char *path); |
| 73 |
void StripExtension (char *path); |
| 74 |
|
| 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); |
| 79 |
|
| 80 |
int ParseNum (char *str); |
| 81 |
|
| 82 |
short BigShort (short l); |
| 83 |
short LittleShort (short l); |
| 84 |
int BigLong (int l); |
| 85 |
int LittleLong (int l); |
| 86 |
float BigFloat (float l); |
| 87 |
float LittleFloat (float l); |
| 88 |
|
| 89 |
|
| 90 |
char *COM_Parse (char *data); |
| 91 |
|
| 92 |
extern char com_token[1024]; |
| 93 |
extern qboolean com_eof; |
| 94 |
|
| 95 |
#define MAX_NUM_ARGVS 32 |
| 96 |
extern int argc; |
| 97 |
extern char *argv[MAX_NUM_ARGVS]; |
| 98 |
|
| 99 |
#endif |