[BACK]Return to main.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mandoc

Diff for /src/usr.bin/mandoc/main.c between version 1.5 and 1.6

version 1.5, 2009/06/18 23:34:53 version 1.6, 2009/06/18 23:51:12
Line 61 
Line 61 
 #define NO_IGN_ESCAPE    (1 << 1)       /* Don't ignore bad escapes. */  #define NO_IGN_ESCAPE    (1 << 1)       /* Don't ignore bad escapes. */
 #define NO_IGN_MACRO     (1 << 2)       /* Don't ignore bad macros. */  #define NO_IGN_MACRO     (1 << 2)       /* Don't ignore bad macros. */
 #define NO_IGN_CHARS     (1 << 3)       /* Don't ignore bad chars. */  #define NO_IGN_CHARS     (1 << 3)       /* Don't ignore bad chars. */
         enum intt         inttype;      /* Input parsers. */          enum intt         inttype;      /* Input parsers... */
         struct man       *man;          struct man       *man;
         struct man       *lastman;          struct man       *lastman;
         struct mdoc      *mdoc;          struct mdoc      *mdoc;
         struct mdoc      *lastmdoc;          struct mdoc      *lastmdoc;
         enum outt         outtype;      /* Output devices. */          enum outt         outtype;      /* Output devices... */
         out_mdoc          outmdoc;          out_mdoc          outmdoc;
         out_man           outman;          out_man           outman;
         out_free          outfree;          out_free          outfree;
Line 146 
Line 146 
         argc -= optind;          argc -= optind;
         argv += optind;          argv += optind;
   
         /* Configure buffers. */  
   
         bzero(&ln, sizeof(struct buf));          bzero(&ln, sizeof(struct buf));
         bzero(&blk, sizeof(struct buf));          bzero(&blk, sizeof(struct buf));
   
Line 177 
Line 175 
                 free(blk.buf);                  free(blk.buf);
         if (ln.buf)          if (ln.buf)
                 free(ln.buf);                  free(ln.buf);
   
         /* TODO: have a curp_free routine. */  
         if (curp.outfree)          if (curp.outfree)
                 (*curp.outfree)(curp.outdata);                  (*curp.outfree)(curp.outdata);
         if (curp.mdoc)          if (curp.mdoc)
Line 220 
Line 216 
         mancb.man_err = merr;          mancb.man_err = merr;
         mancb.man_warn = manwarn;          mancb.man_warn = manwarn;
   
         /*          /* Defaults from mandoc.1. */
          * Default behaviour is to ignore unknown macros.  This is  
          * specified in mandoc.1.  
          */  
   
         pflags = MAN_IGN_MACRO;          pflags = MAN_IGN_MACRO;
   
         /* Override default behaviour... */  
   
         if (curp->fflags & NO_IGN_MACRO)          if (curp->fflags & NO_IGN_MACRO)
                 pflags &= ~MAN_IGN_MACRO;                  pflags &= ~MAN_IGN_MACRO;
   
Line 249 
Line 240 
         mdoccb.mdoc_err = merr;          mdoccb.mdoc_err = merr;
         mdoccb.mdoc_warn = mdocwarn;          mdoccb.mdoc_warn = mdocwarn;
   
         /*          /* Defaults from mandoc.1. */
          * Default behaviour is to ignore unknown macros, escape  
          * sequences and characters (very liberal).  This is specified  
          * in mandoc.1.  
          */  
   
         pflags = MDOC_IGN_MACRO | MDOC_IGN_ESCAPE | MDOC_IGN_CHARS;          pflags = MDOC_IGN_MACRO | MDOC_IGN_ESCAPE | MDOC_IGN_CHARS;
   
         /* Override default behaviour... */  
   
         if (curp->fflags & IGN_SCOPE)          if (curp->fflags & IGN_SCOPE)
                 pflags |= MDOC_IGN_SCOPE;                  pflags |= MDOC_IGN_SCOPE;
         if (curp->fflags & NO_IGN_ESCAPE)          if (curp->fflags & NO_IGN_ESCAPE)
Line 558 
Line 543 
 }  }
   
   
 /*  
  * Parse out the options for [-fopt...] setting compiler options.  These  
  * can be comma-delimited or called again.  
  */  
 static int  static int
 foptions(int *fflags, char *arg)  foptions(int *fflags, char *arg)
 {  {
Line 602 
Line 583 
 }  }
   
   
 /*  
  * Parse out the options for [-Werr...], which sets warning modes.  
  * These can be comma-delimited or called again.  
  */  
 static int  static int
 woptions(int *wflags, char *arg)  woptions(int *wflags, char *arg)
 {  {
Line 651 
Line 628 
         warnx("%s:%d: error: %s (column %d)",          warnx("%s:%d: error: %s (column %d)",
                         curp->file, line, msg, col);                          curp->file, line, msg, col);
   
         /* Always exit on errors... */  
         return(0);          return(0);
 }  }
   
Line 686 
Line 662 
         if ( ! (curp->wflags & WARN_WERR))          if ( ! (curp->wflags & WARN_WERR))
                 return(1);                  return(1);
   
         /*          warnx("considering warnings as errors");
          * If the -Werror flag is passed in, as in gcc, then all  
          * warnings are considered as errors.  
          */  
   
         warnx("%s: considering warnings as errors",  
                         __progname);  
         return(0);          return(0);
 }  }
   
Line 713 
Line 683 
         if ( ! (curp->wflags & WARN_WERR))          if ( ! (curp->wflags & WARN_WERR))
                 return(1);                  return(1);
   
         /*          warnx("considering warnings as errors");
          * If the -Werror flag is passed in, as in gcc, then all  
          * warnings are considered as errors.  
          */  
   
         warnx("%s: considering warnings as errors",  
                         __progname);  
         return(0);          return(0);
 }  }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6