Commit b25fea99 authored by Jonathan Beck's avatar Jonathan Beck Committed by Matt Colyer

Added function to handle <data> tag in dict.

Signed-off-by: 's avatarMatt Colyer <matt@colyer.name>
parent 9fa57190
...@@ -62,6 +62,13 @@ xmlNode *add_key_str_dict_element(xmlDocPtr plist, xmlNode *dict, const char *ke ...@@ -62,6 +62,13 @@ xmlNode *add_key_str_dict_element(xmlDocPtr plist, xmlNode *dict, const char *ke
return keyPtr; return keyPtr;
} }
xmlNode *add_key_data_dict_element(xmlDocPtr plist, xmlNode *dict, const char *key, const char *value, int depth) {
xmlNode *keyPtr;
keyPtr = add_child_to_plist(plist, "key", key, dict, depth);
add_child_to_plist(plist, "data", value, dict, depth);
return keyPtr;
}
char **read_dict_element_strings(xmlNode *dict) { char **read_dict_element_strings(xmlNode *dict) {
// reads a set of keys and strings into an array where each even number is a key and odd numbers are values. // reads a set of keys and strings into an array where each even number is a key and odd numbers are values.
// if the odd number is \0, that's the end of the list. // if the odd number is \0, that's the end of the list.
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <libxml/tree.h> #include <libxml/tree.h>
xmlNode *add_key_str_dict_element(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);
xmlNode *add_key_data_dict_element(xmlDocPtr plist, xmlNode *dict, const char *key, const char *value, int depth);
xmlNode *add_child_to_plist(xmlDocPtr plist, const char *name, const char *content, xmlNode *to_node, int depth); xmlNode *add_child_to_plist(xmlDocPtr plist, const char *name, const char *content, xmlNode *to_node, int depth);
void free_plist(xmlDocPtr plist); void free_plist(xmlDocPtr plist);
xmlDocPtr new_plist(); xmlDocPtr new_plist();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment