summaryrefslogtreecommitdiff
path: root/src/core/pi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/pi.c')
-rw-r--r--src/core/pi.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/pi.c b/src/core/pi.c
index 55e85f7..c2b6cc9 100644
--- a/src/core/pi.c
+++ b/src/core/pi.c
@@ -56,3 +56,21 @@ dom_exception dom_processing_instruction_create(struct dom_document *doc,
return DOM_NO_ERR;
}
+
+/**
+ * Destroy a processing instruction
+ *
+ * \param doc The owning document
+ * \param pi The processing instruction to destroy
+ *
+ * The contents of ::pi will be destroyed and ::pi will be freed.
+ */
+void dom_processing_instruction_destroy(struct dom_document *doc,
+ struct dom_processing_instruction *pi)
+{
+ /* Finalise base class */
+ dom_node_finalise(doc, &pi->base);
+
+ /* Free processing instruction */
+ dom_document_alloc(doc, pi, 0);
+}