Franklin Wei | a855d62 | 2017-01-21 15:18:31 -0500 | [diff] [blame] | 1 | #ifndef _CVARS_H_ |
| 2 | #define _CVARS_H_ |
| 3 | |
| 4 | #define REGCONVAR(varname, varhelp, variable, function) CVAR_RegisterCvar(varname, varhelp, &variable, &function) |
| 5 | #define REGCONFUNC(varname, varhelp, function) CVAR_RegisterCvar(varname, varhelp, NULL, &function) |
| 6 | |
Vencislav Atanasov | 183e45e | 2019-07-28 23:31:50 +0300 | [diff] [blame^] | 7 | #include <inttypes.h> |
Franklin Wei | a855d62 | 2017-01-21 15:18:31 -0500 | [diff] [blame] | 8 | |
| 9 | typedef void (*function_t) (void* binding); |
| 10 | |
| 11 | typedef struct t_cvar_binding |
| 12 | { |
| 13 | char name[64]; |
| 14 | char help[64]; |
| 15 | void* variable; |
| 16 | function_t function; |
| 17 | } cvar_binding; |
| 18 | |
| 19 | |
| 20 | void CVAR_RegisterCvar(const char * varname, const char * varhelp, void* variable, function_t function); |
| 21 | int CVAR_GetNumCvarBindings(); |
| 22 | cvar_binding* CVAR_GetCvarBinding(unsigned int nBinding); |
| 23 | void CVAR_Render(); |
| 24 | |
| 25 | #endif |