Lines Matching refs:dba

51 int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode TSRMLS_DC) {  in flatfile_store()  argument
53 if (flatfile_findkey(dba, key_datum TSRMLS_CC)) { in flatfile_store()
56 php_stream_seek(dba->fp, 0L, SEEK_END); in flatfile_store()
57 php_stream_printf(dba->fp TSRMLS_CC, "%zu\n", key_datum.dsize); in flatfile_store()
58 php_stream_flush(dba->fp); in flatfile_store()
59 if (php_stream_write(dba->fp, key_datum.dptr, key_datum.dsize) < key_datum.dsize) { in flatfile_store()
62 php_stream_printf(dba->fp TSRMLS_CC, "%zu\n", value_datum.dsize); in flatfile_store()
63 php_stream_flush(dba->fp); in flatfile_store()
64 if (php_stream_write(dba->fp, value_datum.dptr, value_datum.dsize) < value_datum.dsize) { in flatfile_store()
68 flatfile_delete(dba, key_datum TSRMLS_CC); in flatfile_store()
69 php_stream_printf(dba->fp TSRMLS_CC, "%zu\n", key_datum.dsize); in flatfile_store()
70 php_stream_flush(dba->fp); in flatfile_store()
71 if (php_stream_write(dba->fp, key_datum.dptr, key_datum.dsize) < key_datum.dsize) { in flatfile_store()
74 php_stream_printf(dba->fp TSRMLS_CC, "%zu\n", value_datum.dsize); in flatfile_store()
75 if (php_stream_write(dba->fp, value_datum.dptr, value_datum.dsize) < value_datum.dsize) { in flatfile_store()
80 php_stream_flush(dba->fp); in flatfile_store()
87 datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC) { in flatfile_fetch() argument
91 if (flatfile_findkey(dba, key_datum TSRMLS_CC)) { in flatfile_fetch()
92 if (php_stream_gets(dba->fp, buf, sizeof(buf))) { in flatfile_fetch()
95 value_datum.dsize = php_stream_read(dba->fp, value_datum.dptr, value_datum.dsize); in flatfile_fetch()
107 int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC) { in flatfile_delete() argument
115 php_stream_rewind(dba->fp); in flatfile_delete()
116 while(!php_stream_eof(dba->fp)) { in flatfile_delete()
118 if (!php_stream_gets(dba->fp, buf, 15)) { in flatfile_delete()
126 pos = php_stream_tell(dba->fp); in flatfile_delete()
129 num = php_stream_read(dba->fp, buf, num); in flatfile_delete()
135 php_stream_seek(dba->fp, pos, SEEK_SET); in flatfile_delete()
136 php_stream_putc(dba->fp, 0); in flatfile_delete()
137 php_stream_flush(dba->fp); in flatfile_delete()
138 php_stream_seek(dba->fp, 0L, SEEK_END); in flatfile_delete()
144 if (!php_stream_gets(dba->fp, buf, 15)) { in flatfile_delete()
153 num = php_stream_read(dba->fp, buf, num); in flatfile_delete()
165 int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC) { in flatfile_findkey() argument
173 php_stream_rewind(dba->fp); in flatfile_findkey()
174 while (!php_stream_eof(dba->fp)) { in flatfile_findkey()
175 if (!php_stream_gets(dba->fp, buf, 15)) { in flatfile_findkey()
183 num = php_stream_read(dba->fp, buf, num); in flatfile_findkey()
193 if (!php_stream_gets(dba->fp, buf, 15)) { in flatfile_findkey()
201 num = php_stream_read(dba->fp, buf, num); in flatfile_findkey()
213 datum flatfile_firstkey(flatfile *dba TSRMLS_DC) { in flatfile_firstkey()
219 php_stream_rewind(dba->fp); in flatfile_firstkey()
220 while(!php_stream_eof(dba->fp)) { in flatfile_firstkey()
221 if (!php_stream_gets(dba->fp, buf, 15)) { in flatfile_firstkey()
229 num = php_stream_read(dba->fp, buf, num); in flatfile_firstkey()
234 dba->CurrentFlatFilePos = php_stream_tell(dba->fp); in flatfile_firstkey()
239 if (!php_stream_gets(dba->fp, buf, 15)) { in flatfile_firstkey()
247 num = php_stream_read(dba->fp, buf, num); in flatfile_firstkey()
261 datum flatfile_nextkey(flatfile *dba TSRMLS_DC) { in flatfile_nextkey()
267 php_stream_seek(dba->fp, dba->CurrentFlatFilePos, SEEK_SET); in flatfile_nextkey()
268 while(!php_stream_eof(dba->fp)) { in flatfile_nextkey()
269 if (!php_stream_gets(dba->fp, buf, 15)) { in flatfile_nextkey()
277 num = php_stream_read(dba->fp, buf, num); in flatfile_nextkey()
281 if (!php_stream_gets(dba->fp, buf, 15)) { in flatfile_nextkey()
289 num = php_stream_read(dba->fp, buf, num); in flatfile_nextkey()
294 dba->CurrentFlatFilePos = php_stream_tell(dba->fp); in flatfile_nextkey()