diff options
Diffstat (limited to 'ext/standard/php_fopen_wrapper.c')
-rw-r--r-- | ext/standard/php_fopen_wrapper.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 8026b08d45..9239b37032 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -31,21 +31,21 @@ #include "php_fopen_wrappers.h" #include "SAPI.h" -static size_t php_stream_output_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */ +static size_t php_stream_output_write(php_stream *stream, const char *buf, size_t count) /* {{{ */ { PHPWRITE(buf, count); return count; } /* }}} */ -static size_t php_stream_output_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */ +static size_t php_stream_output_read(php_stream *stream, char *buf, size_t count) /* {{{ */ { stream->eof = 1; return 0; } /* }}} */ -static int php_stream_output_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */ +static int php_stream_output_close(php_stream *stream, int close_handle) /* {{{ */ { return 0; } @@ -69,20 +69,20 @@ typedef struct php_stream_input { /* {{{ */ } php_stream_input_t; /* }}} */ -static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */ +static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t count) /* {{{ */ { return -1; } /* }}} */ -static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */ +static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count) /* {{{ */ { php_stream_input_t *input = stream->abstract; size_t read; if (!SG(post_read) && SG(read_post_bytes) < (int64_t)(input->position + count)) { /* read requested data from SAPI */ - int read_bytes = sapi_read_post_block(buf, count TSRMLS_CC); + int read_bytes = sapi_read_post_block(buf, count); if (read_bytes > 0) { php_stream_seek(input->body, 0, SEEK_END); @@ -103,7 +103,7 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count } /* }}} */ -static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */ +static int php_stream_input_close(php_stream *stream, int close_handle) /* {{{ */ { efree(stream->abstract); stream->abstract = NULL; @@ -112,13 +112,13 @@ static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC } /* }}} */ -static int php_stream_input_flush(php_stream *stream TSRMLS_DC) /* {{{ */ +static int php_stream_input_flush(php_stream *stream) /* {{{ */ { return -1; } /* }}} */ -static int php_stream_input_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC) /* {{{ */ +static int php_stream_input_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset) /* {{{ */ { php_stream_input_t *input = stream->abstract; @@ -144,7 +144,7 @@ php_stream_ops php_stream_input_ops = { NULL /* set_option */ }; -static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, int read_chain, int write_chain TSRMLS_DC) /* {{{ */ +static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, int read_chain, int write_chain) /* {{{ */ { char *p, *token; php_stream_filter *temp_filter; @@ -153,17 +153,17 @@ static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, i while (p) { php_url_decode(p, strlen(p)); if (read_chain) { - if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream) TSRMLS_CC))) { + if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream)))) { php_stream_filter_append(&stream->readfilters, temp_filter); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create filter (%s)", p); + php_error_docref(NULL, E_WARNING, "Unable to create filter (%s)", p); } } if (write_chain) { - if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream) TSRMLS_CC))) { + if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream)))) { php_stream_filter_append(&stream->writefilters, temp_filter); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create filter (%s)", p); + php_error_docref(NULL, E_WARNING, "Unable to create filter (%s)", p); } } p = php_strtok_r(NULL, "|", &token); @@ -172,7 +172,7 @@ static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, i /* }}} */ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, - char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */ + char **opened_path, php_stream_context *context STREAMS_DC) /* {{{ */ { int fd = -1; int mode_rw = 0; @@ -192,7 +192,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa path += 11; max_memory = ZEND_STRTOL(path, NULL, 10); if (max_memory < 0) { - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Max memory must be >= 0"); + php_error_docref(NULL, E_RECOVERABLE_ERROR, "Max memory must be >= 0"); return NULL; } } @@ -222,7 +222,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration"); + php_error_docref(NULL, E_WARNING, "URL file-access is disabled in the server configuration"); } return NULL; } @@ -241,7 +241,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa if (!strcasecmp(path, "stdin")) { if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration"); + php_error_docref(NULL, E_WARNING, "URL file-access is disabled in the server configuration"); } return NULL; } @@ -291,14 +291,14 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa if (strcmp(sapi_module.name, "cli")) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Direct access to file descriptors is only available from command-line PHP"); + php_error_docref(NULL, E_WARNING, "Direct access to file descriptors is only available from command-line PHP"); } return NULL; } if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration"); + php_error_docref(NULL, E_WARNING, "URL file-access is disabled in the server configuration"); } return NULL; } @@ -306,7 +306,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa start = &path[3]; fildes_ori = ZEND_STRTOL(start, &end, 10); if (end == start || *end != '\0') { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, + php_stream_wrapper_log_error(wrapper, options, "php://fd/ stream must be specified in the form php://fd/<orig fd>"); return NULL; } @@ -318,14 +318,14 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa #endif if (fildes_ori < 0 || fildes_ori >= dtablesize) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, + php_stream_wrapper_log_error(wrapper, options, "The file descriptors must be non-negative numbers smaller than %d", dtablesize); return NULL; } fd = dup((int)fildes_ori); if (fd == -1) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, + php_stream_wrapper_log_error(wrapper, options, "Error duping file descriptor " ZEND_LONG_FMT "; possibly it doesn't exist: " "[%d]: %s", fildes_ori, errno, strerror(errno)); return NULL; @@ -341,7 +341,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa pathdup = estrndup(path + 6, strlen(path + 6)); p = strstr(pathdup, "/resource="); if (!p) { - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "No URL resource specified"); + php_error_docref(NULL, E_RECOVERABLE_ERROR, "No URL resource specified"); efree(pathdup); return NULL; } @@ -355,11 +355,11 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa p = php_strtok_r(pathdup + 1, "/", &token); while (p) { if (!strncasecmp(p, "read=", 5)) { - php_stream_apply_filter_list(stream, p + 5, 1, 0 TSRMLS_CC); + php_stream_apply_filter_list(stream, p + 5, 1, 0); } else if (!strncasecmp(p, "write=", 6)) { - php_stream_apply_filter_list(stream, p + 6, 0, 1 TSRMLS_CC); + php_stream_apply_filter_list(stream, p + 6, 0, 1); } else { - php_stream_apply_filter_list(stream, p, mode_rw & PHP_STREAM_FILTER_READ, mode_rw & PHP_STREAM_FILTER_WRITE TSRMLS_CC); + php_stream_apply_filter_list(stream, p, mode_rw & PHP_STREAM_FILTER_READ, mode_rw & PHP_STREAM_FILTER_WRITE); } p = php_strtok_r(NULL, "/", &token); } @@ -368,7 +368,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa return stream; } else { /* invalid php://thingy */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid php:// URL specified"); + php_error_docref(NULL, E_WARNING, "Invalid php:// URL specified"); return NULL; } |