version 1.49.2.8, 2013/10/05 20:30:05 |
version 1.49.2.14, 2014/03/23 12:04:54 |
|
|
#include <string.h> |
#include <string.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
#if defined(__linux__) || defined(__sun) |
#if defined(__APPLE__) |
# include <endian.h> |
|
# include <db_185.h> |
|
#elif defined(__APPLE__) |
|
# include <libkern/OSByteOrder.h> |
# include <libkern/OSByteOrder.h> |
# include <db.h> |
#elif defined(__linux__) |
|
# include <endian.h> |
|
#elif defined(__sun) |
|
# include <sys/byteorder.h> |
|
# include <sys/stat.h> |
#else |
#else |
# include <sys/endian.h> |
# include <sys/endian.h> |
# include <db.h> |
|
#endif |
#endif |
|
|
#if defined(__sun) |
#if defined(__linux__) || defined(__sun) |
#include <sys/stat.h> |
# include <db_185.h> |
|
#else |
|
# include <db.h> |
#endif |
#endif |
|
|
#include "man.h" |
#include "man.h" |
#include "mdoc.h" |
#include "mdoc.h" |
#include "mandoc.h" |
#include "mandoc.h" |
|
#include "mandoc_aux.h" |
#include "mandocdb.h" |
#include "mandocdb.h" |
#include "manpath.h" |
#include "manpath.h" |
|
|
Line 286 static const struct mdoc_handler mdocs[MDOC_MAX] = { |
|
Line 289 static const struct mdoc_handler mdocs[MDOC_MAX] = { |
|
}; |
}; |
|
|
static const char *progname; |
static const char *progname; |
|
static int mparse_options; /* abort the parse early */ |
static int use_all; /* Use all directories and files. */ |
static int use_all; /* Use all directories and files. */ |
static int verb; /* Output verbosity level. */ |
static int verb; /* Output verbosity level. */ |
static int warnings; /* Potential problems in manuals. */ |
static int warnings; /* Potential problems in manuals. */ |
Line 326 main(int argc, char *argv[]) |
|
Line 330 main(int argc, char *argv[]) |
|
hash = NULL; |
hash = NULL; |
op = OP_DEFAULT; |
op = OP_DEFAULT; |
dir = NULL; |
dir = NULL; |
|
mparse_options = MPARSE_SO; |
|
|
while (-1 != (ch = getopt(argc, argv, "aC:d:tu:vW"))) |
while (-1 != (ch = getopt(argc, argv, "aC:d:Qtu:vW"))) |
switch (ch) { |
switch (ch) { |
case ('a'): |
case ('a'): |
use_all = 1; |
use_all = 1; |
Line 350 main(int argc, char *argv[]) |
|
Line 355 main(int argc, char *argv[]) |
|
dir = optarg; |
dir = optarg; |
op = OP_UPDATE; |
op = OP_UPDATE; |
break; |
break; |
|
case ('Q'): |
|
mparse_options |= MPARSE_QUICK; |
|
break; |
case ('t'): |
case ('t'): |
dup2(STDOUT_FILENO, STDERR_FILENO); |
dup2(STDOUT_FILENO, STDERR_FILENO); |
if (op) { |
if (op) { |
Line 392 main(int argc, char *argv[]) |
|
Line 400 main(int argc, char *argv[]) |
|
info.lorder = 4321; |
info.lorder = 4321; |
info.flags = R_DUP; |
info.flags = R_DUP; |
|
|
mp = mparse_alloc(MPARSE_AUTO, MANDOCLEVEL_FATAL, NULL, NULL, NULL); |
mp = mparse_alloc(mparse_options, MANDOCLEVEL_FATAL, NULL, NULL); |
|
|
memset(&buf, 0, sizeof(struct buf)); |
memset(&buf, 0, sizeof(struct buf)); |
memset(&dbuf, 0, sizeof(struct buf)); |
memset(&dbuf, 0, sizeof(struct buf)); |
|
|
|
|
usage: |
usage: |
fprintf(stderr, |
fprintf(stderr, |
"usage: %s [-avvv] [-C file] | dir ... | -t file ...\n" |
"usage: %s [-aQvvv] [-C file] | dir ... | -t file ...\n" |
" -d dir [file ...] | " |
" -d dir [file ...] | " |
"-u dir [file ...]\n", |
"-u dir [file ...]\n", |
progname); |
progname); |
Line 644 index_merge(const struct of *of, struct mparse *mp, |
|
Line 652 index_merge(const struct of *of, struct mparse *mp, |
|
if ((MANDOC_SRC & of->src_form || |
if ((MANDOC_SRC & of->src_form || |
! (MANDOC_FORM & of->src_form)) && |
! (MANDOC_FORM & of->src_form)) && |
MANDOCLEVEL_FATAL > mparse_readfd(mp, -1, fn)) |
MANDOCLEVEL_FATAL > mparse_readfd(mp, -1, fn)) |
mparse_result(mp, &mdoc, &man); |
mparse_result(mp, &mdoc, &man, NULL); |
|
|
if (NULL != mdoc) { |
if (NULL != mdoc) { |
msec = mdoc_meta(mdoc)->msec; |
msec = mdoc_meta(mdoc)->msec; |
Line 734 index_merge(const struct of *of, struct mparse *mp, |
|
Line 742 index_merge(const struct of *of, struct mparse *mp, |
|
} |
} |
buf_appendb(buf, ")", 2); |
buf_appendb(buf, ")", 2); |
for (p = buf->cp; '\0' != *p; p++) |
for (p = buf->cp; '\0' != *p; p++) |
*p = tolower(*p); |
*p = tolower((unsigned char)*p); |
key.data = buf->cp; |
key.data = buf->cp; |
key.size = buf->len; |
key.size = buf->len; |
val.data = NULL; |
val.data = NULL; |