diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/plist/plist.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/include/plist/plist.h b/include/plist/plist.h index a67075c..49d978c 100644 --- a/include/plist/plist.h +++ b/include/plist/plist.h @@ -29,6 +29,46 @@ extern "C" { #include <stdint.h> #include <sys/types.h> +typedef void* plist_t; + +typedef enum { + PLIST_BOOLEAN, + PLIST_UINT, + PLIST_REAL, + PLIST_STRING, + PLIST_UNICODE, + PLIST_ARRAY, + PLIST_DICT, + PLIST_DATE, + PLIST_DATA, + PLIST_KEY, + PLIST_NONE +} plist_type; + +//Plist edition +void plist_new_dict(plist_t * plist); +void plist_new_array(plist_t * plist); +void plist_new_dict_in_plist(plist_t plist, plist_t * dict); +void plist_add_dict_element(plist_t dict, char *key, plist_type type, void *value, uint64_t length); +void plist_free(plist_t plist); + +//plist navigation +plist_t plist_get_first_child(plist_t node); +plist_t plist_get_next_sibling(plist_t node); +plist_t plist_get_prev_sibling(plist_t node); + + +void plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length); +void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length); + +void plist_from_xml(const char *plist_xml, uint32_t length, plist_t * plist); +void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist); + +plist_t plist_find_query_node(plist_t plist, char *key, char *request); +plist_t plist_find_node(plist_t plist, plist_type type, void *value); +void plist_get_type_and_value(plist_t node, plist_type * type, void *value, uint64_t * length); + + #ifdef __cplusplus |