version 1.49.2.5, 2013/09/18 00:54:20 |
version 1.49.2.10, 2013/11/21 01:53:48 |
|
|
#include <string.h> |
#include <string.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
#if defined(__linux__) |
#if defined(__APPLE__) |
|
# include <libkern/OSByteOrder.h> |
|
#elif defined(__linux__) |
# include <endian.h> |
# include <endian.h> |
|
#elif defined(__sun) |
|
# include <sys/byteorder.h> |
|
# include <sys/stat.h> |
|
#else |
|
# include <sys/endian.h> |
|
#endif |
|
|
|
#if defined(__linux__) || defined(__sun) |
# 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 615 index_merge(const struct of *of, struct mparse *mp, |
|
Line 622 index_merge(const struct of *of, struct mparse *mp, |
|
uint64_t vbuf[2]; |
uint64_t vbuf[2]; |
char type; |
char type; |
|
|
|
static char emptystring[] = ""; |
|
|
if (warnings) { |
if (warnings) { |
files = NULL; |
files = NULL; |
hash_reset(&files); |
hash_reset(&files); |
Line 727 index_merge(const struct of *of, struct mparse *mp, |
|
Line 736 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; |
val.size = 0; |
val.size = 0; |
if (0 == skip) |
if (0 == skip) |
val.data = ""; |
val.data = emptystring; |
else { |
else { |
ch = (*files->get)(files, &key, &val, 0); |
ch = (*files->get)(files, &key, &val, 0); |
if (ch < 0) { |
if (ch < 0) { |
Line 1756 ofile_dirbuild(const char *dir, const char* psec, cons |
|
Line 1765 ofile_dirbuild(const char *dir, const char* psec, cons |
|
int p_src_form, struct of **of) |
int p_src_form, struct of **of) |
{ |
{ |
char buf[PATH_MAX]; |
char buf[PATH_MAX]; |
|
#if defined(__sun) |
|
struct stat sb; |
|
#endif |
size_t sz; |
size_t sz; |
DIR *d; |
DIR *d; |
const char *fn, *sec, *arch; |
const char *fn, *sec, *arch; |
Line 1778 ofile_dirbuild(const char *dir, const char* psec, cons |
|
Line 1790 ofile_dirbuild(const char *dir, const char* psec, cons |
|
|
|
src_form = p_src_form; |
src_form = p_src_form; |
|
|
|
#if defined(__sun) |
|
stat(dp->d_name, &sb); |
|
if (S_IFDIR & sb.st_mode) { |
|
#else |
if (DT_DIR == dp->d_type) { |
if (DT_DIR == dp->d_type) { |
|
#endif |
sec = psec; |
sec = psec; |
arch = parch; |
arch = parch; |
|
|
Line 1835 ofile_dirbuild(const char *dir, const char* psec, cons |
|
Line 1852 ofile_dirbuild(const char *dir, const char* psec, cons |
|
continue; |
continue; |
} |
} |
|
|
|
#if defined(__sun) |
|
if (0 == S_IFREG & sb.st_mode) { |
|
#else |
if (DT_REG != dp->d_type) { |
if (DT_REG != dp->d_type) { |
|
#endif |
if (warnings) |
if (warnings) |
fprintf(stderr, |
fprintf(stderr, |
"%s/%s: not a regular file\n", |
"%s/%s: not a regular file\n", |