summaryrefslogtreecommitdiff
path: root/src/utils/namespace.h
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2007-09-29 01:01:55 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2007-09-29 01:01:55 +0000
commit6b1aeb6465f339bfbc7be33b1ecab3f235adbe7f (patch)
tree720ad0f18306af6b11b9b1c0dbd622bf57792af6 /src/utils/namespace.h
parent83bc8f09261fb4d265cc79d39e740b4a0c9648e2 (diff)
downloadlibdom-6b1aeb6465f339bfbc7be33b1ecab3f235adbe7f.tar.gz
libdom-6b1aeb6465f339bfbc7be33b1ecab3f235adbe7f.tar.bz2
Introduce global initialistaion/finalisation for DOM library. This should be used to initialise any parts of the library before they are used. Mostly, this will comprise of static initialisers. Finalisation cleans up afterwards. This API is only exposed to language-specific binding libraries -- they should expose their own global initialisation/finalisation routines which call the core libdom ones.
Introduce new utility code for namespace and qname processing. Port dom_document_create_element_ns() and dom_document_create_attribute_ns() to this new code. Make libdom-libxml's initialiser initialise libdom itself first of all. svn path=/trunk/dom/; revision=3604
Diffstat (limited to 'src/utils/namespace.h')
-rw-r--r--src/utils/namespace.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/utils/namespace.h b/src/utils/namespace.h
new file mode 100644
index 0000000..0bc5093
--- /dev/null
+++ b/src/utils/namespace.h
@@ -0,0 +1,33 @@
+/*
+ * This file is part of libdom.
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
+ */
+
+#ifndef dom_utils_namespace_h_
+#define dom_utils_namespace_h_
+
+#include <dom/functypes.h>
+#include <dom/core/exceptions.h>
+
+struct dom_document;
+struct dom_string;
+
+/* Initialise the namespace component */
+dom_exception _dom_namespace_initialise(dom_alloc alloc, void *pw);
+
+/* Finalise the namespace component */
+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);
+
+/* Split a QName into a namespace prefix and localname string */
+dom_exception _dom_namespace_split_qname(struct dom_string *qname,
+ struct dom_document *doc, struct dom_string **prefix,
+ struct dom_string **localname);
+
+#endif
+