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

Diff for /mandoc/man_validate.c between version 1.11 and 1.14

version 1.11, 2009/06/18 10:32:00 version 1.14, 2009/06/22 13:09:17
Line 25 
Line 25 
   
 #define POSTARGS  struct man *m, const struct man_node *n  #define POSTARGS  struct man *m, const struct man_node *n
   
 enum    merr {  
         WPRINT  
 };  
   
 typedef int     (*v_post)(POSTARGS);  typedef int     (*v_post)(POSTARGS);
   
 struct  man_valid {  struct  man_valid {
Line 42  static int   check_le1(POSTARGS);
Line 38  static int   check_le1(POSTARGS);
 static  int       check_le2(POSTARGS);  static  int       check_le2(POSTARGS);
 static  int       check_le5(POSTARGS);  static  int       check_le5(POSTARGS);
 static  int       check_text(POSTARGS);  static  int       check_text(POSTARGS);
 static  int       perr(struct man *, int, int, int, enum merr);  static  int       check_root(POSTARGS);
   
 static  v_post    posts_le1[] = { check_le1, NULL };  static  v_post    posts_le1[] = { check_le1, NULL };
 static  v_post    posts_le2[] = { check_le2, NULL };  static  v_post    posts_le2[] = { check_le2, NULL };
Line 90  man_valid_post(struct man *m)
Line 86  man_valid_post(struct man *m)
         case (MAN_TEXT):          case (MAN_TEXT):
                 return(check_text(m, m->last));                  return(check_text(m, m->last));
         case (MAN_ROOT):          case (MAN_ROOT):
                 return(1);                  return(check_root(m, m->last));
         default:          default:
                 break;                  break;
         }          }
Line 106  man_valid_post(struct man *m)
Line 102  man_valid_post(struct man *m)
   
   
 static int  static int
 perr(struct man *m, int line, int pos,  check_root(POSTARGS)
                 int iserr, enum merr type)  
 {  {
         const char       *p;  
   
         p = NULL;          if (NULL == m->first->child)
         switch (type) {                  return(man_nerr(m, n, WNODATA));
         case (WPRINT):          if (NULL == m->meta.title)
                 p = "invalid character";                  return(man_nerr(m, n, WNOTITLE));
                 break;  
         }  
         assert(p);  
   
         if (iserr)          return(1);
                 return(man_verr(m, line, pos, p));  
   
         return(man_vwarn(m, line, pos, p));  
 }  }
   
   
Line 139  check_text(POSTARGS) 
Line 127  check_text(POSTARGS) 
                         continue;                          continue;
   
                 if (MAN_IGN_CHARS & m->pflags)                  if (MAN_IGN_CHARS & m->pflags)
                         return(perr(m, n->line, pos, 0, WPRINT));                          return(man_pwarn(m, n->line, pos, WNPRINT));
                 return(perr(m, n->line, pos, 1, WPRINT));                  return(man_perr(m, n->line, pos, WNPRINT));
         }          }
   
         return(1);          return(1);

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.14

CVSweb