From 05a3cf37e14017a3593ed9e17e4a83b003ef29d6 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 7 Apr 2011 23:28:32 +0000 Subject: s/struct dom_string/dom_string/g svn path=/trunk/libdom/; revision=12172 --- bindings/hubbub/parser.c | 8 +- bindings/xml/xmlparser.c | 22 ++--- include/dom/core/attr.h | 19 ++-- include/dom/core/characterdata.h | 38 ++++---- include/dom/core/document.h | 137 +++++++++++++-------------- include/dom/core/document_type.h | 25 +++-- include/dom/core/element.h | 135 +++++++++++++------------- include/dom/core/namednodemap.h | 14 +-- include/dom/core/node.h | 116 +++++++++++------------ include/dom/core/string.h | 48 +++++----- include/dom/core/text.h | 13 ++- include/dom/core/typeinfo.h | 17 ++-- include/dom/dom.h | 2 +- include/dom/events/custom_event.h | 7 +- include/dom/events/document_event.h | 10 +- include/dom/events/event.h | 23 +++-- include/dom/events/event_target.h | 22 ++--- include/dom/events/keyboard_event.h | 34 +++---- include/dom/events/mouse_event.h | 14 +-- include/dom/events/mouse_multi_wheel_event.h | 14 +-- include/dom/events/mouse_wheel_event.h | 12 +-- include/dom/events/mutation_event.h | 38 ++++---- include/dom/events/mutation_name_event.h | 34 +++---- include/dom/events/text_event.h | 24 ++--- include/dom/events/ui_event.h | 12 +-- include/dom/html/html_collection.h | 4 +- include/dom/html/html_document.h | 20 ++-- include/dom/html/html_element.h | 12 +-- include/dom/html/html_options_collection.h | 4 +- include/dom/html/html_title_element.h | 7 +- src/core/attr.c | 20 ++-- src/core/attr.h | 17 ++-- src/core/cdatasection.c | 2 +- src/core/cdatasection.h | 4 +- src/core/characterdata.c | 22 ++--- src/core/characterdata.h | 14 +-- src/core/comment.c | 2 +- src/core/comment.h | 3 +- src/core/doc_fragment.c | 2 +- src/core/doc_fragment.h | 3 +- src/core/document.c | 50 +++++----- src/core/document.h | 54 +++++------ src/core/document_type.c | 20 ++-- src/core/document_type.h | 18 ++-- src/core/element.c | 102 ++++++++++---------- src/core/element.h | 59 ++++++------ src/core/entity_ref.c | 4 +- src/core/entity_ref.h | 5 +- src/core/namednodemap.c | 12 +-- src/core/namednodemap.h | 13 ++- src/core/node.c | 42 ++++---- src/core/node.h | 46 ++++----- src/core/nodelist.h | 1 - src/core/pi.c | 2 +- src/core/pi.h | 3 +- src/core/string.c | 76 +++++++-------- src/core/string.h | 8 +- src/core/text.c | 10 +- src/core/text.h | 9 +- src/core/typeinfo.c | 6 +- src/events/custom_event.c | 2 +- src/events/document_event.c | 4 +- src/events/event.c | 10 +- src/events/event_target.c | 10 +- src/events/event_target.h | 9 +- src/events/keyboard_event.c | 18 ++-- src/events/keyboard_event.h | 4 +- src/events/mouse_event.c | 6 +- src/events/mouse_multi_wheel_event.c | 6 +- src/events/mouse_wheel_event.c | 6 +- src/events/mutation_event.c | 18 ++-- src/events/mutation_event.h | 6 +- src/events/mutation_name_event.c | 14 +-- src/events/mutation_name_event.h | 4 +- src/events/text_event.c | 10 +- src/events/text_event.h | 2 +- src/events/ui_event.c | 4 +- src/html/html_base_element.c | 4 +- src/html/html_base_element.h | 4 +- src/html/html_body_element.c | 4 +- src/html/html_body_element.h | 4 +- src/html/html_collection.c | 2 +- src/html/html_document.c | 20 ++-- src/html/html_document.h | 10 +- src/html/html_element.c | 4 +- src/html/html_element.h | 4 +- src/html/html_form_element.c | 4 +- src/html/html_form_element.h | 4 +- src/html/html_head_element.c | 4 +- src/html/html_head_element.h | 4 +- src/html/html_html_element.c | 4 +- src/html/html_html_element.h | 4 +- src/html/html_isindex_element.c | 4 +- src/html/html_isindex_element.h | 4 +- src/html/html_link_element.c | 4 +- src/html/html_link_element.h | 4 +- src/html/html_meta_element.c | 4 +- src/html/html_meta_element.h | 4 +- src/html/html_options_collection.c | 2 +- src/html/html_select_element.c | 4 +- src/html/html_select_element.h | 4 +- src/html/html_style_element.c | 4 +- src/html/html_style_element.h | 4 +- src/html/html_title_element.c | 8 +- src/html/html_title_element.h | 4 +- src/utils/namespace.c | 18 ++-- src/utils/namespace.h | 15 ++- src/utils/resource_mgr.c | 4 +- src/utils/resource_mgr.h | 6 +- src/utils/validate.c | 4 +- src/utils/validate.h | 7 +- 111 files changed, 906 insertions(+), 929 deletions(-) diff --git a/bindings/hubbub/parser.c b/bindings/hubbub/parser.c index 9df238f..ad234e8 100644 --- a/bindings/hubbub/parser.c +++ b/bindings/hubbub/parser.c @@ -283,7 +283,7 @@ static hubbub_error create_comment(void *parser, const hubbub_string *data, { dom_hubbub_parser *dom_parser = (dom_hubbub_parser *) parser; dom_exception err; - struct dom_string *str; + dom_string *str; struct dom_comment *comment; *result = NULL; @@ -386,7 +386,7 @@ static hubbub_error create_element(void *parser, const hubbub_tag *tag, { dom_hubbub_parser *dom_parser = (dom_hubbub_parser *) parser; dom_exception err; - struct dom_string *name; + dom_string *name; struct dom_element *element = NULL; hubbub_error herr; @@ -443,7 +443,7 @@ static hubbub_error create_text(void *parser, const hubbub_string *data, { dom_hubbub_parser *dom_parser = (dom_hubbub_parser *) parser; dom_exception err; - struct dom_string *str; + dom_string *str; struct dom_text *text = NULL; *result = NULL; @@ -690,7 +690,7 @@ static hubbub_error add_attributes(void *parser, void *node, uint32_t i; for (i = 0; i < n_attributes; i++) { - struct dom_string *name, *value; + dom_string *name, *value; err = dom_string_create(dom_parser->alloc, dom_parser->pw, attributes[i].name.ptr, attributes[i].name.len, &name); diff --git a/bindings/xml/xmlparser.c b/bindings/xml/xmlparser.c index 7f15b83..fbb2c2f 100644 --- a/bindings/xml/xmlparser.c +++ b/bindings/xml/xmlparser.c @@ -94,7 +94,7 @@ struct dom_xml_parser { bool complete; /**< Indicate stream completion */ - struct dom_string *udkey; /**< Key for DOM node user data */ + dom_string *udkey; /**< Key for DOM node user data */ dom_alloc alloc; /**< Memory (de)allocation function */ void *pw; /**< Pointer to client data */ @@ -639,7 +639,7 @@ void xml_parser_add_element_node(dom_xml_parser *parser, /* Create the element node */ if (child->ns == NULL) { /* No namespace */ - struct dom_string *tag_name; + dom_string *tag_name; /* Create tag name DOM string */ err = _dom_document_create_string(parser->doc, @@ -666,8 +666,8 @@ void xml_parser_add_element_node(dom_xml_parser *parser, dom_string_unref(tag_name); } else { /* Namespace */ - struct dom_string *namespace; - struct dom_string *qname; + dom_string *namespace; + dom_string *qname; size_t qnamelen = (child->ns->prefix != NULL ? strlen((const char *) child->ns->prefix) : 0) + (child->ns->prefix != NULL ? 1 : 0) /* ':' */ + @@ -730,7 +730,7 @@ void xml_parser_add_element_node(dom_xml_parser *parser, /* Create attribute node */ if (a->ns == NULL) { /* Attribute has no namespace */ - struct dom_string *name; + dom_string *name; /* Create attribute name DOM string */ err = _dom_document_create_string(parser->doc, @@ -758,8 +758,8 @@ void xml_parser_add_element_node(dom_xml_parser *parser, dom_string_unref(name); } else { /* Attribute has namespace */ - struct dom_string *namespace; - struct dom_string *qname; + dom_string *namespace; + dom_string *qname; size_t qnamelen = (a->ns->prefix != NULL ? strlen((const char *) a->ns->prefix) : 0) + (a->ns->prefix != NULL ? 1 : 0) /* ':' */ + @@ -904,7 +904,7 @@ void xml_parser_add_text_node(dom_xml_parser *parser, struct dom_node *parent, xmlNodePtr child) { struct dom_text *text, *ins_text = NULL; - struct dom_string *data; + dom_string *data; dom_exception err; /* Create DOM string data for text node */ @@ -965,7 +965,7 @@ void xml_parser_add_cdata_section(dom_xml_parser *parser, struct dom_node *parent, xmlNodePtr child) { struct dom_cdata_section *cdata, *ins_cdata = NULL; - struct dom_string *data; + dom_string *data; dom_exception err; /* Create DOM string data for cdata section */ @@ -1026,7 +1026,7 @@ void xml_parser_add_entity_reference(dom_xml_parser *parser, struct dom_node *parent, xmlNodePtr child) { struct dom_entity_reference *entity, *ins_entity = NULL; - struct dom_string *name; + dom_string *name; xmlNodePtr c; dom_exception err; @@ -1102,7 +1102,7 @@ void xml_parser_add_comment(dom_xml_parser *parser, struct dom_node *parent, xmlNodePtr child) { struct dom_comment *comment, *ins_comment = NULL; - struct dom_string *data; + dom_string *data; dom_exception err; /* Create DOM string data for comment */ diff --git a/include/dom/core/attr.h b/include/dom/core/attr.h index f5105f7..10d4a79 100644 --- a/include/dom/core/attr.h +++ b/include/dom/core/attr.h @@ -17,7 +17,6 @@ struct dom_element; struct dom_type_info; struct dom_node; struct dom_attr; -struct dom_string; typedef struct dom_attr dom_attr; @@ -37,13 +36,13 @@ typedef struct dom_attr_vtable { struct dom_node_vtable base; dom_exception (*dom_attr_get_name)(struct dom_attr *attr, - struct dom_string **result); + dom_string **result); dom_exception (*dom_attr_get_specified)(struct dom_attr *attr, bool *result); dom_exception (*dom_attr_get_value)(struct dom_attr *attr, - struct dom_string **result); + dom_string **result); dom_exception (*dom_attr_set_value)(struct dom_attr *attr, - struct dom_string *value); + dom_string *value); dom_exception (*dom_attr_get_owner_element)(struct dom_attr *attr, struct dom_element **result); dom_exception (*dom_attr_get_schema_type_info)(struct dom_attr *attr, @@ -52,13 +51,13 @@ typedef struct dom_attr_vtable { } dom_attr_vtable; static inline dom_exception dom_attr_get_name(struct dom_attr *attr, - struct dom_string **result) + dom_string **result) { return ((dom_attr_vtable *) ((dom_node *) attr)->vtable)-> dom_attr_get_name(attr, result); } #define dom_attr_get_name(a, r) dom_attr_get_name((struct dom_attr *) (a), \ - (struct dom_string **) (r)) + (dom_string **) (r)) static inline dom_exception dom_attr_get_specified(struct dom_attr *attr, bool *result) @@ -70,22 +69,22 @@ static inline dom_exception dom_attr_get_specified(struct dom_attr *attr, (struct dom_attr *) (a), (bool *) (r)) static inline dom_exception dom_attr_get_value(struct dom_attr *attr, - struct dom_string **result) + dom_string **result) { return ((dom_attr_vtable *) ((dom_node *) attr)->vtable)-> dom_attr_get_value(attr, result); } #define dom_attr_get_value(a, r) dom_attr_get_value((struct dom_attr *) (a), \ - (struct dom_string **) (r)) + (dom_string **) (r)) static inline dom_exception dom_attr_set_value(struct dom_attr *attr, - struct dom_string *value) + dom_string *value) { return ((dom_attr_vtable *) ((dom_node *) attr)->vtable)-> dom_attr_set_value(attr, value); } #define dom_attr_set_value(a, v) dom_attr_set_value((struct dom_attr *) (a), \ - (struct dom_string *) (v)) + (dom_string *) (v)) static inline dom_exception dom_attr_get_owner_element(struct dom_attr *attr, struct dom_element **result) diff --git a/include/dom/core/characterdata.h b/include/dom/core/characterdata.h index 745407c..322fb03 100644 --- a/include/dom/core/characterdata.h +++ b/include/dom/core/characterdata.h @@ -11,8 +11,6 @@ #include #include -struct dom_string; - typedef struct dom_characterdata dom_characterdata; /* The vtable for characterdata */ @@ -21,48 +19,48 @@ typedef struct dom_characterdata_vtable { dom_exception (*dom_characterdata_get_data)( struct dom_characterdata *cdata, - struct dom_string **data); + dom_string **data); dom_exception (*dom_characterdata_set_data)( struct dom_characterdata *cdata, - struct dom_string *data); + dom_string *data); dom_exception (*dom_characterdata_get_length)( struct dom_characterdata *cdata, unsigned long *length); dom_exception (*dom_characterdata_substring_data)( struct dom_characterdata *cdata, unsigned long offset, - unsigned long count, struct dom_string **data); + unsigned long count, dom_string **data); dom_exception (*dom_characterdata_append_data)( struct dom_characterdata *cdata, - struct dom_string *data); + dom_string *data); dom_exception (*dom_characterdata_insert_data)( struct dom_characterdata *cdata, - unsigned long offset, struct dom_string *data); + unsigned long offset, dom_string *data); dom_exception (*dom_characterdata_delete_data)( struct dom_characterdata *cdata, unsigned long offset, unsigned long count); dom_exception (*dom_characterdata_replace_data)( struct dom_characterdata *cdata, unsigned long offset, - unsigned long count, struct dom_string *data); + unsigned long count, dom_string *data); } dom_characterdata_vtable; static inline dom_exception dom_characterdata_get_data( - struct dom_characterdata *cdata, struct dom_string **data) + struct dom_characterdata *cdata, dom_string **data) { return ((dom_characterdata_vtable *) ((dom_node *) cdata)->vtable)-> dom_characterdata_get_data(cdata, data); } #define dom_characterdata_get_data(c, d) dom_characterdata_get_data( \ - (struct dom_characterdata *) (c), (struct dom_string **) (d)) + (struct dom_characterdata *) (c), (dom_string **) (d)) static inline dom_exception dom_characterdata_set_data( - struct dom_characterdata *cdata, struct dom_string *data) + struct dom_characterdata *cdata, dom_string *data) { return ((dom_characterdata_vtable *) ((dom_node *) cdata)->vtable)-> dom_characterdata_set_data(cdata, data); } #define dom_characterdata_set_data(c, d) dom_characterdata_set_data( \ - (struct dom_characterdata *) (c), (struct dom_string *) (d)) + (struct dom_characterdata *) (c), (dom_string *) (d)) static inline dom_exception dom_characterdata_get_length( struct dom_characterdata *cdata, unsigned long *length) @@ -75,7 +73,7 @@ static inline dom_exception dom_characterdata_get_length( static inline dom_exception dom_characterdata_substring_data( struct dom_characterdata *cdata, unsigned long offset, - unsigned long count, struct dom_string **data) + unsigned long count, dom_string **data) { return ((dom_characterdata_vtable *) ((dom_node *) cdata)->vtable)-> dom_characterdata_substring_data(cdata, offset, count, @@ -84,27 +82,27 @@ static inline dom_exception dom_characterdata_substring_data( #define dom_characterdata_substring_data(c, o, ct, d) \ dom_characterdata_substring_data( \ (struct dom_characterdata *) (c), (unsigned long) (o), \ - (unsigned long) (ct), (struct dom_string **) (d)) + (unsigned long) (ct), (dom_string **) (d)) static inline dom_exception dom_characterdata_append_data( - struct dom_characterdata *cdata, struct dom_string *data) + struct dom_characterdata *cdata, dom_string *data) { return ((dom_characterdata_vtable *) ((dom_node *) cdata)->vtable)-> dom_characterdata_append_data(cdata, data); } #define dom_characterdata_append_data(c, d) dom_characterdata_append_data( \ - (struct dom_characterdata *) (c), (struct dom_string *) (d)) + (struct dom_characterdata *) (c), (dom_string *) (d)) static inline dom_exception dom_characterdata_insert_data( struct dom_characterdata *cdata, unsigned long offset, - struct dom_string *data) + dom_string *data) { return ((dom_characterdata_vtable *) ((dom_node *) cdata)->vtable)-> dom_characterdata_insert_data(cdata, offset, data); } #define dom_characterdata_insert_data(c, o, d) dom_characterdata_insert_data( \ (struct dom_characterdata *) (c), (unsigned long) (o), \ - (struct dom_string *) (d)) + (dom_string *) (d)) static inline dom_exception dom_characterdata_delete_data( struct dom_characterdata *cdata, unsigned long offset, @@ -119,7 +117,7 @@ static inline dom_exception dom_characterdata_delete_data( static inline dom_exception dom_characterdata_replace_data( struct dom_characterdata *cdata, unsigned long offset, - unsigned long count, struct dom_string *data) + unsigned long count, dom_string *data) { return ((dom_characterdata_vtable *) ((dom_node *) cdata)->vtable)-> dom_characterdata_replace_data(cdata, offset, count, @@ -128,6 +126,6 @@ static inline dom_exception dom_characterdata_replace_data( #define dom_characterdata_replace_data(c, o, ct, d) \ dom_characterdata_replace_data(\ (struct dom_characterdata *) (c), (unsigned long) (o),\ - (unsigned long) (ct), (struct dom_string *) (d)) + (unsigned long) (ct), (dom_string *) (d)) #endif diff --git a/include/dom/core/document.h b/include/dom/core/document.h index ebe82b8..58d4639 100644 --- a/include/dom/core/document.h +++ b/include/dom/core/document.h @@ -29,7 +29,6 @@ struct dom_entity_reference; struct dom_node; struct dom_nodelist; struct dom_processing_instruction; -struct dom_string; struct dom_text; struct lwc_string_s; @@ -47,74 +46,74 @@ typedef struct dom_document_vtable { dom_exception (*dom_document_get_document_element)( struct dom_document *doc, struct dom_element **result); dom_exception (*dom_document_create_element)(struct dom_document *doc, - struct dom_string *tag_name, + dom_string *tag_name, struct dom_element **result); dom_exception (*dom_document_create_document_fragment)( struct dom_document *doc, struct dom_document_fragment **result); dom_exception (*dom_document_create_text_node)(struct dom_document *doc, - struct dom_string *data, struct dom_text **result); + dom_string *data, struct dom_text **result); dom_exception (*dom_document_create_comment)(struct dom_document *doc, - struct dom_string *data, struct dom_comment **result); + dom_string *data, struct dom_comment **result); dom_exception (*dom_document_create_cdata_section)( - struct dom_document *doc, struct dom_string *data, + struct dom_document *doc, dom_string *data, struct dom_cdata_section **result); dom_exception (*dom_document_create_processing_instruction)( - struct dom_document *doc, struct dom_string *target, - struct dom_string *data, + struct dom_document *doc, dom_string *target, + dom_string *data, struct dom_processing_instruction **result); dom_exception (*dom_document_create_attribute)(struct dom_document *doc, - struct dom_string *name, struct dom_attr **result); + dom_string *name, struct dom_attr **result); dom_exception (*dom_document_create_entity_reference)( - struct dom_document *doc, struct dom_string *name, + struct dom_document *doc, dom_string *name, struct dom_entity_reference **result); dom_exception (*dom_document_get_elements_by_tag_name)( - struct dom_document *doc, struct dom_string *tagname, + struct dom_document *doc, dom_string *tagname, struct dom_nodelist **result); dom_exception (*dom_document_import_node)(struct dom_document *doc, struct dom_node *node, bool deep, struct dom_node **result); dom_exception (*dom_document_create_element_ns)( - struct dom_document *doc, struct dom_string *namespace, - struct dom_string *qname, struct dom_element **result); + struct dom_document *doc, dom_string *namespace, + dom_string *qname, struct dom_element **result); dom_exception (*dom_document_create_attribute_ns)( - struct dom_document *doc, struct dom_string *namespace, - struct dom_string *qname, struct dom_attr **result); + struct dom_document *doc, dom_string *namespace, + dom_string *qname, struct dom_attr **result); dom_exception (*dom_document_get_elements_by_tag_name_ns)( - struct dom_document *doc, struct dom_string *namespace, - struct dom_string *localname, + struct dom_document *doc, dom_string *namespace, + dom_string *localname, struct dom_nodelist **result); dom_exception (*dom_document_get_element_by_id)( - struct dom_document *doc, struct dom_string *id, + struct dom_document *doc, dom_string *id, struct dom_element **result); dom_exception (*dom_document_get_input_encoding)( - struct dom_document *doc, struct dom_string **result); + struct dom_document *doc, dom_string **result); dom_exception (*dom_document_get_xml_encoding)(struct dom_document *doc, - struct dom_string **result); + dom_string **result); dom_exception (*dom_document_get_xml_standalone)( struct dom_document *doc, bool *result); dom_exception (*dom_document_set_xml_standalone)( struct dom_document *doc, bool standalone); dom_exception (*dom_document_get_xml_version)(struct dom_document *doc, - struct dom_string **result); + dom_string **result); dom_exception (*dom_document_set_xml_version)(struct dom_document *doc, - struct dom_string *version); + dom_string *version); dom_exception (*dom_document_get_strict_error_checking)( struct dom_document *doc, bool *result); dom_exception (*dom_document_set_strict_error_checking)( struct dom_document *doc, bool strict); dom_exception (*dom_document_get_uri)(struct dom_document *doc, - struct dom_string **result); + dom_string **result); dom_exception (*dom_document_set_uri)(struct dom_document *doc, - struct dom_string *uri); + dom_string *uri); dom_exception (*dom_document_adopt_node)(struct dom_document *doc, struct dom_node *node, struct dom_node **result); dom_exception (*dom_document_get_dom_config)(struct dom_document *doc, struct dom_configuration **result); dom_exception (*dom_document_normalize)(struct dom_document *doc); dom_exception (*dom_document_rename_node)(struct dom_document *doc, - struct dom_node *node, struct dom_string *namespace, - struct dom_string *qname, struct dom_node **result); + struct dom_node *node, dom_string *namespace, + dom_string *qname, struct dom_node **result); } dom_document_vtable; static inline dom_exception dom_document_get_doctype(struct dom_document *doc, @@ -146,14 +145,14 @@ static inline dom_exception dom_document_get_document_element( (struct dom_element **) (r)) static inline dom_exception dom_document_create_element( - struct dom_document *doc, struct dom_string *tag_name, + struct dom_document *doc, dom_string *tag_name, struct dom_element **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> dom_document_create_element(doc, tag_name, result); } #define dom_document_create_element(d, t, r) dom_document_create_element( \ - (dom_document *) (d), (struct dom_string *) (t), \ + (dom_document *) (d), (dom_string *) (t), \ (struct dom_element **) (r)) static inline dom_exception dom_document_create_document_fragment( @@ -168,7 +167,7 @@ static inline dom_exception dom_document_create_document_fragment( (struct dom_document_fragment **) (r)) static inline dom_exception dom_document_create_text_node( - struct dom_document *doc, struct dom_string *data, + struct dom_document *doc, dom_string *data, struct dom_text **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> @@ -176,21 +175,21 @@ static inline dom_exception dom_document_create_text_node( } #define dom_document_create_text_node(d, data, r) \ dom_document_create_text_node((dom_document *) (d), \ - (struct dom_string *) (data), (struct dom_text **) (r)) + (dom_string *) (data), (struct dom_text **) (r)) static inline dom_exception dom_document_create_comment( - struct dom_document *doc, struct dom_string *data, + struct dom_document *doc, dom_string *data, struct dom_comment **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> dom_document_create_comment(doc, data, result); } #define dom_document_create_comment(d, data, r) dom_document_create_comment( \ - (dom_document *) (d), (struct dom_string *) (data), \ + (dom_document *) (d), (dom_string *) (data), \ (struct dom_comment **) (r)) static inline dom_exception dom_document_create_cdata_section( - struct dom_document *doc, struct dom_string *data, + struct dom_document *doc, dom_string *data, struct dom_cdata_section **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> @@ -198,12 +197,12 @@ static inline dom_exception dom_document_create_cdata_section( } #define dom_document_create_cdata_section(d, data, r) \ dom_document_create_cdata_section((dom_document *) (d), \ - (struct dom_string *) (data), \ + (dom_string *) (data), \ (struct dom_cdata_section **) (r)) static inline dom_exception dom_document_create_processing_instruction( - struct dom_document *doc, struct dom_string *target, - struct dom_string *data, + struct dom_document *doc, dom_string *target, + dom_string *data, struct dom_processing_instruction **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> @@ -212,23 +211,23 @@ static inline dom_exception dom_document_create_processing_instruction( } #define dom_document_create_processing_instruction(d, t, data, r) \ dom_document_create_processing_instruction( \ - (dom_document *) (d), (struct dom_string *) (t), \ - (struct dom_string *) (data), \ + (dom_document *) (d), (dom_string *) (t), \ + (dom_string *) (data), \ (struct dom_processing_instruction **) (r)) static inline dom_exception dom_document_create_attribute( - struct dom_document *doc, struct dom_string *name, + struct dom_document *doc, dom_string *name, struct dom_attr **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> dom_document_create_attribute(doc, name, result); } #define dom_document_create_attribute(d, n, r) dom_document_create_attribute( \ - (dom_document *) (d), (struct dom_string *) (n), \ + (dom_document *) (d), (dom_string *) (n), \ (struct dom_attr **) (r)) static inline dom_exception dom_document_create_entity_reference( - struct dom_document *doc, struct dom_string *name, + struct dom_document *doc, dom_string *name, struct dom_entity_reference **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> @@ -237,10 +236,10 @@ static inline dom_exception dom_document_create_entity_reference( } #define dom_document_create_entity_reference(d, n, r) \ dom_document_create_entity_reference((dom_document *) (d), \ - (struct dom_string *) (n), (struct dom_entity_reference **) (r)) + (dom_string *) (n), (struct dom_entity_reference **) (r)) static inline dom_exception dom_document_get_elements_by_tag_name( - struct dom_document *doc, struct dom_string *tagname, + struct dom_document *doc, dom_string *tagname, struct dom_nodelist **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> @@ -249,7 +248,7 @@ static inline dom_exception dom_document_get_elements_by_tag_name( } #define dom_document_get_elements_by_tag_name(d, t, r) \ dom_document_get_elements_by_tag_name((dom_document *) (d), \ - (struct dom_string *) (t), (struct dom_nodelist **) (r)) + (dom_string *) (t), (struct dom_nodelist **) (r)) static inline dom_exception dom_document_import_node(struct dom_document *doc, struct dom_node *node, bool deep, struct dom_node **result) @@ -262,8 +261,8 @@ static inline dom_exception dom_document_import_node(struct dom_document *doc, (dom_node **) (r)) static inline dom_exception dom_document_create_element_ns( - struct dom_document *doc, struct dom_string *namespace, - struct dom_string *qname, struct dom_element **result) + struct dom_document *doc, dom_string *namespace, + dom_string *qname, struct dom_element **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> dom_document_create_element_ns(doc, namespace, @@ -271,12 +270,12 @@ static inline dom_exception dom_document_create_element_ns( } #define dom_document_create_element_ns(d, n, q, r) \ dom_document_create_element_ns((dom_document *) (d), \ - (struct dom_string *) (n), (struct dom_string *) (q), \ + (dom_string *) (n), (dom_string *) (q), \ (struct dom_element **) (r)) static inline dom_exception dom_document_create_attribute_ns - (struct dom_document *doc, struct dom_string *namespace, - struct dom_string *qname, struct dom_attr **result) + (struct dom_document *doc, dom_string *namespace, + dom_string *qname, struct dom_attr **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> dom_document_create_attribute_ns(doc, namespace, @@ -284,12 +283,12 @@ static inline dom_exception dom_document_create_attribute_ns } #define dom_document_create_attribute_ns(d, n, q, r) \ dom_document_create_attribute_ns((dom_document *) (d), \ - (struct dom_string *) (n), (struct dom_string *) (q), \ + (dom_string *) (n), (dom_string *) (q), \ (struct dom_attr **) (r)) static inline dom_exception dom_document_get_elements_by_tag_name_ns( - struct dom_document *doc, struct dom_string *namespace, - struct dom_string *localname, struct dom_nodelist **result) + struct dom_document *doc, dom_string *namespace, + dom_string *localname, struct dom_nodelist **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> dom_document_get_elements_by_tag_name_ns(doc, @@ -297,11 +296,11 @@ static inline dom_exception dom_document_get_elements_by_tag_name_ns( } #define dom_document_get_elements_by_tag_name_ns(d, n, l, r) \ dom_document_get_elements_by_tag_name_ns((dom_document *) (d),\ - (struct dom_string *) (n), (struct dom_string *) (l), \ + (dom_string *) (n), (dom_string *) (l), \ (struct dom_nodelist **) (r)) static inline dom_exception dom_document_get_element_by_id( - struct dom_document *doc, struct dom_string *id, + struct dom_document *doc, dom_string *id, struct dom_element **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> @@ -309,25 +308,25 @@ static inline dom_exception dom_document_get_element_by_id( } #define dom_document_get_element_by_id(d, i, r) \ dom_document_get_element_by_id((dom_document *) (d), \ - (struct dom_string *) (i), (struct dom_element **) (r)) + (dom_string *) (i), (struct dom_element **) (r)) static inline dom_exception dom_document_get_input_encoding( - struct dom_document *doc, struct dom_string **result) + struct dom_document *doc, dom_string **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> dom_document_get_input_encoding(doc, result); } #define dom_document_get_input_encoding(d, r) dom_document_get_input_encoding(\ - (dom_document *) (d), (struct dom_string **) (r)) + (dom_document *) (d), (dom_string **) (r)) static inline dom_exception dom_document_get_xml_encoding( - struct dom_document *doc, struct dom_string **result) + struct dom_document *doc, dom_string **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> dom_document_get_xml_encoding(doc, result); } #define dom_document_get_xml_encoding(d, r) dom_document_get_xml_encoding( \ - (dom_document *) (d), (struct dom_string **) (r)) + (dom_document *) (d), (dom_string **) (r)) static inline dom_exception dom_document_get_xml_standalone( struct dom_document *doc, bool *result) @@ -348,22 +347,22 @@ static inline dom_exception dom_document_set_xml_standalone( (dom_document *) (d), (bool) (s)) static inline dom_exception dom_document_get_xml_version( - struct dom_document *doc, struct dom_string **result) + struct dom_document *doc, dom_string **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> dom_document_get_xml_version(doc, result); } #define dom_document_get_xml_version(d, r) dom_document_get_xml_version( \ - (dom_document *) (d), (struct dom_string **) (r)) + (dom_document *) (d), (dom_string **) (r)) static inline dom_exception dom_document_set_xml_version( - struct dom_document *doc, struct dom_string *version) + struct dom_document *doc, dom_string *version) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> dom_document_set_xml_version(doc, version); } #define dom_document_set_xml_version(d, v) dom_document_set_xml_version( \ - (dom_document *) (d), (struct dom_string *) (v)) + (dom_document *) (d), (dom_string *) (v)) static inline dom_exception dom_document_get_strict_error_checking( struct dom_document *doc, bool *result) @@ -386,22 +385,22 @@ static inline dom_exception dom_document_set_strict_error_checking( (bool) (s)) static inline dom_exception dom_document_get_uri(struct dom_document *doc, - struct dom_string **result) + dom_string **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> dom_document_get_uri(doc, result); } #define dom_document_get_uri(d, r) dom_document_get_uri((dom_document *) (d), \ - (struct dom_string **) (r)) + (dom_string **) (r)) static inline dom_exception dom_document_set_uri(struct dom_document *doc, - struct dom_string *uri) + dom_string *uri) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> dom_document_set_uri(doc, uri); } #define dom_document_set_uri(d, u) dom_document_set_uri((dom_document *) (d), \ - (struct dom_string *) (u)) + (dom_string *) (u)) static inline dom_exception dom_document_adopt_node(struct dom_document *doc, struct dom_node *node, struct dom_node **result) @@ -430,7 +429,7 @@ static inline dom_exception dom_document_normalize(struct dom_document *doc) static inline dom_exception dom_document_rename_node(struct dom_document *doc, struct dom_node *node, - struct dom_string *namespace, struct dom_string *qname, + dom_string *namespace, dom_string *qname, struct dom_node **result) { return ((dom_document_vtable *) ((dom_node *) doc)->vtable)-> @@ -438,7 +437,7 @@ static inline dom_exception dom_document_rename_node(struct dom_document *doc, result); } #define dom_document_rename_node(d, n, ns, q, r) dom_document_rename_node( \ - (dom_document *) (d), (struct dom_string *) (ns), \ - (struct dom_string *) (q), (dom_node **) (r)) + (dom_document *) (d), (dom_string *) (ns), \ + (dom_string *) (q), (dom_node **) (r)) #endif diff --git a/include/dom/core/document_type.h b/include/dom/core/document_type.h index fdba202..989ff69 100644 --- a/include/dom/core/document_type.h +++ b/include/dom/core/document_type.h @@ -13,7 +13,6 @@ #include struct dom_namednodemap; -struct dom_string; typedef struct dom_document_type dom_document_type; /* The Dom DocumentType vtable */ @@ -22,7 +21,7 @@ typedef struct dom_document_type_vtable { dom_exception (*dom_document_type_get_name)( struct dom_document_type *doc_type, - struct dom_string **result); + dom_string **result); dom_exception (*dom_document_type_get_entities)( struct dom_document_type *doc_type, struct dom_namednodemap **result); @@ -31,23 +30,23 @@ typedef struct dom_document_type_vtable { struct dom_namednodemap **result); dom_exception (*dom_document_type_get_public_id)( struct dom_document_type *doc_type, - struct dom_string **result); + dom_string **result); dom_exception (*dom_document_type_get_system_id)( struct dom_document_type *doc_type, - struct dom_string **result); + dom_string **result); dom_exception (*dom_document_type_get_internal_subset)( struct dom_document_type *doc_type, - struct dom_string **result); + dom_string **result); } dom_document_type_vtable; static inline dom_exception dom_document_type_get_name( - struct dom_document_type *doc_type, struct dom_string **result) + struct dom_document_type *doc_type, dom_string **result) { return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable) ->dom_document_type_get_name(doc_type, result); } #define dom_document_type_get_name(dt, r) dom_document_type_get_name( \ - (dom_document_type *) (dt), (struct dom_string **) (r)) + (dom_document_type *) (dt), (dom_string **) (r)) static inline dom_exception dom_document_type_get_entities( struct dom_document_type *doc_type, @@ -71,29 +70,29 @@ static inline dom_exception dom_document_type_get_notations( static inline dom_exception dom_document_type_get_public_id( struct dom_document_type *doc_type, - struct dom_string **result) + dom_string **result) { return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable) ->dom_document_type_get_public_id(doc_type, result); } #define dom_document_type_get_public_id(dt, r) \ dom_document_type_get_public_id((dom_document_type *) (dt), \ - (struct dom_string **) (r)) + (dom_string **) (r)) static inline dom_exception dom_document_type_get_system_id( struct dom_document_type *doc_type, - struct dom_string **result) + dom_string **result) { return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable) ->dom_document_type_get_system_id(doc_type, result); } #define dom_document_type_get_system_id(dt, r) \ dom_document_type_get_system_id((dom_document_type *) (dt), \ - (struct dom_string **) (r)) + (dom_string **) (r)) static inline dom_exception dom_document_type_get_internal_subset( struct dom_document_type *doc_type, - struct dom_string **result) + dom_string **result) { return ((dom_document_type_vtable *) ((dom_node *) (doc_type))->vtable) ->dom_document_type_get_internal_subset(doc_type, @@ -101,7 +100,7 @@ static inline dom_exception dom_document_type_get_internal_subset( } #define dom_document_type_get_internal_subset(dt, r) \ dom_document_type_get_internal_subset( \ - (dom_document_type *) (dt), (struct dom_string **) (r)) + (dom_document_type *) (dt), (dom_string **) (r)) #endif diff --git a/include/dom/core/element.h b/include/dom/core/element.h index 4cffa2c..c77335b 100644 --- a/include/dom/core/element.h +++ b/include/dom/core/element.h @@ -15,7 +15,6 @@ struct dom_attr; struct dom_nodelist; -struct dom_string; struct dom_type_info; typedef struct dom_element dom_element; @@ -25,15 +24,15 @@ typedef struct dom_element_vtable { struct dom_node_vtable base; dom_exception (*dom_element_get_tag_name)(struct dom_element *element, - struct dom_string **name); + dom_string **name); dom_exception (*dom_element_get_attribute)(struct dom_element *element, - struct dom_string *name, struct dom_string **value); + dom_string *name, dom_string **value); dom_exception (*dom_element_set_attribute)(struct dom_element *element, - struct dom_string *name, struct dom_string *value); + dom_string *name, dom_string *value); dom_exception (*dom_element_remove_attribute)( - struct dom_element *element, struct dom_string *name); + struct dom_element *element, dom_string *name); dom_exception (*dom_element_get_attribute_node)( - struct dom_element *element, struct dom_string *name, + struct dom_element *element, dom_string *name, struct dom_attr **result); dom_exception (*dom_element_set_attribute_node)( struct dom_element *element, struct dom_attr *attr, @@ -42,96 +41,96 @@ typedef struct dom_element_vtable { struct dom_element *element, struct dom_attr *attr, struct dom_attr **result); dom_exception (*dom_element_get_elements_by_tag_name)( - struct dom_element *element, struct dom_string *name, + struct dom_element *element, dom_string *name, struct dom_nodelist **result); dom_exception (*dom_element_get_attribute_ns)( struct dom_element *element, - struct dom_string *namespace, - struct dom_string *localname, - struct dom_string **value); + dom_string *namespace, + dom_string *localname, + dom_string **value); dom_exception (*dom_element_set_attribute_ns)( struct dom_element *element, - struct dom_string *namespace, struct dom_string *qname, - struct dom_string *value); + dom_string *namespace, dom_string *qname, + dom_string *value); dom_exception (*dom_element_remove_attribute_ns)( struct dom_element *element, - struct dom_string *namespace, - struct dom_string *localname); + dom_string *namespace, + dom_string *localname); dom_exception (*dom_element_get_attribute_node_ns)( struct dom_element *element, - struct dom_string *namespace, - struct dom_string *localname, struct dom_attr **result); + dom_string *namespace, + dom_string *localname, struct dom_attr **result); dom_exception (*dom_element_set_attribute_node_ns)( struct dom_element *element, struct dom_attr *attr, struct dom_attr **result); dom_exception (*dom_element_get_elements_by_tag_name_ns)( struct dom_element *element, - struct dom_string *namespace, - struct dom_string *localname, + dom_string *namespace, + dom_string *localname, struct dom_nodelist **result); dom_exception (*dom_element_has_attribute)(struct dom_element *element, - struct dom_string *name, bool *result); + dom_string *name, bool *result); dom_exception (*dom_element_has_attribute_ns)( struct dom_element *element, - struct dom_string *namespace, - struct dom_string *localname, bool *result); + dom_string *namespace, + dom_string *localname, bool *result); dom_exception (*dom_element_get_schema_type_info)( struct dom_element *element, struct dom_type_info **result); dom_exception (*dom_element_set_id_attribute)( - struct dom_element *element, struct dom_string *name, + struct dom_element *element, dom_string *name, bool is_id); dom_exception (*dom_element_set_id_attribute_ns)( struct dom_element *element, - struct dom_string *namespace, - struct dom_string *localname, bool is_id); + dom_string *namespace, + dom_string *localname, bool is_id); dom_exception (*dom_element_set_id_attribute_node)( struct dom_element *element, struct dom_attr *id_attr, bool is_id); } dom_element_vtable; static inline dom_exception dom_element_get_tag_name( - struct dom_element *element, struct dom_string **name) + struct dom_element *element, dom_string **name) { return ((dom_element_vtable *) ((dom_node *) element)->vtable)-> dom_element_get_tag_name(element, name); } #define dom_element_get_tag_name(e, n) dom_element_get_tag_name( \ - (dom_element *) (e), (struct dom_string **) (n)) + (dom_element *) (e), (dom_string **) (n)) static inline dom_exception dom_element_get_attribute( - struct dom_element *element, struct dom_string *name, - struct dom_string **value) + struct dom_element *element, dom_string *name, + dom_string **value) { return ((dom_element_vtable *) ((dom_node *) element)->vtable)-> dom_element_get_attribute(element, name, value); } #define dom_element_get_attribute(e, n, v) dom_element_get_attribute( \ - (dom_element *) (e), (struct dom_string *) (n), \ - (struct dom_string **) (v)) + (dom_element *) (e), (dom_string *) (n), \ + (dom_string **) (v)) static inline dom_exception dom_element_set_attribute( - struct dom_element *element, struct dom_string *name, - struct dom_string *value) + struct dom_element *element, dom_string *name, + dom_string *value) { return ((dom_element_vtable *) ((dom_node *) element)->vtable)-> dom_element_set_attribute(element, name, value); } #define dom_element_set_attribute(e, n, v) dom_element_set_attribute( \ - (dom_element *) (e), (struct dom_string *) (n), \ - (struct dom_string *) (v)) + (dom_element *) (e), (dom_string *) (n), \ + (dom_string *) (v)) static inline dom_exception dom_element_remove_attribute( - struct dom_element *element, struct dom_string *name) + struct dom_element *element, dom_string *name) { return ((dom_element_vtable *) ((dom_node *) element)->vtable)-> dom_element_remove_attribute(element, name); } #define dom_element_remove_attribute(e, n) dom_element_remove_attribute( \ - (dom_element *) (e), (struct dom_string *) (n)) + (dom_element *) (e), (dom_string *) (n)) static inline dom_exception dom_element_get_attribute_node( - struct dom_element *element, struct dom_string *name, + struct dom_element *element, dom_string *name, struct dom_attr **result) { return ((dom_element_vtable *) ((dom_node *) element)->vtable)-> @@ -139,7 +138,7 @@ static inline dom_exception dom_element_get_attribute_node( } #define dom_element_get_attribute_node(e, n, r) \ dom_element_get_attribute_node((dom_element *) (e), \ - (struct dom_string *) (n), (struct dom_attr **) (r)) + (dom_string *) (n), (struct dom_attr **) (r)) static inline dom_exception dom_element_set_attribute_node( struct dom_element *element, struct dom_attr *attr, @@ -166,7 +165,7 @@ static inline dom_exception dom_element_remove_attribute_node( static inline dom_exception dom_element_get_elements_by_tag_name( - struct dom_element *element, struct dom_string *name, + struct dom_element *element, dom_string *name, struct dom_nodelist **result) { return ((dom_element_vtable *) ((dom_node *) element)->vtable)-> @@ -175,11 +174,11 @@ static inline dom_exception dom_element_get_elements_by_tag_name( } #define dom_element_get_elements_by_tag_name(e, n, r) \ dom_element_get_elements_by_tag_name((dom_element *) (e), \ - (struct dom_string *) (n), (struct dom_nodelist **) (r)) + (dom_string *) (n), (struct dom_nodelist **) (r)) static inline dom_exception dom_element_get_attribute_ns( - struct dom_element *element, struct dom_string *namespace, - struct dom_string *localname, struct dom_string **value) + struct dom_element *element, dom_string *namespace, + dom_string *localname, dom_string **value) { return ((dom_element_vtable *) ((dom_node *) element)->vtable)-> dom_element_get_attribute_ns(element, namespace, @@ -187,12 +186,12 @@ static inline dom_exception dom_element_get_attribute_ns( } #define dom_element_get_attribute_ns(e, n, l, v) \ dom_element_get_attribute_ns((dom_element *) (e), \ - (struct dom_string *) (n), (struct dom_string *) (l), \ - (struct dom_string **) (v)) + (dom_string *) (n), (dom_string *) (l), \ + (dom_string **) (v)) static inline dom_exception dom_element_set_attribute_ns( - struct dom_element *element, struct dom_string *namespace, - struct dom_string *qname, struct dom_string *value) + struct dom_element *element, dom_string *namespace, + dom_string *qname, dom_string *value) { return ((dom_element_vtable *) ((dom_node *) element)->vtable)-> dom_element_set_attribute_ns(element, namespace, @@ -200,13 +199,13 @@ static inline dom_exception dom_element_set_attribute_ns( } #define dom_element_set_attribute_ns(e, n, l, v) \ dom_element_set_attribute_ns((dom_element *) (e), \ - (struct dom_string *) (n), (struct dom_string *) (l), \ - (struct dom_string *) (v)) + (dom_string *) (n), (dom_string *) (l), \ + (dom_string *) (v)) static inline dom_exception dom_element_remove_attribute_ns( - struct dom_element *element, struct dom_string *namespace, - struct dom_string *localname) + struct dom_element *element, dom_string *namespace, + dom_string *localname) { return ((dom_element_vtable *) ((dom_node *) element)->vtable)-> dom_element_remove_attribute_ns(element, namespace, @@ -214,12 +213,12 @@ static inline dom_exception dom_element_remove_attribute_ns( } #define dom_element_remove_attribute_ns(e, n, l) \ dom_element_remove_attribute_ns((dom_element *) (e), \ - (struct dom_string *) (n), (struct dom_string *) (l)) + (dom_string *) (n), (dom_string *) (l)) static inline dom_exception dom_element_get_attribute_node_ns( - struct dom_element *element, struct dom_string *namespace, - struct dom_string *localname, struct dom_attr **result) + struct dom_element *element, dom_string *namespace, + dom_string *localname, struct dom_attr **result) { return ((dom_element_vtable *) ((dom_node *) element)->vtable)-> dom_element_get_attribute_node_ns(element, namespace, @@ -227,7 +226,7 @@ static inline dom_exception dom_element_get_attribute_node_ns( } #define dom_element_get_attribute_node_ns(e, n, l, r) \ dom_element_get_attribute_node_ns((dom_element *) (e), \ - (struct dom_string *) (n), (struct dom_string *) (l), \ + (dom_string *) (n), (dom_string *) (l), \ (struct dom_attr **) (r)) static inline dom_exception dom_element_set_attribute_node_ns( @@ -243,8 +242,8 @@ static inline dom_exception dom_element_set_attribute_node_ns( (struct dom_attr *) (a), (struct dom_attr **) (r)) static inline dom_exception dom_element_get_elements_by_tag_name_ns( - struct dom_element *element, struct dom_string *namespace, - struct dom_string *localname, struct dom_nodelist **result) + struct dom_element *element, dom_string *namespace, + dom_string *localname, struct dom_nodelist **result) { return ((dom_element_vtable *) ((dom_node *) element)->vtable)-> dom_element_get_elements_by_tag_name_ns(element, @@ -252,31 +251,31 @@ static inline dom_exception dom_element_get_elements_by_tag_name_ns( } #define dom_element_get_elements_by_tag_name_ns(e, n, l, r) \ dom_element_get_elements_by_tag_name_ns((dom_element *) (e), \ - (struct dom_string *) (n), (struct dom_string *) (l), \ + (dom_string *) (n), (dom_string *) (l), \ (struct dom_nodelist **) (r)) static inline dom_exception dom_element_has_attribute( - struct dom_element *element, struct dom_string *name, + struct dom_element *element, dom_string *name, bool *result) { return ((dom_element_vtable *) ((dom_node *) element)->vtable)-> dom_element_has_attribute(element, name, result); } #define dom_element_has_attribute(e, n, r) dom_element_has_attribute( \ - (dom_element *) (e), (struct dom_string *) (n), \ + (dom_element *) (e), (dom_string *) (n), \ (bool *) (r)) static inline dom_exception dom_element_has_attribute_ns( - struct dom_element *element, struct dom_string *namespace, - struct dom_string *localname, bool *result) + struct dom_element *element, dom_string *namespace, + dom_string *localname, bool *result) { return ((dom_element_vtable *) ((dom_node *) element)->vtable)-> dom_element_has_attribute_ns(element, namespace, localname, result); } #define dom_element_has_attribute_ns(e, n, l, r) dom_element_has_attribute_ns(\ - (dom_element *) (e), (struct dom_string *) (n), \ - (struct dom_string *) (l), (bool *) (r)) + (dom_element *) (e), (dom_string *) (n), \ + (dom_string *) (l), (bool *) (r)) static inline dom_exception dom_element_get_schema_type_info( struct dom_element *element, struct dom_type_info **result) @@ -289,7 +288,7 @@ static inline dom_exception dom_element_get_schema_type_info( (struct dom_type_info **) (r)) static inline dom_exception dom_element_set_id_attribute( - struct dom_element *element, struct dom_string *name, + struct dom_element *element, dom_string *name, bool is_id) { return ((dom_element_vtable *) ((dom_node *) element)->vtable)-> @@ -297,11 +296,11 @@ static inline dom_exception dom_element_set_id_attribute( } #define dom_element_set_id_attribute(e, n, i) \ dom_element_set_id_attribute((dom_element *) (e), \ - (struct dom_string *) (n), (bool) (i)) + (dom_string *) (n), (bool) (i)) static inline dom_exception dom_element_set_id_attribute_ns( - struct dom_element *element, struct dom_string *namespace, - struct dom_string *localname, bool is_id) + struct dom_element *element, dom_string *namespace, + dom_string *localname, bool is_id) { return ((dom_element_vtable *) ((dom_node *) element)->vtable)-> dom_element_set_id_attribute_ns(element, namespace, @@ -309,7 +308,7 @@ static inline dom_exception dom_element_set_id_attribute_ns( } #define dom_element_set_id_attribute_ns(e, n, l, i) \ dom_element_set_id_attribute_ns((dom_element *) (e), \ - (struct dom_string *) (n), (struct dom_string *) (l), \ + (dom_string *) (n), (dom_string *) (l), \ (bool) (i)) static inline dom_exception dom_element_set_id_attribute_node( diff --git a/include/dom/core/namednodemap.h b/include/dom/core/namednodemap.h index a39983e..ad2494b 100644 --- a/include/dom/core/namednodemap.h +++ b/include/dom/core/namednodemap.h @@ -9,9 +9,9 @@ #define dom_core_namednodemap_h_ #include +#include struct dom_node; -struct dom_string; typedef struct dom_namednodemap dom_namednodemap; @@ -22,7 +22,7 @@ dom_exception dom_namednodemap_get_length(struct dom_namednodemap *map, unsigned long *length); dom_exception _dom_namednodemap_get_named_item(struct dom_namednodemap *map, - struct dom_string *name, struct dom_node **node); + dom_string *name, struct dom_node **node); #define dom_namednodemap_get_named_item(m, n, r) \ _dom_namednodemap_get_named_item((dom_namednodemap *) (m), \ @@ -38,7 +38,7 @@ dom_exception _dom_namednodemap_set_named_item(struct dom_namednodemap *map, dom_exception _dom_namednodemap_remove_named_item( - struct dom_namednodemap *map, struct dom_string *name, + struct dom_namednodemap *map, dom_string *name, struct dom_node **node); #define dom_namednodemap_remove_named_item(m, n, r) \ @@ -55,8 +55,8 @@ dom_exception _dom_namednodemap_item(struct dom_namednodemap *map, dom_exception _dom_namednodemap_get_named_item_ns( - struct dom_namednodemap *map, struct dom_string *namespace, - struct dom_string *localname, struct dom_node **node); + struct dom_namednodemap *map, dom_string *namespace, + dom_string *localname, struct dom_node **node); #define dom_namednodemap_get_named_item_ns(m, n, l, r) \ _dom_namednodemap_get_named_item_ns((dom_namednodemap *) (m), \ @@ -73,8 +73,8 @@ dom_exception _dom_namednodemap_set_named_item_ns( dom_exception _dom_namednodemap_remove_named_item_ns( - struct dom_namednodemap *map, struct dom_string *namespace, - struct dom_string *localname, struct dom_node **node); + struct dom_namednodemap *map, dom_string *namespace, + dom_string *localname, struct dom_node **node); #define dom_namednodemap_remove_named_item_ns(m, n, l, r) \ _dom_namednodemap_remove_named_item_ns(\ diff --git a/include/dom/core/node.h b/include/dom/core/node.h index 5e2d89a..ee1f057 100644 --- a/include/dom/core/node.h +++ b/include/dom/core/node.h @@ -12,11 +12,11 @@ #include #include +#include struct dom_document; struct dom_nodelist; struct dom_namednodemap; -struct dom_string; struct dom_node; /** @@ -46,7 +46,7 @@ typedef enum { * Type of handler function for user data registered on a DOM node */ typedef void (*dom_user_data_handler)(dom_node_operation operation, - struct dom_string *key, void *data, struct dom_node *src, + dom_string *key, void *data, struct dom_node *src, struct dom_node *dst); /** @@ -84,11 +84,11 @@ typedef struct dom_node_vtable { /* The DOM level 3 node's oprations */ dom_exception (*dom_node_get_node_name)(dom_node_internal *node, - struct dom_string **result); + dom_string **result); dom_exception (*dom_node_get_node_value)(dom_node_internal *node, - struct dom_string **result); + dom_string **result); dom_exception (*dom_node_set_node_value)(dom_node_internal *node, - struct dom_string *value); + dom_string *value); dom_exception (*dom_node_get_node_type)(dom_node_internal *node, dom_node_type *result); dom_exception (*dom_node_get_parent_node)(dom_node_internal *node, @@ -127,46 +127,46 @@ typedef struct dom_node_vtable { dom_node_internal **result); dom_exception (*dom_node_normalize)(dom_node_internal *node); dom_exception (*dom_node_is_supported)(dom_node_internal *node, - struct dom_string *feature, struct dom_string *version, + dom_string *feature, dom_string *version, bool *result); dom_exception (*dom_node_get_namespace)(dom_node_internal *node, - struct dom_string **result); + dom_string **result); dom_exception (*dom_node_get_prefix)(dom_node_internal *node, - struct dom_string **result); + dom_string **result); dom_exception (*dom_node_set_prefix)(dom_node_internal *node, - struct dom_string *prefix); + dom_string *prefix); dom_exception (*dom_node_get_local_name)(dom_node_internal *node, - struct dom_string **result); + dom_string **result); dom_exception (*dom_node_has_attributes)(dom_node_internal *node, bool *result); dom_exception (*dom_node_get_base)(dom_node_internal *node, - struct dom_string **result); + dom_string **result); dom_exception (*dom_node_compare_document_position)( dom_node_internal *node, dom_node_internal *other, uint16_t *result); dom_exception (*dom_node_get_text_content)(dom_node_internal *node, - struct dom_string **result); + dom_string **result); dom_exception (*dom_node_set_text_content)(dom_node_internal *node, - struct dom_string *content); + dom_string *content); dom_exception (*dom_node_is_same)(dom_node_internal *node, dom_node_internal *other, bool *result); dom_exception (*dom_node_lookup_prefix)(dom_node_internal *node, - struct dom_string *namespace, - struct dom_string **result); + dom_string *namespace, + dom_string **result); dom_exception (*dom_node_is_default_namespace)(dom_node_internal *node, - struct dom_string *namespace, bool *result); + dom_string *namespace, bool *result); dom_exception (*dom_node_lookup_namespace)(dom_node_internal *node, - struct dom_string *prefix, struct dom_string **result); + dom_string *prefix, dom_string **result); dom_exception (*dom_node_is_equal)(dom_node_internal *node, dom_node_internal *other, bool *result); dom_exception (*dom_node_get_feature)(dom_node_internal *node, - struct dom_string *feature, struct dom_string *version, + dom_string *feature, dom_string *version, void **result); dom_exception (*dom_node_set_user_data)(dom_node_internal *node, - struct dom_string *key, void *data, + dom_string *key, void *data, dom_user_data_handler handler, void **result); dom_exception (*dom_node_get_user_data)(dom_node_internal *node, - struct dom_string *key, void **result); + dom_string *key, void **result); } dom_node_vtable; /* The ref/unref methods define */ @@ -176,31 +176,31 @@ void _dom_node_unref(dom_node_internal *node); #define dom_node_unref(n) _dom_node_unref((dom_node_internal *) (n)) static inline dom_exception dom_node_get_node_name(struct dom_node *node, - struct dom_string **result) + dom_string **result) { return ((dom_node_vtable *) node->vtable)->dom_node_get_node_name( (dom_node_internal *) node, result); } #define dom_node_get_node_name(n, r) dom_node_get_node_name((dom_node *) (n), \ - (struct dom_string **) (r)) + (dom_string **) (r)) static inline dom_exception dom_node_get_node_value(struct dom_node *node, - struct dom_string **result) + dom_string **result) { return ((dom_node_vtable *) node->vtable)->dom_node_get_node_value( (dom_node_internal *) node, result); } #define dom_node_get_node_value(n, r) dom_node_get_node_value( \ - (dom_node *) (n), (struct dom_string **) (r)) + (dom_node *) (n), (dom_string **) (r)) static inline dom_exception dom_node_set_node_value(struct dom_node *node, - struct dom_string *value) + dom_string *value) { return ((dom_node_vtable *) node->vtable)->dom_node_set_node_value( (dom_node_internal *) node, value); } #define dom_node_set_node_value(n, v) dom_node_set_node_value( \ - (dom_node *) (n), (struct dom_string *) (v)) + (dom_node *) (n), (dom_string *) (v)) static inline dom_exception dom_node_get_node_type(struct dom_node *node, dom_node_type *result) @@ -368,7 +368,7 @@ static inline dom_exception dom_node_normalize(struct dom_node *node) #define dom_node_normalize(n) dom_node_normalize((dom_node *) (n)) static inline dom_exception dom_node_is_supported(struct dom_node *node, - struct dom_string *feature, struct dom_string *version, + dom_string *feature, dom_string *version, bool *result) { return ((dom_node_vtable *) node->vtable)->dom_node_is_supported( @@ -376,44 +376,44 @@ static inline dom_exception dom_node_is_supported(struct dom_node *node, version, result); } #define dom_node_is_supported(n, f, v, r) dom_node_is_supported( \ - (dom_node *) (n), (struct dom_string *) (f), \ - (struct dom_string *) (v), (bool *) (r)) + (dom_node *) (n), (dom_string *) (f), \ + (dom_string *) (v), (bool *) (r)) static inline dom_exception dom_node_get_namespace(struct dom_node *node, - struct dom_string **result) + dom_string **result) { return ((dom_node_vtable *) node->vtable)->dom_node_get_namespace( (dom_node_internal *) node, result); } #define dom_node_get_namespace(n, r) dom_node_get_namespace((dom_node *) (n), \ - (struct dom_string **) (r)) + (dom_string **) (r)) static inline dom_exception dom_node_get_prefix(struct dom_node *node, - struct dom_string **result) + dom_string **result) { return ((dom_node_vtable *) node->vtable)->dom_node_get_prefix( (dom_node_internal *) node, result); } #define dom_node_get_prefix(n, r) dom_node_get_prefix((dom_node *) (n), \ - (struct dom_string **) (r)) + (dom_string **) (r)) static inline dom_exception dom_node_set_prefix(struct dom_node *node, - struct dom_string *prefix) + dom_string *prefix) { return ((dom_node_vtable *) node->vtable)->dom_node_set_prefix( (dom_node_internal *) node, prefix); } #define dom_node_set_prefix(n, p) dom_node_set_prefix((dom_node *) (n), \ - (struct dom_string *) (p)) + (dom_string *) (p)) static inline dom_exception dom_node_get_local_name(struct dom_node *node, - struct dom_string **result) + dom_string **result) { return ((dom_node_vtable *) node->vtable)->dom_node_get_local_name( (dom_node_internal *) node, result); } #define dom_node_get_local_name(n, r) dom_node_get_local_name((dom_node *) (n),\ - (struct dom_string **) (r)) + (dom_string **) (r)) static inline dom_exception dom_node_has_attributes(struct dom_node *node, bool *result) @@ -425,13 +425,13 @@ static inline dom_exception dom_node_has_attributes(struct dom_node *node, (dom_node *) (n), (bool *) (r)) static inline dom_exception dom_node_get_base(struct dom_node *node, - struct dom_string **result) + dom_string **result) { return ((dom_node_vtable *) node->vtable)->dom_node_get_base( (dom_node_internal *) node, result); } #define dom_node_get_base(n, r) dom_node_get_base((dom_node *) (n), \ - (struct dom_string **) (r)) + (dom_string **) (r)) static inline dom_exception dom_node_compare_document_position( struct dom_node *node, struct dom_node *other, @@ -447,22 +447,22 @@ static inline dom_exception dom_node_compare_document_position( (dom_node *) (o), (uint16_t *) (r)) static inline dom_exception dom_node_get_text_content(struct dom_node *node, - struct dom_string **result) + dom_string **result) { return ((dom_node_vtable *) node->vtable)->dom_node_get_text_content( (dom_node_internal *) node, result); } #define dom_node_get_text_content(n, r) dom_node_get_text_content( \ - (dom_node *) (n), (struct dom_string **) (r)) + (dom_node *) (n), (dom_string **) (r)) static inline dom_exception dom_node_set_text_content(struct dom_node *node, - struct dom_string *content) + dom_string *content) { return ((dom_node_vtable *) node->vtable)->dom_node_set_text_content( (dom_node_internal *) node, content); } #define dom_node_set_text_content(n, c) dom_node_get_text_content( \ - (dom_node *) (n), (struct dom_string *) (c)) + (dom_node *) (n), (dom_string *) (c)) static inline dom_exception dom_node_is_same(struct dom_node *node, struct dom_node *other, bool *result) @@ -476,17 +476,17 @@ static inline dom_exception dom_node_is_same(struct dom_node *node, (dom_node *) (o), (bool *) (r)) static inline dom_exception dom_node_lookup_prefix(struct dom_node *node, - struct dom_string *namespace, struct dom_string **result) + dom_string *namespace, dom_string **result) { return ((dom_node_vtable *) node->vtable)->dom_node_lookup_prefix( (dom_node_internal *) node, namespace, result); } #define dom_node_lookup_prefix(n, ns, r) dom_node_lookup_prefix( \ - (dom_node *) (n), (struct dom_string *) (ns), \ - (struct dom_string **) (r)) + (dom_node *) (n), (dom_string *) (ns), \ + (dom_string **) (r)) static inline dom_exception dom_node_is_default_namespace( - struct dom_node *node, struct dom_string *namespace, + struct dom_node *node, dom_string *namespace, bool *result) { return ((dom_node_vtable *) node->vtable)-> @@ -494,17 +494,17 @@ static inline dom_exception dom_node_is_default_namespace( (dom_node_internal *) node, namespace, result); } #define dom_node_is_default_namespace(n, ns, r) dom_node_is_default_namespace(\ - (dom_node *) (n), (struct dom_string *) (ns), (bool *) (r)) + (dom_node *) (n), (dom_string *) (ns), (bool *) (r)) static inline dom_exception dom_node_lookup_namespace(struct dom_node *node, - struct dom_string *prefix, struct dom_string **result) + dom_string *prefix, dom_string **result) { return ((dom_node_vtable *) node->vtable)->dom_node_lookup_namespace( (dom_node_internal *) node, prefix, result); } #define dom_node_lookup_namespace(n, p, r) dom_node_lookup_namespace( \ - (dom_node *) (n), (struct dom_string *) (p), \ - (struct dom_string **) (r)) + (dom_node *) (n), (dom_string *) (p), \ + (dom_string **) (r)) static inline dom_exception dom_node_is_equal(struct dom_node *node, struct dom_node *other, bool *result) @@ -518,18 +518,18 @@ static inline dom_exception dom_node_is_equal(struct dom_node *node, (dom_node *) (o), (bool *) (r)) static inline dom_exception dom_node_get_feature(struct dom_node *node, - struct dom_string *feature, struct dom_string *version, + dom_string *feature, dom_string *version, void **result) { return ((dom_node_vtable *) node->vtable)->dom_node_get_feature( (dom_node_internal *) node, feature, version, result); } #define dom_node_get_feature(n, f, v, r) dom_node_get_feature( \ - (dom_node *) (n), (struct dom_string *) (f), \ - (struct dom_string *) (v), (void **) (r)) + (dom_node *) (n), (dom_string *) (f), \ + (dom_string *) (v), (void **) (r)) static inline dom_exception dom_node_set_user_data(struct dom_node *node, - struct dom_string *key, void *data, + dom_string *key, void *data, dom_user_data_handler handler, void **result) { return ((dom_node_vtable *) node->vtable)->dom_node_set_user_data( @@ -537,16 +537,16 @@ static inline dom_exception dom_node_set_user_data(struct dom_node *node, result); } #define dom_node_set_user_data(n, k, d, h, r) dom_node_set_user_data( \ - (dom_node *) (n), (struct dom_string *) (k), (void *) (d), \ + (dom_node *) (n), (dom_string *) (k), (void *) (d), \ (dom_user_data_handler) h, (void **) (r)) static inline dom_exception dom_node_get_user_data(struct dom_node *node, - struct dom_string *key, void **result) + dom_string *key, void **result) { return ((dom_node_vtable *) node->vtable)->dom_node_get_user_data( (dom_node_internal *) node, key, result); } #define dom_node_get_user_data(n, k, r) dom_node_get_user_data( \ - (dom_node *) (n), (struct dom_string *) (k), (void **) (r)) + (dom_node *) (n), (dom_string *) (k), (void **) (r)) #endif diff --git a/include/dom/core/string.h b/include/dom/core/string.h index 7da2114..b671cb7 100644 --- a/include/dom/core/string.h +++ b/include/dom/core/string.h @@ -19,64 +19,64 @@ typedef struct dom_string dom_string; /* Claim a reference on a DOM string */ -void dom_string_ref(struct dom_string *str); +void dom_string_ref(dom_string *str); /* Release a reference on a DOM string */ -void dom_string_unref(struct dom_string *str); +void dom_string_unref(dom_string *str); /* Create a DOM string from a string of characters */ dom_exception dom_string_create(dom_alloc alloc, void *pw, - const uint8_t *ptr, size_t len, struct dom_string **str); + const uint8_t *ptr, size_t len, dom_string **str); /* Clone a dom_string */ dom_exception dom_string_clone(dom_alloc alloc, void *pw, - struct dom_string *str, struct dom_string **ret); + dom_string *str, dom_string **ret); /* Get the internal lwc_string */ -dom_exception dom_string_get_intern(struct dom_string *str, +dom_exception dom_string_get_intern(dom_string *str, struct lwc_string_s **lwcstr); /* Case sensitively compare two DOM strings */ -int dom_string_cmp(struct dom_string *s1, struct dom_string *s2); +int dom_string_cmp(dom_string *s1, dom_string *s2); /* Case insensitively compare two DOM strings */ -int dom_string_icmp(struct dom_string *s1, struct dom_string *s2); +int dom_string_icmp(dom_string *s1, dom_string *s2); /* Get the index of the first occurrence of a character in a dom string */ -uint32_t dom_string_index(struct dom_string *str, uint32_t chr); +uint32_t dom_string_index(dom_string *str, uint32_t chr); /* Get the index of the last occurrence of a character in a dom string */ -uint32_t dom_string_rindex(struct dom_string *str, uint32_t chr); +uint32_t dom_string_rindex(dom_string *str, uint32_t chr); /* Get the length, in characters, of a dom string */ -uint32_t dom_string_length(struct dom_string *str); +uint32_t dom_string_length(dom_string *str); /* Get the UCS-4 character at position index, the index should be in * [0, length), and length can be get by calling dom_string_length */ -dom_exception dom_string_at(struct dom_string *str, uint32_t index, +dom_exception dom_string_at(dom_string *str, uint32_t index, uint32_t *ch); /* Concatenate two dom strings */ -dom_exception dom_string_concat(struct dom_string *s1, struct dom_string *s2, - struct dom_string **result); +dom_exception dom_string_concat(dom_string *s1, dom_string *s2, + dom_string **result); /* Extract a substring from a dom string */ -dom_exception dom_string_substr(struct dom_string *str, - uint32_t i1, uint32_t i2, struct dom_string **result); +dom_exception dom_string_substr(dom_string *str, + uint32_t i1, uint32_t i2, dom_string **result); /* Insert data into a dom string at the given location */ -dom_exception dom_string_insert(struct dom_string *target, - struct dom_string *source, uint32_t offset, - struct dom_string **result); +dom_exception dom_string_insert(dom_string *target, + dom_string *source, uint32_t offset, + dom_string **result); /* Replace a section of a dom string */ -dom_exception dom_string_replace(struct dom_string *target, - struct dom_string *source, uint32_t i1, uint32_t i2, - struct dom_string **result); +dom_exception dom_string_replace(dom_string *target, + dom_string *source, uint32_t i1, uint32_t i2, + dom_string **result); /* Duplicate a dom string */ -dom_exception dom_string_dup(struct dom_string *str, - struct dom_string **result); +dom_exception dom_string_dup(dom_string *str, + dom_string **result); /* Calculate a hash value from a dom string */ -uint32_t dom_string_hash(struct dom_string *str); +uint32_t dom_string_hash(dom_string *str); #endif diff --git a/include/dom/core/text.h b/include/dom/core/text.h index 5e38d13..61e1c4c 100644 --- a/include/dom/core/text.h +++ b/include/dom/core/text.h @@ -14,7 +14,6 @@ #include struct dom_characterdata; -struct dom_string; typedef struct dom_text dom_text; @@ -26,9 +25,9 @@ typedef struct dom_text_vtable { dom_exception (*dom_text_get_is_element_content_whitespace)( struct dom_text *text, bool *result); dom_exception (*dom_text_get_whole_text)(struct dom_text *text, - struct dom_string **result); + dom_string **result); dom_exception (*dom_text_replace_whole_text)(struct dom_text *text, - struct dom_string *content, struct dom_text **result); + dom_string *content, struct dom_text **result); } dom_text_vtable; static inline dom_exception dom_text_split_text(struct dom_text *text, @@ -52,21 +51,21 @@ static inline dom_exception dom_text_get_is_element_content_whitespace( (bool *) (r)) static inline dom_exception dom_text_get_whole_text(struct dom_text *text, - struct dom_string **result) + dom_string **result) { return ((dom_text_vtable *) ((dom_node *) text)->vtable)-> dom_text_get_whole_text(text, result); } #define dom_text_get_whole_text(t, r) dom_text_get_whole_text((dom_text *) (t),\ - (struct dom_string **) (r)) + (dom_string **) (r)) static inline dom_exception dom_text_replace_whole_text(struct dom_text *text, - struct dom_string *content, struct dom_text **result) + dom_string *content, struct dom_text **result) { return ((dom_text_vtable *) ((dom_node *) text)->vtable)-> dom_text_replace_whole_text(text, content, result); } #define dom_text_replace_whole_text(t, c, r) dom_text_replace_whole_text( \ - (dom_text *) (t), (struct dom_string *) (c), (dom_text **) (r)) + (dom_text *) (t), (dom_string *) (c), (dom_text **) (r)) #endif diff --git a/include/dom/core/typeinfo.h b/include/dom/core/typeinfo.h index f285799..caa2094 100644 --- a/include/dom/core/typeinfo.h +++ b/include/dom/core/typeinfo.h @@ -11,8 +11,7 @@ #include #include - -struct dom_string; +#include typedef struct dom_type_info dom_type_info; @@ -24,24 +23,24 @@ typedef enum { } dom_type_info_derivation_method; dom_exception _dom_type_info_get_type_name(dom_type_info *ti, - struct dom_string **ret); + dom_string **ret); #define dom_type_info_get_type_name(t, r) _dom_type_info_get_type_name( \ - (dom_type_info *) (t), (struct dom_string **) (r)) + (dom_type_info *) (t), (dom_string **) (r)) dom_exception _dom_type_info_get_type_namespace(dom_type_info *ti, - struct dom_string **ret); + dom_string **ret); #define dom_type_info_get_type_namespace(t, r) \ _dom_type_info_get_type_namespace((dom_type_info *) (t),\ - (struct dom_string **) (r)) + (dom_string **) (r)) dom_exception _dom_type_info_is_derived(dom_type_info *ti, - struct dom_string *namespace, struct dom_string *name, + dom_string *namespace, dom_string *name, dom_type_info_derivation_method method, bool *ret); #define dom_type_info_is_derived(t, s, n, m, r) _dom_type_info_is_derived(\ - (dom_type_info *) (t), (struct dom_string *) (s), \ - (struct dom_string *) (n), \ + (dom_type_info *) (t), (dom_string *) (s), \ + (dom_string *) (n), \ (dom_type_info_derivation_method) (m), (bool *) (r)) diff --git a/include/dom/dom.h b/include/dom/dom.h index d39b85f..371c773 100644 --- a/include/dom/dom.h +++ b/include/dom/dom.h @@ -52,7 +52,7 @@ typedef enum dom_namespace { DOM_NAMESPACE_COUNT = 7 } dom_namespace; -extern struct dom_string *dom_namespaces[DOM_NAMESPACE_COUNT]; +extern dom_string *dom_namespaces[DOM_NAMESPACE_COUNT]; dom_exception dom_initialise(dom_alloc alloc, void *pw); dom_exception dom_finalise(void); diff --git a/include/dom/events/custom_event.h b/include/dom/events/custom_event.h index cb97732..a5bc2f6 100644 --- a/include/dom/events/custom_event.h +++ b/include/dom/events/custom_event.h @@ -10,8 +10,7 @@ #include #include - -struct dom_string; +#include typedef struct dom_custom_event dom_custom_event; @@ -22,11 +21,11 @@ dom_exception _dom_custom_event_get_detail(dom_custom_event *evt, (void **) (d)) dom_exception _dom_custom_event_init_ns(dom_custom_event *evt, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, bool bubble, bool cancelable, void *detail); #define dom_custom_event_init_ns(e, n, t, b, c, d) \ _dom_custom_event_init_ns((dom_custom_event *) (e), \ - (struct dom_string *) (n), (struct dom_string *) (t), \ + (dom_string *) (n), (dom_string *) (t), \ (bool) (b), (bool) (c), (void *) (d)) #endif diff --git a/include/dom/events/document_event.h b/include/dom/events/document_event.h index be0646f..bbb9f83 100644 --- a/include/dom/events/document_event.h +++ b/include/dom/events/document_event.h @@ -11,8 +11,8 @@ #include #include +#include -struct dom_string; struct dom_event; struct dom_document; struct lwc_string_s; @@ -84,17 +84,17 @@ typedef dom_default_action_callback (*dom_events_default_action_fetcher) void **pw); dom_exception _dom_document_event_create_event(dom_document_event *de, - struct dom_string *type, struct dom_event **evt); + dom_string *type, struct dom_event **evt); #define dom_document_event_create_event(d, t, e) \ _dom_document_event_create_event((dom_document_event *) (d), \ - (struct dom_string *) (t), (struct dom_event **) (e)) + (dom_string *) (t), (struct dom_event **) (e)) dom_exception _dom_document_event_can_dispatch(dom_document_event *de, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, bool* can); #define dom_document_event_can_dispatch(d, n, t, c) \ _dom_document_event_can_dispatch((dom_document_event *) (d), \ - (struct dom_string *) (n), (struct dom_string *) (t),\ + (dom_string *) (n), (dom_string *) (t),\ (bool *) (c)) #endif diff --git a/include/dom/events/event.h b/include/dom/events/event.h index df50f2e..73e7ec0 100644 --- a/include/dom/events/event.h +++ b/include/dom/events/event.h @@ -10,10 +10,9 @@ #include #include +#include #include -struct dom_string; - typedef enum { DOM_CAPTURING_PHASE = 1, DOM_AT_TARGET = 2, @@ -28,9 +27,9 @@ void _dom_event_ref(dom_event *evt); void _dom_event_unref(dom_event *evt); #define dom_event_unref(n) _dom_event_unref((dom_event *) (n)) -dom_exception _dom_event_get_type(dom_event *evt, struct dom_string **type); +dom_exception _dom_event_get_type(dom_event *evt, dom_string **type); #define dom_event_get_type(e, t) _dom_event_get_type((dom_event *) (e), \ - (struct dom_string **) (t)) + (dom_string **) (t)) dom_exception _dom_event_get_target(dom_event *evt, dom_event_target **target); #define dom_event_get_target(e, t) _dom_event_get_target((dom_event *) (e), \ @@ -62,15 +61,15 @@ dom_exception _dom_event_prevent_default(dom_event *evt); #define dom_event_prevent_default(e) _dom_event_prevent_default(\ (dom_event *) (e)) -dom_exception _dom_event_init(dom_event *evt, struct dom_string *type, +dom_exception _dom_event_init(dom_event *evt, dom_string *type, bool bubble, bool cancelable); #define dom_event_init(e, t, b, c) _dom_event_init((dom_event *) (e), \ - (struct dom_string *) (t), (bool) (b), (bool) (c)) + (dom_string *) (t), (bool) (b), (bool) (c)) dom_exception _dom_event_get_namespace(dom_event *evt, - struct dom_string **namespace); + dom_string **namespace); #define dom_event_get_namespace(e, n) _dom_event_get_namespace(\ - (dom_event *) (e), (struct dom_string **) (n)) + (dom_event *) (e), (dom_string **) (n)) dom_exception _dom_event_is_custom(dom_event *evt, bool *custom); #define dom_event_is_custom(e, c) _dom_event_is_custom((dom_event *) (e), \ @@ -84,10 +83,10 @@ dom_exception _dom_event_is_default_prevented(dom_event *evt, bool *prevented); #define dom_event_is_default_prevented(e, p) \ _dom_event_is_default_prevented((dom_event *) (e), (bool *) (p)) -dom_exception _dom_event_init_ns(dom_event *evt, struct dom_string *namespace, - struct dom_string *type, bool bubble, bool cancelable); +dom_exception _dom_event_init_ns(dom_event *evt, dom_string *namespace, + dom_string *type, bool bubble, bool cancelable); #define dom_event_init_ns(e, n, t, b, c) _dom_event_init_ns( \ - (dom_event *) (e), (struct dom_string *) (n), \ - (struct dom_string *) (t), (bool) (b), (bool) (c)) + (dom_event *) (e), (dom_string *) (n), \ + (dom_string *) (t), (bool) (b), (bool) (c)) #endif diff --git a/include/dom/events/event_target.h b/include/dom/events/event_target.h index bf3233e..51226ed 100644 --- a/include/dom/events/event_target.h +++ b/include/dom/events/event_target.h @@ -10,8 +10,8 @@ #include #include +#include -struct dom_string; struct dom_event_listener; struct dom_event; struct dom_node_internal; @@ -19,19 +19,19 @@ struct dom_node_internal; typedef struct dom_node_internal dom_event_target; dom_exception _dom_event_target_add_event_listener(dom_event_target *et, - struct dom_string *type, struct dom_event_listener *listener, + dom_string *type, struct dom_event_listener *listener, bool capture); #define dom_event_target_add_event_listener(et, t, l, c) \ _dom_event_target_add_event_listener((dom_event_target *) (et),\ - (struct dom_string *) (t), (struct dom_event_listener *) (l), \ + (dom_string *) (t), (struct dom_event_listener *) (l), \ (bool) (c)) dom_exception _dom_event_target_remove_event_listener(dom_event_target *et, - struct dom_string *type, struct dom_event_listener *listener, + dom_string *type, struct dom_event_listener *listener, bool capture); #define dom_event_target_remove_event_listener(et, t, l, c) \ _dom_event_target_remove_event_listener(\ - (dom_event_target *) (et), (struct dom_string *) (t),\ + (dom_event_target *) (et), (dom_string *) (t),\ (struct dom_event_listener *) (l), (bool) (c)) dom_exception _dom_event_target_dispatch_event(dom_event_target *et, @@ -41,21 +41,21 @@ dom_exception _dom_event_target_dispatch_event(dom_event_target *et, (struct dom_event *) (e), (bool *) (s)) dom_exception _dom_event_target_add_event_listener_ns(dom_event_target *et, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, struct dom_event_listener *listener, bool capture); #define dom_event_target_add_event_listener_ns(et, n, t, l, c) \ _dom_event_target_add_event_listener_ns(\ - (dom_event_target *) (et), (struct dom_string *) (n),\ - (struct dom_string *) (t), (struct dom_event_listener *) (l),\ + (dom_event_target *) (et), (dom_string *) (n),\ + (dom_string *) (t), (struct dom_event_listener *) (l),\ (bool) (c)) dom_exception _dom_event_target_remove_event_listener_ns(dom_event_target *et, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, struct dom_event_listener *listener, bool capture); #define dom_event_target_remove_event_listener_ns(et, n, t, l, c) \ _dom_event_target_remove_event_listener_ns(\ - (dom_event_target *) (et), (struct dom_string *) (n),\ - (struct dom_string *) (t), (struct dom_event_listener *) (l),\ + (dom_event_target *) (et), (dom_string *) (n),\ + (dom_string *) (t), (struct dom_event_listener *) (l),\ (bool) (c)) #endif diff --git a/include/dom/events/keyboard_event.h b/include/dom/events/keyboard_event.h index bbac4a1..132049e 100644 --- a/include/dom/events/keyboard_event.h +++ b/include/dom/events/keyboard_event.h @@ -10,8 +10,8 @@ #include #include +#include -struct dom_string; struct dom_abstract_view; typedef struct dom_keyboard_event dom_keyboard_event; @@ -24,10 +24,10 @@ typedef enum { } dom_key_location; dom_exception _dom_keyboard_event_get_key_identifier(dom_keyboard_event *evt, - struct dom_string **ident); + dom_string **ident); #define dom_keyboard_event_get_key_identifier(e, i) \ _dom_keyboard_event_get_key_identifier( \ - (dom_keyboard_event *) (e), (struct dom_string **) (i)) + (dom_keyboard_event *) (e), (dom_string **) (i)) dom_exception _dom_keyboard_event_get_key_location(dom_keyboard_event *evt, dom_key_location *loc); @@ -57,33 +57,33 @@ dom_exception _dom_keyboard_event_get_meta_key(dom_keyboard_event *evt, (dom_keyboard_event *) (e), (bool *) (k)) dom_exception _dom_keyboard_event_get_modifier_state(dom_keyboard_event *evt, - struct dom_string *m, bool *state); + dom_string *m, bool *state); #define dom_keyboard_event_get_modifier_state(e, m, s) \ _dom_keyboard_event_get_modifier_state( \ - (dom_keyboard_event *) (e), (struct dom_string *) (m),\ + (dom_keyboard_event *) (e), (dom_string *) (m),\ (bool *) (s)) dom_exception _dom_keyboard_event_init(dom_keyboard_event *evt, - struct dom_string *type, bool bubble, bool cancelable, - struct dom_abstract_view *view, struct dom_string *key_ident, - dom_key_location key_loc, struct dom_string *modifier_list); + dom_string *type, bool bubble, bool cancelable, + struct dom_abstract_view *view, dom_string *key_ident, + dom_key_location key_loc, dom_string *modifier_list); #define dom_keyboard_event_init(e, t, b, c, v, ki, kl, m) \ _dom_keyboard_event_init((dom_keyboard_event *) (e), \ - (struct dom_string *) (t), (bool) (b), (bool) (c), \ - (struct dom_abstract_view *) (v), (struct dom_string *) (ki), \ - (dom_key_location) (kl), (struct dom_string *) (m)) + (dom_string *) (t), (bool) (b), (bool) (c), \ + (struct dom_abstract_view *) (v), (dom_string *) (ki), \ + (dom_key_location) (kl), (dom_string *) (m)) dom_exception _dom_keyboard_event_init_ns(dom_keyboard_event *evt, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, - struct dom_string *key_ident, dom_key_location key_loc, - struct dom_string *modifier_list); + dom_string *key_ident, dom_key_location key_loc, + dom_string *modifier_list); #define dom_keyboard_event_init_ns(e, n, t, b, c, v, ki, kl, m) \ _dom_keyboard_event_init_ns((dom_keyboard_event *) (e), \ - (struct dom_string *) (n), (struct dom_string *) (t), \ + (dom_string *) (n), (dom_string *) (t), \ (bool) (b), (bool) (c), (struct dom_abstract_view *) (v), \ - (struct dom_string *) (ki), (dom_key_location) (kl), \ - (struct dom_string *) (m)) + (dom_string *) (ki), (dom_key_location) (kl), \ + (dom_string *) (m)) #endif diff --git a/include/dom/events/mouse_event.h b/include/dom/events/mouse_event.h index c153dd8..8212c72 100644 --- a/include/dom/events/mouse_event.h +++ b/include/dom/events/mouse_event.h @@ -10,9 +10,9 @@ #include #include +#include #include -struct dom_string; struct dom_abstract_view; typedef struct dom_mouse_event dom_mouse_event; @@ -69,13 +69,13 @@ dom_exception _dom_mouse_event_get_related_target(dom_mouse_event *evt, (dom_event_target **) (t)) dom_exception _dom_mouse_event_get_modifier_state(dom_mouse_event *evt, - struct dom_string *m, bool *state); + dom_string *m, bool *state); #define dom_mouse_event_get_modifier_state(e, m, s) \ _dom_mouse_event_get_modifier_state((dom_mouse_event *) (e), \ - (struct dom_string *) (m), (bool *) (s)) + (dom_string *) (m), (bool *) (s)) dom_exception _dom_mouse_event_init(dom_mouse_event *evt, - struct dom_string *type, bool bubble, bool cancelable, + dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, long detail, long screen_x, long screen_y, long client_x, long client_y, bool ctrl, bool alt, bool shift, bool meta, unsigned short button, @@ -83,14 +83,14 @@ dom_exception _dom_mouse_event_init(dom_mouse_event *evt, #define dom_mouse_event_init(e, t, b, c, v, d, sx, sy, cx, cy, ctrl, alt, \ shift, meta, button, et) \ _dom_mouse_event_init((dom_mouse_event *) (e), \ - (struct dom_string *) (t), (bool) (b), (bool) (c),\ + (dom_string *) (t), (bool) (b), (bool) (c),\ (struct dom_abstract_view *) (v), (long) (d), (long) (sx), \ (long) (sy), (long) (cx), (long) (cy), (bool) (ctrl),\ (bool) (alt), (bool) (shift), (bool) (meta), \ (unsigned short) (button), (dom_event_target *) (et)) dom_exception _dom_mouse_event_init_ns(dom_mouse_event *evt, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, long detail, long screen_x, long screen_y, long client_x, long client_y, bool ctrl, bool alt, bool shift, bool meta, @@ -98,7 +98,7 @@ dom_exception _dom_mouse_event_init_ns(dom_mouse_event *evt, #define dom_mouse_event_init_ns(e, n, t, b, c, v, d, sx, sy, cx, cy, ctrl, alt,\ shift, meta, button, et) \ _dom_mouse_event_init_ns((dom_mouse_event *) (e), \ - (struct dom_string *) (n), (struct dom_string *) (t),\ + (dom_string *) (n), (dom_string *) (t),\ (bool) (b), (bool) (c), (struct dom_abstract_view *) (v),\ (long) (d), (long) (sx), (long) (sy), (long) (cx),\ (long) (cy), (bool) (ctrl), (bool) (alt), (bool) (shift),\ diff --git a/include/dom/events/mouse_multi_wheel_event.h b/include/dom/events/mouse_multi_wheel_event.h index 7bb85ff..8d2a4eb 100644 --- a/include/dom/events/mouse_multi_wheel_event.h +++ b/include/dom/events/mouse_multi_wheel_event.h @@ -10,9 +10,9 @@ #include #include +#include #include -struct dom_string; struct dom_abstract_view; typedef struct dom_mouse_multi_wheel_event dom_mouse_multi_wheel_event; @@ -36,21 +36,21 @@ dom_exception _dom_mouse_multi_wheel_event_get_wheel_delta_z( (dom_mouse_multi_wheel_event *) (e), (long *) (z)) dom_exception _dom_mouse_multi_wheel_event_init_ns( - dom_mouse_multi_wheel_event *evt, struct dom_string *namespace, - struct dom_string *type, bool bubble, bool cancelable, + dom_mouse_multi_wheel_event *evt, dom_string *namespace, + dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, long detail, long screen_x, long screen_y, long client_x, long client_y, unsigned short button, dom_event_target *et, - struct dom_string *modifier_list, long wheel_delta_x, + dom_string *modifier_list, long wheel_delta_x, long wheel_delta_y, long wheel_delta_z); #define dom_mouse_multi_wheel_event_init_ns(e, n, t, b, c, v, \ d, sx, sy, cx, cy, button, et, ml, x, y, z) \ _dom_mouse_multi_wheel_event_init_ns( \ - (dom_mouse_multi_wheel_event *) (e), (struct dom_string *) (n),\ - (struct dom_string *) (t), (bool) (b), (bool) (c), \ + (dom_mouse_multi_wheel_event *) (e), (dom_string *) (n),\ + (dom_string *) (t), (bool) (b), (bool) (c), \ (struct dom_abstract_view *) (v), (long) (d), (long) (sx), \ (long) (sy), (long) (cx), (long) (cy),\ (unsigned short) (button), (dom_event_target *) (et),\ - (struct dom_string *) (ml), (long) (x), (long) (y), (long) (z)) + (dom_string *) (ml), (long) (x), (long) (y), (long) (z)) #endif diff --git a/include/dom/events/mouse_wheel_event.h b/include/dom/events/mouse_wheel_event.h index 5f1e83c..34f5e75 100644 --- a/include/dom/events/mouse_wheel_event.h +++ b/include/dom/events/mouse_wheel_event.h @@ -9,9 +9,9 @@ #include #include +#include #include -struct dom_string; struct dom_abstract_view; typedef struct dom_mouse_wheel_event dom_mouse_wheel_event; @@ -23,20 +23,20 @@ dom_exception _dom_mouse_wheel_event_get_wheel_delta( (dom_mouse_wheel_event *) (e), (long *) (d)) dom_exception _dom_mouse_wheel_event_init_ns( - dom_mouse_wheel_event *evt, struct dom_string *namespace, - struct dom_string *type, bool bubble, bool cancelable, + dom_mouse_wheel_event *evt, dom_string *namespace, + dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, long detail, long screen_x, long screen_y, long client_x, long client_y, unsigned short button, dom_event_target *et, - struct dom_string *modifier_list, long wheel_delta); + dom_string *modifier_list, long wheel_delta); #define dom_mouse_wheel_event_init_ns(e, n, t, b, c, v, \ d, sx, sy, cx, cy, button, et, ml, dt) \ _dom_mouse_wheel_event_init_ns((dom_mouse_wheel_event *) (e), \ - (struct dom_string *) (n), (struct dom_string *) (t), \ + (dom_string *) (n), (dom_string *) (t), \ (bool) (b), (bool) (c), (struct dom_abstract_view *) (v),\ (long) (d), (long) (sx), (long) (sy), (long) (cx), (long) (cy),\ (unsigned short) (button), (dom_event_target *) (et),\ - (struct dom_string *) (ml), (long) (dt)) + (dom_string *) (ml), (long) (dt)) #endif diff --git a/include/dom/events/mutation_event.h b/include/dom/events/mutation_event.h index 9dc3fdd..80a8b46 100644 --- a/include/dom/events/mutation_event.h +++ b/include/dom/events/mutation_event.h @@ -10,8 +10,8 @@ #include #include +#include -struct dom_string; struct dom_node; typedef enum { @@ -29,22 +29,22 @@ dom_exception _dom_mutation_event_get_related_node(dom_mutation_event *evt, (dom_mutation_event *) (e), (struct dom_node **) (n)) dom_exception _dom_mutation_event_get_prev_value(dom_mutation_event *evt, - struct dom_string **ret); + dom_string **ret); #define dom_mutation_event_get_prev_value(e, r) \ _dom_mutation_event_get_prev_value((dom_mutation_event *) (e), \ - (struct dom_string **) (r)) + (dom_string **) (r)) dom_exception _dom_mutation_event_get_new_value(dom_mutation_event *evt, - struct dom_string **ret); + dom_string **ret); #define dom_mutation_event_get_new_value(e, r) \ _dom_mutation_event_get_new_value((dom_mutation_event *) (e), \ - (struct dom_string **) (r)) + (dom_string **) (r)) dom_exception _dom_mutation_event_get_attr_name(dom_mutation_event *evt, - struct dom_string **ret); + dom_string **ret); #define dom_mutation_event_get_attr_name(e, r) \ _dom_mutation_event_get_attr_name((dom_mutation_event *) (e), \ - (struct dom_string **) (r)) + (dom_string **) (r)) dom_exception _dom_mutation_event_get_attr_change(dom_mutation_event *evt, dom_mutation_type *type); @@ -53,28 +53,28 @@ dom_exception _dom_mutation_event_get_attr_change(dom_mutation_event *evt, (dom_mutation_type *) (t)) dom_exception _dom_mutation_event_init(dom_mutation_event *evt, - struct dom_string *type, bool bubble, bool cancelable, - struct dom_node *node, struct dom_string *prev_value, - struct dom_string *new_value, struct dom_string *attr_name, + dom_string *type, bool bubble, bool cancelable, + struct dom_node *node, dom_string *prev_value, + dom_string *new_value, dom_string *attr_name, dom_mutation_type change); #define dom_mutation_event_init(e, t, b, c, n, p, nv, a, ch) \ _dom_mutation_event_init((dom_mutation_event *) (e), \ - (struct dom_string *) (t), (bool) (b), (bool) (c), \ - (struct dom_node *) (n), (struct dom_string *) (p), \ - (struct dom_string *) (nv), (struct dom_string *) (a), \ + (dom_string *) (t), (bool) (b), (bool) (c), \ + (struct dom_node *) (n), (dom_string *) (p), \ + (dom_string *) (nv), (dom_string *) (a), \ (dom_mutation_type) (ch)) dom_exception _dom_mutation_event_init_ns(dom_mutation_event *evt, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, bool bubble, bool cancelable, struct dom_node *node, - struct dom_string *prev_value, struct dom_string *new_value, - struct dom_string *attr_name, dom_mutation_type change); + dom_string *prev_value, dom_string *new_value, + dom_string *attr_name, dom_mutation_type change); #define dom_mutation_event_init_ns(e, n, t, b, c, nd, p, nv, a, ch) \ _dom_mutation_event_init_ns((dom_mutation_event *) (e), \ - (struct dom_string *) (n), (struct dom_string *) (t),\ + (dom_string *) (n), (dom_string *) (t),\ (bool) (b), (bool) (c), (struct dom_node *) (nd), \ - (struct dom_string *) (p), (struct dom_string *) (nv),\ - (struct dom_string *) (a), (dom_mutation_type) (ch)) + (dom_string *) (p), (dom_string *) (nv),\ + (dom_string *) (a), (dom_mutation_type) (ch)) #endif diff --git a/include/dom/events/mutation_name_event.h b/include/dom/events/mutation_name_event.h index 13d27a4..e0325d7 100644 --- a/include/dom/events/mutation_name_event.h +++ b/include/dom/events/mutation_name_event.h @@ -10,44 +10,44 @@ #include #include +#include -struct dom_string; struct dom_node; typedef struct dom_mutation_name_event dom_mutation_name_event; dom_exception _dom_mutation_name_event_get_prev_namespace( - dom_mutation_name_event *evt, struct dom_string **namespace); + dom_mutation_name_event *evt, dom_string **namespace); #define dom_mutation_name_event_get_prev_namespace(e, n) \ _dom_mutation_name_event_get_prev_namespace(\ - (dom_mutation_name_event *) (e), (struct dom_string **) (n)) + (dom_mutation_name_event *) (e), (dom_string **) (n)) dom_exception _dom_mutation_name_event_get_prev_node_name( - dom_mutation_name_event *evt, struct dom_string **name); + dom_mutation_name_event *evt, dom_string **name); #define dom_mutation_name_event_get_prev_node_name(e, n) \ _dom_mutation_name_event_get_prev_node_name(\ - (dom_mutation_name_event *) (e), (struct dom_string **) (n)) + (dom_mutation_name_event *) (e), (dom_string **) (n)) dom_exception _dom_mutation_name_event_init(dom_mutation_name_event *evt, - struct dom_string *type, bool bubble, bool cancelable, - struct dom_node *node, struct dom_string *prev_ns, - struct dom_string *prev_name); + dom_string *type, bool bubble, bool cancelable, + struct dom_node *node, dom_string *prev_ns, + dom_string *prev_name); #define dom_mutation_name_event_init(e, t, b, c, n, p, pn) \ _dom_mutation_name_event_init((dom_mutation_name_event *) (e), \ - (struct dom_string *) (t), (bool) (b), (bool) (c), \ - (struct dom_node *) (n), (struct dom_string *) (p), \ - (struct dom_string *) (pn)) + (dom_string *) (t), (bool) (b), (bool) (c), \ + (struct dom_node *) (n), (dom_string *) (p), \ + (dom_string *) (pn)) dom_exception _dom_mutation_name_event_init_ns(dom_mutation_name_event *evt, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, bool bubble, bool cancelable, struct dom_node *node, - struct dom_string *prev_ns, struct dom_string *prev_name); + dom_string *prev_ns, dom_string *prev_name); #define dom_mutation_name_event_init_ns(e, n, t, b, c, nv, p, pn) \ _dom_mutation_name_event_init_ns(\ - (dom_mutation_name_event *) (e), (struct dom_string *) (n),\ - (struct dom_string *) (t), (bool) (b), (bool) (c),\ - (struct dom_node *) (nv), (struct dom_string *) (p), \ - (struct dom_string *) (pn)) + (dom_mutation_name_event *) (e), (dom_string *) (n),\ + (dom_string *) (t), (bool) (b), (bool) (c),\ + (struct dom_node *) (nv), (dom_string *) (p), \ + (dom_string *) (pn)) #endif diff --git a/include/dom/events/text_event.h b/include/dom/events/text_event.h index cf040ce..5b5fe34 100644 --- a/include/dom/events/text_event.h +++ b/include/dom/events/text_event.h @@ -10,32 +10,32 @@ #include #include +#include struct dom_abstract_view; -struct dom_string; typedef struct dom_text_event dom_text_event; dom_exception _dom_text_event_get_data(dom_text_event *evt, - struct dom_string **data); + dom_string **data); #define dom_text_event_get_data(e, d) _dom_text_event_get_data(\ - (dom_text_event *) (e), (struct dom_string **) (d)) + (dom_text_event *) (e), (dom_string **) (d)) dom_exception _dom_text_event_init(dom_text_event *evt, - struct dom_string *type, bool bubble, bool cancelable, - struct dom_abstract_view *view, struct dom_string *data); + dom_string *type, bool bubble, bool cancelable, + struct dom_abstract_view *view, dom_string *data); #define dom_text_event_init(e, t, b, c, v, d) _dom_text_event_init( \ - (dom_text_event *) (e), (struct dom_string *) (t), (bool) (b), \ + (dom_text_event *) (e), (dom_string *) (t), (bool) (b), \ (bool) (c), (struct dom_abstract_view *) (v),\ - (struct dom_string *) (d)) + (dom_string *) (d)) dom_exception _dom_text_event_init_ns(dom_text_event *evt, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, - struct dom_string *data); + dom_string *data); #define dom_text_event_init_ns(e, n, t, b, c, v, d) _dom_text_event_init_ns( \ - (dom_text_event *) (e), (struct dom_string *) (n), \ - (struct dom_string *) (t), (bool) (b), (bool) (c), \ - (struct dom_abstract_view *) (v), (struct dom_string *) (d)) + (dom_text_event *) (e), (dom_string *) (n), \ + (dom_string *) (t), (bool) (b), (bool) (c), \ + (struct dom_abstract_view *) (v), (dom_string *) (d)) #endif diff --git a/include/dom/events/ui_event.h b/include/dom/events/ui_event.h index eaded99..da321e5 100644 --- a/include/dom/events/ui_event.h +++ b/include/dom/events/ui_event.h @@ -10,8 +10,8 @@ #include #include +#include -struct dom_string; struct dom_abstract_view; typedef struct dom_ui_event dom_ui_event; @@ -26,20 +26,20 @@ dom_exception _dom_ui_event_get_detail(dom_ui_event *evt, #define dom_ui_event_get_detail(e, d) _dom_ui_event_get_detail(\ (dom_ui_event *) (e), (long *) (d)) -dom_exception _dom_ui_event_init(dom_ui_event *evt, struct dom_string *type, +dom_exception _dom_ui_event_init(dom_ui_event *evt, dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, long detail); #define dom_ui_event_init(e, t, b, c, v, d) _dom_ui_event_init( \ - (dom_ui_event *) (e), (struct dom_string *) (t), (bool) (b), \ + (dom_ui_event *) (e), (dom_string *) (t), (bool) (b), \ (bool) (c), (struct dom_abstract_view *) (v), (long) (d)) dom_exception _dom_ui_event_init_ns(dom_ui_event *evt, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, long detail); #define dom_ui_event_init_ns(e, n, t, b, c, v, d) _dom_ui_event_init_ns( \ - (dom_ui_event *) (e), (struct dom_string *) (n), \ - (struct dom_string *) (t), (bool) (b), (bool) (c), \ + (dom_ui_event *) (e), (dom_string *) (n), \ + (dom_string *) (t), (bool) (b), (bool) (c), \ (struct dom_abstract_view *) (v), (long) (d)) #endif diff --git a/include/dom/html/html_collection.h b/include/dom/html/html_collection.h index 09cf6ed..7322ea8 100644 --- a/include/dom/html/html_collection.h +++ b/include/dom/html/html_collection.h @@ -9,9 +9,9 @@ #define dom_html_collection_h_ #include +#include struct dom_node; -struct dom_string; typedef struct dom_html_collection dom_html_collection; @@ -20,7 +20,7 @@ dom_exception dom_html_collection_get_length(dom_html_collection *col, dom_exception dom_html_collection_item(dom_html_collection *col, unsigned long index, struct dom_node **node); dom_exception dom_html_collection_named_item(dom_html_collection *col, - struct dom_string *name, struct dom_node **node); + dom_string *name, struct dom_node **node); void dom_html_collection_ref(dom_html_collection *col); void dom_html_collection_unref(dom_html_collection *col); diff --git a/include/dom/html/html_document.h b/include/dom/html/html_document.h index 230024a..55bc12b 100644 --- a/include/dom/html/html_document.h +++ b/include/dom/html/html_document.h @@ -56,15 +56,15 @@ dom_exception dom_html_document_complete(void); /* The DOM spec public API */ dom_exception dom_html_document_get_title(dom_html_document *doc, - struct dom_string **title); + dom_string **title); dom_exception dom_html_document_set_title(dom_html_document *doc, - struct dom_string *title); + dom_string *title); dom_exception dom_html_document_get_referer(dom_html_document *doc, - struct dom_string **referer); + dom_string **referer); dom_exception dom_html_document_get_domain(dom_html_document *doc, - struct dom_string **domain); + dom_string **domain); dom_exception dom_html_document_get_url(dom_html_document *doc, - struct dom_string **url); + dom_string **url); dom_exception dom_html_document_get_body(dom_html_document *doc, struct dom_html_element **body); dom_exception dom_html_document_set_body(dom_html_document *doc, @@ -80,18 +80,18 @@ dom_exception dom_html_document_get_forms(dom_html_document *doc, dom_exception dom_html_document_get_anchors(dom_html_document *doc, struct dom_html_collection **col); dom_exception dom_html_document_get_cookie(dom_html_document *doc, - struct dom_string **cookie); + dom_string **cookie); dom_exception dom_html_document_set_cookie(dom_html_document *doc, - struct dom_string *cookie); + dom_string *cookie); dom_exception dom_html_document_open(dom_html_document *doc); dom_exception dom_html_document_close(dom_html_document *doc); dom_exception dom_html_document_write(dom_html_document *doc, - struct dom_string *text); + dom_string *text); dom_exception dom_html_document_writeln(dom_html_document *doc, - struct dom_string *text); + dom_string *text); dom_exception dom_html_document_get_elements_by_name(dom_html_document *doc, - struct dom_string *name, struct dom_nodelist **list); + dom_string *name, struct dom_nodelist **list); #endif diff --git a/include/dom/html/html_element.h b/include/dom/html/html_element.h index 47129fe..ea07c72 100644 --- a/include/dom/html/html_element.h +++ b/include/dom/html/html_element.h @@ -16,28 +16,28 @@ typedef struct dom_html_element_vtable { struct dom_element_vtable base; dom_exception (*dom_html_element_get_id)(struct dom_html_element *element, - struct dom_string **id); + dom_string **id); dom_exception (*dom_html_element_set_id)(struct dom_html_element *element, - struct dom_string *id); + dom_string *id); } dom_html_element_vtable; static inline dom_exception dom_html_element_get_id(struct dom_html_element *element, - struct dom_string **id) + dom_string **id) { return ((dom_html_element_vtable *) ((dom_node *) element)->vtable)-> dom_html_element_get_id(element, id); } #define dom_html_element_get_id(e, id) dom_html_element_get_id( \ - (dom_html_element *) (e), (struct dom_string **) (id)) + (dom_html_element *) (e), (dom_string **) (id)) static inline dom_exception dom_html_element_set_id(struct dom_html_element *element, - struct dom_string *id) + dom_string *id) { return ((dom_html_element_vtable *) ((dom_node *) element)->vtable)-> dom_html_element_set_id(element, id); } #define dom_html_element_set_id(e, id) dom_html_element_set_id( \ - (dom_html_element *) (e), (struct dom_string *) (id)) + (dom_html_element *) (e), (dom_string *) (id)) #endif diff --git a/include/dom/html/html_options_collection.h b/include/dom/html/html_options_collection.h index ad8e6aa..d11221a 100644 --- a/include/dom/html/html_options_collection.h +++ b/include/dom/html/html_options_collection.h @@ -9,9 +9,9 @@ #define dom_html_options_collection_h_ #include +#include struct dom_node; -struct dom_string; typedef struct dom_html_options_collection dom_html_options_collection; @@ -23,7 +23,7 @@ dom_exception dom_html_options_collection_item( dom_html_options_collection *col, unsigned long index, struct dom_node **node); dom_exception dom_html_options_collection_named_item( - dom_html_options_collection *col, struct dom_string *name, + dom_html_options_collection *col, dom_string *name, struct dom_node **node); void dom_html_options_collection_ref(dom_html_options_collection *col); diff --git a/include/dom/html/html_title_element.h b/include/dom/html/html_title_element.h index 5da766a..24a3b63 100644 --- a/include/dom/html/html_title_element.h +++ b/include/dom/html/html_title_element.h @@ -9,16 +9,15 @@ #define dom_html_title_element_h_ #include - -struct dom_string; +#include typedef struct dom_html_title_element dom_html_title_element; dom_exception dom_html_title_element_get_text(dom_html_title_element *ele, - struct dom_string **text); + dom_string **text); dom_exception dom_html_title_element_set_text(dom_html_title_element *ele, - struct dom_string *text); + dom_string *text); #endif diff --git a/src/core/attr.c b/src/core/attr.c index b280057..937eec0 100644 --- a/src/core/attr.c +++ b/src/core/attr.c @@ -396,7 +396,7 @@ void dom_attr_mark_readonly(dom_attr *a) * finished with it. */ dom_exception _dom_attr_get_name(struct dom_attr *attr, - struct dom_string **result) + dom_string **result) { /* This is the same as nodeName */ return dom_node_get_node_name(attr, result); @@ -428,11 +428,11 @@ dom_exception _dom_attr_get_specified(struct dom_attr *attr, bool *result) * finished with it. */ dom_exception _dom_attr_get_value(struct dom_attr *attr, - struct dom_string **result) + dom_string **result) { struct dom_node_internal *a = (struct dom_node_internal *) attr; struct dom_node_internal *c; - struct dom_string *value, *temp; + dom_string *value, *temp; dom_exception err; err = _dom_document_create_string(a->owner, @@ -469,7 +469,7 @@ dom_exception _dom_attr_get_value(struct dom_attr *attr, /* Claim new value */ value = temp; } else if (c->type == DOM_ENTITY_REFERENCE_NODE) { - struct dom_string *tr; + dom_string *tr; /* Get textual representation of entity */ err = _dom_entity_reference_get_textual_representation( @@ -513,7 +513,7 @@ dom_exception _dom_attr_get_value(struct dom_attr *attr, * DOM_NO_MODIFICATION_ALLOWED_ERR if attribute is readonly. */ dom_exception _dom_attr_set_value(struct dom_attr *attr, - struct dom_string *value) + dom_string *value) { struct dom_node_internal *a = (struct dom_node_internal *) attr; struct dom_node_internal *c, *d; @@ -640,7 +640,7 @@ dom_exception _dom_attr_is_id(struct dom_attr *attr, bool *result) /* Overload function of Node, please refer node.c for the detail of this * function. */ dom_exception _dom_attr_get_node_value(dom_node_internal *node, - struct dom_string **result) + dom_string **result) { dom_attr *attr = (dom_attr *) node; @@ -674,7 +674,7 @@ dom_exception _dom_attr_clone_node(dom_node_internal *node, bool deep, /* Overload function of Node, please refer node.c for the detail of this * function. */ dom_exception _dom_attr_set_prefix(dom_node_internal *node, - struct dom_string *prefix) + dom_string *prefix) { /* Really I don't know whether there should something * special to do here */ @@ -684,7 +684,7 @@ dom_exception _dom_attr_set_prefix(dom_node_internal *node, /* Overload function of Node, please refer node.c for the detail of this * function. */ dom_exception _dom_attr_lookup_prefix(dom_node_internal *node, - struct dom_string *namespace, struct dom_string **result) + dom_string *namespace, dom_string **result) { struct dom_element *owner; dom_exception err; @@ -704,7 +704,7 @@ dom_exception _dom_attr_lookup_prefix(dom_node_internal *node, /* Overload function of Node, please refer node.c for the detail of this * function. */ dom_exception _dom_attr_is_default_namespace(dom_node_internal *node, - struct dom_string *namespace, bool *result) + dom_string *namespace, bool *result) { struct dom_element *owner; dom_exception err; @@ -724,7 +724,7 @@ dom_exception _dom_attr_is_default_namespace(dom_node_internal *node, /* Overload function of Node, please refer node.c for the detail of this * function. */ dom_exception _dom_attr_lookup_namespace(dom_node_internal *node, - struct dom_string *prefix, struct dom_string **result) + dom_string *prefix, dom_string **result) { struct dom_element *owner; dom_exception err; diff --git a/src/core/attr.h b/src/core/attr.h index b94715a..0d4621a 100644 --- a/src/core/attr.h +++ b/src/core/attr.h @@ -11,7 +11,6 @@ #include struct dom_document; -struct dom_string; struct dom_type_info; struct lwc_string_s; @@ -28,12 +27,12 @@ void _dom_attr_finalise(struct dom_document *doc, struct dom_attr *attr); /* Virtual functions for dom_attr */ dom_exception _dom_attr_get_name(struct dom_attr *attr, - struct dom_string **result); + dom_string **result); dom_exception _dom_attr_get_specified(struct dom_attr *attr, bool *result); dom_exception _dom_attr_get_value(struct dom_attr *attr, - struct dom_string **result); + dom_string **result); dom_exception _dom_attr_set_value(struct dom_attr *attr, - struct dom_string *value); + dom_string *value); dom_exception _dom_attr_get_owner(struct dom_attr *attr, struct dom_element **result); dom_exception _dom_attr_get_schema_type_info(struct dom_attr *attr, @@ -51,18 +50,18 @@ dom_exception _dom_attr_is_id(struct dom_attr *attr, bool *result); /* Overloading dom_node functions */ dom_exception _dom_attr_get_node_value(dom_node_internal *node, - struct dom_string **result); + dom_string **result); dom_exception _dom_attr_clone_node(dom_node_internal *node, bool deep, dom_node_internal **result); dom_exception _dom_attr_set_prefix(dom_node_internal *node, - struct dom_string *prefix); + dom_string *prefix); dom_exception _dom_attr_normalize(dom_node_internal *node); dom_exception _dom_attr_lookup_prefix(dom_node_internal *node, - struct dom_string *namespace, struct dom_string **result); + dom_string *namespace, dom_string **result); dom_exception _dom_attr_is_default_namespace(dom_node_internal *node, - struct dom_string *namespace, bool *result); + dom_string *namespace, bool *result); dom_exception _dom_attr_lookup_namespace(dom_node_internal *node, - struct dom_string *prefix, struct dom_string **result); + dom_string *prefix, dom_string **result); #define DOM_NODE_VTABLE_ATTR \ _dom_node_get_node_name, \ _dom_attr_get_node_value, /*overload*/\ diff --git a/src/core/cdatasection.c b/src/core/cdatasection.c index b470df2..7417ebf 100644 --- a/src/core/cdatasection.c +++ b/src/core/cdatasection.c @@ -37,7 +37,7 @@ static struct dom_node_protect_vtable cdata_section_protect_vtable = { * The returned node will already be referenced. */ dom_exception _dom_cdata_section_create(struct dom_document *doc, - struct lwc_string_s *name, struct dom_string *value, + struct lwc_string_s *name, dom_string *value, struct dom_cdata_section **result) { struct dom_cdata_section *c; diff --git a/src/core/cdatasection.h b/src/core/cdatasection.h index 94d45a2..04a0954 100644 --- a/src/core/cdatasection.h +++ b/src/core/cdatasection.h @@ -10,15 +10,15 @@ #include #include +#include struct dom_node_internal; struct dom_cdata_section; struct dom_document; -struct dom_string; struct lwc_string_s; dom_exception _dom_cdata_section_create(struct dom_document *doc, - struct lwc_string_s *name, struct dom_string *value, + struct lwc_string_s *name, dom_string *value, struct dom_cdata_section **result); void _dom_cdata_section_destroy(struct dom_document *doc, diff --git a/src/core/characterdata.c b/src/core/characterdata.c index 05d12ea..824e0dc 100644 --- a/src/core/characterdata.c +++ b/src/core/characterdata.c @@ -57,7 +57,7 @@ dom_characterdata *_dom_characterdata_create(struct dom_document *doc) */ dom_exception _dom_characterdata_initialise(struct dom_characterdata *cdata, struct dom_document *doc, dom_node_type type, - lwc_string *name, struct dom_string *value) + lwc_string *name, dom_string *value) { return _dom_node_initialise(&cdata->base, doc, type, name, value, NULL, NULL); @@ -97,7 +97,7 @@ void _dom_characterdata_finalise(struct dom_document *doc, * this implementation; dom_strings are unbounded. */ dom_exception _dom_characterdata_get_data(struct dom_characterdata *cdata, - struct dom_string **data) + dom_string **data) { struct dom_node_internal *c = (struct dom_node_internal *) cdata; @@ -122,7 +122,7 @@ dom_exception _dom_characterdata_get_data(struct dom_characterdata *cdata, * a reference on the string). The node's existing content will be unrefed. */ dom_exception _dom_characterdata_set_data(struct dom_characterdata *cdata, - struct dom_string *data) + dom_string *data) { struct dom_node_internal *c = (struct dom_node_internal *) cdata; @@ -192,7 +192,7 @@ dom_exception _dom_characterdata_get_length(struct dom_characterdata *cdata, */ dom_exception _dom_characterdata_substring_data( struct dom_characterdata *cdata, unsigned long offset, - unsigned long count, struct dom_string **data) + unsigned long count, dom_string **data) { struct dom_node_internal *c = (struct dom_node_internal *) cdata; uint32_t len, end; @@ -225,10 +225,10 @@ dom_exception _dom_characterdata_substring_data( * DOM_NO_MODIFICATION_ALLOWED_ERR if ::cdata is readonly. */ dom_exception _dom_characterdata_append_data(struct dom_characterdata *cdata, - struct dom_string *data) + dom_string *data) { struct dom_node_internal *c = (struct dom_node_internal *) cdata; - struct dom_string *temp; + dom_string *temp; dom_exception err; if (_dom_node_readonly(c)) { @@ -271,10 +271,10 @@ dom_exception _dom_characterdata_append_data(struct dom_characterdata *cdata, * DOM_NO_MODIFICATION_ALLOWED_ERR if ::cdata is readonly. */ dom_exception _dom_characterdata_insert_data(struct dom_characterdata *cdata, - unsigned long offset, struct dom_string *data) + unsigned long offset, dom_string *data) { struct dom_node_internal *c = (struct dom_node_internal *) cdata; - struct dom_string *temp; + dom_string *temp; uint32_t len; dom_exception err; @@ -335,7 +335,7 @@ dom_exception _dom_characterdata_delete_data(struct dom_characterdata *cdata, unsigned long offset, unsigned long count) { struct dom_node_internal *c = (struct dom_node_internal *) cdata; - struct dom_string *temp; + dom_string *temp; uint32_t len, end; dom_exception err; @@ -397,10 +397,10 @@ dom_exception _dom_characterdata_delete_data(struct dom_characterdata *cdata, */ dom_exception _dom_characterdata_replace_data(struct dom_characterdata *cdata, unsigned long offset, unsigned long count, - struct dom_string *data) + dom_string *data) { struct dom_node_internal *c = (struct dom_node_internal *) cdata; - struct dom_string *temp; + dom_string *temp; uint32_t len, end; dom_exception err; diff --git a/src/core/characterdata.h b/src/core/characterdata.h index b5886ea..da8772d 100644 --- a/src/core/characterdata.h +++ b/src/core/characterdata.h @@ -24,30 +24,30 @@ struct dom_characterdata { dom_characterdata *_dom_characterdata_create(struct dom_document *doc); dom_exception _dom_characterdata_initialise(struct dom_characterdata *cdata, struct dom_document *doc, dom_node_type type, - struct lwc_string_s *name, struct dom_string *value); + struct lwc_string_s *name, dom_string *value); void _dom_characterdata_finalise(struct dom_document *doc, struct dom_characterdata *cdata); /* The virtual functions for dom_characterdata */ dom_exception _dom_characterdata_get_data(struct dom_characterdata *cdata, - struct dom_string **data); + dom_string **data); dom_exception _dom_characterdata_set_data(struct dom_characterdata *cdata, - struct dom_string *data); + dom_string *data); dom_exception _dom_characterdata_get_length(struct dom_characterdata *cdata, unsigned long *length); dom_exception _dom_characterdata_substring_data( struct dom_characterdata *cdata, unsigned long offset, - unsigned long count, struct dom_string **data); + unsigned long count, dom_string **data); dom_exception _dom_characterdata_append_data(struct dom_characterdata *cdata, - struct dom_string *data); + dom_string *data); dom_exception _dom_characterdata_insert_data(struct dom_characterdata *cdata, - unsigned long offset, struct dom_string *data); + unsigned long offset, dom_string *data); dom_exception _dom_characterdata_delete_data(struct dom_characterdata *cdata, unsigned long offset, unsigned long count); dom_exception _dom_characterdata_replace_data(struct dom_characterdata *cdata, unsigned long offset, unsigned long count, - struct dom_string *data); + dom_string *data); #define DOM_CHARACTERDATA_VTABLE \ _dom_characterdata_get_data, \ diff --git a/src/core/comment.c b/src/core/comment.c index 564bcd8..ab49a66 100644 --- a/src/core/comment.c +++ b/src/core/comment.c @@ -38,7 +38,7 @@ static struct dom_node_protect_vtable comment_protect_vtable = { * The returned node will already be referenced. */ dom_exception _dom_comment_create(struct dom_document *doc, - struct lwc_string_s *name, struct dom_string *value, + struct lwc_string_s *name, dom_string *value, struct dom_comment **result) { struct dom_comment *c; diff --git a/src/core/comment.h b/src/core/comment.h index ef8791f..1951732 100644 --- a/src/core/comment.h +++ b/src/core/comment.h @@ -13,11 +13,10 @@ struct dom_comment; struct dom_document; -struct dom_string; struct lwc_string_s; dom_exception _dom_comment_create(struct dom_document *doc, - struct lwc_string_s *name, struct dom_string *value, + struct lwc_string_s *name, dom_string *value, struct dom_comment **result); #define _dom_comment_initialise _dom_characterdata_initialise diff --git a/src/core/doc_fragment.c b/src/core/doc_fragment.c index 6b46696..1d320b5 100644 --- a/src/core/doc_fragment.c +++ b/src/core/doc_fragment.c @@ -45,7 +45,7 @@ static struct dom_node_protect_vtable df_protect_vtable = { * The returned node will already be referenced. */ dom_exception _dom_document_fragment_create(struct dom_document *doc, - struct lwc_string_s *name, struct dom_string *value, + struct lwc_string_s *name, dom_string *value, struct dom_document_fragment **result) { struct dom_document_fragment *f; diff --git a/src/core/doc_fragment.h b/src/core/doc_fragment.h index 9d3de76..b2c3e71 100644 --- a/src/core/doc_fragment.h +++ b/src/core/doc_fragment.h @@ -12,11 +12,10 @@ struct dom_document_fragment; struct dom_document; -struct dom_string; struct lwc_string_s; dom_exception _dom_document_fragment_create(struct dom_document *doc, - struct lwc_string_s *name, struct dom_string *value, + struct lwc_string_s *name, dom_string *value, struct dom_document_fragment **result); void _dom_document_fragment_destroy(struct dom_document *doc, diff --git a/src/core/document.c b/src/core/document.c index 20ad789..b671c30 100644 --- a/src/core/document.c +++ b/src/core/document.c @@ -285,7 +285,7 @@ dom_exception _dom_document_get_document_element(struct dom_document *doc, * finished with it. */ dom_exception _dom_document_create_element(struct dom_document *doc, - struct dom_string *tag_name, struct dom_element **result) + dom_string *tag_name, struct dom_element **result) { lwc_string *name; dom_exception err; @@ -345,7 +345,7 @@ dom_exception _dom_document_create_document_fragment(struct dom_document *doc, * finished with it. */ dom_exception _dom_document_create_text_node(struct dom_document *doc, - struct dom_string *data, struct dom_text **result) + dom_string *data, struct dom_text **result) { lwc_string *name; dom_exception err; @@ -374,7 +374,7 @@ dom_exception _dom_document_create_text_node(struct dom_document *doc, * finished with it. */ dom_exception _dom_document_create_comment(struct dom_document *doc, - struct dom_string *data, struct dom_comment **result) + dom_string *data, struct dom_comment **result) { lwc_string *name; dom_exception err; @@ -405,7 +405,7 @@ dom_exception _dom_document_create_comment(struct dom_document *doc, * finished with it. */ dom_exception _dom_document_create_cdata_section(struct dom_document *doc, - struct dom_string *data, struct dom_cdata_section **result) + dom_string *data, struct dom_cdata_section **result) { lwc_string *name; dom_exception err; @@ -438,8 +438,8 @@ dom_exception _dom_document_create_cdata_section(struct dom_document *doc, * finished with it. */ dom_exception _dom_document_create_processing_instruction( - struct dom_document *doc, struct dom_string *target, - struct dom_string *data, + struct dom_document *doc, dom_string *target, + dom_string *data, struct dom_processing_instruction **result) { lwc_string *name; @@ -472,7 +472,7 @@ dom_exception _dom_document_create_processing_instruction( * finished with it. */ dom_exception _dom_document_create_attribute(struct dom_document *doc, - struct dom_string *name, struct dom_attr **result) + dom_string *name, struct dom_attr **result) { lwc_string *n; dom_exception err; @@ -504,7 +504,7 @@ dom_exception _dom_document_create_attribute(struct dom_document *doc, * finished with it. */ dom_exception _dom_document_create_entity_reference(struct dom_document *doc, - struct dom_string *name, + dom_string *name, struct dom_entity_reference **result) { lwc_string *n; @@ -535,7 +535,7 @@ dom_exception _dom_document_create_entity_reference(struct dom_document *doc, * finished with it. */ dom_exception _dom_document_get_elements_by_tag_name(struct dom_document *doc, - struct dom_string *tagname, struct dom_nodelist **result) + dom_string *tagname, struct dom_nodelist **result) { lwc_string *name; dom_exception err; @@ -605,10 +605,10 @@ dom_exception _dom_document_import_node(struct dom_document *doc, * finished with it. */ dom_exception _dom_document_create_element_ns(struct dom_document *doc, - struct dom_string *namespace, struct dom_string *qname, + dom_string *namespace, dom_string *qname, struct dom_element **result) { - struct dom_string *prefix, *localname; + dom_string *prefix, *localname; dom_exception err; if (_dom_validate_name(qname) == false) @@ -710,10 +710,10 @@ dom_exception _dom_document_create_element_ns(struct dom_document *doc, * finished with it. */ dom_exception _dom_document_create_attribute_ns(struct dom_document *doc, - struct dom_string *namespace, struct dom_string *qname, + dom_string *namespace, dom_string *qname, struct dom_attr **result) { - struct dom_string *prefix, *localname; + dom_string *prefix, *localname; dom_exception err; if (_dom_validate_name(qname) == false) @@ -799,8 +799,8 @@ dom_exception _dom_document_create_attribute_ns(struct dom_document *doc, * finished with it. */ dom_exception _dom_document_get_elements_by_tag_name_ns( - struct dom_document *doc, struct dom_string *namespace, - struct dom_string *localname, struct dom_nodelist **result) + struct dom_document *doc, dom_string *namespace, + dom_string *localname, struct dom_nodelist **result) { dom_exception err; lwc_string *l = NULL, *n = NULL; @@ -843,7 +843,7 @@ dom_exception _dom_document_get_elements_by_tag_name_ns( * finished with it. */ dom_exception _dom_document_get_element_by_id(struct dom_document *doc, - struct dom_string *id, struct dom_element **result) + dom_string *id, struct dom_element **result) { lwc_string *i; dom_node_internal *root; @@ -877,7 +877,7 @@ dom_exception _dom_document_get_element_by_id(struct dom_document *doc, * finished with it. */ dom_exception _dom_document_get_input_encoding(struct dom_document *doc, - struct dom_string **result) + dom_string **result) { UNUSED(doc); UNUSED(result); @@ -897,7 +897,7 @@ dom_exception _dom_document_get_input_encoding(struct dom_document *doc, * finished with it. */ dom_exception _dom_document_get_xml_encoding(struct dom_document *doc, - struct dom_string **result) + dom_string **result) { UNUSED(doc); UNUSED(result); @@ -957,7 +957,7 @@ dom_exception _dom_document_set_xml_standalone(struct dom_document *doc, * DOM_NOT_SUPPORTED_ERR. */ dom_exception _dom_document_get_xml_version(struct dom_document *doc, - struct dom_string **result) + dom_string **result) { UNUSED(doc); UNUSED(result); @@ -978,7 +978,7 @@ dom_exception _dom_document_get_xml_version(struct dom_document *doc, * DOM_NOT_SUPPORTED_ERR. */ dom_exception _dom_document_set_xml_version(struct dom_document *doc, - struct dom_string *version) + dom_string *version) { UNUSED(doc); UNUSED(version); @@ -1030,7 +1030,7 @@ dom_exception _dom_document_set_strict_error_checking( * finished with it. */ dom_exception _dom_document_get_uri(struct dom_document *doc, - struct dom_string **result) + dom_string **result) { dom_string_ref(doc->uri); *result = doc->uri; @@ -1050,7 +1050,7 @@ dom_exception _dom_document_get_uri(struct dom_document *doc, * finished with it. */ dom_exception _dom_document_set_uri(struct dom_document *doc, - struct dom_string *uri) + dom_string *uri) { dom_string_unref(doc->uri); dom_string_ref(uri); @@ -1200,7 +1200,7 @@ dom_exception _dom_document_normalize(struct dom_document *doc) */ dom_exception _dom_document_rename_node(struct dom_document *doc, struct dom_node *node, - struct dom_string *namespace, struct dom_string *qname, + dom_string *namespace, dom_string *qname, struct dom_node **result) { UNUSED(doc); @@ -1273,7 +1273,7 @@ dom_exception _dom_document_copy(struct dom_node_internal *new, * returned DOM string. */ dom_exception _dom_document_create_string(struct dom_document *doc, - const uint8_t *data, size_t len, struct dom_string **result) + const uint8_t *data, size_t len, dom_string **result) { return dom_string_create(doc->alloc, doc->pw, data, len, result); } @@ -1333,7 +1333,7 @@ void _dom_document_get_allocator(struct dom_document *doc, dom_alloc *al, */ dom_exception _dom_document_create_string_from_lwcstring( struct dom_document *doc, struct lwc_string_s *str, - struct dom_string **result) + dom_string **result) { return _dom_string_create_from_lwcstring(doc->alloc, doc->pw, str, result); diff --git a/src/core/document.h b/src/core/document.h index 3939f9a..911b89f 100644 --- a/src/core/document.h +++ b/src/core/document.h @@ -52,7 +52,7 @@ struct dom_document { struct dom_doc_nl *nodelists; /**< List of active nodelists */ - struct dom_string *uri; /**< The uri of this document */ + dom_string *uri; /**< The uri of this document */ dom_alloc alloc; /**< Memory (de)allocation function */ void *pw; /**< Pointer to client data */ @@ -81,7 +81,7 @@ bool _dom_document_finalise(struct dom_document *doc); /* Create a dom_string from C string */ dom_exception _dom_document_create_string(struct dom_document *doc, - const uint8_t *data, size_t len, struct dom_string **result); + const uint8_t *data, size_t len, dom_string **result); /* Create a lwc_string from C string */ dom_exception _dom_document_create_lwcstring(struct dom_document *doc, const uint8_t *data, size_t len, struct lwc_string_s **result); @@ -91,7 +91,7 @@ void _dom_document_unref_lwcstring(struct dom_document *doc, /* Create a dom_string from a lwc_string */ dom_exception _dom_document_create_string_from_lwcstring( struct dom_document *doc, struct lwc_string_s *str, - struct dom_string **result); + dom_string **result); /* Begin the virtual functions */ @@ -102,59 +102,59 @@ dom_exception _dom_document_get_implementation(struct dom_document *doc, dom_exception _dom_document_get_document_element(struct dom_document *doc, struct dom_element **result); dom_exception _dom_document_create_element(struct dom_document *doc, - struct dom_string *tag_name, struct dom_element **result); + dom_string *tag_name, struct dom_element **result); dom_exception _dom_document_create_document_fragment(struct dom_document *doc, struct dom_document_fragment **result); dom_exception _dom_document_create_text_node(struct dom_document *doc, - struct dom_string *data, struct dom_text **result); + dom_string *data, struct dom_text **result); dom_exception _dom_document_create_comment(struct dom_document *doc, - struct dom_string *data, struct dom_comment **result); + dom_string *data, struct dom_comment **result); dom_exception _dom_document_create_cdata_section(struct dom_document *doc, - struct dom_string *data, struct dom_cdata_section **result); + dom_string *data, struct dom_cdata_section **result); dom_exception _dom_document_create_processing_instruction( - struct dom_document *doc, struct dom_string *target, - struct dom_string *data, + struct dom_document *doc, dom_string *target, + dom_string *data, struct dom_processing_instruction **result); dom_exception _dom_document_create_attribute(struct dom_document *doc, - struct dom_string *name, struct dom_attr **result); + dom_string *name, struct dom_attr **result); dom_exception _dom_document_create_entity_reference(struct dom_document *doc, - struct dom_string *name, + dom_string *name, struct dom_entity_reference **result); dom_exception _dom_document_get_elements_by_tag_name(struct dom_document *doc, - struct dom_string *tagname, struct dom_nodelist **result); + dom_string *tagname, struct dom_nodelist **result); dom_exception _dom_document_import_node(struct dom_document *doc, struct dom_node *node, bool deep, struct dom_node **result); dom_exception _dom_document_create_element_ns(struct dom_document *doc, - struct dom_string *namespace, struct dom_string *qname, + dom_string *namespace, dom_string *qname, struct dom_element **result); dom_exception _dom_document_create_attribute_ns(struct dom_document *doc, - struct dom_string *namespace, struct dom_string *qname, + dom_string *namespace, dom_string *qname, struct dom_attr **result); dom_exception _dom_document_get_elements_by_tag_name_ns( - struct dom_document *doc, struct dom_string *namespace, - struct dom_string *localname, struct dom_nodelist **result); + struct dom_document *doc, dom_string *namespace, + dom_string *localname, struct dom_nodelist **result); dom_exception _dom_document_get_element_by_id(struct dom_document *doc, - struct dom_string *id, struct dom_element **result); + dom_string *id, struct dom_element **result); dom_exception _dom_document_get_input_encoding(struct dom_document *doc, - struct dom_string **result); + dom_string **result); dom_exception _dom_document_get_xml_encoding(struct dom_document *doc, - struct dom_string **result); + dom_string **result); dom_exception _dom_document_get_xml_standalone(struct dom_document *doc, bool *result); dom_exception _dom_document_set_xml_standalone(struct dom_document *doc, bool standalone); dom_exception _dom_document_get_xml_version(struct dom_document *doc, - struct dom_string **result); + dom_string **result); dom_exception _dom_document_set_xml_version(struct dom_document *doc, - struct dom_string *version); + dom_string *version); dom_exception _dom_document_get_strict_error_checking( struct dom_document *doc, bool *result); dom_exception _dom_document_set_strict_error_checking( struct dom_document *doc, bool strict); dom_exception _dom_document_get_uri(struct dom_document *doc, - struct dom_string **result); + dom_string **result); dom_exception _dom_document_set_uri(struct dom_document *doc, - struct dom_string *uri); + dom_string *uri); dom_exception _dom_document_adopt_node(struct dom_document *doc, struct dom_node *node, struct dom_node **result); dom_exception _dom_document_get_dom_config(struct dom_document *doc, @@ -162,7 +162,7 @@ dom_exception _dom_document_get_dom_config(struct dom_document *doc, dom_exception _dom_document_normalize(struct dom_document *doc); dom_exception _dom_document_rename_node(struct dom_document *doc, struct dom_node *node, - struct dom_string *namespace, struct dom_string *qname, + dom_string *namespace, dom_string *qname, struct dom_node **result); #define DOM_DOCUMENT_VTABLE \ @@ -205,7 +205,7 @@ dom_exception _dom_document_rename_node(struct dom_document *doc, struct dom_document_protected_vtable { struct dom_node_protect_vtable base; dom_exception (*dom_document_get_base)(dom_document *doc, - struct dom_string **base_uri); + dom_string **base_uri); /* Get the document's base uri */ }; @@ -213,14 +213,14 @@ typedef struct dom_document_protected_vtable dom_document_protected_vtable; /* Get the document's base URI */ static inline dom_exception dom_document_get_base(dom_document *doc, - struct dom_string **base_uri) + dom_string **base_uri) { struct dom_node_internal *node = (struct dom_node_internal *) doc; return ((dom_document_protected_vtable *) node->vtable)-> dom_document_get_base(doc, base_uri); } #define dom_document_get_base(d, b) dom_document_get_base( \ - (dom_document *) (d), (struct dom_string **) (b)) + (dom_document *) (d), (dom_string **) (b)) /* Following comes the protected vtable */ void _dom_document_destroy(struct dom_node_internal *node); diff --git a/src/core/document_type.c b/src/core/document_type.c index 7788b1d..cfec29d 100644 --- a/src/core/document_type.c +++ b/src/core/document_type.c @@ -24,8 +24,8 @@ struct dom_document_type { struct dom_node_internal base; /**< Base node */ - struct dom_string *public_id; /**< Doctype public ID */ - struct dom_string *system_id; /**< Doctype system ID */ + dom_string *public_id; /**< Doctype public ID */ + dom_string *system_id; /**< Doctype system ID */ struct dom_resource_mgr res; /**< resource_mgr of this node */ }; @@ -61,8 +61,8 @@ static struct dom_node_protect_vtable dt_protect_vtable = { * explicitly. The client must unref the doctype once it has * finished with it. */ -dom_exception _dom_document_type_create(struct dom_string *qname, - struct dom_string *public_id, struct dom_string *system_id, +dom_exception _dom_document_type_create(dom_string *qname, + dom_string *public_id, dom_string *system_id, dom_alloc alloc, void *pw, struct dom_document_type **doctype) { @@ -107,8 +107,8 @@ void _dom_document_type_destroy(struct dom_node_internal *doctypenode) /* Initialise this document_type */ dom_exception _dom_document_type_initialise(struct dom_document_type *doctype, - struct dom_string *qname, struct dom_string *public_id, - struct dom_string *system_id, dom_alloc alloc, void *pw) + dom_string *qname, dom_string *public_id, + dom_string *system_id, dom_alloc alloc, void *pw) { dom_exception err; @@ -207,7 +207,7 @@ void _dom_document_type_finalise(struct dom_document_type *doctype) * return DOM_NOT_SUPPORTED_ERR. */ dom_exception _dom_document_type_get_name(struct dom_document_type *doc_type, - struct dom_string **result) + dom_string **result) { return dom_node_get_node_name(doc_type, result); } @@ -276,7 +276,7 @@ dom_exception _dom_document_type_get_notations( */ dom_exception _dom_document_type_get_public_id( struct dom_document_type *doc_type, - struct dom_string **result) + dom_string **result) { UNUSED(doc_type); UNUSED(result); @@ -300,7 +300,7 @@ dom_exception _dom_document_type_get_public_id( */ dom_exception _dom_document_type_get_system_id( struct dom_document_type *doc_type, - struct dom_string **result) + dom_string **result) { UNUSED(doc_type); UNUSED(result); @@ -324,7 +324,7 @@ dom_exception _dom_document_type_get_system_id( */ dom_exception _dom_document_type_get_internal_subset( struct dom_document_type *doc_type, - struct dom_string **result) + dom_string **result) { UNUSED(doc_type); UNUSED(result); diff --git a/src/core/document_type.h b/src/core/document_type.h index 4fd1c83..7fcac8e 100644 --- a/src/core/document_type.h +++ b/src/core/document_type.h @@ -12,21 +12,21 @@ struct dom_document_type; struct dom_resource_mgr; /* Create a DOM document type */ -dom_exception _dom_document_type_create(struct dom_string *qname, - struct dom_string *public_id, - struct dom_string *system_id, +dom_exception _dom_document_type_create(dom_string *qname, + dom_string *public_id, + dom_string *system_id, dom_alloc alloc, void *pw, struct dom_document_type **doctype); /* Destroy a document type */ void _dom_document_type_destroy(struct dom_node_internal *doctypenode); dom_exception _dom_document_type_initialise(struct dom_document_type *doctype, - struct dom_string *qname, struct dom_string *public_id, - struct dom_string *system_id, dom_alloc alloc, void *pw); + dom_string *qname, dom_string *public_id, + dom_string *system_id, dom_alloc alloc, void *pw); void _dom_document_type_finalise(struct dom_document_type *doctype); /* The virtual functions of DocumentType */ dom_exception _dom_document_type_get_name(struct dom_document_type *doc_type, - struct dom_string **result); + dom_string **result); dom_exception _dom_document_type_get_entities( struct dom_document_type *doc_type, struct dom_namednodemap **result); @@ -35,13 +35,13 @@ dom_exception _dom_document_type_get_notations( struct dom_namednodemap **result); dom_exception _dom_document_type_get_public_id( struct dom_document_type *doc_type, - struct dom_string **result); + dom_string **result); dom_exception _dom_document_type_get_system_id( struct dom_document_type *doc_type, - struct dom_string **result); + dom_string **result); dom_exception _dom_document_type_get_internal_subset( struct dom_document_type *doc_type, - struct dom_string **result); + dom_string **result); #define DOM_DOCUMENT_TYPE_VTABLE \ _dom_document_type_get_name, \ diff --git a/src/core/element.c b/src/core/element.c index 1069e60..580cb41 100644 --- a/src/core/element.c +++ b/src/core/element.c @@ -50,15 +50,15 @@ static struct dom_element_protected_vtable element_protect_vtable = { }; static dom_exception _dom_element_get_attr(struct dom_element *element, - struct dom_hash_table *hs, struct dom_string *name, - struct dom_string **value); + struct dom_hash_table *hs, dom_string *name, + dom_string **value); static dom_exception _dom_element_set_attr(struct dom_element *element, - struct dom_hash_table *hs, struct dom_string *name, - struct dom_string *value); + struct dom_hash_table *hs, dom_string *name, + dom_string *value); static dom_exception _dom_element_remove_attr(struct dom_element *element, - struct dom_hash_table *hs, struct dom_string *name); + struct dom_hash_table *hs, dom_string *name); static dom_exception _dom_element_get_attr_node(struct dom_element *element, - struct dom_hash_table *hs, struct dom_string *name, + struct dom_hash_table *hs, dom_string *name, struct dom_attr **result); static dom_exception _dom_element_set_attr_node(struct dom_element *element, struct dom_hash_table *hs, struct dom_attr *attr, @@ -67,33 +67,33 @@ static dom_exception _dom_element_remove_attr_node(struct dom_element *element, struct dom_hash_table *hs, struct dom_attr *attr, struct dom_attr **result); static dom_exception _dom_element_has_attr(struct dom_element *element, - struct dom_hash_table *hs, struct dom_string *name, + struct dom_hash_table *hs, dom_string *name, bool *result); static dom_exception _dom_element_set_id_attr(struct dom_element *element, - struct dom_hash_table *hs, struct dom_string *name, bool is_id); + struct dom_hash_table *hs, dom_string *name, bool is_id); /* The operation set for namednodemap */ static dom_exception attributes_get_length(void *priv, unsigned long *length); static dom_exception attributes_get_named_item(void *priv, - struct dom_string *name, struct dom_node **node); + dom_string *name, struct dom_node **node); static dom_exception attributes_set_named_item(void *priv, struct dom_node *arg, struct dom_node **node); static dom_exception attributes_remove_named_item( - void *priv, struct dom_string *name, + void *priv, dom_string *name, struct dom_node **node); static dom_exception attributes_item(void *priv, unsigned long index, struct dom_node **node); static dom_exception attributes_get_named_item_ns( - void *priv, struct dom_string *namespace, - struct dom_string *localname, struct dom_node **node); + void *priv, dom_string *namespace, + dom_string *localname, struct dom_node **node); static dom_exception attributes_set_named_item_ns( void *priv, struct dom_node *arg, struct dom_node **node); static dom_exception attributes_remove_named_item_ns( - void *priv, struct dom_string *namespace, - struct dom_string *localname, struct dom_node **node); + void *priv, dom_string *namespace, + dom_string *localname, struct dom_node **node); static void attributes_destroy(void *priv); static bool attributes_equal(void *p1, void *p2); @@ -273,7 +273,7 @@ void _dom_element_destroy(struct dom_document *doc, * finished with it. */ dom_exception _dom_element_get_tag_name(struct dom_element *element, - struct dom_string **name) + dom_string **name) { /* This is the same as nodeName */ return dom_node_get_node_name((struct dom_node *) element, name); @@ -292,7 +292,7 @@ dom_exception _dom_element_get_tag_name(struct dom_element *element, * finished with it. */ dom_exception _dom_element_get_attribute(struct dom_element *element, - struct dom_string *name, struct dom_string **value) + dom_string *name, dom_string **value) { return _dom_element_get_attr(element, element->attributes, name, value); } @@ -308,7 +308,7 @@ dom_exception _dom_element_get_attribute(struct dom_element *element, * DOM_NO_MODIFICATION_ALLOWED_ERR if ::element is readonly. */ dom_exception _dom_element_set_attribute(struct dom_element *element, - struct dom_string *name, struct dom_string *value) + dom_string *name, dom_string *value) { return _dom_element_set_attr(element, element->attributes, name, value); } @@ -322,7 +322,7 @@ dom_exception _dom_element_set_attribute(struct dom_element *element, * DOM_NO_MODIFICATION_ALLOWED_ERR if ::element is readonly. */ dom_exception _dom_element_remove_attribute(struct dom_element *element, - struct dom_string *name) + dom_string *name) { return _dom_element_remove_attr(element, element->attributes, name); } @@ -340,7 +340,7 @@ dom_exception _dom_element_remove_attribute(struct dom_element *element, * finished with it. */ dom_exception _dom_element_get_attribute_node(struct dom_element *element, - struct dom_string *name, struct dom_attr **result) + dom_string *name, struct dom_attr **result) { return _dom_element_get_attr_node(element, element->attributes, name, result); @@ -406,7 +406,7 @@ dom_exception _dom_element_remove_attribute_node(struct dom_element *element, * finished with it. */ dom_exception _dom_element_get_elements_by_tag_name( - struct dom_element *element, struct dom_string *name, + struct dom_element *element, dom_string *name, struct dom_nodelist **result) { dom_exception err; @@ -445,8 +445,8 @@ dom_exception _dom_element_get_elements_by_tag_name( * finished with it. */ dom_exception _dom_element_get_attribute_ns(struct dom_element *element, - struct dom_string *namespace, struct dom_string *localname, - struct dom_string **value) + dom_string *namespace, dom_string *localname, + dom_string **value) { lwc_string *str; dom_exception err; @@ -500,8 +500,8 @@ dom_exception _dom_element_get_attribute_ns(struct dom_element *element, * Namespaces. */ dom_exception _dom_element_set_attribute_ns(struct dom_element *element, - struct dom_string *namespace, struct dom_string *qname, - struct dom_string *value) + dom_string *namespace, dom_string *qname, + dom_string *value) { lwc_string *str; dom_exception err; @@ -570,7 +570,7 @@ dom_exception _dom_element_set_attribute_ns(struct dom_element *element, * Namespaces. */ dom_exception _dom_element_remove_attribute_ns(struct dom_element *element, - struct dom_string *namespace, struct dom_string *localname) + dom_string *namespace, dom_string *localname) { lwc_string *str; dom_exception err; @@ -611,7 +611,7 @@ dom_exception _dom_element_remove_attribute_ns(struct dom_element *element, * finished with it. */ dom_exception _dom_element_get_attribute_node_ns(struct dom_element *element, - struct dom_string *namespace, struct dom_string *localname, + dom_string *namespace, dom_string *localname, struct dom_attr **result) { lwc_string *str; @@ -725,8 +725,8 @@ dom_exception _dom_element_set_attribute_node_ns(struct dom_element *element, * finished with it. */ dom_exception _dom_element_get_elements_by_tag_name_ns( - struct dom_element *element, struct dom_string *namespace, - struct dom_string *localname, struct dom_nodelist **result) + struct dom_element *element, dom_string *namespace, + dom_string *localname, struct dom_nodelist **result) { dom_document *doc; dom_exception err; @@ -772,7 +772,7 @@ dom_exception _dom_element_get_elements_by_tag_name_ns( * \return DOM_NO_ERR. */ dom_exception _dom_element_has_attribute(struct dom_element *element, - struct dom_string *name, bool *result) + dom_string *name, bool *result) { return _dom_element_has_attr(element, element->attributes, name, result); @@ -793,7 +793,7 @@ dom_exception _dom_element_has_attribute(struct dom_element *element, * Namespaces. */ dom_exception _dom_element_has_attribute_ns(struct dom_element *element, - struct dom_string *namespace, struct dom_string *localname, + dom_string *namespace, dom_string *localname, bool *result) { lwc_string *str; @@ -854,7 +854,7 @@ dom_exception _dom_element_get_schema_type_info(struct dom_element *element, * one such attribute node. */ dom_exception _dom_element_set_id_attribute(struct dom_element *element, - struct dom_string *name, bool is_id) + dom_string *name, bool is_id) { return _dom_element_set_id_attr(element, element->attributes, name, is_id); @@ -873,7 +873,7 @@ dom_exception _dom_element_set_id_attribute(struct dom_element *element, * attribute of ::element. */ dom_exception _dom_element_set_id_attribute_ns(struct dom_element *element, - struct dom_string *namespace, struct dom_string *localname, + dom_string *namespace, dom_string *localname, bool is_id) { struct dom_hash_table *hs; @@ -988,7 +988,7 @@ dom_exception _dom_element_has_attributes(dom_node_internal *node, bool *result) * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_element_lookup_prefix(dom_node_internal *node, - struct dom_string *namespace, struct dom_string **result) + dom_string *namespace, dom_string **result) { struct dom_element *owner; dom_exception err; @@ -1014,7 +1014,7 @@ dom_exception _dom_element_lookup_prefix(dom_node_internal *node, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_element_is_default_namespace(dom_node_internal *node, - struct dom_string *namespace, bool *result) + dom_string *namespace, bool *result) { struct dom_element *ele = (struct dom_element *) node; lwc_string *ns; @@ -1068,7 +1068,7 @@ dom_exception _dom_element_is_default_namespace(dom_node_internal *node, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_element_lookup_namespace(dom_node_internal *node, - struct dom_string *prefix, struct dom_string **result) + dom_string *prefix, dom_string **result) { lwc_string *pf; dom_exception err; @@ -1138,8 +1138,8 @@ dom_exception _dom_element_lookup_namespace(dom_node_internal *node, * later easy accessing by any client. */ dom_exception _dom_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed) + dom_string *name, dom_string *value, + dom_string **parsed) { UNUSED(ele); UNUSED(name); @@ -1242,8 +1242,8 @@ dom_exception _dom_element_copy(struct dom_node_internal *new, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_element_get_attr(struct dom_element *element, - struct dom_hash_table *hs, struct dom_string *name, - struct dom_string **value) + struct dom_hash_table *hs, dom_string *name, + dom_string **value) { void *a; dom_exception err = DOM_NO_ERR; @@ -1276,8 +1276,8 @@ dom_exception _dom_element_get_attr(struct dom_element *element, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_element_set_attr(struct dom_element *element, - struct dom_hash_table *hs, struct dom_string *name, - struct dom_string *value) + struct dom_hash_table *hs, dom_string *name, + dom_string *value) { void *a; dom_exception err; @@ -1400,7 +1400,7 @@ dom_exception _dom_element_set_attr(struct dom_element *element, * DOM_NO_MODIFICATION_ALLOWED_ERR if ::element is readonly. */ dom_exception _dom_element_remove_attr(struct dom_element *element, - struct dom_hash_table *hs, struct dom_string *name) + struct dom_hash_table *hs, dom_string *name) { void *a; dom_exception err; @@ -1481,7 +1481,7 @@ dom_exception _dom_element_remove_attr(struct dom_element *element, * finished with it. */ dom_exception _dom_element_get_attr_node(struct dom_element *element, - struct dom_hash_table *hs, struct dom_string *name, + struct dom_hash_table *hs, dom_string *name, struct dom_attr **result) { void *a; @@ -1773,7 +1773,7 @@ dom_exception _dom_element_remove_attr_node(struct dom_element *element, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_element_has_attr(struct dom_element *element, - struct dom_hash_table *hs, struct dom_string *name, + struct dom_hash_table *hs, dom_string *name, bool *result) { void *a; @@ -1807,7 +1807,7 @@ dom_exception _dom_element_has_attr(struct dom_element *element, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_element_set_id_attr(struct dom_element *element, - struct dom_hash_table *hs, struct dom_string *name, bool is_id) + struct dom_hash_table *hs, dom_string *name, bool is_id) { dom_attr *attr; lwc_string *str; @@ -1971,7 +1971,7 @@ dom_exception attributes_get_length(void *priv, /* Implementation function for NamedNodeMap, see core/namednodemap.h for * details */ dom_exception attributes_get_named_item(void *priv, - struct dom_string *name, struct dom_node **node) + dom_string *name, struct dom_node **node) { dom_element *e = (dom_element *) priv; @@ -1996,7 +1996,7 @@ dom_exception attributes_set_named_item(void *priv, /* Implementation function for NamedNodeMap, see core/namednodemap.h for * details */ dom_exception attributes_remove_named_item( - void *priv, struct dom_string *name, + void *priv, dom_string *name, struct dom_node **node) { dom_element *e = (dom_element *) priv; @@ -2068,8 +2068,8 @@ dom_exception attributes_item(void *priv, /* Implementation function for NamedNodeMap, see core/namednodemap.h for * details */ dom_exception attributes_get_named_item_ns( - void *priv, struct dom_string *namespace, - struct dom_string *localname, struct dom_node **node) + void *priv, dom_string *namespace, + dom_string *localname, struct dom_node **node) { dom_element *e = (dom_element *) priv; @@ -2096,8 +2096,8 @@ dom_exception attributes_set_named_item_ns( /* Implementation function for NamedNodeMap, see core/namednodemap.h for * details */ dom_exception attributes_remove_named_item_ns( - void *priv, struct dom_string *namespace, - struct dom_string *localname, struct dom_node **node) + void *priv, dom_string *namespace, + dom_string *localname, struct dom_node **node) { dom_element *e = (dom_element *) priv; dom_exception err; diff --git a/src/core/element.h b/src/core/element.h index 8a64314..66d1a50 100644 --- a/src/core/element.h +++ b/src/core/element.h @@ -18,7 +18,6 @@ struct dom_document; struct dom_element; struct dom_namednodemap; struct dom_node; -struct dom_string; struct dom_attr; struct dom_type_info; struct dom_hash_table; @@ -57,49 +56,49 @@ void _dom_element_destroy(struct dom_document *doc, /* The virtual functions of dom_element */ dom_exception _dom_element_get_tag_name(struct dom_element *element, - struct dom_string **name); + dom_string **name); dom_exception _dom_element_get_attribute(struct dom_element *element, - struct dom_string *name, struct dom_string **value); + dom_string *name, dom_string **value); dom_exception _dom_element_set_attribute(struct dom_element *element, - struct dom_string *name, struct dom_string *value); + dom_string *name, dom_string *value); dom_exception _dom_element_remove_attribute(struct dom_element *element, - struct dom_string *name); + dom_string *name); dom_exception _dom_element_get_attribute_node(struct dom_element *element, - struct dom_string *name, struct dom_attr **result); + dom_string *name, struct dom_attr **result); dom_exception _dom_element_set_attribute_node(struct dom_element *element, struct dom_attr *attr, struct dom_attr **result); dom_exception _dom_element_remove_attribute_node(struct dom_element *element, struct dom_attr *attr, struct dom_attr **result); dom_exception _dom_element_get_elements_by_tag_name( - struct dom_element *element, struct dom_string *name, + struct dom_element *element, dom_string *name, struct dom_nodelist **result); dom_exception _dom_element_get_attribute_ns(struct dom_element *element, - struct dom_string *namespace, struct dom_string *localname, - struct dom_string **value); + dom_string *namespace, dom_string *localname, + dom_string **value); dom_exception _dom_element_set_attribute_ns(struct dom_element *element, - struct dom_string *namespace, struct dom_string *qname, - struct dom_string *value); + dom_string *namespace, dom_string *qname, + dom_string *value); dom_exception _dom_element_remove_attribute_ns(struct dom_element *element, - struct dom_string *namespace, struct dom_string *localname); + dom_string *namespace, dom_string *localname); dom_exception _dom_element_get_attribute_node_ns(struct dom_element *element, - struct dom_string *namespace, struct dom_string *localname, + dom_string *namespace, dom_string *localname, struct dom_attr **result); dom_exception _dom_element_set_attribute_node_ns(struct dom_element *element, struct dom_attr *attr, struct dom_attr **result); dom_exception _dom_element_get_elements_by_tag_name_ns( - struct dom_element *element, struct dom_string *namespace, - struct dom_string *localname, struct dom_nodelist **result); + struct dom_element *element, dom_string *namespace, + dom_string *localname, struct dom_nodelist **result); dom_exception _dom_element_has_attribute(struct dom_element *element, - struct dom_string *name, bool *result); + dom_string *name, bool *result); dom_exception _dom_element_has_attribute_ns(struct dom_element *element, - struct dom_string *namespace, struct dom_string *localname, + dom_string *namespace, dom_string *localname, bool *result); dom_exception _dom_element_get_schema_type_info(struct dom_element *element, struct dom_type_info **result); dom_exception _dom_element_set_id_attribute(struct dom_element *element, - struct dom_string *name, bool is_id); + dom_string *name, bool is_id); dom_exception _dom_element_set_id_attribute_ns(struct dom_element *element, - struct dom_string *namespace, struct dom_string *localname, + dom_string *namespace, dom_string *localname, bool is_id); dom_exception _dom_element_set_id_attribute_node(struct dom_element *element, struct dom_attr *id_attr, bool is_id); @@ -133,11 +132,11 @@ dom_exception _dom_element_has_attributes(dom_node_internal *node, bool *result); dom_exception _dom_element_normalize(dom_node_internal *node); dom_exception _dom_element_lookup_prefix(dom_node_internal *node, - struct dom_string *namespace, struct dom_string **result); + dom_string *namespace, dom_string **result); dom_exception _dom_element_is_default_namespace(dom_node_internal *node, - struct dom_string *namespace, bool *result); + dom_string *namespace, bool *result); dom_exception _dom_element_lookup_namespace(dom_node_internal *node, - struct dom_string *prefix, struct dom_string **result); + dom_string *prefix, dom_string **result); #define DOM_NODE_VTABLE_ELEMENT \ _dom_node_get_node_name, \ _dom_node_get_node_value, \ @@ -184,8 +183,8 @@ struct dom_element_protected_vtable { struct dom_node_protect_vtable base; dom_exception (*dom_element_parse_attribute)(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed); + dom_string *name, dom_string *value, + dom_string **parsed); /**< Called by dom_attr_set_value, and used to check * whether the new attribute value is valid and * return a valid on if it is not @@ -196,22 +195,22 @@ typedef struct dom_element_protected_vtable dom_element_protected_vtable; /* Parse the attribute's value */ static inline dom_exception dom_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed) + dom_string *name, dom_string *value, + dom_string **parsed) { struct dom_node_internal *node = (struct dom_node_internal *) ele; return ((dom_element_protected_vtable *) node->vtable)-> dom_element_parse_attribute(ele, name, value, parsed); } #define dom_element_parse_attribute(e, n, v, p) dom_element_parse_attribute( \ - (dom_element *) (e), (struct dom_string *) (n), \ - (struct dom_string *) (v), (struct dom_string **) (p)) + (dom_element *) (e), (dom_string *) (n), \ + (dom_string *) (v), (dom_string **) (p)) /* The protected virtual function */ dom_exception _dom_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed); + dom_string *name, dom_string *value, + dom_string **parsed); void __dom_element_destroy(dom_node_internal *node); dom_exception _dom_element_alloc(struct dom_document *doc, struct dom_node_internal *n, struct dom_node_internal **ret); diff --git a/src/core/entity_ref.c b/src/core/entity_ref.c index c5b426c..f35b306 100644 --- a/src/core/entity_ref.c +++ b/src/core/entity_ref.c @@ -43,7 +43,7 @@ static struct dom_node_protect_vtable er_protect_vtable = { * The returned node will already be referenced. */ dom_exception _dom_entity_reference_create(struct dom_document *doc, - struct lwc_string_s *name, struct dom_string *value, + struct lwc_string_s *name, dom_string *value, struct dom_entity_reference **result) { struct dom_entity_reference *e; @@ -101,7 +101,7 @@ void _dom_entity_reference_destroy(struct dom_document *doc, * finished with it. */ dom_exception _dom_entity_reference_get_textual_representation( - struct dom_entity_reference *entity, struct dom_string **result) + struct dom_entity_reference *entity, dom_string **result) { UNUSED(entity); UNUSED(result); diff --git a/src/core/entity_ref.h b/src/core/entity_ref.h index 2b83d07..b83765c 100644 --- a/src/core/entity_ref.h +++ b/src/core/entity_ref.h @@ -13,11 +13,10 @@ struct dom_document; struct dom_entity_reference; -struct dom_string; struct lwc_string_s; dom_exception _dom_entity_reference_create(struct dom_document *doc, - struct lwc_string_s *name, struct dom_string *value, + struct lwc_string_s *name, dom_string *value, struct dom_entity_reference **result); void _dom_entity_reference_destroy(struct dom_document *doc, @@ -41,6 +40,6 @@ dom_exception _dom_er_copy(struct dom_node_internal *new, /* Helper functions */ dom_exception _dom_entity_reference_get_textual_representation( struct dom_entity_reference *entity, - struct dom_string **result); + dom_string **result); #endif diff --git a/src/core/namednodemap.c b/src/core/namednodemap.c index ec1e151..508fbb0 100644 --- a/src/core/namednodemap.c +++ b/src/core/namednodemap.c @@ -134,7 +134,7 @@ dom_exception dom_namednodemap_get_length(struct dom_namednodemap *map, * should unref the node once it has finished with it. */ dom_exception _dom_namednodemap_get_named_item(struct dom_namednodemap *map, - struct dom_string *name, struct dom_node **node) + dom_string *name, struct dom_node **node) { assert(map->opt != NULL); return map->opt->namednodemap_get_named_item(map->priv, name, node); @@ -186,7 +186,7 @@ dom_exception _dom_namednodemap_set_named_item(struct dom_namednodemap *map, * should unref the node once it has finished with it. */ dom_exception _dom_namednodemap_remove_named_item( - struct dom_namednodemap *map, struct dom_string *name, + struct dom_namednodemap *map, dom_string *name, struct dom_node **node) { assert(map->opt != NULL); @@ -231,8 +231,8 @@ dom_exception _dom_namednodemap_item(struct dom_namednodemap *map, * should unref the node once it has finished with it. */ dom_exception _dom_namednodemap_get_named_item_ns( - struct dom_namednodemap *map, struct dom_string *namespace, - struct dom_string *localname, struct dom_node **node) + struct dom_namednodemap *map, dom_string *namespace, + dom_string *localname, struct dom_node **node) { assert(map->opt != NULL); return map->opt->namednodemap_get_named_item_ns(map->priv, namespace, @@ -296,8 +296,8 @@ dom_exception _dom_namednodemap_set_named_item_ns( * should unref the node once it has finished with it. */ dom_exception _dom_namednodemap_remove_named_item_ns( - struct dom_namednodemap *map, struct dom_string *namespace, - struct dom_string *localname, struct dom_node **node) + struct dom_namednodemap *map, dom_string *namespace, + dom_string *localname, struct dom_node **node) { assert(map->opt != NULL); return map->opt->namednodemap_remove_named_item_ns(map->priv, namespace, diff --git a/src/core/namednodemap.h b/src/core/namednodemap.h index 328e433..079294c 100644 --- a/src/core/namednodemap.h +++ b/src/core/namednodemap.h @@ -16,36 +16,35 @@ struct dom_document; struct dom_node; struct dom_namednodemap; -struct dom_string; struct nnm_operation { dom_exception (*namednodemap_get_length)(void *priv, unsigned long *length); dom_exception (*namednodemap_get_named_item)(void *priv, - struct dom_string *name, struct dom_node **node); + dom_string *name, struct dom_node **node); dom_exception (*namednodemap_set_named_item)(void *priv, struct dom_node *arg, struct dom_node **node); dom_exception (*namednodemap_remove_named_item)( - void *priv, struct dom_string *name, + void *priv, dom_string *name, struct dom_node **node); dom_exception (*namednodemap_item)(void *priv, unsigned long index, struct dom_node **node); dom_exception (*namednodemap_get_named_item_ns)( - void *priv, struct dom_string *namespace, - struct dom_string *localname, struct dom_node **node); + void *priv, dom_string *namespace, + dom_string *localname, struct dom_node **node); dom_exception (*namednodemap_set_named_item_ns)( void *priv, struct dom_node *arg, struct dom_node **node); dom_exception (*namednodemap_remove_named_item_ns)( - void *priv, struct dom_string *namespace, - struct dom_string *localname, struct dom_node **node); + void *priv, dom_string *namespace, + dom_string *localname, struct dom_node **node); void (*namednodemap_destroy)(void *priv); diff --git a/src/core/node.c b/src/core/node.c index 71977b4..14dad4a 100644 --- a/src/core/node.c +++ b/src/core/node.c @@ -142,7 +142,7 @@ void _dom_node_destroy(struct dom_node_internal *node) */ dom_exception _dom_node_initialise(dom_node_internal *node, struct dom_document *doc, dom_node_type type, - struct lwc_string_s *name, struct dom_string *value, + struct lwc_string_s *name, dom_string *value, struct lwc_string_s *namespace, struct lwc_string_s *prefix) { dom_alloc alloc; @@ -180,7 +180,7 @@ dom_exception _dom_node_initialise_generic( struct dom_node_internal *node, struct dom_document *doc, dom_alloc alloc, void *pw, dom_node_type type, struct lwc_string_s *name, - struct dom_string *value, struct lwc_string_s *namespace, + dom_string *value, struct lwc_string_s *namespace, struct lwc_string_s *prefix) { UNUSED(alloc); @@ -388,9 +388,9 @@ void _dom_node_unref(dom_node_internal *node) * finished with it. */ dom_exception _dom_node_get_node_name(dom_node_internal *node, - struct dom_string **result) + dom_string **result) { - struct dom_string *node_name, *temp; + dom_string *node_name, *temp; dom_document *doc; dom_exception err; struct dom_resource_mgr rm; @@ -414,7 +414,7 @@ dom_exception _dom_node_get_node_name(dom_node_internal *node, * has a defined prefix, then nodeName is a QName comprised * of prefix:name. */ if(node->prefix != NULL) { - struct dom_string *colon; + dom_string *colon; err = _dom_resource_mgr_create_string(&rm, (const uint8_t *) ":", SLEN(":"), &colon); @@ -491,7 +491,7 @@ dom_exception _dom_node_get_node_name(dom_node_internal *node, * this implementation; dom_strings are unbounded. */ dom_exception _dom_node_get_node_value(dom_node_internal *node, - struct dom_string **result) + dom_string **result) { if (node->value != NULL) dom_string_ref(node->value); @@ -515,7 +515,7 @@ dom_exception _dom_node_get_node_value(dom_node_internal *node, * a reference on the string). The node's existing value will be unrefed. */ dom_exception _dom_node_set_node_value(dom_node_internal *node, - struct dom_string *value) + dom_string *value) { /* TODO * Whether we should change this to a virtual function? @@ -1292,7 +1292,7 @@ dom_exception _dom_node_normalize(dom_node_internal *node) * \return DOM_NO_ERR. */ dom_exception _dom_node_is_supported(dom_node_internal *node, - struct dom_string *feature, struct dom_string *version, + dom_string *feature, dom_string *version, bool *result) { bool has; @@ -1319,7 +1319,7 @@ dom_exception _dom_node_is_supported(dom_node_internal *node, * finished with it. */ dom_exception _dom_node_get_namespace(dom_node_internal *node, - struct dom_string **result) + dom_string **result) { assert(node->owner != NULL); @@ -1343,7 +1343,7 @@ dom_exception _dom_node_get_namespace(dom_node_internal *node, * finished with it. */ dom_exception _dom_node_get_prefix(dom_node_internal *node, - struct dom_string **result) + dom_string **result) { assert(node->owner != NULL); @@ -1380,7 +1380,7 @@ dom_exception _dom_node_get_prefix(dom_node_internal *node, * is "xmlns". */ dom_exception _dom_node_set_prefix(dom_node_internal *node, - struct dom_string *prefix) + dom_string *prefix) { dom_exception err; lwc_string *str; @@ -1436,7 +1436,7 @@ dom_exception _dom_node_set_prefix(dom_node_internal *node, * finished with it. */ dom_exception _dom_node_get_local_name(dom_node_internal *node, - struct dom_string **result) + dom_string **result) { assert(node->owner != NULL); @@ -1486,7 +1486,7 @@ dom_exception _dom_node_has_attributes(dom_node_internal *node, bool *result) * return DOM_NOT_SUPPORTED_ERR. */ dom_exception _dom_node_get_base(dom_node_internal *node, - struct dom_string **result) + dom_string **result) { struct dom_document *doc = node->owner; assert(doc != NULL); @@ -1534,7 +1534,7 @@ dom_exception _dom_node_compare_document_position(dom_node_internal *node, * this implementation; dom_strings are unbounded. */ dom_exception _dom_node_get_text_content(dom_node_internal *node, - struct dom_string **result) + dom_string **result) { dom_node_internal *n; dom_string *str; @@ -1565,7 +1565,7 @@ dom_exception _dom_node_get_text_content(dom_node_internal *node, * Text node containing the new content. */ dom_exception _dom_node_set_text_content(dom_node_internal *node, - struct dom_string *content) + dom_string *content) { dom_node_internal *n, *p, *r; dom_document *doc; @@ -1630,7 +1630,7 @@ dom_exception _dom_node_is_same(dom_node_internal *node, * finished with it. */ dom_exception _dom_node_lookup_prefix(dom_node_internal *node, - struct dom_string *namespace, struct dom_string **result) + dom_string *namespace, dom_string **result) { if (node->parent != NULL) return dom_node_lookup_prefix(node, namespace, result); @@ -1649,7 +1649,7 @@ dom_exception _dom_node_lookup_prefix(dom_node_internal *node, * \return DOM_NO_ERR. */ dom_exception _dom_node_is_default_namespace(dom_node_internal *node, - struct dom_string *namespace, bool *result) + dom_string *namespace, bool *result) { if (node->parent != NULL) return dom_node_is_default_namespace(node, namespace, result); @@ -1671,7 +1671,7 @@ dom_exception _dom_node_is_default_namespace(dom_node_internal *node, * finished with it. */ dom_exception _dom_node_lookup_namespace(dom_node_internal *node, - struct dom_string *prefix, struct dom_string **result) + dom_string *prefix, dom_string **result) { if (node->parent != NULL) return dom_node_lookup_namespace(node->parent, prefix, result); @@ -1786,7 +1786,7 @@ dom_exception _dom_node_is_equal(dom_node_internal *node, * \return DOM_NO_ERR. */ dom_exception _dom_node_get_feature(dom_node_internal *node, - struct dom_string *feature, struct dom_string *version, + dom_string *feature, dom_string *version, void **result) { bool has; @@ -1816,7 +1816,7 @@ dom_exception _dom_node_get_feature(dom_node_internal *node, * \return DOM_NO_ERR. */ dom_exception _dom_node_set_user_data(dom_node_internal *node, - struct dom_string *key, void *data, + dom_string *key, void *data, dom_user_data_handler handler, void **result) { struct dom_user_data *ud = NULL; @@ -1886,7 +1886,7 @@ dom_exception _dom_node_set_user_data(dom_node_internal *node, * \return DOM_NO_ERR. */ dom_exception _dom_node_get_user_data(dom_node_internal *node, - struct dom_string *key, void **result) + dom_string *key, void **result) { struct dom_user_data *ud = NULL; diff --git a/src/core/node.h b/src/core/node.h index 70187d6..3134c49 100644 --- a/src/core/node.h +++ b/src/core/node.h @@ -24,7 +24,7 @@ * User data context attached to a DOM node */ struct dom_user_data { - struct dom_string *key; /**< Key for data */ + dom_string *key; /**< Key for data */ void *data; /**< Client-specific data */ dom_user_data_handler handler; /**< Callback function */ @@ -61,7 +61,7 @@ struct dom_node_internal { struct lwc_string_s *name; /**< Node name (this is the local part * of a QName in the cases where a * namespace exists) */ - struct dom_string *value; /**< Node value */ + dom_string *value; /**< Node value */ dom_node_type type; /**< Node type */ dom_node_internal *parent; /**< Parent node */ dom_node_internal *first_child; /**< First child node */ @@ -87,14 +87,14 @@ dom_node_internal * _dom_node_create(struct dom_document *doc); dom_exception _dom_node_initialise(struct dom_node_internal *node, struct dom_document *doc, dom_node_type type, - struct lwc_string_s *name, struct dom_string *value, + struct lwc_string_s *name, dom_string *value, struct lwc_string_s *namespace, struct lwc_string_s *prefix); dom_exception _dom_node_initialise_generic( struct dom_node_internal *node, struct dom_document *doc, dom_alloc alloc, void *pw, dom_node_type type, struct lwc_string_s *name, - struct dom_string *value, struct lwc_string_s *namespace, + dom_string *value, struct lwc_string_s *namespace, struct lwc_string_s *prefix); void _dom_node_finalise(struct dom_document *doc, dom_node_internal *node); @@ -105,11 +105,11 @@ bool _dom_node_readonly(const dom_node_internal *node); /* The DOM Node's vtable methods */ dom_exception _dom_node_get_node_name(dom_node_internal *node, - struct dom_string **result); + dom_string **result); dom_exception _dom_node_get_node_value(dom_node_internal *node, - struct dom_string **result); + dom_string **result); dom_exception _dom_node_set_node_value(dom_node_internal *node, - struct dom_string *value); + dom_string *value); dom_exception _dom_node_get_node_type(dom_node_internal *node, dom_node_type *result); dom_exception _dom_node_get_parent_node(dom_node_internal *node, @@ -145,43 +145,43 @@ dom_exception _dom_node_clone_node(dom_node_internal *node, bool deep, dom_node_internal **result); dom_exception _dom_node_normalize(dom_node_internal *node); dom_exception _dom_node_is_supported(dom_node_internal *node, - struct dom_string *feature, struct dom_string *version, + dom_string *feature, dom_string *version, bool *result); dom_exception _dom_node_get_namespace(dom_node_internal *node, - struct dom_string **result); + dom_string **result); dom_exception _dom_node_get_prefix(dom_node_internal *node, - struct dom_string **result); + dom_string **result); dom_exception _dom_node_set_prefix(dom_node_internal *node, - struct dom_string *prefix); + dom_string *prefix); dom_exception _dom_node_get_local_name(dom_node_internal *node, - struct dom_string **result); + dom_string **result); dom_exception _dom_node_has_attributes(dom_node_internal *node, bool *result); dom_exception _dom_node_get_base(dom_node_internal *node, - struct dom_string **result); + dom_string **result); dom_exception _dom_node_compare_document_position(dom_node_internal *node, dom_node_internal *other, uint16_t *result); dom_exception _dom_node_get_text_content(dom_node_internal *node, - struct dom_string **result); + dom_string **result); dom_exception _dom_node_set_text_content(dom_node_internal *node, - struct dom_string *content); + dom_string *content); dom_exception _dom_node_is_same(dom_node_internal *node, dom_node_internal *other, bool *result); dom_exception _dom_node_lookup_prefix(dom_node_internal *node, - struct dom_string *namespace, struct dom_string **result); + dom_string *namespace, dom_string **result); dom_exception _dom_node_is_default_namespace(dom_node_internal *node, - struct dom_string *namespace, bool *result); + dom_string *namespace, bool *result); dom_exception _dom_node_lookup_namespace(dom_node_internal *node, - struct dom_string *prefix, struct dom_string **result); + dom_string *prefix, dom_string **result); dom_exception _dom_node_is_equal(dom_node_internal *node, dom_node_internal *other, bool *result); dom_exception _dom_node_get_feature(dom_node_internal *node, - struct dom_string *feature, struct dom_string *version, + dom_string *feature, dom_string *version, void **result); dom_exception _dom_node_set_user_data(dom_node_internal *node, - struct dom_string *key, void *data, + dom_string *key, void *data, dom_user_data_handler handler, void **result); dom_exception _dom_node_get_user_data(dom_node_internal *node, - struct dom_string *key, void **result); + dom_string *key, void **result); #define DOM_NODE_VTABLE \ _dom_node_get_node_name, \ @@ -276,14 +276,14 @@ static inline dom_exception dom_node_copy(struct dom_node_internal *new, #define dom_node_get_refcount(n) ((dom_node_internal *) (n))->refcnt dom_exception _redocument_domstring(struct dom_document *old, - struct dom_document* new, struct dom_string **string); + struct dom_document* new, dom_string **string); dom_exception _dom_merge_adjacent_text(dom_node_internal *p, dom_node_internal *n); /* Used to extract the lwc_string from dom_string. * If there is no lwc_string inside the param, create one use the node->owner * as document */ dom_exception _dom_node_get_intern_string(dom_node_internal *node, - struct dom_string *str, struct lwc_string_s **intern); + dom_string *str, struct lwc_string_s **intern); void _dom_node_unref_intern_string(dom_node_internal *node, struct lwc_string_s *inter); dom_exception _dom_node_create_lwcstring(dom_node_internal *node, diff --git a/src/core/nodelist.h b/src/core/nodelist.h index e467aa6..ba00cbf 100644 --- a/src/core/nodelist.h +++ b/src/core/nodelist.h @@ -15,7 +15,6 @@ struct dom_document; struct dom_node; struct dom_nodelist; -struct dom_string; struct lwc_string_s; /** diff --git a/src/core/pi.c b/src/core/pi.c index 634dc05..1d7a508 100644 --- a/src/core/pi.c +++ b/src/core/pi.c @@ -40,7 +40,7 @@ static struct dom_node_protect_vtable pi_protect_vtable = { * The returned node will already be referenced. */ dom_exception _dom_processing_instruction_create(struct dom_document *doc, - struct lwc_string_s *name, struct dom_string *value, + struct lwc_string_s *name, dom_string *value, struct dom_processing_instruction **result) { struct dom_processing_instruction *p; diff --git a/src/core/pi.h b/src/core/pi.h index 3f6d46c..8eca330 100644 --- a/src/core/pi.h +++ b/src/core/pi.h @@ -12,11 +12,10 @@ struct dom_document; struct dom_processing_instruction; -struct dom_string; struct lwc_string_s; dom_exception _dom_processing_instruction_create(struct dom_document *doc, - struct lwc_string_s *name, struct dom_string *value, + struct lwc_string_s *name, dom_string *value, struct dom_processing_instruction **result); void _dom_processing_instruction_destroy(struct dom_document *doc, diff --git a/src/core/string.c b/src/core/string.c index a443f55..4c104ae 100644 --- a/src/core/string.c +++ b/src/core/string.c @@ -35,7 +35,7 @@ struct dom_string { uint32_t refcnt; /**< Reference count */ }; -static struct dom_string empty_string = { +static dom_string empty_string = { .ptr = NULL, .len = 0, .intern = NULL, @@ -51,7 +51,7 @@ static struct dom_string empty_string = { * * \param str The string to claim a reference on */ -void dom_string_ref(struct dom_string *str) +void dom_string_ref(dom_string *str) { if (str != NULL) str->refcnt++; @@ -65,7 +65,7 @@ void dom_string_ref(struct dom_string *str) * If the reference count reaches zero, any memory claimed by the * string will be released */ -void dom_string_unref(struct dom_string *str) +void dom_string_unref(dom_string *str) { if (str == NULL) return; @@ -98,9 +98,9 @@ void dom_string_unref(struct dom_string *str) * returned DOM string. */ dom_exception dom_string_create(dom_alloc alloc, void *pw, - const uint8_t *ptr, size_t len, struct dom_string **str) + const uint8_t *ptr, size_t len, dom_string **str) { - struct dom_string *ret; + dom_string *ret; if (ptr == NULL || len == 0) { dom_string_ref(&empty_string); @@ -110,7 +110,7 @@ dom_exception dom_string_create(dom_alloc alloc, void *pw, return DOM_NO_ERR; } - ret = alloc(NULL, sizeof(struct dom_string), pw); + ret = alloc(NULL, sizeof(dom_string), pw); if (ret == NULL) return DOM_NO_MEM_ERR; @@ -151,7 +151,7 @@ dom_exception dom_string_create(dom_alloc alloc, void *pw, * real clone, just ref the source string is ok. */ dom_exception dom_string_clone(dom_alloc alloc, void *pw, - struct dom_string *str, struct dom_string **ret) + dom_string *str, dom_string **ret) { if (alloc == str->alloc && pw == str->pw) { *ret = str; @@ -175,7 +175,7 @@ dom_exception dom_string_clone(dom_alloc alloc, void *pw, * \return DOM_NO_ERR on success, DOM_NO_MEM_ERR on memory exhaustion */ dom_exception _dom_string_create_from_lwcstring(dom_alloc alloc, void *pw, - lwc_string *str, struct dom_string **ret) + lwc_string *str, dom_string **ret) { dom_string *r; @@ -184,7 +184,7 @@ dom_exception _dom_string_create_from_lwcstring(dom_alloc alloc, void *pw, return DOM_NO_ERR; } - r = alloc(NULL, sizeof(struct dom_string), pw); + r = alloc(NULL, sizeof(dom_string), pw); if (r == NULL) return DOM_NO_MEM_ERR; @@ -218,7 +218,7 @@ dom_exception _dom_string_create_from_lwcstring(dom_alloc alloc, void *pw, * \param lwcstr The result lwc_string * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ -dom_exception _dom_string_intern(struct dom_string *str, +dom_exception _dom_string_intern(dom_string *str, struct lwc_string_s **lwcstr) { lwc_string *ret; @@ -254,7 +254,7 @@ dom_exception _dom_string_intern(struct dom_string *str, * \param lwcstr The lwc_string of this dom-string * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ -dom_exception dom_string_get_intern(struct dom_string *str, +dom_exception dom_string_get_intern(dom_string *str, struct lwc_string_s **lwcstr) { *lwcstr = str->intern; @@ -274,7 +274,7 @@ dom_exception dom_string_get_intern(struct dom_string *str, * * NULL and "" will match. */ -int dom_string_cmp(struct dom_string *s1, struct dom_string *s2) +int dom_string_cmp(dom_string *s1, dom_string *s2) { bool ret; @@ -308,7 +308,7 @@ int dom_string_cmp(struct dom_string *s1, struct dom_string *s2) * * NULL and "" will match. */ -int dom_string_icmp(struct dom_string *s1, struct dom_string *s2) +int dom_string_icmp(dom_string *s1, dom_string *s2) { const uint8_t *d1 = NULL; const uint8_t *d2 = NULL; @@ -369,7 +369,7 @@ int dom_string_icmp(struct dom_string *s1, struct dom_string *s2) * \param chr UCS4 value to look for * \return Character index of found character, or -1 if none found */ -uint32_t dom_string_index(struct dom_string *str, uint32_t chr) +uint32_t dom_string_index(dom_string *str, uint32_t chr) { const uint8_t *s; size_t clen, slen; @@ -409,7 +409,7 @@ uint32_t dom_string_index(struct dom_string *str, uint32_t chr) * \param chr UCS4 value to look for * \return Character index of found character, or -1 if none found */ -uint32_t dom_string_rindex(struct dom_string *str, uint32_t chr) +uint32_t dom_string_rindex(dom_string *str, uint32_t chr) { const uint8_t *s; size_t clen, slen; @@ -453,7 +453,7 @@ uint32_t dom_string_rindex(struct dom_string *str, uint32_t chr) * \param str The string to measure the length of * \return The length of the string, in characters */ -uint32_t dom_string_length(struct dom_string *str) +uint32_t dom_string_length(dom_string *str) { size_t clen; parserutils_error err; @@ -476,7 +476,7 @@ uint32_t dom_string_length(struct dom_string *str) * \param ch The UCS4 character * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ -dom_exception dom_string_at(struct dom_string *str, uint32_t index, +dom_exception dom_string_at(dom_string *str, uint32_t index, uint32_t *ch) { const uint8_t *s; @@ -533,10 +533,10 @@ dom_exception dom_string_at(struct dom_string *str, uint32_t index, * The returned string will have its reference count increased. The client * should dereference it once it has finished with it. */ -dom_exception dom_string_concat(struct dom_string *s1, struct dom_string *s2, - struct dom_string **result) +dom_exception dom_string_concat(dom_string *s1, dom_string *s2, + dom_string **result) { - struct dom_string *concat; + dom_string *concat; dom_alloc alloc; void *pw; @@ -555,7 +555,7 @@ dom_exception dom_string_concat(struct dom_string *s1, struct dom_string *s2, return DOM_NO_ERR; } - concat = alloc(NULL, sizeof(struct dom_string), pw); + concat = alloc(NULL, sizeof(dom_string), pw); if (concat == NULL) { return DOM_NO_MEM_ERR; @@ -600,8 +600,8 @@ dom_exception dom_string_concat(struct dom_string *s1, struct dom_string *s2, * The returned string will have its reference count increased. The client * should dereference it once it has finished with it. */ -dom_exception dom_string_substr(struct dom_string *str, - uint32_t i1, uint32_t i2, struct dom_string **result) +dom_exception dom_string_substr(dom_string *str, + uint32_t i1, uint32_t i2, dom_string **result) { const uint8_t *s = str->ptr; size_t slen = str->len; @@ -657,11 +657,11 @@ dom_exception dom_string_substr(struct dom_string *str, * The returned string will have its reference count increased. The client * should dereference it once it has finished with it. */ -dom_exception dom_string_insert(struct dom_string *target, - struct dom_string *source, uint32_t offset, - struct dom_string **result) +dom_exception dom_string_insert(dom_string *target, + dom_string *source, uint32_t offset, + dom_string **result) { - struct dom_string *res; + dom_string *res; const uint8_t *t, *s; uint32_t tlen, slen, clen; uint32_t ins = 0; @@ -696,7 +696,7 @@ dom_exception dom_string_insert(struct dom_string *target, } /* Allocate result string */ - res = target->alloc(NULL, sizeof(struct dom_string), target->pw); + res = target->alloc(NULL, sizeof(dom_string), target->pw); if (res == NULL) { return DOM_NO_MEM_ERR; } @@ -750,11 +750,11 @@ dom_exception dom_string_insert(struct dom_string *target, * The returned string will have its reference count increased. The client * should dereference it once it has finished with it. */ -dom_exception dom_string_replace(struct dom_string *target, - struct dom_string *source, uint32_t i1, uint32_t i2, - struct dom_string **result) +dom_exception dom_string_replace(dom_string *target, + dom_string *source, uint32_t i1, uint32_t i2, + dom_string **result) { - struct dom_string *res; + dom_string *res; const uint8_t *t, *s; uint32_t tlen, slen; uint32_t b1, b2; @@ -799,7 +799,7 @@ dom_exception dom_string_replace(struct dom_string *target, } /* Allocate result string */ - res = target->alloc(NULL, sizeof(struct dom_string), target->pw); + res = target->alloc(NULL, sizeof(dom_string), target->pw); if (res == NULL) { return DOM_NO_MEM_ERR; @@ -853,8 +853,8 @@ dom_exception dom_string_replace(struct dom_string *target, * The returned string will have its reference count increased. The client * should dereference it once it has finished with it. */ -dom_exception dom_string_dup(struct dom_string *str, - struct dom_string **result) +dom_exception dom_string_dup(dom_string *str, + dom_string **result) { if (str->intern != NULL) { return _dom_string_create_from_lwcstring(str->alloc, str->pw, @@ -871,7 +871,7 @@ dom_exception dom_string_dup(struct dom_string *str, * \param str The string to calculate a hash of * \return The hash value associated with the string */ -uint32_t dom_string_hash(struct dom_string *str) +uint32_t dom_string_hash(dom_string *str) { const uint8_t *s = str->ptr; size_t slen = str->len; @@ -918,7 +918,7 @@ dom_exception _dom_exception_from_lwc_error(lwc_error err) * @note: This function is just provided for the convenience of accessing the * raw C string character, no change on the result string is allowed. */ -char *_dom_string_data(struct dom_string *str) +char *_dom_string_data(dom_string *str) { return (char *) str->ptr; } @@ -927,7 +927,7 @@ char *_dom_string_data(struct dom_string *str) * * \param str The dom_string object */ -size_t _dom_string_length(struct dom_string *str) +size_t _dom_string_length(dom_string *str) { return str->len; } diff --git a/src/core/string.h b/src/core/string.h index ef231be..d5a943a 100644 --- a/src/core/string.h +++ b/src/core/string.h @@ -13,10 +13,10 @@ /* Create a DOM string from a lwc_string * This function call mainly used for create a string from lwc_string */ dom_exception _dom_string_create_from_lwcstring(dom_alloc alloc, void *pw, - struct lwc_string_s *str, struct dom_string **ret); + struct lwc_string_s *str, dom_string **ret); /* Make the dom_string be interned */ -dom_exception _dom_string_intern(struct dom_string *str, +dom_exception _dom_string_intern(dom_string *str, struct lwc_string_s **lwcstr); /* Map the lwc_error to dom_exception */ @@ -27,10 +27,10 @@ dom_exception _dom_exception_from_lwc_error(lwc_error err); * @note: This function is just provided for the convenience of accessing the * raw C string character, no change on the result string is allowed. */ -char *_dom_string_data(struct dom_string *str); +char *_dom_string_data(dom_string *str); /* Get the string length of this dom_string */ -size_t _dom_string_length(struct dom_string *str); +size_t _dom_string_length(dom_string *str); #endif diff --git a/src/core/text.c b/src/core/text.c index 6aa6d0f..1cb8981 100644 --- a/src/core/text.c +++ b/src/core/text.c @@ -69,7 +69,7 @@ static dom_exception walk_logic_adjacent_text(dom_text *text, * The returned node will already be referenced. */ dom_exception _dom_text_create(struct dom_document *doc, - struct lwc_string_s *name, struct dom_string *value, + struct lwc_string_s *name, dom_string *value, struct dom_text **result) { struct dom_text *t; @@ -127,7 +127,7 @@ void _dom_text_destroy(struct dom_document *doc, struct dom_text *text) */ dom_exception _dom_text_initialise(struct dom_text *text, struct dom_document *doc, dom_node_type type, - struct lwc_string_s *name, struct dom_string *value) + struct lwc_string_s *name, dom_string *value) { dom_exception err; @@ -177,7 +177,7 @@ dom_exception _dom_text_split_text(struct dom_text *text, unsigned long offset, struct dom_text **result) { struct dom_node_internal *t = (struct dom_node_internal *) text; - struct dom_string *value; + dom_string *value; struct dom_text *res; unsigned long len; dom_exception err; @@ -248,7 +248,7 @@ dom_exception _dom_text_get_is_element_content_whitespace( * \return DOM_NO_ERR. */ dom_exception _dom_text_get_whole_text(struct dom_text *text, - struct dom_string **result) + dom_string **result) { return walk_logic_adjacent_text(text, COLLECT, result); } @@ -267,7 +267,7 @@ dom_exception _dom_text_get_whole_text(struct dom_text *text, * once it has finished with it. */ dom_exception _dom_text_replace_whole_text(struct dom_text *text, - struct dom_string *content, struct dom_text **result) + dom_string *content, struct dom_text **result) { dom_exception err; dom_string *ret; diff --git a/src/core/text.h b/src/core/text.h index 44e09e7..c1d0956 100644 --- a/src/core/text.h +++ b/src/core/text.h @@ -15,7 +15,6 @@ #include "core/characterdata.h" struct dom_document; -struct dom_string; struct lwc_string_s; /** @@ -30,14 +29,14 @@ struct dom_text { /* Constructor and Destructor */ dom_exception _dom_text_create(struct dom_document *doc, - struct lwc_string_s *name, struct dom_string *value, + struct lwc_string_s *name, dom_string *value, struct dom_text **result); void _dom_text_destroy(struct dom_document *doc, struct dom_text *text); dom_exception _dom_text_initialise(struct dom_text *text, struct dom_document *doc, dom_node_type type, - struct lwc_string_s *name, struct dom_string *value); + struct lwc_string_s *name, dom_string *value); void _dom_text_finalise(struct dom_document *doc, struct dom_text *text); @@ -48,9 +47,9 @@ dom_exception _dom_text_split_text(struct dom_text *text, dom_exception _dom_text_get_is_element_content_whitespace( struct dom_text *text, bool *result); dom_exception _dom_text_get_whole_text(struct dom_text *text, - struct dom_string **result); + dom_string **result); dom_exception _dom_text_replace_whole_text(struct dom_text *text, - struct dom_string *content, struct dom_text **result); + dom_string *content, struct dom_text **result); #define DOM_TEXT_VTABLE \ _dom_text_split_text, \ diff --git a/src/core/typeinfo.c b/src/core/typeinfo.c index 4ebefcd..c0ca342 100644 --- a/src/core/typeinfo.c +++ b/src/core/typeinfo.c @@ -27,7 +27,7 @@ struct dom_type_info { * return DOM_NOT_SUPPORTED_ERR. */ dom_exception _dom_type_info_get_type_name(dom_type_info *ti, - struct dom_string **ret) + dom_string **ret) { UNUSED(ti); UNUSED(ret); @@ -46,7 +46,7 @@ dom_exception _dom_type_info_get_type_name(dom_type_info *ti, * return DOM_NOT_SUPPORTED_ERR. */ dom_exception _dom_type_info_get_type_namespace(dom_type_info *ti, - struct dom_string **ret) + dom_string **ret) { UNUSED(ti); UNUSED(ret); @@ -67,7 +67,7 @@ dom_exception _dom_type_info_get_type_namespace(dom_type_info *ti, * return DOM_NOT_SUPPORTED_ERR. */ dom_exception _dom_type_info_is_derived(dom_type_info *ti, - struct dom_string *namespace, struct dom_string *name, + dom_string *namespace, dom_string *name, dom_type_info_derivation_method method, bool *ret) { UNUSED(ti); diff --git a/src/events/custom_event.c b/src/events/custom_event.c index 920c23e..99b4120 100644 --- a/src/events/custom_event.c +++ b/src/events/custom_event.c @@ -89,7 +89,7 @@ dom_exception _dom_custom_event_get_detail(dom_custom_event *evt, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_custom_event_init_ns(dom_custom_event *evt, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, bool bubble, bool cancelable, void *detail) { evt->detail = detail; diff --git a/src/events/document_event.c b/src/events/document_event.c index 6f18028..2b89152 100644 --- a/src/events/document_event.c +++ b/src/events/document_event.c @@ -91,7 +91,7 @@ void _dom_document_event_internal_finalise(struct dom_document *doc, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_document_event_create_event(dom_document_event *de, - struct dom_string *type, struct dom_event **evt) + dom_string *type, struct dom_event **evt) { lwc_string *t = NULL; dom_exception err; @@ -175,7 +175,7 @@ dom_exception _dom_document_event_create_event(dom_document_event *de, * DOM_NO_SUPPORTED_ERR. */ dom_exception _dom_document_event_can_dispatch(dom_document_event *de, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, bool *can) { UNUSED(de); diff --git a/src/events/event.c b/src/events/event.c index 6cd8d64..98bb0d5 100644 --- a/src/events/event.c +++ b/src/events/event.c @@ -129,7 +129,7 @@ void _dom_event_unref(dom_event *evt) * \parnm type The returned event type * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ -dom_exception _dom_event_get_type(dom_event *evt, struct dom_string **type) +dom_exception _dom_event_get_type(dom_event *evt, dom_string **type) { struct dom_document *doc = evt->doc; dom_exception err; @@ -245,7 +245,7 @@ dom_exception _dom_event_prevent_default(dom_event *evt) * \param cancelable Whether this event is cancelable * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ -dom_exception _dom_event_init(dom_event *evt, struct dom_string *type, +dom_exception _dom_event_init(dom_event *evt, dom_string *type, bool bubble, bool cancelable) { assert(evt->doc != NULL); @@ -273,7 +273,7 @@ dom_exception _dom_event_init(dom_event *evt, struct dom_string *type, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_event_get_namespace(dom_event *evt, - struct dom_string **namespace) + dom_string **namespace) { struct dom_document *doc = evt->doc; dom_exception err; @@ -337,8 +337,8 @@ dom_exception _dom_event_is_default_prevented(dom_event *evt, bool *prevented) * \param cancelable Whether this event is cancelable * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ -dom_exception _dom_event_init_ns(dom_event *evt, struct dom_string *namespace, - struct dom_string *type, bool bubble, bool cancelable) +dom_exception _dom_event_init_ns(dom_event *evt, dom_string *namespace, + dom_string *type, bool bubble, bool cancelable) { assert(evt->doc != NULL); lwc_string *str = NULL; diff --git a/src/events/event_target.c b/src/events/event_target.c index 5428557..6bf5458 100644 --- a/src/events/event_target.c +++ b/src/events/event_target.c @@ -72,7 +72,7 @@ void _dom_event_target_internal_finalise(struct dom_document *doc, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_event_target_add_event_listener(dom_event_target *et, - struct dom_string *type, struct dom_event_listener *listener, + dom_string *type, struct dom_event_listener *listener, bool capture) { struct listener_entry *le = NULL; @@ -141,7 +141,7 @@ dom_exception _dom_event_target_add_event_listener(dom_event_target *et, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_event_target_remove_event_listener(dom_event_target *et, - struct dom_string *type, struct dom_event_listener *listener, + dom_string *type, struct dom_event_listener *listener, bool capture) { struct listener_entry *le = NULL; @@ -244,7 +244,7 @@ dom_exception _dom_event_target_dispatch_event(dom_event_target *et, return DOM_NO_ERR; } - struct dom_string *type = NULL; + dom_string *type = NULL; err = _dom_document_create_string_from_lwcstring(doc, evt->type, &type); if (err != DOM_NO_ERR) return err; @@ -389,7 +389,7 @@ cleanup: * We don't support this API now, so it always return DOM_NOT_SUPPORTED_ERR. */ dom_exception _dom_event_target_add_event_listener_ns(dom_event_target *et, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, struct dom_event_listener *listener, bool capture) { UNUSED(et); @@ -414,7 +414,7 @@ dom_exception _dom_event_target_add_event_listener_ns(dom_event_target *et, * We don't support this API now, so it always return DOM_NOT_SUPPORTED_ERR. */ dom_exception _dom_event_target_remove_event_listener_ns(dom_event_target *et, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, struct dom_event_listener *listener, bool capture) { UNUSED(et); diff --git a/src/events/event_target.h b/src/events/event_target.h index e6ad7b6..78808e3 100644 --- a/src/events/event_target.h +++ b/src/events/event_target.h @@ -17,7 +17,6 @@ #include "utils/hashtable.h" struct dom_document; -struct dom_string; /** * Listener Entry @@ -72,13 +71,13 @@ dom_exception _dom_dispatch_node_change_event(struct dom_document *doc, /* Dispatch a DOMCharacterDataModified event */ dom_exception _dom_dispatch_characterdata_modified_event( struct dom_document *doc, dom_event_target *et, - struct dom_string *prev, struct dom_string *new, bool *success); + dom_string *prev, dom_string *new, bool *success); /* Dispatch a DOMAttrModified event */ dom_exception _dom_dispatch_attr_modified_event(struct dom_document *doc, - dom_event_target *et, struct dom_string *prev, - struct dom_string *new, dom_event_target *related, - struct dom_string *attr_name, dom_mutation_type change, + dom_event_target *et, dom_string *prev, + dom_string *new, dom_event_target *related, + dom_string *attr_name, dom_mutation_type change, bool *success); /* Dispatch a DOMSubtreeModified event */ diff --git a/src/events/keyboard_event.c b/src/events/keyboard_event.c index b8fc3ba..3e3b141 100644 --- a/src/events/keyboard_event.c +++ b/src/events/keyboard_event.c @@ -74,7 +74,7 @@ void _virtual_dom_keyboard_event_destroy(struct dom_event *evt) * \return DOM_NO_ERR. */ dom_exception _dom_keyboard_event_get_key_identifier(dom_keyboard_event *evt, - struct dom_string **ident) + dom_string **ident) { *ident = evt->key_ident; dom_string_ref(*ident); @@ -171,7 +171,7 @@ dom_exception _dom_keyboard_event_get_meta_key(dom_keyboard_event *evt, * KeyboardEvent.keyLocation. */ dom_exception _dom_keyboard_event_get_modifier_state(dom_keyboard_event *evt, - struct dom_string *m, bool *state) + dom_string *m, bool *state) { if (m == NULL) { *state = false; @@ -221,9 +221,9 @@ dom_exception _dom_keyboard_event_get_modifier_state(dom_keyboard_event *evt, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_keyboard_event_init(dom_keyboard_event *evt, - struct dom_string *type, bool bubble, bool cancelable, - struct dom_abstract_view *view, struct dom_string *key_ident, - dom_key_location key_loc, struct dom_string *modifier_list) + dom_string *type, bool bubble, bool cancelable, + struct dom_abstract_view *view, dom_string *key_ident, + dom_key_location key_loc, dom_string *modifier_list) { dom_exception err; @@ -255,10 +255,10 @@ dom_exception _dom_keyboard_event_init(dom_keyboard_event *evt, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_keyboard_event_init_ns(dom_keyboard_event *evt, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, - struct dom_string *key_ident, dom_key_location key_loc, - struct dom_string *modifier_list) + dom_string *key_ident, dom_key_location key_loc, + dom_string *modifier_list) { dom_exception err; @@ -284,7 +284,7 @@ dom_exception _dom_keyboard_event_init_ns(dom_keyboard_event *evt, * \param modifier_state The returned state * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ -dom_exception _dom_parse_modifier_list(struct dom_string *modifier_list, +dom_exception _dom_parse_modifier_list(dom_string *modifier_list, uint32_t *modifier_state) { *modifier_state = 0; diff --git a/src/events/keyboard_event.h b/src/events/keyboard_event.h index 4d2777c..a988efc 100644 --- a/src/events/keyboard_event.h +++ b/src/events/keyboard_event.h @@ -18,7 +18,7 @@ struct dom_keyboard_event { struct dom_ui_event base; /**< The base class */ - struct dom_string *key_ident; /**< The identifier of the key in this + dom_string *key_ident; /**< The identifier of the key in this * event, please refer: * http://www.w3.org/TR/DOM-Level-3-Events/keyset.html#KeySet-Set * for detail @@ -49,7 +49,7 @@ void _dom_keyboard_event_finalise(struct dom_document *doc, /* Parse the modifier list string to corresponding bool variable state */ -dom_exception _dom_parse_modifier_list(struct dom_string *modifier_list, +dom_exception _dom_parse_modifier_list(dom_string *modifier_list, uint32_t *modifier_state); #endif diff --git a/src/events/mouse_event.c b/src/events/mouse_event.c index 1b31012..7f61343 100644 --- a/src/events/mouse_event.c +++ b/src/events/mouse_event.c @@ -222,7 +222,7 @@ dom_exception _dom_mouse_event_get_related_target(dom_mouse_event *evt, * KeyboardEvent.keyLocation. */ dom_exception _dom_mouse_event_get_modifier_state(dom_mouse_event *evt, - struct dom_string *m, bool *state) + dom_string *m, bool *state) { if (m == NULL) { *state = false; @@ -278,7 +278,7 @@ dom_exception _dom_mouse_event_get_modifier_state(dom_mouse_event *evt, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_mouse_event_init(dom_mouse_event *evt, - struct dom_string *type, bool bubble, bool cancelable, + dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, long detail, long screen_x, long screen_y, long client_x, long client_y, bool ctrl, bool alt, bool shift, bool meta, unsigned short button, @@ -332,7 +332,7 @@ dom_exception _dom_mouse_event_init(dom_mouse_event *evt, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_mouse_event_init_ns(dom_mouse_event *evt, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, long detail, long screen_x, long screen_y, long client_x, long client_y, bool ctrl, bool alt, bool shift, bool meta, diff --git a/src/events/mouse_multi_wheel_event.c b/src/events/mouse_multi_wheel_event.c index bca9c97..6eccdab 100644 --- a/src/events/mouse_multi_wheel_event.c +++ b/src/events/mouse_multi_wheel_event.c @@ -126,12 +126,12 @@ dom_exception _dom_mouse_multi_wheel_event_get_wheel_delta_z( * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_mouse_multi_wheel_event_init_ns( - dom_mouse_multi_wheel_event *evt, struct dom_string *namespace, - struct dom_string *type, bool bubble, bool cancelable, + dom_mouse_multi_wheel_event *evt, dom_string *namespace, + dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, long detail, long screen_x, long screen_y, long client_x, long client_y, unsigned short button, dom_event_target *et, - struct dom_string *modifier_list, long wheel_delta_x, + dom_string *modifier_list, long wheel_delta_x, long wheel_delta_y, long wheel_delta_z) { dom_exception err; diff --git a/src/events/mouse_wheel_event.c b/src/events/mouse_wheel_event.c index c38ae3e..c2ae111 100644 --- a/src/events/mouse_wheel_event.c +++ b/src/events/mouse_wheel_event.c @@ -92,12 +92,12 @@ dom_exception _dom_mouse_wheel_event_get_wheel_delta( * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_mouse_wheel_event_init_ns( - dom_mouse_wheel_event *evt, struct dom_string *namespace, - struct dom_string *type, bool bubble, bool cancelable, + dom_mouse_wheel_event *evt, dom_string *namespace, + dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, long detail, long screen_x, long screen_y, long client_x, long client_y, unsigned short button, dom_event_target *et, - struct dom_string *modifier_list, long wheel_delta) + dom_string *modifier_list, long wheel_delta) { dom_exception err; evt->delta = wheel_delta; diff --git a/src/events/mutation_event.c b/src/events/mutation_event.c index c24ae15..ecc9794 100644 --- a/src/events/mutation_event.c +++ b/src/events/mutation_event.c @@ -98,7 +98,7 @@ dom_exception _dom_mutation_event_get_related_node(dom_mutation_event *evt, * \return DOM_NO_ERR. */ dom_exception _dom_mutation_event_get_prev_value(dom_mutation_event *evt, - struct dom_string **ret) + dom_string **ret) { *ret = evt->prev_value; dom_string_ref(*ret); @@ -114,7 +114,7 @@ dom_exception _dom_mutation_event_get_prev_value(dom_mutation_event *evt, * \return DOM_NO_ERR. */ dom_exception _dom_mutation_event_get_new_value(dom_mutation_event *evt, - struct dom_string **ret) + dom_string **ret) { *ret = evt->new_value; dom_string_ref(*ret); @@ -130,7 +130,7 @@ dom_exception _dom_mutation_event_get_new_value(dom_mutation_event *evt, * \return DOM_NO_ERR. */ dom_exception _dom_mutation_event_get_attr_name(dom_mutation_event *evt, - struct dom_string **ret) + dom_string **ret) { *ret = evt->attr_name; dom_string_ref(*ret); @@ -168,9 +168,9 @@ dom_exception _dom_mutation_event_get_attr_change(dom_mutation_event *evt, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_mutation_event_init(dom_mutation_event *evt, - struct dom_string *type, bool bubble, bool cancelable, - struct dom_node *node, struct dom_string *prev_value, - struct dom_string *new_value, struct dom_string *attr_name, + dom_string *type, bool bubble, bool cancelable, + struct dom_node *node, dom_string *prev_value, + dom_string *new_value, dom_string *attr_name, dom_mutation_type change) { evt->related_node = node; @@ -206,10 +206,10 @@ dom_exception _dom_mutation_event_init(dom_mutation_event *evt, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_mutation_event_init_ns(dom_mutation_event *evt, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, bool bubble, bool cancelable, struct dom_node *node, - struct dom_string *prev_value, struct dom_string *new_value, - struct dom_string *attr_name, dom_mutation_type change) + dom_string *prev_value, dom_string *new_value, + dom_string *attr_name, dom_mutation_type change) { evt->related_node = node; dom_node_ref(node); diff --git a/src/events/mutation_event.h b/src/events/mutation_event.h index d6cd733..58ae9fb 100644 --- a/src/events/mutation_event.h +++ b/src/events/mutation_event.h @@ -19,9 +19,9 @@ struct dom_mutation_event { struct dom_event base; struct dom_node *related_node; - struct dom_string *prev_value; - struct dom_string *new_value; - struct dom_string *attr_name; + dom_string *prev_value; + dom_string *new_value; + dom_string *attr_name; dom_mutation_type change; }; diff --git a/src/events/mutation_name_event.c b/src/events/mutation_name_event.c index 34b9288..d7c14e4 100644 --- a/src/events/mutation_name_event.c +++ b/src/events/mutation_name_event.c @@ -76,7 +76,7 @@ void _virtual_dom_mutation_name_event_destroy(struct dom_event *evt) * \return DOM_NO_ERR. */ dom_exception _dom_mutation_name_event_get_prev_namespace( - dom_mutation_name_event *evt, struct dom_string **namespace) + dom_mutation_name_event *evt, dom_string **namespace) { *namespace = evt->prev_namespace; dom_string_ref(*namespace); @@ -92,7 +92,7 @@ dom_exception _dom_mutation_name_event_get_prev_namespace( * \return DOM_NO_ERR. */ dom_exception _dom_mutation_name_event_get_prev_node_name( - dom_mutation_name_event *evt, struct dom_string **name) + dom_mutation_name_event *evt, dom_string **name) { *name = evt->prev_nodename; dom_string_ref(*name); @@ -113,9 +113,9 @@ dom_exception _dom_mutation_name_event_get_prev_node_name( * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_mutation_name_event_init(dom_mutation_name_event *evt, - struct dom_string *type, bool bubble, bool cancelable, - struct dom_node *node, struct dom_string *prev_ns, - struct dom_string *prev_name) + dom_string *type, bool bubble, bool cancelable, + struct dom_node *node, dom_string *prev_ns, + dom_string *prev_name) { evt->prev_namespace = prev_ns; dom_string_ref(prev_ns); @@ -142,9 +142,9 @@ dom_exception _dom_mutation_name_event_init(dom_mutation_name_event *evt, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_mutation_name_event_init_ns(dom_mutation_name_event *evt, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, bool bubble, bool cancelable, struct dom_node *node, - struct dom_string *prev_ns, struct dom_string *prev_name) + dom_string *prev_ns, dom_string *prev_name) { evt->prev_namespace = prev_ns; dom_string_ref(prev_ns); diff --git a/src/events/mutation_name_event.h b/src/events/mutation_name_event.h index 2ba74de..94b35a2 100644 --- a/src/events/mutation_name_event.h +++ b/src/events/mutation_name_event.h @@ -18,8 +18,8 @@ struct dom_mutation_name_event { struct dom_mutation_event base; - struct dom_string *prev_namespace; - struct dom_string *prev_nodename; + dom_string *prev_namespace; + dom_string *prev_nodename; }; /* Constructor */ diff --git a/src/events/text_event.c b/src/events/text_event.c index 24c921a..591da57 100644 --- a/src/events/text_event.c +++ b/src/events/text_event.c @@ -69,7 +69,7 @@ void _virtual_dom_text_event_destroy(struct dom_event *evt) * \return DOM_NO_ERR. */ dom_exception _dom_text_event_get_data(dom_text_event *evt, - struct dom_string **data) + dom_string **data) { *data = evt->data; dom_string_ref(*data); @@ -89,8 +89,8 @@ dom_exception _dom_text_event_get_data(dom_text_event *evt, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_text_event_init(dom_text_event *evt, - struct dom_string *type, bool bubble, bool cancelable, - struct dom_abstract_view *view, struct dom_string *data) + dom_string *type, bool bubble, bool cancelable, + struct dom_abstract_view *view, dom_string *data) { evt->data = data; dom_string_ref(data); @@ -112,9 +112,9 @@ dom_exception _dom_text_event_init(dom_text_event *evt, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_text_event_init_ns(dom_text_event *evt, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, - struct dom_string *data) + dom_string *data) { evt->data = data; dom_string_ref(data); diff --git a/src/events/text_event.h b/src/events/text_event.h index 754a4f6..a50bf32 100644 --- a/src/events/text_event.h +++ b/src/events/text_event.h @@ -17,7 +17,7 @@ */ struct dom_text_event { struct dom_ui_event base; - struct dom_string *data; + dom_string *data; }; /* Constructor */ diff --git a/src/events/ui_event.c b/src/events/ui_event.c index f18e44f..0be2980 100644 --- a/src/events/ui_event.c +++ b/src/events/ui_event.c @@ -102,7 +102,7 @@ dom_exception _dom_ui_event_get_detail(dom_ui_event *evt, * \param detail The detail object * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ -dom_exception _dom_ui_event_init(dom_ui_event *evt, struct dom_string *type, +dom_exception _dom_ui_event_init(dom_ui_event *evt, dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, long detail) { @@ -125,7 +125,7 @@ dom_exception _dom_ui_event_init(dom_ui_event *evt, struct dom_string *type, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_ui_event_init_ns(dom_ui_event *evt, - struct dom_string *namespace, struct dom_string *type, + dom_string *namespace, dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, long detail) { diff --git a/src/html/html_base_element.c b/src/html/html_base_element.c index f8aa14e..dad0985 100644 --- a/src/html/html_base_element.c +++ b/src/html/html_base_element.c @@ -96,8 +96,8 @@ void _dom_html_base_element_destroy(struct dom_document *doc, /* The virtual function used to parse attribute value, see src/core/element.c * for detail */ dom_exception _dom_html_base_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed) + dom_string *name, dom_string *value, + dom_string **parsed) { UNUSED(ele); UNUSED(name); diff --git a/src/html/html_base_element.h b/src/html/html_base_element.h index 7e58cc2..c9143f5 100644 --- a/src/html/html_base_element.h +++ b/src/html/html_base_element.h @@ -35,8 +35,8 @@ void _dom_html_base_element_destroy(struct dom_document *doc, /* The protected virtual functions */ dom_exception _dom_html_base_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed); + dom_string *name, dom_string *value, + dom_string **parsed); void _dom_virtual_html_base_element_destroy(dom_node_internal *node); dom_exception _dom_html_base_element_alloc(struct dom_document *doc, struct dom_node_internal *n, struct dom_node_internal **ret); diff --git a/src/html/html_body_element.c b/src/html/html_body_element.c index 7512910..afe8ee4 100644 --- a/src/html/html_body_element.c +++ b/src/html/html_body_element.c @@ -96,8 +96,8 @@ void _dom_html_body_element_destroy(struct dom_document *doc, /* The virtual function used to parse attribute value, see src/core/element.c * for detail */ dom_exception _dom_html_body_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed) + dom_string *name, dom_string *value, + dom_string **parsed) { UNUSED(ele); UNUSED(name); diff --git a/src/html/html_body_element.h b/src/html/html_body_element.h index e62ff78..ccb6091 100644 --- a/src/html/html_body_element.h +++ b/src/html/html_body_element.h @@ -35,8 +35,8 @@ void _dom_html_body_element_destroy(struct dom_document *doc, /* The protected virtual functions */ dom_exception _dom_html_body_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed); + dom_string *name, dom_string *value, + dom_string **parsed); void _dom_virtual_html_body_element_destroy(dom_node_internal *node); dom_exception _dom_html_body_element_alloc(struct dom_document *doc, struct dom_node_internal *n, struct dom_node_internal **ret); diff --git a/src/html/html_collection.c b/src/html/html_collection.c index e0c96b9..9b34c51 100644 --- a/src/html/html_collection.c +++ b/src/html/html_collection.c @@ -206,7 +206,7 @@ dom_exception dom_html_collection_item(dom_html_collection *col, * \return DOM_NO_ERR on success. */ dom_exception dom_html_collection_named_item(dom_html_collection *col, - struct dom_string *name, struct dom_node **node) + dom_string *name, struct dom_node **node) { struct dom_node_internal *n = col->root; dom_exception err; diff --git a/src/html/html_document.c b/src/html/html_document.c index a2845aa..6b9eb5c 100644 --- a/src/html/html_document.c +++ b/src/html/html_document.c @@ -72,7 +72,7 @@ dom_exception dom_html_document_complete(void); * as the returned title. */ dom_exception dom_html_document_get_title(dom_html_document *doc, - struct dom_string **title) + dom_string **title) { UNUSED(doc); UNUSED(title); @@ -81,13 +81,13 @@ dom_exception dom_html_document_get_title(dom_html_document *doc, } dom_exception dom_html_document_set_title(dom_html_document *doc, - struct dom_string *title); + dom_string *title); dom_exception dom_html_document_get_referer(dom_html_document *doc, - struct dom_string **referer); + dom_string **referer); dom_exception dom_html_document_get_domain(dom_html_document *doc, - struct dom_string **domain); + dom_string **domain); dom_exception dom_html_document_get_url(dom_html_document *doc, - struct dom_string **url); + dom_string **url); dom_exception dom_html_document_get_body(dom_html_document *doc, struct dom_html_element **body); dom_exception dom_html_document_set_body(dom_html_document *doc, @@ -103,16 +103,16 @@ dom_exception dom_html_document_get_forms(dom_html_document *doc, dom_exception dom_html_document_get_anchors(dom_html_document *doc, struct dom_html_collection **col); dom_exception dom_html_document_get_cookie(dom_html_document *doc, - struct dom_string **cookie); + dom_string **cookie); dom_exception dom_html_document_set_cookie(dom_html_document *doc, - struct dom_string *cookie); + dom_string *cookie); dom_exception dom_html_document_open(dom_html_document *doc); dom_exception dom_html_document_close(dom_html_document *doc); dom_exception dom_html_document_write(dom_html_document *doc, - struct dom_string *text); + dom_string *text); dom_exception dom_html_document_writeln(dom_html_document *doc, - struct dom_string *text); + dom_string *text); dom_exception dom_html_document_get_elements_by_name(dom_html_document *doc, - struct dom_string *name, struct dom_nodelist **list); + dom_string *name, struct dom_nodelist **list); diff --git a/src/html/html_document.h b/src/html/html_document.h index 31770ef..27f5cf9 100644 --- a/src/html/html_document.h +++ b/src/html/html_document.h @@ -26,11 +26,11 @@ struct dom_html_document { } parser; /**< The underlaying parser of this document */ - struct dom_string *title; /**< HTML document title */ - struct dom_string *referer; /**< HTML document referer */ - struct dom_string *domain; /**< HTML document domain */ - struct dom_string *url; /**< HTML document URL */ - struct dom_string *cookie; /**< HTML document cookie */ + dom_string *title; /**< HTML document title */ + dom_string *referer; /**< HTML document referer */ + dom_string *domain; /**< HTML document domain */ + dom_string *url; /**< HTML document URL */ + dom_string *cookie; /**< HTML document cookie */ }; /* Initialise a HTMLDocument */ diff --git a/src/html/html_element.c b/src/html/html_element.c index decf955..3552c67 100644 --- a/src/html/html_element.c +++ b/src/html/html_element.c @@ -71,7 +71,7 @@ dom_exception _dom_html_element_copy(struct dom_node_internal *new, /* API functions */ dom_exception _dom_html_element_get_id(dom_html_element *element, - struct dom_string **id) + dom_string **id) { dom_exception ret; dom_document *doc; @@ -94,7 +94,7 @@ dom_exception _dom_html_element_get_id(dom_html_element *element, } dom_exception _dom_html_element_set_id(dom_html_element *element, - struct dom_string *id) + dom_string *id) { dom_exception ret; dom_document *doc; diff --git a/src/html/html_element.h b/src/html/html_element.h index d0691d6..2a433a8 100644 --- a/src/html/html_element.h +++ b/src/html/html_element.h @@ -43,9 +43,9 @@ dom_exception _dom_html_element_copy(struct dom_node_internal *new, /* The API functions */ dom_exception _dom_html_element_get_id(dom_html_element *element, - struct dom_string **id); + dom_string **id); dom_exception _dom_html_element_set_id(dom_html_element *element, - struct dom_string *id); + dom_string *id); /* Some common functions used by all child classes */ dom_exception dom_html_element_get_bool_property(dom_html_element *ele, diff --git a/src/html/html_form_element.c b/src/html/html_form_element.c index 7c0e9af..1b6ab91 100644 --- a/src/html/html_form_element.c +++ b/src/html/html_form_element.c @@ -104,8 +104,8 @@ void _dom_html_form_element_destroy(struct dom_document *doc, /* The virtual function used to parse attribute value, see src/core/element.c * for detail */ dom_exception _dom_html_form_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed) + dom_string *name, dom_string *value, + dom_string **parsed) { UNUSED(ele); UNUSED(name); diff --git a/src/html/html_form_element.h b/src/html/html_form_element.h index 9b8105d..dd1482b 100644 --- a/src/html/html_form_element.h +++ b/src/html/html_form_element.h @@ -39,8 +39,8 @@ void _dom_html_form_element_destroy(struct dom_document *doc, /* The protected virtual functions */ dom_exception _dom_html_form_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed); + dom_string *name, dom_string *value, + dom_string **parsed); void _dom_virtual_html_form_element_destroy(dom_node_internal *node); dom_exception _dom_html_form_element_alloc(struct dom_document *doc, struct dom_node_internal *n, struct dom_node_internal **ret); diff --git a/src/html/html_head_element.c b/src/html/html_head_element.c index 9ab53b6..a37acfe 100644 --- a/src/html/html_head_element.c +++ b/src/html/html_head_element.c @@ -96,8 +96,8 @@ void _dom_html_head_element_destroy(struct dom_document *doc, /* The virtual function used to parse attribute value, see src/core/element.c * for detail */ dom_exception _dom_html_head_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed) + dom_string *name, dom_string *value, + dom_string **parsed) { UNUSED(ele); UNUSED(name); diff --git a/src/html/html_head_element.h b/src/html/html_head_element.h index d92c656..bb58720 100644 --- a/src/html/html_head_element.h +++ b/src/html/html_head_element.h @@ -35,8 +35,8 @@ void _dom_html_head_element_destroy(struct dom_document *doc, /* The protected virtual functions */ dom_exception _dom_html_head_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed); + dom_string *name, dom_string *value, + dom_string **parsed); void _dom_virtual_html_head_element_destroy(dom_node_internal *node); dom_exception _dom_html_head_element_alloc(struct dom_document *doc, struct dom_node_internal *n, struct dom_node_internal **ret); diff --git a/src/html/html_html_element.c b/src/html/html_html_element.c index 8e08382..2da67f6 100644 --- a/src/html/html_html_element.c +++ b/src/html/html_html_element.c @@ -96,8 +96,8 @@ void _dom_html_html_element_destroy(struct dom_document *doc, /* The virtual function used to parse attribute value, see src/core/element.c * for detail */ dom_exception _dom_html_html_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed) + dom_string *name, dom_string *value, + dom_string **parsed) { UNUSED(ele); UNUSED(name); diff --git a/src/html/html_html_element.h b/src/html/html_html_element.h index 4e81d18..4ffc9ba 100644 --- a/src/html/html_html_element.h +++ b/src/html/html_html_element.h @@ -35,8 +35,8 @@ void _dom_html_html_element_destroy(struct dom_document *doc, /* The protected virtual functions */ dom_exception _dom_html_html_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed); + dom_string *name, dom_string *value, + dom_string **parsed); void _dom_virtual_html_html_element_destroy(dom_node_internal *node); dom_exception _dom_html_html_element_alloc(struct dom_document *doc, struct dom_node_internal *n, struct dom_node_internal **ret); diff --git a/src/html/html_isindex_element.c b/src/html/html_isindex_element.c index 42db2e5..295ee38 100644 --- a/src/html/html_isindex_element.c +++ b/src/html/html_isindex_element.c @@ -103,8 +103,8 @@ void _dom_html_isindex_element_destroy(struct dom_document *doc, /* The virtual function used to parse attribute value, see src/core/element.c * for detail */ dom_exception _dom_html_isindex_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed) + dom_string *name, dom_string *value, + dom_string **parsed) { UNUSED(ele); UNUSED(name); diff --git a/src/html/html_isindex_element.h b/src/html/html_isindex_element.h index 3aad119..b64c6c0 100644 --- a/src/html/html_isindex_element.h +++ b/src/html/html_isindex_element.h @@ -37,8 +37,8 @@ void _dom_html_isindex_element_destroy(struct dom_document *doc, /* The protected virtual functions */ dom_exception _dom_html_isindex_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed); + dom_string *name, dom_string *value, + dom_string **parsed); void _dom_virtual_html_isindex_element_destroy(dom_node_internal *node); dom_exception _dom_html_isindex_element_alloc(struct dom_document *doc, struct dom_node_internal *n, struct dom_node_internal **ret); diff --git a/src/html/html_link_element.c b/src/html/html_link_element.c index ce0d6ac..b7b143c 100644 --- a/src/html/html_link_element.c +++ b/src/html/html_link_element.c @@ -130,8 +130,8 @@ dom_exception dom_html_link_element_set_disabled(dom_html_link_element *ele, /* The virtual function used to parse attribute value, see src/core/element.c * for detail */ dom_exception _dom_html_link_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed) + dom_string *name, dom_string *value, + dom_string **parsed) { UNUSED(ele); UNUSED(name); diff --git a/src/html/html_link_element.h b/src/html/html_link_element.h index 4c6fe55..613665b 100644 --- a/src/html/html_link_element.h +++ b/src/html/html_link_element.h @@ -35,8 +35,8 @@ void _dom_html_link_element_destroy(struct dom_document *doc, /* The protected virtual functions */ dom_exception _dom_html_link_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed); + dom_string *name, dom_string *value, + dom_string **parsed); void _dom_virtual_html_link_element_destroy(dom_node_internal *node); dom_exception _dom_html_link_element_alloc(struct dom_document *doc, struct dom_node_internal *n, struct dom_node_internal **ret); diff --git a/src/html/html_meta_element.c b/src/html/html_meta_element.c index a525e13..92b293b 100644 --- a/src/html/html_meta_element.c +++ b/src/html/html_meta_element.c @@ -96,8 +96,8 @@ void _dom_html_meta_element_destroy(struct dom_document *doc, /* The virtual function used to parse attribute value, see src/core/element.c * for detail */ dom_exception _dom_html_meta_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed) + dom_string *name, dom_string *value, + dom_string **parsed) { UNUSED(ele); UNUSED(name); diff --git a/src/html/html_meta_element.h b/src/html/html_meta_element.h index 2f50719..6574913 100644 --- a/src/html/html_meta_element.h +++ b/src/html/html_meta_element.h @@ -35,8 +35,8 @@ void _dom_html_meta_element_destroy(struct dom_document *doc, /* The protected virtual functions */ dom_exception _dom_html_meta_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed); + dom_string *name, dom_string *value, + dom_string **parsed); void _dom_virtual_html_meta_element_destroy(dom_node_internal *node); dom_exception _dom_html_meta_element_alloc(struct dom_document *doc, struct dom_node_internal *n, struct dom_node_internal **ret); diff --git a/src/html/html_options_collection.c b/src/html/html_options_collection.c index 8b4c7bb..0b80df2 100644 --- a/src/html/html_options_collection.c +++ b/src/html/html_options_collection.c @@ -140,7 +140,7 @@ dom_exception dom_html_options_collection_item(dom_html_options_collection *col, * \return DOM_NO_ERR on success. */ dom_exception dom_html_options_collection_named_item(dom_html_options_collection *col, - struct dom_string *name, struct dom_node **node) + dom_string *name, struct dom_node **node) { return dom_html_collection_named_item(&col->base, name, node); } diff --git a/src/html/html_select_element.c b/src/html/html_select_element.c index f4e54cb..134df3e 100644 --- a/src/html/html_select_element.c +++ b/src/html/html_select_element.c @@ -102,8 +102,8 @@ void _dom_html_select_element_destroy(struct dom_document *doc, /* The virtual function used to parse attribute value, see src/core/element.c * for detail */ dom_exception _dom_html_select_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed) + dom_string *name, dom_string *value, + dom_string **parsed) { UNUSED(ele); UNUSED(name); diff --git a/src/html/html_select_element.h b/src/html/html_select_element.h index 28b4956..acaa929 100644 --- a/src/html/html_select_element.h +++ b/src/html/html_select_element.h @@ -40,8 +40,8 @@ void _dom_html_select_element_destroy(struct dom_document *doc, /* The protected virtual functions */ dom_exception _dom_html_select_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed); + dom_string *name, dom_string *value, + dom_string **parsed); void _dom_virtual_html_select_element_destroy(dom_node_internal *node); dom_exception _dom_html_select_element_alloc(struct dom_document *doc, struct dom_node_internal *n, struct dom_node_internal **ret); diff --git a/src/html/html_style_element.c b/src/html/html_style_element.c index 288b1cf..b39995a 100644 --- a/src/html/html_style_element.c +++ b/src/html/html_style_element.c @@ -96,8 +96,8 @@ void _dom_html_style_element_destroy(struct dom_document *doc, /* The virtual function used to parse attribute value, see src/core/element.c * for detail */ dom_exception _dom_html_style_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed) + dom_string *name, dom_string *value, + dom_string **parsed) { UNUSED(ele); UNUSED(name); diff --git a/src/html/html_style_element.h b/src/html/html_style_element.h index 3ac8cf5..b20acb0 100644 --- a/src/html/html_style_element.h +++ b/src/html/html_style_element.h @@ -35,8 +35,8 @@ void _dom_html_style_element_destroy(struct dom_document *doc, /* The protected virtual functions */ dom_exception _dom_html_style_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed); + dom_string *name, dom_string *value, + dom_string **parsed); void _dom_virtual_html_style_element_destroy(dom_node_internal *node); dom_exception _dom_html_style_element_alloc(struct dom_document *doc, struct dom_node_internal *n, struct dom_node_internal **ret); diff --git a/src/html/html_title_element.c b/src/html/html_title_element.c index c914d4a..1a440b1 100644 --- a/src/html/html_title_element.c +++ b/src/html/html_title_element.c @@ -101,8 +101,8 @@ void _dom_html_title_element_destroy(struct dom_document *doc, /* The virtual function used to parse attribute value, see src/core/element.c * for detail */ dom_exception _dom_html_title_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed) + dom_string *name, dom_string *value, + dom_string **parsed) { UNUSED(ele); UNUSED(name); @@ -151,7 +151,7 @@ dom_exception _dom_html_title_element_copy(struct dom_node_internal *new, * \return DOM_NO_ERR on success, appropriated dom_exception on failure. */ dom_exception dom_html_title_element_get_text(dom_html_title_element *ele, - struct dom_string **text) + dom_string **text) { dom_node_internal *node = (dom_node_internal *) ele; dom_node_internal *n = node->first_child; @@ -172,7 +172,7 @@ dom_exception dom_html_title_element_get_text(dom_html_title_element *ele, * \return DOM_NO_ERR on success, appropriated dom_exception on failure. */ dom_exception dom_html_title_element_set_text(dom_html_title_element *ele, - struct dom_string *text) + dom_string *text) { dom_node_internal *node = (dom_node_internal *) ele; dom_node_internal *n = node->first_child; diff --git a/src/html/html_title_element.h b/src/html/html_title_element.h index 1433189..87dabd8 100644 --- a/src/html/html_title_element.h +++ b/src/html/html_title_element.h @@ -35,8 +35,8 @@ void _dom_html_title_element_destroy(struct dom_document *doc, /* The protected virtual functions */ dom_exception _dom_html_title_element_parse_attribute(dom_element *ele, - struct dom_string *name, struct dom_string *value, - struct dom_string **parsed); + dom_string *name, dom_string *value, + dom_string **parsed); void _dom_virtual_html_title_element_destroy(dom_node_internal *node); dom_exception _dom_html_title_element_alloc(struct dom_document *doc, struct dom_node_internal *n, struct dom_node_internal **ret); diff --git a/src/utils/namespace.c b/src/utils/namespace.c index 3290b3f..2b14d72 100644 --- a/src/utils/namespace.c +++ b/src/utils/namespace.c @@ -16,9 +16,9 @@ /** XML prefix */ -static struct dom_string *xml; +static dom_string *xml; /** XMLNS prefix */ -static struct dom_string *xmlns; +static dom_string *xmlns; /* The namespace strings */ static const char *namespaces[DOM_NAMESPACE_COUNT] = { @@ -31,7 +31,7 @@ static const char *namespaces[DOM_NAMESPACE_COUNT] = { "http://www.w3.org/2000/xmlns/" }; -struct dom_string *dom_namespaces[DOM_NAMESPACE_COUNT] = { +dom_string *dom_namespaces[DOM_NAMESPACE_COUNT] = { NULL, }; @@ -129,8 +129,8 @@ dom_exception _dom_namespace_finalise(void) * ::qname is not (or is not prefixed by) * "xmlns". */ -dom_exception _dom_namespace_validate_qname(struct dom_string *qname, - struct dom_string *namespace) +dom_exception _dom_namespace_validate_qname(dom_string *qname, + dom_string *namespace) { uint32_t colon, len; @@ -171,8 +171,8 @@ dom_exception _dom_namespace_validate_qname(struct dom_string *qname, return DOM_NAMESPACE_ERR; } else { /* Prefix */ - struct dom_string *prefix; - struct dom_string *lname; + dom_string *prefix; + dom_string *lname; dom_exception err; /* Ensure there is a namespace URI */ @@ -238,8 +238,8 @@ dom_exception _dom_namespace_validate_qname(struct dom_string *qname, * ::prefix and ::localname will be referenced. The caller should unreference * them once finished. */ -dom_exception _dom_namespace_split_qname(struct dom_string *qname, - struct dom_string **prefix, struct dom_string **localname) +dom_exception _dom_namespace_split_qname(dom_string *qname, + dom_string **prefix, dom_string **localname) { uint32_t colon; dom_exception err; diff --git a/src/utils/namespace.h b/src/utils/namespace.h index 900c9ee..221e9da 100644 --- a/src/utils/namespace.h +++ b/src/utils/namespace.h @@ -10,10 +10,9 @@ #include #include +#include struct dom_document; -struct dom_string; - /* Initialise the namespace component */ dom_exception _dom_namespace_initialise(dom_alloc alloc, void *pw); @@ -22,18 +21,18 @@ dom_exception _dom_namespace_initialise(dom_alloc alloc, void *pw); dom_exception _dom_namespace_finalise(void); /* Ensure a QName is valid */ -dom_exception _dom_namespace_validate_qname(struct dom_string *qname, - struct dom_string *namespace); +dom_exception _dom_namespace_validate_qname(dom_string *qname, + dom_string *namespace); /* Split a QName into a namespace prefix and localname string */ -dom_exception _dom_namespace_split_qname(struct dom_string *qname, - struct dom_string **prefix, struct dom_string **localname); +dom_exception _dom_namespace_split_qname(dom_string *qname, + dom_string **prefix, dom_string **localname); /* Get the XML prefix dom_string */ -struct dom_string *_dom_namespace_get_xml_prefix(void); +dom_string *_dom_namespace_get_xml_prefix(void); /* Get the XMLNS prefix dom_string */ -struct dom_string *_dom_namespace_get_xmlns_prefix(void); +dom_string *_dom_namespace_get_xmlns_prefix(void); #endif diff --git a/src/utils/resource_mgr.c b/src/utils/resource_mgr.c index 98270ee..ccaf015 100644 --- a/src/utils/resource_mgr.c +++ b/src/utils/resource_mgr.c @@ -38,7 +38,7 @@ void *_dom_resource_mgr_alloc(struct dom_resource_mgr *res, void *ptr, * \return DOM_NO_ERR on success, appropriate dom_exception on failure. */ dom_exception _dom_resource_mgr_create_string(struct dom_resource_mgr *res, - const uint8_t *data, size_t len, struct dom_string **result) + const uint8_t *data, size_t len, dom_string **result) { return dom_string_create(res->alloc, res->pw, data, len, result); } @@ -74,7 +74,7 @@ dom_exception _dom_resource_mgr_create_lwcstring(struct dom_resource_mgr *res, */ dom_exception _dom_resource_mgr_create_string_from_lwcstring( struct dom_resource_mgr *res, struct lwc_string_s *str, - struct dom_string **result) + dom_string **result) { return _dom_string_create_from_lwcstring(res->alloc, res->pw, str, result); diff --git a/src/utils/resource_mgr.h b/src/utils/resource_mgr.h index 608df53..1b604ec 100644 --- a/src/utils/resource_mgr.h +++ b/src/utils/resource_mgr.h @@ -10,11 +10,11 @@ #include #include +#include #include "hashtable.h" struct lwc_string_s; -struct dom_string; /** * Resource manager @@ -28,14 +28,14 @@ void *_dom_resource_mgr_alloc(struct dom_resource_mgr *res, void *ptr, size_t size); dom_exception _dom_resource_mgr_create_string(struct dom_resource_mgr *res, - const uint8_t *data, size_t len, struct dom_string **result); + const uint8_t *data, size_t len, dom_string **result); dom_exception _dom_resource_mgr_create_lwcstring(struct dom_resource_mgr *res, const uint8_t *data, size_t len, struct lwc_string_s **result); dom_exception _dom_resource_mgr_create_string_from_lwcstring( struct dom_resource_mgr *res, struct lwc_string_s *str, - struct dom_string **result); + dom_string **result); dom_exception _dom_resource_mgr_create_hashtable(struct dom_resource_mgr *res, size_t chains, dom_hash_func f, struct dom_hash_table **ht); diff --git a/src/utils/validate.c b/src/utils/validate.c index eb6cb22..ac0bcd1 100644 --- a/src/utils/validate.c +++ b/src/utils/validate.c @@ -99,7 +99,7 @@ static bool is_name_char(uint32_t ch) * \param name The name need to be tested * \return true if ::name is valid, false otherwise. */ -bool _dom_validate_name(struct dom_string *name) +bool _dom_validate_name(dom_string *name) { uint32_t ch, len, i; dom_exception err; @@ -139,7 +139,7 @@ bool _dom_validate_name(struct dom_string *name) * \param str The name to validate * \return true if ::name is valid, false otherwise. */ -bool _dom_validate_ncname(struct dom_string *name) +bool _dom_validate_ncname(dom_string *name) { uint32_t ch, len, i; dom_exception err; diff --git a/src/utils/validate.h b/src/utils/validate.h index 5d375e7..7318653 100644 --- a/src/utils/validate.h +++ b/src/utils/validate.h @@ -16,11 +16,10 @@ #define dom_utils_valid_h_ #include +#include -struct dom_string; - -bool _dom_validate_name(struct dom_string *name); -bool _dom_validate_ncname(struct dom_string *name); +bool _dom_validate_name(dom_string *name); +bool _dom_validate_ncname(dom_string *name); #endif -- cgit v1.2.3