diff options
| author | 2008-08-03 20:29:49 +0200 | |
|---|---|---|
| committer | 2008-08-05 23:28:10 -0700 | |
| commit | b25fea997fc798e945dd7f19f8d0be0d8d3289d1 (patch) | |
| tree | e49124e7dbab4800ac4ec155b5dded91551cadf8 | |
| parent | 9fa57190be32f0d9d52948ea8d1e22bedf679312 (diff) | |
| download | libimobiledevice-b25fea997fc798e945dd7f19f8d0be0d8d3289d1.tar.gz libimobiledevice-b25fea997fc798e945dd7f19f8d0be0d8d3289d1.tar.bz2 | |
Added function to handle <data> tag in dict.
Signed-off-by: Matt Colyer <matt@colyer.name>
| -rw-r--r-- | src/plist.c | 7 | ||||
| -rw-r--r-- | src/plist.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/plist.c b/src/plist.c index 01cb734..2d2a832 100644 --- a/src/plist.c +++ b/src/plist.c | |||
| @@ -62,6 +62,13 @@ xmlNode *add_key_str_dict_element(xmlDocPtr plist, xmlNode *dict, const char *ke | |||
| 62 | return keyPtr; | 62 | return keyPtr; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | xmlNode *add_key_data_dict_element(xmlDocPtr plist, xmlNode *dict, const char *key, const char *value, int depth) { | ||
| 66 | xmlNode *keyPtr; | ||
| 67 | keyPtr = add_child_to_plist(plist, "key", key, dict, depth); | ||
| 68 | add_child_to_plist(plist, "data", value, dict, depth); | ||
| 69 | return keyPtr; | ||
| 70 | } | ||
| 71 | |||
| 65 | char **read_dict_element_strings(xmlNode *dict) { | 72 | char **read_dict_element_strings(xmlNode *dict) { |
| 66 | // reads a set of keys and strings into an array where each even number is a key and odd numbers are values. | 73 | // reads a set of keys and strings into an array where each even number is a key and odd numbers are values. |
| 67 | // if the odd number is \0, that's the end of the list. | 74 | // if the odd number is \0, that's the end of the list. |
diff --git a/src/plist.h b/src/plist.h index 3d1edda..64ff4d3 100644 --- a/src/plist.h +++ b/src/plist.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <libxml/tree.h> | 26 | #include <libxml/tree.h> |
| 27 | 27 | ||
| 28 | xmlNode *add_key_str_dict_element(xmlDocPtr plist, xmlNode *dict, const char *key, const char *value, int depth); | 28 | xmlNode *add_key_str_dict_element(xmlDocPtr plist, xmlNode *dict, const char *key, const char *value, int depth); |
| 29 | xmlNode *add_key_data_dict_element(xmlDocPtr plist, xmlNode *dict, const char *key, const char *value, int depth); | ||
| 29 | xmlNode *add_child_to_plist(xmlDocPtr plist, const char *name, const char *content, xmlNode *to_node, int depth); | 30 | xmlNode *add_child_to_plist(xmlDocPtr plist, const char *name, const char *content, xmlNode *to_node, int depth); |
| 30 | void free_plist(xmlDocPtr plist); | 31 | void free_plist(xmlDocPtr plist); |
| 31 | xmlDocPtr new_plist(); | 32 | xmlDocPtr new_plist(); |
