summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-03-03 18:08:01 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-03-03 18:08:01 +0000
commit702d96e703473dbe4481a42c472b4aae423a51d1 (patch)
tree9dc767860ebea940f1d936d14d69073b4e289c92 /include
parenteeb651eadb47228ad41c21b80d75afc17c2924f8 (diff)
downloadlibdom-702d96e703473dbe4481a42c472b4aae423a51d1.tar.gz
libdom-702d96e703473dbe4481a42c472b4aae423a51d1.tar.bz2
Rationalise dom_string (some consideration is required as to what happens wrt interning -- lwc_strings should probably be used)
Purge charset handling -- a) documents are always converted to utf-8 b) use parserutils for utf-8 handling Fix Hubbub binding to compile. svn path=/trunk/dom/; revision=6682
Diffstat (limited to 'include')
-rw-r--r--include/dom/bootstrap/implpriv.h5
-rw-r--r--include/dom/core/document.h3
-rw-r--r--include/dom/core/implementation.h1
-rw-r--r--include/dom/core/string.h19
4 files changed, 5 insertions, 23 deletions
diff --git a/include/dom/bootstrap/implpriv.h b/include/dom/bootstrap/implpriv.h
index 97806a8..c99a9d2 100644
--- a/include/dom/bootstrap/implpriv.h
+++ b/include/dom/bootstrap/implpriv.h
@@ -94,7 +94,6 @@ 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,
@@ -130,7 +129,6 @@ 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);
/**
@@ -251,8 +249,7 @@ dom_exception dom_register_source(struct dom_implementation_source *source,
/* Create a DOM document */
dom_exception dom_document_create(struct dom_implementation *impl,
- dom_string_charset charset, dom_alloc alloc, void *pw,
- struct dom_document **doc);
+ 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,
diff --git a/include/dom/core/document.h b/include/dom/core/document.h
index cce8e4b..6a5fd9f 100644
--- a/include/dom/core/document.h
+++ b/include/dom/core/document.h
@@ -9,6 +9,7 @@
#define dom_core_document_h_
#include <stdbool.h>
+#include <stdint.h>
#include <dom/core/exceptions.h>
@@ -98,5 +99,7 @@ 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);
+dom_exception dom_document_create_string(struct dom_document *doc,
+ const uint8_t *data, size_t len, struct dom_string **result);
#endif
diff --git a/include/dom/core/implementation.h b/include/dom/core/implementation.h
index a51493f..5e26432 100644
--- a/include/dom/core/implementation.h
+++ b/include/dom/core/implementation.h
@@ -37,7 +37,6 @@ 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 e3dfa30..8da9dd7 100644
--- a/include/dom/core/string.h
+++ b/include/dom/core/string.h
@@ -14,33 +14,16 @@
#include <dom/functypes.h>
#include <dom/core/exceptions.h>
-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 */
void dom_string_unref(struct dom_string *str);
-/* Create a DOM string from an offset into the document buffer */
-dom_exception dom_string_create_from_off(struct dom_document *doc,
- uint32_t off, size_t len, struct dom_string **str);
/* Create a DOM string from a string of characters */
-dom_exception dom_string_create_from_ptr(struct dom_document *doc,
- const uint8_t *ptr, size_t len, struct dom_string **str);
-/* Create a DOM string from a constant string of characters */
-dom_exception dom_string_create_from_const_ptr(struct dom_document *doc,
+dom_exception dom_string_create(dom_alloc alloc, void *pw,
const uint8_t *ptr, size_t len, struct dom_string **str);
-/* 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,
- dom_string_charset charset, const uint8_t *ptr, size_t len,
- struct dom_string **str);
/* Case sensitively compare two DOM strings */
int dom_string_cmp(struct dom_string *s1, struct dom_string *s2);