[BACK]Return to docbook2mdoc.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / docbook2mdoc

Diff for /docbook2mdoc/docbook2mdoc.c between version 1.29 and 1.31

version 1.29, 2014/04/02 10:59:07 version 1.31, 2014/04/02 12:27:05
Line 88  static const char *attrvals[ATTRVAL__MAX] = {
Line 88  static const char *attrvals[ATTRVAL__MAX] = {
 static  const struct node nodes[NODE__MAX] = {  static  const struct node nodes[NODE__MAX] = {
         { NULL, 0 },          { NULL, 0 },
         { "acronym", 0 },          { "acronym", 0 },
           { "anchor", NODE_IGNTEXT },
         { "application", 0 },          { "application", 0 },
         { "arg", 0 },          { "arg", 0 },
         { "caution", NODE_IGNTEXT },          { "caution", NODE_IGNTEXT },
Line 139  static const struct node nodes[NODE__MAX] = {
Line 140  static const struct node nodes[NODE__MAX] = {
         { "row", NODE_IGNTEXT },          { "row", NODE_IGNTEXT },
         { "sbr", NODE_IGNTEXT },          { "sbr", NODE_IGNTEXT },
         { "screen", NODE_IGNTEXT },          { "screen", NODE_IGNTEXT },
           { "sgmltag", 0 },
         { "structname", 0 },          { "structname", 0 },
         { "synopsis", 0 },          { "synopsis", 0 },
         { "table", NODE_IGNTEXT },          { "table", NODE_IGNTEXT },
Line 156  static const struct node nodes[NODE__MAX] = {
Line 158  static const struct node nodes[NODE__MAX] = {
         { "varlistentry", NODE_IGNTEXT },          { "varlistentry", NODE_IGNTEXT },
         { "varname", 0 },          { "varname", 0 },
         { "warning", NODE_IGNTEXT },          { "warning", NODE_IGNTEXT },
           { "wordasword", 0 },
 };  };
   
 static void  static void
Line 332  xml_elem_start(void *arg, const XML_Char *name, const 
Line 335  xml_elem_start(void *arg, const XML_Char *name, const 
                         if (0 == strcmp(*att, attrkeys[key]))                          if (0 == strcmp(*att, attrkeys[key]))
                                 break;                                  break;
                 if (ATTRKEY__MAX == key) {                  if (ATTRKEY__MAX == key) {
                         fprintf(stderr, "%s:%zu:%zu: unknown "                          fprintf(stderr, "%s:%zu:%zu: warning: "
                                 "attribute \"%s\"\n", ps->fname,                                  "unknown attribute \"%s\"\n",
                                   ps->fname,
                                 XML_GetCurrentLineNumber(ps->xml),                                  XML_GetCurrentLineNumber(ps->xml),
                                 XML_GetCurrentColumnNumber(ps->xml),                                  XML_GetCurrentColumnNumber(ps->xml),
                                 *att);                                  *att);
                         continue;                          continue;
                 } else if ( ! isattrkey(node, key)) {                  } else if ( ! isattrkey(node, key)) {
                         fprintf(stderr, "%s:%zu:%zu: bad "                          fprintf(stderr, "%s:%zu:%zu: warning: "
                                 "attribute \"%s\"\n", ps->fname,                                  "bad attribute \"%s\"\n",
                                   ps->fname,
                                 XML_GetCurrentLineNumber(ps->xml),                                  XML_GetCurrentLineNumber(ps->xml),
                                 XML_GetCurrentColumnNumber(ps->xml),                                  XML_GetCurrentColumnNumber(ps->xml),
                                 *att);                                  *att);
Line 350  xml_elem_start(void *arg, const XML_Char *name, const 
Line 355  xml_elem_start(void *arg, const XML_Char *name, const 
                         if (0 == strcmp(*(att + 1), attrvals[val]))                          if (0 == strcmp(*(att + 1), attrvals[val]))
                                 break;                                  break;
                 if (ATTRVAL__MAX != val && ! isattrval(key, val)) {                  if (ATTRVAL__MAX != val && ! isattrval(key, val)) {
                         fprintf(stderr, "%s:%zu:%zu: bad "                          fprintf(stderr, "%s:%zu:%zu: warning: "
                                 "value \"%s\"\n", ps->fname,                                  "bad attribute value \"%s\"\n",
                                   ps->fname,
                                 XML_GetCurrentLineNumber(ps->xml),                                  XML_GetCurrentLineNumber(ps->xml),
                                 XML_GetCurrentColumnNumber(ps->xml),                                  XML_GetCurrentColumnNumber(ps->xml),
                                 *(att + 1));                                  *(att + 1));
Line 1065  pnode_print(struct parse *p, struct pnode *pn)
Line 1071  pnode_print(struct parse *p, struct pnode *pn)
                 pnode_printmopen(p);                  pnode_printmopen(p);
                 fputs("Nm", stdout);                  fputs("Nm", stdout);
                 break;                  break;
           case (NODE_ANCHOR):
                   /* Don't print anything! */
                   return;
         case (NODE_ARG):          case (NODE_ARG):
                 pnode_printarg(p, pn);                  pnode_printarg(p, pn);
                 pnode_unlinksub(pn);                  pnode_unlinksub(pn);
Line 1209  pnode_print(struct parse *p, struct pnode *pn)
Line 1218  pnode_print(struct parse *p, struct pnode *pn)
                 assert(p->newln);                  assert(p->newln);
                 puts(".br");                  puts(".br");
                 break;                  break;
           case (NODE_SGMLTAG):
                   pnode_printmopen(p);
                   fputs("Li", stdout);
                   break;
         case (NODE_STRUCTNAME):          case (NODE_STRUCTNAME):
                 pnode_printmopen(p);                  pnode_printmopen(p);
                 fputs("Vt", stdout);                  fputs("Vt", stdout);
Line 1296  pnode_print(struct parse *p, struct pnode *pn)
Line 1309  pnode_print(struct parse *p, struct pnode *pn)
         case (NODE_PARAMETER):          case (NODE_PARAMETER):
         case (NODE_REPLACEABLE):          case (NODE_REPLACEABLE):
         case (NODE_REFPURPOSE):          case (NODE_REFPURPOSE):
           case (NODE_SGMLTAG):
         case (NODE_STRUCTNAME):          case (NODE_STRUCTNAME):
         case (NODE_TEXT):          case (NODE_TEXT):
         case (NODE_USERINPUT):          case (NODE_USERINPUT):
Line 1358  readfile(XML_Parser xp, int fd, 
Line 1372  readfile(XML_Parser xp, int fd, 
   
         while ((ssz = read(fd, b, bsz)) >= 0) {          while ((ssz = read(fd, b, bsz)) >= 0) {
                 if (0 == (rc = XML_Parse(xp, b, ssz, 0 == ssz)))                  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_ErrorString
                                 (XML_GetErrorCode(xp)));                                  (XML_GetErrorCode(xp)));
                 else if ( ! p.stop && ssz > 0)                  else if ( ! p.stop && ssz > 0)

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.31

CVSweb