#include "buffer.h"
#include <rz_types.h>
Go to the source code of this file.
|
int | cdb_make_start (struct cdb_make *, int) |
|
int | cdb_make_addbegin (struct cdb_make *, unsigned int, unsigned int) |
|
int | cdb_make_addend (struct cdb_make *, unsigned int, unsigned int, ut32) |
|
int | cdb_make_add (struct cdb_make *, const char *, unsigned int, const char *, unsigned int) |
|
int | cdb_make_finish (struct cdb_make *) |
|
◆ CDB_HPLIST
◆ cdb_make_add()
Definition at line 108 of file cdb_make.c.
int buffer_putalign(buffer *s, const char *buf, ut32 len)
int cdb_make_addend(struct cdb_make *c, ut32 keylen, ut32 datalen, ut32 h)
int cdb_make_addbegin(struct cdb_make *c, ut32 keylen, ut32 datalen)
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
RZ_API ut32 sdb_hash(const char *key)
References buffer_putalign(), c, cdb_make_addbegin(), cdb_make_addend(), key, and sdb_hash().
Referenced by sdb_disk_insert().
◆ cdb_make_addbegin()
◆ cdb_make_addend()
◆ cdb_make_finish()
Definition at line 124 of file cdb_make.c.
131 memsize =
c->memsize +
c->numentries;
139 c->hash =
c->split +
c->numentries;
141 for (u =
i = 0;
i < 256;
i++) {
146 for (
x =
c->head;
x;
x =
x->next) {
149 c->split[--
c->start[255 &
x->hp[
i].h]] =
x->hp[
i];
153 for (
i = 0;
i < 256;
i++) {
157 for (u = 0; u <
len; u++) {
158 c->hash[u].h =
c->hash[u].p = 0;
160 hp =
c->split +
c->start[
i];
161 for (u = 0; u <
count; u++) {
162 where = (hp->
h >> 8) %
len;
163 while (
c->hash[where].p) {
164 if (++where ==
len) {
168 c->hash[where] = *hp++;
170 for (u = 0; u <
len; u++) {
189 for (
x =
c->head;
x;) {
int buffer_putflush(buffer *s, const char *buf, ut32 len)
int buffer_flush(buffer *s)
void cdb_alloc_free(void *x)
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 count
static void ut32_pack(char s[4], ut32 u)
static int seek_set(int fd, off_t pos)
References buffer_flush(), buffer_putalign(), buffer_putflush(), c, cdb_alloc(), cdb_alloc_free(), count, cdb_hp::h, i, incpos(), len, n, seek_set(), UT32_MAX, ut32_pack(), and x.
Referenced by sdb_disk_finish().
◆ cdb_make_start()
Definition at line 37 of file cdb_make.c.
44 c->pos =
sizeof(
c->final);
47 for (
i = 0;
i < 256;
i++) {
void buffer_init(buffer *s, BufferOp op, int fd, char *buf, ut32 len)
int(* BufferOp)(int, const char *, int)
static const z80_opcode fd[]
References buffer_init(), c, fd, i, seek_set(), and write.
Referenced by sdb_disk_create().