libdom
Loading...
Searching...
No Matches
Functions
dom-structure-dump.c File Reference
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dom/dom.h>
#include <dom/walk.h>
#include <dom/bindings/hubbub/parser.h>

Functions

dom_documentcreate_doc_dom_from_file (char *file)
 
bool dump_dom_element_attribute (dom_node *node, char *attribute)
 
bool dump_dom_element (dom_node *node, int depth, bool close)
 
enum dom_walk_cmd dump_dom_structure__cb (enum dom_walk_stage stage, dom_node_type type, dom_node *node, void *pw)
 
bool dump_dom_structure (dom_node *node, int depth)
 
void sd__fini_lwc_callback (lwc_string *str, void *pw)
 
int main (int argc, char **argv)
 

Function Documentation

◆ create_doc_dom_from_file()

dom_document * create_doc_dom_from_file ( char * file)

Generate a LibDOM document DOM from an HTML file

Parameters
fileThe file path
Returns
pointer to DOM document, or NULL on error

◆ dump_dom_element()

bool dump_dom_element ( dom_node * node,
int depth,
bool close )

Print a line in a DOM structure dump for an element

Parameters
nodeThe node to dump
depthThe node's depth
Returns
true on success, or false on error

◆ dump_dom_element_attribute()

bool dump_dom_element_attribute ( dom_node * node,
char * attribute )

Dump attribute/value for an element node

Parameters
nodeThe element node to dump attribute details for
attributeThe attribute to dump
Returns
true on success, or false on error

◆ dump_dom_structure()

bool dump_dom_structure ( dom_node * node,
int depth )

Walk though a DOM (sub)tree, in depth first order, printing DOM structure.

Parameters
nodeThe root node to start from
depthThe depth of 'node' in the (sub)tree

◆ dump_dom_structure__cb()

enum dom_walk_cmd dump_dom_structure__cb ( enum dom_walk_stage stage,
dom_node_type type,
dom_node * node,
void * pw )

Structure dump callback for DOM walker.

◆ main()

int main ( int argc,
char ** argv )

Main entry point from OS.

◆ sd__fini_lwc_callback()

void sd__fini_lwc_callback ( lwc_string * str,
void * pw )