=================================================================== RCS file: /cvs/docbook2mdoc/docbook2mdoc.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -p -r1.29 -r1.30 --- docbook2mdoc/docbook2mdoc.c 2014/04/02 10:59:07 1.29 +++ docbook2mdoc/docbook2mdoc.c 2014/04/02 12:12:41 1.30 @@ -1,4 +1,4 @@ -/* $Id: docbook2mdoc.c,v 1.29 2014/04/02 10:59:07 kristaps Exp $ */ +/* $Id: docbook2mdoc.c,v 1.30 2014/04/02 12:12:41 kristaps Exp $ */ /* * Copyright (c) 2014 Kristaps Dzonsons * @@ -88,6 +88,7 @@ static const char *attrvals[ATTRVAL__MAX] = { static const struct node nodes[NODE__MAX] = { { NULL, 0 }, { "acronym", 0 }, + { "anchor", NODE_IGNTEXT }, { "application", 0 }, { "arg", 0 }, { "caution", NODE_IGNTEXT }, @@ -139,6 +140,7 @@ static const struct node nodes[NODE__MAX] = { { "row", NODE_IGNTEXT }, { "sbr", NODE_IGNTEXT }, { "screen", NODE_IGNTEXT }, + { "sgmltag", 0 }, { "structname", 0 }, { "synopsis", 0 }, { "table", NODE_IGNTEXT }, @@ -156,6 +158,7 @@ static const struct node nodes[NODE__MAX] = { { "varlistentry", NODE_IGNTEXT }, { "varname", 0 }, { "warning", NODE_IGNTEXT }, + { "wordasword", 0 }, }; static void @@ -1065,6 +1068,9 @@ pnode_print(struct parse *p, struct pnode *pn) pnode_printmopen(p); fputs("Nm", stdout); break; + case (NODE_ANCHOR): + /* Don't print anything! */ + return; case (NODE_ARG): pnode_printarg(p, pn); pnode_unlinksub(pn); @@ -1209,6 +1215,10 @@ pnode_print(struct parse *p, struct pnode *pn) assert(p->newln); puts(".br"); break; + case (NODE_SGMLTAG): + pnode_printmopen(p); + fputs("Li", stdout); + break; case (NODE_STRUCTNAME): pnode_printmopen(p); fputs("Vt", stdout); @@ -1296,6 +1306,7 @@ pnode_print(struct parse *p, struct pnode *pn) case (NODE_PARAMETER): case (NODE_REPLACEABLE): case (NODE_REFPURPOSE): + case (NODE_SGMLTAG): case (NODE_STRUCTNAME): case (NODE_TEXT): case (NODE_USERINPUT): @@ -1358,7 +1369,9 @@ readfile(XML_Parser xp, int fd, while ((ssz = read(fd, b, bsz)) >= 0) { if (0 == (rc = XML_Parse(xp, b, ssz, 0 == ssz))) - fprintf(stderr, "%s: %s\n", fn, + fprintf(stderr, "%s:%zu:%zu: %s\n", fn, + XML_GetCurrentLineNumber(xp), + XML_GetCurrentColumnNumber(xp), XML_ErrorString (XML_GetErrorCode(xp))); else if ( ! p.stop && ssz > 0)