Lines Matching refs:cdb

46 	dba_cdb *cdb = (dba_cdb *) info->dbf
49 struct cdb c;
61 DBA_OPEN_FUNC(cdb) in DBA_OPEN_FUNC() argument
69 dba_cdb *cdb; in DBA_OPEN_FUNC() local
100 cdb = pemalloc(sizeof(dba_cdb), info->flags&DBA_PERSISTENT); in DBA_OPEN_FUNC()
101 memset(cdb, 0, sizeof(dba_cdb)); in DBA_OPEN_FUNC()
105 cdb_make_start(&cdb->m, file); in DBA_OPEN_FUNC()
107 cdb_init(&cdb->c, file); in DBA_OPEN_FUNC()
109 cdb->make = make; in DBA_OPEN_FUNC()
111 cdb_init(&cdb->c, file); in DBA_OPEN_FUNC()
113 cdb->file = file; in DBA_OPEN_FUNC()
115 pinfo->dbf = cdb; in DBA_OPEN_FUNC()
119 DBA_CLOSE_FUNC(cdb) in DBA_CLOSE_FUNC() argument
125 if (cdb->make) { in DBA_CLOSE_FUNC()
126 cdb_make_finish(&cdb->m); in DBA_CLOSE_FUNC()
128 cdb_free(&cdb->c); in DBA_CLOSE_FUNC()
131 cdb_free(&cdb->c); in DBA_CLOSE_FUNC()
132 close(cdb->file); in DBA_CLOSE_FUNC()
134 pefree(cdb, info->flags&DBA_PERSISTENT); in DBA_CLOSE_FUNC()
138 # define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos) argument
139 # define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len) argument
140 # define php_cdb_find(cdb, key, len) cdb_find(cdb, key, len) argument
142 # define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos) argument
143 # define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len) argument
144 # define php_cdb_find(cdb, key, len) cdb_find(cdb, key, len) argument
147 DBA_FETCH_FUNC(cdb) in DBA_FETCH_FUNC() argument
154 if (cdb->make) in DBA_FETCH_FUNC()
157 if (php_cdb_find(&cdb->c, key, keylen) == 1) { in DBA_FETCH_FUNC()
159 if (php_cdb_findnext(&cdb->c, key, keylen) != 1) { in DBA_FETCH_FUNC()
163 len = cdb_datalen(&cdb->c); in DBA_FETCH_FUNC()
166 if (php_cdb_read(&cdb->c, new_entry, len, cdb_datapos(&cdb->c)) == -1) { in DBA_FETCH_FUNC()
178 DBA_UPDATE_FUNC(cdb) in DBA_UPDATE_FUNC() argument
183 if (!cdb->make) in DBA_UPDATE_FUNC()
187 if (cdb_make_add(&cdb->m, key, keylen, val, vallen) != -1) in DBA_UPDATE_FUNC()
193 DBA_EXISTS_FUNC(cdb) in DBA_EXISTS_FUNC() argument
198 if (cdb->make) in DBA_EXISTS_FUNC()
201 if (php_cdb_find(&cdb->c, key, keylen) == 1) in DBA_EXISTS_FUNC()
206 DBA_DELETE_FUNC(cdb) in DBA_DELETE_FUNC() argument
220 if (cdb_file_read(cdb->file, buf, n) < n) return NULL; \
238 if (n >= cdb->eod) return NULL; \
239 if (cdb_file_lseek(cdb->file, (zend_off_t)n, SEEK_SET) != (zend_off_t) n) return NULL; \
243 DBA_FIRSTKEY_FUNC(cdb) in DBA_FIRSTKEY_FUNC() argument
251 if (cdb->make) in DBA_FIRSTKEY_FUNC()
255 cdb->eod = -1; in DBA_FIRSTKEY_FUNC()
260 uint32_unpack(buf, &cdb->eod); in DBA_FIRSTKEY_FUNC()
270 if (cdb_file_read(cdb->file, key, klen) < klen) { in DBA_FIRSTKEY_FUNC()
279 cdb->pos = 2048 + 4 + 4 + klen + dlen; in DBA_FIRSTKEY_FUNC()
284 DBA_NEXTKEY_FUNC(cdb) in DBA_NEXTKEY_FUNC() argument
292 if (cdb->make) in DBA_NEXTKEY_FUNC()
296 CSEEK(cdb->pos); in DBA_NEXTKEY_FUNC()
302 if (cdb_file_read(cdb->file, key, klen) < klen) { in DBA_NEXTKEY_FUNC()
310 cdb->pos += 8 + klen + dlen; in DBA_NEXTKEY_FUNC()
315 DBA_OPTIMIZE_FUNC(cdb) in DBA_OPTIMIZE_FUNC() argument
320 DBA_SYNC_FUNC(cdb) in DBA_SYNC_FUNC() argument
326 DBA_INFO_FUNC(cdb) in DBA_INFO_FUNC() argument