From b25fea997fc798e945dd7f19f8d0be0d8d3289d1 Mon Sep 17 00:00:00 2001
From: Jonathan Beck
Date: Sun, 3 Aug 2008 20:29:49 +0200
Subject: Added function to handle <data> tag in dict.

Signed-off-by: Matt Colyer <matt@colyer.name>
---
 src/plist.c | 7 +++++++
 src/plist.h | 1 +
 2 files changed, 8 insertions(+)

(limited to 'src')

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
 	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) {
 	// 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. 
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 @@
 #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_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);
 void free_plist(xmlDocPtr plist);
 xmlDocPtr new_plist();
-- 
cgit v1.1-32-gdbae