summaryrefslogtreecommitdiff
path: root/src/render.h
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-07-11 23:15:31 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-07-11 23:15:31 -0700
commit46330867a8d82bf45f2ea575b93c5f0d4496ca0c (patch)
treec9714d601dd593948ad3968d38b9b005bc2728e6 /src/render.h
parentc6460e00ea05da186e7d0ea7690b28f2b98a0ed9 (diff)
Restructured common renderer code.
* Added functions for cr, blankline, out to renderer object. * Removed lit (we'll handle this with a macro). * Changed type of out so it takes a regular string instead of a chunk. * Use macros LIT, OUT, BLANKLINE, CR in renderers to simplify code. (Not sure about this, but `renderer->out(renderer, ...)` sure is verbose.)
Diffstat (limited to 'src/render.h')
-rw-r--r--src/render.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/render.h b/src/render.h
index 718050e..cf5b078 100644
--- a/src/render.h
+++ b/src/render.h
@@ -32,21 +32,16 @@ struct cmark_renderer {
cmark_escaping,
int32_t,
unsigned char);
+ void (*cr)(struct cmark_renderer*);
+ void (*blankline)(struct cmark_renderer*);
+ void (*out)(struct cmark_renderer*,
+ const char *,
+ bool,
+ cmark_escaping);
};
typedef struct cmark_renderer cmark_renderer;
-void cr(cmark_renderer *renderer);
-
-void blankline(cmark_renderer *renderer);
-
-void out(cmark_renderer *renderer,
- cmark_chunk str,
- bool wrap,
- cmark_escaping escape);
-
-void lit(cmark_renderer *renderer, char *s, bool wrap);
-
char*
cmark_render(cmark_node *root,
int options,