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

Diff for /mandoc/main.c between version 1.26 and 1.27

version 1.26, 2009/06/10 20:18:43 version 1.27, 2009/06/11 12:07:49
Line 190  main(int argc, char *argv[])
Line 190  main(int argc, char *argv[])
                 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 231  man_init(struct curparse *curp)
Line 233  man_init(struct curparse *curp)
         mancb.man_err = merr;          mancb.man_err = merr;
         mancb.man_warn = manwarn;          mancb.man_warn = manwarn;
   
         pflags = MAN_IGN_MACRO; /* XXX */          /*
            * Default behaviour is to ignore unknown macros.  This is
            * specified in mandoc.1.
            */
   
           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 254  mdoc_init(struct curparse *curp)
Line 263  mdoc_init(struct curparse *curp)
         mdoccb.mdoc_err = merr;          mdoccb.mdoc_err = merr;
         mdoccb.mdoc_warn = mdocwarn;          mdoccb.mdoc_warn = mdocwarn;
   
           /*
            * 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 363  fdesc(struct buf *blk, struct buf *ln, struct curparse
Line 380  fdesc(struct buf *blk, struct buf *ln, struct curparse
                                 continue;                                  continue;
                         }                          }
   
                         /* Check for CPP-escaped newline.  */                          /* Check for CPP-escaped newline. */
   
                         if (pos > 0 && '\\' == ln->buf[pos - 1]) {                          if (pos > 0 && '\\' == ln->buf[pos - 1]) {
                                 for (j = pos - 1; j >= 0; j--)                                  for (j = pos - 1; j >= 0; j--)
Line 630  merr(void *arg, int line, int col, const char *msg)
Line 647  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);
   
           /* Always exit on errors... */
         return(0);          return(0);
 }  }
   
Line 666  mdocwarn(void *arg, int line, int col, 
Line 684  mdocwarn(void *arg, int line, int col, 
   
         if ( ! (curp->wflags & WARN_WERR))          if ( ! (curp->wflags & WARN_WERR))
                 return(1);                  return(1);
   
           /*
            * If the -Werror flag is passed in, as in gcc, then all
            * warnings are considered as errors.
            */
   
         warnx("%s: considering warnings as errors",          warnx("%s: considering warnings as errors",
                         __progname);                          __progname);
Line 688  manwarn(void *arg, int line, int col, const char *msg)
Line 711  manwarn(void *arg, int line, int col, const char *msg)
   
         if ( ! (curp->wflags & WARN_WERR))          if ( ! (curp->wflags & WARN_WERR))
                 return(1);                  return(1);
   
           /*
            * If the -Werror flag is passed in, as in gcc, then all
            * warnings are considered as errors.
            */
   
         warnx("%s: considering warnings as errors",          warnx("%s: considering warnings as errors",
                         __progname);                          __progname);

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

CVSweb