version 1.197, 2015/10/06 18:32:19 |
version 1.198, 2015/10/11 21:12:54 |
|
|
|
|
#include <assert.h> |
#include <assert.h> |
#include <ctype.h> |
#include <ctype.h> |
|
#include <err.h> |
#include <errno.h> |
#include <errno.h> |
#include <fcntl.h> |
#include <fcntl.h> |
#if HAVE_FTS |
#if HAVE_FTS |
Line 189 static int set_basedir(const char *, int); |
|
Line 190 static int set_basedir(const char *, int); |
|
static int treescan(void); |
static int treescan(void); |
static size_t utf8(unsigned int, char [7]); |
static size_t utf8(unsigned int, char [7]); |
|
|
|
extern char *__progname; |
|
|
static char tempfilename[32]; |
static char tempfilename[32]; |
static char *progname; |
|
static int nodb; /* no database changes */ |
static int nodb; /* no database changes */ |
static int mparse_options; /* abort the parse early */ |
static int mparse_options; /* abort the parse early */ |
static int use_all; /* use all found files */ |
static int use_all; /* use all found files */ |
Line 357 mandocdb(int argc, char *argv[]) |
|
Line 359 mandocdb(int argc, char *argv[]) |
|
mpages_info.key_offset = offsetof(struct mpage, inodev); |
mpages_info.key_offset = offsetof(struct mpage, inodev); |
mlinks_info.key_offset = offsetof(struct mlink, file); |
mlinks_info.key_offset = offsetof(struct mlink, file); |
|
|
progname = strrchr(argv[0], '/'); |
|
if (progname == NULL) |
|
progname = argv[0]; |
|
else |
|
++progname; |
|
|
|
/* |
/* |
* We accept a few different invocations. |
* We accept a few different invocations. |
* The CHECKOP macro makes sure that invocation styles don't |
* The CHECKOP macro makes sure that invocation styles don't |
Line 370 mandocdb(int argc, char *argv[]) |
|
Line 366 mandocdb(int argc, char *argv[]) |
|
*/ |
*/ |
#define CHECKOP(_op, _ch) do \ |
#define CHECKOP(_op, _ch) do \ |
if (OP_DEFAULT != (_op)) { \ |
if (OP_DEFAULT != (_op)) { \ |
fprintf(stderr, "%s: -%c: Conflicting option\n", \ |
warnx("-%c: Conflicting option", (_ch)); \ |
progname, (_ch)); \ |
|
goto usage; \ |
goto usage; \ |
} while (/*CONSTCOND*/0) |
} while (/*CONSTCOND*/0) |
|
|
Line 407 mandocdb(int argc, char *argv[]) |
|
Line 402 mandocdb(int argc, char *argv[]) |
|
break; |
break; |
case 'T': |
case 'T': |
if (strcmp(optarg, "utf8")) { |
if (strcmp(optarg, "utf8")) { |
fprintf(stderr, "%s: -T%s: " |
warnx("-T%s: Unsupported output format", |
"Unsupported output format\n", |
optarg); |
progname, optarg); |
|
goto usage; |
goto usage; |
} |
} |
write_utf8 = 1; |
write_utf8 = 1; |
Line 436 mandocdb(int argc, char *argv[]) |
|
Line 430 mandocdb(int argc, char *argv[]) |
|
argv += optind; |
argv += optind; |
|
|
if (OP_CONFFILE == op && argc > 0) { |
if (OP_CONFFILE == op && argc > 0) { |
fprintf(stderr, "%s: -C: Too many arguments\n", |
warnx("-C: Too many arguments"); |
progname); |
|
goto usage; |
goto usage; |
} |
} |
|
|
|
|
" %s [-DnpQ] [-Tutf8] -d dir [file ...]\n" |
" %s [-DnpQ] [-Tutf8] -d dir [file ...]\n" |
" %s [-Dnp] -u dir [file ...]\n" |
" %s [-Dnp] -u dir [file ...]\n" |
" %s [-Q] -t file ...\n", |
" %s [-Q] -t file ...\n", |
progname, progname, progname, |
__progname, __progname, __progname, |
progname, progname); |
__progname, __progname); |
|
|
return (int)MANDOCLEVEL_BADARG; |
return (int)MANDOCLEVEL_BADARG; |
} |
} |