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

Diff for /mandoc/tbl_opts.c between version 1.9 and 1.10

version 1.9, 2011/03/15 16:23:51 version 1.10, 2011/03/20 16:02:05
Line 20 
Line 20 
 #include <string.h>  #include <string.h>
   
 #include "mandoc.h"  #include "mandoc.h"
   #include "libmandoc.h"
 #include "libroff.h"  #include "libroff.h"
   
 enum    tbl_ident {  enum    tbl_ident {
Line 88  arg(struct tbl_node *tbl, int ln, const char *p, int *
Line 89  arg(struct tbl_node *tbl, int ln, const char *p, int *
         /* Arguments always begin with a parenthesis. */          /* Arguments always begin with a parenthesis. */
   
         if ('(' != p[*pos]) {          if ('(' != p[*pos]) {
                 TBL_MSG(tbl, MANDOCERR_TBL, ln, *pos);                  mandoc_msg(MANDOCERR_TBL, tbl->parse,
                                   ln, *pos, NULL);
                 return(0);                  return(0);
         }          }
   
Line 103  arg(struct tbl_node *tbl, int ln, const char *p, int *
Line 105  arg(struct tbl_node *tbl, int ln, const char *p, int *
         switch (key) {          switch (key) {
         case (KEY_DELIM):          case (KEY_DELIM):
                 if ('\0' == p[(*pos)++]) {                  if ('\0' == p[(*pos)++]) {
                         TBL_MSG(tbl, MANDOCERR_TBL, ln, *pos - 1);                          mandoc_msg(MANDOCERR_TBL, tbl->parse,
                                           ln, *pos - 1, NULL);
                         return(0);                          return(0);
                 }                  }
   
                 if ('\0' == p[(*pos)++]) {                  if ('\0' == p[(*pos)++]) {
                         TBL_MSG(tbl, MANDOCERR_TBL, ln, *pos - 1);                          mandoc_msg(MANDOCERR_TBL, tbl->parse,
                                           ln, *pos - 1, NULL);
                         return(0);                          return(0);
                 }                  }
                 break;                  break;
Line 116  arg(struct tbl_node *tbl, int ln, const char *p, int *
Line 120  arg(struct tbl_node *tbl, int ln, const char *p, int *
                 if ('\0' != (tbl->opts.tab = p[(*pos)++]))                  if ('\0' != (tbl->opts.tab = p[(*pos)++]))
                         break;                          break;
   
                 TBL_MSG(tbl, MANDOCERR_TBL, ln, *pos - 1);                  mandoc_msg(MANDOCERR_TBL, tbl->parse,
                                   ln, *pos - 1, NULL);
                 return(0);                  return(0);
         case (KEY_LINESIZE):          case (KEY_LINESIZE):
                 for (i = 0; i < KEY_MAXNUMSZ && p[*pos]; i++, (*pos)++) {                  for (i = 0; i < KEY_MAXNUMSZ && p[*pos]; i++, (*pos)++) {
Line 131  arg(struct tbl_node *tbl, int ln, const char *p, int *
Line 136  arg(struct tbl_node *tbl, int ln, const char *p, int *
                         break;                          break;
                 }                  }
   
                 (*tbl->msg)(MANDOCERR_TBL, tbl->data, ln, *pos, NULL);                  mandoc_msg(MANDOCERR_TBL, tbl->parse, ln, *pos, NULL);
                 return(0);                  return(0);
         case (KEY_DPOINT):          case (KEY_DPOINT):
                 if ('\0' != (tbl->opts.decimal = p[(*pos)++]))                  if ('\0' != (tbl->opts.decimal = p[(*pos)++]))
                         break;                          break;
   
                 TBL_MSG(tbl, MANDOCERR_TBL, ln, *pos - 1);                  mandoc_msg(MANDOCERR_TBL, tbl->parse,
                                   ln, *pos - 1, NULL);
                 return(0);                  return(0);
         default:          default:
                 abort();                  abort();
Line 149  arg(struct tbl_node *tbl, int ln, const char *p, int *
Line 155  arg(struct tbl_node *tbl, int ln, const char *p, int *
         if (')' == p[(*pos)++])          if (')' == p[(*pos)++])
                 return(1);                  return(1);
   
         TBL_MSG(tbl, MANDOCERR_TBL, ln, *pos - 1);          mandoc_msg(MANDOCERR_TBL, tbl->parse, ln, *pos - 1, NULL);
         return(0);          return(0);
 }  }
   
Line 196  again: /*
Line 202  again: /*
         /* Exit if buffer is empty (or overrun). */          /* Exit if buffer is empty (or overrun). */
   
         if (KEY_MAXNAME == i || 0 == i) {          if (KEY_MAXNAME == i || 0 == i) {
                 TBL_MSG(tbl, MANDOCERR_TBL, ln, *pos);                  mandoc_msg(MANDOCERR_TBL, tbl->parse, ln, *pos, NULL);
                 return;                  return;
         }          }
   
Line 235  again: /*
Line 241  again: /*
          */           */
   
         if (KEY_MAXKEYS == i)          if (KEY_MAXKEYS == i)
                 TBL_MSG(tbl, MANDOCERR_TBLOPT, ln, sv);                  mandoc_msg(MANDOCERR_TBLOPT, tbl->parse, ln, sv, NULL);
   
         goto again;          goto again;
         /* NOTREACHED */          /* NOTREACHED */

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

CVSweb