summaryrefslogtreecommitdiff
path: root/src/core/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/text.c')
-rw-r--r--src/core/text.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/core/text.c b/src/core/text.c
index 05e2b7d..ec94311 100644
--- a/src/core/text.c
+++ b/src/core/text.c
@@ -52,6 +52,23 @@ dom_exception dom_text_create(struct dom_document *doc,
}
/**
+ * Destroy a text node
+ *
+ * \param doc The owning document
+ * \param text The text node to destroy
+ *
+ * The contents of ::text will be destroyed and ::text will be freed.
+ */
+void dom_text_destroy(struct dom_document *doc, struct dom_text *text)
+{
+ /* Finalise node */
+ dom_text_finalise(doc, text);
+
+ /* Free node */
+ dom_document_alloc(doc, text, 0);
+}
+
+/**
* Initialise a text node
*
* \param text The node to initialise
@@ -82,6 +99,19 @@ dom_exception dom_text_initialise(struct dom_text *text,
}
/**
+ * Finalise a text node
+ *
+ * \param doc The owning document
+ * \param text The text node to finalise
+ *
+ * The contents of ::text will be cleaned up. ::text will not be freed.
+ */
+void dom_text_finalise(struct dom_document *doc, struct dom_text *text)
+{
+ dom_characterdata_finalise(doc, &text->base);
+}
+
+/**
* Split a text node at a given character offset
*
* \param text The node to split