summaryrefslogtreecommitdiffstats
path: root/src/plist.h
diff options
context:
space:
mode:
authorGravatar Jonathan Beck2008-11-30 16:36:18 +0100
committerGravatar Jonathan Beck2008-11-30 16:36:18 +0100
commit889cb32a1231c41762d7e2bbe6c891bd3a6c9a7d (patch)
treee60a593d5806b1fc5398bfa17f6d2feec9c82358 /src/plist.h
parent831ee461bd03ad809f73b34dc5205d296158a969 (diff)
downloadlibimobiledevice-889cb32a1231c41762d7e2bbe6c891bd3a6c9a7d.tar.gz
libimobiledevice-889cb32a1231c41762d7e2bbe6c891bd3a6c9a7d.tar.bz2
Continue abstraction of xml and binary plist.
Diffstat (limited to 'src/plist.h')
-rw-r--r--src/plist.h48
1 files changed, 9 insertions, 39 deletions
diff --git a/src/plist.h b/src/plist.h
index 4586d6f..1ca55f9 100644
--- a/src/plist.h
+++ b/src/plist.h
@@ -46,38 +46,8 @@ void free_dictionary(char **dictionary);
46 46
47/* Binary plist stuff */ 47/* Binary plist stuff */
48 48
49enum {
50 BPLIST_TRUE = 0x08,
51 BPLIST_FALSE = 0x09,
52 BPLIST_FILL = 0x0F, /* will be used for length grabbing */
53 BPLIST_INT = 0x10,
54 BPLIST_REAL = 0x20,
55 BPLIST_DATE = 0x33,
56 BPLIST_DATA = 0x40,
57 BPLIST_STRING = 0x50,
58 BPLIST_UNICODE = 0x60,
59 BPLIST_UID = 0x70,
60 BPLIST_ARRAY = 0xA0,
61 BPLIST_SET = 0xC0,
62 BPLIST_DICT = 0xD0,
63 BPLIST_MASK = 0xF0
64};
65 49
66typedef struct _bplist_node { 50typedef enum {
67 struct _bplist_node *next, **subnodes; // subnodes is for arrays, dicts and (potentially) sets.
68 uint64_t length, intval64;
69 uint32_t intval32; // length = subnodes
70 uint16_t intval16;
71 uint8_t intval8;
72 uint8_t type, *indexes; // indexes for array-types; essentially specify the order in which to access for key => value pairs
73 char *strval;
74 double realval;
75 wchar_t *unicodeval;
76} bplist_node;
77
78bplist_node *parse_nodes(const char *bpbuffer, uint32_t bplength, uint32_t * position);
79
80typedef enum {
81 PLIST_BOOLEAN, 51 PLIST_BOOLEAN,
82 PLIST_UINT8, 52 PLIST_UINT8,
83 PLIST_UINT16, 53 PLIST_UINT16,
@@ -100,15 +70,15 @@ typedef GNode *plist_t;
100typedef GNode *dict_t; 70typedef GNode *dict_t;
101typedef GNode *array_t; 71typedef GNode *array_t;
102 72
103void plist_new_plist(plist_t* plist); 73void plist_new_plist(plist_t * plist);
104void plist_new_dict_in_plist(plist_t plist, dict_t* dict); 74void plist_new_dict_in_plist(plist_t plist, dict_t * dict);
105void plist_new_array_in_plist(plist_t plist, int length, plist_type type, void** values, array_t* array); 75void plist_new_array_in_plist(plist_t plist, int length, plist_type type, void **values, array_t * array);
106void plist_add_dict_element(dict_t dict, char* key, plist_type type, void* value); 76void plist_add_dict_element(dict_t dict, char *key, plist_type type, void *value);
107void plist_free(plist_t plist); 77void plist_free(plist_t plist);
108 78
109void plist_to_xml(plist_t plist, char** plist_xml); 79void plist_to_xml(plist_t plist, char **plist_xml);
110void plist_to_bin(plist_t plist, char** plist_bin); 80void plist_to_bin(plist_t plist, char **plist_bin, int *length);
111 81
112void xml_to_plist(const char* plist_xml, plist_t* plist); 82void xml_to_plist(const char *plist_xml, plist_t * plist);
113void bin_to_plist(const char* plist_bin, plist_t* plist); 83void bin_to_plist(const char *plist_bin, int length, plist_t * plist);
114#endif 84#endif