Skip to content

Commit

Permalink
expose document set_input_encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
krichprollsch committed Apr 19, 2024
1 parent 5f945d6 commit 3c38e7e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions include/dom/core/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ typedef struct dom_document_vtable {
struct dom_element **result);
dom_exception (*dom_document_get_input_encoding)(
struct dom_document *doc, dom_string **result);
dom_exception (*dom_document_set_input_encoding)(
struct dom_document *doc, dom_string *encoding);
dom_exception (*dom_document_get_xml_encoding)(struct dom_document *doc,
dom_string **result);
dom_exception (*dom_document_get_xml_standalone)(
Expand Down Expand Up @@ -329,6 +331,15 @@ static inline dom_exception dom_document_get_input_encoding(
#define dom_document_get_input_encoding(d, r) dom_document_get_input_encoding(\
(dom_document *) (d), (r))

static inline dom_exception dom_document_set_input_encoding(
struct dom_document *doc, dom_string *encoding)
{
return ((dom_document_vtable *) ((dom_node *) doc)->vtable)->
dom_document_set_input_encoding(doc, encoding);
}
#define dom_document_set_input_encoding(d, e) dom_document_set_input_encoding(\
(dom_document *) (d), (e))

static inline dom_exception dom_document_get_xml_encoding(
struct dom_document *doc, dom_string **result)
{
Expand Down
1 change: 1 addition & 0 deletions src/core/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ dom_exception _dom_document_set_text_content(dom_node_internal *node,
_dom_document_get_elements_by_tag_name_ns, \
_dom_document_get_element_by_id, \
_dom_document_get_input_encoding, \
_dom_document_set_input_encoding, \
_dom_document_get_xml_encoding, \
_dom_document_get_xml_standalone, \
_dom_document_set_xml_standalone, \
Expand Down
1 change: 1 addition & 0 deletions src/html/html_document.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ bool anchors_callback(struct dom_node_internal *node, void *ctx);
_dom_html_document_get_elements_by_tag_name_ns, \
_dom_document_get_element_by_id, \
_dom_document_get_input_encoding, \
_dom_document_set_input_encoding, \
_dom_document_get_xml_encoding, \
_dom_document_get_xml_standalone, \
_dom_document_set_xml_standalone, \
Expand Down

0 comments on commit 3c38e7e

Please sign in to comment.