summaryrefslogtreecommitdiff
path: root/include/dom
diff options
context:
space:
mode:
Diffstat (limited to 'include/dom')
-rw-r--r--include/dom/bootstrap/implpriv.h11
-rw-r--r--include/dom/core/implementation.h3
-rw-r--r--include/dom/core/string.h8
3 files changed, 18 insertions, 4 deletions
diff --git a/include/dom/bootstrap/implpriv.h b/include/dom/bootstrap/implpriv.h
index 36359c5..97806a8 100644
--- a/include/dom/bootstrap/implpriv.h
+++ b/include/dom/bootstrap/implpriv.h
@@ -29,10 +29,10 @@
#include <dom/core/exceptions.h>
#include <dom/functypes.h>
+#include <dom/core/string.h>
struct dom_document;
struct dom_document_type;
-struct dom_string;
/**
* DOM Implementation
@@ -94,6 +94,7 @@ struct dom_implementation {
* \param qname The qualified name of the document element
* \param doctype The type of document to create
* \param doc Pointer to location to receive result
+ * \param charset The charset to use for strings in the document
* \param alloc Memory (de)allocation function
* \param pw Pointer to client-specific private data
* \return DOM_NO_ERR on success,
@@ -129,6 +130,7 @@ struct dom_implementation {
struct dom_string *qname,
struct dom_document_type *doctype,
struct dom_document **doc,
+ dom_string_charset charset,
dom_alloc alloc, void *pw);
/**
@@ -249,7 +251,12 @@ dom_exception dom_register_source(struct dom_implementation_source *source,
/* Create a DOM document */
dom_exception dom_document_create(struct dom_implementation *impl,
- dom_alloc alloc, void *pw, struct dom_document **doc);
+ dom_string_charset charset, dom_alloc alloc, void *pw,
+ struct dom_document **doc);
+
+/* Set a document's buffer */
+void dom_document_set_buffer(struct dom_document *doc, uint8_t *buffer,
+ size_t buffer_len);
/* Create a DOM document type */
dom_exception dom_document_type_create(struct dom_string *qname,
diff --git a/include/dom/core/implementation.h b/include/dom/core/implementation.h
index 3f42ab7..a51493f 100644
--- a/include/dom/core/implementation.h
+++ b/include/dom/core/implementation.h
@@ -12,11 +12,11 @@
#include <dom/core/exceptions.h>
#include <dom/functypes.h>
+#include <dom/core/string.h>
struct dom_document;
struct dom_document_type;
struct dom_implementation;
-struct dom_string;
void dom_implementation_ref(struct dom_implementation *impl);
void dom_implementation_unref(struct dom_implementation *impl);
@@ -37,6 +37,7 @@ dom_exception dom_implementation_create_document(
struct dom_string *namespace, struct dom_string *qname,
struct dom_document_type *doctype,
struct dom_document **doc,
+ dom_string_charset charset,
dom_alloc alloc, void *pw);
dom_exception dom_implementation_get_feature(
diff --git a/include/dom/core/string.h b/include/dom/core/string.h
index c9ffd97..935e2c2 100644
--- a/include/dom/core/string.h
+++ b/include/dom/core/string.h
@@ -17,6 +17,11 @@
struct dom_document;
struct dom_string;
+typedef enum {
+ DOM_STRING_UTF8,
+ DOM_STRING_UTF16
+} dom_string_charset;
+
/* Claim a reference on a DOM string */
void dom_string_ref(struct dom_string *str);
/* Release a reference on a DOM string */
@@ -34,7 +39,8 @@ dom_exception dom_string_create_from_const_ptr(struct dom_document *doc,
/* Create a DOM string from a string of characters that does not belong
* to a document */
dom_exception dom_string_create_from_ptr_no_doc(dom_alloc alloc, void *pw,
- const uint8_t *ptr, size_t len, struct dom_string **str);
+ dom_string_charset charset, const uint8_t *ptr, size_t len,
+ struct dom_string **str);
/* Get a pointer to the string of characters within a DOM string */
dom_exception dom_string_get_data(struct dom_string *str,