diff options
Diffstat (limited to 'apps/plugins/rockboy/rc.h')
-rw-r--r-- | apps/plugins/rockboy/rc.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/apps/plugins/rockboy/rc.h b/apps/plugins/rockboy/rc.h new file mode 100644 index 0000000000..217b05f5c6 --- /dev/null +++ b/apps/plugins/rockboy/rc.h | |||
@@ -0,0 +1,71 @@ | |||
1 | |||
2 | |||
3 | |||
4 | #ifndef __RC_H__ | ||
5 | #define __RC_H__ | ||
6 | |||
7 | |||
8 | |||
9 | typedef enum rctype | ||
10 | { | ||
11 | rcv_end, | ||
12 | rcv_int, | ||
13 | rcv_string, | ||
14 | rcv_vector, | ||
15 | rcv_bool | ||
16 | } rcvtype_t; | ||
17 | |||
18 | |||
19 | typedef struct rcvar_s | ||
20 | { | ||
21 | char *name; | ||
22 | int type; | ||
23 | int len; | ||
24 | void *mem; | ||
25 | } rcvar_t; | ||
26 | |||
27 | #define RCV_END { 0, rcv_end, 0, 0 } | ||
28 | #define RCV_INT(n,v) { (n), rcv_int, 1, (v) } | ||
29 | #define RCV_STRING(n,v) { (n), rcv_string, 0, (v) } | ||
30 | #define RCV_VECTOR(n,v,l) { (n), rcv_vector, (l), (v) } | ||
31 | #define RCV_BOOL(n,v) { (n), rcv_bool, 1, (v) } | ||
32 | |||
33 | typedef struct rccmd_s | ||
34 | { | ||
35 | char *name; | ||
36 | int (*func)(int, char **); | ||
37 | } rccmd_t; | ||
38 | |||
39 | #define RCC(n,f) { (n), (f) } | ||
40 | #define RCC_END { 0, 0 } | ||
41 | |||
42 | void rc_export(rcvar_t *v); | ||
43 | void rc_exportvars(rcvar_t *vars); | ||
44 | |||
45 | int rc_findvar(char *name); | ||
46 | |||
47 | int rc_setvar_n(int i, int c, char **v); | ||
48 | int rc_setvar(char *name, int c, char **v); | ||
49 | |||
50 | int rc_getint_n(int i); | ||
51 | int *rc_getvec_n(int i); | ||
52 | char *rc_getstr_n(int i); | ||
53 | |||
54 | int rc_getint(char *name); | ||
55 | int *rc_getvec(char *name); | ||
56 | char *rc_getstr(char *name); | ||
57 | |||
58 | int rc_bindkey(char *keyname, char *cmd); | ||
59 | int rc_unbindkey(char *keyname); | ||
60 | void rc_unbindall(void); | ||
61 | |||
62 | int rc_sourcefile(char *filename); | ||
63 | void rc_dokey(int key, int st); | ||
64 | |||
65 | int rc_command(char *line); | ||
66 | |||
67 | #endif | ||
68 | |||
69 | |||
70 | |||
71 | |||