Info string handling. More...
Go to the source code of this file.
Defines | |
#define | MAX_INFO_KEY 64 |
#define | MAX_INFO_VALUE 64 |
#define | MAX_INFO_STRING 512 |
Functions | |
const char * | Info_ValueForKey (const char *s, const char *key) |
Searches the string for the given key and returns the associated value, or an empty string. | |
const char * | Info_BoolForKey (const char *s, const char *key) |
int | Info_IntegerForKey (const char *s, const char *key) |
void | Info_RemoveKey (char *s, const char *key) |
Searches through s for key and remove is. | |
void | Info_SetValueForKey (char *s, const size_t size, const char *key, const char *value) |
Adds a new entry into string with given value. | |
void | Info_SetValueForKeyAsInteger (char *s, const size_t size, const char *key, const int value) |
void | Info_Print (const char *s) |
Prints info strings (like userinfo or serverinfo - CVAR_USERINFO, CVAR_SERVERINFO). | |
qboolean | Info_Validate (const char *s) |
Some characters are illegal in info strings because they can mess up the server's parsing. |
Info string handling.
Definition in file infostring.h.
#define MAX_INFO_KEY 64 |
Definition at line 32 of file infostring.h.
Referenced by Info_SetValueForKey().
#define MAX_INFO_STRING 512 |
Definition at line 34 of file infostring.h.
Referenced by CL_ParseServerInfoMessage(), CL_PingServerCallback(), Cvar_BitInfo(), Info_SetValueForKey(), SVC_DirectConnect(), SVC_Info(), and SVC_TeamInfo().
#define MAX_INFO_VALUE 64 |
Definition at line 33 of file infostring.h.
Referenced by Info_SetValueForKey().
const char* Info_BoolForKey | ( | const char * | s, | |
const char * | key | |||
) |
Definition at line 77 of file infostring.c.
References Info_ValueForKey().
Referenced by CL_ParseServerInfoMessage().
int Info_IntegerForKey | ( | const char * | s, | |
const char * | key | |||
) |
Definition at line 85 of file infostring.c.
References Info_ValueForKey().
Referenced by CL_ParseTeamInfoMessage().
void Info_Print | ( | const char * | s | ) |
Prints info strings (like userinfo or serverinfo - CVAR_USERINFO, CVAR_SERVERINFO).
Definition at line 215 of file infostring.c.
References Com_Printf(), and key.
Referenced by CL_UserInfo_f(), SV_Serverinfo_f(), SV_ShowServerinfo_f(), and SV_UserInfo_f().
void Info_RemoveKey | ( | char * | s, | |
const char * | key | |||
) |
Searches through s for key and remove is.
[in] | s | String to search key in |
[in] | key | String to search for in s |
Definition at line 96 of file infostring.c.
Referenced by Info_SetValueForKey().
void Info_SetValueForKey | ( | char * | s, | |
const size_t | size, | |||
const char * | key, | |||
const char * | value | |||
) |
Adds a new entry into string with given value.
[out] | s | The target info string |
[in] | size | The size of s |
[in] | key | The key to set |
[in] | value | The value to set for the given key |
Definition at line 173 of file infostring.c.
References Com_Printf(), Com_sprintf(), Info_RemoveKey(), MAX_INFO_KEY, MAX_INFO_STRING, MAX_INFO_VALUE, Q_strcat(), Q_strncpyz(), and STRINGIFY.
Referenced by Cvar_BitInfo(), G_ClientConnect(), Info_SetValueForKeyAsInteger(), SVC_DirectConnect(), SVC_Info(), and SVC_TeamInfo().
void Info_SetValueForKeyAsInteger | ( | char * | s, | |
const size_t | size, | |||
const char * | key, | |||
const int | value | |||
) |
Definition at line 158 of file infostring.c.
References Info_SetValueForKey(), and va().
Referenced by G_SetTeamForPlayer(), SVC_Info(), and SVC_TeamInfo().
qboolean Info_Validate | ( | const char * | s | ) |
Some characters are illegal in info strings because they can mess up the server's parsing.
Definition at line 146 of file infostring.c.
Referenced by G_ClientUserinfoChanged().
const char* Info_ValueForKey | ( | const char * | s, | |
const char * | key | |||
) |
Searches the string for the given key and returns the associated value, or an empty string.
[in] | s | The string you want to extract the keyvalue from |
[in] | key | The key you want to extract the value for |
Definition at line 39 of file infostring.c.
References Q_strcasecmp.
Referenced by CL_ParseServerInfoMessage(), CL_ParseTeamInfoMessage(), CL_ProcessPingReply(), G_ClientConnect(), G_ClientGetTeamNumPref(), G_ClientUserinfoChanged(), Info_BoolForKey(), Info_IntegerForKey(), SV_UserinfoChanged(), and SVC_DirectConnect().