fmk Fri Apr 28 19:03:58 2006 UTC Modified files: /php-src/ext/standard image.c file.c http_fopen_wrapper.c /php-src/main php_streams.h /php-src/ext/spl spl_directory.c Log: Remove ZSTR() from stream macros. Calling function must apply this macro
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/image.c?r1=1.122&r2=1.123&diff_format=u Index: php-src/ext/standard/image.c diff -u php-src/ext/standard/image.c:1.122 php-src/ext/standard/image.c:1.123 --- php-src/ext/standard/image.c:1.122 Sat Apr 22 10:39:30 2006 +++ php-src/ext/standard/image.c Fri Apr 28 19:03:57 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: image.c,v 1.122 2006/04/22 10:39:30 fmk Exp $ */ +/* $Id: image.c,v 1.123 2006/04/28 19:03:57 fmk Exp $ */ #include "php.h" #include <stdio.h> @@ -1023,7 +1023,7 @@ if (php_stream_rewind(stream)) { return 0; } - while ((fline=php_stream_gets(stream, NULL, 0)) != NULL) { + while ((fline=php_stream_gets(stream, NULL_ZSTR, 0)) != NULL) { iname = estrdup(fline); /* simple way to get necessary buffer of required size */ if (sscanf(fline, "#define %s %d", iname, &value) == 2) { if (!(type = strrchr(iname, '_'))) { http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/file.c?r1=1.438&r2=1.439&diff_format=u Index: php-src/ext/standard/file.c diff -u php-src/ext/standard/file.c:1.438 php-src/ext/standard/file.c:1.439 --- php-src/ext/standard/file.c:1.438 Sat Apr 22 10:39:30 2006 +++ php-src/ext/standard/file.c Fri Apr 28 19:03:57 2006 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.438 2006/04/22 10:39:30 fmk Exp $ */ +/* $Id: file.c,v 1.439 2006/04/28 19:03:57 fmk Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -1049,7 +1049,7 @@ php_stream_from_zval(stream, &zstream); - buf.v = php_stream_get_line_ex(stream, stream->readbuf_type, NULL, 0, length, &retlen); + buf.v = php_stream_get_line_ex(stream, stream->readbuf_type, NULL_ZSTR, 0, length, &retlen); if (!buf.v) { RETURN_FALSE; } @@ -1110,7 +1110,7 @@ php_stream_from_zval(stream, &zstream); if (stream->readbuf_type == IS_UNICODE) { - UChar *buf = php_stream_get_line_ex(stream, IS_UNICODE, NULL, 0, length, &retlen); + UChar *buf = php_stream_get_line_ex(stream, IS_UNICODE, NULL_ZSTR, 0, length, &retlen); UChar *allowed = NULL; int allowed_len = 0; @@ -1127,7 +1127,7 @@ RETURN_UNICODEL(buf, retlen, 0); } else { /* IS_STRING */ - char *buf = php_stream_get_line_ex(stream, IS_STRING, NULL, 0, length, &retlen); + char *buf = php_stream_get_line_ex(stream, IS_STRING, NULL_ZSTR, 0, length, &retlen); char *allowed = NULL; int allowed_len = 0; @@ -1189,7 +1189,7 @@ } - buf = php_stream_get_line((php_stream *) what, NULL, 0, &len); + buf = php_stream_get_line((php_stream *) what, NULL_ZSTR, 0, &len); if (buf == NULL) { efree(args); RETURN_FALSE; @@ -2056,12 +2056,12 @@ } if (len < 0) { - if ((buf = php_stream_get_line(stream, NULL, 0, &buf_len)) == NULL) { + if ((buf = php_stream_get_line(stream, NULL_ZSTR, 0, &buf_len)) == NULL) { RETURN_FALSE; } } else { buf = emalloc(len + 1); - if (php_stream_get_line(stream, buf, len + 1, &buf_len) == NULL) { + if (php_stream_get_line(stream, ZSTR(buf), len + 1, &buf_len) == NULL) { efree(buf); RETURN_FALSE; } @@ -2153,7 +2153,7 @@ memcpy(tptr, line_end, line_end_len); tptr += line_end_len; - if ((new_buf = php_stream_get_line(stream, NULL, 0, &new_len)) == NULL) { + if ((new_buf = php_stream_get_line(stream, NULL_ZSTR, 0, &new_len)) == NULL) { /* we've got an unterminated enclosure, * assign all the data from the start of * the enclosure to end of data to the http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/http_fopen_wrapper.c?r1=1.115&r2=1.116&diff_format=u Index: php-src/ext/standard/http_fopen_wrapper.c diff -u php-src/ext/standard/http_fopen_wrapper.c:1.115 php-src/ext/standard/http_fopen_wrapper.c:1.116 --- php-src/ext/standard/http_fopen_wrapper.c:1.115 Sun Apr 16 17:41:26 2006 +++ php-src/ext/standard/http_fopen_wrapper.c Fri Apr 28 19:03:57 2006 @@ -19,7 +19,7 @@ | Sara Golemon <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: http_fopen_wrapper.c,v 1.115 2006/04/16 17:41:26 iliaa Exp $ */ +/* $Id: http_fopen_wrapper.c,v 1.116 2006/04/28 19:03:57 fmk Exp $ */ #include "php.h" #include "php_globals.h" @@ -232,7 +232,7 @@ char header_line[HTTP_HEADER_BLOCK_SIZE]; /* get response header */ - while (php_stream_gets(stream, header_line, HTTP_HEADER_BLOCK_SIZE-1) != NULL) { + while (php_stream_gets(stream, ZSTR(header_line), HTTP_HEADER_BLOCK_SIZE-1) != NULL) { if (header_line[0] == '\n' || header_line[0] == '\r' || header_line[0] == '\0') { @@ -520,7 +520,7 @@ size_t tmp_line_len; /* get response header */ - if (php_stream_get_line(stream, tmp_line, sizeof(tmp_line) - 1, &tmp_line_len) != NULL) { + if (php_stream_get_line(stream, ZSTR(tmp_line), sizeof(tmp_line) - 1, &tmp_line_len) != NULL) { zval *http_response; int response_code; @@ -574,7 +574,7 @@ while (!body && !php_stream_eof(stream)) { size_t http_header_line_length; - if (php_stream_get_line(stream, http_header_line, HTTP_HEADER_BLOCK_SIZE, &http_header_line_length) && *http_header_line != '\n' && *http_header_line != '\r') { + if (php_stream_get_line(stream, ZSTR(http_header_line), HTTP_HEADER_BLOCK_SIZE, &http_header_line_length) && *http_header_line != '\n' && *http_header_line != '\r') { char *e = http_header_line + http_header_line_length - 1; while (*e == '\n' || *e == '\r') { e--; http://cvs.php.net/viewcvs.cgi/php-src/main/php_streams.h?r1=1.112&r2=1.113&diff_format=u Index: php-src/main/php_streams.h diff -u php-src/main/php_streams.h:1.112 php-src/main/php_streams.h:1.113 --- php-src/main/php_streams.h:1.112 Tue Apr 18 19:09:31 2006 +++ php-src/main/php_streams.h Fri Apr 28 19:03:58 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_streams.h,v 1.112 2006/04/18 19:09:31 pollita Exp $ */ +/* $Id: php_streams.h,v 1.113 2006/04/28 19:03:58 fmk Exp $ */ #ifndef PHP_STREAMS_H #define PHP_STREAMS_H @@ -323,12 +323,12 @@ #define php_stream_flush(stream) _php_stream_flush((stream), 0 TSRMLS_CC) PHPAPI void *_php_stream_get_line(php_stream *stream, int buf_type, zstr buf, size_t maxlen, size_t maxchars, size_t *returned_len TSRMLS_DC); -#define php_stream_get_line(stream, buf, maxlen, retlen) _php_stream_get_line((stream), IS_STRING, ZSTR(buf), (maxlen), 0, (retlen) TSRMLS_CC) +#define php_stream_get_line(stream, buf, maxlen, retlen) _php_stream_get_line((stream), IS_STRING, buf, (maxlen), 0, (retlen) TSRMLS_CC) #define php_stream_get_line_ex(stream, buf_type, buf, maxlen, maxchars, retlen) \ - _php_stream_get_line((stream), (buf_type), ZSTR(buf), (maxlen), (maxchars), (retlen) TSRMLS_CC) -#define php_stream_gets(stream, buf, maxlen) _php_stream_get_line((stream), IS_STRING, ZSTR(buf), (maxlen), 0, NULL TSRMLS_CC) + _php_stream_get_line((stream), (buf_type), buf, (maxlen), (maxchars), (retlen) TSRMLS_CC) +#define php_stream_gets(stream, buf, maxlen) _php_stream_get_line((stream), IS_STRING, buf, (maxlen), 0, NULL TSRMLS_CC) #define php_stream_gets_ex(stream, buf_type, buf, maxlen, maxchars) \ - _php_stream_get_line((stream), (buf_type), ZSTR(buf), (maxlen), (maxchars), NULL TSRMLS_CC) + _php_stream_get_line((stream), (buf_type), buf, (maxlen), (maxchars), NULL TSRMLS_CC) PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *returned_len, char *delim, size_t delim_len TSRMLS_DC); PHPAPI UChar *php_stream_get_record_unicode(php_stream *stream, size_t maxlen, size_t maxchars, size_t *returned_len, UChar *delim, size_t delim_len TSRMLS_DC); http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_directory.c?r1=1.90&r2=1.91&diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.90 php-src/ext/spl/spl_directory.c:1.91 --- php-src/ext/spl/spl_directory.c:1.90 Sat Apr 22 10:39:30 2006 +++ php-src/ext/spl/spl_directory.c Fri Apr 28 19:03:58 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: spl_directory.c,v 1.90 2006/04/22 10:39:30 fmk Exp $ */ +/* $Id: spl_directory.c,v 1.91 2006/04/28 19:03:58 fmk Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -1349,14 +1349,14 @@ if (intern->u.file.max_line_len > 0) { buf = emalloc((intern->u.file.max_line_len + 1) * sizeof(char)); - if (php_stream_get_line(intern->u.file.stream, buf, intern->u.file.max_line_len, &line_len) == NULL) { + if (php_stream_get_line(intern->u.file.stream, ZSTR(buf), intern->u.file.max_line_len, &line_len) == NULL) { efree(buf); buf = NULL; } else { buf[line_len] = '\0'; } } else { - buf = php_stream_get_line(intern->u.file.stream, NULL, 0, &line_len); + buf = php_stream_get_line(intern->u.file.stream, NULL_ZSTR, 0, &line_len); } if (!buf) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php