NetSurf
|
libdom utilities (implementation). More...
#include <stdbool.h>
#include <stdio.h>
#include <dom/dom.h>
#include <dom/bindings/hubbub/parser.h>
#include <dom/bindings/hubbub/errors.h>
Go to the source code of this file.
Typedefs | |
typedef nserror(* | libdom_iterate_cb) (dom_node *node, void *ctx) |
Functions | |
dom_node * | libdom_find_first_element (dom_node *parent, lwc_string *element_name) |
Search children of a node for first named element. More... | |
nserror | libdom_iterate_child_elements (dom_node *parent, libdom_iterate_cb cb, void *ctx) |
nserror | libdom_parse_file (const char *filename, const char *encoding, dom_document **doc) |
nserror | libdom_hubbub_error_to_nserror (dom_hubbub_error error) |
Convert libdom hubbub binding errors to nserrors. More... | |
nserror | libdom_dump_structure (dom_node *node, FILE *f, int depth) |
Walk though a DOM (sub)tree, in depth first order, printing DOM structure. More... | |
libdom utilities (implementation).
Definition in file libdom.h.
typedef nserror(* libdom_iterate_cb) (dom_node *node, void *ctx) |
nserror libdom_dump_structure | ( | dom_node * | node, |
FILE * | f, | ||
int | depth | ||
) |
Walk though a DOM (sub)tree, in depth first order, printing DOM structure.
node | The root node to start from. |
f | The file to write output into. |
depth | The depth of 'node' in the (sub)tree. |
Definition at line 331 of file libdom.c.
References dump_dom_element(), libdom_dump_structure(), NSERROR_DOM, and NSERROR_OK.
Referenced by html_debug_dump(), and libdom_dump_structure().
dom_node * libdom_find_first_element | ( | dom_node * | parent, |
lwc_string * | element_name | ||
) |
Search children of a node for first named element.
parent | dom_node to search children of, or NULL |
element_name | name of element to find |
Definition at line 33 of file libdom.c.
References next_node(), node_name(), and parent.
Referenced by hotlist_load(), and hotlist_load_entry().
nserror libdom_hubbub_error_to_nserror | ( | dom_hubbub_error | error | ) |
Convert libdom hubbub binding errors to nserrors.
error | The hubbub binding error to convert |
Definition at line 122 of file libdom.c.
References NSERROR_BAD_ENCODING, NSERROR_BAD_PARAMETER, NSERROR_DOM, NSERROR_ENCODING_CHANGE, NSERROR_INVALID, NSERROR_NEED_DATA, NSERROR_NOMEM, NSERROR_NOT_FOUND, NSERROR_OK, and NSERROR_UNKNOWN.
Referenced by html_begin_conversion(), html_create_html_data(), html_process_data(), html_process_encoding_change(), and libdom_parse_file().
nserror libdom_iterate_child_elements | ( | dom_node * | parent, |
libdom_iterate_cb | cb, | ||
void * | ctx | ||
) |
Definition at line 76 of file libdom.c.
References NSERROR_NOMEM, NSERROR_OK, parent, and type.
Referenced by hotlist_load_directory().
nserror libdom_parse_file | ( | const char * | filename, |
const char * | encoding, | ||
dom_document ** | doc | ||
) |
Definition at line 381 of file libdom.c.
References BUF_SIZE, ignore_dom_msg(), libdom_hubbub_error_to_nserror(), NSERROR_DOM, NSERROR_NOT_FOUND, and NSERROR_OK.
Referenced by hotlist_load().