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

Diff for /docbook2mdoc/docbook2mdoc.c between version 1.23 and 1.24

version 1.23, 2014/03/30 17:46:17 version 1.24, 2014/03/30 18:15:55
Line 103  static const struct node nodes[NODE__MAX] = {
Line 103  static const struct node nodes[NODE__MAX] = {
         { "funcsynopsisinfo", 0 },          { "funcsynopsisinfo", 0 },
         { "function", 0 },          { "function", 0 },
         { "itemizedlist", NODE_IGNTEXT },          { "itemizedlist", NODE_IGNTEXT },
           { "group", NODE_IGNTEXT },
         { "link", 0 },          { "link", 0 },
         { "listitem", NODE_IGNTEXT },          { "listitem", NODE_IGNTEXT },
         { "literal", 0 },          { "literal", 0 },
Line 792  pnode_printarg(struct parse *p, struct pnode *pn)
Line 793  pnode_printarg(struct parse *p, struct pnode *pn)
         }          }
 }  }
   
   static void
   pnode_printgroup(struct parse *p, struct pnode *pn)
   {
           struct pnode    *pp, *np;
           struct pattr    *ap;
           int              isop, sv;
   
           isop = 1;
           TAILQ_FOREACH(ap, &pn->attrq, child)
                   if (ATTRKEY_CHOICE == ap->key &&
                           (ATTRVAL_PLAIN == ap->val ||
                            ATTRVAL_REQ == ap->val)) {
                           isop = 0;
                           break;
                   }
   
           /*
            * Make sure we're on a macro line.
            * This will prevent pnode_print() for putting us on a
            * subsequent line.
            */
           sv = p->newln;
           pnode_printmopen(p);
           if (isop)
                   fputs("Op", stdout);
           else if (sv)
                   fputs("No", stdout);
   
           /*
            * Keep on printing text separated by the vertical bar as long
            * as we're within the same origin node as the group.
            * This is kind of a nightmare.
            * Eh, DocBook...
            * FIXME: if there's a "Fl", we don't cut off the leading "-"
            * like we do in pnode_print().
            */
           TAILQ_FOREACH(pp, &pn->childq, child) {
                   pnode_print(p, pp);
                   np = TAILQ_NEXT(pp, child);
                   while (NULL != np) {
                           if (pp->node != np->node)
                                   break;
                           fputs(" |", stdout);
                           pnode_printmacrolinepart(p, np);
                           pp = np;
                           np = TAILQ_NEXT(np, child);
                   }
           }
   
           pnode_printmclose(p, sv);
   }
   
 /*  /*
  * Recursively search and return the first instance of "node".   * Recursively search and return the first instance of "node".
  */   */
Line 974  pnode_print(struct parse *p, struct pnode *pn)
Line 1027  pnode_print(struct parse *p, struct pnode *pn)
         case (NODE_ORDEREDLIST):          case (NODE_ORDEREDLIST):
                 assert(p->newln);                  assert(p->newln);
                 pnode_printitemizedlist(p, pn);                  pnode_printitemizedlist(p, pn);
                   break;
           case (NODE_GROUP):
                   pnode_printgroup(p, pn);
                   pnode_unlinksub(pn);
                 break;                  break;
         case (NODE_LITERAL):          case (NODE_LITERAL):
                 pnode_printmopen(p);                  pnode_printmopen(p);

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

CVSweb