38# ifdef CDB_INCLUDE_FILE
39# include CDB_INCLUDE_FILE
44 dba_cdb *cdb = (dba_cdb *) info->dbf
68 dba_info *pinfo = (dba_info *) info;
78 *
error =
"Unable to open file";
90 *
error =
"Update operations are not supported";
94 *
error =
"Currently not supported";
98 cdb =
pemalloc(
sizeof(dba_cdb), info->flags&DBA_PERSISTENT);
101#ifdef DBA_CDB_BUILTIN
122#ifdef DBA_CDB_BUILTIN
135#ifdef DBA_CDB_BUILTIN
136# define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos)
137# define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len)
138# define php_cdb_find(cdb, key, len) cdb_find(cdb, key, len)
140# define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos)
141# define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len)
142# define php_cdb_find(cdb, key, len) cdb_find(cdb, key, len)
151#ifdef DBA_CDB_BUILTIN
162 fetched_val = zend_string_alloc(
len,
false);
176#ifdef DBA_CDB_BUILTIN
193#ifdef DBA_CDB_BUILTIN
208#ifdef DBA_CDB_BUILTIN
209# define cdb_file_read(fildes, buf, size) php_stream_read(fildes, buf, size)
211# define cdb_file_read(fildes, buf, size) read(fildes, buf, size)
215#define CREAD(n) do { \
216 if (cdb_file_read(cdb->file, buf, n) < n) return NULL; \
221#ifdef DBA_CDB_BUILTIN
233#define CSEEK(n) do { \
234 if (n >= cdb->eod) return NULL; \
235 if (cdb_file_lseek(cdb->file, (zend_off_t)n, SEEK_SET) != (zend_off_t) n) return NULL; \
239DBA_FIRSTKEY_FUNC(
cdb)
246#ifdef DBA_CDB_BUILTIN
265 key = zend_string_alloc(klen,
false);
274 cdb->pos = 2048 + 4 + 4 + klen + dlen;
286#ifdef DBA_CDB_BUILTIN
296 key = zend_string_alloc(klen,
false);
304 cdb->pos += 8 + klen + dlen;
309DBA_OPTIMIZE_FUNC(
cdb)
322#ifdef DBA_CDB_BUILTIN
323 if (!
strcmp(hnd->name,
"cdb")) {
file(string $filename, int $flags=0, $context=null)
void cdb_init(struct cdb *c, php_stream *fp)
void cdb_free(struct cdb *c)
const char * cdb_version(void)
const char * cdb_make_version(void)
int cdb_make_finish(struct cdb_make *c)
int cdb_make_start(struct cdb_make *c, php_stream *f)
int cdb_make_add(struct cdb_make *c, char *key, unsigned int keylen, char *data, unsigned int datalen)
memset(ptr, 0, type->size)
zend_ffi_ctype_name_buf buf
unsigned const char * pos
unsigned char key[REFLECTION_KEY_LEN]
struct _php_stream php_stream
#define php_stream_seek(stream, offset, whence)
#define php_stream_tell(stream)
void uint32_unpack(const char *in, uint32 *out)
#define pefree(ptr, persistent)
#define pemalloc(size, persistent)
strcmp(string $string1, string $string2)
zend_string_release_ex(func->internal_function.function_name, 0)
struct _zend_string zend_string
#define VCWD_OPEN(path, flags)