]> granicus.if.org Git - php/commitdiff
- Fix build
authorMarcus Boerger <helly@php.net>
Thu, 11 May 2006 20:10:29 +0000 (20:10 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 11 May 2006 20:10:29 +0000 (20:10 +0000)
ext/dba/libflatfile/flatfile.c
ext/dba/libinifile/inifile.c

index b16338c76cc89e7495d02364da73397938dd1345..45aa15a07c20ac3a7da70eb3d36770e45545bed4 100644 (file)
@@ -37,6 +37,8 @@
 
 #include "flatfile.h"
 
+#define _php_stream_gets(stream, buf, len) php_stream_gets(stream, (zstr)((char*)buf), len)
+
 #define FLATFILE_BLOCK_SIZE 1024
 
 /*
@@ -88,7 +90,7 @@ datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC) {
        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);
@@ -114,7 +116,7 @@ int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC) {
        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);
@@ -140,7 +142,7 @@ int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC) {
                }       
 
                /* 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);
@@ -171,7 +173,7 @@ int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC) {
 
        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);
@@ -189,7 +191,7 @@ int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC) {
                                break;
                        }
                }       
-               if (!php_stream_gets(dba->fp, buf, 15)) {
+               if (!_php_stream_gets(dba->fp, buf, 15)) {
                        break;
                }
                num = atoi(buf);
@@ -217,7 +219,7 @@ datum flatfile_firstkey(flatfile *dba TSRMLS_DC) {
 
        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);
@@ -235,7 +237,7 @@ datum flatfile_firstkey(flatfile *dba TSRMLS_DC) {
                        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);
@@ -265,7 +267,7 @@ datum flatfile_nextkey(flatfile *dba TSRMLS_DC) {
 
        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);
@@ -277,7 +279,7 @@ datum flatfile_nextkey(flatfile *dba TSRMLS_DC) {
                if (num < 0)  {
                        break;
                }
-               if (!php_stream_gets(dba->fp, buf, 15)) {
+               if (!_php_stream_gets(dba->fp, buf, 15)) {
                        break;
                }
                num = atoi(buf);
index 24f2673e7340e796b8079e760a87c001237c4118..e74eef7f47bc767ab38e9f734acbfb4b6de28990 100644 (file)
@@ -169,7 +169,7 @@ static int inifile_read(inifile *dba, line_type *ln TSRMLS_DC) {
        char *pos;
 
        inifile_val_free(&ln->val);
-       while ((fline = php_stream_gets(dba->fp, NULL, 0)) != NULL) {
+       while ((fline = php_stream_gets(dba->fp, NULL_ZSTR, 0)) != NULL) {
                if (fline) {
                        if (fline[0] == '[') {
                                /* A value name cannot start with '['