summaryrefslogtreecommitdiffstats
path: root/src/plist.h
diff options
context:
space:
mode:
authorGravatar Jonathan Beck2008-12-13 13:56:55 +0100
committerGravatar Jonathan Beck2008-12-13 13:56:55 +0100
commite220e2cf08809a6a8853a8c9c7b06cef4e90cb57 (patch)
tree51472b19b56c5816fc050fcac6273a5931f9f4f6 /src/plist.h
parent3fdd24aea06a9bf38d9d34fb8bccbb7023ed3100 (diff)
downloadlibplist-e220e2cf08809a6a8853a8c9c7b06cef4e90cb57.tar.gz
libplist-e220e2cf08809a6a8853a8c9c7b06cef4e90cb57.tar.bz2
Add plutil and do some cleaning.
Diffstat (limited to 'src/plist.h')
-rw-r--r--src/plist.h41
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
34typedef 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
49struct plist_data { 38
39struct 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
52typedef struct plist_data_s* plist_data_t;
62 53
54plist_t plist_new_node(plist_data_t data);
55plist_data_t plist_get_data(plist_t node);
56plist_data_t plist_new_plist_data();
57void plist_free_plist_data(plist_data_t node);
63 58
64typedef GNode *plist_t;
65
66
67void plist_new_dict(plist_t * plist);
68void plist_new_array(plist_t * plist);
69void plist_new_dict_in_plist(plist_t plist, plist_t * dict);
70void plist_add_dict_element(plist_t dict, char *key, plist_type type, void *value, uint64_t length);
71void plist_free(plist_t plist);
72
73void plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length);
74void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length);
75
76void xml_to_plist(const char *plist_xml, uint32_t length, plist_t * plist);
77void bin_to_plist(const char *plist_bin, uint32_t length, plist_t * plist);
78
79plist_t find_query_node(plist_t plist, char *key, char *request);
80plist_t find_node(plist_t plist, plist_type type, void *value);
81void get_type_and_value(plist_t node, plist_type * type, void *value, uint64_t * length);
82 59
83#endif 60#endif