#include "flatfile.h"
+#define _php_stream_gets(stream, buf, len) php_stream_gets(stream, (zstr)((char*)buf), len)
+
#define FLATFILE_BLOCK_SIZE 1024
/*
char buf[16];
if (flatfile_findkey(dba, key_datum TSRMLS_CC)) {
- if (php_stream_gets(dba->fp, buf, sizeof(buf))) {
+ if (_php_stream_gets(dba->fp, buf, sizeof(buf))) {
value_datum.dsize = atoi(buf);
value_datum.dptr = safe_emalloc(value_datum.dsize, 1, 1);
value_datum.dsize = php_stream_read(dba->fp, value_datum.dptr, value_datum.dsize);
php_stream_rewind(dba->fp);
while(!php_stream_eof(dba->fp)) {
/* read in the length of the key name */
- if (!php_stream_gets(dba->fp, buf, 15)) {
+ if (!_php_stream_gets(dba->fp, buf, 15)) {
break;
}
num = atoi(buf);
}
/* read in the length of the value */
- if (!php_stream_gets(dba->fp, buf, 15)) {
+ if (!_php_stream_gets(dba->fp, buf, 15)) {
break;
}
num = atoi(buf);
php_stream_rewind(dba->fp);
while (!php_stream_eof(dba->fp)) {
- if (!php_stream_gets(dba->fp, buf, 15)) {
+ if (!_php_stream_gets(dba->fp, buf, 15)) {
break;
}
num = atoi(buf);
break;
}
}
- if (!php_stream_gets(dba->fp, buf, 15)) {
+ if (!_php_stream_gets(dba->fp, buf, 15)) {
break;
}
num = atoi(buf);
php_stream_rewind(dba->fp);
while(!php_stream_eof(dba->fp)) {
- if (!php_stream_gets(dba->fp, buf, 15)) {
+ if (!_php_stream_gets(dba->fp, buf, 15)) {
break;
}
num = atoi(buf);
res.dsize = num;
return res;
}
- if (!php_stream_gets(dba->fp, buf, 15)) {
+ if (!_php_stream_gets(dba->fp, buf, 15)) {
break;
}
num = atoi(buf);
php_stream_seek(dba->fp, dba->CurrentFlatFilePos, SEEK_SET);
while(!php_stream_eof(dba->fp)) {
- if (!php_stream_gets(dba->fp, buf, 15)) {
+ if (!_php_stream_gets(dba->fp, buf, 15)) {
break;
}
num = atoi(buf);
if (num < 0) {
break;
}
- if (!php_stream_gets(dba->fp, buf, 15)) {
+ if (!_php_stream_gets(dba->fp, buf, 15)) {
break;
}
num = atoi(buf);