[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.76 and 1.79

version 1.76, 2011/10/16 12:20:34 version 1.79, 2011/12/02 01:37:14
Line 44  struct man_valid {
Line 44  struct man_valid {
         v_check  *posts;          v_check  *posts;
 };  };
   
 static  int       check_bline(CHKARGS);  
 static  int       check_eq0(CHKARGS);  static  int       check_eq0(CHKARGS);
 static  int       check_le1(CHKARGS);  static  int       check_le1(CHKARGS);
 static  int       check_ge2(CHKARGS);  static  int       check_ge2(CHKARGS);
Line 76  static v_check   posts_sec[] = { post_sec, NULL };
Line 75  static v_check   posts_sec[] = { post_sec, NULL };
 static  v_check   posts_sp[] = { post_vs, check_le1, NULL };  static  v_check   posts_sp[] = { post_vs, check_le1, NULL };
 static  v_check   posts_th[] = { check_ge2, check_le5, post_TH, NULL };  static  v_check   posts_th[] = { check_ge2, check_le5, post_TH, NULL };
 static  v_check   posts_uc[] = { post_UC, NULL };  static  v_check   posts_uc[] = { post_UC, NULL };
 static  v_check   pres_bline[] = { check_bline, NULL };  static  v_check   pres_sec[] = { pre_sec, NULL };
 static  v_check   pres_sec[] = { check_bline, pre_sec, NULL};  
   
 static  const struct man_valid man_valids[MAN_MAX] = {  static  const struct man_valid man_valids[MAN_MAX] = {
         { NULL, posts_br }, /* br */          { NULL, posts_br }, /* br */
         { pres_bline, posts_th }, /* TH */          { NULL, posts_th }, /* TH */
         { pres_sec, posts_sec }, /* SH */          { pres_sec, posts_sec }, /* SH */
         { pres_sec, posts_sec }, /* SS */          { pres_sec, posts_sec }, /* SS */
         { pres_bline, NULL }, /* TP */          { NULL, NULL }, /* TP */
         { pres_bline, posts_par }, /* LP */          { NULL, posts_par }, /* LP */
         { pres_bline, posts_par }, /* PP */          { NULL, posts_par }, /* PP */
         { pres_bline, posts_par }, /* P */          { NULL, posts_par }, /* P */
         { pres_bline, NULL }, /* IP */          { NULL, NULL }, /* IP */
         { pres_bline, NULL }, /* HP */          { NULL, NULL }, /* HP */
         { NULL, NULL }, /* SM */          { NULL, NULL }, /* SM */
         { NULL, NULL }, /* SB */          { NULL, NULL }, /* SB */
         { NULL, NULL }, /* BI */          { NULL, NULL }, /* BI */
Line 103  static const struct man_valid man_valids[MAN_MAX] = {
Line 101  static const struct man_valid man_valids[MAN_MAX] = {
         { NULL, NULL }, /* RI */          { NULL, NULL }, /* RI */
         { NULL, posts_eq0 }, /* na */ /* FIXME: should warn only. */          { NULL, posts_eq0 }, /* na */ /* FIXME: should warn only. */
         { NULL, posts_sp }, /* sp */ /* FIXME: should warn only. */          { NULL, posts_sp }, /* sp */ /* FIXME: should warn only. */
         { pres_bline, posts_nf }, /* nf */          { NULL, posts_nf }, /* nf */
         { pres_bline, posts_fi }, /* fi */          { NULL, posts_fi }, /* fi */
         { NULL, NULL }, /* RE */          { NULL, NULL }, /* RE */
         { NULL, posts_part }, /* RS */          { NULL, posts_part }, /* RS */
         { NULL, NULL }, /* DT */          { NULL, NULL }, /* DT */
Line 352  check_par(CHKARGS)
Line 350  check_par(CHKARGS)
   
   
 static int  static int
 check_bline(CHKARGS)  
 {  
   
         assert( ! (MAN_ELINE & m->flags));  
         if (MAN_BLINE & m->flags) {  
                 man_nmsg(m, n, MANDOCERR_SYNTLINESCOPE);  
                 return(0);  
         }  
   
         return(1);  
 }  
   
 static int  
 post_TH(CHKARGS)  post_TH(CHKARGS)
 {  {
         const char      *p;          const char      *p;
Line 415  post_TH(CHKARGS)
Line 400  post_TH(CHKARGS)
   
         if (n)          if (n)
                 n = n->next;                  n = n->next;
         if (n)          if (n && n->string && '\0' != n->string[0]) {
                 pos = n->pos;                  pos = n->pos;
         m->meta.date = mandoc_normdate                  m->meta.date = mandoc_normdate
                 (m->parse, n ? n->string : NULL, line, pos);                      (m->parse, n->string, line, pos);
           } else
                   m->meta.date = mandoc_strdup("");
   
         /* TITLE MSEC DATE ->SOURCE<- VOL */          /* TITLE MSEC DATE ->SOURCE<- VOL */
   
Line 426  post_TH(CHKARGS)
Line 413  post_TH(CHKARGS)
                 m->meta.source = mandoc_strdup(n->string);                  m->meta.source = mandoc_strdup(n->string);
   
         /* TITLE MSEC DATE SOURCE ->VOL<- */          /* TITLE MSEC DATE SOURCE ->VOL<- */
           /* If missing, use the default VOL name for MSEC. */
   
         if (n && (n = n->next))          if (n && (n = n->next))
                 m->meta.vol = mandoc_strdup(n->string);                  m->meta.vol = mandoc_strdup(n->string);
           else if ('\0' != m->meta.msec[0] &&
               (NULL != (p = mandoc_a2msec(m->meta.msec))))
                   m->meta.vol = mandoc_strdup(p);
   
         /*          /*
          * Remove the `TH' node after we've processed it for our           * Remove the `TH' node after we've processed it for our

Legend:
Removed from v.1.76  
changed lines
  Added in v.1.79

CVSweb