diff options
Diffstat (limited to 'utils/libdom.h')
-rw-r--r-- | utils/libdom.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/utils/libdom.h b/utils/libdom.h index e5a7c20c1..f2da40570 100644 --- a/utils/libdom.h +++ b/utils/libdom.h @@ -48,4 +48,20 @@ bool libdom_treewalk(dom_node *root, */ dom_node *libdom_find_element(dom_node *node, lwc_string *element_name); +/** + * Search children of a node for first named element + * \param parent dom_node to search children of, or NULL + * \param element_name name of element to find + * \return first child of node which is an element and matches name, or + * NULL if not found or parameter node is NULL + */ +dom_node *libdom_find_first_element(dom_node *parent, lwc_string *element_name); + +typedef bool (*libdom_iterate_cb)(dom_node *node, void *ctx); + +void libdom_iterate_child_elements(dom_node *parent, + libdom_iterate_cb cb, void *ctx); + +dom_document *libdom_parse_file(const char *filename, const char *encoding); + #endif |