version 1.232, 2015/04/03 08:46:17 |
version 1.238, 2015/04/29 11:04:17 |
|
|
OUTMODE_ONE |
OUTMODE_ONE |
}; |
}; |
|
|
typedef void (*out_mdoc)(void *, const struct mdoc *); |
typedef void (*out_mdoc)(void *, const struct roff_man *); |
typedef void (*out_man)(void *, const struct man *); |
typedef void (*out_man)(void *, const struct roff_man *); |
typedef void (*out_free)(void *); |
typedef void (*out_free)(void *); |
|
|
enum outt { |
enum outt { |
Line 352 main(int argc, char *argv[]) |
|
Line 352 main(int argc, char *argv[]) |
|
sz = 0; |
sz = 0; |
#endif |
#endif |
|
|
if (sz == 0 && search.argmode == ARG_NAME) |
if (sz == 0) { |
fs_search(&search, &conf.manpath, |
if (search.argmode == ARG_NAME) |
argc, argv, &res, &sz); |
fs_search(&search, &conf.manpath, |
|
argc, argv, &res, &sz); |
|
else |
|
fprintf(stderr, |
|
"%s: nothing appropriate\n", |
|
progname); |
|
} |
|
|
if (sz == 0) { |
if (sz == 0) { |
rc = MANDOCLEVEL_BADARG; |
rc = MANDOCLEVEL_BADARG; |
Line 576 fs_lookup(const struct manpaths *paths, size_t ipath, |
|
Line 582 fs_lookup(const struct manpaths *paths, size_t ipath, |
|
|
|
found: |
found: |
#if HAVE_SQLITE3 |
#if HAVE_SQLITE3 |
fprintf(stderr, "%s: outdated mandoc.db lacks %s(%s) entry,\n" |
fprintf(stderr, "%s: outdated mandoc.db lacks %s(%s) entry, run " |
" consider running # makewhatis %s\n", |
"makewhatis %s\n", progname, name, sec, paths->paths[ipath]); |
progname, name, sec, paths->paths[ipath]); |
|
#endif |
#endif |
|
|
*res = mandoc_reallocarray(*res, ++*ressz, sizeof(struct manpage)); |
*res = mandoc_reallocarray(*res, ++*ressz, sizeof(struct manpage)); |
page = *res + (*ressz - 1); |
page = *res + (*ressz - 1); |
page->file = file; |
page->file = file; |
|
|
parse(struct curparse *curp, int fd, const char *file) |
parse(struct curparse *curp, int fd, const char *file) |
{ |
{ |
enum mandoclevel rctmp; |
enum mandoclevel rctmp; |
struct mdoc *mdoc; |
struct roff_man *man; |
struct man *man; |
|
|
|
/* Begin by parsing the file itself. */ |
/* Begin by parsing the file itself. */ |
|
|
Line 722 parse(struct curparse *curp, int fd, const char *file) |
|
Line 725 parse(struct curparse *curp, int fd, const char *file) |
|
} |
} |
} |
} |
|
|
mparse_result(curp->mp, &mdoc, &man, NULL); |
mparse_result(curp->mp, &man, NULL); |
|
|
/* Execute the out device, if it exists. */ |
/* Execute the out device, if it exists. */ |
|
|
if (man && curp->outman) |
if (man == NULL) |
|
return; |
|
if (curp->outmdoc != NULL && man->macroset == MACROSET_MDOC) |
|
(*curp->outmdoc)(curp->outdata, man); |
|
if (curp->outman != NULL && man->macroset == MACROSET_MAN) |
(*curp->outman)(curp->outdata, man); |
(*curp->outman)(curp->outdata, man); |
if (mdoc && curp->outmdoc) |
|
(*curp->outmdoc)(curp->outdata, mdoc); |
|
} |
} |
|
|
static void |
static void |
Line 1022 spawn_pager(void) |
|
Line 1027 spawn_pager(void) |
|
/* Hand over to the pager. */ |
/* Hand over to the pager. */ |
|
|
execvp(argv[0], argv); |
execvp(argv[0], argv); |
fprintf(stderr, "%s: exec: %s\n", |
fprintf(stderr, "%s: exec %s: %s\n", |
progname, strerror(errno)); |
progname, argv[0], strerror(errno)); |
exit((int)MANDOCLEVEL_SYSERR); |
exit((int)MANDOCLEVEL_SYSERR); |
} |
} |