version 1.26, 2009/06/10 20:18:43 |
version 1.28, 2009/06/15 10:36:01 |
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 250 mdoc_init(struct curparse *curp) |
|
Line 259 mdoc_init(struct curparse *curp) |
|
struct mdoc *mdoc; |
struct mdoc *mdoc; |
struct mdoc_cb mdoccb; |
struct mdoc_cb mdoccb; |
|
|
mdoccb.mdoc_msg = NULL; |
|
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 379 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 646 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 683 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 710 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); |