summaryrefslogtreecommitdiff
path: root/src/cmark.h
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2014-11-18 16:45:11 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2014-11-18 16:45:11 -0800
commit9370b2cfd9b6382164ab7bde36a59409d32ae498 (patch)
tree5a371e5c14340531753e446a0b84a75bab87ec29 /src/cmark.h
parent47580cbda73fa6ad984dc4690625eb27b54bc563 (diff)
parent1d39b50d8889155de11df40f7e89bec09e0c4681 (diff)
Merge branch 'api_tests' of https://github.com/nwellnhof/CommonMark into nwellnhof-api_tests
Diffstat (limited to 'src/cmark.h')
-rw-r--r--src/cmark.h32
1 files changed, 27 insertions, 5 deletions
diff --git a/src/cmark.h b/src/cmark.h
index c5ddd5b..522e77e 100644
--- a/src/cmark.h
+++ b/src/cmark.h
@@ -56,8 +56,16 @@ typedef enum {
typedef struct cmark_node cmark_node;
typedef struct cmark_doc_parser cmark_doc_parser;
-CMARK_EXPORT cmark_node_type
-cmark_node_get_type(cmark_node *node);
+// Construction and destruction
+
+CMARK_EXPORT cmark_node*
+cmark_node_new(cmark_node_type type);
+
+CMARK_EXPORT void
+cmark_node_destroy(cmark_node *node);
+
+CMARK_EXPORT void
+cmark_free_nodes(cmark_node *e);
// Tree traversal
@@ -76,6 +84,23 @@ cmark_node_first_child(cmark_node *node);
CMARK_EXPORT cmark_node*
cmark_node_last_child(cmark_node *node);
+// Accessors
+
+CMARK_EXPORT cmark_node_type
+cmark_node_get_type(cmark_node *node);
+
+CMARK_EXPORT const char*
+cmark_node_get_content(cmark_node *node);
+
+CMARK_EXPORT int
+cmark_node_set_content(cmark_node *node, const char *content);
+
+CMARK_EXPORT const char*
+cmark_node_get_url(cmark_node *node);
+
+CMARK_EXPORT int
+cmark_node_set_url(cmark_node *node, const char *url);
+
// Tree manipulation
CMARK_EXPORT void
@@ -124,9 +149,6 @@ unsigned char *cmark_render_html(cmark_node *root);
CMARK_EXPORT
unsigned char *cmark_markdown_to_html(unsigned char *text, int len);
-CMARK_EXPORT
-void cmark_free_nodes(cmark_node *e);
-
#ifndef CMARK_NO_SHORT_NAMES
#define NODE_DOCUMENT CMARK_NODE_DOCUMENT
#define NODE_BQUOTE CMARK_NODE_BQUOTE