summaryrefslogtreecommitdiffstats
path: root/src/plist.h
diff options
context:
space:
mode:
authorGravatar Zach C2008-08-31 11:25:22 -0700
committerGravatar Jonathan Beck2008-11-24 22:49:07 +0100
commitf4c4b783c8dbe2fe8e7e6f6b5f19f0d44b489c9a (patch)
tree9ef8c57fe298a4ae9e0a443d7103e6126c869020 /src/plist.h
parent8c3a01e11bb9c74e2a1bb7da143cb35469f29fba (diff)
downloadlibimobiledevice-f4c4b783c8dbe2fe8e7e6f6b5f19f0d44b489c9a.tar.gz
libimobiledevice-f4c4b783c8dbe2fe8e7e6f6b5f19f0d44b489c9a.tar.bz2
Added binary-plist support (tweaked slightly to move stuff around)
Signed-off-by: Matt Colyer <matt@colyer.name> fix makefile to take correct main function into account
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 @@
#include <libxml/parser.h>
#include <libxml/tree.h>
+#include <stdint.h>
+#include <wchar.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
xmlNode *add_key_dict_node(xmlDocPtr plist, xmlNode * dict, const char *key, const char *value, int depth);
xmlNode *add_key_str_dict_element(xmlDocPtr plist, xmlNode * dict, const char *key, const char *value, int depth);
@@ -35,4 +41,36 @@ xmlDocPtr new_plist();
char **read_dict_element_strings(xmlNode * dict);
void free_dictionary(char **dictionary);
+
+/* Binary plist stuff */
+
+enum {
+ BPLIST_TRUE = 0x08,
+ BPLIST_FALSE = 0x09,
+ BPLIST_FILL = 0x0F, /* will be used for length grabbing */
+ BPLIST_INT = 0x10,
+ BPLIST_REAL = 0x20,
+ BPLIST_DATE = 0x33,
+ BPLIST_DATA = 0x40,
+ BPLIST_STRING = 0x50,
+ BPLIST_UNICODE = 0x60,
+ BPLIST_UID = 0x70,
+ BPLIST_ARRAY = 0xA0,
+ BPLIST_SET = 0xC0,
+ BPLIST_DICT = 0xD0,
+ BPLIST_MASK = 0xF0
+};
+
+typedef struct _bplist_node {
+ struct _bplist_node *next, **subnodes; // subnodes is for arrays, dicts and (potentially) sets.
+ uint64_t length, intval64;
+ uint32_t intval32; // length = subnodes
+ uint16_t intval16;
+ uint8_t intval8;
+ uint8_t type, *indexes; // indexes for array-types; essentially specify the order in which to access for key => value pairs
+ char *strval;
+ double realval;
+ wchar_t *unicodeval;
+} bplist_node;
+
#endif