nlopess         Thu Jul 27 15:53:47 2006 UTC

  Modified files:              
    /php-src/ext/zlib   zlib.c 
  Log:
  convert void* to zstr when using the 't' parameter type
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib.c?r1=1.202&r2=1.203&diff_format=u
Index: php-src/ext/zlib/zlib.c
diff -u php-src/ext/zlib/zlib.c:1.202 php-src/ext/zlib/zlib.c:1.203
--- php-src/ext/zlib/zlib.c:1.202       Sat Jul  8 21:54:49 2006
+++ php-src/ext/zlib/zlib.c     Thu Jul 27 15:53:47 2006
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: zlib.c,v 1.202 2006/07/08 21:54:49 nlopess Exp $ */
+/* $Id: zlib.c,v 1.203 2006/07/27 15:53:47 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -275,7 +275,7 @@
    Read and uncompress entire .gz-file into an array */
 PHP_FUNCTION(gzfile)
 {
-       void *filename;
+       zstr filename;
        int filename_len;
        zend_uchar filename_type;
        long flags = 0;
@@ -291,15 +291,15 @@
        use_include_path = flags ? USE_PATH : 0;
 
        if (filename_type == IS_UNICODE) {
-               if (php_stream_path_encode(NULL, (char**)&filename, 
&filename_len, (UChar*)filename, filename_len, REPORT_ERRORS, NULL) == FAILURE) 
{
+               if (php_stream_path_encode(NULL, &filename.s, &filename_len, 
filename.u, filename_len, REPORT_ERRORS, NULL) == FAILURE) {
                        RETURN_FALSE;
                }
        }
 
        /* using a stream here is a bit more efficient (resource wise) than 
php_gzopen_wrapper */
-       stream = php_stream_gzopen(NULL, filename, "rb", use_include_path | 
REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC);
+       stream = php_stream_gzopen(NULL, filename.s, "rb", use_include_path | 
REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC);
        if (filename_type == IS_UNICODE) {
-               efree(filename);
+               efree(filename.s);
        }
        if (stream == NULL) {
                /* Error reporting is already done by stream code */
@@ -323,7 +323,7 @@
    Open a .gz-file and return a .gz-file pointer */
 PHP_FUNCTION(gzopen)
 {
-       void *filename;
+       zstr filename;
        char *mode;
        int filename_len, mode_len;
        zend_uchar filename_type;
@@ -338,15 +338,15 @@
        use_include_path = flags ? USE_PATH : 0;
 
        if (filename_type == IS_UNICODE) {
-               if (php_stream_path_encode(NULL, (char**)&filename, 
&filename_len, (UChar*)filename, filename_len, REPORT_ERRORS, NULL) == FAILURE) 
{
+               if (php_stream_path_encode(NULL, &filename.s, &filename_len, 
filename.u, filename_len, REPORT_ERRORS, NULL) == FAILURE) {
                        RETURN_FALSE;
                }
        }
 
-       stream = php_stream_gzopen(NULL, filename, mode, use_include_path | 
REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC);
+       stream = php_stream_gzopen(NULL, filename.s, mode, use_include_path | 
REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC);
 
        if (filename_type == IS_UNICODE) {
-               efree(filename);
+               efree(filename.s);
        }
        if (!stream) {
                RETURN_FALSE;
@@ -362,7 +362,7 @@
    Output a .gz-file */
 PHP_FUNCTION(readgzfile)
 {
-       char *filename;
+       zstr filename;
        int filename_len;
        zend_uchar filename_type;
        long flags = 0;
@@ -377,14 +377,14 @@
        use_include_path = flags ? USE_PATH : 0;
 
        if (filename_type == IS_UNICODE) {
-               if (php_stream_path_encode(NULL, &filename, &filename_len, 
(UChar*)filename, filename_len, REPORT_ERRORS, NULL) == FAILURE) {
+               if (php_stream_path_encode(NULL, &filename.s, &filename_len, 
filename.u, filename_len, REPORT_ERRORS, NULL) == FAILURE) {
                        RETURN_FALSE;
                }
        }
 
-       stream = php_stream_gzopen(NULL, filename, "rb", use_include_path, 
NULL, NULL STREAMS_CC TSRMLS_CC);
+       stream = php_stream_gzopen(NULL, filename.s, "rb", use_include_path, 
NULL, NULL STREAMS_CC TSRMLS_CC);
        if (filename_type == IS_UNICODE) {
-               efree(filename);
+               efree(filename.s);
        }
        if (!stream) {
                RETURN_FALSE;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to