1 /*
2 ===========================================================================
3 Copyright (C) 1999 - 2005, Id Software, Inc.
4 Copyright (C) 2000 - 2013, Raven Software, Inc.
5 Copyright (C) 2001 - 2013, Activision, Inc.
6 Copyright (C) 2013 - 2015, OpenJK contributors
7 
8 This file is part of the OpenJK source code.
9 
10 OpenJK is free software; you can redistribute it and/or modify it
11 under the terms of the GNU General Public License version 2 as
12 published by the Free Software Foundation.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, see <http://www.gnu.org/licenses/>.
21 ===========================================================================
22 */
23 
24 /*****************************************************************************
25  * name:		l_libvar.h
26  *
27  * desc:		botlib vars
28  *
29  * $Archive: /source/code/botlib/l_libvar.h $
30  * $Author: Mrelusive $
31  * $Revision: 2 $
32  * $Modtime: 10/05/99 3:32p $
33  * $Date: 10/05/99 3:42p $
34  *
35  *****************************************************************************/
36 
37 #pragma once
38 
39 //library variable
40 typedef struct libvar_s
41 {
42 	char		*name;
43 	char		*string;
44 	int		flags;
45 	qboolean	modified;	// set each time the cvar is changed
46 	float		value;
47 	struct	libvar_s *next;
48 } libvar_t;
49 
50 //removes all library variables
51 void LibVarDeAllocAll(void);
52 //gets the library variable with the given name
53 libvar_t *LibVarGet(char *var_name);
54 //gets the string of the library variable with the given name
55 char *LibVarGetString(char *var_name);
56 //gets the value of the library variable with the given name
57 float LibVarGetValue(char *var_name);
58 //creates the library variable if not existing already and returns it
59 libvar_t *LibVar(char *var_name, char *value);
60 //creates the library variable if not existing already and returns the value
61 float LibVarValue(char *var_name, char *value);
62 //creates the library variable if not existing already and returns the value string
63 char *LibVarString(char *var_name, char *value);
64 //sets the library variable
65 void LibVarSet(char *var_name, char *value);
66 //returns true if the library variable has been modified
67 qboolean LibVarChanged(char *var_name);
68 //sets the library variable to unmodified
69 void LibVarSetNotModified(char *var_name);
70