9 #if HAVE_HEADER_SYS_MMAN_H
34 #if HAVE_HEADER_SYS_MMAN_H
44 #if !HAVE_HEADER_SYS_MMAN_H
53 if (
fd !=
c->fd &&
c->fd != -1) {
59 #if HAVE_HEADER_SYS_MMAN_H
61 if (
x == MAP_FAILED) {
62 eprintf(
"Cannot mmap %d\n", (
int)st.st_size);
69 char *
x =
calloc(1, st.st_size);
71 eprintf(
"Cannot malloc %d\n", (
int)st.st_size);
75 if (
read(
fd,
x, st.st_size) != st.st_size) {
116 const size_t szb =
sizeof buf;
118 int n = (szb >
len) ?
len : szb;
142 const int bufsz = ((u + 1) & 0xFF) ?
sizeof(
buf) :
sizeof(
buf) / 2;
148 if (bufsz ==
sizeof(
buf)) {
156 c->hslots = (
pos -
c->hpos) / (2 *
sizeof(
ut32));
161 u = ((u >> 8) %
c->hslots) << 3;
162 c->kpos =
c->hpos + u;
164 while (
c->loop <
c->hslots) {
173 c->kpos +=
sizeof(
buf);
174 if (
c->kpos ==
c->hpos + (
c->hslots << 3)) {
bool cdb_init(struct cdb *c, int fd)
bool cdb_getkvlen(struct cdb *c, ut32 *klen, ut32 *vlen, ut32 pos)
void cdb_free(struct cdb *c)
static int match(struct cdb *c, const char *key, ut32 len, ut32 pos)
bool cdb_read(struct cdb *c, char *buf, ut32 len, ut32 pos)
void cdb_findstart(struct cdb *c)
int cdb_findnext(struct cdb *c, ut32 u, const char *key, ut32 len)
static static fork const void static count close
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset fstat
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep lseek
RZ_API void Ht_() free(HtName_(Ht) *ht)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
void * calloc(size_t number, size_t size)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags mmap
static const void static count static fd struct stat static buf struct pollfd unsigned static timeout void static offset munmap
static int seek_set(int fd, off_t pos)
static void ut32_unpack(char s[4], ut32 *u)
static const z80_opcode fd[]
int read(izstream &zs, T *x, Items items)