=================================================================== RCS file: /cvs/docbook2mdoc/docbook2mdoc.c,v retrieving revision 1.30 retrieving revision 1.32 diff -u -p -r1.30 -r1.32 --- docbook2mdoc/docbook2mdoc.c 2014/04/02 12:12:41 1.30 +++ docbook2mdoc/docbook2mdoc.c 2014/04/30 09:04:40 1.32 @@ -1,4 +1,4 @@ -/* $Id: docbook2mdoc.c,v 1.30 2014/04/02 12:12:41 kristaps Exp $ */ +/* $Id: docbook2mdoc.c,v 1.32 2014/04/30 09:04:40 kristaps Exp $ */ /* * Copyright (c) 2014 Kristaps Dzonsons * @@ -96,6 +96,8 @@ static const struct node nodes[NODE__MAX] = { { "cmdsynopsis", NODE_IGNTEXT }, { "code", 0 }, { "command", 0 }, + { "constant", 0 }, + { "copyright", NODE_IGNTEXT }, { "date", 0 }, { "emphasis", 0 }, { "entry", 0 }, @@ -106,8 +108,10 @@ static const struct node nodes[NODE__MAX] = { { "funcsynopsis", NODE_IGNTEXT }, { "funcsynopsisinfo", 0 }, { "function", 0 }, - { "itemizedlist", NODE_IGNTEXT }, { "group", NODE_IGNTEXT }, + { "holder", NODE_IGNTEXT }, + { "info", NODE_IGNTEXT }, + { "itemizedlist", NODE_IGNTEXT }, { "link", 0 }, { "listitem", NODE_IGNTEXT }, { "literal", 0 }, @@ -159,6 +163,7 @@ static const struct node nodes[NODE__MAX] = { { "varname", 0 }, { "warning", NODE_IGNTEXT }, { "wordasword", 0 }, + { "year", NODE_IGNTEXT }, }; static void @@ -335,15 +340,17 @@ xml_elem_start(void *arg, const XML_Char *name, const if (0 == strcmp(*att, attrkeys[key])) break; if (ATTRKEY__MAX == key) { - fprintf(stderr, "%s:%zu:%zu: unknown " - "attribute \"%s\"\n", ps->fname, + fprintf(stderr, "%s:%zu:%zu: warning: " + "unknown attribute \"%s\"\n", + ps->fname, XML_GetCurrentLineNumber(ps->xml), XML_GetCurrentColumnNumber(ps->xml), *att); continue; } else if ( ! isattrkey(node, key)) { - fprintf(stderr, "%s:%zu:%zu: bad " - "attribute \"%s\"\n", ps->fname, + fprintf(stderr, "%s:%zu:%zu: warning: " + "bad attribute \"%s\"\n", + ps->fname, XML_GetCurrentLineNumber(ps->xml), XML_GetCurrentColumnNumber(ps->xml), *att); @@ -353,8 +360,9 @@ xml_elem_start(void *arg, const XML_Char *name, const if (0 == strcmp(*(att + 1), attrvals[val])) break; if (ATTRVAL__MAX != val && ! isattrval(key, val)) { - fprintf(stderr, "%s:%zu:%zu: bad " - "value \"%s\"\n", ps->fname, + fprintf(stderr, "%s:%zu:%zu: warning: " + "bad attribute value \"%s\"\n", + ps->fname, XML_GetCurrentLineNumber(ps->xml), XML_GetCurrentColumnNumber(ps->xml), *(att + 1)); @@ -518,6 +526,7 @@ pnode_findfirst(struct pnode *pn, enum nodeid node) #define MACROLINE_NORM 0 #define MACROLINE_UPPER 1 +#define MACROLINE_NOWS 2 /* * Recursively print text presumably on a macro line. * Convert all whitespace to regular spaces. @@ -527,7 +536,7 @@ pnode_printmacrolinetext(struct parse *p, struct pnode { char *cp; - if (0 == p->newln) + if (0 == p->newln && ! (MACROLINE_NOWS & fl)) putchar(' '); bufclear(p); @@ -781,7 +790,7 @@ pnode_printparamdef(struct parse *p, struct pnode *pn) fputs(".Fa \"", stdout); p->newln = 0; if (NULL != ptype) { - pnode_printmacrolinepart(p, ptype); + pnode_printmacrolinetext(p, ptype, MACROLINE_NOWS); putchar(' '); } @@ -1146,8 +1155,8 @@ pnode_print(struct parse *p, struct pnode *pn) /* Suppress non-text children... */ pnode_printmopen(p); fputs("Fa \"", stdout); - pnode_printmacrolinepart(p, pn); - puts("\""); + pnode_printmacrolinetext(p, pn, MACROLINE_NOWS); + fputs("\"", stdout); pnode_unlinksub(pn); break; case (NODE_QUOTE):