summaryrefslogtreecommitdiffstats
path: root/src/plist.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plist.h')
-rw-r--r--src/plist.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/plist.h b/src/plist.h
index b27a0c5..98c7d91 100644
--- a/src/plist.h
+++ b/src/plist.h
@@ -24,6 +24,12 @@
24 24
25#include <libxml/parser.h> 25#include <libxml/parser.h>
26#include <libxml/tree.h> 26#include <libxml/tree.h>
27#include <stdint.h>
28#include <wchar.h>
29
30#include <sys/types.h>
31#include <sys/stat.h>
32#include <unistd.h>
27 33
28xmlNode *add_key_dict_node(xmlDocPtr plist, xmlNode * dict, const char *key, const char *value, int depth); 34xmlNode *add_key_dict_node(xmlDocPtr plist, xmlNode * dict, const char *key, const char *value, int depth);
29xmlNode *add_key_str_dict_element(xmlDocPtr plist, xmlNode * dict, const char *key, const char *value, int depth); 35xmlNode *add_key_str_dict_element(xmlDocPtr plist, xmlNode * dict, const char *key, const char *value, int depth);
@@ -35,4 +41,36 @@ xmlDocPtr new_plist();
35 41
36char **read_dict_element_strings(xmlNode * dict); 42char **read_dict_element_strings(xmlNode * dict);
37void free_dictionary(char **dictionary); 43void free_dictionary(char **dictionary);
44
45/* Binary plist stuff */
46
47enum {
48 BPLIST_TRUE = 0x08,
49 BPLIST_FALSE = 0x09,
50 BPLIST_FILL = 0x0F, /* will be used for length grabbing */
51 BPLIST_INT = 0x10,
52 BPLIST_REAL = 0x20,
53 BPLIST_DATE = 0x33,
54 BPLIST_DATA = 0x40,
55 BPLIST_STRING = 0x50,
56 BPLIST_UNICODE = 0x60,
57 BPLIST_UID = 0x70,
58 BPLIST_ARRAY = 0xA0,
59 BPLIST_SET = 0xC0,
60 BPLIST_DICT = 0xD0,
61 BPLIST_MASK = 0xF0
62};
63
64typedef struct _bplist_node {
65 struct _bplist_node *next, **subnodes; // subnodes is for arrays, dicts and (potentially) sets.
66 uint64_t length, intval64;
67 uint32_t intval32; // length = subnodes
68 uint16_t intval16;
69 uint8_t intval8;
70 uint8_t type, *indexes; // indexes for array-types; essentially specify the order in which to access for key => value pairs
71 char *strval;
72 double realval;
73 wchar_t *unicodeval;
74} bplist_node;
75
38#endif 76#endif