summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2002-03-17 22:50:59 +0000
committerWez Furlong <wez@php.net>2002-03-17 22:50:59 +0000
commitd2d8762267de33b954363189b4ec710e70527a2a (patch)
treeeb1a94dcc817decc20651b5999ccf3ea7699aadc /ext
parent19e82a49f96393a7ae93331db73ef895f3c61376 (diff)
downloadphp-git-d2d8762267de33b954363189b4ec710e70527a2a.tar.gz
Streams now make more use of the memory manager, so tracking down
leaking streams should be easier. # I hate these big commits
Diffstat (limited to 'ext')
-rw-r--r--ext/exif/exif.c4
-rw-r--r--ext/ftp/php_ftp.c4
-rw-r--r--ext/gd/gd.c4
-rwxr-xr-xext/mailparse/mailparse.c4
-rw-r--r--ext/ming/ming.c4
-rw-r--r--ext/pgsql/pgsql.c2
-rw-r--r--ext/standard/basic_functions.c18
-rw-r--r--ext/standard/ftp_fopen_wrapper.c2
-rw-r--r--ext/standard/http_fopen_wrapper.c4
-rw-r--r--ext/standard/image.c2
-rw-r--r--ext/standard/php_fopen_wrapper.c2
-rw-r--r--ext/standard/php_fopen_wrappers.h4
-rw-r--r--ext/zlib/php_zlib.h3
-rw-r--r--ext/zlib/zlib.c6
-rw-r--r--ext/zlib/zlib_fopen_wrapper.c4
15 files changed, 33 insertions, 34 deletions
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 37b60276cd..5cb796ee6c 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -2960,7 +2960,7 @@ int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_thumbnai
ImageInfo->motorola_intel = 0;
#ifdef HAVE_PHP_STREAM
- ImageInfo->infile = php_stream_open_wrapper(FileName, "rb", IGNORE_PATH|ENFORCE_SAFE_MODE, NULL TSRMLS_CC);
+ ImageInfo->infile = php_stream_open_wrapper(FileName, "rb", IGNORE_PATH|ENFORCE_SAFE_MODE, NULL);
#else
ImageInfo->infile = VCWD_FOPEN(FileName, "rb"); /* Unix ignores 'b', windows needs it. */
#endif
@@ -3264,7 +3264,7 @@ PHP_FUNCTION(exif_imagetype)
if (zend_get_parameters_ex(1, &arg1) == FAILURE)
WRONG_PARAM_COUNT;
- stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), "rb", IGNORE_PATH|ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL TSRMLS_CC);
+ stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), "rb", IGNORE_PATH|ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL);
if (stream == NULL) {
RETURN_FALSE;
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index 1012698966..d3fd331bfa 100644
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@ -480,7 +480,7 @@ PHP_FUNCTION(ftp_get)
RETURN_FALSE;
}
- outstream = php_stream_fopen(local, "wb", NULL TSRMLS_CC);
+ outstream = php_stream_fopen(local, "wb", NULL);
if (outstream == NULL) {
php_stream_close(tmpstream);
@@ -547,7 +547,7 @@ PHP_FUNCTION(ftp_put)
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
XTYPE(xtype, mode);
- instream = php_stream_fopen(local, "rb", NULL TSRMLS_CC);
+ instream = php_stream_fopen(local, "rb", NULL);
if (instream == NULL) {
RETURN_FALSE;
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 30ed567792..93766aa1c2 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -449,7 +449,7 @@ PHP_FUNCTION(imageloadfont)
convert_to_string_ex(file);
- stream = php_stream_open_wrapper(Z_STRVAL_PP(file), "rb", IGNORE_PATH|IGNORE_URL_WIN|REPORT_ERRORS, NULL TSRMLS_CC);
+ stream = php_stream_open_wrapper(Z_STRVAL_PP(file), "rb", IGNORE_PATH|IGNORE_URL_WIN|REPORT_ERRORS, NULL);
if (stream == NULL) {
RETURN_FALSE;
}
@@ -1150,7 +1150,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
fn = Z_STRVAL_PP(file);
- stream = php_stream_open_wrapper(fn, "rb", REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL TSRMLS_CC);
+ stream = php_stream_open_wrapper(fn, "rb", REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL);
if (stream == NULL) {
RETURN_FALSE;
}
diff --git a/ext/mailparse/mailparse.c b/ext/mailparse/mailparse.c
index b86ee79ade..3df3df56a0 100755
--- a/ext/mailparse/mailparse.c
+++ b/ext/mailparse/mailparse.c
@@ -193,7 +193,7 @@ PHP_FUNCTION(mailparse_uudecode_all)
instream = (php_stream*)zend_fetch_resource(&file TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream());
ZEND_VERIFY_RESOURCE(instream);
- outstream = php_stream_fopen_temporary_file(NULL, "mailparse", &outpath TSRMLS_CC);
+ outstream = php_stream_fopen_temporary_file(NULL, "mailparse", &outpath);
if (outstream == NULL) {
zend_error(E_WARNING, "%s(): unable to open temp file", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
@@ -232,7 +232,7 @@ PHP_FUNCTION(mailparse_uudecode_all)
add_assoc_string(item, "origfilename", origfilename, 1);
/* create a temp file for the data */
- partstream = php_stream_fopen_temporary_file(NULL, "mailparse", &outpath TSRMLS_CC);
+ partstream = php_stream_fopen_temporary_file(NULL, "mailparse", &outpath);
if (partstream) {
nparts++;
add_assoc_string(item, "filename", outpath, 0);
diff --git a/ext/ming/ming.c b/ext/ming/ming.c
index 7233e3e4d2..7cf91e0027 100644
--- a/ext/ming/ming.c
+++ b/ext/ming/ming.c
@@ -1157,7 +1157,7 @@ PHP_FUNCTION(swffont_init)
php_stream * stream;
FILE * file;
- stream = php_stream_open_wrapper(Z_STRVAL_PP(zfile), "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL TSRMLS_CC);
+ stream = php_stream_open_wrapper(Z_STRVAL_PP(zfile), "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
if(stream == NULL) {
RETURN_FALSE;
@@ -1602,7 +1602,7 @@ PHP_FUNCTION(swfmovie_save)
convert_to_string_ex(x);
- stream = php_stream_open_wrapper(Z_STRVAL_PP(x), "wb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL TSRMLS_CC);
+ stream = php_stream_open_wrapper(Z_STRVAL_PP(x), "wb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
if (stream == NULL)
RETURN_FALSE;
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 43eae5d0d4..e82379127e 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -1468,7 +1468,7 @@ PHP_FUNCTION(pg_trace)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, z_pgsql_link, id, "PostgreSQL link", le_link, le_plink);
convert_to_string_ex(z_filename);
- stream = php_stream_open_wrapper(Z_STRVAL_PP(z_filename), mode, ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL TSRMLS_CC);
+ stream = php_stream_open_wrapper(Z_STRVAL_PP(z_filename), mode, ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL);
if (!stream) {
RETURN_FALSE;
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index b0607df3ea..faec631bfb 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -1005,14 +1005,14 @@ PHP_MINIT_FUNCTION(basic)
if (PG(allow_url_fopen)) {
- if (FAILURE == php_register_url_stream_wrapper("http", &php_stream_http_wrapper TSRMLS_CC))
+ if (FAILURE == php_register_url_stream_wrapper("http", &php_stream_http_wrapper))
return FAILURE;
- if (FAILURE == php_register_url_stream_wrapper("php", &php_stream_php_wrapper TSRMLS_CC))
+ if (FAILURE == php_register_url_stream_wrapper("php", &php_stream_php_wrapper))
return FAILURE;
- if (FAILURE == php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper TSRMLS_CC))
+ if (FAILURE == php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper))
return FAILURE;
# if HAVE_OPENSSL_EXT
- if (FAILURE == php_register_url_stream_wrapper("https", &php_stream_http_wrapper TSRMLS_CC))
+ if (FAILURE == php_register_url_stream_wrapper("https", &php_stream_http_wrapper))
return FAILURE;
# endif
}
@@ -1030,11 +1030,11 @@ PHP_MSHUTDOWN_FUNCTION(basic)
#endif
if (PG(allow_url_fopen)) {
- php_unregister_url_stream_wrapper("http" TSRMLS_CC);
- php_unregister_url_stream_wrapper("ftp" TSRMLS_CC);
- php_unregister_url_stream_wrapper("php" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("http");
+ php_unregister_url_stream_wrapper("ftp");
+ php_unregister_url_stream_wrapper("php");
# if HAVE_OPENSSL_EXT
- php_unregister_url_stream_wrapper("https" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("https");
# endif
}
@@ -1532,7 +1532,7 @@ PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers T
break;
case 3: /*save to a file */
- stream = php_stream_open_wrapper(opt, "a", IGNORE_URL | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL TSRMLS_CC);
+ stream = php_stream_open_wrapper(opt, "a", IGNORE_URL | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL);
if (!stream)
return FAILURE;
php_stream_write(stream, message, strlen(message));
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index ade1e86f36..8cd85b30d2 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -85,7 +85,7 @@ php_stream_wrapper php_stream_ftp_wrapper = {
/* {{{ php_fopen_url_wrap_ftp
*/
-php_stream * php_stream_url_wrap_ftp(char *path, char *mode, int options, char **opened_path TSRMLS_DC)
+php_stream * php_stream_url_wrap_ftp(char *path, char *mode, int options, char **opened_path STREAMS_DC)
{
php_stream *stream=NULL;
php_url *resource=NULL;
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index 9cada1fb52..c5e5e3c037 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -71,7 +71,7 @@
#define HTTP_HEADER_BLOCK_SIZE 1024
-php_stream *php_stream_url_wrap_http(char *path, char *mode, int options, char **opened_path TSRMLS_DC)
+php_stream *php_stream_url_wrap_http(char *path, char *mode, int options, char **opened_path STREAMS_DC)
{
php_stream *stream = NULL;
php_url *resource = NULL;
@@ -268,7 +268,7 @@ php_stream *php_stream_url_wrap_http(char *path, char *mode, int options, char *
else {
strlcpy(new_path, location, sizeof(new_path));
}
- stream = php_stream_url_wrap_http(new_path, mode, options, opened_path TSRMLS_CC);
+ stream = php_stream_url_wrap_http(new_path, mode, options, opened_path STREAMS_CC);
if (stream->wrapperdata) {
entryp = &entry;
MAKE_STD_ZVAL(entry);
diff --git a/ext/standard/image.c b/ext/standard/image.c
index 9761fb1845..73baa53158 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -717,7 +717,7 @@ PHP_FUNCTION(getimagesize)
break;
}
- stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), "rb", REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL TSRMLS_CC);
+ stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), "rb", REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL);
if (!stream) {
RETURN_FALSE;
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index 37b3b2b90f..3a56bd6706 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -30,7 +30,7 @@
#include "php_standard.h"
#include "php_fopen_wrappers.h"
-php_stream * php_stream_url_wrap_php(char * path, char * mode, int options, char ** opened_path TSRMLS_DC)
+php_stream * php_stream_url_wrap_php(char * path, char * mode, int options, char ** opened_path STREAMS_DC)
{
FILE * fp = NULL;
php_stream * stream = NULL;
diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h
index 0d235b945d..d41d8cf4e6 100644
--- a/ext/standard/php_fopen_wrappers.h
+++ b/ext/standard/php_fopen_wrappers.h
@@ -23,8 +23,8 @@
#ifndef PHP_FOPEN_WRAPPERS_H
#define PHP_FOPEN_WRAPPERS_H
-php_stream *php_stream_url_wrap_http(char *path, char *mode, int options, char **opened_path TSRMLS_DC);
-php_stream *php_stream_url_wrap_ftp(char *path, char *mode, int options, char **opened_path TSRMLS_DC);
+php_stream *php_stream_url_wrap_http(char *path, char *mode, int options, char **opened_path STREAMS_DC);
+php_stream *php_stream_url_wrap_ftp(char *path, char *mode, int options, char **opened_path STREAMS_DC);
php_stream_wrapper php_stream_http_wrapper;
php_stream_wrapper php_stream_ftp_wrapper;
php_stream_wrapper php_stream_php_wrapper;
diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h
index 10a40cd96a..2c603d3e76 100644
--- a/ext/zlib/php_zlib.h
+++ b/ext/zlib/php_zlib.h
@@ -64,10 +64,9 @@ PHP_FUNCTION(gzinflate);
PHP_FUNCTION(gzencode);
PHP_FUNCTION(ob_gzhandler);
-FILE *zlib_fopen_wrapper(const char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC);
int php_enable_output_compression(int buffer_size TSRMLS_DC);
-php_stream *php_stream_gzopen(char *path, char *mode, int options, char **opened_path TSRMLS_DC);
+php_stream *php_stream_gzopen(char *path, char *mode, int options, char **opened_path STREAMS_DC);
extern php_stream_ops php_stream_gzio_ops;
extern php_stream_wrapper php_stream_gzip_wrapper;
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 44edcbdcd3..35ef2a179d 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -188,7 +188,7 @@ PHP_MINIT_FUNCTION(zlib)
le_zp = zend_register_list_destructors_ex(phpi_destructor_gzclose, NULL, "zlib", module_number);
if(PG(allow_url_fopen)) {
- php_register_url_stream_wrapper("zlib", &php_stream_gzip_wrapper TSRMLS_CC);
+ php_register_url_stream_wrapper("zlib", &php_stream_gzip_wrapper);
}
REGISTER_LONG_CONSTANT("FORCE_GZIP", CODING_GZIP, CONST_CS | CONST_PERSISTENT);
@@ -255,7 +255,7 @@ static gzFile php_gzopen_wrapper(char *path, char *mode, int options TSRMLS_DC)
php_stream *stream = NULL;
int fd;
- stream = php_stream_open_wrapper(path, mode, options | REPORT_ERRORS, NULL TSRMLS_CC);
+ stream = php_stream_open_wrapper(path, mode, options | REPORT_ERRORS, NULL);
if (stream) {
if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD|PHP_STREAM_CAST_TRY_HARD, (void**)&fd, 1))
{
@@ -302,7 +302,7 @@ PHP_FUNCTION(gzfile)
convert_to_string_ex(filename);
/* using a stream here is a bit more efficient (resource wise) than php_gzopen_wrapper */
- stream = php_stream_gzopen(Z_STRVAL_PP(filename), "rb", use_include_path|ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL TSRMLS_CC);
+ stream = php_stream_gzopen(Z_STRVAL_PP(filename), "rb", use_include_path|ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL STREAMS_CC);
if (stream == NULL) {
php_error(E_WARNING,"gzFile(\"%s\") - %s",Z_STRVAL_PP(filename),strerror(errno));
RETURN_FALSE;
diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c
index 5d3129f843..c28ab6a1e5 100644
--- a/ext/zlib/zlib_fopen_wrapper.c
+++ b/ext/zlib/zlib_fopen_wrapper.c
@@ -80,7 +80,7 @@ php_stream_ops php_stream_gzio_ops = {
NULL, "ZLIB"
};
-php_stream *php_stream_gzopen(char *path, char *mode, int options, char **opened_path TSRMLS_DC)
+php_stream *php_stream_gzopen(char *path, char *mode, int options, char **opened_path STREAMS_DC)
{
struct php_gz_stream_data_t *self;
php_stream *stream = NULL;
@@ -90,7 +90,7 @@ php_stream *php_stream_gzopen(char *path, char *mode, int options, char **opened
if (strncmp("zlib:", path, 5) == 0)
path += 5;
- self->stream = php_stream_open_wrapper(path, mode, options, opened_path TSRMLS_CC);
+ self->stream = php_stream_open_wrapper(path, mode, options, opened_path);
if (self->stream) {
int fd;