API-v2: Rename hoedown_callbacks to hoedown_renderer
This commit is contained in:
parent
7ebc80adc1
commit
6d3acbd672
5 changed files with 16 additions and 16 deletions
|
@ -15,7 +15,7 @@ main(int argc, char **argv)
|
|||
hoedown_buffer *ib, *ob;
|
||||
FILE *in = stdin;
|
||||
|
||||
hoedown_callbacks callbacks;
|
||||
hoedown_renderer callbacks;
|
||||
hoedown_html_renderopt options;
|
||||
struct hoedown_markdown *markdown;
|
||||
|
||||
|
|
12
src/html.c
12
src/html.c
|
@ -660,9 +660,9 @@ toc_finalize(hoedown_buffer *ob, void *opaque)
|
|||
}
|
||||
|
||||
void
|
||||
hoedown_html_toc_renderer(hoedown_callbacks *callbacks, hoedown_html_renderopt *options, int nesting_level)
|
||||
hoedown_html_toc_renderer(hoedown_renderer *callbacks, hoedown_html_renderopt *options, int nesting_level)
|
||||
{
|
||||
static const hoedown_callbacks cb_default = {
|
||||
static const hoedown_renderer cb_default = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -700,7 +700,7 @@ hoedown_html_toc_renderer(hoedown_callbacks *callbacks, hoedown_html_renderopt *
|
|||
toc_finalize,
|
||||
};
|
||||
|
||||
memcpy(callbacks, &cb_default, sizeof(hoedown_callbacks));
|
||||
memcpy(callbacks, &cb_default, sizeof(hoedown_renderer));
|
||||
|
||||
memset(options, 0, sizeof(hoedown_html_renderopt));
|
||||
|
||||
|
@ -711,9 +711,9 @@ hoedown_html_toc_renderer(hoedown_callbacks *callbacks, hoedown_html_renderopt *
|
|||
}
|
||||
|
||||
void
|
||||
hoedown_html_renderer(hoedown_callbacks *callbacks, hoedown_html_renderopt *options, unsigned int render_flags, int nesting_level)
|
||||
hoedown_html_renderer(hoedown_renderer *callbacks, hoedown_html_renderopt *options, unsigned int render_flags, int nesting_level)
|
||||
{
|
||||
static const hoedown_callbacks cb_default = {
|
||||
static const hoedown_renderer cb_default = {
|
||||
rndr_blockcode,
|
||||
rndr_blockquote,
|
||||
rndr_raw_block,
|
||||
|
@ -761,7 +761,7 @@ hoedown_html_renderer(hoedown_callbacks *callbacks, hoedown_html_renderopt *opti
|
|||
}
|
||||
|
||||
/* Prepare the callbacks */
|
||||
memcpy(callbacks, &cb_default, sizeof(hoedown_callbacks));
|
||||
memcpy(callbacks, &cb_default, sizeof(hoedown_renderer));
|
||||
|
||||
if (render_flags & HOEDOWN_HTML_SKIP_IMAGES)
|
||||
callbacks->image = NULL;
|
||||
|
|
|
@ -50,10 +50,10 @@ int
|
|||
hoedown_html_is_tag(const uint8_t *tag_data, size_t tag_size, const char *tagname);
|
||||
|
||||
extern void
|
||||
hoedown_html_renderer(hoedown_callbacks *callbacks, hoedown_html_renderopt *options, unsigned int render_flags, int nesting_level);
|
||||
hoedown_html_renderer(hoedown_renderer *callbacks, hoedown_html_renderopt *options, unsigned int render_flags, int nesting_level);
|
||||
|
||||
extern void
|
||||
hoedown_html_toc_renderer(hoedown_callbacks *callbacks, hoedown_html_renderopt *options, int nesting_level);
|
||||
hoedown_html_toc_renderer(hoedown_renderer *callbacks, hoedown_html_renderopt *options, int nesting_level);
|
||||
|
||||
extern void
|
||||
hoedown_html_smartypants(hoedown_buffer *ob, const uint8_t *text, size_t size);
|
||||
|
|
|
@ -113,7 +113,7 @@ static char_trigger markdown_char_ptrs[] = {
|
|||
|
||||
/* render • structure containing one particular render */
|
||||
struct hoedown_markdown {
|
||||
hoedown_callbacks cb;
|
||||
hoedown_renderer cb;
|
||||
void *opaque;
|
||||
|
||||
struct link_ref *refs[REF_TABLE_SIZE];
|
||||
|
@ -2706,7 +2706,7 @@ hoedown_markdown *
|
|||
hoedown_markdown_new(
|
||||
unsigned int extensions,
|
||||
size_t max_nesting,
|
||||
const hoedown_callbacks *callbacks,
|
||||
const hoedown_renderer *callbacks,
|
||||
void *opaque)
|
||||
{
|
||||
hoedown_markdown *md = NULL;
|
||||
|
@ -2717,7 +2717,7 @@ hoedown_markdown_new(
|
|||
if (!md)
|
||||
return NULL;
|
||||
|
||||
memcpy(&md->cb, callbacks, sizeof(hoedown_callbacks));
|
||||
memcpy(&md->cb, callbacks, sizeof(hoedown_renderer));
|
||||
|
||||
hoedown_stack_new(&md->work_bufs[BUFFER_BLOCK], 4);
|
||||
hoedown_stack_new(&md->work_bufs[BUFFER_SPAN], 8);
|
||||
|
|
|
@ -50,8 +50,8 @@ enum hoedown_extensions {
|
|||
HOEDOWN_EXT_QUOTE = (1 << 12)
|
||||
};
|
||||
|
||||
/* hoedown_callbacks - functions for rendering parsed data */
|
||||
struct hoedown_callbacks {
|
||||
/* hoedown_renderer - functions for rendering parsed data */
|
||||
struct hoedown_renderer {
|
||||
/* block level callbacks - NULL skips the block */
|
||||
void (*blockcode)(hoedown_buffer *ob, const hoedown_buffer *text, const hoedown_buffer *lang, void *opaque);
|
||||
void (*blockquote)(hoedown_buffer *ob, const hoedown_buffer *text, void *opaque);
|
||||
|
@ -93,7 +93,7 @@ struct hoedown_callbacks {
|
|||
void (*doc_footer)(hoedown_buffer *ob, void *opaque);
|
||||
};
|
||||
|
||||
typedef struct hoedown_callbacks hoedown_callbacks;
|
||||
typedef struct hoedown_renderer hoedown_renderer;
|
||||
|
||||
struct hoedown_markdown;
|
||||
|
||||
|
@ -115,7 +115,7 @@ extern hoedown_markdown *
|
|||
hoedown_markdown_new(
|
||||
unsigned int extensions,
|
||||
size_t max_nesting,
|
||||
const hoedown_callbacks *callbacks,
|
||||
const hoedown_renderer *callbacks,
|
||||
void *opaque);
|
||||
|
||||
extern void
|
||||
|
|
Loading…
Reference in a new issue