diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2014-11-16 21:56:49 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2014-11-16 22:43:04 +0100 |
commit | 675b92aa6b6c8124c8ccf9535e338fd37b8b9977 (patch) | |
tree | f3201e9ceb6fab30db8c97bcc01812ef341f97b9 /src/cmark.c | |
parent | 52045957a87f2c86f61f2054cafbebe050a1299b (diff) |
Move inline function definitions to header files
Inline functions must be defined in header files in order to be inlined in
other compilation units. This also fixes the MSVC build where out-of-line
versions weren't created and allows to remove the -fgnu89-inline flag.
Diffstat (limited to 'src/cmark.c')
-rw-r--r-- | src/cmark.c | 54 |
1 files changed, 1 insertions, 53 deletions
diff --git a/src/cmark.c b/src/cmark.c index f793499..e7f6899 100644 --- a/src/cmark.c +++ b/src/cmark.c @@ -73,20 +73,7 @@ void cmark_free_inlines(cmark_node_inl* e) } } -inline cmark_node_inl *cmark_make_link(cmark_node_inl *label, unsigned char *url, unsigned char *title) -{ - cmark_node_inl* e = (cmark_node_inl *)calloc(1, sizeof(*e)); - if(e != NULL) { - e->tag = CMARK_INL_LINK; - e->content.linkable.label = label; - e->content.linkable.url = url; - e->content.linkable.title = title; - e->next = NULL; - } - return e; -} - -unsigned char *clean_autolink(chunk *url, int is_email) +unsigned char *cmark_clean_autolink(chunk *url, int is_email) { strbuf buf = GH_BUF_INIT; @@ -102,45 +89,6 @@ unsigned char *clean_autolink(chunk *url, int is_email) return strbuf_detach(&buf); } -inline cmark_node_inl* cmark_make_autolink(cmark_node_inl* label, chunk url, int is_email) -{ - return cmark_make_link(label, clean_autolink(&url, is_email), NULL); -} - -inline cmark_node_inl* cmark_make_inlines(cmark_inl_tag t, cmark_node_inl* contents) -{ - cmark_node_inl * e = (cmark_node_inl *)calloc(1, sizeof(*e)); - if(e != NULL) { - e->tag = t; - e->content.inlines = contents; - e->next = NULL; - } - return e; -} - -// Create an inline with a literal string value. -inline cmark_node_inl* cmark_make_literal(cmark_inl_tag t, cmark_chunk s) -{ - cmark_node_inl * e = (cmark_node_inl *)calloc(1, sizeof(*e)); - if(e != NULL) { - e->tag = t; - e->content.literal = s; - e->next = NULL; - } - return e; -} - -// Create an inline with no value. -inline cmark_node_inl* cmark_make_simple(cmark_inl_tag t) -{ - cmark_node_inl* e = (cmark_node_inl *)calloc(1, sizeof(*e)); - if(e != NULL) { - e->tag = t; - e->next = NULL; - } - return e; -} - // Free a node_block list and any children. void cmark_free_blocks(cmark_node_block *e) { |