summaryrefslogtreecommitdiffstats
path: root/src/plist.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plist.h')
-rw-r--r--src/plist.h83
1 files changed, 0 insertions, 83 deletions
diff --git a/src/plist.h b/src/plist.h
deleted file mode 100644
index 1dc464a..0000000
--- a/src/plist.h
+++ /dev/null
@@ -1,83 +0,0 @@
1/*
2 * plist.h
3 * contains structures and the like for plists
4 *
5 * Copyright (c) 2008 Zach C. All Rights Reserved.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef PLIST_H
23#define PLIST_H
24
25#include <stdint.h>
26#include <wchar.h>
27
28#include <sys/types.h>
29#include <sys/stat.h>
30#include <unistd.h>
31#include <glib.h>
32
33
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
48
49struct plist_data {
50 union {
51 char boolval;
52 uint64_t intval;
53 double realval;
54 char *strval;
55 wchar_t *unicodeval;
56 char *buff;
57 };
58 uint64_t length;
59 plist_type type;
60};
61
62
63
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
83#endif