diff options
author | Wez Furlong <wez@php.net> | 2002-03-18 18:54:32 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2002-03-18 18:54:32 +0000 |
commit | c9d5e137380893c2608ebe4aefeb46026d5efcef (patch) | |
tree | 898f5a7e8894a9fe9f9fdbb0a0fa8080bebbbc72 /ext/standard | |
parent | 41c1c084953a6a5024c56df2b79bcb1fad820633 (diff) | |
download | php-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/standard')
-rw-r--r-- | ext/standard/file.c | 8 | ||||
-rw-r--r-- | ext/standard/file.h | 2 | ||||
-rw-r--r-- | ext/standard/fsock.c | 4 | ||||
-rw-r--r-- | ext/standard/ftp_fopen_wrapper.c | 14 | ||||
-rw-r--r-- | ext/standard/http_fopen_wrapper.c | 4 | ||||
-rw-r--r-- | ext/standard/image.c | 94 | ||||
-rw-r--r-- | ext/standard/php_fopen_wrapper.c | 2 | ||||
-rw-r--r-- | ext/standard/php_fopen_wrappers.h | 4 | ||||
-rw-r--r-- | ext/standard/php_image.h | 2 |
9 files changed, 67 insertions, 67 deletions
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 */ |