Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

l_cmd.h

Go to the documentation of this file.
00001 /*
00002 ===========================================================================
00003 Copyright (C) 1999-2005 Id Software, Inc.
00004 
00005 This file is part of Quake III Arena source code.
00006 
00007 Quake III Arena source code is free software; you can redistribute it
00008 and/or modify it under the terms of the GNU General Public License as
00009 published by the Free Software Foundation; either version 2 of the License,
00010 or (at your option) any later version.
00011 
00012 Quake III Arena source code is distributed in the hope that it will be
00013 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Foobar; if not, write to the Free Software
00019 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020 ===========================================================================
00021 */
00022 // cmdlib.h
00023 
00024 #ifndef SIN
00025 #define SIN
00026 #endif //SIN
00027 
00028 #ifndef __CMDLIB__
00029 #define __CMDLIB__
00030 
00031 #ifdef _WIN32
00032 #pragma warning(disable : 4244)     // MIPS
00033 #pragma warning(disable : 4136)     // X86
00034 #pragma warning(disable : 4051)     // ALPHA
00035 
00036 #pragma warning(disable : 4018)     // signed/unsigned mismatch
00037 #pragma warning(disable : 4305)     // truncate from double to float
00038 #endif
00039 
00040 #include <stdio.h>
00041 #include <string.h>
00042 #include <stdlib.h>
00043 #include <errno.h>
00044 #include <ctype.h>
00045 #include <time.h>
00046 #include <stdarg.h>
00047 
00048 #ifndef __BYTEBOOL__
00049 #define __BYTEBOOL__
00050 typedef enum {false, true} qboolean;
00051 typedef unsigned char byte;
00052 #endif
00053 
00054 // the dec offsetof macro doesnt work very well...
00055 #define myoffsetof(type,identifier) ((size_t)&((type *)0)->identifier)
00056 
00057 
00058 // set these before calling CheckParm
00059 extern int myargc;
00060 extern char **myargv;
00061 
00062 char *strupr (char *in);
00063 char *strlower (char *in);
00064 int Q_strncasecmp (char *s1, char *s2, int n);
00065 int Q_strcasecmp (char *s1, char *s2);
00066 void Q_getwd (char *out);
00067 
00068 int Q_filelength (FILE *f);
00069 int FileTime (char *path);
00070 
00071 void    Q_mkdir (char *path);
00072 
00073 extern  char        qdir[1024];
00074 extern  char        gamedir[1024];
00075 void SetQdirFromPath (char *path);
00076 char *ExpandArg (char *path);   // from cmd line
00077 char *ExpandPath (char *path);  // from scripts
00078 char *ExpandPathAndArchive (char *path);
00079 
00080 
00081 double I_FloatTime (void);
00082 
00083 void Error(char *error, ...);
00084 void Warning(char *warning, ...);
00085 
00086 int     CheckParm (char *check);
00087 
00088 FILE    *SafeOpenWrite (char *filename);
00089 FILE    *SafeOpenRead (char *filename);
00090 void    SafeRead (FILE *f, void *buffer, int count);
00091 void    SafeWrite (FILE *f, void *buffer, int count);
00092 
00093 int LoadFile (char *filename, void **bufferptr, int offset, int length);
00094 int TryLoadFile (char *filename, void **bufferptr);
00095 void SaveFile (char *filename, void *buffer, int count);
00096 qboolean    FileExists (char *filename);
00097 
00098 void    DefaultExtension (char *path, char *extension);
00099 void    DefaultPath (char *path, char *basepath);
00100 void    StripFilename (char *path);
00101 void    StripExtension (char *path);
00102 
00103 void    ExtractFilePath (char *path, char *dest);
00104 void    ExtractFileBase (char *path, char *dest);
00105 void    ExtractFileExtension (char *path, char *dest);
00106 
00107 int     ParseNum (char *str);
00108 
00109 short   BigShort (short l);
00110 short   LittleShort (short l);
00111 int     BigLong (int l);
00112 int     LittleLong (int l);
00113 float   BigFloat (float l);
00114 float   LittleFloat (float l);
00115 
00116 #ifdef SIN
00117 unsigned short  BigUnsignedShort (unsigned short l);
00118 unsigned short  LittleUnsignedShort (unsigned short l);
00119 unsigned          BigUnsigned (unsigned l);
00120 unsigned          LittleUnsigned (unsigned l);
00121 #endif
00122 
00123 
00124 char *COM_Parse (char *data);
00125 
00126 extern  char        com_token[1024];
00127 extern  qboolean    com_eof;
00128 
00129 char *copystring(char *s);
00130 
00131 
00132 void CRC_Init(unsigned short *crcvalue);
00133 void CRC_ProcessByte(unsigned short *crcvalue, byte data);
00134 unsigned short CRC_Value(unsigned short crcvalue);
00135 
00136 void    CreatePath (char *path);
00137 void    QCopyFile (char *from, char *to);
00138 
00139 extern  qboolean        archive;
00140 extern  char            archivedir[1024];
00141 
00142 
00143 extern  qboolean verbose;
00144 void qprintf (char *format, ...);
00145 
00146 void ExpandWildcards (int *argc, char ***argv);
00147 
00148 
00149 // for compression routines
00150 typedef struct
00151 {
00152     byte    *data;
00153     int     count;
00154 } cblock_t;
00155 
00156 #endif
00157 

Generated on Thu Aug 25 12:37:17 2005 for Quake III Arena by  doxygen 1.3.9.1