summaryrefslogtreecommitdiff
path: root/src/node.c
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2015-01-19 15:06:14 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2015-01-20 18:12:28 +0100
commit040def592d73c7babf4634a0990e51de1a68d635 (patch)
tree6f6670ab2871c2ec1ba6ac4244a81790b18ae6ae /src/node.c
parent3f4d605546fc82a3cdce8056790f1bb140a62903 (diff)
Add user data field for nodes
Diffstat (limited to 'src/node.c')
-rw-r--r--src/node.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/node.c b/src/node.c
index 3785a27..675eb19 100644
--- a/src/node.c
+++ b/src/node.c
@@ -189,6 +189,24 @@ cmark_node_last_child(cmark_node *node)
}
}
+void*
+cmark_node_get_user_data(cmark_node *node) {
+ if (node == NULL) {
+ return NULL;
+ } else {
+ return node->user_data;
+ }
+}
+
+int
+cmark_node_set_user_data(cmark_node *node, void *user_data) {
+ if (node == NULL) {
+ return 0;
+ }
+ node->user_data = user_data;
+ return 1;
+}
+
static char*
S_strdup(const char *str)
{