Redo toc.c to add the new function mkd_toc(), which writes the

generate toc to a string.   Documented in `markdown.3`
and `mkd-functions.3`, requires a new file (`Csio.c`) that has
functions for writing to a Cstring, requires that some of the
internal functions in `generate.c` be exposed (and renaed to
`__mkd_`*function* to reduce namespace collisions.

The new functions in Csio (particularly `Csprintf()` should make
it easier to convert many of the other "we print to a `FILE*` and
you need to lump it" functions into a pair of "print to a string"
and "print to a file" functions.
This commit is contained in:
David Parsons
2009-02-27 16:47:02 -08:00
parent 99632b67e0
commit 9397c0a5c7
8 changed files with 143 additions and 38 deletions
+4
View File
@@ -50,6 +50,7 @@
*/
#define T(x) (x).text
#define S(x) (x).size
#define ALL(x) (x).alloc
/* abstract anchor type that defines a list base
* with a function that attaches an element to
@@ -65,4 +66,7 @@
typedef STRING(char) Cstring;
extern int Csputc(int, Cstring *);
extern int Csprintf(Cstring *, char *, ...);
#endif/*_CSTRING_D*/