diff options
Diffstat (limited to 'src/plist.h')
| -rw-r--r-- | src/plist.h | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/src/plist.h b/src/plist.h index 1dc464a..ca3201a 100644 --- a/src/plist.h +++ b/src/plist.h | |||
| @@ -22,6 +22,8 @@ | |||
| 22 | #ifndef PLIST_H | 22 | #ifndef PLIST_H |
| 23 | #define PLIST_H | 23 | #define PLIST_H |
| 24 | 24 | ||
| 25 | #include "plist/plist.h" | ||
| 26 | |||
| 25 | #include <stdint.h> | 27 | #include <stdint.h> |
| 26 | #include <wchar.h> | 28 | #include <wchar.h> |
| 27 | 29 | ||
| @@ -31,22 +33,10 @@ | |||
| 31 | #include <glib.h> | 33 | #include <glib.h> |
| 32 | 34 | ||
| 33 | 35 | ||
| 34 | typedef enum { | ||
| 35 | PLIST_BOOLEAN, | ||
| 36 | PLIST_UINT, | ||
| 37 | PLIST_REAL, | ||
| 38 | PLIST_STRING, | ||
| 39 | PLIST_UNICODE, | ||
| 40 | PLIST_ARRAY, | ||
| 41 | PLIST_DICT, | ||
| 42 | PLIST_DATE, | ||
| 43 | PLIST_DATA, | ||
| 44 | PLIST_KEY, | ||
| 45 | PLIST_NONE | ||
| 46 | } plist_type; | ||
| 47 | 36 | ||
| 48 | 37 | ||
| 49 | struct plist_data { | 38 | |
| 39 | struct plist_data_s { | ||
| 50 | union { | 40 | union { |
| 51 | char boolval; | 41 | char boolval; |
| 52 | uint64_t intval; | 42 | uint64_t intval; |
| @@ -59,25 +49,12 @@ struct plist_data { | |||
| 59 | plist_type type; | 49 | plist_type type; |
| 60 | }; | 50 | }; |
| 61 | 51 | ||
| 52 | typedef struct plist_data_s* plist_data_t; | ||
| 62 | 53 | ||
| 54 | plist_t plist_new_node(plist_data_t data); | ||
| 55 | plist_data_t plist_get_data(plist_t node); | ||
| 56 | plist_data_t plist_new_plist_data(); | ||
| 57 | void plist_free_plist_data(plist_data_t node); | ||
| 63 | 58 | ||
| 64 | typedef GNode *plist_t; | ||
| 65 | |||
| 66 | |||
| 67 | void plist_new_dict(plist_t * plist); | ||
| 68 | void plist_new_array(plist_t * plist); | ||
| 69 | void plist_new_dict_in_plist(plist_t plist, plist_t * dict); | ||
| 70 | void plist_add_dict_element(plist_t dict, char *key, plist_type type, void *value, uint64_t length); | ||
| 71 | void plist_free(plist_t plist); | ||
| 72 | |||
| 73 | void plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length); | ||
| 74 | void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length); | ||
| 75 | |||
| 76 | void xml_to_plist(const char *plist_xml, uint32_t length, plist_t * plist); | ||
| 77 | void bin_to_plist(const char *plist_bin, uint32_t length, plist_t * plist); | ||
| 78 | |||
| 79 | plist_t find_query_node(plist_t plist, char *key, char *request); | ||
| 80 | plist_t find_node(plist_t plist, plist_type type, void *value); | ||
| 81 | void get_type_and_value(plist_t node, plist_type * type, void *value, uint64_t * length); | ||
| 82 | 59 | ||
| 83 | #endif | 60 | #endif |
