=================================================================== RCS file: /cvs/mandoc/Attic/xml.c,v retrieving revision 1.11 retrieving revision 1.15 diff -u -p -r1.11 -r1.15 --- mandoc/Attic/xml.c 2008/12/03 19:21:58 1.11 +++ mandoc/Attic/xml.c 2008/12/05 17:43:14 1.15 @@ -1,4 +1,4 @@ -/* $Id: xml.c,v 1.11 2008/12/03 19:21:58 kristaps Exp $ */ +/* $Id: xml.c,v 1.15 2008/12/05 17:43:14 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -24,21 +24,28 @@ #include "ml.h" -static ssize_t xml_endtag(struct md_mbuf *, +static ssize_t xml_endtag(struct md_mbuf *, void *, const struct md_args *, enum md_ns, int); -static ssize_t xml_begintag(struct md_mbuf *, +static ssize_t xml_begintag(struct md_mbuf *, void *, const struct md_args *, enum md_ns, int, const int *, const char **); -static int xml_begin(struct md_mbuf *, - const struct md_args *); +static int xml_begin(struct md_mbuf *, + const struct md_args *, + const struct tm *, + const char *, const char *, + const char *, const char *); static int xml_end(struct md_mbuf *, const struct md_args *); +/* ARGSUSED */ static int -xml_begin(struct md_mbuf *mbuf, const struct md_args *args) +xml_begin(struct md_mbuf *mbuf, const struct md_args *args, + const struct tm *tm, const char *os, + const char *title, const char *section, + const char *vol) { size_t res; @@ -54,6 +61,7 @@ xml_begin(struct md_mbuf *mbuf, const struct md_args * } +/* ARGSUSED */ static int xml_end(struct md_mbuf *mbuf, const struct md_args *args) { @@ -67,13 +75,16 @@ xml_end(struct md_mbuf *mbuf, const struct md_args *ar } +/* ARGSUSED */ static ssize_t -xml_begintag(struct md_mbuf *mbuf, const struct md_args *args, - enum md_ns ns, int tok, - const int *argc, const char **argv) +xml_begintag(struct md_mbuf *mbuf, void *data, + const struct md_args *args, enum md_ns ns, + int tok, const int *argc, const char **argv) { size_t res; + /* FIXME: doesn't print arguments! */ + res = 0; switch (ns) { @@ -97,17 +108,17 @@ xml_begintag(struct md_mbuf *mbuf, const struct md_arg break; } - if ( ! ml_nputs(mbuf, toknames[tok], - strlen(toknames[tok]), &res)) + if ( ! ml_puts(mbuf, toknames[tok], &res)) return(-1); return((ssize_t)res); } +/* ARGSUSED */ static ssize_t -xml_endtag(struct md_mbuf *mbuf, const struct md_args *args, - enum md_ns ns, int tok) +xml_endtag(struct md_mbuf *mbuf, void *data, + const struct md_args *args, enum md_ns ns, int tok) { size_t res; @@ -134,8 +145,7 @@ xml_endtag(struct md_mbuf *mbuf, const struct md_args break; } - if ( ! ml_nputs(mbuf, toknames[tok], - strlen(toknames[tok]), &res)) + if ( ! ml_puts(mbuf, toknames[tok], &res)) return(-1); return((ssize_t)res); @@ -163,7 +173,7 @@ md_init_xml(const struct md_args *args, struct md_mbuf *mbuf, const struct md_rbuf *rbuf) { - return(mlg_alloc(args, rbuf, mbuf, xml_begintag, + return(mlg_alloc(args, NULL, rbuf, mbuf, xml_begintag, xml_endtag, xml_begin, xml_end)); }