#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <ctype.h>
Include dependency graph for q_shared.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Data Structures | |
| struct | growList_t |
Defines | |
| #define | ALIGN_OFF |
| #define | ALIGN_ON |
| #define | BLINK_DIVISOR 200 |
| #define | EQUAL_EPSILON 0.001 |
| #define | FILE_HASH_SIZE 1024 |
| #define | id386 0 |
| #define | max(x, y) ( ( ( x ) > ( y ) ) ? ( x ) : ( y ) ) |
| #define | MAX_INFO_KEY 1024 |
| #define | MAX_INFO_STRING 1024 |
| #define | MAX_INFO_VALUE 1024 |
| #define | MAX_MAP_AREA_BYTES 32 |
| #define | MAX_NAME_LENGTH 32 |
| #define | MAX_OSPATH 128 |
| #define | MAX_QINT 0x7fffffff |
| #define | MAX_QPATH 64 |
| #define | MAX_STRING_CHARS 1024 |
| #define | MAX_STRING_TOKENS 256 |
| #define | MAX_TOKEN_CHARS 1024 |
| #define | min(x, y) ( ( ( x ) < ( y ) ) ? ( x ) : ( y ) ) |
| #define | MIN_QINT (-MAX_QINT-1) |
| #define | NULL ((void *)0) |
| #define | PITCH 0 |
| #define | PROP_GAP_WIDTH 3 |
| #define | PROP_HEIGHT 27 |
| #define | PROP_SMALL_SIZE_SCALE 0.75 |
| #define | PROP_SPACE_WIDTH 8 |
| #define | PULSE_DIVISOR 75 |
| #define | Q3_VERSION "DOOM 0.01" |
| #define | QDECL |
| #define | ROLL 2 |
| #define | sign(f) ( ( f > 0 ) ? 1 : ( ( f < 0 ) ? -1 : 0 ) ) |
| #define | UI_BIGFONT 0x00000020 |
| #define | UI_BLINK 0x00001000 |
| #define | UI_CENTER 0x00000001 |
| #define | UI_DROPSHADOW 0x00000800 |
| #define | UI_FORMATMASK 0x00000007 |
| #define | UI_GIANTFONT 0x00000040 |
| #define | UI_INVERSE 0x00002000 |
| #define | UI_LEFT 0x00000000 |
| #define | UI_PULSE 0x00004000 |
| #define | UI_RIGHT 0x00000002 |
| #define | UI_SMALLFONT 0x00000010 |
| #define | YAW 1 |
Typedefs | |
| typedef unsigned char | byte |
| typedef int | clipHandle_t |
| typedef int | fileHandle_t |
| typedef int | qhandle_t |
| typedef int | sfxHandle_t |
Enumerations | |
| enum | cbufExec_t { EXEC_NOW, EXEC_INSERT, EXEC_APPEND } |
| enum | errorParm_t { ERR_NONE, ERR_FATAL, ERR_DROP, ERR_DISCONNECT, ERR_NEED_CD } |
| enum | fsMode_t { FS_READ, FS_WRITE, FS_APPEND, FS_APPEND_SYNC } |
| enum | fsOrigin_t { FS_SEEK_CUR, FS_SEEK_END, FS_SEEK_SET } |
| enum | jointHandle_t { INVALID_JOINT = -1 } |
| enum | qboolean { qfalse, qtrue } |
Functions | |
| float | BigFloat (float l) |
| int | BigLong (int l) |
| short | BigShort (short l) |
| int | Com_AddToGrowList (growList_t *list, void *data) |
| void | Com_BeginParseSession (const char *filename) |
| float | Com_Clamp (float min, float max, float value) |
| void | Com_DefaultExtension (char *path, int maxSize, const char *extension) |
| void QDECL | Com_DPrintf (const char *msg,...) |
| void | Com_EndParseSession (void) |
| void QDECL | Com_Error (int level, const char *error,...) |
| int | Com_Filter (const char *filter, const char *name, int casesensitive) |
| int | Com_GetCurrentParseLine (void) |
| void * | Com_GrowListElement (const growList_t *list, int index) |
| int | Com_HashString (const char *fname) |
| int | Com_IndexForGrowListElement (const growList_t *list, const void *element) |
| void | Com_InitGrowList (growList_t *list, int maxElements) |
| void | Com_MatchToken (const char *(*buf_p), const char *match, qboolean warning) |
| const char * | Com_Parse (const char *(*data_p)) |
| void | Com_Parse1DMatrix (const char *(*buf_p), int x, float *m) |
| void | Com_Parse2DMatrix (const char *(*buf_p), int y, int x, float *m) |
| void | Com_Parse3DMatrix (const char *(*buf_p), int z, int y, int x, float *m) |
| float | Com_ParseFloat (const char *(*buf_p)) |
| int | Com_ParseInfos (const char *buf, int max, char infos[][MAX_INFO_STRING]) |
| int | Com_ParseInt (const char *(*buf_p)) |
| const char * | Com_ParseOnLine (const char *(*data_p)) |
| const char * | Com_ParseRestOfLine (const char *(*data_p)) |
| void QDECL | Com_Printf (const char *msg,...) |
| void | Com_ScriptError (const char *msg,...) |
| void | Com_ScriptWarning (const char *msg,...) |
| void | Com_SkipBracedSection (const char *(*program)) |
| char * | Com_SkipPath (char *pathname) |
| void | Com_SkipRestOfLine (const char *(*data)) |
| void QDECL | Com_sprintf (char *dest, int size, const char *fmt,...) |
| const char * | Com_StringContains (const char *str1, const char *str2, int casesensitive) |
| void | Com_StripExtension (const char *in, char *out) |
| void | Com_UngetToken (void) |
| void | Info_NextPair (const char *(*s), char key[MAX_INFO_KEY], char value[MAX_INFO_VALUE]) |
| void | Info_RemoveKey (char *s, const char *key) |
| void | Info_SetValueForKey (char *s, const char *key, const char *value) |
| qboolean | Info_Validate (const char *s) |
| char * | Info_ValueForKey (const char *s, const char *key) |
| float | LittleFloat (float l) |
| int | LittleLong (int l) |
| short | LittleShort (short l) |
| char * | Q_CleanStr (char *string) |
| int | Q_isalpha (int c) |
| int | Q_islower (int c) |
| int | Q_isprint (int c) |
| int | Q_isupper (int c) |
| int | Q_PrintStrlen (const char *string) |
| void | Q_strcat (char *dest, int size, const char *src) |
| int | Q_stricmp (const char *s1, const char *s2) |
| int | Q_stricmpn (const char *s1, const char *s2, int n) |
| char * | Q_strlwr (char *s1) |
| int | Q_strncmp (const char *s1, const char *s2, int n) |
| void | Q_strncpyz (char *dest, const char *src, int destsize) |
| char * | Q_strrchr (const char *string, int c) |
| char * | Q_strupr (char *s1) |
| void | Swap_Init (void) |
| char *QDECL | va (char *format,...) |
|
|
Definition at line 36 of file q_shared.h. |
|
|
Definition at line 35 of file q_shared.h. |
|
|
Definition at line 296 of file q_shared.h. |
|
|
Definition at line 215 of file q_shared.h. |
|
|
Definition at line 530 of file q_shared.h. |
|
|
Definition at line 82 of file q_shared.h. |
|
|
Definition at line 234 of file q_shared.h. |
|
|
Definition at line 254 of file q_shared.h. |
|
|
Definition at line 253 of file q_shared.h. |
|
|
Definition at line 255 of file q_shared.h. |
|
|
Definition at line 275 of file q_shared.h. |
|
|
Definition at line 261 of file q_shared.h. |
|
|
Definition at line 259 of file q_shared.h. |
|
|
Definition at line 230 of file q_shared.h. |
|
|
Definition at line 258 of file q_shared.h. |
|
|
Definition at line 249 of file q_shared.h. |
|
|
Definition at line 250 of file q_shared.h. |
|
|
Definition at line 251 of file q_shared.h. |
|
|
Definition at line 235 of file q_shared.h. |
|
|
Definition at line 231 of file q_shared.h. |
|
|
Definition at line 227 of file q_shared.h. |
|
|
Definition at line 243 of file q_shared.h. |
|
|
Definition at line 291 of file q_shared.h. |
|
|
Definition at line 293 of file q_shared.h. |
|
|
Definition at line 294 of file q_shared.h. |
|
|
Definition at line 292 of file q_shared.h. |
|
|
Definition at line 297 of file q_shared.h. |
|
|
Definition at line 32 of file q_shared.h. |
|
|
Definition at line 87 of file q_shared.h. |
|
|
Definition at line 245 of file q_shared.h. |
|
|
Definition at line 239 of file q_shared.h. |
|
|
Definition at line 304 of file q_shared.h. |
|
|
Definition at line 307 of file q_shared.h. |
|
|
Definition at line 300 of file q_shared.h. |
|
|
Definition at line 306 of file q_shared.h. |
|
|
Definition at line 302 of file q_shared.h. |
|
|
Definition at line 305 of file q_shared.h. |
|
|
Definition at line 308 of file q_shared.h. |
|
|
Definition at line 299 of file q_shared.h. |
|
|
Definition at line 309 of file q_shared.h. |
|
|
Definition at line 301 of file q_shared.h. |
|
|
Definition at line 303 of file q_shared.h. |
|
|
Definition at line 244 of file q_shared.h. |
|
|
Definition at line 213 of file q_shared.h. |
|
|
Definition at line 220 of file q_shared.h. |
|
|
Definition at line 219 of file q_shared.h. |
|
|
Definition at line 217 of file q_shared.h. |
|
|
Definition at line 218 of file q_shared.h. |
|
|
Definition at line 264 of file q_shared.h. 00264 {
00265 EXEC_NOW, // don't return until completed, a VM should NEVER use this,
00266 // because some commands might cause the VM to be unloaded...
00267 EXEC_INSERT, // insert at current position, but don't run yet
00268 EXEC_APPEND // add to end of the command buffer (normal case)
00269 } cbufExec_t;
|
|
|
Definition at line 280 of file q_shared.h. 00280 {
00281 ERR_NONE,
00282 ERR_FATAL, // exit the entire game with a popup window
00283 ERR_DROP, // print to console and disconnect from game
00284 ERR_DISCONNECT, // don't kill server
00285 ERR_NEED_CD // pop up the need-cd dialog
00286 } errorParm_t;
|
|
|
Definition at line 596 of file q_shared.h. 00596 {
00597 FS_READ,
00598 FS_WRITE,
00599 FS_APPEND,
00600 FS_APPEND_SYNC
00601 } fsMode_t;
|
|
|
Definition at line 603 of file q_shared.h. 00603 {
00604 FS_SEEK_CUR,
00605 FS_SEEK_END,
00606 FS_SEEK_SET
00607 } fsOrigin_t;
|
|
|
Definition at line 222 of file q_shared.h. 00222 {
00223 INVALID_JOINT = -1
00224 } jointHandle_t;
|
|
|
Definition at line 211 of file q_shared.h. 00211 {qfalse, qtrue} qboolean;
|
|
|
Definition at line 1052 of file l_cmd.c. References _BigFloat, b, byte, in, and l. 01053 {
01054 union {byte b[4]; float f;} in, out;
01055
01056 in.f = l;
01057 out.b[0] = in.b[3];
01058 out.b[1] = in.b[2];
01059 out.b[2] = in.b[1];
01060 out.b[3] = in.b[0];
01061
01062 return out.f;
01063 }
|
|
|
Definition at line 1035 of file l_cmd.c. References _BigLong, byte, and l. Referenced by ByteSwapTri(), LoadLBM(), Texture_InitPalette(), TRI_LoadPolysets(), and WriteLBMfile(). 01036 {
01037 byte b1,b2,b3,b4;
01038
01039 b1 = l&255;
01040 b2 = (l>>8)&255;
01041 b3 = (l>>16)&255;
01042 b4 = (l>>24)&255;
01043
01044 return ((int)b1<<24) + ((int)b2<<16) + ((int)b3<<8) + b4;
01045 }
|
|
|
Definition at line 1019 of file l_cmd.c. References _BigShort, byte, and l. Referenced by CL_Connect_f(), CL_GlobalServers_f(), CL_LocalServers_f(), CL_Rcon_f(), CL_RequestAuthorization(), CL_RequestMotd(), CL_ServersResponsePacket(), LoadLBM(), NET_StringToAdr(), SV_Ban_f(), SV_BanNum_f(), SV_GetChallenge(), SV_MasterHeartbeat(), and WriteLBMfile(). 01020 {
01021 byte b1,b2;
01022
01023 b1 = l&255;
01024 b2 = (l>>8)&255;
01025
01026 return (b1<<8) + b2;
01027 }
|
|
||||||||||||
|
Definition at line 43 of file q_shared.cpp. References Com_AddToGrowList(), Com_Allocate(), Com_Dealloc(), Com_DPrintf(), Com_Error(), Com_InitGrowList(), growList_t::currentElements, data, growList_t::elements, ERR_DROP, ERR_FATAL, growList_t::maxElements, and memcpy(). Referenced by Com_AddToGrowList(). 00043 {
00044 void **old;
00045
00046 if ( list->currentElements != list->maxElements ) {
00047 list->elements[list->currentElements] = data;
00048 return list->currentElements++;
00049 }
00050
00051 // grow, reallocate and move
00052 old = list->elements;
00053
00054 if ( list->maxElements < 0 ) {
00055 Com_Error( ERR_FATAL, "Com_AddToGrowList: maxElements = %i", list->maxElements );
00056 }
00057
00058 if ( list->maxElements == 0 ) {
00059 // initialize the list to hold 100 elements
00060 Com_InitGrowList( list, 100 );
00061 return Com_AddToGrowList( list, data );
00062 }
00063
00064 list->maxElements *= 2;
00065
00066 Com_DPrintf( "Resizing growlist to %i maxElements\n", list->maxElements );
00067
00068 list->elements = (void **)Com_Allocate( list->maxElements * sizeof( void * ) );
00069
00070 if ( !list->elements ) {
00071 Com_Error( ERR_DROP, "Growlist alloc failed" );
00072 }
00073
00074 memcpy( list->elements, old, list->currentElements * sizeof( void * ) );
00075
00076 Com_Dealloc( old );
00077
00078 return Com_AddToGrowList( list, data );
00079 }
|
Here is the call graph for this function:

|
|
Definition at line 58 of file q_parse.cpp. References Com_Error(), ERR_FATAL, parseInfo_t::lines, MAX_PARSE_INFO, parseInfo_t::parseFile, parseInfo, parseInfoNum, pi, and Q_strncpyz(). Referenced by idCameraDef::load(). 00058 {
00059 if ( parseInfoNum == MAX_PARSE_INFO - 1 ) {
00060 Com_Error( ERR_FATAL, "Com_BeginParseSession: session overflow" );
00061 }
00062 parseInfoNum++;
00063 pi = &parseInfo[parseInfoNum];
00064
00065 pi->lines = 1;
00066 Q_strncpyz( pi->parseFile, filename, sizeof( pi->parseFile ) );
00067 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 26 of file q_shared.c. References value. Referenced by ArenaServers_MenuInit(), PlayerSettings_SetMenuItems(), Preferences_SetMenuItems(), Punkbuster_ConfirmDisable(), Punkbuster_ConfirmEnable(), ServerOptions_MenuInit(), ServerOptions_SetMenuItems(), ServerOptions_Start(), UI_AddBotsMenu_Init(), UI_DrawHandicap(), UI_Handicap_HandleKey(), UI_OwnerDrawWidth(), UI_RunMenuScript(), and UI_SPSkillMenu_Init(). 00026 {
00027 if ( value < min ) {
00028 return min;
00029 }
00030 if ( value > max ) {
00031 return max;
00032 }
00033 return value;
00034 }
|
|
||||||||||||||||
|
Definition at line 285 of file q_shared.cpp. References Com_sprintf(), Q_strncpyz(), src, and strlen(). 00285 {
00286 char oldPath[MAX_QPATH];
00287 char *src;
00288
00289 //
00290 // if path doesn't have a .EXT, append extension
00291 // (extension should include the .)
00292 //
00293 src = path + strlen(path) - 1;
00294
00295 while (*src != '/' && src != path) {
00296 if ( *src == '.' ) {
00297 return; // it has an extension
00298 }
00299 src--;
00300 }
00301
00302 Q_strncpyz( oldPath, path, sizeof( oldPath ) );
00303 Com_sprintf( path, maxSize, "%s%s", oldPath, extension );
00304 }
|
Here is the call graph for this function:

|
||||||||||||
Here is the call graph for this function:

|
|
Definition at line 74 of file q_parse.cpp. References Com_Error(), ERR_FATAL, parseInfo, parseInfoNum, and pi. 00074 {
00075 if ( parseInfoNum == 0 ) {
00076 Com_Error( ERR_FATAL, "Com_EndParseSession: session underflow" );
00077 }
00078 parseInfoNum--;
00079 pi = &parseInfo[parseInfoNum];
00080 }
|
Here is the call graph for this function:

|
||||||||||||||||
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 147 of file q_shared.cpp. References Com_StringContains(), i, name, ptr(), strlen(), and toupper(). Referenced by Cmd_List_f(), Com_FilterPath(), and Cvar_List_f(). 00148 {
00149 char buf[MAX_TOKEN_CHARS];
00150 const char *ptr;
00151 int i, found;
00152
00153 while(*filter) {
00154 if (*filter == '*') {
00155 filter++;
00156 for (i = 0; *filter; i++) {
00157 if (*filter == '*' || *filter == '?') break;
00158 buf[i] = *filter;
00159 filter++;
00160 }
00161 buf[i] = '\0';
00162 if (strlen(buf)) {
00163 ptr = Com_StringContains(name, buf, casesensitive);
00164 if (!ptr) return qfalse;
00165 name = ptr + strlen(buf);
00166 }
00167 }
00168 else if (*filter == '?') {
00169 filter++;
00170 name++;
00171 }
00172 else if (*filter == '[' && *(filter+1) == '[') {
00173 filter++;
00174 }
00175 else if (*filter == '[') {
00176 filter++;
00177 found = qfalse;
00178 while(*filter && !found) {
00179 if (*filter == ']' && *(filter+1) != ']') break;
00180 if (*(filter+1) == '-' && *(filter+2) && (*(filter+2) != ']' || *(filter+3) == ']')) {
00181 if (casesensitive) {
00182 if (*name >= *filter && *name <= *(filter+2)) found = qtrue;
00183 }
00184 else {
00185 if (toupper(*name) >= toupper(*filter) &&
00186 toupper(*name) <= toupper(*(filter+2))) found = qtrue;
00187 }
00188 filter += 3;
00189 }
00190 else {
00191 if (casesensitive) {
00192 if (*filter == *name) found = qtrue;
00193 }
00194 else {
00195 if (toupper(*filter) == toupper(*name)) found = qtrue;
00196 }
00197 filter++;
00198 }
00199 }
00200 if (!found) return qfalse;
00201 while(*filter) {
00202 if (*filter == ']' && *(filter+1) != ']') break;
00203 filter++;
00204 }
00205 filter++;
00206 name++;
00207 }
00208 else {
00209 if (casesensitive) {
00210 if (*filter != *name) return qfalse;
00211 }
00212 else {
00213 if (toupper(*filter) != toupper(*name)) return qfalse;
00214 }
00215 filter++;
00216 name++;
00217 }
00218 }
00219 return qtrue;
00220 }
|
Here is the call graph for this function:

|
|
Definition at line 87 of file q_parse.cpp. References parseInfo_t::lines, and pi.
|
|
||||||||||||
|
Definition at line 81 of file q_shared.cpp. References Com_Error(), growList_t::currentElements, growList_t::elements, and ERR_DROP. 00081 {
00082 if ( index < 0 || index >= list->currentElements ) {
00083 Com_Error( ERR_DROP, "Com_GrowListElement: %i out of range of %i",
00084 index, list->currentElements );
00085 }
00086 return list->elements[index];
00087 }
|
Here is the call graph for this function:

|
|
Definition at line 229 of file q_shared.cpp. References FILE_HASH_SIZE, i, and tolower(). 00229 {
00230 int i;
00231 long hash;
00232 char letter;
00233
00234 hash = 0;
00235 i = 0;
00236 while (fname[i] != '\0') {
00237 letter = tolower(fname[i]);
00238 if (letter =='.') break; // don't include extension
00239 if (letter =='\\') letter = '/'; // damn path names
00240 hash+=(long)(letter)*(i+119);
00241 i++;
00242 }
00243 hash &= (FILE_HASH_SIZE-1);
00244 return hash;
00245 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 89 of file q_shared.cpp. References growList_t::currentElements, growList_t::elements, and i. 00089 {
00090 int i;
00091
00092 for ( i = 0 ; i < list->currentElements ; i++ ) {
00093 if ( list->elements[i] == element ) {
00094 return i;
00095 }
00096 }
00097 return -1;
00098 }
|
|
||||||||||||
|
Definition at line 37 of file q_shared.cpp. References Com_Allocate(), growList_t::currentElements, growList_t::elements, and growList_t::maxElements. Referenced by Com_AddToGrowList(). 00037 {
00038 list->maxElements = maxElements;
00039 list->currentElements = 0;
00040 list->elements = (void **)Com_Allocate( list->maxElements * sizeof( void * ) );
00041 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 390 of file q_parse.cpp. References Com_Parse(), Com_ScriptError(), Com_ScriptWarning(), match(), strcmp(), and token. Referenced by Com_Parse1DMatrix(), Com_Parse2DMatrix(), Com_Parse3DMatrix(), idSplinePosition::parse(), idInterpolatedPosition::parse(), idFixedPosition::parse(), idCameraFOV::parse(), idCameraEvent::parse(), and idCameraDef::parse(). 00390 {
00391 const char *token;
00392
00393 token = Com_Parse( buf_p );
00394 if ( strcmp( token, match ) ) {
00395 if (warning) {
00396 Com_ScriptWarning( "MatchToken: %s != %s", token, match );
00397 } else {
00398 Com_ScriptError( "MatchToken: %s != %s", token, match );
00399 }
00400 }
00401 }
|
Here is the call graph for this function:

|
|
Definition at line 362 of file q_parse.cpp. References Com_ParseExt(), pi, qtrue, parseInfo_t::token, and parseInfo_t::ungetToken. Referenced by Com_MatchToken(), Com_Parse1DMatrix(), Com_ParseFloat(), Com_ParseInfos(), Com_ParseInt(), Com_SkipBracedSection(), idSplinePosition::parse(), idInterpolatedPosition::parse(), idFixedPosition::parse(), idCameraFOV::parse(), idCameraEvent::parse(), idCameraDef::parse(), idSplineList::parse(), and idCameraPosition::parseToken(). 00362 {
00363 if ( pi->ungetToken ) {
00364 pi->ungetToken = qfalse;
00365 return pi->token;
00366 }
00367 return Com_ParseExt( data_p, qtrue );
00368 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 498 of file q_parse.cpp. References atof(), Com_MatchToken(), Com_Parse(), i, m, and token. Referenced by Com_Parse2DMatrix(), idInterpolatedPosition::parse(), idFixedPosition::parse(), and idSplineList::parse(). 00498 {
00499 const char *token;
00500 int i;
00501
00502 Com_MatchToken( buf_p, "(" );
00503
00504 for (i = 0 ; i < x ; i++) {
00505 token = Com_Parse(buf_p);
00506 m[i] = atof(token);
00507 }
00508
00509 Com_MatchToken( buf_p, ")" );
00510 }
|
Here is the call graph for this function:

|
||||||||||||||||||||
|
Definition at line 512 of file q_parse.cpp. References Com_MatchToken(), Com_Parse1DMatrix(), i, m, and x. Referenced by Com_Parse3DMatrix(). 00512 {
00513 int i;
00514
00515 Com_MatchToken( buf_p, "(" );
00516
00517 for (i = 0 ; i < y ; i++) {
00518 Com_Parse1DMatrix (buf_p, x, m + i * x);
00519 }
00520
00521 Com_MatchToken( buf_p, ")" );
00522 }
|
Here is the call graph for this function:

|
||||||||||||||||||||||||
|
Definition at line 524 of file q_parse.cpp. References Com_MatchToken(), Com_Parse2DMatrix(), i, m, x, and y. 00524 {
00525 int i;
00526
00527 Com_MatchToken( buf_p, "(" );
00528
00529 for (i = 0 ; i < z ; i++) {
00530 Com_Parse2DMatrix (buf_p, y, x, m + i * x*y);
00531 }
00532
00533 Com_MatchToken( buf_p, ")" );
00534 }
|
Here is the call graph for this function:

|
|
Definition at line 476 of file q_parse.cpp. References atof(), Com_Parse(), and token. Referenced by idCameraDef::parse(). 00476 {
00477 const char *token;
00478
00479 token = Com_Parse( buf_p );
00480 if ( !token[0] ) {
00481 return 0;
00482 }
00483 return atof( token );
00484 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 420 of file q_shared.cpp. References Com_Parse(), Com_ParseOnLine(), Com_Printf(), count, Info_SetValueForKey(), Q_strncpyz(), strcmp(), and token. 00420 {
00421 const char *token;
00422 int count;
00423 char key[MAX_TOKEN_CHARS];
00424
00425 count = 0;
00426
00427 while ( 1 ) {
00428 token = Com_Parse( &buf );
00429 if ( !token[0] ) {
00430 break;
00431 }
00432 if ( strcmp( token, "{" ) ) {
00433 Com_Printf( "Missing { in info file\n" );
00434 break;
00435 }
00436
00437 if ( count == max ) {
00438 Com_Printf( "Max infos exceeded\n" );
00439 break;
00440 }
00441
00442 infos[count][0] = 0;
00443 while ( 1 ) {
00444 token = Com_Parse( &buf );
00445 if ( !token[0] ) {
00446 Com_Printf( "Unexpected end of info file\n" );
00447 break;
00448 }
00449 if ( !strcmp( token, "}" ) ) {
00450 break;
00451 }
00452 Q_strncpyz( key, token, sizeof( key ) );
00453
00454 token = Com_ParseOnLine( &buf );
00455 if ( !token[0] ) {
00456 token = "<NULL>";
00457 }
00458 Info_SetValueForKey( infos[count], key, token );
00459 }
00460 count++;
00461 }
00462
00463 return count;
00464 }
|
Here is the call graph for this function:

|
|
Definition at line 486 of file q_parse.cpp. References atof(), atoi, Com_Parse(), and token. 00486 {
00487 const char *token;
00488
00489 token = Com_Parse( buf_p );
00490 if ( !token[0] ) {
00491 return 0;
00492 }
00493 return atoi( token );
00494 }
|
Here is the call graph for this function:

|
|
Definition at line 375 of file q_parse.cpp. References Com_ParseExt(), pi, qfalse, parseInfo_t::token, and parseInfo_t::ungetToken. Referenced by Com_ParseInfos(), Com_ParseRestOfLine(), idSplinePosition::parse(), idInterpolatedPosition::parse(), idFixedPosition::parse(), idCameraFOV::parse(), idCameraEvent::parse(), and idSplineList::parse(). 00375 {
00376 if ( pi->ungetToken ) {
00377 pi->ungetToken = qfalse;
00378 return pi->token;
00379 }
00380 return Com_ParseExt( data_p, qfalse );
00381 }
|
Here is the call graph for this function:

|
|
Definition at line 456 of file q_parse.cpp. References Com_ParseOnLine(), line, Q_strcat(), and token. 00456 {
00457 static char line[MAX_TOKEN_CHARS];
00458 const char *token;
00459
00460 line[0] = 0;
00461 while( 1 ) {
00462 token = Com_ParseOnLine( data_p );
00463 if ( !token[0] ) {
00464 break;
00465 }
00466 if ( line[0] ) {
00467 Q_strcat( line, sizeof(line), " " );
00468 }
00469 Q_strcat( line, sizeof(line), token );
00470 }
00471
00472 return line;
00473 }
|
Here is the call graph for this function:

|
||||||||||||
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 98 of file q_parse.cpp. References Com_Error(), ERR_DROP, parseInfo_t::lines, parseInfo_t::parseFile, pi, string(), va_end, va_list, va_start, and vsprintf(). Referenced by Com_MatchToken(), and Com_UngetToken(). 00098 {
00099 va_list argptr;
00100 char string[32000];
00101
00102 va_start( argptr, msg );
00103 vsprintf( string, msg,argptr );
00104 va_end( argptr );
00105
00106 Com_Error( ERR_DROP, "File %s, line %i: %s", pi->parseFile, pi->lines, string );
00107 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 109 of file q_parse.cpp. References Com_Printf(), parseInfo_t::lines, parseInfo_t::parseFile, pi, string(), va_end, va_list, va_start, and vsprintf(). Referenced by Com_MatchToken(). 00109 {
00110 va_list argptr;
00111 char string[32000];
00112
00113 va_start( argptr, msg );
00114 vsprintf( string, msg,argptr );
00115 va_end( argptr );
00116
00117 Com_Printf( "File %s, line %i: %s", pi->parseFile, pi->lines, string );
00118 }
|
Here is the call graph for this function:

|
|
Definition at line 413 of file q_parse.cpp. References Com_Parse(), program(), and token. 00413 {
00414 const char *token;
00415 int depth;
00416
00417 depth = 0;
00418 do {
00419 token = Com_Parse( program );
00420 if( token[1] == 0 ) {
00421 if( token[0] == '{' ) {
00422 depth++;
00423 }
00424 else if( token[0] == '}' ) {
00425 depth--;
00426 }
00427 }
00428 } while( depth && *program );
00429 }
|
Here is the call graph for this function:

|
|
Definition at line 253 of file q_shared.cpp. 00254 {
00255 char *last;
00256
00257 last = pathname;
00258 while (*pathname)
00259 {
00260 if (*pathname=='/')
00261 last = pathname+1;
00262 pathname++;
00263 }
00264 return last;
00265 }
|
|
|
Definition at line 436 of file q_parse.cpp. References c, data, parseInfo_t::lines, p, and pi. 00436 {
00437 const char *p;
00438 int c;
00439
00440 p = *data;
00441 while ( (c = *p++) != 0 ) {
00442 if ( c == '\n' ) {
00443 pi->lines++;
00444 break;
00445 }
00446 }
00447
00448 *data = p;
00449 }
|
|
||||||||||||||||||||
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 118 of file q_shared.cpp. References i, j, strlen(), and toupper(). Referenced by Com_Filter(). 00118 {
00119 int len, i, j;
00120
00121 len = strlen(str1) - strlen(str2);
00122 for (i = 0; i <= len; i++, str1++) {
00123 for (j = 0; str2[j]; j++) {
00124 if (casesensitive) {
00125 if (str1[j] != str2[j]) {
00126 break;
00127 }
00128 }
00129 else {
00130 if (toupper(str1[j]) != toupper(str2[j])) {
00131 break;
00132 }
00133 }
00134 }
00135 if (!str2[j]) {
00136 return str1;
00137 }
00138 }
00139 return NULL;
00140 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 272 of file q_shared.cpp. References in.
|
|
|
Definition at line 129 of file q_parse.cpp. References Com_ScriptError(), pi, and parseInfo_t::ungetToken. 00129 {
00130 if ( pi->ungetToken ) {
00131 Com_ScriptError( "UngetToken called twice" );
00132 }
00133 pi->ungetToken = qtrue;
00134 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 792 of file q_shared.cpp. Referenced by CL_SystemInfoChanged(), ServerInfo_MenuDraw(), and UI_ServerInfoMenu(). 00792 {
00793 char *o;
00794 const char *s;
00795
00796 s = *head;
00797
00798 if ( *s == '\\' ) {
00799 s++;
00800 }
00801 key[0] = 0;
00802 value[0] = 0;
00803
00804 o = key;
00805 while ( *s != '\\' ) {
00806 if ( !*s ) {
00807 *o = 0;
00808 *head = s;
00809 return;
00810 }
00811 *o++ = *s++;
00812 }
00813 *o = 0;
00814 s++;
00815
00816 o = value;
00817 while ( *s != '\\' && *s ) {
00818 *o++ = *s++;
00819 }
00820 *o = 0;
00821
00822 *head = s;
00823 }
|
|
||||||||||||
|
Definition at line 1032 of file q_shared.c. References Com_Error(), ERR_DROP, s, strchr(), strcmp(), strcpy(), and strlen(). Referenced by Info_SetValueForKey(). 01032 {
01033 char *start;
01034 char pkey[MAX_INFO_KEY];
01035 char value[MAX_INFO_VALUE];
01036 char *o;
01037
01038 if ( strlen( s ) >= MAX_INFO_STRING ) {
01039 Com_Error( ERR_DROP, "Info_RemoveKey: oversize infostring" );
01040 }
01041
01042 if (strchr (key, '\\')) {
01043 return;
01044 }
01045
01046 while (1)
01047 {
01048 start = s;
01049 if (*s == '\\')
01050 s++;
01051 o = pkey;
01052 while (*s != '\\')
01053 {
01054 if (!*s)
01055 return;
01056 *o++ = *s++;
01057 }
01058 *o = 0;
01059 s++;
01060
01061 o = value;
01062 while (*s != '\\' && *s)
01063 {
01064 if (!*s)
01065 return;
01066 *o++ = *s++;
01067 }
01068 *o = 0;
01069
01070 if (!strcmp (key, pkey) )
01071 {
01072 strcpy (start, s); // remove this part
01073 return;
01074 }
01075
01076 if (!*s)
01077 return;
01078 }
01079
01080 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 1165 of file q_shared.c. References Com_Error(), Com_Printf(), Com_sprintf(), ERR_DROP, Info_RemoveKey(), s, strcat(), strchr(), strcpy(), strlen(), and value. Referenced by ArenaServers_InsertFavorites(), BotDeathmatchAI(), BotSetUserInfo(), CL_CheckForResend(), CL_RequestMotd(), CL_ServerInfoPacket(), Cmd_TeamTask_f(), Com_ParseInfos(), Cvar_InfoString(), G_AddBot(), G_LoadArenas(), G_ParseInfos(), LAN_GetServerInfo(), SV_DirectConnect(), SV_RankNewGameCBF(), SV_UserinfoChanged(), SVC_Info(), SVC_Status(), UI_LoadArenas(), UI_LogAwardData(), UI_ParseInfos(), UI_SetBestScore(), UI_ShowTierVideo(), UI_SPUnlock_f(), and UI_SPUnlockMedals_f(). 01165 {
01166 char newi[MAX_INFO_STRING];
01167
01168 if ( strlen( s ) >= MAX_INFO_STRING ) {
01169 Com_Error( ERR_DROP, "Info_SetValueForKey: oversize infostring" );
01170 }
01171
01172 if (strchr (key, '\\') || strchr (value, '\\'))
01173 {
01174 Com_Printf ("Can't use keys or values with a \\\n");
01175 return;
01176 }
01177
01178 if (strchr (key, ';') || strchr (value, ';'))
01179 {
01180 Com_Printf ("Can't use keys or values with a semicolon\n");
01181 return;
01182 }
01183
01184 if (strchr (key, '\"') || strchr (value, '\"'))
01185 {
01186 Com_Printf ("Can't use keys or values with a \"\n");
01187 return;
01188 }
01189
01190 Info_RemoveKey (s, key);
01191 if (!value || !strlen(value))
01192 return;
01193
01194 Com_sprintf (newi, sizeof(newi), "\\%s\\%s", key, value);
01195
01196 if (strlen(newi) + strlen(s) > MAX_INFO_STRING)
01197 {
01198 Com_Printf ("Info string length exceeded\n");
01199 return;
01200 }
01201
01202 strcat (newi, s);
01203 strcpy (s, newi);
01204 }
|
Here is the call graph for this function:

|
|
Definition at line 1148 of file q_shared.c. References qboolean, s, and strchr(). Referenced by ClientUserinfoChanged(). 01148 {
01149 if ( strchr( s, '\"' ) ) {
01150 return qfalse;
01151 }
01152 if ( strchr( s, ';' ) ) {
01153 return qfalse;
01154 }
01155 return qtrue;
01156 }
|
Here is the call graph for this function:

|
||||||||||||
Here is the call graph for this function:

|
|
Definition at line 1065 of file l_cmd.c. References _LittleFloat, and l. Referenced by AAS_SwapAASData(), CMod_LoadPatches(), CMod_LoadPlanes(), CMod_LoadSubmodels(), HL_SwapBSPFile(), ParseFace(), ParseFlare(), ParseMesh(), ParseTriSurf(), Q1_SwapBSPFile(), Q2_SwapBSPFile(), Q3_SwapBSPFile(), R_LoadMD3(), R_LoadMD4(), R_LoadPlanes(), R_LoadSubmodels(), Sin_SwapBSPFile(), and SwapBSPFile(). 01066 {
01067 return l;
01068 }
|
|
|
|
Definition at line 1029 of file l_cmd.c. References _LittleShort, and l. Referenced by AAS_SwapAASData(), FGetLittleShort(), HL_SwapBSPFile(), LoadBMP(), LoadPCX(), LoadTGA(), LoadTGABuffer(), MSG_ReadBits(), MSG_WriteBits(), Q1_SwapBSPFile(), Q2_SwapBSPFile(), R_LoadMD3(), ResampleSfx(), ResampleSfxRaw(), S_ByteSwapRawSamples(), Sin_SwapBSPFile(), unzlocal_getShort(), and WritePCXfile(). 01030 {
01031 return l;
01032 }
|
|
|
|
Definition at line 677 of file q_shared.c. References c. Referenced by MenuField_Key(), Rankings_DrawName(), and Rankings_DrawPassword(). 00678 {
00679 if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
00680 return ( 1 );
00681 return ( 0 );
00682 }
|
|
|
Definition at line 663 of file q_shared.c. References c. Referenced by MenuField_Key().
|
|
|
Definition at line 656 of file q_shared.c. References c. Referenced by ScrollList_Key().
|
|
|
Definition at line 670 of file q_shared.c. References c. Referenced by MenuField_Key(), and ScrollList_Key().
|
|
|
Definition at line 825 of file q_shared.c. References p, and Q_IsColorString. Referenced by CG_DrawAttacker(), and Field_VariableSizeDraw(). 00825 {
00826 int len;
00827 const char *p;
00828
00829 if( !string ) {
00830 return 0;
00831 }
00832
00833 len = 0;
00834 p = string;
00835 while( *p ) {
00836 if( Q_IsColorString( p ) ) {
00837 p += 2;
00838 continue;
00839 }
00840 p++;
00841 len++;
00842 }
00843
00844 return len;
00845 }
|
|
||||||||||||||||
|
Definition at line 814 of file q_shared.c. References Com_Error(), ERR_FATAL, Q_strncpyz(), src, and strlen(). Referenced by BuildShaderStateConfig(), CG_BuildSpectatorString(), CL_SendPureChecksums(), Com_ParseRestOfLine(), Com_Printf(), ConcatRemaining(), Field_CompleteCommand(), FS_ComparePaks(), FS_LoadedPakChecksums(), FS_LoadedPakNames(), FS_LoadedPakPureChecksums(), FS_ReferencedPakChecksums(), FS_ReferencedPakNames(), FS_ReferencedPakPureChecksums(), Item_EnableShowViaCvar(), Item_RunScript(), keyConcatArgs(), PC_Script_Parse(), QGL_Init(), ServerInfo_MenuDraw(), SVC_RemoteCommand(), Sys_DefaultHomePath(), UI_RunMenuScript(), and UpdateIPBans(). 00814 {
00815 int l1;
00816
00817 l1 = strlen( dest );
00818 if ( l1 >= size ) {
00819 Com_Error( ERR_FATAL, "Q_strcat: already overflowed" );
00820 }
00821 Q_strncpyz( dest + l1, src, size - l1 );
00822 }
|
Here is the call graph for this function:

|
||||||||||||
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 727 of file q_shared.c. References n. Referenced by CG_ServerCommand(), Com_AddStartupCommands(), FindMatches(), FS_GetModList(), FS_ListFilteredFiles(), FS_ReferencedPakChecksums(), FS_ReferencedPakNames(), ParseDeform(), ParseShader(), PlayerModel_BuildList(), PrintMatches(), Q_stricmp(), Q_stristr(), SV_Map_f(), and UI_BuildQ3Model_List(). 00727 {
00728 int c1, c2;
00729
00730 // bk001129 - moved in 1.17 fix not in id codebase
00731 if ( s1 == NULL ) {
00732 if ( s2 == NULL )
00733 return 0;
00734 else
00735 return -1;
00736 }
00737 else if ( s2==NULL )
00738 return 1;
00739
00740
00741
00742 do {
00743 c1 = *s1++;
00744 c2 = *s2++;
00745
00746 if (!n--) {
00747 return 0; // strings are equal until end point
00748 }
00749
00750 if (c1 != c2) {
00751 if (c1 >= 'a' && c1 <= 'z') {
00752 c1 -= ('a' - 'A');
00753 }
00754 if (c2 >= 'a' && c2 <= 'z') {
00755 c2 -= ('a' - 'A');
00756 }
00757 if (c1 != c2) {
00758 return c1 < c2 ? -1 : 1;
00759 }
00760 }
00761 } while (c1);
00762
00763 return 0; // strings are equal
00764 }
|
|
|
Definition at line 790 of file q_shared.c. Referenced by FS_LoadZipFile(), GLimp_Init(), GLW_LoadOpenGL(), InitOpenGL(), R_LoadMD3(), R_LoadMD4(), and RE_RegisterSkin(). 00790 {
00791 char *s;
00792
00793 s = s1;
00794 while ( *s ) {
00795 *s = tolower(*s);
00796 s++;
00797 }
00798 return s1;
00799 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 766 of file q_shared.c. References n. Referenced by CheckTeamVote(), CL_ConnectionlessPacket(), CL_ConsolePrint(), R_LoadEntities(), SpecifyLeague_Event(), SV_ConnectionlessPacket(), and SV_ReplacePendingServerCommands(). 00766 {
00767 int c1, c2;
00768
00769 do {
00770 c1 = *s1++;
00771 c2 = *s2++;
00772
00773 if (!n--) {
00774 return 0; // strings are equal until end point
00775 }
00776
00777 if (c1 != c2) {
00778 return c1 < c2 ? -1 : 1;
00779 }
00780 } while (c1);
00781
00782 return 0; // strings are equal
00783 }
|
|
||||||||||||||||
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 684 of file q_shared.c. References s. Referenced by CG_LoadingClient(), PlayerIcon(), PlayerIntroSound(), S_Play_f(), and ServerPlayerIcon(). 00685 {
00686 char cc = c;
00687 char *s;
00688 char *sp=(char *)0;
00689
00690 s = (char*)string;
00691
00692 while (*s)
00693 {
00694 if (*s == cc)
00695 sp = s;
00696 s++;
00697 }
00698 if (cc == 0)
00699 sp = s;
00700
00701 return sp;
00702 }
|
|
|
Definition at line 801 of file q_shared.c. Referenced by ArenaServers_Insert(), BindingFromName(), Controls_DrawKeyBinding(), Demos_MenuInit(), LoadConfig_MenuInit(), PlayerModel_PicEvent(), PlayerModel_SetMenuItems(), ServerOptions_SetMenuItems(), StartServer_Cache(), StartServer_GametypeEvent(), StartServer_Update(), UI_LoadDemos(), UI_LoadMovies(), UI_SPLevelMenu_MenuDraw(), and UI_SPLevelMenu_SetMenuArena(). 00801 {
00802 char *s;
00803
00804 s = s1;
00805 while ( *s ) {
00806 *s = toupper(*s);
00807 s++;
00808 }
00809 return s1;
00810 }
|
Here is the call graph for this function:

|
|
Definition at line 389 of file q_shared.cpp. References _BigFloat, _BigLong, _BigShort, _LittleFloat, _LittleLong, _LittleShort, and byte. 00390 {
00391 byte swaptest[2] = {1,0};
00392
00393 // set the byte swapping variables in a portable manner
00394 if ( *(short *)swaptest == 1)
00395 {
00396 _BigShort = ShortSwap;
00397 _LittleShort = ShortNoSwap;
00398 _BigLong = LongSwap;
00399 _LittleLong = LongNoSwap;
00400 _BigFloat = FloatSwap;
00401 _LittleFloat = FloatNoSwap;
00402 }
00403 else
00404 {
00405 _BigShort = ShortNoSwap;
00406 _LittleShort = ShortSwap;
00407 _BigLong = LongNoSwap;
00408 _LittleLong = LongSwap;
00409 _BigFloat = FloatNoSwap;
00410 _LittleFloat = FloatSwap;
00411 }
00412
00413 }
|
|
||||||||||||
Here is the call graph for this function:

1.3.9.1