summaryrefslogtreecommitdiff
path: root/src/core/node.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2007-07-28 14:34:59 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2007-07-28 14:34:59 +0000
commitf690243cd9e852396aecc2c4d054e1e2478aff09 (patch)
treed3fe522992dec910758c2b86d0d02ec9c2d005a9 /src/core/node.c
parent5b61881600d30941e4a4b53160416f80b11bf7b3 (diff)
downloadlibdom-f690243cd9e852396aecc2c4d054e1e2478aff09.tar.gz
libdom-f690243cd9e852396aecc2c4d054e1e2478aff09.tar.bz2
Sort out somewhat messy object construction.
We now have explicit types for all classes (rather than using the parent class for those which inherit but add no extra data content). svn path=/trunk/dom/; revision=3465
Diffstat (limited to 'src/core/node.c')
-rw-r--r--src/core/node.c59
1 files changed, 0 insertions, 59 deletions
diff --git a/src/core/node.c b/src/core/node.c
index 4f15617..04a1230 100644
--- a/src/core/node.c
+++ b/src/core/node.c
@@ -13,65 +13,6 @@
#include "utils/utils.h"
/**
- * Create a DOM node of the given type
- *
- * \param doc The owning document
- * \param type The type of node to create
- * \param name The node name, or NULL
- * \param value The node value, or NULL
- * \param result Pointer to location to receive created node
- * \return DOM_NO_ERR on success, appropriate error otherwise
- *
- * ::doc, ::name and ::value will have their reference counts increased.
- *
- * The created node will already be referenced.
- */
-dom_exception dom_node_create(struct dom_document *doc, dom_node_type type,
- struct dom_string *name, struct dom_string *value,
- struct dom_node **result)
-{
- struct dom_node *node;
- dom_exception err;
-
- /* If there's a type-specific constructor, use that */
- switch (type) {
- case DOM_ELEMENT_NODE:
- return dom_document_create_element(doc, name,
- (struct dom_element **) result);
- case DOM_ATTRIBUTE_NODE:
- return dom_document_create_attribute(doc, name,
- (struct dom_attr **) result);
- case DOM_TEXT_NODE:
- return dom_document_create_text_node(doc, value,
- (struct dom_text **) result);
- case DOM_CDATA_SECTION_NODE:
- return dom_document_create_cdata_section(doc, value,
- (struct dom_text **) result);
- case DOM_COMMENT_NODE:
- return dom_document_create_comment(doc, value,
- (struct dom_characterdata **) result);
- default:
- break;
- }
-
- /* Otherwise, this is a generic node, so build it ourselves */
- node = dom_document_alloc(doc, NULL, sizeof(struct dom_node));
- if (node == NULL)
- return DOM_NO_MEM_ERR;
-
- /* Initialise node contents */
- err = dom_node_initialise(node, doc, type, name, value);
- if (err != DOM_NO_ERR) {
- dom_document_alloc(doc, node, 0);
- return err;
- }
-
- *result = node;
-
- return DOM_NO_ERR;
-}
-
-/**
* Initialise a DOM node
*
* \param node The node to initialise