From d6077ea037e23f6e2c0d83dda7b5d7106f48d1a3 Mon Sep 17 00:00:00 2001
From: John MacFarlane ");
+ cmark_strbuf_puts(html, " ");
} else {
- strbuf_puts(html, "\n");
+ cmark_strbuf_puts(html, "
\n");
}
break;
@@ -96,17 +96,17 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
if (entering) {
cr(html);
if (list_type == CMARK_BULLET_LIST) {
- strbuf_puts(html, "\n");
} else {
cr(html);
- strbuf_puts(html, "
\n");
+ cmark_strbuf_puts(html, "\n");
+ cmark_strbuf_puts(html, "
\n");
}
else if (start == 1) {
- strbuf_puts(html, "
\n" : "\n");
}
@@ -116,9 +116,9 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
case CMARK_NODE_LIST_ITEM:
if (entering) {
cr(html);
- strbuf_puts(html, "\n");
+ cmark_strbuf_puts(html, "
\n");
}
else {
- strbuf_printf(html, "
\n",
+ cmark_strbuf_printf(html, "
\n",
start);
}
} else {
- strbuf_puts(html,
+ cmark_strbuf_puts(html,
list_type == CMARK_BULLET_LIST ?
"
");
+ cmark_strbuf_puts(html, "
\n");
break;
case CMARK_NODE_HTML:
cr(html);
- strbuf_put(html, node->as.literal.data, node->as.literal.len);
+ cmark_strbuf_put(html, node->as.literal.data, node->as.literal.len);
break;
case CMARK_NODE_HRULE:
cr(html);
- strbuf_puts(html, "");
}
else {
int first_tag = 0;
@@ -148,23 +148,23 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
first_tag += 1;
}
- strbuf_puts(html, "
\n");
+ cmark_strbuf_puts(html, "as.code.info.data, first_tag);
- strbuf_puts(html, "\">");
+ cmark_strbuf_puts(html, "\">");
}
escape_html(html, node->as.literal.data, node->as.literal.len);
- strbuf_puts(html, "
\n");
+ cmark_strbuf_puts(html, "
\n");
break;
case CMARK_NODE_PARAGRAPH:
@@ -179,9 +179,9 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
if (!tight) {
if (entering) {
cr(html);
- strbuf_puts(html, "
");
+ cmark_strbuf_puts(html, "");
escape_html(html, node->as.literal.data, node->as.literal.len);
- strbuf_puts(html, "
");
+ cmark_strbuf_puts(html, "
");
break;
case CMARK_NODE_INLINE_HTML:
- strbuf_put(html, node->as.literal.data, node->as.literal.len);
+ cmark_strbuf_put(html, node->as.literal.data, node->as.literal.len);
break;
case CMARK_NODE_STRONG:
if (entering) {
- strbuf_puts(html, "");
+ cmark_strbuf_puts(html, "");
} else {
- strbuf_puts(html, "");
+ cmark_strbuf_puts(html, "");
}
break;
case CMARK_NODE_EMPH:
if (entering) {
- strbuf_puts(html, "");
+ cmark_strbuf_puts(html, "");
} else {
- strbuf_puts(html, "");
+ cmark_strbuf_puts(html, "");
}
break;
case CMARK_NODE_LINK:
if (entering) {
- strbuf_puts(html, "as.link.url)
escape_href(html, node->as.link.url, -1);
if (node->as.link.title) {
- strbuf_puts(html, "\" title=\"");
+ cmark_strbuf_puts(html, "\" title=\"");
escape_html(html, node->as.link.title, -1);
}
- strbuf_puts(html, "\">");
+ cmark_strbuf_puts(html, "\">");
} else {
- strbuf_puts(html, "");
+ cmark_strbuf_puts(html, "");
}
break;
case CMARK_NODE_IMAGE:
if (entering) {
- strbuf_puts(html, "as.link.url)
escape_href(html, node->as.link.url, -1);
- strbuf_puts(html, "\" alt=\"");
+ cmark_strbuf_puts(html, "\" alt=\"");
state->plain = node;
} else {
if (node->as.link.title) {
- strbuf_puts(html, "\" title=\"");
+ cmark_strbuf_puts(html, "\" title=\"");
escape_html(html, node->as.link.title, -1);
}
- strbuf_puts(html, "\" />");
+ cmark_strbuf_puts(html, "\" />");
}
break;
@@ -265,14 +265,14 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
break;
}
- // strbuf_putc(html, 'x');
+ // cmark_strbuf_putc(html, 'x');
return 1;
}
char *cmark_render_html(cmark_node *root)
{
char *result;
- strbuf html = GH_BUF_INIT;
+ cmark_strbuf html = GH_BUF_INIT;
cmark_event_type ev_type;
cmark_node *cur;
struct render_state state = { &html, NULL };
@@ -282,9 +282,9 @@ char *cmark_render_html(cmark_node *root)
cur = cmark_iter_get_node(iter);
S_render_node(cur, ev_type, &state);
}
- result = (char *)strbuf_detach(&html);
+ result = (char *)cmark_strbuf_detach(&html);
cmark_iter_free(iter);
- strbuf_free(&html);
+ cmark_strbuf_free(&html);
return result;
}
diff --git a/src/inlines.c b/src/inlines.c
index 872a9c3..f63fabe 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -34,7 +34,7 @@ typedef struct delimiter {
} delimiter;
typedef struct {
- chunk input;
+ cmark_chunk input;
int pos;
cmark_reference_map *refmap;
delimiter *last_delim;
@@ -45,24 +45,24 @@ S_insert_emph(subject *subj, delimiter *opener, delimiter *closer);
static int parse_inline(subject* subj, cmark_node * parent);
-static void subject_from_buf(subject *e, strbuf *buffer,
+static void subject_from_buf(subject *e, cmark_strbuf *buffer,
cmark_reference_map *refmap);
static int subject_find_special_char(subject *subj);
-static unsigned char *cmark_clean_autolink(chunk *url, int is_email)
+static unsigned char *cmark_clean_autolink(cmark_chunk *url, int is_email)
{
- strbuf buf = GH_BUF_INIT;
+ cmark_strbuf buf = GH_BUF_INIT;
- chunk_trim(url);
+ cmark_chunk_trim(url);
if (url->len == 0)
return NULL;
if (is_email)
- strbuf_puts(&buf, "mailto:");
+ cmark_strbuf_puts(&buf, "mailto:");
houdini_unescape_html_f(&buf, url->data, url->len);
- return strbuf_detach(&buf);
+ return cmark_strbuf_detach(&buf);
}
static inline cmark_node *make_link(cmark_node *label, unsigned char *url, unsigned char *title)
@@ -80,13 +80,13 @@ static inline cmark_node *make_link(cmark_node *label, unsigned char *url, unsig
return e;
}
-static inline cmark_node* make_autolink(cmark_node* label, chunk url, int is_email)
+static inline cmark_node* make_autolink(cmark_node* label, cmark_chunk url, int is_email)
{
return make_link(label, cmark_clean_autolink(&url, is_email), NULL);
}
// Create an inline with a literal string value.
-static inline cmark_node* make_literal(cmark_node_type t, chunk s)
+static inline cmark_node* make_literal(cmark_node_type t, cmark_chunk s)
{
cmark_node * e = (cmark_node *)calloc(1, sizeof(*e));
if(e != NULL) {
@@ -139,7 +139,7 @@ static unsigned char *bufdup(const unsigned char *buf)
return new_buf;
}
-static void subject_from_buf(subject *e, strbuf *buffer,
+static void subject_from_buf(subject *e, cmark_strbuf *buffer,
cmark_reference_map *refmap)
{
e->input.data = buffer->ptr;
@@ -149,7 +149,7 @@ static void subject_from_buf(subject *e, strbuf *buffer,
e->refmap = refmap;
e->last_delim = NULL;
- chunk_rtrim(&e->input);
+ cmark_chunk_rtrim(&e->input);
}
static inline int isbacktick(int c)
@@ -177,7 +177,7 @@ static inline int is_eof(subject* subj)
#define advance(subj) (subj)->pos += 1
// Take characters while a predicate holds, and return a string.
-static inline chunk take_while(subject* subj, int (*f)(int))
+static inline cmark_chunk take_while(subject* subj, int (*f)(int))
{
unsigned char c;
int startpos = subj->pos;
@@ -188,7 +188,7 @@ static inline chunk take_while(subject* subj, int (*f)(int))
len++;
}
- return chunk_dup(&subj->input, startpos, len);
+ return cmark_chunk_dup(&subj->input, startpos, len);
}
// Try to process a backtick code span that began with a
@@ -221,7 +221,7 @@ static int scan_to_closing_backticks(subject* subj, int openticklength)
// Assumes that the subject has a backtick at the current position.
static cmark_node* handle_backticks(subject *subj)
{
- chunk openticks = take_while(subj, isbacktick);
+ cmark_chunk openticks = take_while(subj, isbacktick);
int startpos = subj->pos;
int endpos = scan_to_closing_backticks(subj, openticks.len);
@@ -229,13 +229,13 @@ static cmark_node* handle_backticks(subject *subj)
subj->pos = startpos; // rewind
return make_str(openticks);
} else {
- strbuf buf = GH_BUF_INIT;
+ cmark_strbuf buf = GH_BUF_INIT;
- strbuf_set(&buf, subj->input.data + startpos, endpos - startpos - openticks.len);
- strbuf_trim(&buf);
- strbuf_normalize_whitespace(&buf);
+ cmark_strbuf_set(&buf, subj->input.data + startpos, endpos - startpos - openticks.len);
+ cmark_strbuf_trim(&buf);
+ cmark_strbuf_normalize_whitespace(&buf);
- return make_code(chunk_buf_detach(&buf));
+ return make_code(cmark_chunk_buf_detach(&buf));
}
}
@@ -349,7 +349,7 @@ static cmark_node* handle_strong_emph(subject* subj, unsigned char c)
numdelims = scan_delims(subj, c, &can_open, &can_close);
- inl_text = make_str(chunk_dup(&subj->input, subj->pos - numdelims, numdelims));
+ inl_text = make_str(cmark_chunk_dup(&subj->input, subj->pos - numdelims, numdelims));
if (can_open || can_close) {
push_delimiter(subj, c, can_open, can_close, inl_text);
@@ -435,7 +435,7 @@ S_insert_emph(subject *subj, delimiter *opener, delimiter *closer)
// if opener has 0 characters, remove it and its associated inline
if (opener_num_chars == 0) {
// replace empty opener inline with emph
- chunk_free(&(opener_inl->as.literal));
+ cmark_chunk_free(&(opener_inl->as.literal));
emph = opener_inl;
emph->type = use_delims == 1 ? NODE_EMPH : NODE_STRONG;
// remove opener from list
@@ -483,12 +483,12 @@ static cmark_node* handle_backslash(subject *subj)
unsigned char nextchar = peek_char(subj);
if (ispunct(nextchar)) { // only ascii symbols and newline can be escaped
advance(subj);
- return make_str(chunk_dup(&subj->input, subj->pos - 1, 1));
+ return make_str(cmark_chunk_dup(&subj->input, subj->pos - 1, 1));
} else if (nextchar == '\n') {
advance(subj);
return make_linebreak();
} else {
- return make_str(chunk_literal("\\"));
+ return make_str(cmark_chunk_literal("\\"));
}
}
@@ -496,7 +496,7 @@ static cmark_node* handle_backslash(subject *subj)
// Assumes the subject has an '&' character at the current position.
static cmark_node* handle_entity(subject* subj)
{
- strbuf ent = GH_BUF_INIT;
+ cmark_strbuf ent = GH_BUF_INIT;
size_t len;
advance(subj);
@@ -507,20 +507,20 @@ static cmark_node* handle_entity(subject* subj)
);
if (len == 0)
- return make_str(chunk_literal("&"));
+ return make_str(cmark_chunk_literal("&"));
subj->pos += len;
- return make_str(chunk_buf_detach(&ent));
+ return make_str(cmark_chunk_buf_detach(&ent));
}
// Like make_str, but parses entities.
// Returns an inline sequence consisting of str and entity elements.
-static cmark_node *make_str_with_entities(chunk *content)
+static cmark_node *make_str_with_entities(cmark_chunk *content)
{
- strbuf unescaped = GH_BUF_INIT;
+ cmark_strbuf unescaped = GH_BUF_INIT;
if (houdini_unescape_html(&unescaped, content->data, (size_t)content->len)) {
- return make_str(chunk_buf_detach(&unescaped));
+ return make_str(cmark_chunk_buf_detach(&unescaped));
} else {
return make_str(*content);
}
@@ -528,11 +528,11 @@ static cmark_node *make_str_with_entities(chunk *content)
// Clean a URL: remove surrounding whitespace and surrounding <>,
// and remove \ that escape punctuation.
-unsigned char *cmark_clean_url(chunk *url)
+unsigned char *cmark_clean_url(cmark_chunk *url)
{
- strbuf buf = GH_BUF_INIT;
+ cmark_strbuf buf = GH_BUF_INIT;
- chunk_trim(url);
+ cmark_chunk_trim(url);
if (url->len == 0)
return NULL;
@@ -543,13 +543,13 @@ unsigned char *cmark_clean_url(chunk *url)
houdini_unescape_html_f(&buf, url->data, url->len);
}
- strbuf_unescape(&buf);
- return strbuf_detach(&buf);
+ cmark_strbuf_unescape(&buf);
+ return cmark_strbuf_detach(&buf);
}
-unsigned char *cmark_clean_title(chunk *title)
+unsigned char *cmark_clean_title(cmark_chunk *title)
{
- strbuf buf = GH_BUF_INIT;
+ cmark_strbuf buf = GH_BUF_INIT;
unsigned char first, last;
if (title->len == 0)
@@ -567,8 +567,8 @@ unsigned char *cmark_clean_title(chunk *title)
houdini_unescape_html_f(&buf, title->data, title->len);
}
- strbuf_unescape(&buf);
- return strbuf_detach(&buf);
+ cmark_strbuf_unescape(&buf);
+ return cmark_strbuf_detach(&buf);
}
// Parse an autolink or HTML tag.
@@ -576,14 +576,14 @@ unsigned char *cmark_clean_title(chunk *title)
static cmark_node* handle_pointy_brace(subject* subj)
{
int matchlen = 0;
- chunk contents;
+ cmark_chunk contents;
advance(subj); // advance past first <
// first try to match a URL autolink
matchlen = scan_autolink_uri(&subj->input, subj->pos);
if (matchlen > 0) {
- contents = chunk_dup(&subj->input, subj->pos, matchlen - 1);
+ contents = cmark_chunk_dup(&subj->input, subj->pos, matchlen - 1);
subj->pos += matchlen;
return make_autolink(
@@ -595,7 +595,7 @@ static cmark_node* handle_pointy_brace(subject* subj)
// next try to match an email autolink
matchlen = scan_autolink_email(&subj->input, subj->pos);
if (matchlen > 0) {
- contents = chunk_dup(&subj->input, subj->pos, matchlen - 1);
+ contents = cmark_chunk_dup(&subj->input, subj->pos, matchlen - 1);
subj->pos += matchlen;
return make_autolink(
@@ -607,20 +607,20 @@ static cmark_node* handle_pointy_brace(subject* subj)
// finally, try to match an html tag
matchlen = scan_html_tag(&subj->input, subj->pos);
if (matchlen > 0) {
- contents = chunk_dup(&subj->input, subj->pos - 1, matchlen + 1);
+ contents = cmark_chunk_dup(&subj->input, subj->pos - 1, matchlen + 1);
subj->pos += matchlen;
return make_raw_html(contents);
}
// if nothing matches, just return the opening <:
- return make_str(chunk_literal("<"));
+ return make_str(cmark_chunk_literal("<"));
}
// Parse a link label. Returns 1 if successful.
// Note: unescaped brackets are not allowed in labels.
// The label begins with `[` and ends with the first `]` character
// encountered. Backticks in labels do not start code spans.
-static int link_label(subject* subj, chunk *raw_label)
+static int link_label(subject* subj, cmark_chunk *raw_label)
{
int startpos = subj->pos;
int length = 0;
@@ -651,7 +651,7 @@ static int link_label(subject* subj, chunk *raw_label)
}
if (c == ']') { // match found
- *raw_label = chunk_dup(&subj->input, startpos + 1, subj->pos - (startpos + 1));
+ *raw_label = cmark_chunk_dup(&subj->input, startpos + 1, subj->pos - (startpos + 1));
advance(subj); // advance past ]
return 1;
}
@@ -671,13 +671,13 @@ static cmark_node* handle_close_bracket(subject* subj, cmark_node *parent)
int sps;
cmark_reference *ref;
bool is_image = false;
- chunk urlchunk, titlechunk;
+ cmark_chunk urlcmark_chunk, titlecmark_chunk;
unsigned char *url, *title;
delimiter *opener;
delimiter *tmp_delim;
cmark_node *link_text;
cmark_node *inl;
- chunk raw_label;
+ cmark_chunk raw_label;
int found_label;
advance(subj); // advance past ]
@@ -693,7 +693,7 @@ static cmark_node* handle_close_bracket(subject* subj, cmark_node *parent)
}
if (opener == NULL) {
- return make_str(chunk_literal("]"));
+ return make_str(cmark_chunk_literal("]"));
}
// If we got here, we matched a potential link/image text.
@@ -721,12 +721,12 @@ static cmark_node* handle_close_bracket(subject* subj, cmark_node *parent)
if (peek_at(subj, endall) == ')') {
subj->pos = endall + 1;
- urlchunk = chunk_dup(&subj->input, starturl, endurl - starturl);
- titlechunk = chunk_dup(&subj->input, starttitle, endtitle - starttitle);
- url = cmark_clean_url(&urlchunk);
- title = cmark_clean_title(&titlechunk);
- chunk_free(&urlchunk);
- chunk_free(&titlechunk);
+ urlcmark_chunk = cmark_chunk_dup(&subj->input, starturl, endurl - starturl);
+ titlecmark_chunk = cmark_chunk_dup(&subj->input, starttitle, endtitle - starttitle);
+ url = cmark_clean_url(&urlcmark_chunk);
+ title = cmark_clean_title(&titlecmark_chunk);
+ cmark_chunk_free(&urlcmark_chunk);
+ cmark_chunk_free(&titlecmark_chunk);
goto match;
} else {
@@ -737,11 +737,11 @@ static cmark_node* handle_close_bracket(subject* subj, cmark_node *parent)
// Next, look for a following [link label] that matches in refmap.
// skip spaces
subj->pos = subj->pos + scan_spacechars(&subj->input, subj->pos);
- raw_label = chunk_literal("");
+ raw_label = cmark_chunk_literal("");
found_label = link_label(subj, &raw_label);
if (!found_label || raw_label.len == 0) {
- chunk_free(&raw_label);
- raw_label = chunk_dup(&subj->input, opener->position,
+ cmark_chunk_free(&raw_label);
+ raw_label = cmark_chunk_dup(&subj->input, opener->position,
initial_pos - opener->position - 1);
}
@@ -752,7 +752,7 @@ static cmark_node* handle_close_bracket(subject* subj, cmark_node *parent)
}
ref = cmark_reference_lookup(subj->refmap, &raw_label);
- chunk_free(&raw_label);
+ cmark_chunk_free(&raw_label);
if (ref != NULL) { // found
url = bufdup(ref->url);
@@ -766,12 +766,12 @@ noMatch:
// If we fall through to here, it means we didn't match a link:
remove_delimiter(subj, opener); // remove this opener from delimiter list
subj->pos = initial_pos;
- return make_str(chunk_literal("]"));
+ return make_str(cmark_chunk_literal("]"));
match:
inl = opener->inl_text;
inl->type = is_image ? NODE_IMAGE : NODE_LINK;
- chunk_free(&inl->as.literal);
+ cmark_chunk_free(&inl->as.literal);
inl->first_child = link_text;
process_emphasis(subj, opener->previous);
inl->as.link.url = url;
@@ -863,7 +863,7 @@ static int subject_find_special_char(subject *subj)
static int parse_inline(subject* subj, cmark_node * parent)
{
cmark_node* new_inl = NULL;
- chunk contents;
+ cmark_chunk contents;
unsigned char c;
int endpos;
c = peek_char(subj);
@@ -892,7 +892,7 @@ static int parse_inline(subject* subj, cmark_node * parent)
break;
case '[':
advance(subj);
- new_inl = make_str(chunk_literal("["));
+ new_inl = make_str(cmark_chunk_literal("["));
push_delimiter(subj, '[', true, false, new_inl);
break;
case ']':
@@ -902,20 +902,20 @@ static int parse_inline(subject* subj, cmark_node * parent)
advance(subj);
if (peek_char(subj) == '[') {
advance(subj);
- new_inl = make_str(chunk_literal("!["));
+ new_inl = make_str(cmark_chunk_literal("!["));
push_delimiter(subj, '!', false, true, new_inl);
} else {
- new_inl = make_str(chunk_literal("!"));
+ new_inl = make_str(cmark_chunk_literal("!"));
}
break;
default:
endpos = subject_find_special_char(subj);
- contents = chunk_dup(&subj->input, subj->pos, endpos - subj->pos);
+ contents = cmark_chunk_dup(&subj->input, subj->pos, endpos - subj->pos);
subj->pos = endpos;
// if we're at a newline, strip trailing spaces.
if (peek_char(subj) == '\n') {
- chunk_rtrim(&contents);
+ cmark_chunk_rtrim(&contents);
}
new_inl = make_str(contents);
@@ -953,13 +953,13 @@ 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 cmark_parse_reference_inline(strbuf *input, cmark_reference_map *refmap)
+int cmark_parse_reference_inline(cmark_strbuf *input, cmark_reference_map *refmap)
{
subject subj;
- chunk lab;
- chunk url;
- chunk title;
+ cmark_chunk lab;
+ cmark_chunk url;
+ cmark_chunk title;
int matchlen = 0;
int beforetitle;
@@ -981,7 +981,7 @@ int cmark_parse_reference_inline(strbuf *input, cmark_reference_map *refmap)
spnl(&subj);
matchlen = scan_link_url(&subj.input, subj.pos);
if (matchlen) {
- url = chunk_dup(&subj.input, subj.pos, matchlen);
+ url = cmark_chunk_dup(&subj.input, subj.pos, matchlen);
subj.pos += matchlen;
} else {
return 0;
@@ -992,11 +992,11 @@ int cmark_parse_reference_inline(strbuf *input, cmark_reference_map *refmap)
spnl(&subj);
matchlen = scan_link_title(&subj.input, subj.pos);
if (matchlen) {
- title = chunk_dup(&subj.input, subj.pos, matchlen);
+ title = cmark_chunk_dup(&subj.input, subj.pos, matchlen);
subj.pos += matchlen;
} else {
subj.pos = beforetitle;
- title = chunk_literal("");
+ title = cmark_chunk_literal("");
}
// parse final spaces and newline:
while (peek_char(&subj) == ' ') {
diff --git a/src/inlines.h b/src/inlines.h
index b4897d7..d2ccfb4 100644
--- a/src/inlines.h
+++ b/src/inlines.h
@@ -5,12 +5,12 @@
extern "C" {
#endif
-unsigned char *cmark_clean_url(chunk *url);
-unsigned char *cmark_clean_title(chunk *title);
+unsigned char *cmark_clean_url(cmark_chunk *url);
+unsigned char *cmark_clean_title(cmark_chunk *title);
void cmark_parse_inlines(cmark_node* parent, cmark_reference_map *refmap);
-int cmark_parse_reference_inline(strbuf *input, cmark_reference_map *refmap);
+int cmark_parse_reference_inline(cmark_strbuf *input, cmark_reference_map *refmap);
#ifdef __cplusplus
}
diff --git a/src/man.c b/src/man.c
index 3f63d13..e72a121 100644
--- a/src/man.c
+++ b/src/man.c
@@ -10,7 +10,7 @@
// Functions to convert cmark_nodes to groff man strings.
-static void escape_man(strbuf *dest, const unsigned char *source, int length)
+static void escape_man(cmark_strbuf *dest, const unsigned char *source, int length)
{
int i;
unsigned char c;
@@ -18,27 +18,27 @@ static void escape_man(strbuf *dest, const unsigned char *source, int length)
for (i = 0; i < length; i++) {
c = source[i];
if (c == '.' && i == 0) {
- strbuf_puts(dest, "\\&.");
+ cmark_strbuf_puts(dest, "\\&.");
} else if (c == '\'' && i == 0) {
- strbuf_puts(dest, "\\&'");
+ cmark_strbuf_puts(dest, "\\&'");
} else if (c == '-') {
- strbuf_puts(dest, "\\-");
+ cmark_strbuf_puts(dest, "\\-");
} else if (c == '\\') {
- strbuf_puts(dest, "\\e");
+ cmark_strbuf_puts(dest, "\\e");
} else {
- strbuf_putc(dest, source[i]);
+ cmark_strbuf_putc(dest, source[i]);
}
}
}
-static inline void cr(strbuf *man)
+static inline void cr(cmark_strbuf *man)
{
if (man->size && man->ptr[man->size - 1] != '\n')
- strbuf_putc(man, '\n');
+ cmark_strbuf_putc(man, '\n');
}
struct render_state {
- strbuf* man;
+ cmark_strbuf* man;
cmark_node *plain;
};
@@ -47,7 +47,7 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
{
struct render_state *state = vstate;
cmark_node *tmp;
- strbuf *man = state->man;
+ cmark_strbuf *man = state->man;
int list_number;
bool entering = (ev_type == CMARK_EVENT_ENTER);
@@ -65,7 +65,7 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
case CMARK_NODE_LINEBREAK:
case CMARK_NODE_SOFTBREAK:
- strbuf_putc(man, ' ');
+ cmark_strbuf_putc(man, ' ');
break;
default:
@@ -81,11 +81,11 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
case CMARK_NODE_BLOCK_QUOTE:
if (entering) {
cr(man);
- strbuf_puts(man, ".RS");
+ cmark_strbuf_puts(man, ".RS");
cr(man);
} else {
cr(man);
- strbuf_puts(man, ".RE");
+ cmark_strbuf_puts(man, ".RE");
cr(man);
}
break;
@@ -96,10 +96,10 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
case CMARK_NODE_LIST_ITEM:
if (entering) {
cr(man);
- strbuf_puts(man, ".IP ");
+ cmark_strbuf_puts(man, ".IP ");
if (cmark_node_get_list_type(node->parent) ==
CMARK_BULLET_LIST) {
- strbuf_puts(man, "\\[bu] 2");
+ cmark_strbuf_puts(man, "\\[bu] 2");
} else {
list_number = cmark_node_get_list_start(node->parent);
tmp = node;
@@ -107,7 +107,7 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
tmp = tmp->prev;
list_number += 1;
}
- strbuf_printf(man, "\"%d.\" 4", list_number);
+ cmark_strbuf_printf(man, "\"%d.\" 4", list_number);
}
cr(man);
} else {
@@ -118,7 +118,7 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
case CMARK_NODE_HEADER:
if (entering) {
cr(man);
- strbuf_puts(man,
+ cmark_strbuf_puts(man,
cmark_node_get_header_level(node) == 1 ?
".SH" : ".SS");
cr(man);
@@ -129,11 +129,11 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
case CMARK_NODE_CODE_BLOCK:
cr(man);
- strbuf_puts(man, ".IP\n.nf\n\\f[C]\n");
+ cmark_strbuf_puts(man, ".IP\n.nf\n\\f[C]\n");
escape_man(man, node->as.literal.data,
node->as.literal.len);
cr(man);
- strbuf_puts(man, "\\f[]\n.fi");
+ cmark_strbuf_puts(man, "\\f[]\n.fi");
cr(man);
break;
@@ -142,7 +142,7 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
case CMARK_NODE_HRULE:
cr(man);
- strbuf_puts(man, ".PP\n * * * * *");
+ cmark_strbuf_puts(man, ".PP\n * * * * *");
cr(man);
break;
@@ -155,7 +155,7 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
// no blank line or .PP
} else {
cr(man);
- strbuf_puts(man, ".PP\n");
+ cmark_strbuf_puts(man, ".PP\n");
}
} else {
cr(man);
@@ -168,18 +168,18 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
break;
case CMARK_NODE_LINEBREAK:
- strbuf_puts(man, ".PD 0\n.P\n.PD");
+ cmark_strbuf_puts(man, ".PD 0\n.P\n.PD");
cr(man);
break;
case CMARK_NODE_SOFTBREAK:
- strbuf_putc(man, '\n');
+ cmark_strbuf_putc(man, '\n');
break;
case CMARK_NODE_CODE:
- strbuf_puts(man, "\\f[C]");
+ cmark_strbuf_puts(man, "\\f[C]");
escape_man(man, node->as.literal.data, node->as.literal.len);
- strbuf_puts(man, "\\f[]");
+ cmark_strbuf_puts(man, "\\f[]");
break;
case CMARK_NODE_INLINE_HTML:
@@ -187,33 +187,33 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
case CMARK_NODE_STRONG:
if (entering) {
- strbuf_puts(man, "\\f[B]");
+ cmark_strbuf_puts(man, "\\f[B]");
} else {
- strbuf_puts(man, "\\f[]");
+ cmark_strbuf_puts(man, "\\f[]");
}
break;
case CMARK_NODE_EMPH:
if (entering) {
- strbuf_puts(man, "\\f[I]");
+ cmark_strbuf_puts(man, "\\f[I]");
} else {
- strbuf_puts(man, "\\f[]");
+ cmark_strbuf_puts(man, "\\f[]");
}
break;
case CMARK_NODE_LINK:
if (!entering) {
- strbuf_printf(man, " (%s)",
+ cmark_strbuf_printf(man, " (%s)",
cmark_node_get_url(node));
}
break;
case CMARK_NODE_IMAGE:
if (entering) {
- strbuf_puts(man, "[IMAGE: ");
+ cmark_strbuf_puts(man, "[IMAGE: ");
state->plain = node;
} else {
- strbuf_puts(man, "]");
+ cmark_strbuf_puts(man, "]");
}
break;
@@ -222,14 +222,14 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate)
break;
}
- // strbuf_putc(man, 'x');
+ // cmark_strbuf_putc(man, 'x');
return 1;
}
char *cmark_render_man(cmark_node *root)
{
char *result;
- strbuf man = GH_BUF_INIT;
+ cmark_strbuf man = GH_BUF_INIT;
struct render_state state = { &man, NULL };
cmark_node *cur;
cmark_event_type ev_type;
@@ -239,9 +239,9 @@ char *cmark_render_man(cmark_node *root)
cur = cmark_iter_get_node(iter);
S_render_node(cur, ev_type, &state);
}
- result = (char *)strbuf_detach(&man);
+ result = (char *)cmark_strbuf_detach(&man);
cmark_iter_free(iter);
- strbuf_free(&man);
+ cmark_strbuf_free(&man);
return result;
}
diff --git a/src/node.c b/src/node.c
index 4c32548..8e74204 100644
--- a/src/node.c
+++ b/src/node.c
@@ -38,17 +38,17 @@ void S_free_nodes(cmark_node *e)
{
cmark_node *next;
while (e != NULL) {
- strbuf_free(&e->string_content);
+ cmark_strbuf_free(&e->string_content);
switch (e->type){
case NODE_CODE_BLOCK:
- chunk_free(&e->as.code.info);
- chunk_free(&e->as.literal);
+ cmark_chunk_free(&e->as.code.info);
+ cmark_chunk_free(&e->as.literal);
break;
case NODE_TEXT:
case NODE_INLINE_HTML:
case NODE_CODE:
case NODE_HTML:
- chunk_free(&e->as.literal);
+ cmark_chunk_free(&e->as.literal);
break;
case NODE_LINK:
case NODE_IMAGE:
@@ -188,7 +188,7 @@ cmark_node_get_literal(cmark_node *node) {
case NODE_TEXT:
case NODE_INLINE_HTML:
case NODE_CODE:
- return chunk_to_cstr(&node->as.literal);
+ return cmark_chunk_to_cstr(&node->as.literal);
default:
break;
@@ -209,7 +209,7 @@ cmark_node_set_literal(cmark_node *node, const char *content) {
case NODE_TEXT:
case NODE_INLINE_HTML:
case NODE_CODE:
- chunk_set_cstr(&node->as.literal, content);
+ cmark_chunk_set_cstr(&node->as.literal, content);
return 1;
default:
@@ -352,7 +352,7 @@ cmark_node_get_fence_info(cmark_node *node) {
}
if (node->type == NODE_CODE_BLOCK) {
- return chunk_to_cstr(&node->as.code.info);
+ return cmark_chunk_to_cstr(&node->as.code.info);
}
else {
return NULL;
@@ -366,7 +366,7 @@ cmark_node_set_fence_info(cmark_node *node, const char *info) {
}
if (node->type == NODE_CODE_BLOCK) {
- chunk_set_cstr(&node->as.code.info, info);
+ cmark_chunk_set_cstr(&node->as.code.info, info);
return 1;
}
else {
diff --git a/src/node.h b/src/node.h
index e5508b4..199f020 100644
--- a/src/node.h
+++ b/src/node.h
@@ -26,7 +26,7 @@ typedef struct {
int fence_length;
int fence_offset;
unsigned char fence_char;
- chunk info;
+ cmark_chunk info;
} cmark_code;
typedef struct {
@@ -54,10 +54,10 @@ struct cmark_node {
bool open;
bool last_line_blank;
- strbuf string_content;
+ cmark_strbuf string_content;
union {
- chunk literal;
+ cmark_chunk literal;
cmark_list list;
cmark_code code;
cmark_header header;
@@ -73,4 +73,3 @@ cmark_node_check(cmark_node *node, FILE *out);
#endif
#endif
-
diff --git a/src/parser.h b/src/parser.h
index 1f63d9c..9d65b67 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -16,8 +16,8 @@ struct cmark_parser {
struct cmark_node* root;
struct cmark_node* current;
int line_number;
- strbuf *curline;
- strbuf *linebuf;
+ cmark_strbuf *curline;
+ cmark_strbuf *linebuf;
};
#ifdef __cplusplus
diff --git a/src/print.c b/src/print.c
index 22daeac..cad1c1d 100644
--- a/src/print.c
+++ b/src/print.c
@@ -7,129 +7,129 @@
#define INDENT 2
-static void print_str(strbuf* buffer, const unsigned char *s, int len)
+static void print_str(cmark_strbuf* buffer, const unsigned char *s, int len)
{
int i;
if (len < 0)
len = strlen((char *)s);
- strbuf_putc(buffer, '"');
+ cmark_strbuf_putc(buffer, '"');
for (i = 0; i < len; ++i) {
unsigned char c = s[i];
switch (c) {
case '\n':
- strbuf_printf(buffer, "\\n");
+ cmark_strbuf_printf(buffer, "\\n");
break;
case '"':
- strbuf_printf(buffer, "\\\"");
+ cmark_strbuf_printf(buffer, "\\\"");
break;
case '\\':
- strbuf_printf(buffer, "\\\\");
+ cmark_strbuf_printf(buffer, "\\\\");
break;
default:
- strbuf_putc(buffer, (int)c);
+ cmark_strbuf_putc(buffer, (int)c);
}
}
- strbuf_putc(buffer, '"');
+ cmark_strbuf_putc(buffer, '"');
}
// Prettyprint an inline list, for debugging.
-static void render_nodes(strbuf* buffer, cmark_node* node, int indent)
+static void render_nodes(cmark_strbuf* buffer, cmark_node* node, int indent)
{
int i;
cmark_list *data;
while(node != NULL) {
for (i=0; i < indent; i++) {
- strbuf_putc(buffer, ' ');
+ cmark_strbuf_putc(buffer, ' ');
}
switch(node->type) {
case NODE_DOCUMENT:
break;
case NODE_BLOCK_QUOTE:
- strbuf_printf(buffer, "block_quote\n");
+ cmark_strbuf_printf(buffer, "block_quote\n");
break;
case NODE_LIST_ITEM:
- strbuf_printf(buffer, "list_item\n");
+ cmark_strbuf_printf(buffer, "list_item\n");
break;
case NODE_LIST:
data = &(node->as.list);
if (data->list_type == CMARK_ORDERED_LIST) {
- strbuf_printf(buffer, "list (type=ordered tight=%s start=%d delim=%s)\n",
+ cmark_strbuf_printf(buffer, "list (type=ordered tight=%s start=%d delim=%s)\n",
(data->tight ? "true" : "false"),
data->start,
(data->delimiter == CMARK_PAREN_DELIM ? "parens" : "period"));
} else {
- strbuf_printf(buffer, "list (type=bullet tight=%s bullet_char=%c)\n",
+ cmark_strbuf_printf(buffer, "list (type=bullet tight=%s bullet_char=%c)\n",
(data->tight ? "true" : "false"),
data->bullet_char);
}
break;
case NODE_HEADER:
- strbuf_printf(buffer, "header (level=%d)\n", node->as.header.level);
+ cmark_strbuf_printf(buffer, "header (level=%d)\n", node->as.header.level);
break;
case NODE_PARAGRAPH:
- strbuf_printf(buffer, "paragraph\n");
+ cmark_strbuf_printf(buffer, "paragraph\n");
break;
case NODE_HRULE:
- strbuf_printf(buffer, "hrule\n");
+ cmark_strbuf_printf(buffer, "hrule\n");
break;
case NODE_CODE_BLOCK:
- strbuf_printf(buffer, "code_block info=");
+ cmark_strbuf_printf(buffer, "code_block info=");
print_str(buffer, node->as.code.info.data,
node->as.code.info.len);
- strbuf_putc(buffer, ' ');
+ cmark_strbuf_putc(buffer, ' ');
print_str(buffer, node->as.literal.data,
node->as.literal.len);
- strbuf_putc(buffer, '\n');
+ cmark_strbuf_putc(buffer, '\n');
break;
case NODE_HTML:
- strbuf_printf(buffer, "html ");
+ cmark_strbuf_printf(buffer, "html ");
print_str(buffer, node->as.literal.data,
node->as.literal.len);
- strbuf_putc(buffer, '\n');
+ cmark_strbuf_putc(buffer, '\n');
break;
case NODE_TEXT:
- strbuf_printf(buffer, "text ");
+ cmark_strbuf_printf(buffer, "text ");
print_str(buffer, node->as.literal.data, node->as.literal.len);
- strbuf_putc(buffer, '\n');
+ cmark_strbuf_putc(buffer, '\n');
break;
case NODE_LINEBREAK:
- strbuf_printf(buffer, "linebreak\n");
+ cmark_strbuf_printf(buffer, "linebreak\n");
break;
case NODE_SOFTBREAK:
- strbuf_printf(buffer, "softbreak\n");
+ cmark_strbuf_printf(buffer, "softbreak\n");
break;
case NODE_CODE:
- strbuf_printf(buffer, "code ");
+ cmark_strbuf_printf(buffer, "code ");
print_str(buffer, node->as.literal.data, node->as.literal.len);
- strbuf_putc(buffer, '\n');
+ cmark_strbuf_putc(buffer, '\n');
break;
case NODE_INLINE_HTML:
- strbuf_printf(buffer, "inline_html ");
+ cmark_strbuf_printf(buffer, "inline_html ");
print_str(buffer, node->as.literal.data, node->as.literal.len);
- strbuf_putc(buffer, '\n');
+ cmark_strbuf_putc(buffer, '\n');
break;
case NODE_LINK:
case NODE_IMAGE:
- strbuf_printf(buffer, "%s url=", node->type == NODE_LINK ? "link" : "image");
+ cmark_strbuf_printf(buffer, "%s url=", node->type == NODE_LINK ? "link" : "image");
if (node->as.link.url)
print_str(buffer, node->as.link.url, -1);
if (node->as.link.title) {
- strbuf_printf(buffer, " title=");
+ cmark_strbuf_printf(buffer, " title=");
print_str(buffer, node->as.link.title, -1);
}
- strbuf_putc(buffer, '\n');
+ cmark_strbuf_putc(buffer, '\n');
break;
case NODE_STRONG:
- strbuf_printf(buffer, "strong\n");
+ cmark_strbuf_printf(buffer, "strong\n");
break;
case NODE_EMPH:
- strbuf_printf(buffer, "emph\n");
+ cmark_strbuf_printf(buffer, "emph\n");
break;
default:
break;
@@ -160,9 +160,9 @@ static void render_nodes(strbuf* buffer, cmark_node* node, int indent)
char *cmark_render_ast(cmark_node *root)
{
char* result;
- strbuf buffer = GH_BUF_INIT;
+ cmark_strbuf buffer = GH_BUF_INIT;
render_nodes(&buffer, root, -2);
- result = (char *)strbuf_detach(&buffer);
- strbuf_free(&buffer);
+ result = (char *)cmark_strbuf_detach(&buffer);
+ cmark_strbuf_free(&buffer);
return result;
}
diff --git a/src/references.c b/src/references.c
index 2b1d0a7..c9051f0 100644
--- a/src/references.c
+++ b/src/references.c
@@ -30,9 +30,9 @@ static void reference_free(cmark_reference *ref)
// remove leading/trailing whitespace, case fold
// Return NULL if the reference name is actually empty (i.e. composed
// solely from whitespace)
-static unsigned char *normalize_reference(chunk *ref)
+static unsigned char *normalize_reference(cmark_chunk *ref)
{
- strbuf normalized = GH_BUF_INIT;
+ cmark_strbuf normalized = GH_BUF_INIT;
unsigned char *result;
if(ref == NULL)
@@ -42,10 +42,10 @@ static unsigned char *normalize_reference(chunk *ref)
return NULL;
utf8proc_case_fold(&normalized, ref->data, ref->len);
- strbuf_trim(&normalized);
- strbuf_normalize_whitespace(&normalized);
+ cmark_strbuf_trim(&normalized);
+ cmark_strbuf_normalize_whitespace(&normalized);
- result = strbuf_detach(&normalized);
+ result = cmark_strbuf_detach(&normalized);
assert(result);
if (result[0] == '\0') {
@@ -73,8 +73,8 @@ static void add_reference(cmark_reference_map *map, cmark_reference* ref)
map->table[ref->hash % REFMAP_SIZE] = ref;
}
-void cmark_reference_create(cmark_reference_map *map, chunk *label, chunk *url,
- chunk *title)
+void cmark_reference_create(cmark_reference_map *map, cmark_chunk *label, cmark_chunk *url,
+ cmark_chunk *title)
{
cmark_reference *ref;
unsigned char *reflabel = normalize_reference(label);
@@ -97,7 +97,7 @@ void cmark_reference_create(cmark_reference_map *map, chunk *label, chunk *url,
// Returns reference if refmap contains a reference with matching
// label, otherwise NULL.
-cmark_reference* cmark_reference_lookup(cmark_reference_map *map, chunk *label)
+cmark_reference* cmark_reference_lookup(cmark_reference_map *map, cmark_chunk *label)
{
cmark_reference *ref = NULL;
unsigned char *norm;
diff --git a/src/references.h b/src/references.h
index 58658b6..69325bb 100644
--- a/src/references.h
+++ b/src/references.h
@@ -27,8 +27,8 @@ typedef struct cmark_reference_map cmark_reference_map;
cmark_reference_map *cmark_reference_map_new(void);
void cmark_reference_map_free(cmark_reference_map *map);
-cmark_reference* cmark_reference_lookup(cmark_reference_map *map, chunk *label);
-extern void cmark_reference_create(cmark_reference_map *map, chunk *label, chunk *url, chunk *title);
+cmark_reference* cmark_reference_lookup(cmark_reference_map *map, cmark_chunk *label);
+extern void cmark_reference_create(cmark_reference_map *map, cmark_chunk *label, cmark_chunk *url, cmark_chunk *title);
#ifdef __cplusplus
}
diff --git a/src/scanners.c b/src/scanners.c
index 6728c07..e5c4ef1 100644
--- a/src/scanners.c
+++ b/src/scanners.c
@@ -3,7 +3,7 @@
#include "chunk.h"
#include "scanners.h"
-int _scan_at(int (*scanner)(const unsigned char *), chunk *c, int offset)
+int _scan_at(int (*scanner)(const unsigned char *), cmark_chunk *c, int offset)
{
int res;
unsigned char *ptr = (unsigned char *)c->data;
diff --git a/src/scanners.h b/src/scanners.h
index aa5c00d..f360505 100644
--- a/src/scanners.h
+++ b/src/scanners.h
@@ -5,7 +5,7 @@
extern "C" {
#endif
-int _scan_at(int (*scanner)(const unsigned char *), chunk *c, int offset);
+int _scan_at(int (*scanner)(const unsigned char *), cmark_chunk *c, int offset);
int _scan_autolink_uri(const unsigned char *p);
int _scan_autolink_email(const unsigned char *p);
int _scan_html_tag(const unsigned char *p);
diff --git a/src/utf8.c b/src/utf8.c
index e4ea8e2..8e3c4bb 100644
--- a/src/utf8.c
+++ b/src/utf8.c
@@ -22,10 +22,10 @@ static const int8_t utf8proc_utf8class[256] = {
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0 };
-static void encode_unknown(strbuf *buf)
+static void encode_unknown(cmark_strbuf *buf)
{
static const uint8_t repl[] = {239, 191, 189};
- strbuf_put(buf, repl, 3);
+ cmark_strbuf_put(buf, repl, 3);
}
static int utf8proc_charlen(const uint8_t *str, int str_len)
@@ -109,7 +109,7 @@ static int utf8proc_valid(const uint8_t *str, int str_len)
return length;
}
-void utf8proc_detab(strbuf *ob, const uint8_t *line, size_t size)
+void utf8proc_detab(cmark_strbuf *ob, const uint8_t *line, size_t size)
{
static const uint8_t whitespace[] = " ";
@@ -124,21 +124,21 @@ void utf8proc_detab(strbuf *ob, const uint8_t *line, size_t size)
}
if (i > org)
- strbuf_put(ob, line + org, i - org);
+ cmark_strbuf_put(ob, line + org, i - org);
if (i >= size)
break;
if (line[i] == '\t') {
int numspaces = 4 - (tab % 4);
- strbuf_put(ob, whitespace, numspaces);
+ cmark_strbuf_put(ob, whitespace, numspaces);
i += 1;
tab += numspaces;
} else {
int charlen = utf8proc_valid(line + i, size - i);
if (charlen >= 0) {
- strbuf_put(ob, line + i, charlen);
+ cmark_strbuf_put(ob, line + i, charlen);
} else {
encode_unknown(ob);
charlen = -charlen;
@@ -188,7 +188,7 @@ int utf8proc_iterate(const uint8_t *str, int str_len, int32_t *dst)
return length;
}
-void utf8proc_encode_char(int32_t uc, strbuf *buf)
+void utf8proc_encode_char(int32_t uc, cmark_strbuf *buf)
{
uint8_t dst[4];
int len = 0;
@@ -224,10 +224,10 @@ void utf8proc_encode_char(int32_t uc, strbuf *buf)
return;
}
- strbuf_put(buf, dst, len);
+ cmark_strbuf_put(buf, dst, len);
}
-void utf8proc_case_fold(strbuf *dest, const uint8_t *str, int len)
+void utf8proc_case_fold(cmark_strbuf *dest, const uint8_t *str, int len)
{
int32_t c;
diff --git a/src/utf8.h b/src/utf8.h
index 9558576..7df1573 100644
--- a/src/utf8.h
+++ b/src/utf8.h
@@ -8,10 +8,10 @@
extern "C" {
#endif
-void utf8proc_case_fold(strbuf *dest, const uint8_t *str, int len);
-void utf8proc_encode_char(int32_t uc, strbuf *buf);
+void utf8proc_case_fold(cmark_strbuf *dest, const uint8_t *str, int len);
+void utf8proc_encode_char(int32_t uc, cmark_strbuf *buf);
int utf8proc_iterate(const uint8_t *str, int str_len, int32_t *dst);
-void utf8proc_detab(strbuf *dest, const uint8_t *line, size_t size);
+void utf8proc_detab(cmark_strbuf *dest, const uint8_t *line, size_t size);
int utf8proc_is_space(int32_t uc);
int utf8proc_is_punctuation(int32_t uc);
--
cgit v1.2.3