summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2002-03-18 18:54:32 +0000
committerWez Furlong <wez@php.net>2002-03-18 18:54:32 +0000
commitc9d5e137380893c2608ebe4aefeb46026d5efcef (patch)
tree898f5a7e8894a9fe9f9fdbb0a0fa8080bebbbc72 /ext
parent41c1c084953a6a5024c56df2b79bcb1fad820633 (diff)
downloadphp-git-c9d5e137380893c2608ebe4aefeb46026d5efcef.tar.gz
TSRMLS related work on streams, as discussed with Zeev.
# Should be the last "broad" commit for a while # Don't forget to make clean ; make
Diffstat (limited to 'ext')
-rw-r--r--ext/exif/exif.c2
-rw-r--r--ext/ftp/ftp.c2
-rwxr-xr-xext/mailparse/mailparse.c4
-rw-r--r--ext/standard/file.c8
-rw-r--r--ext/standard/file.h2
-rw-r--r--ext/standard/fsock.c4
-rw-r--r--ext/standard/ftp_fopen_wrapper.c14
-rw-r--r--ext/standard/http_fopen_wrapper.c4
-rw-r--r--ext/standard/image.c94
-rw-r--r--ext/standard/php_fopen_wrapper.c2
-rw-r--r--ext/standard/php_fopen_wrappers.h4
-rw-r--r--ext/standard/php_image.h2
-rw-r--r--ext/zlib/php_zlib.h2
-rw-r--r--ext/zlib/zlib.c2
-rw-r--r--ext/zlib/zlib_fopen_wrapper.c14
15 files changed, 83 insertions, 77 deletions
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 264d62f149..7fdf6c9f87 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -3271,7 +3271,7 @@ PHP_FUNCTION(exif_imagetype)
rsrc_id = ZEND_REGISTER_RESOURCE(NULL, stream, php_file_le_stream());
- itype = itype = php_getimagetype(stream, NULL);
+ itype = itype = php_getimagetype(stream, NULL TSRMLS_CC);
zend_list_delete(rsrc_id);
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index c3a7818534..b41367926a 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -547,6 +547,7 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type)
char *ptr;
int lastch;
int rcvd;
+ TSRMLS_FETCH();
if (ftp == NULL)
return 0;
@@ -619,6 +620,7 @@ ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type)
int size;
char *ptr;
int ch;
+ TSRMLS_FETCH();
if (ftp == NULL)
return 0;
diff --git a/ext/mailparse/mailparse.c b/ext/mailparse/mailparse.c
index 3df3df56a0..4a102e2831 100755
--- a/ext/mailparse/mailparse.c
+++ b/ext/mailparse/mailparse.c
@@ -153,6 +153,7 @@ static void mailparse_rfc822t_errfunc(const char * msg, int num)
static void mailparse_do_uudecode(php_stream * instream, php_stream * outstream)
{
int A, B, C, D, n;
+ TSRMLS_FETCH();
while(!php_stream_eof(instream)) {
UU_NEXT(n);
@@ -375,10 +376,13 @@ PHP_FUNCTION(mailparse_determine_best_xfer_encoding)
static int mailparse_stream_output(int c, void *stream)
{
char buf = c;
+ TSRMLS_FETCH();
+
return php_stream_write((php_stream*)stream, &buf, 1);
}
static int mailparse_stream_flush(void *stream)
{
+ TSRMLS_FETCH();
return php_stream_flush((php_stream*)stream);
}
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 2036df7e05..9aa1948247 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -254,7 +254,7 @@ PHP_FUNCTION(get_meta_tags)
tok_last = TOK_EOF;
- while (!done && (tok = php_next_meta_token(&md)) != TOK_EOF) {
+ while (!done && (tok = php_next_meta_token(&md TSRMLS_CC)) != TOK_EOF) {
if (tok == TOK_ID) {
if (tok_last == TOK_OPENTAG) {
md.in_meta = !strcasecmp("meta", md.token_data);
@@ -785,7 +785,7 @@ PHP_FUNCTION(socket_set_blocking)
if (php_set_sock_blocking(socketd, block) == FAILURE)
RETURN_FALSE;
- php_stream_sock_set_blocking((php_stream*)what, block == 0 ? 0 : 1);
+ php_stream_sock_set_blocking((php_stream*)what, block == 0 ? 0 : 1 TSRMLS_CC);
RETURN_TRUE;
}
RETURN_FALSE;
@@ -832,7 +832,7 @@ PHP_FUNCTION(socket_set_timeout)
t.tv_usec = 0;
if (php_stream_is((php_stream*)what, PHP_STREAM_IS_SOCKET)) {
- php_stream_sock_set_timeout((php_stream*)what, &t);
+ php_stream_sock_set_timeout((php_stream*)what, &t TSRMLS_CC);
RETURN_TRUE;
}
@@ -1947,7 +1947,7 @@ PHP_FUNCTION(realpath)
/* {{{ php_next_meta_token
Tokenizes an HTML file for get_meta_tags */
-php_meta_tags_token php_next_meta_token(php_meta_tags_data *md)
+php_meta_tags_token php_next_meta_token(php_meta_tags_data *md TSRMLS_DC)
{
int ch = 0, compliment;
char buff[META_DEF_BUFSIZE + 1];
diff --git a/ext/standard/file.h b/ext/standard/file.h
index d32b9c0cd3..a6929ad658 100644
--- a/ext/standard/file.h
+++ b/ext/standard/file.h
@@ -100,7 +100,7 @@ typedef struct _php_meta_tags_data {
int in_meta;
} php_meta_tags_data;
-php_meta_tags_token php_next_meta_token(php_meta_tags_data *);
+php_meta_tags_token php_next_meta_token(php_meta_tags_data * TSRMLS_DC);
typedef struct {
int fgetss_state;
diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c
index 0cb188936d..1b8b51a237 100644
--- a/ext/standard/fsock.c
+++ b/ext/standard/fsock.c
@@ -205,10 +205,10 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
int ssl_ret = FAILURE;
switch(ssl_flags) {
case php_ssl_v23:
- ssl_ret = php_stream_sock_ssl_activate_with_method(stream, 1, SSLv23_client_method());
+ ssl_ret = php_stream_sock_ssl_activate_with_method(stream, 1, SSLv23_client_method() TSRMLS_CC);
break;
case php_ssl_tls:
- ssl_ret = php_stream_sock_ssl_activate_with_method(stream, 1, TLSv1_client_method());
+ ssl_ret = php_stream_sock_ssl_activate_with_method(stream, 1, TLSv1_client_method() TSRMLS_CC);
break;
default:
/* unknown ?? */
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index 8cd85b30d2..f204d1549f 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -66,7 +66,7 @@
#include "php_fopen_wrappers.h"
-static int php_get_ftp_result(php_stream *stream)
+static int php_get_ftp_result(php_stream *stream TSRMLS_DC)
{
char tmp_line[513];
@@ -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 STREAMS_DC)
+php_stream * php_stream_url_wrap_ftp(char *path, char *mode, int options, char **opened_path STREAMS_DC TSRMLS_DC)
{
php_stream *stream=NULL;
php_url *resource=NULL;
@@ -109,7 +109,7 @@ php_stream * php_stream_url_wrap_ftp(char *path, char *mode, int options, char *
goto errexit;
/* Start talking to ftp server */
- result = php_get_ftp_result(stream);
+ result = php_get_ftp_result(stream TSRMLS_CC);
if (result > 299 || result < 200)
goto errexit;
@@ -124,7 +124,7 @@ php_stream * php_stream_url_wrap_ftp(char *path, char *mode, int options, char *
php_stream_write_string(stream, "\r\n");
/* get the response */
- result = php_get_ftp_result(stream);
+ result = php_get_ftp_result(stream TSRMLS_CC);
/* if a password is required, send it */
if (result >= 300 && result <= 399) {
@@ -144,14 +144,14 @@ php_stream * php_stream_url_wrap_ftp(char *path, char *mode, int options, char *
php_stream_write_string(stream, "\r\n");
/* read the response */
- result = php_get_ftp_result(stream);
+ result = php_get_ftp_result(stream TSRMLS_CC);
}
if (result > 299 || result < 200)
goto errexit;
/* set the connection to be binary */
php_stream_write_string(stream, "TYPE I\r\n");
- result = php_get_ftp_result(stream);
+ result = php_get_ftp_result(stream TSRMLS_CC);
if (result > 299 || result < 200)
goto errexit;
@@ -161,7 +161,7 @@ php_stream * php_stream_url_wrap_ftp(char *path, char *mode, int options, char *
php_stream_write_string(stream, "\r\n");
/* read the response */
- result = php_get_ftp_result(stream);
+ result = php_get_ftp_result(stream TSRMLS_CC);
if (mode[0] == 'r') {
/* when reading file, it must exist */
if (result > 299 || result < 200) {
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index c5e5e3c037..aeaec330a8 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 STREAMS_DC)
+php_stream *php_stream_url_wrap_http(char *path, char *mode, int options, char **opened_path STREAMS_DC TSRMLS_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 STREAMS_CC);
+ stream = php_stream_url_wrap_http(new_path, mode, options, opened_path STREAMS_CC TSRMLS_CC);
if (stream->wrapperdata) {
entryp = &entry;
MAKE_STD_ZVAL(entry);
diff --git a/ext/standard/image.c b/ext/standard/image.c
index 73baa53158..9d6896c608 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -73,7 +73,7 @@ struct gfxinfo {
/* {{{ php_handle_gif
* routine to handle GIF files. If only everything were that easy... ;} */
-static struct gfxinfo *php_handle_gif (php_stream * stream)
+static struct gfxinfo *php_handle_gif (php_stream * stream TSRMLS_DC)
{
struct gfxinfo *result = NULL;
unsigned char a[2];
@@ -94,7 +94,7 @@ static struct gfxinfo *php_handle_gif (php_stream * stream)
/* {{{ php_handle_psd
*/
-static struct gfxinfo *php_handle_psd (php_stream * stream)
+static struct gfxinfo *php_handle_psd (php_stream * stream TSRMLS_DC)
{
struct gfxinfo *result = NULL;
unsigned char a[8];
@@ -121,7 +121,7 @@ static struct gfxinfo *php_handle_psd (php_stream * stream)
/* {{{ php_handle_bmp
*/
-static struct gfxinfo *php_handle_bmp (php_stream * stream)
+static struct gfxinfo *php_handle_bmp (php_stream * stream TSRMLS_DC)
{
struct gfxinfo *result = NULL;
char temp[15];
@@ -159,7 +159,7 @@ static unsigned long int php_swf_get_bits (unsigned char* buffer, unsigned int p
/* {{{ php_handle_swf
*/
-static struct gfxinfo *php_handle_swf (php_stream * stream)
+static struct gfxinfo *php_handle_swf (php_stream * stream TSRMLS_DC)
{
struct gfxinfo *result = NULL;
long bits;
@@ -180,7 +180,7 @@ static struct gfxinfo *php_handle_swf (php_stream * stream)
/* {{{ php_handle_png
* routine to handle PNG files */
-static struct gfxinfo *php_handle_png (php_stream * stream)
+static struct gfxinfo *php_handle_png (php_stream * stream TSRMLS_DC)
{
struct gfxinfo *result = NULL;
unsigned long in_width, in_height;
@@ -245,7 +245,7 @@ static struct gfxinfo *php_handle_png (php_stream * stream)
/* {{{ php_read2
*/
-static unsigned short php_read2(php_stream * stream)
+static unsigned short php_read2(php_stream * stream TSRMLS_DC)
{
unsigned char a[2];
@@ -258,7 +258,7 @@ static unsigned short php_read2(php_stream * stream)
/* {{{ php_next_marker
* get next marker byte from file */
-static unsigned int php_next_marker(php_stream * stream, int last_marker, int comment_correction, int ff_read)
+static unsigned int php_next_marker(php_stream * stream, int last_marker, int comment_correction, int ff_read TSRMLS_DC)
{
int a=0, marker;
@@ -311,9 +311,9 @@ static unsigned int php_next_marker(php_stream * stream, int last_marker, int co
/* {{{ php_skip_variable
* skip over a variable-length block; assumes proper length marker */
-static void php_skip_variable(php_stream * stream)
+static void php_skip_variable(php_stream * stream TSRMLS_DC)
{
- off_t length = ((unsigned int)php_read2(stream));
+ off_t length = ((unsigned int)php_read2(stream TSRMLS_CC));
length = length-2;
if (length)
@@ -325,14 +325,14 @@ static void php_skip_variable(php_stream * stream)
/* {{{ php_read_APP
*/
-static void php_read_APP(php_stream * stream, unsigned int marker, zval *info)
+static void php_read_APP(php_stream * stream, unsigned int marker, zval *info TSRMLS_DC)
{
unsigned short length;
unsigned char *buffer;
unsigned char markername[ 16 ];
zval *tmp;
- length = php_read2(stream);
+ length = php_read2(stream TSRMLS_CC);
length -= 2; /* length includes itself */
buffer = emalloc(length);
@@ -356,14 +356,14 @@ static void php_read_APP(php_stream * stream, unsigned int marker, zval *info)
/* {{{ php_handle_jpeg
main loop to parse JPEG structure */
-static struct gfxinfo *php_handle_jpeg (php_stream * stream, pval *info)
+static struct gfxinfo *php_handle_jpeg (php_stream * stream, pval *info TSRMLS_DC)
{
struct gfxinfo *result = NULL;
unsigned int marker = M_PSEUDO;
unsigned short length, ff_read=1;
for (;;) {
- marker = php_next_marker(stream, marker, 1, ff_read);
+ marker = php_next_marker(stream, marker, 1, ff_read TSRMLS_CC);
ff_read = 0;
switch (marker) {
case M_SOF0:
@@ -384,16 +384,16 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, pval *info)
result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo));
if ( !result)
return NULL;
- length = php_read2(stream);
+ length = php_read2(stream TSRMLS_CC);
result->bits = php_stream_getc(stream);
- result->height = php_read2(stream);
- result->width = php_read2(stream);
+ result->height = php_read2(stream TSRMLS_CC);
+ result->width = php_read2(stream TSRMLS_CC);
result->channels = php_stream_getc(stream);
if (!info || length<8) /* if we don't want an extanded info -> return */
return result;
php_stream_seek(stream, length-8, SEEK_CUR);
} else {
- php_skip_variable(stream);
+ php_skip_variable(stream TSRMLS_CC);
}
break;
@@ -414,9 +414,9 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, pval *info)
case M_APP14:
case M_APP15:
if (info) {
- php_read_APP(stream, marker, info); /* read all the app markes... */
+ php_read_APP(stream, marker, info TSRMLS_CC); /* read all the app markes... */
} else {
- php_skip_variable(stream);
+ php_skip_variable(stream TSRMLS_CC);
}
break;
@@ -426,7 +426,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, pval *info)
break;
default:
- php_skip_variable(stream); /* anything else isn't interesting */
+ php_skip_variable(stream TSRMLS_CC); /* anything else isn't interesting */
break;
}
}
@@ -443,7 +443,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, pval *info)
/* {{{ php_read4
*/
-static unsigned int php_read4(php_stream * stream)
+static unsigned int php_read4(php_stream * stream TSRMLS_DC)
{
unsigned char a[4];
@@ -459,32 +459,32 @@ static unsigned int php_read4(php_stream * stream)
/* {{{ php_handle_tiff
main loop to parse TIFF structure */
-static struct gfxinfo *php_handle_jpc(php_stream * stream)
+static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC)
{
struct gfxinfo *result = NULL;
unsigned int marker, dummy;
unsigned short length, ff_read = 1;
- marker = php_next_marker(stream, 0, 0, ff_read);
+ marker = php_next_marker(stream, 0, 0, ff_read TSRMLS_CC);
ff_read = 0;
if ( marker == JC_SIZ)
{
- length = php_read2(stream); /* Lsiz: length of segment */
+ length = php_read2(stream TSRMLS_CC); /* Lsiz: length of segment */
if ( length<42 || length>49191) /* read the spec */
return NULL;
result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo));
if ( !result)
return NULL;
- dummy = php_read2(stream); /* Rsiz: capabilities */
- result->height = php_read4(stream); /* Xsiz */
- result->width = php_read4(stream); /* Ysiz */
- dummy = php_read4(stream); /* X0siz */
- dummy = php_read4(stream); /* Y0siz */
- dummy = php_read4(stream); /* XTsiz */
- dummy = php_read4(stream); /* YTsiz */
- dummy = php_read4(stream); /* XT0siz */
- dummy = php_read4(stream); /* YT0siz */
- result->bits = php_read2(stream); /* Csiz: precision in bitss */
+ dummy = php_read2(stream TSRMLS_CC); /* Rsiz: capabilities */
+ result->height = php_read4(stream TSRMLS_CC); /* Xsiz */
+ result->width = php_read4(stream TSRMLS_CC); /* Ysiz */
+ dummy = php_read4(stream TSRMLS_CC); /* X0siz */
+ dummy = php_read4(stream TSRMLS_CC); /* Y0siz */
+ dummy = php_read4(stream TSRMLS_CC); /* XTsiz */
+ dummy = php_read4(stream TSRMLS_CC); /* YTsiz */
+ dummy = php_read4(stream TSRMLS_CC); /* XT0siz */
+ dummy = php_read4(stream TSRMLS_CC); /* YT0siz */
+ result->bits = php_read2(stream TSRMLS_CC); /* Csiz: precision in bitss */
result->channels = 0; /* don't know yet */
return result;
}
@@ -563,7 +563,7 @@ static unsigned php_ifd_get32u(void *Long, int motorola_intel)
/* {{{ php_handle_tiff
main loop to parse TIFF structure */
-static struct gfxinfo *php_handle_tiff (php_stream * stream, pval *info, int motorola_intel)
+static struct gfxinfo *php_handle_tiff (php_stream * stream, pval *info, int motorola_intel TSRMLS_DC)
{
struct gfxinfo *result = NULL;
int i, num_entries;
@@ -635,7 +635,7 @@ static struct gfxinfo *php_handle_tiff (php_stream * stream, pval *info, int mot
/* {{{ php_imagetype
detect filetype from first bytes */
-int php_getimagetype(php_stream * stream, char *filetype)
+PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC)
{
char tmp[8];
@@ -725,38 +725,38 @@ PHP_FUNCTION(getimagesize)
rsrc_id = ZEND_REGISTER_RESOURCE(NULL, stream, php_file_le_stream());
- itype = php_getimagetype(stream, NULL);
+ itype = php_getimagetype(stream, NULL TSRMLS_CC);
switch( itype) {
case IMAGE_FILETYPE_GIF:
- result = php_handle_gif (stream);
+ result = php_handle_gif (stream TSRMLS_CC);
break;
case IMAGE_FILETYPE_JPEG:
if (info) {
- result = php_handle_jpeg(stream, *info);
+ result = php_handle_jpeg(stream, *info TSRMLS_CC);
} else {
- result = php_handle_jpeg(stream, NULL);
+ result = php_handle_jpeg(stream, NULL TSRMLS_CC);
}
break;
case IMAGE_FILETYPE_PNG:
- result = php_handle_png(stream);
+ result = php_handle_png(stream TSRMLS_CC);
break;
case IMAGE_FILETYPE_SWF:
- result = php_handle_swf(stream);
+ result = php_handle_swf(stream TSRMLS_CC);
break;
case IMAGE_FILETYPE_PSD:
- result = php_handle_psd(stream);
+ result = php_handle_psd(stream TSRMLS_CC);
break;
case IMAGE_FILETYPE_BMP:
- result = php_handle_bmp(stream);
+ result = php_handle_bmp(stream TSRMLS_CC);
break;
case IMAGE_FILETYPE_TIFF_II:
- result = php_handle_tiff(stream, NULL, 0);
+ result = php_handle_tiff(stream, NULL, 0 TSRMLS_CC);
break;
case IMAGE_FILETYPE_TIFF_MM:
- result = php_handle_tiff(stream, NULL, 1);
+ result = php_handle_tiff(stream, NULL, 1 TSRMLS_CC);
break;
case IMAGE_FILETYPE_JPC:
- result = php_handle_jpc(stream);
+ result = php_handle_jpc(stream TSRMLS_CC);
break;
default:
case IMAGE_FILETYPE_UNKNOWN:
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index 3a56bd6706..cd1929c768 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 STREAMS_DC)
+php_stream * php_stream_url_wrap_php(char * path, char * mode, int options, char ** opened_path STREAMS_DC TSRMLS_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 d41d8cf4e6..3d23975b44 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 STREAMS_DC);
-php_stream *php_stream_url_wrap_ftp(char *path, char *mode, int options, char **opened_path STREAMS_DC);
+php_stream *php_stream_url_wrap_http(char *path, char *mode, int options, char **opened_path STREAMS_DC TSRMLS_DC);
+php_stream *php_stream_url_wrap_ftp(char *path, char *mode, int options, char **opened_path STREAMS_DC TSRMLS_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/standard/php_image.h b/ext/standard/php_image.h
index 3b54fdc1c3..94b2384924 100644
--- a/ext/standard/php_image.h
+++ b/ext/standard/php_image.h
@@ -45,6 +45,6 @@ typedef enum
} image_filetype;
/* }}} */
-extern int php_getimagetype(php_stream *stream, char *filetype);
+PHPAPI int php_getimagetype(php_stream *stream, char *filetype TSRMLS_DC);
#endif /* PHP_IMAGE_H */
diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h
index 2c603d3e76..0872b3e4c5 100644
--- a/ext/zlib/php_zlib.h
+++ b/ext/zlib/php_zlib.h
@@ -66,7 +66,7 @@ PHP_FUNCTION(ob_gzhandler);
int php_enable_output_compression(int buffer_size TSRMLS_DC);
-php_stream *php_stream_gzopen(char *path, char *mode, int options, char **opened_path STREAMS_DC);
+php_stream *php_stream_gzopen(char *path, char *mode, int options, char **opened_path STREAMS_DC TSRMLS_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 881a5d0a0a..69060165bf 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -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 STREAMS_CC);
+ stream = php_stream_gzopen(Z_STRVAL_PP(filename), "rb", use_include_path|ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL STREAMS_CC TSRMLS_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 a3853074d6..49283982b9 100644
--- a/ext/zlib/zlib_fopen_wrapper.c
+++ b/ext/zlib/zlib_fopen_wrapper.c
@@ -28,7 +28,7 @@ struct php_gz_stream_data_t {
php_stream *stream;
};
-static size_t php_gziop_read(php_stream *stream, char *buf, size_t count)
+static size_t php_gziop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *)stream->abstract;
@@ -41,33 +41,33 @@ static size_t php_gziop_read(php_stream *stream, char *buf, size_t count)
return gzread(self->gz_file, buf, count);
}
-static char *php_gziop_gets(php_stream *stream, char *buf, size_t size)
+static char *php_gziop_gets(php_stream *stream, char *buf, size_t size TSRMLS_DC)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *)stream->abstract;
return gzgets(self->gz_file, buf, size);
}
-static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count)
+static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *)stream->abstract;
return gzwrite(self->gz_file, (char*)buf, count);
}
-static int php_gziop_seek(php_stream *stream, off_t offset, int whence)
+static int php_gziop_seek(php_stream *stream, off_t offset, int whence TSRMLS_DC)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *)stream->abstract;
return gzseek(self->gz_file, offset, whence);
}
-static int php_gziop_close(php_stream *stream, int close_handle)
+static int php_gziop_close(php_stream *stream, int close_handle TSRMLS_DC)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *)stream->abstract;
int ret = EOF;
if (close_handle)
ret = gzclose(self->gz_file);
- php_stream_free(self->stream, close_handle);
+ php_stream_free(self->stream, PHP_STREAM_FREE_CLOSE | (close_handle == 0 ? PHP_STREAM_FREE_PRESERVE_HANDLE : 0));
efree(self);
return ret;
@@ -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 STREAMS_DC)
+php_stream *php_stream_gzopen(char *path, char *mode, int options, char **opened_path STREAMS_DC TSRMLS_DC)
{
struct php_gz_stream_data_t *self;
php_stream *stream = NULL;