=================================================================== RCS file: /cvs/mandoc/html.c,v retrieving revision 1.4 retrieving revision 1.7 diff -u -p -r1.4 -r1.7 --- mandoc/html.c 2008/12/04 11:25:29 1.4 +++ mandoc/html.c 2008/12/05 11:28:16 1.7 @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.4 2008/12/04 11:25:29 kristaps Exp $ */ +/* $Id: html.c,v 1.7 2008/12/05 11:28:16 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -32,6 +32,19 @@ #include "ml.h" +struct htmlnode { + int type; + int *argc[ROFF_MAXLINEARG]; + char *argv[ROFF_MAXLINEARG]; + struct htmlnode *parent; +}; + + +struct htmlq { + struct htmlnode *last; +}; + + static int html_loadcss(struct md_mbuf *, const char *); static ssize_t html_endtag(struct md_mbuf *, @@ -46,28 +59,31 @@ static int html_begin(struct md_mbuf *, const struct tm *, const char *, const char *, const char *, const char *); +static int html_printargs(struct md_mbuf *, int, + const char *, const int *, + const char **, size_t *); static int html_end(struct md_mbuf *, const struct md_args *); -static ssize_t html_blocktagname(struct md_mbuf *, - const struct md_args *, int); -static ssize_t html_blocktagargs(struct md_mbuf *, +static int html_blocktagname(struct md_mbuf *, + const struct md_args *, int, size_t *); +static int html_blocktagargs(struct md_mbuf *, const struct md_args *, int, - const int *, const char **); -static ssize_t html_blockheadtagname(struct md_mbuf *, - const struct md_args *, int); -static ssize_t html_blockheadtagargs(struct md_mbuf *, + const int *, const char **, size_t *); +static int html_blockheadtagname(struct md_mbuf *, + const struct md_args *, int, size_t *); +static int html_blockheadtagargs(struct md_mbuf *, const struct md_args *, int, - const int *, const char **); -static ssize_t html_blockbodytagname(struct md_mbuf *, - const struct md_args *, int); -static ssize_t html_blockbodytagargs(struct md_mbuf *, + const int *, const char **, size_t *); +static int html_blockbodytagname(struct md_mbuf *, + const struct md_args *, int, size_t *); +static int html_blockbodytagargs(struct md_mbuf *, const struct md_args *, int, - const int *, const char **); -static ssize_t html_inlinetagname(struct md_mbuf *, - const struct md_args *, int); -static ssize_t html_inlinetagargs(struct md_mbuf *, + const int *, const char **, size_t *); +static int html_inlinetagname(struct md_mbuf *, + const struct md_args *, int, size_t *); +static int html_inlinetagargs(struct md_mbuf *, const struct md_args *, int, - const int *, const char **); + const int *, const char **, size_t *); static int @@ -163,7 +179,7 @@ html_begin(struct md_mbuf *mbuf, const struct md_args assert(args->params.html.css); if (HTML_CSS_EMBED & args->params.html.flags) { - if ( ! ml_puts(mbuf, "