mirror of
https://github.com/Orc/discount.git
synced 2026-09-25 04:10:00 +03:00
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:
@@ -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*/
|
||||
|
||||
Reference in New Issue
Block a user