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

Diff for /docbook2mdoc/docbook2mdoc.c between version 1.30 and 1.33

version 1.30, 2014/04/02 12:12:41 version 1.33, 2014/04/30 09:26:10
Line 96  static const struct node nodes[NODE__MAX] = {
Line 96  static const struct node nodes[NODE__MAX] = {
         { "cmdsynopsis", NODE_IGNTEXT },          { "cmdsynopsis", NODE_IGNTEXT },
         { "code", 0 },          { "code", 0 },
         { "command", 0 },          { "command", 0 },
           { "constant", 0 },
           { "copyright", NODE_IGNTEXT },
         { "date", 0 },          { "date", 0 },
         { "emphasis", 0 },          { "emphasis", 0 },
         { "entry", 0 },          { "entry", 0 },
Line 106  static const struct node nodes[NODE__MAX] = {
Line 108  static const struct node nodes[NODE__MAX] = {
         { "funcsynopsis", NODE_IGNTEXT },          { "funcsynopsis", NODE_IGNTEXT },
         { "funcsynopsisinfo", 0 },          { "funcsynopsisinfo", 0 },
         { "function", 0 },          { "function", 0 },
         { "itemizedlist", NODE_IGNTEXT },  
         { "group", NODE_IGNTEXT },          { "group", NODE_IGNTEXT },
           { "holder", NODE_IGNTEXT },
           { "info", NODE_IGNTEXT },
           { "itemizedlist", NODE_IGNTEXT },
         { "link", 0 },          { "link", 0 },
         { "listitem", NODE_IGNTEXT },          { "listitem", NODE_IGNTEXT },
         { "literal", 0 },          { "literal", 0 },
Line 152  static const struct node nodes[NODE__MAX] = {
Line 156  static const struct node nodes[NODE__MAX] = {
         { "thead", NODE_IGNTEXT },          { "thead", NODE_IGNTEXT },
         { "tip", NODE_IGNTEXT },          { "tip", NODE_IGNTEXT },
         { "title", 0 },          { "title", 0 },
           { "trademark", 0 },
         { "ulink", 0 },          { "ulink", 0 },
         { "userinput", 0 },          { "userinput", 0 },
         { "variablelist", NODE_IGNTEXT },          { "variablelist", NODE_IGNTEXT },
Line 159  static const struct node nodes[NODE__MAX] = {
Line 164  static const struct node nodes[NODE__MAX] = {
         { "varname", 0 },          { "varname", 0 },
         { "warning", NODE_IGNTEXT },          { "warning", NODE_IGNTEXT },
         { "wordasword", 0 },          { "wordasword", 0 },
           { "year", NODE_IGNTEXT },
 };  };
   
 static void  static void
Line 335  xml_elem_start(void *arg, const XML_Char *name, const 
Line 341  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 353  xml_elem_start(void *arg, const XML_Char *name, const 
Line 361  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 518  pnode_findfirst(struct pnode *pn, enum nodeid node)
Line 527  pnode_findfirst(struct pnode *pn, enum nodeid node)
   
 #define MACROLINE_NORM  0  #define MACROLINE_NORM  0
 #define MACROLINE_UPPER 1  #define MACROLINE_UPPER 1
   #define MACROLINE_NOWS 2
 /*  /*
  * Recursively print text presumably on a macro line.   * Recursively print text presumably on a macro line.
  * Convert all whitespace to regular spaces.   * Convert all whitespace to regular spaces.
Line 527  pnode_printmacrolinetext(struct parse *p, struct pnode
Line 537  pnode_printmacrolinetext(struct parse *p, struct pnode
 {  {
         char            *cp;          char            *cp;
   
         if (0 == p->newln)          if (0 == p->newln && ! (MACROLINE_NOWS & fl))
                 putchar(' ');                  putchar(' ');
   
         bufclear(p);          bufclear(p);
Line 781  pnode_printparamdef(struct parse *p, struct pnode *pn)
Line 791  pnode_printparamdef(struct parse *p, struct pnode *pn)
         fputs(".Fa \"", stdout);          fputs(".Fa \"", stdout);
         p->newln = 0;          p->newln = 0;
         if (NULL != ptype) {          if (NULL != ptype) {
                 pnode_printmacrolinepart(p, ptype);                  pnode_printmacrolinetext(p, ptype, MACROLINE_NOWS);
                 putchar(' ');                  putchar(' ');
         }          }
   
Line 935  pnode_printvarlistentry(struct parse *p, struct pnode 
Line 945  pnode_printvarlistentry(struct parse *p, struct pnode 
         assert(p->newln);          assert(p->newln);
         TAILQ_FOREACH(pp, &pn->childq, child)          TAILQ_FOREACH(pp, &pn->childq, child)
                 if (NODE_TERM == pp->node) {                  if (NODE_TERM == pp->node) {
                           assert(p->newln);
                         fputs(".It", stdout);                          fputs(".It", stdout);
                         p->newln = 0;                          p->newln = 0;
                         pnode_print(p, pp);                          pnode_print(p, pp);
Line 1088  pnode_print(struct parse *p, struct pnode *pn)
Line 1099  pnode_print(struct parse *p, struct pnode *pn)
                 pnode_printmopen(p);                  pnode_printmopen(p);
                 fputs("Nm", stdout);                  fputs("Nm", stdout);
                 break;                  break;
           case (NODE_CONSTANT):
                   pnode_printmopen(p);
                   fputs("Dv", stdout);
                   break;
         case (NODE_EMPHASIS):          case (NODE_EMPHASIS):
                 pnode_printmopen(p);                  pnode_printmopen(p);
                 fputs("Em", stdout);                  fputs("Em", stdout);
Line 1146  pnode_print(struct parse *p, struct pnode *pn)
Line 1161  pnode_print(struct parse *p, struct pnode *pn)
                 /* Suppress non-text children... */                  /* Suppress non-text children... */
                 pnode_printmopen(p);                  pnode_printmopen(p);
                 fputs("Fa \"", stdout);                  fputs("Fa \"", stdout);
                 pnode_printmacrolinepart(p, pn);                  pnode_printmacrolinetext(p, pn, MACROLINE_NOWS);
                 puts("\"");                  fputs("\"", stdout);
                 pnode_unlinksub(pn);                  pnode_unlinksub(pn);
                 break;                  break;
         case (NODE_QUOTE):          case (NODE_QUOTE):
Line 1296  pnode_print(struct parse *p, struct pnode *pn)
Line 1311  pnode_print(struct parse *p, struct pnode *pn)
         case (NODE_ARG):          case (NODE_ARG):
         case (NODE_CODE):          case (NODE_CODE):
         case (NODE_COMMAND):          case (NODE_COMMAND):
           case (NODE_CONSTANT):
         case (NODE_EMPHASIS):          case (NODE_EMPHASIS):
         case (NODE_ENVAR):          case (NODE_ENVAR):
         case (NODE_FILENAME):          case (NODE_FILENAME):

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.33

CVSweb