summaryrefslogtreecommitdiff
path: root/src/cmark.h
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-01-10 23:35:33 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2016-01-10 23:35:33 -0800
commit93843bd2fe8c91fe9e659c5b801f1a7d672dc223 (patch)
tree1b3af3c5fb8c4e7abc8491efd3570620eb4d8d91 /src/cmark.h
parente384149e683fd6ea950ba9318525563175ca9f47 (diff)
Added cmark_node_replace(oldnode, newnode).
API change. I've found in using the API that this is very often wanted.
Diffstat (limited to 'src/cmark.h')
-rw-r--r--src/cmark.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmark.h b/src/cmark.h
index 5f9f294..6b5c385 100644
--- a/src/cmark.h
+++ b/src/cmark.h
@@ -387,6 +387,11 @@ CMARK_EXPORT int cmark_node_insert_before(cmark_node *node,
*/
CMARK_EXPORT int cmark_node_insert_after(cmark_node *node, cmark_node *sibling);
+/** Replaces 'oldnode' with 'newnode' and frees the memory used by 'oldnode'.
+ * Returns 1 on success, 0 on failure.
+ */
+CMARK_EXPORT int cmark_node_replace(cmark_node *oldnode, cmark_node *newnode);
+
/** Adds 'child' to the beginning of the children of 'node'.
* Returns 1 on success, 0 on failure.
*/