forked from rofl0r/gnuboy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rc.h
71 lines (49 loc) · 1.2 KB
/
rc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef __RC_H__
#define __RC_H__
typedef enum rctype
{
rcv_end,
rcv_int,
rcv_float,
rcv_string,
rcv_vector,
rcv_bool
} rcvtype_t;
typedef struct rcvar_s
{
char *name;
char *help;
int type;
int len;
void *mem;
} rcvar_t;
#define RCV_END { 0, 0, rcv_end, 0, 0 }
#define RCV_INT(n,v,h) { (n), (h), rcv_int, 1, (v) }
#define RCV_FLOAT(n,v,h) { (n), (h), rcv_float, 1, (v) }
#define RCV_STRING(n,v,h) { (n), (h), rcv_string, 0, (v) }
#define RCV_VECTOR(n,v,l,h) { (n), (h), rcv_vector, (l), (v) }
#define RCV_BOOL(n,v,h) { (n), (h), rcv_bool, 1, (v) }
typedef struct rccmd_s
{
char *name;
int (*func)(int, char **);
} rccmd_t;
#define RCC(n,f) { (n), (f) }
#define RCC_END { 0, 0 }
void rc_export(rcvar_t *v);
void rc_exportvars(rcvar_t *vars);
int rc_findvar(char *name);
int rc_setvar_n(int i, int c, char **v);
int rc_setvar(char *name, int c, char **v);
int rc_getint_n(int i);
float rc_getfloat_n(int i);
int *rc_getvec_n(int i);
char *rc_getstr_n(int i);
int rc_getint(char *name);
float rc_getfloat(char *name);
int *rc_getvec(char *name);
char *rc_getstr(char *name);
int rc_command(char *line);
int rc_sourcefile(char *filename);
const char *rc_type_to_string(rcvtype_t type);
#endif