UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
infostring.h
Go to the documentation of this file.
1 
6 /*
7 All original material Copyright (C) 2002-2020 UFO: Alien Invasion.
8 
9 Copyright (C) 1997-2001 Id Software, Inc.
10 
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License
13 as published by the Free Software Foundation; either version 2
14 of the License, or (at your option) any later version.
15 
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 
20 See the GNU General Public License for more details.
21 
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 
26 */
27 
28 #pragma once
29 
30 #include <stddef.h>
31 #include "ufotypes.h"
32 
33 /* key / value info strings */
34 #define MAX_INFO_KEY 64
35 #define MAX_INFO_VALUE 64
36 #define MAX_INFO_STRING 512
37 
38 const char* Info_ValueForKey(const char* s, const char* key);
39 const char* Info_BoolForKey(const char* s, const char* key);
40 int Info_IntegerForKey(const char* s, const char* key);
41 void Info_RemoveKey(char* s, const char* key);
42 void Info_SetValueForKey(char* s, const size_t size, const char* key, const char* value);
43 void Info_SetValueForKeyAsInteger(char* s, const size_t size, const char* key, const int value);
44 void Info_Print(const char* s);
45 bool Info_Validate(const char* s);
bool Info_Validate(const char *s)
Some characters are illegal in info strings because they can mess up the server's parsing...
Definition: infostring.cpp:142
void Info_SetValueForKeyAsInteger(char *s, const size_t size, const char *key, const int value)
Definition: infostring.cpp:154
int Info_IntegerForKey(const char *s, const char *key)
Definition: infostring.cpp:84
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...
Definition: infostring.cpp:39
void Info_Print(const char *s)
Prints info strings (like userinfo or serverinfo - CVAR_USERINFO, CVAR_SERVERINFO) ...
Definition: infostring.cpp:209
const char * Info_BoolForKey(const char *s, const char *key)
Definition: infostring.cpp:76
unsigned int key
Definition: cl_input.cpp:68
void Info_RemoveKey(char *s, const char *key)
Searches through s for key and remove is.
Definition: infostring.cpp:95
GLsizei size
Definition: r_gl.h:152
void Info_SetValueForKey(char *s, const size_t size, const char *key, const char *value)
Adds a new entry into string with given value.
Definition: infostring.cpp:169
Cross-platform type definitions.