]> icculus.org git repositories - btb/d2x.git/blob - main/cvar.h
add function to find a cvar by name
[btb/d2x.git] / main / cvar.h
1 /* Console variables */
2
3 #ifndef _CVAR_H
4 #define _CVAR_H 1
5
6 #include "pstypes.h"
7
8
9 typedef struct cvar_s
10 {
11         char *name;
12         char *string;
13         bool archive;
14         float value;
15         int intval;
16         struct cvar_s *next;
17 } cvar_t;
18
19
20 /* Register a CVar with the name and string and optionally archive elements set */
21 void cvar_registervariable (cvar_t *cvar);
22
23 /* Set a CVar's value */
24 void cvar_set_cvar(cvar_t *cvar, char *value);
25 void cvar_set_cvar_value(cvar_t *cvar, float value);
26
27 /* Equivalent to typing <var_name> <value> at the console */
28 void cvar_set(char *cvar_name, char *value);
29 void cvar_set_value(char *cvar_name, float value);
30
31 /* Get the pointer to a cvar by name */
32 cvar_t *cvar_find(char *cvar_name);
33
34 /* Get a CVar's value */
35 float cvar(char *cvar_name);
36
37
38 #endif /* _CVAR_H_ */