summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plist.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/plist.c b/src/plist.c
index 2a70a09..c3c9e7b 100644
--- a/src/plist.c
+++ b/src/plist.c
@@ -165,6 +165,34 @@ plist_t plist_get_prev_sibling(plist_t node)
165 return (plist_t) g_node_prev_sibling((GNode *) node); 165 return (plist_t) g_node_prev_sibling((GNode *) node);
166} 166}
167 167
168plist_t plist_get_array_nth_el(plist_t node, uint32_t n)
169{
170 plist_t ret = NULL;
171 if (node && PLIST_ARRAY == plist_get_node_type(node)) {
172 uint32_t i = 0;
173 plist_t temp = plist_get_first_child(node);
174
175 while ( i <= n && temp) {
176 if (i == n)
177 ret = temp;
178 temp = plist_get_next_sibling(temp);
179 i++;
180 }
181 }
182 return ret;
183}
184
185plist_t plist_get_dict_el_from_key(plist_t node, const char *key)
186{
187 plist_t ret = NULL;
188 if (node && PLIST_DICT == plist_get_node_type(node)) {
189
190 plist_t key_node = plist_find_node_by_key(node, key);
191 ret = plist_get_next_sibling(key_node);
192 }
193 return ret;
194}
195
168static char compare_node_value(plist_type type, plist_data_t data, const void *value, uint64_t length) 196static char compare_node_value(plist_type type, plist_data_t data, const void *value, uint64_t length)
169{ 197{
170 char res = FALSE; 198 char res = FALSE;