UFO: Alien Invasion
Loading...
Searching...
No Matches
infostring.h
Go to the documentation of this file.
1
5
6/*
7All original material Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9Copyright (C) 1997-2001 Id Software, Inc.
10
11This program is free software; you can redistribute it and/or
12modify it under the terms of the GNU General Public License
13as published by the Free Software Foundation; either version 2
14of the License, or (at your option) any later version.
15
16This program is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19
20See the GNU General Public License for more details.
21
22You should have received a copy of the GNU General Public License
23along with this program; if not, write to the Free Software
24Foundation, 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
38const char* Info_ValueForKey(const char* s, const char* key);
39const char* Info_BoolForKey(const char* s, const char* key);
40int Info_IntegerForKey(const char* s, const char* key);
41void Info_RemoveKey(char* s, const char* key);
42void Info_SetValueForKey(char* s, const size_t size, const char* key, const char* value);
43void Info_SetValueForKeyAsInteger(char* s, const size_t size, const char* key, const int value);
44void Info_Print(const char* s);
45bool Info_Validate(const char* s);
unsigned int key
Definition cl_input.cpp:64
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.
voidpf void uLong size
Definition ioapi.h:42
Cross-platform type definitions.