summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-12-05 22:18:29 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-12-05 22:18:29 -0800
commit6c1f76a8a22f6c84231e5101f0950ce353ec8075 (patch)
tree2435862e0faefec76a48f41cb47e03cd0a1eca4f /src
parent6f82e1cf327df8903384e4dc79e369a51b6b9eb8 (diff)
API change: Add cmark_node_set_type for completeness.
Diffstat (limited to 'src')
-rw-r--r--src/cmark.h5
-rw-r--r--src/node.c11
2 files changed, 16 insertions, 0 deletions
diff --git a/src/cmark.h b/src/cmark.h
index f96cea9..f1a6da6 100644
--- a/src/cmark.h
+++ b/src/cmark.h
@@ -137,6 +137,11 @@ cmark_node_get_type(cmark_node *node);
/**
*/
+CMARK_EXPORT int
+cmark_node_set_type(cmark_node *node, cmark_node_type node_type);
+
+/**
+ */
CMARK_EXPORT const char*
cmark_node_get_string_content(cmark_node *node);
diff --git a/src/node.c b/src/node.c
index 243c3e6..674f988 100644
--- a/src/node.c
+++ b/src/node.c
@@ -84,6 +84,17 @@ cmark_node_get_type(cmark_node *node)
}
}
+int
+cmark_node_set_type(cmark_node *node, cmark_node_type node_type)
+{
+ if (node == NULL) {
+ return 0;
+ } else {
+ node->type = node_type;
+ return 1;
+ }
+}
+
static const char*
S_type_string(cmark_node *node)
{