summaryrefslogtreecommitdiff
path: root/src/ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast.h')
-rw-r--r--src/ast.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ast.h b/src/ast.h
index b4427c0..263b9cb 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -128,6 +128,27 @@ struct cmark_doc_parser {
cmark_strbuf *curline;
};
+struct cmark_node_inl *cmark_make_link(struct cmark_node_inl *label, unsigned char *url, unsigned char *title);
+
+struct cmark_node_inl* cmark_make_autolink(struct cmark_node_inl* label, cmark_chunk url, int is_email);
+
+struct cmark_node_inl* cmark_make_inlines(int t, struct cmark_node_inl* contents);
+
+struct cmark_node_inl* cmark_make_literal(int t, cmark_chunk s);
+
+struct cmark_node_inl* cmark_make_simple(int t);
+
+// Macros for creating various kinds of simple.
+#define cmark_make_str(s) cmark_make_literal(INL_STRING, s)
+#define cmark_make_code(s) cmark_make_literal(INL_CODE, s)
+#define cmark_make_raw_html(s) cmark_make_literal(INL_RAW_HTML, s)
+#define cmark_make_linebreak() cmark_make_simple(INL_LINEBREAK)
+#define cmark_make_softbreak() cmark_make_simple(INL_SOFTBREAK)
+#define cmark_make_emph(contents) cmark_make_inlines(INL_EMPH, contents)
+#define cmark_make_strong(contents) cmark_make_inlines(INL_STRONG, contents)
+
+
+
#ifndef CMARK_NO_SHORT_NAMES
#define node_inl cmark_node_inl
#define INL_STRING CMARK_INL_STRING
@@ -154,6 +175,18 @@ struct cmark_doc_parser {
#define BLOCK_SETEXT_HEADER CMARK_BLOCK_SETEXT_HEADER
#define BLOCK_HRULE CMARK_BLOCK_HRULE
#define BLOCK_REFERENCE_DEF CMARK_BLOCK_REFERENCE_DEF
+ #define make_link cmark_make_link
+ #define make_autolink cmark_make_autolink
+ #define make_str cmark_make_str
+ #define make_code cmark_make_code
+ #define make_raw_html cmark_make_raw_html
+ #define make_linebreak cmark_make_linebreak
+ #define make_softbreak cmark_make_softbreak
+ #define make_emph cmark_make_emph
+ #define make_strong cmark_make_strong
+ #define make_simple cmark_make_simple
+ #define make_literal cmark_make_literal
+ #define make_inlines cmark_make_inlines
#endif
#ifdef __cplusplus