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

Diff for /mandoc/main.c between version 1.34 and 1.36

version 1.34, 2009/07/04 11:10:36 version 1.36, 2009/07/06 09:34:29
Line 65  struct curparse {
Line 65  struct curparse {
         const char       *file;         /* Current parse. */          const char       *file;         /* Current parse. */
         int               fd;           /* Current parse. */          int               fd;           /* Current parse. */
         int               wflags;          int               wflags;
 #define WARN_WALL         0x03          /* All-warnings mask. */  #define WARN_WALL        (1 << 0)       /* All-warnings mask. */
 #define WARN_WCOMPAT     (1 << 0)       /* Compatibility warnings. */  
 #define WARN_WSYNTAX     (1 << 1)       /* Syntax warnings. */  
 #define WARN_WERR        (1 << 2)       /* Warnings->errors. */  #define WARN_WERR        (1 << 2)       /* Warnings->errors. */
         int               fflags;          int               fflags;
 #define IGN_SCOPE        (1 << 0)       /* Ignore scope errors. */  #define IGN_SCOPE        (1 << 0)       /* Ignore scope errors. */
Line 99  static int    moptions(enum intt *, char *);
Line 97  static int    moptions(enum intt *, char *);
 static  int               woptions(int *, char *);  static  int               woptions(int *, char *);
 static  int               merr(void *, int, int, const char *);  static  int               merr(void *, int, int, const char *);
 static  int               manwarn(void *, int, int, const char *);  static  int               manwarn(void *, int, int, const char *);
 static  int               mdocwarn(void *, int, int,  static  int               mdocwarn(void *, int, int, const char *);
                                 enum mdoc_warn, const char *);  
 static  int               ffile(struct buf *, struct buf *,  static  int               ffile(struct buf *, struct buf *,
                                 const char *, struct curparse *);                                  const char *, struct curparse *);
 static  int               fdesc(struct buf *, struct buf *,  static  int               fdesc(struct buf *, struct buf *,
Line 597  static int
Line 594  static int
 woptions(int *wflags, char *arg)  woptions(int *wflags, char *arg)
 {  {
         char            *v, *o;          char            *v, *o;
         char            *toks[5];          char            *toks[3];
   
         toks[0] = "all";          toks[0] = "all";
         toks[1] = "compat";          toks[1] = "error";
         toks[2] = "syntax";          toks[2] = NULL;
         toks[3] = "error";  
         toks[4] = NULL;  
   
         while (*arg) {          while (*arg) {
                 o = arg;                  o = arg;
Line 612  woptions(int *wflags, char *arg)
Line 607  woptions(int *wflags, char *arg)
                         *wflags |= WARN_WALL;                          *wflags |= WARN_WALL;
                         break;                          break;
                 case (1):                  case (1):
                         *wflags |= WARN_WCOMPAT;  
                         break;  
                 case (2):  
                         *wflags |= WARN_WSYNTAX;  
                         break;  
                 case (3):  
                         *wflags |= WARN_WERR;                          *wflags |= WARN_WERR;
                         break;                          break;
                 default:                  default:
Line 637  merr(void *arg, int line, int col, const char *msg)
Line 626  merr(void *arg, int line, int col, const char *msg)
         struct curparse *curp;          struct curparse *curp;
   
         curp = (struct curparse *)arg;          curp = (struct curparse *)arg;
   
         warnx("%s:%d: error: %s (column %d)",          warnx("%s:%d: error: %s (column %d)",
                         curp->file, line, msg, col);                          curp->file, line, msg, col);
   
Line 645  merr(void *arg, int line, int col, const char *msg)
Line 635  merr(void *arg, int line, int col, const char *msg)
   
   
 static int  static int
 mdocwarn(void *arg, int line, int col,  mdocwarn(void *arg, int line, int col, const char *msg)
                 enum mdoc_warn type, const char *msg)  
 {  {
         struct curparse *curp;          struct curparse *curp;
         char            *wtype;  
   
         curp = (struct curparse *)arg;          curp = (struct curparse *)arg;
         wtype = NULL;  
   
         switch (type) {          if ( ! (curp->wflags & WARN_WALL))
         case (WARN_COMPAT):  
                 wtype = "compat";  
                 if (curp->wflags & WARN_WCOMPAT)  
                         break;  
                 return(1);                  return(1);
         case (WARN_SYNTAX):  
                 wtype = "syntax";  
                 if (curp->wflags & WARN_WSYNTAX)  
                         break;  
                 return(1);  
         }  
   
         assert(wtype);          warnx("%s:%d: syntax warning: %s (column %d)",
         warnx("%s:%d: %s warning: %s (column %d)",                          curp->file, line, msg, col);
                         curp->file, line, wtype, msg, col);  
   
         if ( ! (curp->wflags & WARN_WERR))          if ( ! (curp->wflags & WARN_WERR))
                 return(1);                  return(1);
Line 686  manwarn(void *arg, int line, int col, const char *msg)
Line 662  manwarn(void *arg, int line, int col, const char *msg)
   
         curp = (struct curparse *)arg;          curp = (struct curparse *)arg;
   
         if ( ! (curp->wflags & WARN_WSYNTAX))          if ( ! (curp->wflags & WARN_WALL))
                 return(1);                  return(1);
   
         warnx("%s:%d: syntax warning: %s (column %d)",          warnx("%s:%d: syntax warning: %s (column %d)",

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.36

CVSweb