diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2014-11-28 15:51:40 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2014-11-28 16:13:57 +0100 |
commit | 170f2b6435a36f1e81132b4c11d30eb3e0b54975 (patch) | |
tree | 32d0c011e72ed33ac2b590211fdae52bd199cbfa | |
parent | 572608d158772cef6562b8c34f370fff98855174 (diff) |
Use prefixed names for symbols from inlines.h
-rw-r--r-- | src/blocks.c | 4 | ||||
-rw-r--r-- | src/inlines.c | 10 | ||||
-rw-r--r-- | src/inlines.h | 7 | ||||
-rw-r--r-- | src/references.c | 4 |
4 files changed, 9 insertions, 16 deletions
diff --git a/src/blocks.c b/src/blocks.c index 6f995b3..d955e68 100644 --- a/src/blocks.c +++ b/src/blocks.c @@ -184,7 +184,7 @@ static void finalize(cmark_doc_parser *parser, cmark_node* b, int line_number) case NODE_PARAGRAPH: pos = 0; while (strbuf_at(&b->string_content, 0) == '[' && - (pos = parse_reference_inline(&b->string_content, parser->refmap))) { + (pos = cmark_parse_reference_inline(&b->string_content, parser->refmap))) { strbuf_drop(&b->string_content, pos); } @@ -294,7 +294,7 @@ static void process_inlines(cmark_node* cur, reference_map *refmap) switch (cur->type) { case NODE_PARAGRAPH: case NODE_HEADER: - parse_inlines(cur, refmap); + cmark_parse_inlines(cur, refmap); break; default: diff --git a/src/inlines.c b/src/inlines.c index 060b536..c33cc84 100644 --- a/src/inlines.c +++ b/src/inlines.c @@ -514,7 +514,7 @@ static cmark_node *make_str_with_entities(chunk *content) // Clean a URL: remove surrounding whitespace and surrounding <>, // and remove \ that escape punctuation. -unsigned char *clean_url(chunk *url) +unsigned char *cmark_clean_url(chunk *url) { strbuf buf = GH_BUF_INIT; @@ -533,7 +533,7 @@ unsigned char *clean_url(chunk *url) return strbuf_detach(&buf); } -unsigned char *clean_title(chunk *title) +unsigned char *cmark_clean_title(chunk *title) { strbuf buf = GH_BUF_INIT; unsigned char first, last; @@ -703,8 +703,8 @@ static cmark_node* handle_close_bracket(subject* subj, cmark_node *parent) urlchunk = chunk_dup(&subj->input, starturl, endurl - starturl); titlechunk = chunk_dup(&subj->input, starttitle, endtitle - starttitle); - url = clean_url(&urlchunk); - title = clean_title(&titlechunk); + url = cmark_clean_url(&urlchunk); + title = cmark_clean_title(&titlechunk); chunk_free(&urlchunk); chunk_free(&titlechunk); goto match; @@ -933,7 +933,7 @@ static void spnl(subject* subj) // Modify refmap if a reference is encountered. // Return 0 if no reference found, otherwise position of subject // after reference is parsed. -int parse_reference_inline(strbuf *input, reference_map *refmap) +int cmark_parse_reference_inline(strbuf *input, reference_map *refmap) { subject subj; diff --git a/src/inlines.h b/src/inlines.h index 92b3b7a..d2ccfb4 100644 --- a/src/inlines.h +++ b/src/inlines.h @@ -12,13 +12,6 @@ void cmark_parse_inlines(cmark_node* parent, cmark_reference_map *refmap); int cmark_parse_reference_inline(cmark_strbuf *input, cmark_reference_map *refmap); -#ifndef CMARK_NO_SHORT_NAMES - #define parse_inlines cmark_parse_inlines - #define parse_reference_inline cmark_parse_reference_inline - #define clean_url cmark_clean_url - #define clean_title cmark_clean_title -#endif - #ifdef __cplusplus } #endif diff --git a/src/references.c b/src/references.c index 1738de1..33cea12 100644 --- a/src/references.c +++ b/src/references.c @@ -86,8 +86,8 @@ extern void reference_create(reference_map *map, chunk *label, chunk *url, chunk if(ref != NULL) { ref->label = reflabel; ref->hash = refhash(ref->label); - ref->url = clean_url(url); - ref->title = clean_title(title); + ref->url = cmark_clean_url(url); + ref->title = cmark_clean_title(title); ref->next = NULL; add_reference(map, ref); |