Go to the source code of this file.
|
| typedef hubbub_error(* | hubbub_tree_create_comment) (void *ctx, const hubbub_string *data, void **result) |
| |
| typedef hubbub_error(* | hubbub_tree_create_doctype) (void *ctx, const hubbub_doctype *doctype, void **result) |
| |
| typedef hubbub_error(* | hubbub_tree_create_element) (void *ctx, const hubbub_tag *tag, void **result) |
| |
| typedef hubbub_error(* | hubbub_tree_create_text) (void *ctx, const hubbub_string *data, void **result) |
| |
| typedef hubbub_error(* | hubbub_tree_ref_node) (void *ctx, void *node) |
| |
| typedef hubbub_error(* | hubbub_tree_unref_node) (void *ctx, void *node) |
| |
| typedef hubbub_error(* | hubbub_tree_append_child) (void *ctx, void *parent, void *child, void **result) |
| |
| typedef hubbub_error(* | hubbub_tree_insert_before) (void *ctx, void *parent, void *child, void *ref_child, void **result) |
| |
| typedef hubbub_error(* | hubbub_tree_remove_child) (void *ctx, void *parent, void *child, void **result) |
| |
| typedef hubbub_error(* | hubbub_tree_clone_node) (void *ctx, void *node, bool deep, void **result) |
| |
| typedef hubbub_error(* | hubbub_tree_reparent_children) (void *ctx, void *node, void *new_parent) |
| |
| typedef hubbub_error(* | hubbub_tree_get_parent) (void *ctx, void *node, bool element_only, void **result) |
| |
| typedef hubbub_error(* | hubbub_tree_has_children) (void *ctx, void *node, bool *result) |
| |
| typedef hubbub_error(* | hubbub_tree_form_associate) (void *ctx, void *form, void *node) |
| |
| typedef hubbub_error(* | hubbub_tree_add_attributes) (void *ctx, void *node, const hubbub_attribute *attributes, uint32_t n_attributes) |
| |
| typedef hubbub_error(* | hubbub_tree_set_quirks_mode) (void *ctx, hubbub_quirks_mode mode) |
| |
| typedef hubbub_error(* | hubbub_tree_encoding_change) (void *ctx, const char *encname) |
| |
| typedef hubbub_error(* | hubbub_tree_complete_script) (void *ctx, void *script) |
| |
| typedef struct hubbub_tree_handler | hubbub_tree_handler |
| |
◆ hubbub_tree_add_attributes
Add attributes to a node
- Parameters
-
| ctx | Client's context |
| node | The node to add to |
| attributes | Array of attributes to add |
| n_attributes | Number of entries in array |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
◆ hubbub_tree_append_child
| 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
- Parameters
-
| ctx | Client's context |
| parent | The node to append to |
| child | The node to append |
| result | Pointer to location to receive appended node |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
Postcondition: if successful, result's reference count is increased by 1
Important: *result may not == child (e.g. if text nodes got coalesced)
◆ hubbub_tree_clone_node
Clone a node
- Parameters
-
| 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 |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
Postcondition: if successful, result's reference count must be 1.
◆ hubbub_tree_complete_script
| typedef hubbub_error(* hubbub_tree_complete_script) (void *ctx, void *script) |
Complete script processing
- Parameters
-
| ctx | Client's context |
| script | The script |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
◆ hubbub_tree_create_comment
Create a comment node
- Parameters
-
| ctx | Client's context |
| data | String content of node |
| result | Pointer to location to receive created node |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
Postcondition: if successful, result's reference count must be 1.
◆ hubbub_tree_create_doctype
Create a doctype node
- Parameters
-
| ctx | Client's context |
| doctype | Data for doctype node (name, public id, system id) |
| result | Pointer to location to receive created node |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
Postcondition: if successful, result's reference count must be 1.
◆ hubbub_tree_create_element
Create an element node
- Parameters
-
| ctx | Client's context |
| tag | Data for element node (namespace, name, attributes) |
| result | Pointer to location to receive created node |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
Postcondition: if successful, result's reference count must be 1.
◆ hubbub_tree_create_text
Create a text node
- Parameters
-
| ctx | Client's context |
| data | String content of node |
| result | Pointer to location to receive created node |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
Postcondition: if successful, result's reference count must be 1.
◆ hubbub_tree_encoding_change
| typedef hubbub_error(* hubbub_tree_encoding_change) (void *ctx, const char *encname) |
Notification that a potential encoding change is required
- Parameters
-
| ctx | Client's context |
| charset | The new charset for the source data |
- Returns
- HUBBUB_OK to continue using the current input handler, HUBBUB_ENCODINGCHANGE to stop processing immediately and return control to the client, appropriate error otherwise.
◆ hubbub_tree_form_associate
| typedef hubbub_error(* hubbub_tree_form_associate) (void *ctx, void *form, void *node) |
Associate a node with a form
- Parameters
-
| ctx | Client's context |
| form | The form to associate with |
| node | The node to associate |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
◆ hubbub_tree_get_parent
| typedef hubbub_error(* hubbub_tree_get_parent) (void *ctx, void *node, bool element_only, void **result) |
Retrieve the parent of a node
- Parameters
-
| 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 |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
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.
◆ hubbub_tree_handler
◆ hubbub_tree_has_children
Determine if a node has children
- Parameters
-
| ctx | Client's context |
| node | The node to inspect |
| result | Location to receive result |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
◆ hubbub_tree_insert_before
| 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
- Parameters
-
| 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 |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
Postcondition: if successful, result's reference count is increased by 1
Important: *result may not == child (e.g. if text nodes got coalesced)
◆ hubbub_tree_ref_node
Increase a node's reference count
- Parameters
-
| ctx | Client's context |
| node | Node to reference |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
Postcondition: node's reference count is one larger than before
◆ hubbub_tree_remove_child
| typedef hubbub_error(* hubbub_tree_remove_child) (void *ctx, void *parent, void *child, void **result) |
Remove a node from another's child list
- Parameters
-
| ctx | Client context |
| parent | The node to remove from |
| child | The node to remove |
| result | Pointer to location to receive removed node |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
Postcondition: if successful, result's reference count is increased by 1
◆ hubbub_tree_reparent_children
| typedef hubbub_error(* hubbub_tree_reparent_children) (void *ctx, void *node, void *new_parent) |
Move all the children of one node to another
- Parameters
-
| ctx | Client's context |
| node | The initial parent node |
| new_parent | The new parent node |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
◆ hubbub_tree_set_quirks_mode
Notification of the quirks mode of a document
- Parameters
-
| ctx | Client's context |
| mode | The quirks mode |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
◆ hubbub_tree_unref_node
Decrease a node's reference count
- Parameters
-
| ctx | Client's context |
| node | Node to reference |
- Returns
- HUBBUB_OK on success, appropriate error otherwise.
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.