34 |
34 |
35 #ifdef __cplusplus |
35 #ifdef __cplusplus |
36 extern "C" { |
36 extern "C" { |
37 #endif |
37 #endif |
38 |
38 |
|
39 #define CFG_KEYFILE_ADD(list_begin, list_end, elm) \ |
|
40 cx_linked_list_add((void**)list_begin, (void**)list_end, -1, offsetof(KeyfileEntry, next), elm) |
|
41 |
|
42 typedef struct _keyfile_entry KeyfileEntry; |
|
43 |
39 typedef struct _keyfile_conf { |
44 typedef struct _keyfile_conf { |
40 ConfigParser parser; |
45 ConfigParser parser; |
41 char *file; |
46 char *file; |
42 UcxList *users; // KeyfileEntry list |
47 KeyfileEntry *users_begin; // KeyfileEntry list |
|
48 KeyfileEntry *users_end; |
43 } KeyfileConfig; |
49 } KeyfileConfig; |
44 |
50 |
45 typedef struct _keyfile_entry { |
51 struct _keyfile_entry { |
46 sstr_t name; |
52 cxmutstr name; |
47 enum KeyfileHashType hashtype; |
53 enum KeyfileHashType hashtype; |
48 sstr_t hashdata; |
54 cxmutstr hashdata; |
49 sstr_t *groups; |
55 cxmutstr *groups; |
50 size_t numgroups; |
56 size_t numgroups; |
51 } KeyfileEntry; |
57 KeyfileEntry *next; |
|
58 }; |
52 |
59 |
53 KeyfileConfig *load_keyfile_config(const char *file); |
60 KeyfileConfig *load_keyfile_config(const char *file); |
54 void free_keyfile_config(KeyfileConfig *conf); |
61 void free_keyfile_config(KeyfileConfig *conf); |
55 int keyfile_parse(void *p, ConfigLine *begin, ConfigLine *end, sstr_t line); |
62 int keyfile_parse(void *p, ConfigLine *begin, ConfigLine *end, cxmutstr line); |
56 |
63 |
57 #ifdef __cplusplus |
64 #ifdef __cplusplus |
58 } |
65 } |
59 #endif |
66 #endif |
60 |
67 |