Rev 1317 | Rev 1321 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1317 | vana | 1 | #include <arch/types.h> |
2 | |||
3 | typedef union sysinfo_item_val |
||
4 | { |
||
5 | __native val; |
||
6 | void *fn; |
||
7 | }sysinfo_item_val_t; |
||
8 | |||
9 | typedef struct sysinfo_item |
||
10 | { |
||
11 | char *name; |
||
12 | union |
||
13 | { |
||
14 | __native val; |
||
15 | void *fn; |
||
16 | }val; |
||
17 | |||
18 | union |
||
19 | { |
||
20 | struct sysinfo_item *table; |
||
21 | void *fn; |
||
22 | }subinfo; |
||
23 | |||
24 | struct sysinfo_item *next; |
||
25 | int val_type; |
||
26 | int subinfo_type; |
||
27 | }sysinfo_item_t; |
||
28 | |||
29 | #define SYSINFO_VAL_VAL 0 |
||
30 | #define SYSINFO_VAL_FUNCTION 1 |
||
31 | #define SYSINFO_VAL_UNDEFINED '?' |
||
32 | |||
33 | #define SYSINFO_SUBINFO_NONE 0 |
||
34 | #define SYSINFO_SUBINFO_TABLE 1 |
||
35 | #define SYSINFO_SUBINFO_FUNCTION 2 |
||
36 | |||
37 | |||
38 | typedef __native (*sysinfo_val_fn_t)(sysinfo_item_t *root); |
||
39 | typedef __native (*sysinfo_subinfo_fn_t)(const char *subname); |
||
40 | |||
41 | typedef struct sysinfo_rettype |
||
42 | { |
||
43 | __native val; |
||
44 | __native valid; |
||
45 | }sysinfo_rettype_t; |
||
46 | |||
47 | void sysinfo_set_item_val(const char *name,sysinfo_item_t **root,__native val); |
||
48 | void sysinfo_dump(sysinfo_item_t **root,int depth); |
||
49 | void sysinfo_set_item_function(const char *name,sysinfo_item_t **root,sysinfo_val_fn_t fn); |
||
50 | void sysinfo_set_item_undefined(const char *name,sysinfo_item_t **root); |
||
51 | |||
52 | sysinfo_rettype_t sysinfo_get_val(const char *name,sysinfo_item_t **root); |
||
53 | |||
1318 | vana | 54 | __native sys_sysinfo_valid(__native ptr,__native len); |
55 | __native sys_sysinfo_value(__native ptr,__native len); |
||
56 | |||
57 |