version 1.1, 2016/07/19 21:31:55 |
version 1.4, 2016/08/30 22:01:07 |
|
|
* Map-based version of the mandoc database, for read-only access. |
* Map-based version of the mandoc database, for read-only access. |
* The interface is defined in "dbm.h". |
* The interface is defined in "dbm.h". |
*/ |
*/ |
|
#include "config.h" |
|
|
#include <assert.h> |
#include <assert.h> |
|
#if HAVE_ENDIAN |
#include <endian.h> |
#include <endian.h> |
|
#elif HAVE_SYS_ENDIAN |
|
#include <sys/endian.h> |
|
#elif HAVE_NTOHL |
|
#include <arpa/inet.h> |
|
#endif |
|
#if HAVE_ERR |
#include <err.h> |
#include <err.h> |
|
#endif |
#include <errno.h> |
#include <errno.h> |
#include <regex.h> |
#include <regex.h> |
#include <stdint.h> |
#include <stdint.h> |
Line 140 dbm_page_get(int32_t ip) |
|
Line 150 dbm_page_get(int32_t ip) |
|
assert(ip >= 0); |
assert(ip >= 0); |
assert(ip < npages); |
assert(ip < npages); |
res.name = dbm_get(pages[ip].name); |
res.name = dbm_get(pages[ip].name); |
|
if (res.name == NULL) |
|
res.name = "(NULL)"; |
res.sect = dbm_get(pages[ip].sect); |
res.sect = dbm_get(pages[ip].sect); |
|
if (res.sect == NULL) |
|
res.sect = "(NULL)"; |
res.arch = pages[ip].arch ? dbm_get(pages[ip].arch) : NULL; |
res.arch = pages[ip].arch ? dbm_get(pages[ip].arch) : NULL; |
res.desc = dbm_get(pages[ip].desc); |
res.desc = dbm_get(pages[ip].desc); |
|
if (res.desc == NULL) |
|
res.desc = "(NULL)"; |
res.file = dbm_get(pages[ip].file); |
res.file = dbm_get(pages[ip].file); |
|
if (res.file == NULL) |
|
res.file = " (NULL)"; |
res.addr = dbm_addr(pages + ip); |
res.addr = dbm_addr(pages + ip); |
return &res; |
return &res; |
} |
} |
Line 240 page_bytitle(enum iter arg_iter, const struct dbm_matc |
|
Line 258 page_bytitle(enum iter arg_iter, const struct dbm_matc |
|
default: |
default: |
abort(); |
abort(); |
} |
} |
ip = 0; |
if (cp == NULL) { |
|
iteration = ITER_NONE; |
|
match = NULL; |
|
cp = NULL; |
|
ip = npages; |
|
} else |
|
ip = 0; |
return res; |
return res; |
} |
} |
|
|