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

Diff for /docbook2mdoc/docbook2mdoc.c between version 1.46 and 1.49

version 1.46, 2019/03/08 15:09:54 version 1.49, 2019/03/22 15:54:42
Line 41  struct parse {
Line 41  struct parse {
         unsigned int     flags; /* document-wide flags */          unsigned int     flags; /* document-wide flags */
         struct pnode    *root; /* root of parse tree */          struct pnode    *root; /* root of parse tree */
         struct pnode    *cur; /* current node in tree */          struct pnode    *cur; /* current node in tree */
         char            *b; /* nil-terminated buffer for pre-print */          char            *b; /* NUL-terminated buffer for pre-print */
         size_t           bsz; /* current length of b */          size_t           bsz; /* current length of b */
         size_t           mbsz; /* max bsz allocation */          size_t           mbsz; /* max bsz allocation */
         int              newln; /* output: are we on a fresh line */          int              newln; /* output: are we on a fresh line */
Line 327  xml_elem_start(void *arg, const XML_Char *name, const 
Line 327  xml_elem_start(void *arg, const XML_Char *name, const 
                         XML_GetCurrentColumnNumber(ps->xml));                          XML_GetCurrentColumnNumber(ps->xml));
                 ps->stop = 1;                  ps->stop = 1;
                 return;                  return;
         } else if (NODE_ROOT == ps->node && NODE_REFENTRY != node) {          } else if (NODE_ROOT == ps->node && NODE_REFENTRY != node)
                 return;                  return;
         } else if ( ! isparent(node, ps->node)) {  
                 fprintf(stderr, "%s:%zu:%zu: bad parent \"%s\" "  
                         "of node \"%s\"\n",  
                         ps->fname, XML_GetCurrentLineNumber(ps->xml),  
                         XML_GetCurrentColumnNumber(ps->xml),  
                         NULL == nodes[ps->node].name ?  
                         "(none)" : nodes[ps->node].name,  
                         NULL == nodes[node].name ?  
                         "(none)" : nodes[node].name);  
                 ps->stop = 1;  
                 return;  
         }  
   
         if (NODE_INLINEEQUATION == node)          if (NODE_INLINEEQUATION == node)
                 ps->flags |= PARSE_EQN;                  ps->flags |= PARSE_EQN;
Line 378  xml_elem_start(void *arg, const XML_Char *name, const 
Line 366  xml_elem_start(void *arg, const XML_Char *name, const 
                                         XML_GetCurrentColumnNumber(ps->xml),                                          XML_GetCurrentColumnNumber(ps->xml),
                                         *att);                                          *att);
                         continue;                          continue;
                 } else if ( ! isattrkey(node, key)) {  
                         if (warn)  
                                 fprintf(stderr, "%s:%zu:%zu: warning: "  
                                         "bad attribute \"%s\"\n",  
                                         ps->fname,  
                                         XML_GetCurrentLineNumber(ps->xml),  
                                         XML_GetCurrentColumnNumber(ps->xml),  
                                         *att);  
                         continue;  
                 }                  }
                 for (val = 0; val < ATTRVAL__MAX; val++)                  for (val = 0; val < ATTRVAL__MAX; val++)
                         if (0 == strcmp(*(att + 1), attrvals[val]))                          if (0 == strcmp(*(att + 1), attrvals[val]))
                                 break;                                  break;
                 if (ATTRVAL__MAX != val && ! isattrval(key, val)) {  
                         if (warn)  
                                 fprintf(stderr, "%s:%zu:%zu: warning: "  
                                         "bad attribute value \"%s\"\n",  
                                         ps->fname,  
                                         XML_GetCurrentLineNumber(ps->xml),  
                                         XML_GetCurrentColumnNumber(ps->xml),  
                                         *(att + 1));  
                         continue;  
                 }  
                 pattr = calloc(1, sizeof(struct pattr));                  pattr = calloc(1, sizeof(struct pattr));
                 pattr->key = key;                  pattr->key = key;
                 pattr->val = val;                  pattr->val = val;
Line 505  bufclear(struct parse *p)
Line 474  bufclear(struct parse *p)
 /*  /*
  * Append NODE_TEXT contents to the current buffer, reallocating its   * Append NODE_TEXT contents to the current buffer, reallocating its
  * size if necessary.   * size if necessary.
  * The buffer is ALWAYS nil-terminated.   * The buffer is ALWAYS NUL-terminated.
  */   */
 static void  static void
 bufappend(struct parse *p, struct pnode *pn)  bufappend(struct parse *p, struct pnode *pn)

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.49

CVSweb