43 static char value[2][512] = {
"",
""};
46 static int valueindex = 0;
49 if (*s ==
'\\' && *s !=
'\n')
53 while (*s !=
'\\' && *s !=
'\n') {
61 o = value[valueindex];
63 while (*s !=
'\\' && *s !=
'\n' && *s)
68 return value[valueindex];
79 if (boolStr[0] ==
'0' || boolStr[0] ==
'\0' ||
Q_streq(boolStr,
"No"))
100 if (strstr(
key,
"\\")) {
119 while (*s !=
'\\' && *s) {
126 if (!strncmp(
key, pkey,
sizeof(pkey))) {
127 const size_t size = strlen(s);
128 memmove(start, s,
size);
173 if (strstr(
key,
"\\") || strstr(value,
"\\")) {
174 Com_Printf(
"Can't use keys or values with a \\\n");
178 if (strstr(
key,
";")) {
179 Com_Printf(
"Can't use keys or values with a semicolon\n");
183 if (strstr(
key,
"\"") || strstr(value,
"\"")) {
184 Com_Printf(
"Can't use keys or values with a \"\n");
220 while (*s && *s !=
'\\') {
231 while (*s && *s !=
'\\') {
void Com_Printf(const char *const fmt,...)
definitions common between client and server, but not game lib
const char * Info_BoolForKey(const char *s, const char *key)
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.
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)
bool Info_Validate(const char *s)
Some characters are illegal in info strings because they can mess up the server's parsing.
void Info_Print(const char *s)
Prints info strings (like userinfo or serverinfo - CVAR_USERINFO, CVAR_SERVERINFO).
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.
#define Q_strcasecmp(a, b)
bool Q_strnull(const char *string)
void Q_strncpyz(char *dest, const char *src, size_t destsize)
Safe strncpy that ensures a trailing zero.
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
const char * va(const char *format,...)
does a varargs printf into a temp buffer, so I don't need to have varargs versions of all text functi...