Initial fix for write-strings in HLSDK headers

This commit is contained in:
Alibek Omarov 2023-09-06 05:02:32 +03:00
parent c56b92f9e6
commit c7e0cc3906
2 changed files with 19 additions and 19 deletions

View File

@ -27,8 +27,8 @@
typedef struct cvar_s typedef struct cvar_s
{ {
char *name; const char *name;
char *string; const char *string;
int flags; int flags;
float value; float value;
struct cvar_s *next; struct cvar_s *next;

View File

@ -96,8 +96,8 @@ typedef struct
// Engine hands this to DLLs for functionality callbacks // Engine hands this to DLLs for functionality callbacks
typedef struct enginefuncs_s typedef struct enginefuncs_s
{ {
int (*pfnPrecacheModel) (char* s); int (*pfnPrecacheModel) (const char* s);
int (*pfnPrecacheSound) (char* s); int (*pfnPrecacheSound) (const char* s);
void (*pfnSetModel) (edict_t *e, const char *m); void (*pfnSetModel) (edict_t *e, const char *m);
int (*pfnModelIndex) (const char *m); int (*pfnModelIndex) (const char *m);
int (*pfnModelFrames) (int modelIndex); int (*pfnModelFrames) (int modelIndex);
@ -135,11 +135,11 @@ typedef struct enginefuncs_s
const char *(*pfnTraceTexture) (edict_t *pTextureEntity, const float *v1, const float *v2 ); const char *(*pfnTraceTexture) (edict_t *pTextureEntity, const float *v1, const float *v2 );
void (*pfnTraceSphere) (const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); void (*pfnTraceSphere) (const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr);
void (*pfnGetAimVector) (edict_t* ent, float speed, float *rgflReturn); void (*pfnGetAimVector) (edict_t* ent, float speed, float *rgflReturn);
void (*pfnServerCommand) (char* str); void (*pfnServerCommand) (const char* str);
void (*pfnServerExecute) (void); void (*pfnServerExecute) (void);
void (*pfnClientCommand) (edict_t* pEdict, char* szFmt, ...); void (*pfnClientCommand) (edict_t* pEdict, const char* szFmt, ...);
void (*pfnParticleEffect) (const float *org, const float *dir, float color, float count); void (*pfnParticleEffect) (const float *org, const float *dir, float color, float count);
void (*pfnLightStyle) (int style, char* val); void (*pfnLightStyle) (int style, const char* val);
int (*pfnDecalIndex) (const char *name); int (*pfnDecalIndex) (const char *name);
int (*pfnPointContents) (const float *rgflVector); int (*pfnPointContents) (const float *rgflVector);
void (*pfnMessageBegin) (int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); void (*pfnMessageBegin) (int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);
@ -157,7 +157,7 @@ typedef struct enginefuncs_s
const char* (*pfnCVarGetString) (const char *szVarName); const char* (*pfnCVarGetString) (const char *szVarName);
void (*pfnCVarSetFloat) (const char *szVarName, float flValue); void (*pfnCVarSetFloat) (const char *szVarName, float flValue);
void (*pfnCVarSetString) (const char *szVarName, const char *szValue); void (*pfnCVarSetString) (const char *szVarName, const char *szValue);
void (*pfnAlertMessage) (ALERT_TYPE atype, char *szFmt, ...); void (*pfnAlertMessage) (ALERT_TYPE atype, const char *szFmt, ...);
void (*pfnEngineFprintf) (FILE *pfile, char *szFmt, ...); void (*pfnEngineFprintf) (FILE *pfile, char *szFmt, ...);
void* (*pfnPvAllocEntPrivateData) (edict_t *pEdict, long cb); void* (*pfnPvAllocEntPrivateData) (edict_t *pEdict, long cb);
void* (*pfnPvEntPrivateData) (edict_t *pEdict); void* (*pfnPvEntPrivateData) (edict_t *pEdict);
@ -191,7 +191,7 @@ typedef struct enginefuncs_s
void (*pfnSetView) (const edict_t *pClient, const edict_t *pViewent ); void (*pfnSetView) (const edict_t *pClient, const edict_t *pViewent );
float (*pfnTime) ( void ); float (*pfnTime) ( void );
void (*pfnCrosshairAngle) (const edict_t *pClient, float pitch, float yaw); void (*pfnCrosshairAngle) (const edict_t *pClient, float pitch, float yaw);
byte * (*pfnLoadFileForMe) (char *filename, int *pLength); byte * (*pfnLoadFileForMe) (const char *filename, int *pLength);
void (*pfnFreeFile) (void *buffer); void (*pfnFreeFile) (void *buffer);
void (*pfnEndSection) (const char *pszSectionName); // trigger_endsection void (*pfnEndSection) (const char *pszSectionName); // trigger_endsection
int (*pfnCompareFileTime) (char *filename1, char *filename2, int *iCompare); int (*pfnCompareFileTime) (char *filename1, char *filename2, int *iCompare);
@ -203,12 +203,12 @@ typedef struct enginefuncs_s
void (*pfnRunPlayerMove) (edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec ); void (*pfnRunPlayerMove) (edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec );
int (*pfnNumberOfEntities) (void); int (*pfnNumberOfEntities) (void);
char* (*pfnGetInfoKeyBuffer) (edict_t *e); // passing in NULL gets the serverinfo char* (*pfnGetInfoKeyBuffer) (edict_t *e); // passing in NULL gets the serverinfo
char* (*pfnInfoKeyValue) (char *infobuffer, char *key); char* (*pfnInfoKeyValue) (char *infobuffer, const char *key);
void (*pfnSetKeyValue) (char *infobuffer, char *key, char *value); void (*pfnSetKeyValue) (char *infobuffer, const char *key, const char *value);
void (*pfnSetClientKeyValue) (int clientIndex, char *infobuffer, char *key, char *value); void (*pfnSetClientKeyValue) (int clientIndex, char *infobuffer, const char *key, const char *value);
int (*pfnIsMapValid) (char *filename); int (*pfnIsMapValid) (char *filename);
void (*pfnStaticDecal) ( const float *origin, int decalIndex, int entityIndex, int modelIndex ); void (*pfnStaticDecal) ( const float *origin, int decalIndex, int entityIndex, int modelIndex );
int (*pfnPrecacheGeneric) (char* s); int (*pfnPrecacheGeneric) (const char* s);
int (*pfnGetPlayerUserId) (edict_t *e ); // returns the server assigned userid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients int (*pfnGetPlayerUserId) (edict_t *e ); // returns the server assigned userid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
void (*pfnBuildSoundMsg) (edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); void (*pfnBuildSoundMsg) (edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);
int (*pfnIsDedicatedServer) (void);// is this a dedicated server? int (*pfnIsDedicatedServer) (void);// is this a dedicated server?
@ -230,7 +230,7 @@ typedef struct enginefuncs_s
void (*pfnDeltaSetField) ( struct delta_s *pFields, const char *fieldname ); void (*pfnDeltaSetField) ( struct delta_s *pFields, const char *fieldname );
void (*pfnDeltaUnsetField) ( struct delta_s *pFields, const char *fieldname ); void (*pfnDeltaUnsetField) ( struct delta_s *pFields, const char *fieldname );
void (*pfnDeltaAddEncoder) ( char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); void (*pfnDeltaAddEncoder) ( const char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) );
int (*pfnGetCurrentPlayer) ( void ); int (*pfnGetCurrentPlayer) ( void );
int (*pfnCanSkipPlayer) ( const edict_t *player ); int (*pfnCanSkipPlayer) ( const edict_t *player );
int (*pfnDeltaFindField) ( struct delta_s *pFields, const char *fieldname ); int (*pfnDeltaFindField) ( struct delta_s *pFields, const char *fieldname );
@ -240,7 +240,7 @@ typedef struct enginefuncs_s
void (*pfnSetGroupMask) ( int mask, int op ); void (*pfnSetGroupMask) ( int mask, int op );
int (*pfnCreateInstancedBaseline) ( int classname, struct entity_state_s *baseline ); int (*pfnCreateInstancedBaseline) ( int classname, struct entity_state_s *baseline );
void (*pfnCvar_DirectSet) ( struct cvar_s *var, char *value ); void (*pfnCvar_DirectSet) ( struct cvar_s *var, const char *value );
// Forces the client and server to be running with the same version of the specified file // Forces the client and server to be running with the same version of the specified file
// ( e.g., a player model ). // ( e.g., a player model ).
@ -263,8 +263,8 @@ typedef struct enginefuncs_s
// Passed to pfnKeyValue // Passed to pfnKeyValue
typedef struct KeyValueData_s typedef struct KeyValueData_s
{ {
char *szClassName; // in: entity classname const char *szClassName; // in: entity classname
char *szKeyName; // in: name of key const char *szKeyName; // in: name of key
char *szValue; // in: value of key char *szValue; // in: value of key
long fHandled; // out: DLL sets to true if key-value pair was understood long fHandled; // out: DLL sets to true if key-value pair was understood
} KeyValueData; } KeyValueData;
@ -370,7 +370,7 @@ typedef enum _fieldtypes
typedef struct typedef struct
{ {
FIELDTYPE fieldType; FIELDTYPE fieldType;
char *fieldName; const char *fieldName;
int fieldOffset; int fieldOffset;
short fieldSize; short fieldSize;
short flags; short flags;
@ -486,4 +486,4 @@ extern NEW_DLL_FUNCTIONS gNewDLLFunctions;
typedef int (*APIFUNCTION)( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion ); typedef int (*APIFUNCTION)( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion );
typedef int (*APIFUNCTION2)( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion ); typedef int (*APIFUNCTION2)( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion );
#endif EIFACE_H #endif // EIFACE_H