summaryrefslogtreecommitdiff
path: root/src/qcommon/qcommon.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qcommon/qcommon.h')
-rw-r--r--src/qcommon/qcommon.h45
1 files changed, 30 insertions, 15 deletions
diff --git a/src/qcommon/qcommon.h b/src/qcommon/qcommon.h
index 09132159..d09ee299 100644
--- a/src/qcommon/qcommon.h
+++ b/src/qcommon/qcommon.h
@@ -416,6 +416,9 @@ void Cmd_RemoveCommand( const char *cmd_name );
typedef void (*completionFunc_t)( char *args, int argNum );
+// don't allow VMs to remove system commands
+void Cmd_RemoveCommandSafe( const char *cmd_name );
+
void Cmd_CommandCompletion( void(*callback)(const char *s) );
// callback with each valid string
void Cmd_SetCommandCompletionFunc( const char *command,
@@ -431,6 +434,7 @@ char *Cmd_ArgsFrom( int arg );
void Cmd_ArgsBuffer( char *buffer, int bufferLength );
void Cmd_LiteralArgsBuffer( char *buffer, int bufferLength );
char *Cmd_Cmd (void);
+void Cmd_Args_Sanitize( void );
// The functions that execute commands get their parameters with these
// functions. Cmd_Argv () will return an empty string, not a NULL
// if arg > argc, so string operations are allways safe.
@@ -489,11 +493,15 @@ void Cvar_Update( vmCvar_t *vmCvar );
void Cvar_Set( const char *var_name, const char *value );
// will create the variable with no flags if it doesn't exist
+void Cvar_SetSafe( const char *var_name, const char *value );
+// sometimes we set variables from an untrusted source: fail if flags & CVAR_PROTECTED
+
void Cvar_SetLatched( const char *var_name, const char *value);
// don't set the cvar immediately
void Cvar_SetValue( const char *var_name, float value );
-// expands value to a string and calls Cvar_Set
+void Cvar_SetValueSafe( const char *var_name, float value );
+// expands value to a string and calls Cvar_Set/Cvar_SetSafe
float Cvar_VariableValue( const char *var_name );
int Cvar_VariableIntegerValue( const char *var_name );
@@ -561,8 +569,6 @@ issues.
#define FS_UI_REF 0x02
#define FS_CGAME_REF 0x04
#define FS_QAGAME_REF 0x08
-// number of id paks that will never be autodownloaded from baseq3
-#define NUM_ID_PAKS 9
#define MAX_FILE_HANDLES 64
@@ -595,6 +601,9 @@ void FS_FreeFileList( char **list );
qboolean FS_FileExists( const char *file );
qboolean FS_CreatePath (char *OSPath);
+
+char *FS_FindDll( const char *filename );
+
char *FS_BuildOSPath( const char *base, const char *game, const char *qpath );
qboolean FS_CompareZipChecksum(const char *zipfile);
@@ -605,6 +614,7 @@ int FS_GetModList( char *listbuf, int bufsize );
fileHandle_t FS_FOpenFileWrite( const char *qpath );
fileHandle_t FS_FOpenFileAppend( const char *filename );
+fileHandle_t FS_FCreateOpenPipeFile( const char *filename );
// will properly create any needed paths and deal with seperater character issues
fileHandle_t FS_SV_FOpenFileWrite( const char *filename );
@@ -692,7 +702,6 @@ void FS_PureServerSetLoadedPaks( const char *pakSums, const char *pakNames );
// sole exception of .cfg files.
qboolean FS_CheckDirTraversal(const char *checkdir);
-qboolean FS_idPak( char *pak, char *base );
qboolean FS_ComparePaks( char *neededpaks, int len, qboolean dlstring );
void FS_Rename( const char *from, const char *to );
@@ -701,7 +710,9 @@ void FS_Remove( const char *osPath );
void FS_HomeRemove( const char *homePath );
void FS_FilenameCompletion( const char *dir, const char *ext,
- qboolean stripExt, void(*callback)(const char *s) );
+ qboolean stripExt, void(*callback)(const char *s), qboolean allowNonPureFilesOnDisk );
+
+const char *FS_GetCurrentGameDir(void);
/*
==============================================================
@@ -723,7 +734,7 @@ void Field_Clear( field_t *edit );
void Field_AutoComplete( field_t *edit );
void Field_CompleteKeyname( void );
void Field_CompleteFilename( const char *dir,
- const char *ext, qboolean stripExt );
+ const char *ext, qboolean stripExt, qboolean allowNonPureFilesOnDisk );
void Field_CompleteCommand( char *cmd,
qboolean doCommands, qboolean doCvars );
@@ -754,13 +765,12 @@ typedef enum
typedef enum {
// SE_NONE must be zero
- SE_NONE = 0, // evTime is still valid
- SE_KEY, // evValue is a key code, evValue2 is the down flag
- SE_CHAR, // evValue is an ascii char
- SE_MOUSE, // evValue and evValue2 are reletive signed x / y moves
+ SE_NONE = 0, // evTime is still valid
+ SE_KEY, // evValue is a key code, evValue2 is the down flag
+ SE_CHAR, // evValue is an ascii char
+ SE_MOUSE, // evValue and evValue2 are reletive signed x / y moves
SE_JOYSTICK_AXIS, // evValue is an axis number and evValue2 is the current state (-127 to 127)
- SE_CONSOLE, // evPtr is a char*
- SE_PACKET // evPtr is a netadr_t followed by data bytes to evPtrLength
+ SE_CONSOLE // evPtr is a char*
} sysEventType_t;
typedef struct {
@@ -793,6 +803,7 @@ int Com_Filter(char *filter, char *name, int casesensitive);
int Com_FilterPath(char *filter, char *name, int casesensitive);
int Com_RealTime(qtime_t *qtime);
qboolean Com_SafeMode( void );
+void Com_RunAndTimeServerPacket(netadr_t *evFrom, msg_t *buf);
void Com_StartupVariable( const char *match );
// checks for and removes command line "+set var arg" constructs
@@ -817,6 +828,7 @@ extern cvar_t *com_maxfpsUnfocused;
extern cvar_t *com_minimized;
extern cvar_t *com_maxfpsMinimized;
extern cvar_t *com_altivec;
+extern cvar_t *com_homepath;
// both client and server must agree to pause
extern cvar_t *cl_paused;
@@ -831,7 +843,6 @@ extern int time_frontend;
extern int time_backend; // renderer backend time
extern int com_frameTime;
-extern int com_frameMsec;
extern qboolean com_errorEntered;
@@ -976,6 +987,9 @@ void S_ClearSoundBuffer( void );
void SCR_DebugGraph (float value, int color); // FIXME: move logging to common?
+// AVI files have the start of pixel lines 4 byte-aligned
+#define AVI_LINE_PADDING 4
+
//
// server interface
//
@@ -983,6 +997,7 @@ void SV_Init( void );
void SV_Shutdown( char *finalmsg );
void SV_Frame( int msec );
void SV_PacketEvent( netadr_t from, msg_t *msg );
+int SV_FrameMsec(void);
qboolean SV_GameCommand( void );
@@ -1012,7 +1027,7 @@ typedef enum {
void Sys_Init (void);
// general development dll loading for virtual machine testing
-void * QDECL Sys_LoadDll( const char *name, char *fqpath , intptr_t (QDECL **entryPoint)(int, ...),
+void * QDECL Sys_LoadDll( const char *name, intptr_t (QDECL **entryPoint)(int, ...),
intptr_t (QDECL *systemcalls)(intptr_t, ...) );
void Sys_UnloadDll( void *dllHandle );
@@ -1053,7 +1068,6 @@ cpuFeatures_t Sys_GetProcessorFeatures( void );
void Sys_SetErrorText( const char *text );
void Sys_SendPacket( int length, const void *data, netadr_t to );
-qboolean Sys_GetPacket( netadr_t *net_from, msg_t *net_message );
qboolean Sys_StringToAdr( const char *s, netadr_t *a, netadrtype_t family );
//Does NOT parse port numbers, only base addresses.
@@ -1062,6 +1076,7 @@ qboolean Sys_IsLANAddress (netadr_t adr);
void Sys_ShowIP(void);
qboolean Sys_Mkdir( const char *path );
+FILE *Sys_Mkfifo( const char *ospath );
char *Sys_Cwd( void );
void Sys_SetDefaultInstallPath(const char *path);
char *Sys_DefaultInstallPath(void);