-static int
-roffblkin(void *arg, int tok, int *argc, char **argv)
-{
- struct md_xml *p;
- int i;
-
- assert(arg);
- p = (struct md_xml *)arg;
-
- if (0 != p->pos) {
- if ( ! mbuf_newline(p))
- return(0);
- if ( ! mbuf_indent(p))
- return(0);
- } else if ( ! mbuf_indent(p))
- return(0);
-
- if ( ! mbuf_nputs(p, "<", 1))
- return(0);
- if ( ! mbuf_nputs(p, "block:", 6))
- return(0);
- if ( ! mbuf_puts(p, toknames[tok]))
- return(0);
-
- /* FIXME: xml won't like standards args (e.g., p1003.1-90). */
-
- for (i = 0; ROFF_ARGMAX != argc[i]; i++) {
- if ( ! mbuf_nputs(p, " ", 1))
- return(0);
- if ( ! mbuf_puts(p, tokargnames[argc[i]]))
- return(0);
- if ( ! mbuf_nputs(p, "=\"", 2))
- return(0);
- if ( ! mbuf_putstring(p, argv[i] ? argv[i] : "true"))
- return(0);
- if ( ! mbuf_nputs(p, "\"", 1))
- return(0);
- }
-
- if ( ! mbuf_nputs(p, ">", 1))
- return(0);
-
- p->last = MD_BLKIN;
- p->indent++;
- return(mbuf_newline(p));
-}
-
-
-static int
-roffblkout(void *arg, int tok)
-{
- struct md_xml *p;
-
- assert(arg);
- p = (struct md_xml *)arg;
-
- p->indent--;
-
- if (0 != p->pos) {
- if ( ! mbuf_newline(p))
- return(0);
- if ( ! mbuf_indent(p))
- return(0);
- } else if ( ! mbuf_indent(p))
- return(0);
-
- if ( ! mbuf_nputs(p, "</", 2))
- return(0);
- if ( ! mbuf_nputs(p, "block:", 6))
- return(0);
- if ( ! mbuf_puts(p, toknames[tok]))
- return(0);
- if ( ! mbuf_nputs(p, ">", 1))
- return(0);
-
- p->last = MD_BLKOUT;
- return(mbuf_newline(p));
-}
-
-
-static int
-roffin(void *arg, int tok, int *argc, char **argv)