diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2007-07-28 20:41:41 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2007-07-28 20:41:41 +0000 |
commit | ddbf47a33aa4fba4ce23e751db78acf59895fcc3 (patch) | |
tree | 08ff52e60d85dd31ef7f22c5792cf7794eeb8736 /src/core/text.c | |
parent | f6b4e5eeaf8e7afda0df4a5d44a309c291788382 (diff) | |
download | libdom-ddbf47a33aa4fba4ce23e751db78acf59895fcc3.tar.gz libdom-ddbf47a33aa4fba4ce23e751db78acf59895fcc3.tar.bz2 |
Finalisation and destruction of nodes
svn path=/trunk/dom/; revision=3467
Diffstat (limited to 'src/core/text.c')
-rw-r--r-- | src/core/text.c | 30 |
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 |