version 1.33, 2009/07/04 09:01:55 |
version 1.35, 2009/07/06 09:21:24 |
Line 99 static int moptions(enum intt *, char *); |
|
Line 99 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 554 toptions(enum outt *tflags, char *arg) |
|
Line 553 toptions(enum outt *tflags, char *arg) |
|
static int |
static int |
foptions(int *fflags, char *arg) |
foptions(int *fflags, char *arg) |
{ |
{ |
char *v; |
char *v, *o; |
char *toks[6]; |
char *toks[6]; |
|
|
toks[0] = "ign-scope"; |
toks[0] = "ign-scope"; |
Line 564 foptions(int *fflags, char *arg) |
|
Line 563 foptions(int *fflags, char *arg) |
|
toks[4] = "strict"; |
toks[4] = "strict"; |
toks[5] = NULL; |
toks[5] = NULL; |
|
|
while (*arg) |
while (*arg) { |
|
o = arg; |
switch (getsubopt(&arg, toks, &v)) { |
switch (getsubopt(&arg, toks, &v)) { |
case (0): |
case (0): |
*fflags |= IGN_SCOPE; |
*fflags |= IGN_SCOPE; |
Line 583 foptions(int *fflags, char *arg) |
|
Line 583 foptions(int *fflags, char *arg) |
|
NO_IGN_MACRO | NO_IGN_CHARS; |
NO_IGN_MACRO | NO_IGN_CHARS; |
break; |
break; |
default: |
default: |
warnx("bad argument: -f%s", suboptarg); |
warnx("bad argument: -f%s", o); |
return(0); |
return(0); |
} |
} |
|
} |
|
|
return(1); |
return(1); |
} |
} |
Line 594 foptions(int *fflags, char *arg) |
|
Line 595 foptions(int *fflags, char *arg) |
|
static int |
static int |
woptions(int *wflags, char *arg) |
woptions(int *wflags, char *arg) |
{ |
{ |
char *v; |
char *v, *o; |
char *toks[5]; |
char *toks[5]; |
|
|
toks[0] = "all"; |
toks[0] = "all"; |
Line 603 woptions(int *wflags, char *arg) |
|
Line 604 woptions(int *wflags, char *arg) |
|
toks[3] = "error"; |
toks[3] = "error"; |
toks[4] = NULL; |
toks[4] = NULL; |
|
|
while (*arg) |
while (*arg) { |
|
o = arg; |
switch (getsubopt(&arg, toks, &v)) { |
switch (getsubopt(&arg, toks, &v)) { |
case (0): |
case (0): |
*wflags |= WARN_WALL; |
*wflags |= WARN_WALL; |
Line 618 woptions(int *wflags, char *arg) |
|
Line 620 woptions(int *wflags, char *arg) |
|
*wflags |= WARN_WERR; |
*wflags |= WARN_WERR; |
break; |
break; |
default: |
default: |
warnx("bad argument: -W%s", suboptarg); |
warnx("bad argument: -W%s", o); |
return(0); |
return(0); |
} |
} |
|
} |
|
|
return(1); |
return(1); |
} |
} |
Line 641 merr(void *arg, int line, int col, const char *msg) |
|
Line 644 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) { |
warnx("%s:%d: warning: %s (column %d)", |
case (WARN_COMPAT): |
curp->file, line, msg, col); |
wtype = "compat"; |
|
if (curp->wflags & WARN_WCOMPAT) |
|
break; |
|
return(1); |
|
case (WARN_SYNTAX): |
|
wtype = "syntax"; |
|
if (curp->wflags & WARN_WSYNTAX) |
|
break; |
|
return(1); |
|
} |
|
|
|
assert(wtype); |
|
warnx("%s:%d: %s warning: %s (column %d)", |
|
curp->file, line, wtype, msg, col); |
|
|
|
if ( ! (curp->wflags & WARN_WERR)) |
if ( ! (curp->wflags & WARN_WERR)) |
return(1); |
return(1); |