diff options
Diffstat (limited to 'src/plist.h')
| -rw-r--r-- | src/plist.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/plist.h b/src/plist.h index 5f31281..4586d6f 100644 --- a/src/plist.h +++ b/src/plist.h | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <sys/types.h> | 30 | #include <sys/types.h> |
| 31 | #include <sys/stat.h> | 31 | #include <sys/stat.h> |
| 32 | #include <unistd.h> | 32 | #include <unistd.h> |
| 33 | #include <glib.h> | ||
| 33 | 34 | ||
| 34 | char *format_string(const char *buf, int cols, int depth); | 35 | char *format_string(const char *buf, int cols, int depth); |
| 35 | xmlNode *add_key_dict_node(xmlDocPtr plist, xmlNode * dict, const char *key, const char *value, int depth); | 36 | xmlNode *add_key_dict_node(xmlDocPtr plist, xmlNode * dict, const char *key, const char *value, int depth); |
| @@ -76,4 +77,38 @@ typedef struct _bplist_node { | |||
| 76 | 77 | ||
| 77 | bplist_node *parse_nodes(const char *bpbuffer, uint32_t bplength, uint32_t * position); | 78 | bplist_node *parse_nodes(const char *bpbuffer, uint32_t bplength, uint32_t * position); |
| 78 | 79 | ||
| 80 | typedef enum { | ||
| 81 | PLIST_BOOLEAN, | ||
| 82 | PLIST_UINT8, | ||
| 83 | PLIST_UINT16, | ||
| 84 | PLIST_UINT32, | ||
| 85 | PLIST_UINT64, | ||
| 86 | PLIST_FLOAT32, | ||
| 87 | PLIST_FLOAT64, | ||
| 88 | PLIST_STRING, | ||
| 89 | PLIST_UNICODE, | ||
| 90 | PLIST_ARRAY, | ||
| 91 | PLIST_DICT, | ||
| 92 | PLIST_DATE, | ||
| 93 | PLIST_DATA, | ||
| 94 | PLIST_PLIST, | ||
| 95 | PLIST_KEY, | ||
| 96 | } plist_type; | ||
| 97 | |||
| 98 | |||
| 99 | typedef GNode *plist_t; | ||
| 100 | typedef GNode *dict_t; | ||
| 101 | typedef GNode *array_t; | ||
| 102 | |||
| 103 | void plist_new_plist(plist_t* plist); | ||
| 104 | void plist_new_dict_in_plist(plist_t plist, dict_t* dict); | ||
| 105 | void plist_new_array_in_plist(plist_t plist, int length, plist_type type, void** values, array_t* array); | ||
| 106 | void plist_add_dict_element(dict_t dict, char* key, plist_type type, void* value); | ||
| 107 | void plist_free(plist_t plist); | ||
| 108 | |||
| 109 | void plist_to_xml(plist_t plist, char** plist_xml); | ||
| 110 | void plist_to_bin(plist_t plist, char** plist_bin); | ||
| 111 | |||
| 112 | void xml_to_plist(const char* plist_xml, plist_t* plist); | ||
| 113 | void bin_to_plist(const char* plist_bin, plist_t* plist); | ||
| 79 | #endif | 114 | #endif |
