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

Diff for /mandoc/mdoc.c between version 1.162 and 1.163

version 1.162, 2010/08/08 14:51:32 version 1.163, 2010/08/20 01:02:07
Line 98  static int    node_append(struct mdoc *, 
Line 98  static int    node_append(struct mdoc *, 
                                 struct mdoc_node *);                                  struct mdoc_node *);
 static  int               mdoc_ptext(struct mdoc *, int, char *, int);  static  int               mdoc_ptext(struct mdoc *, int, char *, int);
 static  int               mdoc_pmacro(struct mdoc *, int, char *, int);  static  int               mdoc_pmacro(struct mdoc *, int, char *, int);
 static  int               macrowarn(struct mdoc *, int,  
                                 const char *, int);  
   
   
 const struct mdoc_node *  const struct mdoc_node *
Line 191  mdoc_free(struct mdoc *mdoc)
Line 189  mdoc_free(struct mdoc *mdoc)
  * Allocate volatile and non-volatile parse resources.   * Allocate volatile and non-volatile parse resources.
  */   */
 struct mdoc *  struct mdoc *
 mdoc_alloc(struct regset *regs, void *data,  mdoc_alloc(struct regset *regs, void *data, mandocmsg msg)
                 int pflags, mandocmsg msg)  
 {  {
         struct mdoc     *p;          struct mdoc     *p;
   
Line 200  mdoc_alloc(struct regset *regs, void *data, 
Line 197  mdoc_alloc(struct regset *regs, void *data, 
   
         p->msg = msg;          p->msg = msg;
         p->data = data;          p->data = data;
         p->pflags = pflags;  
         p->regs = regs;          p->regs = regs;
   
         mdoc_hash_init();          mdoc_hash_init();
Line 727  mdoc_ptext(struct mdoc *m, int line, char *buf, int of
Line 723  mdoc_ptext(struct mdoc *m, int line, char *buf, int of
 }  }
   
   
 static int  
 macrowarn(struct mdoc *m, int ln, const char *buf, int offs)  
 {  
         int              rc;  
   
         rc = mdoc_vmsg(m, MANDOCERR_MACRO, ln, offs,  
                         "unknown macro: %s%s",  
                         buf, strlen(buf) > 3 ? "..." : "");  
   
         /* FIXME: logic should be in driver. */  
         /* FIXME: broken, will error out and not omit a message. */  
         return(MDOC_IGN_MACRO & m->pflags ? rc : 0);  
 }  
   
   
 /*  /*
  * Parse a macro line, that is, a line beginning with the control   * Parse a macro line, that is, a line beginning with the control
  * character.   * character.
Line 785  mdoc_pmacro(struct mdoc *m, int ln, char *buf, int off
Line 766  mdoc_pmacro(struct mdoc *m, int ln, char *buf, int off
                 mac[j++] = buf[i++];                  mac[j++] = buf[i++];
         mac[j] = '\0';          mac[j] = '\0';
   
         if (j == 4 || j < 2) {          tok = (j > 1 || j < 4) ? mdoc_hash_find(mac) : MDOC_MAX;
                 if ( ! macrowarn(m, ln, mac, sv))          if (MDOC_MAX == tok) {
                         goto err;                  mdoc_vmsg(m, MANDOCERR_MACRO, ln, sv,
                 return(1);                      "unknown macro: %s%s",
         }                      buf, strlen(buf) > 3 ? "..." : "");
   
         if (MDOC_MAX == (tok = mdoc_hash_find(mac))) {  
                 if ( ! macrowarn(m, ln, mac, sv))  
                         goto err;  
                 return(1);                  return(1);
         }          }
   

Legend:
Removed from v.1.162  
changed lines
  Added in v.1.163

CVSweb