summaryrefslogtreecommitdiff
path: root/include/dom/bootstrap/implpriv.h
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2007-09-30 21:10:50 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2007-09-30 21:10:50 +0000
commit613f88393960853513873756933bd23b93543a33 (patch)
treef7f4c1acff769e9a7f6cd0f1c037ba2c28a66593 /include/dom/bootstrap/implpriv.h
parent5eba18a08b9821fa10cc03af8dbd7d1c10653b13 (diff)
downloadlibdom-613f88393960853513873756933bd23b93543a33.tar.gz
libdom-613f88393960853513873756933bd23b93543a33.tar.bz2
DOM Strings are now capable of containing either UTF-8 or UTF-16 encoded data.
The charset used for strings within a document is specified at document creation time. Whilst it is possible to mix charsets within a document, it's not recommended. Things that need fixing: + dom_string_get_data() doesn't return the charset. Better would be to permit the client to request a charset for the data to be returned in. + Interned node name strings will break if the document is UTF-16 (dom_document_create()). In fact, these could quite happily be globals, rather than allocating a set for each document. + Other usage of dom string constructors need checking for sanity + DOM Strings need to gain more utility APIs (such as getting the character length of a string, string concatenation etc). svn path=/trunk/dom/; revision=3614
Diffstat (limited to 'include/dom/bootstrap/implpriv.h')
-rw-r--r--include/dom/bootstrap/implpriv.h11
1 files changed, 9 insertions, 2 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,