version 1.3, 2016/07/29 15:29:32 |
version 1.7, 2016/08/17 18:59:37 |
|
|
* Allocation-based version of the mandoc database, for read-write access. |
* Allocation-based version of the mandoc database, for read-write access. |
* The interface is defined in "dba.h". |
* The interface is defined in "dba.h". |
*/ |
*/ |
|
#include "config.h" |
|
|
#include <sys/types.h> |
#include <sys/types.h> |
|
#if HAVE_ENDIAN |
|
#include <endian.h> |
|
#elif HAVE_SYS_ENDIAN |
|
#include <sys/endian.h> |
|
#elif HAVE_NTOHL |
|
#include <arpa/inet.h> |
|
#endif |
#include <errno.h> |
#include <errno.h> |
#include <stdint.h> |
#include <stdint.h> |
#include <stdlib.h> |
#include <stdlib.h> |
Line 134 dba_page_new(struct dba_array *pages, const char *name |
|
Line 143 dba_page_new(struct dba_array *pages, const char *name |
|
|
|
page = dba_array_new(DBP_MAX, 0); |
page = dba_array_new(DBP_MAX, 0); |
entry = dba_array_new(1, DBA_STR | DBA_GROW); |
entry = dba_array_new(1, DBA_STR | DBA_GROW); |
dba_array_add(entry, prepend(name, NAME_FILE & NAME_MASK)); |
if (name != NULL) |
|
dba_array_add(entry, prepend(name, NAME_FILE & NAME_MASK)); |
dba_array_add(page, entry); |
dba_array_add(page, entry); |
entry = dba_array_new(1, DBA_STR | DBA_GROW); |
entry = dba_array_new(1, DBA_STR | DBA_GROW); |
dba_array_add(entry, (void *)sect); |
dba_array_add(entry, (void *)sect); |
Line 168 dba_page_add(struct dba_array *page, int32_t ie, const |
|
Line 178 dba_page_add(struct dba_array *page, int32_t ie, const |
|
if (ie == DBP_ARCH) { |
if (ie == DBP_ARCH) { |
if (entries == NULL) |
if (entries == NULL) |
return; |
return; |
if (str == NULL) { |
if (str == NULL || *str == '\0') { |
dba_array_free(entries); |
dba_array_free(entries); |
dba_array_set(page, DBP_ARCH, NULL); |
dba_array_set(page, DBP_ARCH, NULL); |
return; |
return; |