Commit c0c27eb5 authored by Jonathan Beck's avatar Jonathan Beck

Add a function to find a key node by its value.

parent 74dae54b
......@@ -73,6 +73,7 @@ plist_t plist_get_prev_sibling(plist_t node);
//utili function to find first (and only the first encountred) corresponding node
plist_t plist_find_node(plist_t plist, plist_type type, void *value, uint64_t length);
plist_t plist_find_node_by_key(plist_t plist, char *value);
plist_t plist_find_node_by_string(plist_t plist, char *value);
void plist_get_type_and_value(plist_t node, plist_type * type, void *value, uint64_t * length);
......
......@@ -194,6 +194,11 @@ plist_t plist_find_node(plist_t plist, plist_type type, void *value, uint64_t le
return NULL;
}
plist_t plist_find_node_by_key(plist_t plist, char *value)
{
return plist_find_node(plist, PLIST_KEY, value, strlen(value));
}
plist_t plist_find_node_by_string(plist_t plist, char *value)
{
return plist_find_node(plist, PLIST_STRING, value, strlen(value));
......
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