38 #include <sys/types.h>
47 #if defined XAPIAN_HAS_GLASS_BACKEND || \
48 defined XAPIAN_HAS_HONEY_BACKEND
51 if (
io_read(fd, magic_buf, 14) == 14 &&
52 lseek(fd,
pos, SEEK_SET) ==
pos &&
53 memcmp(magic_buf,
"\x0f\x0dXapian ", 9) == 0) {
54 switch (magic_buf[9]) {
55 #ifdef XAPIAN_HAS_GLASS_BACKEND
57 if (memcmp(magic_buf + 10,
"lass", 4) == 0) {
62 #ifdef XAPIAN_HAS_HONEY_BACKEND
64 if (memcmp(magic_buf + 10,
"oney", 4) == 0) {
81 off_t
pos = lseek(fd, 0, SEEK_CUR);
94 #if defined XAPIAN_HAS_GLASS_BACKEND || \
95 defined XAPIAN_HAS_HONEY_BACKEND
int test_if_single_file_db(int fd)
Probe if a file descriptor is a single-file database.
static int test_if_single_file_db_(int fd, off_t pos)
Helper functions for database handling.
Definitions, types, etc for use inside glass.
#define GLASS_MIN_BLOCKSIZE
Minimum B-tree block size.
Definitions, types, etc for use inside honey.
#define HONEY_MIN_DB_SIZE
Minimum size to pad a honey table to.
size_t io_read(int fd, char *p, size_t n, size_t min)
Read n bytes (or until EOF) into block pointed to by p from file descriptor fd.
Wrappers for low-level POSIX I/O routines.
Various assertion macros.
Provides wrappers with POSIXy semantics.
include <sys/stat.h> with portability enhancements
<unistd.h>, but with compat.