version 1.19, 2011/12/01 23:46:26 |
version 1.24, 2011/12/04 14:23:29 |
|
|
#include <string.h> |
#include <string.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
#include <arpa/inet.h> |
#if defined(__linux__) |
|
# include <endian.h> |
#ifdef __linux__ |
|
# include <db_185.h> |
# include <db_185.h> |
|
#elif defined(__APPLE__) |
|
# include <libkern/OSByteOrder.h> |
|
# include <db.h> |
#else |
#else |
# include <db.h> |
# include <db.h> |
#endif |
#endif |
Line 628 index_merge(const struct of *of, struct mparse *mp, |
|
Line 630 index_merge(const struct of *of, struct mparse *mp, |
|
* into the database. |
* into the database. |
*/ |
*/ |
|
|
vbuf.rec = htonl(rec); |
vbuf.rec = htobe32(rec); |
seq = R_FIRST; |
seq = R_FIRST; |
while (0 == (ch = (*hash->seq)(hash, &key, &val, seq))) { |
while (0 == (ch = (*hash->seq)(hash, &key, &val, seq))) { |
seq = R_NEXT; |
seq = R_NEXT; |
vbuf.mask = *(uint64_t *)val.data; |
vbuf.mask = htobe64(*(uint64_t *)val.data); |
val.size = sizeof(struct db_val); |
val.size = sizeof(struct db_val); |
val.data = &vbuf; |
val.data = &vbuf; |
dbt_put(db, dbf, &key, &val); |
dbt_put(db, dbf, &key, &val); |
Line 732 index_prune(const struct of *ofile, DB *db, const char |
|
Line 734 index_prune(const struct of *ofile, DB *db, const char |
|
break; |
break; |
|
|
vbuf = val.data; |
vbuf = val.data; |
if (*maxrec != ntohl(vbuf->rec)) |
if (*maxrec != betoh32(vbuf->rec)) |
continue; |
continue; |
|
|
if ((ch = (*db->del)(db, &key, R_CURSOR)) < 0) |
if ((ch = (*db->del)(db, &key, R_CURSOR)) < 0) |
Line 1415 ofile_argbuild(int argc, char *argv[], struct of **of) |
|
Line 1417 ofile_argbuild(int argc, char *argv[], struct of **of) |
|
*p = '\0'; |
*p = '\0'; |
continue; |
continue; |
} |
} |
if (strncmp("man", p + 1, 3)) { |
if (0 == strncmp("man", p + 1, 3)) |
src_form |= MANDOC_SRC; |
src_form |= MANDOC_SRC; |
arch = p + 1; |
else if (0 == strncmp("cat", p + 1, 3)) |
} else if (strncmp("cat", p + 1, 3)) { |
|
src_form |= MANDOC_FORM; |
src_form |= MANDOC_FORM; |
|
else |
arch = p + 1; |
arch = p + 1; |
} |
|
break; |
break; |
} |
} |
if (NULL == title) |
if (NULL == title) |