Hubbub $Id$
|
#include <hubbub/functypes.h>
Go to the source code of this file.
Classes | |
struct | hubbub_tree_handler |
Hubbub tree handler. More... | |
Typedefs | |
typedef hubbub_error(* | hubbub_tree_create_comment) (void *ctx, const hubbub_string *data, void **result) |
Create a comment node. More... | |
typedef hubbub_error(* | hubbub_tree_create_doctype) (void *ctx, const hubbub_doctype *doctype, void **result) |
Create a doctype node. More... | |
typedef hubbub_error(* | hubbub_tree_create_element) (void *ctx, const hubbub_tag *tag, void **result) |
Create an element node. More... | |
typedef hubbub_error(* | hubbub_tree_create_text) (void *ctx, const hubbub_string *data, void **result) |
Create a text node. More... | |
typedef hubbub_error(* | hubbub_tree_ref_node) (void *ctx, void *node) |
Increase a node's reference count. More... | |
typedef hubbub_error(* | hubbub_tree_unref_node) (void *ctx, void *node) |
Decrease a node's reference count. More... | |
typedef hubbub_error(* | hubbub_tree_append_child) (void *ctx, void *parent, void *child, void **result) |
Append a node to the end of another's child list. More... | |
typedef hubbub_error(* | hubbub_tree_insert_before) (void *ctx, void *parent, void *child, void *ref_child, void **result) |
Insert a node into another's child list. More... | |
typedef hubbub_error(* | hubbub_tree_remove_child) (void *ctx, void *parent, void *child, void **result) |
Remove a node from another's child list. More... | |
typedef hubbub_error(* | hubbub_tree_clone_node) (void *ctx, void *node, bool deep, void **result) |
Clone a node. More... | |
typedef hubbub_error(* | hubbub_tree_reparent_children) (void *ctx, void *node, void *new_parent) |
Move all the children of one node to another. More... | |
typedef hubbub_error(* | hubbub_tree_get_parent) (void *ctx, void *node, bool element_only, void **result) |
Retrieve the parent of a node. More... | |
typedef hubbub_error(* | hubbub_tree_has_children) (void *ctx, void *node, bool *result) |
Determine if a node has children. More... | |
typedef hubbub_error(* | hubbub_tree_form_associate) (void *ctx, void *form, void *node) |
Associate a node with a form. More... | |
typedef hubbub_error(* | hubbub_tree_add_attributes) (void *ctx, void *node, const hubbub_attribute *attributes, uint32_t n_attributes) |
Add attributes to a node. More... | |
typedef hubbub_error(* | hubbub_tree_set_quirks_mode) (void *ctx, hubbub_quirks_mode mode) |
Notification of the quirks mode of a document. More... | |
typedef hubbub_error(* | hubbub_tree_encoding_change) (void *ctx, const char *encname) |
Notification that a potential encoding change is required. More... | |
typedef hubbub_error(* | hubbub_tree_complete_script) (void *ctx, void *script) |
Complete script processing. More... | |
typedef struct hubbub_tree_handler | hubbub_tree_handler |
Hubbub tree handler. More... | |
typedef hubbub_error(* hubbub_tree_add_attributes) (void *ctx, void *node, const hubbub_attribute *attributes, uint32_t n_attributes) |
Add attributes to a node.
ctx | Client's context |
node | The node to add to |
attributes | Array of attributes to add |
n_attributes | Number of entries in array |
typedef hubbub_error(* hubbub_tree_append_child) (void *ctx, void *parent, void *child, void **result) |
Append a node to the end of another's child list.
ctx | Client's context |
parent | The node to append to |
child | The node to append |
result | Pointer to location to receive appended node |
Postcondition: if successful, result's reference count is increased by 1
Important: *result may not == child (e.g. if text nodes got coalesced)
typedef hubbub_error(* hubbub_tree_clone_node) (void *ctx, void *node, bool deep, void **result) |
Clone a node.
ctx | Client's context |
node | The node to clone |
deep | True to clone entire subtree, false to clone only the node |
result | Pointer to location to receive clone |
Postcondition: if successful, result's reference count must be 1.
typedef hubbub_error(* hubbub_tree_complete_script) (void *ctx, void *script) |
Complete script processing.
ctx | Client's context |
script | The script |
typedef hubbub_error(* hubbub_tree_create_comment) (void *ctx, const hubbub_string *data, void **result) |
Create a comment node.
ctx | Client's context |
data | String content of node |
result | Pointer to location to receive created node |
Postcondition: if successful, result's reference count must be 1.
typedef hubbub_error(* hubbub_tree_create_doctype) (void *ctx, const hubbub_doctype *doctype, void **result) |
Create a doctype node.
ctx | Client's context |
doctype | Data for doctype node (name, public id, system id) |
result | Pointer to location to receive created node |
Postcondition: if successful, result's reference count must be 1.
typedef hubbub_error(* hubbub_tree_create_element) (void *ctx, const hubbub_tag *tag, void **result) |
Create an element node.
ctx | Client's context |
tag | Data for element node (namespace, name, attributes) |
result | Pointer to location to receive created node |
Postcondition: if successful, result's reference count must be 1.
typedef hubbub_error(* hubbub_tree_create_text) (void *ctx, const hubbub_string *data, void **result) |
Create a text node.
ctx | Client's context |
data | String content of node |
result | Pointer to location to receive created node |
Postcondition: if successful, result's reference count must be 1.
typedef hubbub_error(* hubbub_tree_encoding_change) (void *ctx, const char *encname) |
Notification that a potential encoding change is required.
ctx | Client's context |
charset | The new charset for the source data |
typedef hubbub_error(* hubbub_tree_form_associate) (void *ctx, void *form, void *node) |
Associate a node with a form.
ctx | Client's context |
form | The form to associate with |
node | The node to associate |
typedef hubbub_error(* hubbub_tree_get_parent) (void *ctx, void *node, bool element_only, void **result) |
Retrieve the parent of a node.
ctx | Client context |
node | Node to retrieve the parent of |
element_only | True if the parent must be an element, false otherwise |
result | Pointer to location to receive parent node |
If there is a parent node, but it is not an element node and element_only is true, then act as if no parent existed.
Postcondition: if there is a parent, then result's reference count must be increased.
typedef struct hubbub_tree_handler hubbub_tree_handler |
Hubbub tree handler.
typedef hubbub_error(* hubbub_tree_has_children) (void *ctx, void *node, bool *result) |
Determine if a node has children.
ctx | Client's context |
node | The node to inspect |
result | Location to receive result |
typedef hubbub_error(* hubbub_tree_insert_before) (void *ctx, void *parent, void *child, void *ref_child, void **result) |
Insert a node into another's child list.
ctx | Client's context |
parent | The node to insert into |
child | The node to insert |
ref_child | The node to insert before |
result | Pointer to location to receive inserted node |
Postcondition: if successful, result's reference count is increased by 1
Important: *result may not == child (e.g. if text nodes got coalesced)
typedef hubbub_error(* hubbub_tree_ref_node) (void *ctx, void *node) |
Increase a node's reference count.
ctx | Client's context |
node | Node to reference |
Postcondition: node's reference count is one larger than before
typedef hubbub_error(* hubbub_tree_remove_child) (void *ctx, void *parent, void *child, void **result) |
Remove a node from another's child list.
ctx | Client context |
parent | The node to remove from |
child | The node to remove |
result | Pointer to location to receive removed node |
Postcondition: if successful, result's reference count is increased by 1
typedef hubbub_error(* hubbub_tree_reparent_children) (void *ctx, void *node, void *new_parent) |
Move all the children of one node to another.
ctx | Client's context |
node | The initial parent node |
new_parent | The new parent node |
typedef hubbub_error(* hubbub_tree_set_quirks_mode) (void *ctx, hubbub_quirks_mode mode) |
Notification of the quirks mode of a document.
ctx | Client's context |
mode | The quirks mode |
typedef hubbub_error(* hubbub_tree_unref_node) (void *ctx, void *node) |
Decrease a node's reference count.
ctx | Client's context |
node | Node to reference |
Postcondition: If the node's reference count becomes zero, and it has no parent, and it is not the document node, then it is destroyed. Otherwise, the reference count is one less than before.