version 1.30, 2009/06/16 20:22:23 |
version 1.34, 2009/07/04 11:10:36 |
Line 132 main(int argc, char *argv[]) |
|
Line 132 main(int argc, char *argv[]) |
|
switch (c) { |
switch (c) { |
case ('f'): |
case ('f'): |
if ( ! foptions(&curp.fflags, optarg)) |
if ( ! foptions(&curp.fflags, optarg)) |
return(0); |
return(EXIT_FAILURE); |
break; |
break; |
case ('m'): |
case ('m'): |
if ( ! moptions(&curp.inttype, optarg)) |
if ( ! moptions(&curp.inttype, optarg)) |
return(0); |
return(EXIT_FAILURE); |
break; |
break; |
case ('T'): |
case ('T'): |
if ( ! toptions(&curp.outtype, optarg)) |
if ( ! toptions(&curp.outtype, optarg)) |
return(0); |
return(EXIT_FAILURE); |
break; |
break; |
case ('W'): |
case ('W'): |
if ( ! woptions(&curp.wflags, optarg)) |
if ( ! woptions(&curp.wflags, optarg)) |
return(0); |
return(EXIT_FAILURE); |
break; |
break; |
case ('V'): |
case ('V'): |
version(); |
version(); |
Line 232 man_init(struct curparse *curp) |
|
Line 232 man_init(struct curparse *curp) |
|
|
|
/* Defaults from mandoc.1. */ |
/* Defaults from mandoc.1. */ |
|
|
pflags = MAN_IGN_MACRO; |
pflags = MAN_IGN_MACRO | MAN_IGN_ESCAPE | MAN_IGN_CHARS; |
|
|
if (curp->fflags & NO_IGN_MACRO) |
if (curp->fflags & NO_IGN_MACRO) |
pflags &= ~MAN_IGN_MACRO; |
pflags &= ~MAN_IGN_MACRO; |
|
if (curp->fflags & NO_IGN_CHARS) |
|
pflags &= ~MAN_IGN_CHARS; |
|
if (curp->fflags & NO_IGN_ESCAPE) |
|
pflags &= ~MAN_IGN_ESCAPE; |
|
|
if (NULL == (man = man_alloc(curp, pflags, &mancb))) |
if (NULL == (man = man_alloc(curp, pflags, &mancb))) |
warnx("memory exhausted"); |
warnx("memory exhausted"); |
Line 316 fdesc(struct buf *blk, struct buf *ln, struct curparse |
|
Line 320 fdesc(struct buf *blk, struct buf *ln, struct curparse |
|
*/ |
*/ |
|
|
if (-1 == fstat(curp->fd, &st)) |
if (-1 == fstat(curp->fd, &st)) |
warnx("%s", curp->file); |
warn("%s", curp->file); |
else if ((size_t)st.st_blksize > sz) |
else if ((size_t)st.st_blksize > sz) |
sz = st.st_blksize; |
sz = st.st_blksize; |
|
|
Line 550 toptions(enum outt *tflags, char *arg) |
|
Line 554 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 560 foptions(int *fflags, char *arg) |
|
Line 564 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 579 foptions(int *fflags, char *arg) |
|
Line 584 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", arg); |
warnx("bad argument: -f%s", o); |
return(0); |
return(0); |
} |
} |
|
} |
|
|
return(1); |
return(1); |
} |
} |
Line 590 foptions(int *fflags, char *arg) |
|
Line 596 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 599 woptions(int *wflags, char *arg) |
|
Line 605 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 614 woptions(int *wflags, char *arg) |
|
Line 621 woptions(int *wflags, char *arg) |
|
*wflags |= WARN_WERR; |
*wflags |= WARN_WERR; |
break; |
break; |
default: |
default: |
warnx("bad argument: -W%s", arg); |
warnx("bad argument: -W%s", o); |
return(0); |
return(0); |
} |
} |
|
} |
|
|
return(1); |
return(1); |
} |
} |