summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/namespace.c18
-rw-r--r--src/utils/namespace.h15
-rw-r--r--src/utils/resource_mgr.c4
-rw-r--r--src/utils/resource_mgr.h6
-rw-r--r--src/utils/validate.c4
-rw-r--r--src/utils/validate.h7
6 files changed, 26 insertions, 28 deletions
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 <dom/functypes.h>
#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
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 <dom/functypes.h>
#include <dom/core/exceptions.h>
+#include <dom/core/string.h>
#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 <stdbool.h>
+#include <dom/core/string.h>
-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