diff options
author | Anatol Belski <ab@php.net> | 2014-12-13 23:06:14 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-12-13 23:06:14 +0100 |
commit | bdeb220f48825642f84cdbf3ff23a30613c92e86 (patch) | |
tree | 1a6cf34d20420e4815b4becb21311a4457d84103 /main/streams | |
parent | bb66f385d09e7e55390e9f57fcbca08f6b43ff91 (diff) | |
download | php-git-bdeb220f48825642f84cdbf3ff23a30613c92e86.tar.gz |
first shot remove TSRMLS_* things
Diffstat (limited to 'main/streams')
-rw-r--r-- | main/streams/cast.c | 33 | ||||
-rw-r--r-- | main/streams/filter.c | 92 | ||||
-rw-r--r-- | main/streams/glob_wrapper.c | 24 | ||||
-rw-r--r-- | main/streams/memory.c | 66 | ||||
-rw-r--r-- | main/streams/mmap.c | 6 | ||||
-rw-r--r-- | main/streams/php_stream_context.h | 20 | ||||
-rw-r--r-- | main/streams/php_stream_filter_api.h | 52 | ||||
-rw-r--r-- | main/streams/php_stream_glob_wrapper.h | 12 | ||||
-rw-r--r-- | main/streams/php_stream_mmap.h | 14 | ||||
-rw-r--r-- | main/streams/php_stream_plain_wrapper.h | 32 | ||||
-rw-r--r-- | main/streams/php_stream_transport.h | 20 | ||||
-rw-r--r-- | main/streams/php_streams_int.h | 4 | ||||
-rw-r--r-- | main/streams/plain_wrapper.c | 178 | ||||
-rw-r--r-- | main/streams/streams.c | 276 | ||||
-rw-r--r-- | main/streams/transports.c | 42 | ||||
-rw-r--r-- | main/streams/userspace.c | 206 | ||||
-rw-r--r-- | main/streams/xp_socket.c | 74 |
17 files changed, 571 insertions, 580 deletions
diff --git a/main/streams/cast.c b/main/streams/cast.c index 3291a9ca8f..83236fa47f 100644 --- a/main/streams/cast.c +++ b/main/streams/cast.c @@ -63,7 +63,6 @@ FILE *fopencookie(void *cookie, const char *mode, COOKIE_IO_FUNCTIONS_T *funcs) static int stream_cookie_reader(void *cookie, char *buffer, int size) { int ret; - TSRMLS_FETCH(); ret = php_stream_read((php_stream*)cookie, buffer, size); return ret; @@ -71,14 +70,12 @@ static int stream_cookie_reader(void *cookie, char *buffer, int size) static int stream_cookie_writer(void *cookie, const char *buffer, int size) { - TSRMLS_FETCH(); return php_stream_write((php_stream *)cookie, (char *)buffer, size); } static PHP_FPOS_T stream_cookie_seeker(void *cookie, zend_off_t position, int whence) { - TSRMLS_FETCH(); return (PHP_FPOS_T)php_stream_seek((php_stream *)cookie, position, whence); } @@ -86,7 +83,6 @@ static PHP_FPOS_T stream_cookie_seeker(void *cookie, zend_off_t position, int wh static int stream_cookie_closer(void *cookie) { php_stream *stream = (php_stream*)cookie; - TSRMLS_FETCH(); /* prevent recursion */ stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE; @@ -96,7 +92,6 @@ static int stream_cookie_closer(void *cookie) static ssize_t stream_cookie_reader(void *cookie, char *buffer, size_t size) { ssize_t ret; - TSRMLS_FETCH(); ret = php_stream_read(((php_stream *)cookie), buffer, size); return ret; @@ -104,7 +99,6 @@ static ssize_t stream_cookie_reader(void *cookie, char *buffer, size_t size) static ssize_t stream_cookie_writer(void *cookie, const char *buffer, size_t size) { - TSRMLS_FETCH(); return php_stream_write(((php_stream *)cookie), (char *)buffer, size); } @@ -112,7 +106,6 @@ static ssize_t stream_cookie_writer(void *cookie, const char *buffer, size_t siz # ifdef COOKIE_SEEKER_USES_OFF64_T static int stream_cookie_seeker(void *cookie, __off64_t *position, int whence) { - TSRMLS_FETCH(); *position = php_stream_seek((php_stream *)cookie, (zend_off_t)*position, whence); @@ -124,7 +117,6 @@ static int stream_cookie_seeker(void *cookie, __off64_t *position, int whence) # else static int stream_cookie_seeker(void *cookie, zend_off_t position, int whence) { - TSRMLS_FETCH(); return php_stream_seek((php_stream *)cookie, position, whence); } @@ -133,7 +125,6 @@ static int stream_cookie_seeker(void *cookie, zend_off_t position, int whence) static int stream_cookie_closer(void *cookie) { php_stream *stream = (php_stream*)cookie; - TSRMLS_FETCH(); /* prevent recursion */ stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE; @@ -197,7 +188,7 @@ void php_stream_mode_sanitize_fdopen_fopencookie(php_stream *stream, char *resul /* }}} */ /* {{{ php_stream_cast */ -PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show_err TSRMLS_DC) +PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show_err) { int flags = castas & PHP_STREAM_CAST_MASK; castas &= ~PHP_STREAM_CAST_MASK; @@ -208,7 +199,7 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { zend_off_t dummy; - stream->ops->seek(stream, stream->position, SEEK_SET, &dummy TSRMLS_CC); + stream->ops->seek(stream, stream->position, SEEK_SET, &dummy); stream->readpos = stream->writepos = 0; } } @@ -228,7 +219,7 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show if (php_stream_is(stream, PHP_STREAM_IS_STDIO) && stream->ops->cast && !php_stream_is_filtered(stream) && - stream->ops->cast(stream, castas, ret TSRMLS_CC) == SUCCESS + stream->ops->cast(stream, castas, ret) == SUCCESS ) { goto exit_success; } @@ -265,12 +256,12 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show b) no memory -> lets bail */ - php_error_docref(NULL TSRMLS_CC, E_ERROR, "fopencookie failed"); + php_error_docref(NULL, E_ERROR, "fopencookie failed"); return FAILURE; #endif - if (!php_stream_is_filtered(stream) && stream->ops->cast && stream->ops->cast(stream, castas, NULL TSRMLS_CC) == SUCCESS) { - if (FAILURE == stream->ops->cast(stream, castas, ret TSRMLS_CC)) { + if (!php_stream_is_filtered(stream) && stream->ops->cast && stream->ops->cast(stream, castas, NULL) == SUCCESS) { + if (FAILURE == stream->ops->cast(stream, castas, ret)) { return FAILURE; } goto exit_success; @@ -304,9 +295,9 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show } if (php_stream_is_filtered(stream)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot cast a filtered stream on this system"); + php_error_docref(NULL, E_WARNING, "cannot cast a filtered stream on this system"); return FAILURE; - } else if (stream->ops->cast && stream->ops->cast(stream, castas, ret TSRMLS_CC) == SUCCESS) { + } else if (stream->ops->cast && stream->ops->cast(stream, castas, ret) == SUCCESS) { goto exit_success; } @@ -319,7 +310,7 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show "select()able descriptor" }; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot represent a stream of type %s as a %s", stream->ops->label, cast_names[castas]); + php_error_docref(NULL, E_WARNING, "cannot represent a stream of type %s as a %s", stream->ops->label, cast_names[castas]); } return FAILURE; @@ -334,7 +325,7 @@ exit_success: * will be accessing the stream. Emit a warning so that the end-user will * know that they should try something else */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, ZEND_LONG_FMT " bytes of buffered data lost during stream conversion!", (zend_long)(stream->writepos - stream->readpos)); + php_error_docref(NULL, E_WARNING, ZEND_LONG_FMT " bytes of buffered data lost during stream conversion!", (zend_long)(stream->writepos - stream->readpos)); } if (castas == PHP_STREAM_AS_STDIO && ret) { @@ -351,7 +342,7 @@ exit_success: /* }}} */ /* {{{ php_stream_open_wrapper_as_file */ -PHPAPI FILE * _php_stream_open_wrapper_as_file(char *path, char *mode, int options, char **opened_path STREAMS_DC TSRMLS_DC) +PHPAPI FILE * _php_stream_open_wrapper_as_file(char *path, char *mode, int options, char **opened_path STREAMS_DC) { FILE *fp = NULL; php_stream *stream = NULL; @@ -374,7 +365,7 @@ PHPAPI FILE * _php_stream_open_wrapper_as_file(char *path, char *mode, int optio /* }}} */ /* {{{ php_stream_make_seekable */ -PHPAPI int _php_stream_make_seekable(php_stream *origstream, php_stream **newstream, int flags STREAMS_DC TSRMLS_DC) +PHPAPI int _php_stream_make_seekable(php_stream *origstream, php_stream **newstream, int flags STREAMS_DC) { if (newstream == NULL) { return PHP_STREAM_FAILED; diff --git a/main/streams/filter.c b/main/streams/filter.c index 56e388403d..62d27e5ee7 100644 --- a/main/streams/filter.c +++ b/main/streams/filter.c @@ -38,24 +38,24 @@ PHPAPI HashTable *php_get_stream_filters_hash_global(void) } /* Normal hash selection/retrieval call */ -PHPAPI HashTable *_php_get_stream_filters_hash(TSRMLS_D) +PHPAPI HashTable *_php_get_stream_filters_hash(void) { return (FG(stream_filters) ? FG(stream_filters) : &stream_filters_hash); } /* API for registering GLOBAL filters */ -PHPAPI int php_stream_filter_register_factory(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC) +PHPAPI int php_stream_filter_register_factory(const char *filterpattern, php_stream_filter_factory *factory) { return zend_hash_str_add_ptr(&stream_filters_hash, filterpattern, strlen(filterpattern), factory) ? SUCCESS : FAILURE; } -PHPAPI int php_stream_filter_unregister_factory(const char *filterpattern TSRMLS_DC) +PHPAPI int php_stream_filter_unregister_factory(const char *filterpattern) { return zend_hash_str_del(&stream_filters_hash, filterpattern, strlen(filterpattern)); } /* API for registering VOLATILE wrappers */ -PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC) +PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern, php_stream_filter_factory *factory) { if (!FG(stream_filters)) { ALLOC_HASHTABLE(FG(stream_filters)); @@ -68,7 +68,7 @@ PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern /* Buckets */ -PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, int own_buf, int buf_persistent TSRMLS_DC) +PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, int own_buf, int buf_persistent) { int is_persistent = php_stream_is_persistent(stream); php_stream_bucket *bucket; @@ -112,11 +112,11 @@ PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, s * In both cases, the original bucket is unlinked from its brigade. * If a copy is made, the original bucket is delref'd. * */ -PHPAPI php_stream_bucket *php_stream_bucket_make_writeable(php_stream_bucket *bucket TSRMLS_DC) +PHPAPI php_stream_bucket *php_stream_bucket_make_writeable(php_stream_bucket *bucket) { php_stream_bucket *retval; - php_stream_bucket_unlink(bucket TSRMLS_CC); + php_stream_bucket_unlink(bucket); if (bucket->refcount == 1 && bucket->own_buf) { return bucket; @@ -131,12 +131,12 @@ PHPAPI php_stream_bucket *php_stream_bucket_make_writeable(php_stream_bucket *bu retval->refcount = 1; retval->own_buf = 1; - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_delref(bucket); return retval; } -PHPAPI int php_stream_bucket_split(php_stream_bucket *in, php_stream_bucket **left, php_stream_bucket **right, size_t length TSRMLS_DC) +PHPAPI int php_stream_bucket_split(php_stream_bucket *in, php_stream_bucket **left, php_stream_bucket **right, size_t length) { *left = (php_stream_bucket*)pecalloc(1, sizeof(php_stream_bucket), in->is_persistent); *right = (php_stream_bucket*)pecalloc(1, sizeof(php_stream_bucket), in->is_persistent); @@ -177,7 +177,7 @@ exit_fail: return FAILURE; } -PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket TSRMLS_DC) +PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket) { if (--bucket->refcount == 0) { if (bucket->own_buf) { @@ -187,7 +187,7 @@ PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket TSRMLS_DC) } } -PHPAPI void php_stream_bucket_prepend(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC) +PHPAPI void php_stream_bucket_prepend(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket) { bucket->next = brigade->head; bucket->prev = NULL; @@ -201,7 +201,7 @@ PHPAPI void php_stream_bucket_prepend(php_stream_bucket_brigade *brigade, php_st bucket->brigade = brigade; } -PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC) +PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket) { if (brigade->tail == bucket) { return; @@ -219,7 +219,7 @@ PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_str bucket->brigade = brigade; } -PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket TSRMLS_DC) +PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket) { if (bucket->prev) { bucket->prev->next = bucket->next; @@ -247,7 +247,7 @@ PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket TSRMLS_DC) * match. If that fails, we try "convert.charset.*", then "convert.*" * This means that we don't need to clog up the hashtable with a zillion * charsets (for example) but still be able to provide them all as filters */ -PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) +PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *filterparams, int persistent) { HashTable *filter_hash = (FG(stream_filters) ? FG(stream_filters) : &stream_filters_hash); php_stream_filter_factory *factory = NULL; @@ -258,7 +258,7 @@ PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval n = (int)strlen(filtername); if (NULL != (factory = zend_hash_str_find_ptr(filter_hash, filtername, n))) { - filter = factory->create_filter(filtername, filterparams, persistent TSRMLS_CC); + filter = factory->create_filter(filtername, filterparams, persistent); } else if ((period = strrchr(filtername, '.'))) { /* try a wildcard */ char *wildname; @@ -270,7 +270,7 @@ PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *period = '\0'; strncat(wildname, ".*", 2); if (NULL != (factory = zend_hash_str_find_ptr(filter_hash, wildname, strlen(wildname)))) { - filter = factory->create_filter(filtername, filterparams, persistent TSRMLS_CC); + filter = factory->create_filter(filtername, filterparams, persistent); } *period = '\0'; @@ -282,15 +282,15 @@ PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval if (filter == NULL) { /* TODO: these need correct docrefs */ if (factory == NULL) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to locate filter \"%s\"", filtername); + php_error_docref(NULL, E_WARNING, "unable to locate filter \"%s\"", filtername); else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to create or locate filter \"%s\"", filtername); + php_error_docref(NULL, E_WARNING, "unable to create or locate filter \"%s\"", filtername); } return filter; } -PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops, void *abstract, int persistent STREAMS_DC TSRMLS_DC) +PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops, void *abstract, int persistent STREAMS_DC) { php_stream_filter *filter; @@ -304,14 +304,14 @@ PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops, return filter; } -PHPAPI void php_stream_filter_free(php_stream_filter *filter TSRMLS_DC) +PHPAPI void php_stream_filter_free(php_stream_filter *filter) { if (filter->fops->dtor) - filter->fops->dtor(filter TSRMLS_CC); + filter->fops->dtor(filter); pefree(filter, filter->is_persistent); } -PHPAPI int php_stream_filter_prepend_ex(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC) +PHPAPI int php_stream_filter_prepend_ex(php_stream_filter_chain *chain, php_stream_filter *filter) { filter->next = chain->head; filter->prev = NULL; @@ -327,12 +327,12 @@ PHPAPI int php_stream_filter_prepend_ex(php_stream_filter_chain *chain, php_stre return SUCCESS; } -PHPAPI void _php_stream_filter_prepend(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC) +PHPAPI void _php_stream_filter_prepend(php_stream_filter_chain *chain, php_stream_filter *filter) { - php_stream_filter_prepend_ex(chain, filter TSRMLS_CC); + php_stream_filter_prepend_ex(chain, filter); } -PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC) +PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_stream_filter *filter) { php_stream *stream = chain->stream; @@ -354,9 +354,9 @@ PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_strea php_stream_bucket *bucket; size_t consumed = 0; - bucket = php_stream_bucket_new(stream, (char*) stream->readbuf + stream->readpos, stream->writepos - stream->readpos, 0, 0 TSRMLS_CC); - php_stream_bucket_append(brig_inp, bucket TSRMLS_CC); - status = filter->fops->filter(stream, filter, brig_inp, brig_outp, &consumed, PSFS_FLAG_NORMAL TSRMLS_CC); + bucket = php_stream_bucket_new(stream, (char*) stream->readbuf + stream->readpos, stream->writepos - stream->readpos, 0, 0); + php_stream_bucket_append(brig_inp, bucket); + status = filter->fops->filter(stream, filter, brig_inp, brig_outp, &consumed, PSFS_FLAG_NORMAL); if (stream->readpos + consumed > (uint)stream->writepos) { /* No behaving filter should cause this. */ @@ -367,15 +367,15 @@ PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_strea case PSFS_ERR_FATAL: while (brig_in.head) { bucket = brig_in.head; - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_unlink(bucket); + php_stream_bucket_delref(bucket); } while (brig_out.head) { bucket = brig_out.head; - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_unlink(bucket); + php_stream_bucket_delref(bucket); } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter failed to process pre-buffered data"); + php_error_docref(NULL, E_WARNING, "Filter failed to process pre-buffered data"); return FAILURE; case PSFS_FEED_ME: /* We don't actually need data yet, @@ -403,8 +403,8 @@ PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_strea memcpy(stream->readbuf + stream->writepos, bucket->buf, bucket->buflen); stream->writepos += bucket->buflen; - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_unlink(bucket); + php_stream_bucket_delref(bucket); } break; } @@ -413,9 +413,9 @@ PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_strea return SUCCESS; } -PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC) +PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, php_stream_filter *filter) { - if (php_stream_filter_append_ex(chain, filter TSRMLS_CC) != SUCCESS) { + if (php_stream_filter_append_ex(chain, filter) != SUCCESS) { if (chain->head == filter) { chain->head = NULL; chain->tail = NULL; @@ -426,7 +426,7 @@ PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, php_stream } } -PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish TSRMLS_DC) +PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish) { php_stream_bucket_brigade brig_a = { NULL, NULL }, brig_b = { NULL, NULL }, *inp = &brig_a, *outp = &brig_b, *brig_temp; php_stream_bucket *bucket; @@ -447,7 +447,7 @@ PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish TSRMLS for(current = filter; current; current = current->next) { php_stream_filter_status_t status; - status = filter->fops->filter(stream, filter, inp, outp, NULL, flags TSRMLS_CC); + status = filter->fops->filter(stream, filter, inp, outp, NULL, flags); if (status == PSFS_FEED_ME) { /* We've flushed the data far enough */ return SUCCESS; @@ -493,22 +493,22 @@ PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish TSRMLS while ((bucket = inp->head)) { memcpy(stream->readbuf + stream->writepos, bucket->buf, bucket->buflen); stream->writepos += bucket->buflen; - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_unlink(bucket); + php_stream_bucket_delref(bucket); } } else if (chain == &(stream->writefilters)) { /* Send flushed data to the stream */ while ((bucket = inp->head)) { - stream->ops->write(stream, bucket->buf, bucket->buflen TSRMLS_CC); - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); + stream->ops->write(stream, bucket->buf, bucket->buflen); + php_stream_bucket_unlink(bucket); + php_stream_bucket_delref(bucket); } } return SUCCESS; } -PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, int call_dtor TSRMLS_DC) +PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, int call_dtor) { if (filter->prev) { filter->prev->next = filter->next; @@ -526,7 +526,7 @@ PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, in } if (call_dtor) { - php_stream_filter_free(filter TSRMLS_CC); + php_stream_filter_free(filter); return NULL; } return filter; diff --git a/main/streams/glob_wrapper.c b/main/streams/glob_wrapper.c index e62fbfb662..7822265ea3 100644 --- a/main/streams/glob_wrapper.c +++ b/main/streams/glob_wrapper.c @@ -47,7 +47,7 @@ typedef struct { size_t pattern_len; } glob_s_t; -PHPAPI char* _php_glob_stream_get_path(php_stream *stream, int copy, size_t *plen STREAMS_DC TSRMLS_DC) /* {{{ */ +PHPAPI char* _php_glob_stream_get_path(php_stream *stream, int copy, size_t *plen STREAMS_DC) /* {{{ */ { glob_s_t *pglob = (glob_s_t *)stream->abstract; @@ -69,7 +69,7 @@ PHPAPI char* _php_glob_stream_get_path(php_stream *stream, int copy, size_t *ple } /* }}} */ -PHPAPI char* _php_glob_stream_get_pattern(php_stream *stream, int copy, size_t *plen STREAMS_DC TSRMLS_DC) /* {{{ */ +PHPAPI char* _php_glob_stream_get_pattern(php_stream *stream, int copy, size_t *plen STREAMS_DC) /* {{{ */ { glob_s_t *pglob = (glob_s_t *)stream->abstract; @@ -91,7 +91,7 @@ PHPAPI char* _php_glob_stream_get_pattern(php_stream *stream, int copy, size_t * } /* }}} */ -PHPAPI int _php_glob_stream_get_count(php_stream *stream, int *pflags STREAMS_DC TSRMLS_DC) /* {{{ */ +PHPAPI int _php_glob_stream_get_count(php_stream *stream, int *pflags STREAMS_DC) /* {{{ */ { glob_s_t *pglob = (glob_s_t *)stream->abstract; @@ -109,7 +109,7 @@ PHPAPI int _php_glob_stream_get_count(php_stream *stream, int *pflags STREAMS_DC } /* }}} */ -static void php_glob_stream_path_split(glob_s_t *pglob, const char *path, int get_path, const char **p_file TSRMLS_DC) /* {{{ */ +static void php_glob_stream_path_split(glob_s_t *pglob, const char *path, int get_path, const char **p_file) /* {{{ */ { const char *pos, *gpath = path; @@ -137,7 +137,7 @@ static void php_glob_stream_path_split(glob_s_t *pglob, const char *path, int ge } /* }}} */ -static size_t php_glob_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */ +static size_t php_glob_stream_read(php_stream *stream, char *buf, size_t count) /* {{{ */ { glob_s_t *pglob = (glob_s_t *)stream->abstract; php_stream_dirent *ent = (php_stream_dirent*)buf; @@ -146,7 +146,7 @@ static size_t php_glob_stream_read(php_stream *stream, char *buf, size_t count T /* avoid problems if someone mis-uses the stream */ if (count == sizeof(php_stream_dirent) && pglob) { if (pglob->index < (size_t)pglob->glob.gl_pathc) { - php_glob_stream_path_split(pglob, pglob->glob.gl_pathv[pglob->index++], pglob->flags & GLOB_APPEND, &path TSRMLS_CC); + php_glob_stream_path_split(pglob, pglob->glob.gl_pathv[pglob->index++], pglob->flags & GLOB_APPEND, &path); PHP_STRLCPY(ent->d_name, path, sizeof(ent->d_name), strlen(path)); return sizeof(php_stream_dirent); } @@ -161,7 +161,7 @@ static size_t php_glob_stream_read(php_stream *stream, char *buf, size_t count T } /* }}} */ -static int php_glob_stream_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */ +static int php_glob_stream_close(php_stream *stream, int close_handle) /* {{{ */ { glob_s_t *pglob = (glob_s_t *)stream->abstract; @@ -180,7 +180,7 @@ static int php_glob_stream_close(php_stream *stream, int close_handle TSRMLS_DC) } /* {{{ */ -static int php_glob_stream_rewind(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC) /* {{{ */ +static int php_glob_stream_rewind(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs) /* {{{ */ { glob_s_t *pglob = (glob_s_t *)stream->abstract; @@ -207,13 +207,13 @@ php_stream_ops php_glob_stream_ops = { /* {{{ php_glob_stream_opener */ static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, const char *path, const char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) + int options, char **opened_path, php_stream_context *context STREAMS_DC) { glob_s_t *pglob; int ret; const char *tmp, *pos; - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) { + if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path)) { return NULL; } @@ -252,9 +252,9 @@ static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, const cha pglob->flags |= GLOB_APPEND; if (pglob->glob.gl_pathc) { - php_glob_stream_path_split(pglob, pglob->glob.gl_pathv[0], 1, &tmp TSRMLS_CC); + php_glob_stream_path_split(pglob, pglob->glob.gl_pathv[0], 1, &tmp); } else { - php_glob_stream_path_split(pglob, path, 1, &tmp TSRMLS_CC); + php_glob_stream_path_split(pglob, path, 1, &tmp); } return php_stream_alloc(&php_glob_stream_ops, pglob, 0, mode); diff --git a/main/streams/memory.c b/main/streams/memory.c index 28274d7fcd..b2dca2115c 100644 --- a/main/streams/memory.c +++ b/main/streams/memory.c @@ -46,7 +46,7 @@ typedef struct { /* {{{ */ -static size_t php_stream_memory_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) +static size_t php_stream_memory_write(php_stream *stream, const char *buf, size_t count) { php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; assert(ms != NULL); @@ -82,7 +82,7 @@ static size_t php_stream_memory_write(php_stream *stream, const char *buf, size_ /* {{{ */ -static size_t php_stream_memory_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) +static size_t php_stream_memory_read(php_stream *stream, char *buf, size_t count) { php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; assert(ms != NULL); @@ -107,7 +107,7 @@ static size_t php_stream_memory_read(php_stream *stream, char *buf, size_t count /* {{{ */ -static int php_stream_memory_close(php_stream *stream, int close_handle TSRMLS_DC) +static int php_stream_memory_close(php_stream *stream, int close_handle) { php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; assert(ms != NULL); @@ -122,7 +122,7 @@ static int php_stream_memory_close(php_stream *stream, int close_handle TSRMLS_D /* {{{ */ -static int php_stream_memory_flush(php_stream *stream TSRMLS_DC) +static int php_stream_memory_flush(php_stream *stream) { /* nothing to do here */ return 0; @@ -131,7 +131,7 @@ static int php_stream_memory_flush(php_stream *stream TSRMLS_DC) /* {{{ */ -static int php_stream_memory_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC) +static int php_stream_memory_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs) { php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; assert(ms != NULL); @@ -195,13 +195,13 @@ static int php_stream_memory_seek(php_stream *stream, zend_off_t offset, int whe /* }}} */ /* {{{ */ -static int php_stream_memory_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) +static int php_stream_memory_cast(php_stream *stream, int castas, void **ret) { return FAILURE; } /* }}} */ -static int php_stream_memory_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */ +static int php_stream_memory_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ */ { time_t timestamp = 0; php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; @@ -244,7 +244,7 @@ static int php_stream_memory_stat(php_stream *stream, php_stream_statbuf *ssb TS } /* }}} */ -static int php_stream_memory_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) /* {{{ */ +static int php_stream_memory_set_option(php_stream *stream, int option, int value, void *ptrparam) /* {{{ */ { php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; size_t newsize; @@ -290,7 +290,7 @@ PHPAPI php_stream_ops php_stream_memory_ops = { /* {{{ */ -PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC TSRMLS_DC) +PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC) { php_stream_memory_data *self; php_stream *stream; @@ -310,7 +310,7 @@ PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC TSRMLS_DC) /* {{{ */ -PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length STREAMS_DC TSRMLS_DC) +PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length STREAMS_DC) { php_stream *stream; php_stream_memory_data *ms; @@ -335,7 +335,7 @@ PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length ST /* {{{ */ -PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length STREAMS_DC TSRMLS_DC) +PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length STREAMS_DC) { php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; @@ -361,7 +361,7 @@ typedef struct { /* {{{ */ -static size_t php_stream_temp_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) +static size_t php_stream_temp_write(php_stream *stream, const char *buf, size_t count) { php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; assert(ts != NULL); @@ -387,7 +387,7 @@ static size_t php_stream_temp_write(php_stream *stream, const char *buf, size_t /* {{{ */ -static size_t php_stream_temp_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) +static size_t php_stream_temp_read(php_stream *stream, char *buf, size_t count) { php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; size_t got; @@ -408,7 +408,7 @@ static size_t php_stream_temp_read(php_stream *stream, char *buf, size_t count T /* {{{ */ -static int php_stream_temp_close(php_stream *stream, int close_handle TSRMLS_DC) +static int php_stream_temp_close(php_stream *stream, int close_handle) { php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; int ret; @@ -435,7 +435,7 @@ static int php_stream_temp_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */ -static int php_stream_temp_flush(php_stream *stream TSRMLS_DC) +static int php_stream_temp_flush(php_stream *stream) { php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; assert(ts != NULL); @@ -446,7 +446,7 @@ static int php_stream_temp_flush(php_stream *stream TSRMLS_DC) /* {{{ */ -static int php_stream_temp_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC) +static int php_stream_temp_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs) { php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; int ret; @@ -466,7 +466,7 @@ static int php_stream_temp_seek(php_stream *stream, zend_off_t offset, int whenc /* }}} */ /* {{{ */ -static int php_stream_temp_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) +static int php_stream_temp_cast(php_stream *stream, int castas, void **ret) { php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; php_stream *file; @@ -512,7 +512,7 @@ static int php_stream_temp_cast(php_stream *stream, int castas, void **ret TSRML } /* }}} */ -static int php_stream_temp_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */ +static int php_stream_temp_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ */ { php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; @@ -523,7 +523,7 @@ static int php_stream_temp_stat(php_stream *stream, php_stream_statbuf *ssb TSRM } /* }}} */ -static int php_stream_temp_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) /* {{{ */ +static int php_stream_temp_set_option(php_stream *stream, int option, int value, void *ptrparam) /* {{{ */ { php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; @@ -555,7 +555,7 @@ PHPAPI php_stream_ops php_stream_temp_ops = { /* }}} */ /* {{{ _php_stream_temp_create_ex */ -PHPAPI php_stream *_php_stream_temp_create_ex(int mode, size_t max_memory_usage, const char *tmpdir STREAMS_DC TSRMLS_DC) +PHPAPI php_stream *_php_stream_temp_create_ex(int mode, size_t max_memory_usage, const char *tmpdir STREAMS_DC) { php_stream_temp_data *self; php_stream *stream; @@ -577,14 +577,14 @@ PHPAPI php_stream *_php_stream_temp_create_ex(int mode, size_t max_memory_usage, /* }}} */ /* {{{ _php_stream_temp_create */ -PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC TSRMLS_DC) +PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC) { return php_stream_temp_create_ex(mode, max_memory_usage, NULL); } /* }}} */ /* {{{ _php_stream_temp_open */ -PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC TSRMLS_DC) +PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC) { php_stream *stream; php_stream_temp_data *ts; @@ -593,8 +593,8 @@ PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char if ((stream = php_stream_temp_create_rel(mode, max_memory_usage)) != NULL) { if (length) { assert(buf != NULL); - php_stream_temp_write(stream, buf, length TSRMLS_CC); - php_stream_temp_seek(stream, 0, SEEK_SET, &newoffs TSRMLS_CC); + php_stream_temp_write(stream, buf, length); + php_stream_temp_seek(stream, 0, SEEK_SET, &newoffs); } ts = (php_stream_temp_data*)stream->abstract; assert(ts != NULL); @@ -616,7 +616,7 @@ PHPAPI php_stream_ops php_stream_rfc2397_ops = { static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, - php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */ + php_stream_context *context STREAMS_DC) /* {{{ */ { php_stream *stream; php_stream_temp_data *ts; @@ -641,7 +641,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con } if ((comma = memchr(path, ',', dlen)) == NULL) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: no comma in URL"); + php_stream_wrapper_log_error(wrapper, options, "rfc2397: no comma in URL"); return NULL; } @@ -653,7 +653,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con sep = memchr(path, '/', mlen); if (!semi && !sep) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: illegal media type"); + php_stream_wrapper_log_error(wrapper, options, "rfc2397: illegal media type"); return NULL; } @@ -668,7 +668,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con path += plen; } else if (semi != path || mlen != sizeof(";base64")-1 || memcmp(path, ";base64", sizeof(";base64")-1)) { /* must be error since parameters are only allowed after mediatype */ zval_ptr_dtor(&meta); - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: illegal media type"); + php_stream_wrapper_log_error(wrapper, options, "rfc2397: illegal media type"); return NULL; } /* get parameters and potentially ';base64' */ @@ -681,7 +681,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con if (mlen != sizeof("base64")-1 || memcmp(path, "base64", sizeof("base64")-1)) { /* must be error since parameters are only allowed after mediatype and we have no '=' sign */ zval_ptr_dtor(&meta); - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: illegal parameter"); + php_stream_wrapper_log_error(wrapper, options, "rfc2397: illegal parameter"); return NULL; } base64 = 1; @@ -701,7 +701,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con } if (mlen) { zval_ptr_dtor(&meta); - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: illegal URL"); + php_stream_wrapper_log_error(wrapper, options, "rfc2397: illegal URL"); return NULL; } } else { @@ -717,7 +717,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con base64_comma = php_base64_decode((const unsigned char *)comma, dlen); if (!base64_comma) { zval_ptr_dtor(&meta); - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: unable to decode"); + php_stream_wrapper_log_error(wrapper, options, "rfc2397: unable to decode"); return NULL; } comma = base64_comma->val; @@ -730,8 +730,8 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con if ((stream = php_stream_temp_create_rel(0, ~0u)) != NULL) { /* store data */ - php_stream_temp_write(stream, comma, ilen TSRMLS_CC); - php_stream_temp_seek(stream, 0, SEEK_SET, &newoffs TSRMLS_CC); + php_stream_temp_write(stream, comma, ilen); + php_stream_temp_seek(stream, 0, SEEK_SET, &newoffs); /* set special stream stuff (enforce exact mode) */ vlen = strlen(mode); if (vlen >= sizeof(stream->mode)) { diff --git a/main/streams/mmap.c b/main/streams/mmap.c index 8746959bbe..3eee859c13 100644 --- a/main/streams/mmap.c +++ b/main/streams/mmap.c @@ -22,7 +22,7 @@ #include "php.h" #include "php_streams_int.h" -PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t length, php_stream_mmap_operation_t mode, size_t *mapped_len TSRMLS_DC) +PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t length, php_stream_mmap_operation_t mode, size_t *mapped_len) { php_stream_mmap_range range; @@ -46,12 +46,12 @@ PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t le return NULL; } -PHPAPI int _php_stream_mmap_unmap(php_stream *stream TSRMLS_DC) +PHPAPI int _php_stream_mmap_unmap(php_stream *stream) { return php_stream_set_option(stream, PHP_STREAM_OPTION_MMAP_API, PHP_STREAM_MMAP_UNMAP, NULL) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0; } -PHPAPI int _php_stream_mmap_unmap_ex(php_stream *stream, zend_off_t readden TSRMLS_DC) +PHPAPI int _php_stream_mmap_unmap_ex(php_stream *stream, zend_off_t readden) { int ret = 1; diff --git a/main/streams/php_stream_context.h b/main/streams/php_stream_context.h index ac90a0ba3c..836cd9cadb 100644 --- a/main/streams/php_stream_context.h +++ b/main/streams/php_stream_context.h @@ -25,7 +25,7 @@ typedef void (*php_stream_notification_func)(php_stream_context *context, int notifycode, int severity, char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, - void * ptr TSRMLS_DC); + void * ptr); #define PHP_STREAM_NOTIFIER_PROGRESS 1 @@ -33,10 +33,10 @@ typedef void (*php_stream_notification_func)(php_stream_context *context, If no context was passed, use the default context The default context has not yet been created, do it now. */ #define php_stream_context_from_zval(zcontext, nocontext) ( \ - (zcontext) ? zend_fetch_resource(zcontext TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context(TSRMLS_C)) : \ + (zcontext) ? zend_fetch_resource(zcontext, -1, "Stream-Context", NULL, 1, php_le_stream_context()) : \ (nocontext) ? NULL : \ FG(default_context) ? FG(default_context) : \ - (FG(default_context) = php_stream_context_alloc(TSRMLS_C)) ) + (FG(default_context) = php_stream_context_alloc()) ) #define php_stream_context_to_zval(context, zval) { ZVAL_RES(zval, (context)->res); GC_REFCOUNT((context)->res)++; } @@ -58,7 +58,7 @@ struct _php_stream_context { BEGIN_EXTERN_C() PHPAPI void php_stream_context_free(php_stream_context *context); -PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D); +PHPAPI php_stream_context *php_stream_context_alloc(void); PHPAPI zval *php_stream_context_get_option(php_stream_context *context, const char *wrappername, const char *optionname); PHPAPI int php_stream_context_set_option(php_stream_context *context, @@ -86,17 +86,17 @@ END_EXTERN_C() BEGIN_EXTERN_C() PHPAPI void php_stream_notification_notify(php_stream_context *context, int notifycode, int severity, - char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr TSRMLS_DC); -PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context TSRMLS_DC); + char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr); +PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context); END_EXTERN_C() #define php_stream_notify_info(context, code, xmsg, xcode) do { if ((context) && (context)->notifier) { \ php_stream_notification_notify((context), (code), PHP_STREAM_NOTIFY_SEVERITY_INFO, \ - (xmsg), (xcode), 0, 0, NULL TSRMLS_CC); } } while (0) + (xmsg), (xcode), 0, 0, NULL); } } while (0) #define php_stream_notify_progress(context, bsofar, bmax) do { if ((context) && (context)->notifier) { \ php_stream_notification_notify((context), PHP_STREAM_NOTIFY_PROGRESS, PHP_STREAM_NOTIFY_SEVERITY_INFO, \ - NULL, 0, (bsofar), (bmax), NULL TSRMLS_CC); } } while(0) + NULL, 0, (bsofar), (bmax), NULL); } } while(0) #define php_stream_notify_progress_init(context, sofar, bmax) do { if ((context) && (context)->notifier) { \ (context)->notifier->progress = (sofar); \ @@ -111,11 +111,11 @@ END_EXTERN_C() #define php_stream_notify_file_size(context, file_size, xmsg, xcode) do { if ((context) && (context)->notifier) { \ php_stream_notification_notify((context), PHP_STREAM_NOTIFY_FILE_SIZE_IS, PHP_STREAM_NOTIFY_SEVERITY_INFO, \ - (xmsg), (xcode), 0, (file_size), NULL TSRMLS_CC); } } while(0) + (xmsg), (xcode), 0, (file_size), NULL); } } while(0) #define php_stream_notify_error(context, code, xmsg, xcode) do { if ((context) && (context)->notifier) {\ php_stream_notification_notify((context), (code), PHP_STREAM_NOTIFY_SEVERITY_ERR, \ - (xmsg), (xcode), 0, 0, NULL TSRMLS_CC); } } while(0) + (xmsg), (xcode), 0, 0, NULL); } } while(0) /* diff --git a/main/streams/php_stream_filter_api.h b/main/streams/php_stream_filter_api.h index dfa4ae2937..feeb96aba0 100644 --- a/main/streams/php_stream_filter_api.h +++ b/main/streams/php_stream_filter_api.h @@ -67,14 +67,14 @@ typedef enum { /* Buckets API. */ BEGIN_EXTERN_C() -PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, int own_buf, int buf_persistent TSRMLS_DC); -PHPAPI int php_stream_bucket_split(php_stream_bucket *in, php_stream_bucket **left, php_stream_bucket **right, size_t length TSRMLS_DC); -PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket TSRMLS_DC); +PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, int own_buf, int buf_persistent); +PHPAPI int php_stream_bucket_split(php_stream_bucket *in, php_stream_bucket **left, php_stream_bucket **right, size_t length); +PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket); #define php_stream_bucket_addref(bucket) (bucket)->refcount++ -PHPAPI void php_stream_bucket_prepend(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC); -PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC); -PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket TSRMLS_DC); -PHPAPI php_stream_bucket *php_stream_bucket_make_writeable(php_stream_bucket *bucket TSRMLS_DC); +PHPAPI void php_stream_bucket_prepend(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket); +PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket); +PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket); +PHPAPI php_stream_bucket *php_stream_bucket_make_writeable(php_stream_bucket *bucket); END_EXTERN_C() #define PSFS_FLAG_NORMAL 0 /* regular read/write */ @@ -92,7 +92,7 @@ typedef struct _php_stream_filter_ops { int flags TSRMLS_DC); - void (*dtor)(php_stream_filter *thisfilter TSRMLS_DC); + void (*dtor)(php_stream_filter *thisfilter); const char *label; @@ -124,32 +124,32 @@ struct _php_stream_filter { /* stack filter onto a stream */ BEGIN_EXTERN_C() -PHPAPI void _php_stream_filter_prepend(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC); -PHPAPI int php_stream_filter_prepend_ex(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC); -PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC); -PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC); -PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish TSRMLS_DC); -PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, int call_dtor TSRMLS_DC); -PHPAPI void php_stream_filter_free(php_stream_filter *filter TSRMLS_DC); -PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops, void *abstract, int persistent STREAMS_DC TSRMLS_DC); +PHPAPI void _php_stream_filter_prepend(php_stream_filter_chain *chain, php_stream_filter *filter); +PHPAPI int php_stream_filter_prepend_ex(php_stream_filter_chain *chain, php_stream_filter *filter); +PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, php_stream_filter *filter); +PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_stream_filter *filter); +PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish); +PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, int call_dtor); +PHPAPI void php_stream_filter_free(php_stream_filter *filter); +PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops, void *abstract, int persistent STREAMS_DC); END_EXTERN_C() -#define php_stream_filter_alloc(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_CC TSRMLS_CC) -#define php_stream_filter_alloc_rel(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_filter_prepend(chain, filter) _php_stream_filter_prepend((chain), (filter) TSRMLS_CC) -#define php_stream_filter_append(chain, filter) _php_stream_filter_append((chain), (filter) TSRMLS_CC) -#define php_stream_filter_flush(filter, finish) _php_stream_filter_flush((filter), (finish) TSRMLS_CC) +#define php_stream_filter_alloc(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_CC) +#define php_stream_filter_alloc_rel(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_REL_CC) +#define php_stream_filter_prepend(chain, filter) _php_stream_filter_prepend((chain), (filter)) +#define php_stream_filter_append(chain, filter) _php_stream_filter_append((chain), (filter)) +#define php_stream_filter_flush(filter, finish) _php_stream_filter_flush((filter), (finish)) #define php_stream_is_filtered(stream) ((stream)->readfilters.head || (stream)->writefilters.head) typedef struct _php_stream_filter_factory { - php_stream_filter *(*create_filter)(const char *filtername, zval *filterparams, int persistent TSRMLS_DC); + php_stream_filter *(*create_filter)(const char *filtername, zval *filterparams, int persistent); } php_stream_filter_factory; BEGIN_EXTERN_C() -PHPAPI int php_stream_filter_register_factory(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC); -PHPAPI int php_stream_filter_unregister_factory(const char *filterpattern TSRMLS_DC); -PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC); -PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC); +PHPAPI int php_stream_filter_register_factory(const char *filterpattern, php_stream_filter_factory *factory); +PHPAPI int php_stream_filter_unregister_factory(const char *filterpattern); +PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern, php_stream_filter_factory *factory); +PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *filterparams, int persistent); END_EXTERN_C() /* diff --git a/main/streams/php_stream_glob_wrapper.h b/main/streams/php_stream_glob_wrapper.h index 69b67d4c85..be93651fd1 100644 --- a/main/streams/php_stream_glob_wrapper.h +++ b/main/streams/php_stream_glob_wrapper.h @@ -23,14 +23,14 @@ PHPAPI extern php_stream_ops php_glob_stream_ops; BEGIN_EXTERN_C() -PHPAPI char* _php_glob_stream_get_path(php_stream *stream, int copy, size_t *plen STREAMS_DC TSRMLS_DC); -#define php_glob_stream_get_path(stream, copy, plen) _php_glob_stream_get_path((stream), (copy), (plen) STREAMS_CC TSRMLS_CC) +PHPAPI char* _php_glob_stream_get_path(php_stream *stream, int copy, size_t *plen STREAMS_DC); +#define php_glob_stream_get_path(stream, copy, plen) _php_glob_stream_get_path((stream), (copy), (plen) STREAMS_CC) -PHPAPI char* _php_glob_stream_get_pattern(php_stream *stream, int copy, size_t *plen STREAMS_DC TSRMLS_DC); -#define php_glob_stream_get_pattern(stream, copy, plen) _php_glob_stream_get_pattern((stream), (copy), (plen) STREAMS_CC TSRMLS_CC) +PHPAPI char* _php_glob_stream_get_pattern(php_stream *stream, int copy, size_t *plen STREAMS_DC); +#define php_glob_stream_get_pattern(stream, copy, plen) _php_glob_stream_get_pattern((stream), (copy), (plen) STREAMS_CC) -PHPAPI int _php_glob_stream_get_count(php_stream *stream, int *pflags STREAMS_DC TSRMLS_DC); -#define php_glob_stream_get_count(stream, pflags) _php_glob_stream_get_count((stream), (pflags) STREAMS_CC TSRMLS_CC) +PHPAPI int _php_glob_stream_get_count(php_stream *stream, int *pflags STREAMS_DC); +#define php_glob_stream_get_count(stream, pflags) _php_glob_stream_get_count((stream), (pflags) STREAMS_CC) END_EXTERN_C() diff --git a/main/streams/php_stream_mmap.h b/main/streams/php_stream_mmap.h index a25c4ac6b9..e58b703095 100644 --- a/main/streams/php_stream_mmap.h +++ b/main/streams/php_stream_mmap.h @@ -60,22 +60,22 @@ typedef struct { #define PHP_STREAM_MMAP_ALL 0 -#define php_stream_mmap_supported(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_MMAP_API, PHP_STREAM_MMAP_SUPPORTED, NULL TSRMLS_CC) == 0 ? 1 : 0) +#define php_stream_mmap_supported(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_MMAP_API, PHP_STREAM_MMAP_SUPPORTED, NULL) == 0 ? 1 : 0) /* Returns 1 if the stream in its current state can be memory mapped, * 0 otherwise */ #define php_stream_mmap_possible(stream) (!php_stream_is_filtered((stream)) && php_stream_mmap_supported((stream))) BEGIN_EXTERN_C() -PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t length, php_stream_mmap_operation_t mode, size_t *mapped_len TSRMLS_DC); -#define php_stream_mmap_range(stream, offset, length, mode, mapped_len) _php_stream_mmap_range((stream), (offset), (length), (mode), (mapped_len) TSRMLS_CC) +PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t length, php_stream_mmap_operation_t mode, size_t *mapped_len); +#define php_stream_mmap_range(stream, offset, length, mode, mapped_len) _php_stream_mmap_range((stream), (offset), (length), (mode), (mapped_len)) /* un-maps the last mapped range */ -PHPAPI int _php_stream_mmap_unmap(php_stream *stream TSRMLS_DC); -#define php_stream_mmap_unmap(stream) _php_stream_mmap_unmap((stream) TSRMLS_CC) +PHPAPI int _php_stream_mmap_unmap(php_stream *stream); +#define php_stream_mmap_unmap(stream) _php_stream_mmap_unmap((stream)) -PHPAPI int _php_stream_mmap_unmap_ex(php_stream *stream, zend_off_t readden TSRMLS_DC); -#define php_stream_mmap_unmap_ex(stream, readden) _php_stream_mmap_unmap_ex((stream), (readden) TSRMLS_CC) +PHPAPI int _php_stream_mmap_unmap_ex(php_stream *stream, zend_off_t readden); +#define php_stream_mmap_unmap_ex(stream, readden) _php_stream_mmap_unmap_ex((stream), (readden)) END_EXTERN_C() /* diff --git a/main/streams/php_stream_plain_wrapper.h b/main/streams/php_stream_plain_wrapper.h index 7d5278c620..d2bf50d189 100644 --- a/main/streams/php_stream_plain_wrapper.h +++ b/main/streams/php_stream_plain_wrapper.h @@ -27,32 +27,32 @@ PHPAPI extern php_stream_wrapper php_plain_files_wrapper; BEGIN_EXTERN_C() /* like fopen, but returns a stream */ -PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, char **opened_path, int options STREAMS_DC TSRMLS_DC); -#define php_stream_fopen(filename, mode, opened) _php_stream_fopen((filename), (mode), (opened), 0 STREAMS_CC TSRMLS_CC) +PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, char **opened_path, int options STREAMS_DC); +#define php_stream_fopen(filename, mode, opened) _php_stream_fopen((filename), (mode), (opened), 0 STREAMS_CC) -PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path, int options STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_with_path(filename, mode, path, opened) _php_stream_fopen_with_path((filename), (mode), (path), (opened), 0 STREAMS_CC TSRMLS_CC) +PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path, int options STREAMS_DC); +#define php_stream_fopen_with_path(filename, mode, path, opened) _php_stream_fopen_with_path((filename), (mode), (path), (opened), 0 STREAMS_CC) -PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_from_file(file, mode) _php_stream_fopen_from_file((file), (mode) STREAMS_CC TSRMLS_CC) +PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STREAMS_DC); +#define php_stream_fopen_from_file(file, mode) _php_stream_fopen_from_file((file), (mode) STREAMS_CC) -PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const char *persistent_id STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_from_fd(fd, mode, persistent_id) _php_stream_fopen_from_fd((fd), (mode), (persistent_id) STREAMS_CC TSRMLS_CC) +PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const char *persistent_id STREAMS_DC); +#define php_stream_fopen_from_fd(fd, mode, persistent_id) _php_stream_fopen_from_fd((fd), (mode), (persistent_id) STREAMS_CC) -PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_from_pipe(file, mode) _php_stream_fopen_from_pipe((file), (mode) STREAMS_CC TSRMLS_CC) +PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STREAMS_DC); +#define php_stream_fopen_from_pipe(file, mode) _php_stream_fopen_from_pipe((file), (mode) STREAMS_CC) -PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_tmpfile() _php_stream_fopen_tmpfile(0 STREAMS_CC TSRMLS_CC) +PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC); +#define php_stream_fopen_tmpfile() _php_stream_fopen_tmpfile(0 STREAMS_CC) -PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char *pfx, char **opened_path STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_temporary_file(dir, pfx, opened_path) _php_stream_fopen_temporary_file((dir), (pfx), (opened_path) STREAMS_CC TSRMLS_CC) +PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char *pfx, char **opened_path STREAMS_DC); +#define php_stream_fopen_temporary_file(dir, pfx, opened_path) _php_stream_fopen_temporary_file((dir), (pfx), (opened_path) STREAMS_CC) /* This is a utility API for extensions that are opening a stream, converting it * to a FILE* and then closing it again. Be warned that fileno() on the result * will most likely fail on systems with fopencookie. */ -PHPAPI FILE * _php_stream_open_wrapper_as_file(char * path, char * mode, int options, char **opened_path STREAMS_DC TSRMLS_DC); -#define php_stream_open_wrapper_as_file(path, mode, options, opened_path) _php_stream_open_wrapper_as_file((path), (mode), (options), (opened_path) STREAMS_CC TSRMLS_CC) +PHPAPI FILE * _php_stream_open_wrapper_as_file(char * path, char * mode, int options, char **opened_path STREAMS_DC); +#define php_stream_open_wrapper_as_file(path, mode, options, opened_path) _php_stream_open_wrapper_as_file((path), (mode), (options), (opened_path) STREAMS_CC) END_EXTERN_C() diff --git a/main/streams/php_stream_transport.h b/main/streams/php_stream_transport.h index 2d076064cf..89a2e9a5f3 100644 --- a/main/streams/php_stream_transport.h +++ b/main/streams/php_stream_transport.h @@ -30,12 +30,12 @@ typedef php_stream *(php_stream_transport_factory_func)(const char *proto, size_ const char *resourcename, size_t resourcenamelen, const char *persistent_id, int options, int flags, struct timeval *timeout, - php_stream_context *context STREAMS_DC TSRMLS_DC); + php_stream_context *context STREAMS_DC); typedef php_stream_transport_factory_func *php_stream_transport_factory; BEGIN_EXTERN_C() -PHPAPI int php_stream_xport_register(const char *protocol, php_stream_transport_factory factory TSRMLS_DC); -PHPAPI int php_stream_xport_unregister(const char *protocol TSRMLS_DC); +PHPAPI int php_stream_xport_register(const char *protocol, php_stream_transport_factory factory); +PHPAPI int php_stream_xport_unregister(const char *protocol); #define STREAM_XPORT_CLIENT 0 #define STREAM_XPORT_SERVER 1 @@ -52,10 +52,10 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in php_stream_context *context, zend_string **error_string, int *error_code - STREAMS_DC TSRMLS_DC); + STREAMS_DC); #define php_stream_xport_create(name, namelen, options, flags, persistent_id, timeout, context, estr, ecode) \ - _php_stream_xport_create(name, namelen, options, flags, persistent_id, timeout, context, estr, ecode STREAMS_CC TSRMLS_CC) + _php_stream_xport_create(name, namelen, options, flags, persistent_id, timeout, context, estr, ecode STREAMS_CC) /* Bind the stream to a local address */ PHPAPI int php_stream_xport_bind(php_stream *stream, @@ -102,12 +102,12 @@ enum php_stream_xport_send_recv_flags { * peeking, optionally retrieving OOB data */ PHPAPI int php_stream_xport_recvfrom(php_stream *stream, char *buf, size_t buflen, int flags, void **addr, socklen_t *addrlen, - zend_string **textaddr TSRMLS_DC); + zend_string **textaddr); /* Similar to send() system call; send data to the stream, optionally * sending it as OOB data */ PHPAPI int php_stream_xport_sendto(php_stream *stream, const char *buf, size_t buflen, - int flags, void *addr, socklen_t addrlen TSRMLS_DC); + int flags, void *addr, socklen_t addrlen); typedef enum { STREAM_SHUT_RD, @@ -117,7 +117,7 @@ typedef enum { /* Similar to shutdown() system call; shut down part of a full-duplex * connection */ -PHPAPI int php_stream_xport_shutdown(php_stream *stream, stream_shutdown_t how TSRMLS_DC); +PHPAPI int php_stream_xport_shutdown(php_stream *stream, stream_shutdown_t how); END_EXTERN_C() @@ -186,8 +186,8 @@ typedef enum { /* These functions provide crypto support on the underlying transport */ BEGIN_EXTERN_C() -PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream TSRMLS_DC); -PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate TSRMLS_DC); +PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream); +PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate); END_EXTERN_C() typedef struct _php_stream_xport_crypto_param { diff --git a/main/streams/php_streams_int.h b/main/streams/php_streams_int.h index d8799fcefb..ac0163ddb4 100644 --- a/main/streams/php_streams_int.h +++ b/main/streams/php_streams_int.h @@ -66,6 +66,6 @@ * ones. result should be a char[5]. */ void php_stream_mode_sanitize_fdopen_fopencookie(php_stream *stream, char *result); -void php_stream_tidy_wrapper_error_log(php_stream_wrapper *wrapper TSRMLS_DC); -void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *path, const char *caption TSRMLS_DC); +void php_stream_tidy_wrapper_error_log(php_stream_wrapper *wrapper); +void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *path, const char *caption); diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index 8fad2aa4f1..acb34b8968 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -44,14 +44,14 @@ # include "win32/time.h" #endif -#define php_stream_fopen_from_fd_int(fd, mode, persistent_id) _php_stream_fopen_from_fd_int((fd), (mode), (persistent_id) STREAMS_CC TSRMLS_CC) -#define php_stream_fopen_from_fd_int_rel(fd, mode, persistent_id) _php_stream_fopen_from_fd_int((fd), (mode), (persistent_id) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_fopen_from_file_int(file, mode) _php_stream_fopen_from_file_int((file), (mode) STREAMS_CC TSRMLS_CC) -#define php_stream_fopen_from_file_int_rel(file, mode) _php_stream_fopen_from_file_int((file), (mode) STREAMS_REL_CC TSRMLS_CC) +#define php_stream_fopen_from_fd_int(fd, mode, persistent_id) _php_stream_fopen_from_fd_int((fd), (mode), (persistent_id) STREAMS_CC) +#define php_stream_fopen_from_fd_int_rel(fd, mode, persistent_id) _php_stream_fopen_from_fd_int((fd), (mode), (persistent_id) STREAMS_REL_CC) +#define php_stream_fopen_from_file_int(file, mode) _php_stream_fopen_from_file_int((file), (mode) STREAMS_CC) +#define php_stream_fopen_from_file_int_rel(file, mode) _php_stream_fopen_from_file_int((file), (mode) STREAMS_REL_CC) #if !defined(WINDOWS) && !defined(NETWARE) -extern int php_get_uid_by_name(const char *name, uid_t *uid TSRMLS_DC); -extern int php_get_gid_by_name(const char *name, gid_t *gid TSRMLS_DC); +extern int php_get_uid_by_name(const char *name, uid_t *uid); +extern int php_get_gid_by_name(const char *name, gid_t *gid); #endif #if defined(PHP_WIN32) @@ -158,7 +158,7 @@ static int do_fstat(php_stdio_stream_data *d, int force) return 0; } -static php_stream *_php_stream_fopen_from_fd_int(int fd, const char *mode, const char *persistent_id STREAMS_DC TSRMLS_DC) +static php_stream *_php_stream_fopen_from_fd_int(int fd, const char *mode, const char *persistent_id STREAMS_DC) { php_stdio_stream_data *self; @@ -174,7 +174,7 @@ static php_stream *_php_stream_fopen_from_fd_int(int fd, const char *mode, const return php_stream_alloc_rel(&php_stream_stdio_ops, self, persistent_id, mode); } -static php_stream *_php_stream_fopen_from_file_int(FILE *file, const char *mode STREAMS_DC TSRMLS_DC) +static php_stream *_php_stream_fopen_from_file_int(FILE *file, const char *mode STREAMS_DC) { php_stdio_stream_data *self; @@ -190,12 +190,12 @@ static php_stream *_php_stream_fopen_from_file_int(FILE *file, const char *mode return php_stream_alloc_rel(&php_stream_stdio_ops, self, 0, mode); } -PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char *pfx, char **opened_path_ptr STREAMS_DC TSRMLS_DC) +PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char *pfx, char **opened_path_ptr STREAMS_DC) { char *opened_path = NULL; int fd; - fd = php_open_temporary_fd(dir, pfx, &opened_path TSRMLS_CC); + fd = php_open_temporary_fd(dir, pfx, &opened_path); if (fd != -1) { php_stream *stream; @@ -216,19 +216,19 @@ PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char } close(fd); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to allocate stream"); + php_error_docref(NULL, E_WARNING, "unable to allocate stream"); return NULL; } return NULL; } -PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC TSRMLS_DC) +PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC) { return php_stream_fopen_temporary_file(NULL, "php", NULL); } -PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const char *persistent_id STREAMS_DC TSRMLS_DC) +PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const char *persistent_id STREAMS_DC) { php_stream *stream = php_stream_fopen_from_fd_int_rel(fd, mode, persistent_id); @@ -267,7 +267,7 @@ PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const cha return stream; } -PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STREAMS_DC TSRMLS_DC) +PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STREAMS_DC) { php_stream *stream = php_stream_fopen_from_file_int_rel(file, mode); @@ -299,7 +299,7 @@ PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STRE return stream; } -PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STREAMS_DC TSRMLS_DC) +PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STREAMS_DC) { php_stdio_stream_data *self; php_stream *stream; @@ -318,7 +318,7 @@ PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STRE return stream; } -static size_t php_stdiop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) +static size_t php_stdiop_write(php_stream *stream, const char *buf, size_t count) { php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; @@ -345,7 +345,7 @@ static size_t php_stdiop_write(php_stream *stream, const char *buf, size_t count } } -static size_t php_stdiop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) +static size_t php_stdiop_read(php_stream *stream, char *buf, size_t count) { php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; size_t ret; @@ -406,7 +406,7 @@ static size_t php_stdiop_read(php_stream *stream, char *buf, size_t count TSRMLS return ret; } -static int php_stdiop_close(php_stream *stream, int close_handle TSRMLS_DC) +static int php_stdiop_close(php_stream *stream, int close_handle) { int ret; php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; @@ -467,7 +467,7 @@ static int php_stdiop_close(php_stream *stream, int close_handle TSRMLS_DC) return ret; } -static int php_stdiop_flush(php_stream *stream TSRMLS_DC) +static int php_stdiop_flush(php_stream *stream) { php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; @@ -484,7 +484,7 @@ static int php_stdiop_flush(php_stream *stream TSRMLS_DC) return 0; } -static int php_stdiop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC) +static int php_stdiop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset) { php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; int ret; @@ -492,7 +492,7 @@ static int php_stdiop_seek(php_stream *stream, zend_off_t offset, int whence, ze assert(data != NULL); if (data->is_pipe) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot seek on a pipe"); + php_error_docref(NULL, E_WARNING, "cannot seek on a pipe"); return -1; } @@ -513,7 +513,7 @@ static int php_stdiop_seek(php_stream *stream, zend_off_t offset, int whence, ze } } -static int php_stdiop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) +static int php_stdiop_cast(php_stream *stream, int castas, void **ret) { php_socket_t fd; php_stdio_stream_data *data = (php_stdio_stream_data*) stream->abstract; @@ -571,7 +571,7 @@ static int php_stdiop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) } } -static int php_stdiop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) +static int php_stdiop_stat(php_stream *stream, php_stream_statbuf *ssb) { int ret; php_stdio_stream_data *data = (php_stdio_stream_data*) stream->abstract; @@ -583,7 +583,7 @@ static int php_stdiop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC return ret; } -static int php_stdiop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) +static int php_stdiop_set_option(php_stream *stream, int option, int value, void *ptrparam) { php_stdio_stream_data *data = (php_stdio_stream_data*) stream->abstract; size_t size; @@ -846,7 +846,7 @@ PHPAPI php_stream_ops php_stream_stdio_ops = { /* }}} */ /* {{{ plain files opendir/readdir implementation */ -static size_t php_plain_files_dirstream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) +static size_t php_plain_files_dirstream_read(php_stream *stream, char *buf, size_t count) { DIR *dir = (DIR*)stream->abstract; /* avoid libc5 readdir problems */ @@ -865,12 +865,12 @@ static size_t php_plain_files_dirstream_read(php_stream *stream, char *buf, size return 0; } -static int php_plain_files_dirstream_close(php_stream *stream, int close_handle TSRMLS_DC) +static int php_plain_files_dirstream_close(php_stream *stream, int close_handle) { return closedir((DIR *)stream->abstract); } -static int php_plain_files_dirstream_rewind(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC) +static int php_plain_files_dirstream_rewind(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs) { rewinddir((DIR *)stream->abstract); return 0; @@ -887,18 +887,18 @@ static php_stream_ops php_plain_files_dirstream_ops = { }; static php_stream *php_plain_files_dir_opener(php_stream_wrapper *wrapper, const char *path, const char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) + int options, char **opened_path, php_stream_context *context STREAMS_DC) { DIR *dir = NULL; php_stream *stream = NULL; #ifdef HAVE_GLOB if (options & STREAM_USE_GLOB_DIR_OPEN) { - return php_glob_stream_wrapper.wops->dir_opener(&php_glob_stream_wrapper, path, mode, options, opened_path, context STREAMS_REL_CC TSRMLS_CC); + return php_glob_stream_wrapper.wops->dir_opener(&php_glob_stream_wrapper, path, mode, options, opened_path, context STREAMS_REL_CC); } #endif - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) { + if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path)) { return NULL; } @@ -906,7 +906,7 @@ static php_stream *php_plain_files_dir_opener(php_stream_wrapper *wrapper, const #ifdef PHP_WIN32 if (!dir) { - php_win32_docref2_from_error(GetLastError(), path, path TSRMLS_CC); + php_win32_docref2_from_error(GetLastError(), path, path); } if (dir && dir->finished) { @@ -925,7 +925,7 @@ static php_stream *php_plain_files_dir_opener(php_stream_wrapper *wrapper, const /* }}} */ /* {{{ php_stream_fopen */ -PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, char **opened_path, int options STREAMS_DC TSRMLS_DC) +PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, char **opened_path, int options STREAMS_DC) { char *realpath = NULL; int open_flags; @@ -936,7 +936,7 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, cha if (FAILURE == php_stream_parse_fopen_modes(mode, &open_flags)) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "`%s' is not a valid mode for fopen", mode); + php_error_docref(NULL, E_WARNING, "`%s' is not a valid mode for fopen", mode); } return NULL; } @@ -944,14 +944,14 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, cha if (options & STREAM_ASSUME_REALPATH) { realpath = estrdup(filename); } else { - if ((realpath = expand_filepath(filename, NULL TSRMLS_CC)) == NULL) { + if ((realpath = expand_filepath(filename, NULL)) == NULL) { return NULL; } } if (persistent) { spprintf(&persistent_id, 0, "streams_stdio_%d_%s", open_flags, realpath); - switch (php_stream_from_persistent_id(persistent_id, &ret TSRMLS_CC)) { + switch (php_stream_from_persistent_id(persistent_id, &ret)) { case PHP_STREAM_PERSISTENT_SUCCESS: if (opened_path) { *opened_path = realpath; @@ -1025,22 +1025,22 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, cha static php_stream *php_plain_files_stream_opener(php_stream_wrapper *wrapper, const char *path, const char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) + int options, char **opened_path, php_stream_context *context STREAMS_DC) { - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) { + if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path)) { return NULL; } return php_stream_fopen_rel(path, mode, opened_path, options); } -static int php_plain_files_url_stater(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) +static int php_plain_files_url_stater(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context) { if (strncasecmp(url, "file://", sizeof("file://") - 1) == 0) { url += sizeof("file://") - 1; } - if (php_check_open_basedir_ex(url, (flags & PHP_STREAM_URL_STAT_QUIET) ? 0 : 1 TSRMLS_CC)) { + if (php_check_open_basedir_ex(url, (flags & PHP_STREAM_URL_STAT_QUIET) ? 0 : 1)) { return -1; } @@ -1060,7 +1060,7 @@ static int php_plain_files_url_stater(php_stream_wrapper *wrapper, const char *u return VCWD_STAT(url, &ssb->sb); } -static int php_plain_files_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC) +static int php_plain_files_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context) { int ret; @@ -1068,25 +1068,25 @@ static int php_plain_files_unlink(php_stream_wrapper *wrapper, const char *url, url += sizeof("file://") - 1; } - if (php_check_open_basedir(url TSRMLS_CC)) { + if (php_check_open_basedir(url)) { return 0; } ret = VCWD_UNLINK(url); if (ret == -1) { if (options & REPORT_ERRORS) { - php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "%s", strerror(errno)); + php_error_docref1(NULL, url, E_WARNING, "%s", strerror(errno)); } return 0; } /* Clear stat cache (and realpath cache) */ - php_clear_stat_cache(1, NULL, 0 TSRMLS_CC); + php_clear_stat_cache(1, NULL, 0); return 1; } -static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC) +static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context) { int ret; @@ -1096,11 +1096,11 @@ static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_f #ifdef PHP_WIN32 if (!php_win32_check_trailing_space(url_from, (int)strlen(url_from))) { - php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to TSRMLS_CC); + php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to); return 0; } if (!php_win32_check_trailing_space(url_to, (int)strlen(url_to))) { - php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to TSRMLS_CC); + php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to); return 0; } #endif @@ -1113,7 +1113,7 @@ static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_f url_to += sizeof("file://") - 1; } - if (php_check_open_basedir(url_from TSRMLS_CC) || php_check_open_basedir(url_to TSRMLS_CC)) { + if (php_check_open_basedir(url_from) || php_check_open_basedir(url_to)) { return 0; } @@ -1124,25 +1124,25 @@ static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_f # ifdef EXDEV if (errno == EXDEV) { zend_stat_t sb; - if (php_copy_file(url_from, url_to TSRMLS_CC) == SUCCESS) { + if (php_copy_file(url_from, url_to) == SUCCESS) { if (VCWD_STAT(url_from, &sb) == 0) { # if !defined(TSRM_WIN32) && !defined(NETWARE) if (VCWD_CHMOD(url_to, sb.st_mode)) { if (errno == EPERM) { - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); + php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno)); VCWD_UNLINK(url_from); return 1; } - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); + php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno)); return 0; } if (VCWD_CHOWN(url_to, sb.st_uid, sb.st_gid)) { if (errno == EPERM) { - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); + php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno)); VCWD_UNLINK(url_from); return 1; } - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); + php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno)); return 0; } # endif @@ -1150,27 +1150,27 @@ static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_f return 1; } } - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); + php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno)); return 0; } # endif #endif #ifdef PHP_WIN32 - php_win32_docref2_from_error(GetLastError(), url_from, url_to TSRMLS_CC); + php_win32_docref2_from_error(GetLastError(), url_from, url_to); #else - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); + php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno)); #endif return 0; } /* Clear stat cache (and realpath cache) */ - php_clear_stat_cache(1, NULL, 0 TSRMLS_CC); + php_clear_stat_cache(1, NULL, 0); return 1; } -static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, int mode, int options, php_stream_context *context TSRMLS_DC) +static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, int mode, int options, php_stream_context *context) { int ret, recursive = options & PHP_STREAM_MKDIR_RECURSIVE; char *p; @@ -1180,7 +1180,7 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, i } if (!recursive) { - ret = php_mkdir(dir, mode TSRMLS_CC); + ret = php_mkdir(dir, mode); } else { /* we look for directory separator from the end of string, thus hopefuly reducing our work load */ char *e; @@ -1189,8 +1189,8 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, i int offset = 0; char buf[MAXPATHLEN]; - if (!expand_filepath_with_mode(dir, buf, NULL, 0, CWD_EXPAND TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path"); + if (!expand_filepath_with_mode(dir, buf, NULL, 0, CWD_EXPAND )) { + php_error_docref(NULL, E_WARNING, "Invalid path"); return 0; } @@ -1227,8 +1227,8 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, i } if (p == buf) { - ret = php_mkdir(dir, mode TSRMLS_CC); - } else if (!(ret = php_mkdir(buf, mode TSRMLS_CC))) { + ret = php_mkdir(dir, mode); + } else if (!(ret = php_mkdir(buf, mode))) { if (!p) { p = buf; } @@ -1239,7 +1239,7 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, i if ((*(p+1) != '\0') && (ret = VCWD_MKDIR(buf, (mode_t)mode)) < 0) { if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); } break; } @@ -1256,35 +1256,35 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, i } } -static int php_plain_files_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC) +static int php_plain_files_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context) { if (strncasecmp(url, "file://", sizeof("file://") - 1) == 0) { url += sizeof("file://") - 1; } - if (php_check_open_basedir(url TSRMLS_CC)) { + if (php_check_open_basedir(url)) { return 0; } #if PHP_WIN32 if (!php_win32_check_trailing_space(url, (int)strlen(url))) { - php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "%s", strerror(ENOENT)); + php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT)); return 0; } #endif if (VCWD_RMDIR(url) < 0) { - php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "%s", strerror(errno)); + php_error_docref1(NULL, url, E_WARNING, "%s", strerror(errno)); return 0; } /* Clear stat cache (and realpath cache) */ - php_clear_stat_cache(1, NULL, 0 TSRMLS_CC); + php_clear_stat_cache(1, NULL, 0); return 1; } -static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url, int option, void *value, php_stream_context *context TSRMLS_DC) +static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url, int option, void *value, php_stream_context *context) { struct utimbuf *newtime; #if !defined(WINDOWS) && !defined(NETWARE) @@ -1299,7 +1299,7 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url #if PHP_WIN32 if (!php_win32_check_trailing_space(url, url_len)) { - php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "%s", strerror(ENOENT)); + php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT)); return 0; } #endif @@ -1308,7 +1308,7 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url url += sizeof("file://") - 1; } - if (php_check_open_basedir(url TSRMLS_CC)) { + if (php_check_open_basedir(url)) { return 0; } @@ -1318,7 +1318,7 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url if (VCWD_ACCESS(url, F_OK) != 0) { FILE *file = VCWD_FOPEN(url, "w"); if (file == NULL) { - php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "Unable to create file %s because %s", url, strerror(errno)); + php_error_docref1(NULL, url, E_WARNING, "Unable to create file %s because %s", url, strerror(errno)); return 0; } fclose(file); @@ -1330,8 +1330,8 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url case PHP_STREAM_META_OWNER_NAME: case PHP_STREAM_META_OWNER: if(option == PHP_STREAM_META_OWNER_NAME) { - if(php_get_uid_by_name((char *)value, &uid TSRMLS_CC) != SUCCESS) { - php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "Unable to find uid for %s", (char *)value); + if(php_get_uid_by_name((char *)value, &uid) != SUCCESS) { + php_error_docref1(NULL, url, E_WARNING, "Unable to find uid for %s", (char *)value); return 0; } } else { @@ -1342,8 +1342,8 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url case PHP_STREAM_META_GROUP: case PHP_STREAM_META_GROUP_NAME: if(option == PHP_STREAM_META_OWNER_NAME) { - if(php_get_gid_by_name((char *)value, &gid TSRMLS_CC) != SUCCESS) { - php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "Unable to find gid for %s", (char *)value); + if(php_get_gid_by_name((char *)value, &gid) != SUCCESS) { + php_error_docref1(NULL, url, E_WARNING, "Unable to find gid for %s", (char *)value); return 0; } } else { @@ -1357,14 +1357,14 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url ret = VCWD_CHMOD(url, mode); break; default: - php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "Unknown option %d for stream_metadata", option); + php_error_docref1(NULL, url, E_WARNING, "Unknown option %d for stream_metadata", option); return 0; } if (ret == -1) { - php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "Operation failed: %s", strerror(errno)); + php_error_docref1(NULL, url, E_WARNING, "Operation failed: %s", strerror(errno)); return 0; } - php_clear_stat_cache(0, NULL, 0 TSRMLS_CC); + php_clear_stat_cache(0, NULL, 0); return 1; } @@ -1390,7 +1390,7 @@ PHPAPI php_stream_wrapper php_plain_files_wrapper = { }; /* {{{ php_stream_fopen_with_path */ -PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path, int options STREAMS_DC TSRMLS_DC) +PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path, int options STREAMS_DC) { /* code ripped off from fopen_wrappers.c */ char *pathbuf, *end; @@ -1424,7 +1424,7 @@ PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char } - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(filename TSRMLS_CC)) { + if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(filename)) { return NULL; } @@ -1436,7 +1436,7 @@ not_relative_path: /* Absolute path open */ if (IS_ABSOLUTE_PATH(filename, filename_length)) { - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(filename TSRMLS_CC)) { + if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(filename)) { return NULL; } @@ -1447,17 +1447,17 @@ not_relative_path: if (IS_SLASH(filename[0])) { size_t cwd_len; char *cwd; - cwd = virtual_getcwd_ex(&cwd_len TSRMLS_CC); + cwd = virtual_getcwd_ex(&cwd_len); /* getcwd() will return always return [DRIVE_LETTER]:/) on windows. */ *(cwd+3) = '\0'; if (snprintf(trypath, MAXPATHLEN, "%s%s", cwd, filename) >= MAXPATHLEN) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s/%s path was truncated to %d", cwd, filename, MAXPATHLEN); + php_error_docref(NULL, E_NOTICE, "%s/%s path was truncated to %d", cwd, filename, MAXPATHLEN); } efree(cwd); - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(trypath TSRMLS_CC)) { + if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(trypath)) { return NULL; } @@ -1473,8 +1473,8 @@ not_relative_path: /* append the calling scripts' current working directory * as a fall back case */ - if (zend_is_executing(TSRMLS_C)) { - exec_fname = zend_get_executed_filename(TSRMLS_C); + if (zend_is_executing()) { + exec_fname = zend_get_executed_filename(); exec_fname_length = (int)strlen(exec_fname); path_length = (int)strlen(path); @@ -1506,10 +1506,10 @@ not_relative_path: goto stream_skip; } if (snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename) >= MAXPATHLEN) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s/%s path was truncated to %d", ptr, filename, MAXPATHLEN); + php_error_docref(NULL, E_NOTICE, "%s/%s path was truncated to %d", ptr, filename, MAXPATHLEN); } - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir_ex(trypath, 0 TSRMLS_CC)) { + if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir_ex(trypath, 0)) { goto stream_skip; } diff --git a/main/streams/streams.c b/main/streams/streams.c index c6420dc0d0..b5340e693a 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -55,7 +55,7 @@ PHPAPI int php_file_le_stream_filter(void) return le_stream_filter; } -PHPAPI HashTable *_php_stream_get_url_stream_wrappers_hash(TSRMLS_D) +PHPAPI HashTable *_php_stream_get_url_stream_wrappers_hash(void) { return (FG(stream_wrappers) ? FG(stream_wrappers) : &url_stream_wrappers_hash); } @@ -65,7 +65,7 @@ PHPAPI HashTable *php_stream_get_url_stream_wrappers_hash_global(void) return &url_stream_wrappers_hash; } -static int _php_stream_release_context(zval *zv, void *pContext TSRMLS_DC) +static int _php_stream_release_context(zval *zv, void *pContext) { zend_resource *le = Z_RES_P(zv); if (le->ptr == pContext) { @@ -74,7 +74,7 @@ static int _php_stream_release_context(zval *zv, void *pContext TSRMLS_DC) return 0; } -static int forget_persistent_resource_id_numbers(zval *el TSRMLS_DC) +static int forget_persistent_resource_id_numbers(zval *el) { php_stream *stream; zend_resource *rsrc = Z_RES_P(el); @@ -94,7 +94,7 @@ fprintf(stderr, "forget_persistent: %s:%p\n", stream->ops->label, stream); if (PHP_STREAM_CONTEXT(stream)) { zend_hash_apply_with_argument(&EG(regular_list), _php_stream_release_context, - PHP_STREAM_CONTEXT(stream) TSRMLS_CC); + PHP_STREAM_CONTEXT(stream)); stream->ctx = NULL; } @@ -103,7 +103,7 @@ fprintf(stderr, "forget_persistent: %s:%p\n", stream->ops->label, stream); PHP_RSHUTDOWN_FUNCTION(streams) { - zend_hash_apply(&EG(persistent_list), forget_persistent_resource_id_numbers TSRMLS_CC); + zend_hash_apply(&EG(persistent_list), forget_persistent_resource_id_numbers); return SUCCESS; } @@ -116,7 +116,7 @@ PHPAPI php_stream *php_stream_encloses(php_stream *enclosing, php_stream *enclos return orig; } -PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream **stream TSRMLS_DC) +PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream **stream) { zend_resource *le; @@ -155,7 +155,7 @@ PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream * /* }}} */ -static zend_llist *php_get_wrapper_errors_list(php_stream_wrapper *wrapper TSRMLS_DC) +static zend_llist *php_get_wrapper_errors_list(php_stream_wrapper *wrapper) { if (!FG(wrapper_errors)) { return NULL; @@ -165,14 +165,14 @@ static zend_llist *php_get_wrapper_errors_list(php_stream_wrapper *wrapper TSRML } /* {{{ wrapper error reporting */ -void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *path, const char *caption TSRMLS_DC) +void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *path, const char *caption) { char *tmp = estrdup(path); char *msg; int free_msg = 0; if (wrapper) { - zend_llist *err_list = php_get_wrapper_errors_list(wrapper TSRMLS_CC); + zend_llist *err_list = php_get_wrapper_errors_list(wrapper); if (err_list) { size_t l = 0; int brlen; @@ -222,14 +222,14 @@ void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char * } php_strip_url_passwd(tmp); - php_error_docref1(NULL TSRMLS_CC, tmp, E_WARNING, "%s: %s", caption, msg); + php_error_docref1(NULL, tmp, E_WARNING, "%s: %s", caption, msg); efree(tmp); if (free_msg) { efree(msg); } } -void php_stream_tidy_wrapper_error_log(php_stream_wrapper *wrapper TSRMLS_DC) +void php_stream_tidy_wrapper_error_log(php_stream_wrapper *wrapper) { if (wrapper && FG(wrapper_errors)) { zend_hash_str_del(FG(wrapper_errors), (const char*)&wrapper, sizeof(wrapper)); @@ -247,7 +247,7 @@ static void wrapper_list_dtor(zval *item) { efree(list); } -PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...) +PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options, const char *fmt, ...) { va_list args; char *buffer = NULL; @@ -257,7 +257,7 @@ PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int option va_end(args); if (options & REPORT_ERRORS || wrapper == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", buffer); + php_error_docref(NULL, E_WARNING, "%s", buffer); efree(buffer); } else { zend_llist *list = NULL; @@ -284,7 +284,7 @@ PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int option /* }}} */ /* allocate a new stream for a particular ops */ -PHPAPI php_stream *_php_stream_alloc(php_stream_ops *ops, void *abstract, const char *persistent_id, const char *mode STREAMS_DC TSRMLS_DC) /* {{{ */ +PHPAPI php_stream *_php_stream_alloc(php_stream_ops *ops, void *abstract, const char *persistent_id, const char *mode STREAMS_DC) /* {{{ */ { php_stream *ret; @@ -341,10 +341,10 @@ fprintf(stderr, "stream_alloc: %s:%p persistent=%s\n", ops->label, ret, persiste } /* }}} */ -PHPAPI int _php_stream_free_enclosed(php_stream *stream_enclosed, int close_options TSRMLS_DC) /* {{{ */ +PHPAPI int _php_stream_free_enclosed(php_stream *stream_enclosed, int close_options) /* {{{ */ { return _php_stream_free(stream_enclosed, - close_options | PHP_STREAM_FREE_IGNORE_ENCLOSING TSRMLS_CC); + close_options | PHP_STREAM_FREE_IGNORE_ENCLOSING); } /* }}} */ @@ -369,14 +369,14 @@ static const char *_php_stream_pretty_free_options(int close_options, char *out) } #endif -static int _php_stream_free_persistent(zval *zv, void *pStream TSRMLS_DC) +static int _php_stream_free_persistent(zval *zv, void *pStream) { zend_resource *le = Z_RES_P(zv); return le->ptr == pStream; } -PHPAPI int _php_stream_free(php_stream *stream, int close_options TSRMLS_DC) /* {{{ */ +PHPAPI int _php_stream_free(php_stream *stream, int close_options) /* {{{ */ { int ret = 1; int preserve_handle = close_options & PHP_STREAM_FREE_PRESERVE_HANDLE ? 1 : 0; @@ -426,7 +426,7 @@ PHPAPI int _php_stream_free(php_stream *stream, int close_options TSRMLS_DC) /* * enclosing stream can free this stream. We remove rsrc_dtor because * we want the enclosing stream to be deleted from the resource list */ return _php_stream_free(enclosing_stream, - (close_options | PHP_STREAM_FREE_CALL_DTOR) & ~PHP_STREAM_FREE_RSRC_DTOR TSRMLS_CC); + (close_options | PHP_STREAM_FREE_CALL_DTOR) & ~PHP_STREAM_FREE_RSRC_DTOR); } /* if we are releasing the stream only (and preserving the underlying handle), @@ -454,7 +454,7 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov #endif /* make sure everything is saved */ - _php_stream_flush(stream, 1 TSRMLS_CC); + _php_stream_flush(stream, 1); /* If not called from the resource dtor, remove the stream from the resource list. */ if ((close_options & PHP_STREAM_FREE_RSRC_DTOR) == 0 && stream->res) { @@ -485,7 +485,7 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov return fclose(stream->stdiocast); } - ret = stream->ops->close(stream, preserve_handle ? 0 : 1 TSRMLS_CC); + ret = stream->ops->close(stream, preserve_handle ? 0 : 1); stream->abstract = NULL; /* tidy up any FILE* that might have been fdopened */ @@ -498,14 +498,14 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov if (close_options & PHP_STREAM_FREE_RELEASE_STREAM) { while (stream->readfilters.head) { - php_stream_filter_remove(stream->readfilters.head, 1 TSRMLS_CC); + php_stream_filter_remove(stream->readfilters.head, 1); } while (stream->writefilters.head) { - php_stream_filter_remove(stream->writefilters.head, 1 TSRMLS_CC); + php_stream_filter_remove(stream->writefilters.head, 1); } if (stream->wrapper && stream->wrapper->wops && stream->wrapper->wops->stream_closer) { - stream->wrapper->wops->stream_closer(stream->wrapper, stream TSRMLS_CC); + stream->wrapper->wops->stream_closer(stream->wrapper, stream); stream->wrapper = NULL; } @@ -521,7 +521,7 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov if (stream->is_persistent && (close_options & PHP_STREAM_FREE_PERSISTENT)) { /* we don't work with *stream but need its value for comparison */ - zend_hash_apply_with_argument(&EG(persistent_list), _php_stream_free_persistent, stream TSRMLS_CC); + zend_hash_apply_with_argument(&EG(persistent_list), _php_stream_free_persistent, stream); } #if ZEND_DEBUG if ((close_options & PHP_STREAM_FREE_RSRC_DTOR) && (stream->__exposed == 0) && (EG(error_reporting) & E_WARNING)) { @@ -572,7 +572,7 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov /* {{{ generic stream operations */ -static void php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_DC) +static void php_stream_fill_read_buffer(php_stream *stream, size_t size) { /* allocate/fill the buffer */ @@ -597,12 +597,12 @@ static void php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_D php_stream_filter *filter; /* read a chunk into a bucket */ - justread = stream->ops->read(stream, chunk_buf, stream->chunk_size TSRMLS_CC); + justread = stream->ops->read(stream, chunk_buf, stream->chunk_size); if (justread && justread != (size_t)-1) { - bucket = php_stream_bucket_new(stream, chunk_buf, justread, 0, 0 TSRMLS_CC); + bucket = php_stream_bucket_new(stream, chunk_buf, justread, 0, 0); /* after this call, bucket is owned by the brigade */ - php_stream_bucket_append(brig_inp, bucket TSRMLS_CC); + php_stream_bucket_append(brig_inp, bucket); flags = PSFS_FLAG_NORMAL; } else { @@ -611,7 +611,7 @@ static void php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_D /* wind the handle... */ for (filter = stream->readfilters.head; filter; filter = filter->next) { - status = filter->fops->filter(stream, filter, brig_inp, brig_outp, NULL, flags TSRMLS_CC); + status = filter->fops->filter(stream, filter, brig_inp, brig_outp, NULL, flags); if (status != PSFS_PASS_ON) { break; @@ -643,8 +643,8 @@ static void php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_D memcpy(stream->readbuf + stream->writepos, bucket->buf, bucket->buflen); stream->writepos += bucket->buflen; - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_unlink(bucket); + php_stream_bucket_delref(bucket); } break; @@ -704,7 +704,7 @@ static void php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_D } } -PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size TSRMLS_DC) +PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size) { size_t toread = 0, didread = 0; @@ -734,13 +734,13 @@ PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size TSRMLS } if (!stream->readfilters.head && (stream->flags & PHP_STREAM_FLAG_NO_BUFFER || stream->chunk_size == 1)) { - toread = stream->ops->read(stream, buf, size TSRMLS_CC); + toread = stream->ops->read(stream, buf, size); if (toread == (size_t) -1) { /* e.g. underlying read(2) returned -1 */ break; } } else { - php_stream_fill_read_buffer(stream, size TSRMLS_CC); + php_stream_fill_read_buffer(stream, size); toread = stream->writepos - stream->readpos; if (toread > size) { @@ -774,7 +774,7 @@ PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size TSRMLS return didread; } -PHPAPI int _php_stream_eof(php_stream *stream TSRMLS_DC) +PHPAPI int _php_stream_eof(php_stream *stream) { /* if there is data in the buffer, it's not EOF */ if (stream->writepos - stream->readpos > 0) { @@ -791,7 +791,7 @@ PHPAPI int _php_stream_eof(php_stream *stream TSRMLS_DC) return stream->eof; } -PHPAPI int _php_stream_putc(php_stream *stream, int c TSRMLS_DC) +PHPAPI int _php_stream_putc(php_stream *stream, int c) { unsigned char buf = c; @@ -801,7 +801,7 @@ PHPAPI int _php_stream_putc(php_stream *stream, int c TSRMLS_DC) return EOF; } -PHPAPI int _php_stream_getc(php_stream *stream TSRMLS_DC) +PHPAPI int _php_stream_getc(php_stream *stream) { char buf; @@ -811,7 +811,7 @@ PHPAPI int _php_stream_getc(php_stream *stream TSRMLS_DC) return EOF; } -PHPAPI int _php_stream_puts(php_stream *stream, const char *buf TSRMLS_DC) +PHPAPI int _php_stream_puts(php_stream *stream, const char *buf) { size_t len; char newline[2] = "\n"; /* is this OK for Win? */ @@ -823,13 +823,13 @@ PHPAPI int _php_stream_puts(php_stream *stream, const char *buf TSRMLS_DC) return 0; } -PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) +PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb) { memset(ssb, 0, sizeof(*ssb)); /* if the stream was wrapped, allow the wrapper to stat it */ if (stream->wrapper && stream->wrapper->wops->stream_stat != NULL) { - return stream->wrapper->wops->stream_stat(stream->wrapper, stream, ssb TSRMLS_CC); + return stream->wrapper->wops->stream_stat(stream->wrapper, stream, ssb); } /* if the stream doesn't directly support stat-ing, return with failure. @@ -840,10 +840,10 @@ PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_D return -1; } - return (stream->ops->stat)(stream, ssb TSRMLS_CC); + return (stream->ops->stat)(stream, ssb); } -PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf TSRMLS_DC) +PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf) { size_t avail; const char *cr, *lf, *eol = NULL; @@ -886,7 +886,7 @@ PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf TS * appropriate length to hold the line, regardless of the line length, memory * permitting */ PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, - size_t *returned_len TSRMLS_DC) + size_t *returned_len) { size_t avail = 0; size_t current_buf_size = 0; @@ -923,7 +923,7 @@ PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, int done = 0; readptr = (char*)stream->readbuf + stream->readpos; - eol = php_stream_locate_eol(stream, NULL TSRMLS_CC); + eol = php_stream_locate_eol(stream, NULL); if (eol) { cpysz = eol - readptr + 1; @@ -976,7 +976,7 @@ PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, } } - php_stream_fill_read_buffer(stream, toread TSRMLS_CC); + php_stream_fill_read_buffer(stream, toread); if (stream->writepos - stream->readpos == 0) { break; @@ -1006,7 +1006,7 @@ static const char *_php_stream_search_delim(php_stream *stream, size_t maxlen, size_t skiplen, const char *delim, /* non-empty! */ - size_t delim_len TSRMLS_DC) + size_t delim_len) { size_t seek_len; @@ -1026,7 +1026,7 @@ static const char *_php_stream_search_delim(php_stream *stream, } } -PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, const char *delim, size_t delim_len TSRMLS_DC) +PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, const char *delim, size_t delim_len) { zend_string *ret_buf; /* returned buffer */ const char *found_delim = NULL; @@ -1040,7 +1040,7 @@ PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, con if (has_delim) { found_delim = _php_stream_search_delim( - stream, maxlen, 0, delim, delim_len TSRMLS_CC); + stream, maxlen, 0, delim, delim_len); } buffered_len = STREAM_BUFFERED_AMOUNT(stream); @@ -1051,7 +1051,7 @@ PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, con to_read_now = MIN(maxlen - buffered_len, stream->chunk_size); - php_stream_fill_read_buffer(stream, buffered_len + to_read_now TSRMLS_CC); + php_stream_fill_read_buffer(stream, buffered_len + to_read_now); just_read = STREAM_BUFFERED_AMOUNT(stream) - buffered_len; @@ -1073,7 +1073,7 @@ PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, con buffered_len >= (delim_len - 1) ? buffered_len - (delim_len - 1) : 0, - delim, delim_len TSRMLS_CC); + delim, delim_len); if (found_delim) { break; } @@ -1115,7 +1115,7 @@ PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, con } /* Writes a buffer directly to a stream, using multiple of the chunk size */ -static size_t _php_stream_write_buffer(php_stream *stream, const char *buf, size_t count TSRMLS_DC) +static size_t _php_stream_write_buffer(php_stream *stream, const char *buf, size_t count) { size_t didwrite = 0, towrite, justwrote; @@ -1125,7 +1125,7 @@ static size_t _php_stream_write_buffer(php_stream *stream, const char *buf, size if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0 && stream->readpos != stream->writepos) { stream->readpos = stream->writepos = 0; - stream->ops->seek(stream, stream->position, SEEK_SET, &stream->position TSRMLS_CC); + stream->ops->seek(stream, stream->position, SEEK_SET, &stream->position); } @@ -1134,7 +1134,7 @@ static size_t _php_stream_write_buffer(php_stream *stream, const char *buf, size if (towrite > stream->chunk_size) towrite = stream->chunk_size; - justwrote = stream->ops->write(stream, buf, towrite TSRMLS_CC); + justwrote = stream->ops->write(stream, buf, towrite); /* convert justwrote to an integer, since normally it is unsigned */ if ((int)justwrote > 0) { @@ -1160,7 +1160,7 @@ static size_t _php_stream_write_buffer(php_stream *stream, const char *buf, size * This may trigger a real write to the stream. * Returns the number of bytes consumed from buf by the first filter in the chain. * */ -static size_t _php_stream_write_filtered(php_stream *stream, const char *buf, size_t count, int flags TSRMLS_DC) +static size_t _php_stream_write_filtered(php_stream *stream, const char *buf, size_t count, int flags) { size_t consumed = 0; php_stream_bucket *bucket; @@ -1170,15 +1170,15 @@ static size_t _php_stream_write_filtered(php_stream *stream, const char *buf, si php_stream_filter *filter; if (buf) { - bucket = php_stream_bucket_new(stream, (char *)buf, count, 0, 0 TSRMLS_CC); - php_stream_bucket_append(&brig_in, bucket TSRMLS_CC); + bucket = php_stream_bucket_new(stream, (char *)buf, count, 0, 0); + php_stream_bucket_append(&brig_in, bucket); } for (filter = stream->writefilters.head; filter; filter = filter->next) { /* for our return value, we are interested in the number of bytes consumed from * the first filter in the chain */ status = filter->fops->filter(stream, filter, brig_inp, brig_outp, - filter == stream->writefilters.head ? &consumed : NULL, flags TSRMLS_CC); + filter == stream->writefilters.head ? &consumed : NULL, flags); if (status != PSFS_PASS_ON) { break; @@ -1198,14 +1198,14 @@ static size_t _php_stream_write_filtered(php_stream *stream, const char *buf, si * underlying stream */ while (brig_inp->head) { bucket = brig_inp->head; - _php_stream_write_buffer(stream, bucket->buf, bucket->buflen TSRMLS_CC); + _php_stream_write_buffer(stream, bucket->buf, bucket->buflen); /* Potential error situation - eg: no space on device. Perhaps we should keep this brigade * hanging around and try to write it later. * At the moment, we just drop it on the floor * */ - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_unlink(bucket); + php_stream_bucket_delref(bucket); } break; case PSFS_FEED_ME: @@ -1221,35 +1221,35 @@ static size_t _php_stream_write_filtered(php_stream *stream, const char *buf, si return consumed; } -PHPAPI int _php_stream_flush(php_stream *stream, int closing TSRMLS_DC) +PHPAPI int _php_stream_flush(php_stream *stream, int closing) { int ret = 0; if (stream->writefilters.head) { - _php_stream_write_filtered(stream, NULL, 0, closing ? PSFS_FLAG_FLUSH_CLOSE : PSFS_FLAG_FLUSH_INC TSRMLS_CC); + _php_stream_write_filtered(stream, NULL, 0, closing ? PSFS_FLAG_FLUSH_CLOSE : PSFS_FLAG_FLUSH_INC ); } if (stream->ops->flush) { - ret = stream->ops->flush(stream TSRMLS_CC); + ret = stream->ops->flush(stream); } return ret; } -PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) +PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t count) { if (buf == NULL || count == 0 || stream->ops->write == NULL) { return 0; } if (stream->writefilters.head) { - return _php_stream_write_filtered(stream, buf, count, PSFS_FLAG_NORMAL TSRMLS_CC); + return _php_stream_write_filtered(stream, buf, count, PSFS_FLAG_NORMAL); } else { - return _php_stream_write_buffer(stream, buf, count TSRMLS_CC); + return _php_stream_write_buffer(stream, buf, count); } } -PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) +PHPAPI size_t _php_stream_printf(php_stream *stream, const char *fmt, ...) { size_t count; char *buf; @@ -1269,12 +1269,12 @@ PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, return count; } -PHPAPI zend_off_t _php_stream_tell(php_stream *stream TSRMLS_DC) +PHPAPI zend_off_t _php_stream_tell(php_stream *stream) { return stream->position; } -PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence TSRMLS_DC) +PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence) { if (stream->fclose_stdiocast == PHP_STREAM_FCLOSE_FOPENCOOKIE) { /* flush to commit data written to the fopencookie FILE* */ @@ -1309,7 +1309,7 @@ PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence TS int ret; if (stream->writefilters.head) { - _php_stream_flush(stream, 0 TSRMLS_CC); + _php_stream_flush(stream, 0); } switch(whence) { @@ -1318,7 +1318,7 @@ PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence TS whence = SEEK_SET; break; } - ret = stream->ops->seek(stream, offset, whence, &stream->position TSRMLS_CC); + ret = stream->ops->seek(stream, offset, whence, &stream->position); if (((stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) || ret == 0) { if (ret == 0) { @@ -1348,17 +1348,17 @@ PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence TS return 0; } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream does not support seeking"); + php_error_docref(NULL, E_WARNING, "stream does not support seeking"); return -1; } -PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) +PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam) { int ret = PHP_STREAM_OPTION_RETURN_NOTIMPL; if (stream->ops->set_option) { - ret = stream->ops->set_option(stream, option, value, ptrparam TSRMLS_CC); + ret = stream->ops->set_option(stream, option, value, ptrparam); } if (ret == PHP_STREAM_OPTION_RETURN_NOTIMPL) { @@ -1387,12 +1387,12 @@ PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, voi return ret; } -PHPAPI int _php_stream_truncate_set_size(php_stream *stream, size_t newsize TSRMLS_DC) +PHPAPI int _php_stream_truncate_set_size(php_stream *stream, size_t newsize) { return php_stream_set_option(stream, PHP_STREAM_OPTION_TRUNCATE_API, PHP_STREAM_TRUNCATE_SET_SIZE, &newsize); } -PHPAPI size_t _php_stream_passthru(php_stream * stream STREAMS_DC TSRMLS_DC) +PHPAPI size_t _php_stream_passthru(php_stream * stream STREAMS_DC) { size_t bcount = 0; char buf[8192]; @@ -1427,7 +1427,7 @@ PHPAPI size_t _php_stream_passthru(php_stream * stream STREAMS_DC TSRMLS_DC) } -PHPAPI zend_string *_php_stream_copy_to_mem(php_stream *src, size_t maxlen, int persistent STREAMS_DC TSRMLS_DC) +PHPAPI zend_string *_php_stream_copy_to_mem(php_stream *src, size_t maxlen, int persistent STREAMS_DC) { size_t ret = 0; char *ptr; @@ -1503,7 +1503,7 @@ PHPAPI zend_string *_php_stream_copy_to_mem(php_stream *src, size_t maxlen, int } /* Returns SUCCESS/FAILURE and sets *len to the number of bytes moved */ -PHPAPI int _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, size_t maxlen, size_t *len STREAMS_DC TSRMLS_DC) +PHPAPI int _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, size_t maxlen, size_t *len STREAMS_DC) { char buf[CHUNK_SIZE]; size_t readchunk; @@ -1610,10 +1610,10 @@ PHPAPI int _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, size * Returns 1 when source len is 0. * Deprecated in favor of php_stream_copy_to_stream_ex() */ ZEND_ATTRIBUTE_DEPRECATED -PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen STREAMS_DC TSRMLS_DC) +PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen STREAMS_DC) { size_t len; - int ret = _php_stream_copy_to_stream_ex(src, dest, maxlen, &len STREAMS_REL_CC TSRMLS_CC); + int ret = _php_stream_copy_to_stream_ex(src, dest, maxlen, &len STREAMS_REL_CC); if (ret == SUCCESS && len == 0 && maxlen != 0) { return 1; } @@ -1623,20 +1623,20 @@ PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size /* {{{ wrapper init and registration */ -static void stream_resource_regular_dtor(zend_resource *rsrc TSRMLS_DC) +static void stream_resource_regular_dtor(zend_resource *rsrc) { php_stream *stream = (php_stream*)rsrc->ptr; /* set the return value for pclose */ FG(pclose_ret) = php_stream_free(stream, PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_RSRC_DTOR); } -static void stream_resource_persistent_dtor(zend_resource *rsrc TSRMLS_DC) +static void stream_resource_persistent_dtor(zend_resource *rsrc) { php_stream *stream = (php_stream*)rsrc->ptr; FG(pclose_ret) = php_stream_free(stream, PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_RSRC_DTOR); } -void php_shutdown_stream_hashes(TSRMLS_D) +void php_shutdown_stream_hashes(void) { if (FG(stream_wrappers)) { zend_hash_destroy(FG(stream_wrappers)); @@ -1657,7 +1657,7 @@ void php_shutdown_stream_hashes(TSRMLS_D) } } -int php_init_stream_wrappers(int module_number TSRMLS_DC) +int php_init_stream_wrappers(int module_number) { le_stream = zend_register_list_destructors_ex(stream_resource_regular_dtor, NULL, "stream", module_number); le_pstream = zend_register_list_destructors_ex(NULL, stream_resource_persistent_dtor, "persistent stream", module_number); @@ -1669,19 +1669,19 @@ int php_init_stream_wrappers(int module_number TSRMLS_DC) zend_hash_init(php_get_stream_filters_hash_global(), 8, NULL, NULL, 1); zend_hash_init(php_stream_xport_get_hash(), 8, NULL, NULL, 1); - return (php_stream_xport_register("tcp", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS + return (php_stream_xport_register("tcp", php_stream_generic_socket_factory) == SUCCESS && - php_stream_xport_register("udp", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS + php_stream_xport_register("udp", php_stream_generic_socket_factory) == SUCCESS #if defined(AF_UNIX) && !(defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE)) && - php_stream_xport_register("unix", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS + php_stream_xport_register("unix", php_stream_generic_socket_factory) == SUCCESS && - php_stream_xport_register("udg", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS + php_stream_xport_register("udg", php_stream_generic_socket_factory) == SUCCESS #endif ) ? SUCCESS : FAILURE; } -int php_shutdown_stream_wrappers(int module_number TSRMLS_DC) +int php_shutdown_stream_wrappers(int module_number) { zend_hash_destroy(&url_stream_wrappers_hash); zend_hash_destroy(php_get_stream_filters_hash_global()); @@ -1709,7 +1709,7 @@ static inline int php_stream_wrapper_scheme_validate(const char *protocol, unsig } /* API for registering GLOBAL wrappers */ -PHPAPI int php_register_url_stream_wrapper(const char *protocol, php_stream_wrapper *wrapper TSRMLS_DC) +PHPAPI int php_register_url_stream_wrapper(const char *protocol, php_stream_wrapper *wrapper) { unsigned int protocol_len = (unsigned int)strlen(protocol); @@ -1720,12 +1720,12 @@ PHPAPI int php_register_url_stream_wrapper(const char *protocol, php_stream_wrap return zend_hash_str_add_ptr(&url_stream_wrappers_hash, protocol, protocol_len, wrapper) ? SUCCESS : FAILURE; } -PHPAPI int php_unregister_url_stream_wrapper(const char *protocol TSRMLS_DC) +PHPAPI int php_unregister_url_stream_wrapper(const char *protocol) { return zend_hash_str_del(&url_stream_wrappers_hash, protocol, strlen(protocol)); } -static void clone_wrapper_hash(TSRMLS_D) +static void clone_wrapper_hash(void) { ALLOC_HASHTABLE(FG(stream_wrappers)); zend_hash_init(FG(stream_wrappers), zend_hash_num_elements(&url_stream_wrappers_hash), NULL, NULL, 1); @@ -1733,7 +1733,7 @@ static void clone_wrapper_hash(TSRMLS_D) } /* API for registering VOLATILE wrappers */ -PHPAPI int php_register_url_stream_wrapper_volatile(const char *protocol, php_stream_wrapper *wrapper TSRMLS_DC) +PHPAPI int php_register_url_stream_wrapper_volatile(const char *protocol, php_stream_wrapper *wrapper) { unsigned int protocol_len = (unsigned int)strlen(protocol); @@ -1742,16 +1742,16 @@ PHPAPI int php_register_url_stream_wrapper_volatile(const char *protocol, php_st } if (!FG(stream_wrappers)) { - clone_wrapper_hash(TSRMLS_C); + clone_wrapper_hash(); } return zend_hash_str_add_ptr(FG(stream_wrappers), protocol, protocol_len, wrapper) ? SUCCESS : FAILURE; } -PHPAPI int php_unregister_url_stream_wrapper_volatile(const char *protocol TSRMLS_DC) +PHPAPI int php_unregister_url_stream_wrapper_volatile(const char *protocol) { if (!FG(stream_wrappers)) { - clone_wrapper_hash(TSRMLS_C); + clone_wrapper_hash(); } return zend_hash_str_del(FG(stream_wrappers), protocol, strlen(protocol)); @@ -1759,7 +1759,7 @@ PHPAPI int php_unregister_url_stream_wrapper_volatile(const char *protocol TSRML /* }}} */ /* {{{ php_stream_locate_url_wrapper */ -PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const char **path_for_open, int options TSRMLS_DC) +PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const char **path_for_open, int options) { HashTable *wrapper_hash = (FG(stream_wrappers) ? FG(stream_wrappers) : &url_stream_wrappers_hash); php_stream_wrapper *wrapper = NULL; @@ -1784,7 +1784,7 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const /* BC with older php scripts and zlib wrapper */ protocol = "compress.zlib"; n = 13; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Use of \"zlib:\" wrapper is deprecated; please use \"compress.zlib://\" instead"); + php_error_docref(NULL, E_WARNING, "Use of \"zlib:\" wrapper is deprecated; please use \"compress.zlib://\" instead"); } if (protocol) { @@ -1799,7 +1799,7 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const } PHP_STRLCPY(wrapper_name, protocol, sizeof(wrapper_name), n); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find the wrapper \"%s\" - did you forget to enable it when you configured PHP?", wrapper_name); + php_error_docref(NULL, E_WARNING, "Unable to find the wrapper \"%s\" - did you forget to enable it when you configured PHP?", wrapper_name); wrapper = NULL; protocol = NULL; @@ -1825,7 +1825,7 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const if (localhost == 0 && path[n+3] != '\0' && path[n+3] != '/') { #endif if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "remote host file access not supported, %s", path); + php_error_docref(NULL, E_WARNING, "remote host file access not supported, %s", path); } return NULL; } @@ -1862,7 +1862,7 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const } if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "file:// wrapper is disabled in the server configuration"); + php_error_docref(NULL, E_WARNING, "file:// wrapper is disabled in the server configuration"); } return NULL; } @@ -1879,9 +1879,9 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const /* protocol[n] probably isn't '\0' */ char *protocol_dup = estrndup(protocol, n); if (!PG(allow_url_fopen)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s:// wrapper is disabled in the server configuration by allow_url_fopen=0", protocol_dup); + php_error_docref(NULL, E_WARNING, "%s:// wrapper is disabled in the server configuration by allow_url_fopen=0", protocol_dup); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s:// wrapper is disabled in the server configuration by allow_url_include=0", protocol_dup); + php_error_docref(NULL, E_WARNING, "%s:// wrapper is disabled in the server configuration by allow_url_include=0", protocol_dup); } efree(protocol_dup); } @@ -1894,36 +1894,36 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const /* {{{ _php_stream_mkdir */ -PHPAPI int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context TSRMLS_DC) +PHPAPI int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context) { php_stream_wrapper *wrapper = NULL; - wrapper = php_stream_locate_url_wrapper(path, NULL, 0 TSRMLS_CC); + wrapper = php_stream_locate_url_wrapper(path, NULL, 0); if (!wrapper || !wrapper->wops || !wrapper->wops->stream_mkdir) { return 0; } - return wrapper->wops->stream_mkdir(wrapper, path, mode, options, context TSRMLS_CC); + return wrapper->wops->stream_mkdir(wrapper, path, mode, options, context); } /* }}} */ /* {{{ _php_stream_rmdir */ -PHPAPI int _php_stream_rmdir(const char *path, int options, php_stream_context *context TSRMLS_DC) +PHPAPI int _php_stream_rmdir(const char *path, int options, php_stream_context *context) { php_stream_wrapper *wrapper = NULL; - wrapper = php_stream_locate_url_wrapper(path, NULL, 0 TSRMLS_CC); + wrapper = php_stream_locate_url_wrapper(path, NULL, 0); if (!wrapper || !wrapper->wops || !wrapper->wops->stream_rmdir) { return 0; } - return wrapper->wops->stream_rmdir(wrapper, path, options, context TSRMLS_CC); + return wrapper->wops->stream_rmdir(wrapper, path, options, context); } /* }}} */ /* {{{ _php_stream_stat_path */ -PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) +PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context) { php_stream_wrapper *wrapper = NULL; const char *path_to_open = path; @@ -1944,9 +1944,9 @@ PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf } } - wrapper = php_stream_locate_url_wrapper(path, &path_to_open, 0 TSRMLS_CC); + wrapper = php_stream_locate_url_wrapper(path, &path_to_open, 0); if (wrapper && wrapper->wops->url_stat) { - ret = wrapper->wops->url_stat(wrapper, path_to_open, flags, ssb, context TSRMLS_CC); + ret = wrapper->wops->url_stat(wrapper, path_to_open, flags, ssb, context); if (ret == 0) { if (!(flags & PHP_STREAM_URL_STAT_NOCACHE)) { /* Drop into cache */ @@ -1973,7 +1973,7 @@ PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf /* {{{ php_stream_opendir */ PHPAPI php_stream *_php_stream_opendir(const char *path, int options, - php_stream_context *context STREAMS_DC TSRMLS_DC) + php_stream_context *context STREAMS_DC) { php_stream *stream = NULL; php_stream_wrapper *wrapper = NULL; @@ -1985,31 +1985,31 @@ PHPAPI php_stream *_php_stream_opendir(const char *path, int options, path_to_open = path; - wrapper = php_stream_locate_url_wrapper(path, &path_to_open, options TSRMLS_CC); + wrapper = php_stream_locate_url_wrapper(path, &path_to_open, options); if (wrapper && wrapper->wops->dir_opener) { stream = wrapper->wops->dir_opener(wrapper, path_to_open, "r", options ^ REPORT_ERRORS, NULL, - context STREAMS_REL_CC TSRMLS_CC); + context STREAMS_REL_CC); if (stream) { stream->wrapper = wrapper; stream->flags |= PHP_STREAM_FLAG_NO_BUFFER | PHP_STREAM_FLAG_IS_DIR; } } else if (wrapper) { - php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS TSRMLS_CC, "not implemented"); + php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS, "not implemented"); } if (stream == NULL && (options & REPORT_ERRORS)) { - php_stream_display_wrapper_errors(wrapper, path, "failed to open dir" TSRMLS_CC); + php_stream_display_wrapper_errors(wrapper, path, "failed to open dir"); } - php_stream_tidy_wrapper_error_log(wrapper TSRMLS_CC); + php_stream_tidy_wrapper_error_log(wrapper); return stream; } /* }}} */ /* {{{ _php_stream_readdir */ -PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent TSRMLS_DC) +PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent) { if (sizeof(php_stream_dirent) == php_stream_read(dirstream, (char*)ent, sizeof(php_stream_dirent))) { @@ -2022,7 +2022,7 @@ PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_ /* {{{ php_stream_open_wrapper_ex */ PHPAPI php_stream *_php_stream_open_wrapper_ex(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) { php_stream *stream = NULL; php_stream_wrapper *wrapper = NULL; @@ -2036,12 +2036,12 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod } if (!path || !*path) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot be empty"); + php_error_docref(NULL, E_WARNING, "Filename cannot be empty"); return NULL; } if (options & USE_PATH) { - resolved_path = zend_resolve_path(path, (int)strlen(path) TSRMLS_CC); + resolved_path = zend_resolve_path(path, (int)strlen(path)); if (resolved_path) { path = resolved_path; /* we've found this file, don't re-check include_path or run realpath */ @@ -2052,9 +2052,9 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod path_to_open = path; - wrapper = php_stream_locate_url_wrapper(path, &path_to_open, options TSRMLS_CC); + wrapper = php_stream_locate_url_wrapper(path, &path_to_open, options); if (options & STREAM_USE_URL && (!wrapper || !wrapper->is_url)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function may only be used against URLs"); + php_error_docref(NULL, E_WARNING, "This function may only be used against URLs"); if (resolved_path) { efree(resolved_path); } @@ -2063,18 +2063,18 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod if (wrapper) { if (!wrapper->wops->stream_opener) { - php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS TSRMLS_CC, + php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS, "wrapper does not support stream open"); } else { stream = wrapper->wops->stream_opener(wrapper, path_to_open, mode, options ^ REPORT_ERRORS, - opened_path, context STREAMS_REL_CC TSRMLS_CC); + opened_path, context STREAMS_REL_CC); } /* if the caller asked for a persistent stream but the wrapper did not * return one, force an error here */ if (stream && (options & STREAM_OPEN_PERSISTENT) && !stream->is_persistent) { - php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS TSRMLS_CC, + php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS, "wrapper does not support persistent streams"); php_stream_close(stream); stream = NULL; @@ -2127,7 +2127,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod if (options & REPORT_ERRORS) { char *tmp = estrdup(path); php_strip_url_passwd(tmp); - php_error_docref1(NULL TSRMLS_CC, tmp, E_WARNING, "could not make seekable - %s", + php_error_docref1(NULL, tmp, E_WARNING, "could not make seekable - %s", tmp); efree(tmp); @@ -2140,19 +2140,19 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod zend_off_t newpos = 0; /* if opened for append, we need to revise our idea of the initial file position */ - if (0 == stream->ops->seek(stream, 0, SEEK_CUR, &newpos TSRMLS_CC)) { + if (0 == stream->ops->seek(stream, 0, SEEK_CUR, &newpos)) { stream->position = newpos; } } if (stream == NULL && (options & REPORT_ERRORS)) { - php_stream_display_wrapper_errors(wrapper, path, "failed to open stream" TSRMLS_CC); + php_stream_display_wrapper_errors(wrapper, path, "failed to open stream"); if (opened_path && *opened_path) { efree(*opened_path); *opened_path = NULL; } } - php_stream_tidy_wrapper_error_log(wrapper TSRMLS_CC); + php_stream_tidy_wrapper_error_log(wrapper); #if ZEND_DEBUG if (stream == NULL && copy_of_path != NULL) { pefree(copy_of_path, persistent); @@ -2166,7 +2166,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod /* }}} */ /* {{{ context API */ -PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context TSRMLS_DC) +PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context) { php_stream_context *oldcontext = PHP_STREAM_CONTEXT(stream); @@ -2184,10 +2184,10 @@ PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream } PHPAPI void php_stream_notification_notify(php_stream_context *context, int notifycode, int severity, - char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr TSRMLS_DC) + char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr) { if (context && context->notifier) - context->notifier->func(context, notifycode, severity, xmsg, xcode, bytes_sofar, bytes_max, ptr TSRMLS_CC); + context->notifier->func(context, notifycode, severity, xmsg, xcode, bytes_sofar, bytes_max, ptr); } PHPAPI void php_stream_context_free(php_stream_context *context) @@ -2203,7 +2203,7 @@ PHPAPI void php_stream_context_free(php_stream_context *context) efree(context); } -PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D) +PHPAPI php_stream_context *php_stream_context_alloc(void) { php_stream_context *context; @@ -2211,7 +2211,7 @@ PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D) context->notifier = NULL; array_init(&context->options); - context->res = ZEND_REGISTER_RESOURCE(NULL, context, php_le_stream_context(TSRMLS_C)); + context->res = ZEND_REGISTER_RESOURCE(NULL, context, php_le_stream_context()); return context; } @@ -2278,7 +2278,7 @@ PHPAPI int php_stream_dirent_alphasortr(const zend_string **a, const zend_string /* {{{ php_stream_scandir */ PHPAPI int _php_stream_scandir(const char *dirname, zend_string **namelist[], int flags, php_stream_context *context, - int (*compare) (const zend_string **a, const zend_string **b) TSRMLS_DC) + int (*compare) (const zend_string **a, const zend_string **b)) { php_stream *stream; php_stream_dirent sdp; diff --git a/main/streams/transports.c b/main/streams/transports.c index 8fd0b91d35..c0657ed0b4 100644 --- a/main/streams/transports.c +++ b/main/streams/transports.c @@ -29,23 +29,23 @@ PHPAPI HashTable *php_stream_xport_get_hash(void) return &xport_hash; } -PHPAPI int php_stream_xport_register(const char *protocol, php_stream_transport_factory factory TSRMLS_DC) +PHPAPI int php_stream_xport_register(const char *protocol, php_stream_transport_factory factory) { return zend_hash_str_update_ptr(&xport_hash, protocol, strlen(protocol), factory) ? SUCCESS : FAILURE; } -PHPAPI int php_stream_xport_unregister(const char *protocol TSRMLS_DC) +PHPAPI int php_stream_xport_unregister(const char *protocol) { return zend_hash_str_del(&xport_hash, protocol, strlen(protocol)); } #define ERR_REPORT(out_err, fmt, arg) \ if (out_err) { *out_err = strpprintf(0, fmt, arg); } \ - else { php_error_docref(NULL TSRMLS_CC, E_WARNING, fmt, arg); } + else { php_error_docref(NULL, E_WARNING, fmt, arg); } #define ERR_RETURN(out_err, local_err, fmt) \ if (out_err) { *out_err = local_err; } \ - else { php_error_docref(NULL TSRMLS_CC, E_WARNING, fmt, local_err ? local_err->val : "Unspecified error"); \ + else { php_error_docref(NULL, E_WARNING, fmt, local_err ? local_err->val : "Unspecified error"); \ if (local_err) { zend_string_release(local_err); local_err = NULL; } \ } @@ -55,7 +55,7 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in php_stream_context *context, zend_string **error_string, int *error_code - STREAMS_DC TSRMLS_DC) + STREAMS_DC) { php_stream *stream = NULL; php_stream_transport_factory factory = NULL; @@ -72,7 +72,7 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in /* check for a cached persistent socket */ if (persistent_id) { - switch(php_stream_from_persistent_id(persistent_id, &stream TSRMLS_CC)) { + switch(php_stream_from_persistent_id(persistent_id, &stream)) { case PHP_STREAM_PERSISTENT_SUCCESS: /* use a 0 second timeout when checking if the socket * has already died */ @@ -125,16 +125,16 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in if (factory == NULL) { /* should never happen */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find a factory !?"); + php_error_docref(NULL, E_WARNING, "Could not find a factory !?"); return NULL; } stream = (factory)(protocol, n, (char*)name, namelen, persistent_id, options, flags, timeout, - context STREAMS_REL_CC TSRMLS_CC); + context STREAMS_REL_CC); if (stream) { - php_stream_context_set(stream, context TSRMLS_CC); + php_stream_context_set(stream, context); if ((flags & STREAM_XPORT_SERVER) == 0) { /* client */ @@ -142,7 +142,7 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in if (flags & (STREAM_XPORT_CONNECT|STREAM_XPORT_CONNECT_ASYNC)) { if (-1 == php_stream_xport_connect(stream, name, namelen, flags & STREAM_XPORT_CONNECT_ASYNC ? 1 : 0, - timeout, &error_text, error_code TSRMLS_CC)) { + timeout, &error_text, error_code)) { ERR_RETURN(error_string, error_text, "connect() failed: %s"); @@ -153,7 +153,7 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in } else { /* server */ if (flags & STREAM_XPORT_BIND) { - if (0 != php_stream_xport_bind(stream, name, namelen, &error_text TSRMLS_CC)) { + if (0 != php_stream_xport_bind(stream, name, namelen, &error_text)) { ERR_RETURN(error_string, error_text, "bind() failed: %s"); failed = 1; } else if (flags & STREAM_XPORT_LISTEN) { @@ -170,7 +170,7 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in } } - if (0 != php_stream_xport_listen(stream, backlog, &error_text TSRMLS_CC)) { + if (0 != php_stream_xport_listen(stream, backlog, &error_text)) { ERR_RETURN(error_string, error_text, "listen() failed: %s"); failed = 1; } @@ -257,7 +257,7 @@ PHPAPI int php_stream_xport_connect(php_stream *stream, } /* Prepare to listen */ -PHPAPI int php_stream_xport_listen(php_stream *stream, int backlog, zend_string **error_text TSRMLS_DC) +PHPAPI int php_stream_xport_listen(php_stream *stream, int backlog, zend_string **error_text) { php_stream_xport_param param; int ret; @@ -349,7 +349,7 @@ PHPAPI int php_stream_xport_get_name(php_stream *stream, int want_peer, return ret; } -PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream TSRMLS_DC) +PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream) { php_stream_xport_crypto_param param; int ret; @@ -365,12 +365,12 @@ PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_cr return param.outputs.returncode; } - php_error_docref("streams.crypto" TSRMLS_CC, E_WARNING, "this stream does not support SSL/crypto"); + php_error_docref("streams.crypto", E_WARNING, "this stream does not support SSL/crypto"); return ret; } -PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate TSRMLS_DC) +PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate) { php_stream_xport_crypto_param param; int ret; @@ -385,7 +385,7 @@ PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate TSRML return param.outputs.returncode; } - php_error_docref("streams.crypto" TSRMLS_CC, E_WARNING, "this stream does not support SSL/crypto"); + php_error_docref("streams.crypto", E_WARNING, "this stream does not support SSL/crypto"); return ret; } @@ -407,7 +407,7 @@ PHPAPI int php_stream_xport_recvfrom(php_stream *stream, char *buf, size_t bufle } if (stream->readfilters.head) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot peek or fetch OOB data from a filtered stream"); + php_error_docref(NULL, E_WARNING, "cannot peek or fetch OOB data from a filtered stream"); return -1; } @@ -462,7 +462,7 @@ PHPAPI int php_stream_xport_recvfrom(php_stream *stream, char *buf, size_t bufle /* Similar to send() system call; send data to the stream, optionally * sending it as OOB data */ PHPAPI int php_stream_xport_sendto(php_stream *stream, const char *buf, size_t buflen, - int flags, void *addr, socklen_t addrlen TSRMLS_DC) + int flags, void *addr, socklen_t addrlen) { php_stream_xport_param param; int ret = 0; @@ -477,7 +477,7 @@ PHPAPI int php_stream_xport_sendto(php_stream *stream, const char *buf, size_t b oob = (flags & STREAM_OOB) == STREAM_OOB; if ((oob || addr) && stream->writefilters.head) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot write OOB data, or data to a targeted address on a filtered stream"); + php_error_docref(NULL, E_WARNING, "cannot write OOB data, or data to a targeted address on a filtered stream"); return -1; } @@ -501,7 +501,7 @@ PHPAPI int php_stream_xport_sendto(php_stream *stream, const char *buf, size_t b /* Similar to shutdown() system call; shut down part of a full-duplex * connection */ -PHPAPI int php_stream_xport_shutdown(php_stream *stream, stream_shutdown_t how TSRMLS_DC) +PHPAPI int php_stream_xport_shutdown(php_stream *stream, stream_shutdown_t how) { php_stream_xport_param param; int ret = 0; diff --git a/main/streams/userspace.c b/main/streams/userspace.c index 1ff80cdfa6..1215851374 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -45,15 +45,15 @@ struct php_user_stream_wrapper { php_stream_wrapper wrapper; }; -static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -static int user_wrapper_stat_url(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC); -static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC); -static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC); -static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context TSRMLS_DC); -static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC); -static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, int option, void *value, php_stream_context *context TSRMLS_DC); +static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC); +static int user_wrapper_stat_url(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context); +static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context); +static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context); +static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context); +static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context); +static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, int option, void *value, php_stream_context *context); static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char *filename, const char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); + int options, char **opened_path, php_stream_context *context STREAMS_DC); static php_stream_wrapper_ops user_stream_wops = { user_wrapper_opener, @@ -70,7 +70,7 @@ static php_stream_wrapper_ops user_stream_wops = { }; -static void stream_wrapper_dtor(zend_resource *rsrc TSRMLS_DC) +static void stream_wrapper_dtor(zend_resource *rsrc) { struct php_user_stream_wrapper * uwrap = (struct php_user_stream_wrapper*)rsrc->ptr; @@ -281,7 +281,7 @@ typedef struct _php_userstream_data php_userstream_data_t; }}} **/ -static void user_stream_create_object(struct php_user_stream_wrapper *uwrap, php_stream_context *context, zval *object TSRMLS_DC) +static void user_stream_create_object(struct php_user_stream_wrapper *uwrap, php_stream_context *context, zval *object) { /* create an instance of our class */ object_init_ex(object, uwrap->ce); @@ -314,8 +314,8 @@ static void user_stream_create_object(struct php_user_stream_wrapper *uwrap, php fcc.called_scope = Z_OBJCE_P(object); fcc.object = Z_OBJ_P(object); - if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute %s::%s()", uwrap->ce->name->val, uwrap->ce->constructor->common.function_name->val); + if (zend_call_function(&fci, &fcc) == FAILURE) { + php_error_docref(NULL, E_WARNING, "Could not execute %s::%s()", uwrap->ce->name->val, uwrap->ce->constructor->common.function_name->val); zval_dtor(object); ZVAL_UNDEF(object); } else { @@ -325,7 +325,7 @@ static void user_stream_create_object(struct php_user_stream_wrapper *uwrap, php } static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *filename, const char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) + int options, char **opened_path, php_stream_context *context STREAMS_DC) { struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; php_userstream_data_t *us; @@ -337,7 +337,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char * /* Try to catch bad usage without preventing flexibility */ if (FG(user_stream_current_filename) != NULL && strcmp(filename, FG(user_stream_current_filename)) == 0) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "infinite recursion prevented"); + php_stream_wrapper_log_error(wrapper, options, "infinite recursion prevented"); return NULL; } FG(user_stream_current_filename) = filename; @@ -356,7 +356,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char * us = emalloc(sizeof(*us)); us->wrapper = uwrap; - user_stream_create_object(uwrap, context, &us->object TSRMLS_CC); + user_stream_create_object(uwrap, context, &us->object); if (Z_TYPE(us->object) == IS_UNDEF) { FG(user_stream_current_filename) = NULL; PG(in_user_include) = old_in_user_include; @@ -391,7 +391,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char * /* set wrapper data to be a reference to our object */ ZVAL_COPY(&stream->wrapperdata, &us->object); } else { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "\"%s::" USERSTREAM_OPEN "\" call failed", + php_stream_wrapper_log_error(wrapper, options, "\"%s::" USERSTREAM_OPEN "\" call failed", us->wrapper->classname); } @@ -415,7 +415,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char * } static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char *filename, const char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) + int options, char **opened_path, php_stream_context *context STREAMS_DC) { struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; php_userstream_data_t *us; @@ -426,7 +426,7 @@ static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char /* Try to catch bad usage without preventing flexibility */ if (FG(user_stream_current_filename) != NULL && strcmp(filename, FG(user_stream_current_filename)) == 0) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "infinite recursion prevented"); + php_stream_wrapper_log_error(wrapper, options, "infinite recursion prevented"); return NULL; } FG(user_stream_current_filename) = filename; @@ -434,7 +434,7 @@ static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char us = emalloc(sizeof(*us)); us->wrapper = uwrap; - user_stream_create_object(uwrap, context, &us->object TSRMLS_CC); + user_stream_create_object(uwrap, context, &us->object); if (Z_TYPE(us->object) == IS_UNDEF) { FG(user_stream_current_filename) = NULL; efree(us); @@ -461,7 +461,7 @@ static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char /* set wrapper data to be a reference to our object */ ZVAL_COPY(&stream->wrapperdata, &us->object); } else { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "\"%s::" USERSTREAM_DIR_OPEN "\" call failed", + php_stream_wrapper_log_error(wrapper, options, "\"%s::" USERSTREAM_DIR_OPEN "\" call failed", us->wrapper->classname); } @@ -492,7 +492,7 @@ PHP_FUNCTION(stream_wrapper_register) zend_resource *rsrc; zend_long flags = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|l", &protocol, &classname, &flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|l", &protocol, &classname, &flags) == FAILURE) { RETURN_FALSE; } @@ -505,20 +505,20 @@ PHP_FUNCTION(stream_wrapper_register) rsrc = ZEND_REGISTER_RESOURCE(NULL, uwrap, le_protocols); - if ((uwrap->ce = zend_lookup_class(classname TSRMLS_CC)) != NULL) { - if (php_register_url_stream_wrapper_volatile(protocol->val, &uwrap->wrapper TSRMLS_CC) == SUCCESS) { + if ((uwrap->ce = zend_lookup_class(classname)) != NULL) { + if (php_register_url_stream_wrapper_volatile(protocol->val, &uwrap->wrapper) == SUCCESS) { RETURN_TRUE; } else { /* We failed. But why? */ if (zend_hash_exists(php_stream_get_url_stream_wrappers_hash(), protocol)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Protocol %s:// is already defined.", protocol->val); + php_error_docref(NULL, E_WARNING, "Protocol %s:// is already defined.", protocol->val); } else { /* Hash doesn't exist so it must have been an invalid protocol scheme */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid protocol scheme specified. Unable to register wrapper class %s to %s://", classname->val, protocol->val); + php_error_docref(NULL, E_WARNING, "Invalid protocol scheme specified. Unable to register wrapper class %s to %s://", classname->val, protocol->val); } } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "class '%s' is undefined", classname->val); + php_error_docref(NULL, E_WARNING, "class '%s' is undefined", classname->val); } zend_list_delete(rsrc); @@ -533,13 +533,13 @@ PHP_FUNCTION(stream_wrapper_unregister) char *protocol; size_t protocol_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &protocol, &protocol_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &protocol, &protocol_len) == FAILURE) { RETURN_FALSE; } - if (php_unregister_url_stream_wrapper_volatile(protocol TSRMLS_CC) == FAILURE) { + if (php_unregister_url_stream_wrapper_volatile(protocol) == FAILURE) { /* We failed */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to unregister protocol %s://", protocol); + php_error_docref(NULL, E_WARNING, "Unable to unregister protocol %s://", protocol); RETURN_FALSE; } @@ -555,26 +555,26 @@ PHP_FUNCTION(stream_wrapper_restore) php_stream_wrapper *wrapper; HashTable *global_wrapper_hash; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &protocol) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &protocol) == FAILURE) { RETURN_FALSE; } global_wrapper_hash = php_stream_get_url_stream_wrappers_hash_global(); if (php_stream_get_url_stream_wrappers_hash() == global_wrapper_hash) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s:// was never changed, nothing to restore", protocol->val); + php_error_docref(NULL, E_NOTICE, "%s:// was never changed, nothing to restore", protocol->val); RETURN_TRUE; } if ((wrapper = zend_hash_find_ptr(global_wrapper_hash, protocol)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s:// never existed, nothing to restore", protocol->val); + php_error_docref(NULL, E_WARNING, "%s:// never existed, nothing to restore", protocol->val); RETURN_FALSE; } /* A failure here could be okay given that the protocol might have been merely unregistered */ - php_unregister_url_stream_wrapper_volatile(protocol->val TSRMLS_CC); + php_unregister_url_stream_wrapper_volatile(protocol->val); - if (php_register_url_stream_wrapper_volatile(protocol->val, wrapper TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to restore original %s:// wrapper", protocol->val); + if (php_register_url_stream_wrapper_volatile(protocol->val, wrapper) == FAILURE) { + php_error_docref(NULL, E_WARNING, "Unable to restore original %s:// wrapper", protocol->val); RETURN_FALSE; } @@ -582,7 +582,7 @@ PHP_FUNCTION(stream_wrapper_restore) } /* }}} */ -static size_t php_userstreamop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) +static size_t php_userstreamop_write(php_stream *stream, const char *buf, size_t count) { zval func_name; zval retval; @@ -602,7 +602,7 @@ static size_t php_userstreamop_write(php_stream *stream, const char *buf, size_t &func_name, &retval, 1, args, - 0, NULL TSRMLS_CC); + 0, NULL); zval_ptr_dtor(&args[0]); zval_ptr_dtor(&func_name); @@ -611,13 +611,13 @@ static size_t php_userstreamop_write(php_stream *stream, const char *buf, size_t convert_to_long(&retval); didwrite = Z_LVAL(retval); } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_WRITE " is not implemented!", + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_WRITE " is not implemented!", us->wrapper->classname); } /* don't allow strange buffer overruns due to bogus return */ if (didwrite > count) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_WRITE " wrote " ZEND_LONG_FMT " bytes more data than requested (" ZEND_LONG_FMT " written, " ZEND_LONG_FMT " max)", + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_WRITE " wrote " ZEND_LONG_FMT " bytes more data than requested (" ZEND_LONG_FMT " written, " ZEND_LONG_FMT " max)", us->wrapper->classname, (zend_long)(didwrite - count), (zend_long)didwrite, (zend_long)count); didwrite = count; @@ -628,7 +628,7 @@ static size_t php_userstreamop_write(php_stream *stream, const char *buf, size_t return didwrite; } -static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) +static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count) { zval func_name; zval retval; @@ -648,20 +648,20 @@ static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count &func_name, &retval, 1, args, - 0, NULL TSRMLS_CC); + 0, NULL); if (call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { convert_to_string(&retval); didread = Z_STRLEN(retval); if (didread > count) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_READ " - read " ZEND_LONG_FMT " bytes more data than requested (" ZEND_LONG_FMT " read, " ZEND_LONG_FMT " max) - excess data will be lost", + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_READ " - read " ZEND_LONG_FMT " bytes more data than requested (" ZEND_LONG_FMT " read, " ZEND_LONG_FMT " max) - excess data will be lost", us->wrapper->classname, (zend_long)(didread - count), (zend_long)didread, (zend_long)count); didread = count; } if (didread > 0) memcpy(buf, Z_STRVAL(retval), didread); } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_READ " is not implemented!", + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_READ " is not implemented!", us->wrapper->classname); } zval_ptr_dtor(&args[0]); @@ -678,12 +678,12 @@ static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count Z_ISUNDEF(us->object)? NULL : &us->object, &func_name, &retval, - 0, NULL, 0, NULL TSRMLS_CC); + 0, NULL, 0, NULL); if (call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF && zval_is_true(&retval)) { stream->eof = 1; } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_EOF " is not implemented! Assuming EOF", us->wrapper->classname); @@ -696,7 +696,7 @@ static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count return didread; } -static int php_userstreamop_close(php_stream *stream, int close_handle TSRMLS_DC) +static int php_userstreamop_close(php_stream *stream, int close_handle) { zval func_name; zval retval; @@ -710,7 +710,7 @@ static int php_userstreamop_close(php_stream *stream, int close_handle TSRMLS_DC Z_ISUNDEF(us->object)? NULL : &us->object, &func_name, &retval, - 0, NULL, 0, NULL TSRMLS_CC); + 0, NULL, 0, NULL); zval_ptr_dtor(&retval); zval_ptr_dtor(&func_name); @@ -723,7 +723,7 @@ static int php_userstreamop_close(php_stream *stream, int close_handle TSRMLS_DC return 0; } -static int php_userstreamop_flush(php_stream *stream TSRMLS_DC) +static int php_userstreamop_flush(php_stream *stream) { zval func_name; zval retval; @@ -738,7 +738,7 @@ static int php_userstreamop_flush(php_stream *stream TSRMLS_DC) Z_ISUNDEF(us->object)? NULL : &us->object, &func_name, &retval, - 0, NULL, 0, NULL TSRMLS_CC); + 0, NULL, 0, NULL); if (call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF && zval_is_true(&retval)) call_result = 0; @@ -751,7 +751,7 @@ static int php_userstreamop_flush(php_stream *stream TSRMLS_DC) return call_result; } -static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC) +static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs) { zval func_name; zval retval; @@ -771,7 +771,7 @@ static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int when &func_name, &retval, 2, args, - 0, NULL TSRMLS_CC); + 0, NULL); zval_ptr_dtor(&args[0]); zval_ptr_dtor(&args[1]); @@ -805,13 +805,13 @@ static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int when Z_ISUNDEF(us->object)? NULL : &us->object, &func_name, &retval, - 0, NULL, 0, NULL TSRMLS_CC); + 0, NULL, 0, NULL); if (call_result == SUCCESS && Z_TYPE(retval) == IS_LONG) { *newoffs = Z_LVAL(retval); ret = 0; } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_TELL " is not implemented!", us->wrapper->classname); + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_TELL " is not implemented!", us->wrapper->classname); ret = -1; } else { ret = -1; @@ -824,7 +824,7 @@ static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int when /* parse the return value from one of the stat functions and store the * relevant fields into the statbuf provided */ -static int statbuf_from_array(zval *array, php_stream_statbuf *ssb TSRMLS_DC) +static int statbuf_from_array(zval *array, php_stream_statbuf *ssb) { zval *elem; @@ -869,7 +869,7 @@ static int statbuf_from_array(zval *array, php_stream_statbuf *ssb TSRMLS_DC) return SUCCESS; } -static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) +static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb) { zval func_name; zval retval; @@ -883,14 +883,14 @@ static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb TSR Z_ISUNDEF(us->object)? NULL : &us->object, &func_name, &retval, - 0, NULL, 0, NULL TSRMLS_CC); + 0, NULL, 0, NULL); if (call_result == SUCCESS && Z_TYPE(retval) == IS_ARRAY) { - if (SUCCESS == statbuf_from_array(&retval, ssb TSRMLS_CC)) + if (SUCCESS == statbuf_from_array(&retval, ssb)) ret = 0; } else { if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_STAT " is not implemented!", + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_STAT " is not implemented!", us->wrapper->classname); } } @@ -902,7 +902,7 @@ static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb TSR } -static int php_userstreamop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) { +static int php_userstreamop_set_option(php_stream *stream, int option, int value, void *ptrparam) { zval func_name; zval retval; int call_result; @@ -913,12 +913,12 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value switch (option) { case PHP_STREAM_OPTION_CHECK_LIVENESS: ZVAL_STRINGL(&func_name, USERSTREAM_EOF, sizeof(USERSTREAM_EOF)-1); - call_result = call_user_function_ex(NULL, Z_ISUNDEF(us->object)? NULL : &us->object, &func_name, &retval, 0, NULL, 0, NULL TSRMLS_CC); + call_result = call_user_function_ex(NULL, Z_ISUNDEF(us->object)? NULL : &us->object, &func_name, &retval, 0, NULL, 0, NULL); if (call_result == SUCCESS && (Z_TYPE(retval) == IS_FALSE || Z_TYPE(retval) == IS_TRUE)) { ret = zval_is_true(&retval) ? PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK; } else { ret = PHP_STREAM_OPTION_RETURN_ERR; - php_error_docref(NULL TSRMLS_CC, E_WARNING, + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_EOF " is not implemented! Assuming EOF", us->wrapper->classname); } @@ -951,7 +951,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value Z_ISUNDEF(us->object)? NULL : &us->object, &func_name, &retval, - 1, args, 0, NULL TSRMLS_CC); + 1, args, 0, NULL); if (call_result == SUCCESS && (Z_TYPE(retval) == IS_FALSE || Z_TYPE(retval) == IS_TRUE)) { ret = (Z_TYPE(retval) == IS_FALSE); @@ -960,7 +960,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value /* lock support test (TODO: more check) */ ret = PHP_STREAM_OPTION_RETURN_OK; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_LOCK " is not implemented!", + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_LOCK " is not implemented!", us->wrapper->classname); ret = PHP_STREAM_OPTION_RETURN_ERR; } @@ -978,7 +978,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value case PHP_STREAM_TRUNCATE_SUPPORTED: if (zend_is_callable_ex(&func_name, Z_ISUNDEF(us->object)? NULL : Z_OBJ(us->object), - IS_CALLABLE_CHECK_SILENT, NULL, NULL, NULL TSRMLS_CC)) + IS_CALLABLE_CHECK_SILENT, NULL, NULL, NULL)) ret = PHP_STREAM_OPTION_RETURN_OK; else ret = PHP_STREAM_OPTION_RETURN_ERR; @@ -992,18 +992,18 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value Z_ISUNDEF(us->object)? NULL : &us->object, &func_name, &retval, - 1, args, 0, NULL TSRMLS_CC); + 1, args, 0, NULL); if (call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { if (Z_TYPE(retval) == IS_FALSE || Z_TYPE(retval) == IS_TRUE) { ret = (Z_TYPE(retval) == IS_TRUE) ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_TRUNCATE " did not return a boolean!", us->wrapper->classname); } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_TRUNCATE " is not implemented!", us->wrapper->classname); } @@ -1056,13 +1056,13 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value Z_ISUNDEF(us->object)? NULL : &us->object, &func_name, &retval, - 3, args, 0, NULL TSRMLS_CC); + 3, args, 0, NULL); if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_SET_OPTION " is not implemented!", + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_SET_OPTION " is not implemented!", us->wrapper->classname); ret = PHP_STREAM_OPTION_RETURN_ERR; - } else if (Z_TYPE(retval) != IS_UNDEF && zend_is_true(&retval TSRMLS_CC)) { + } else if (Z_TYPE(retval) != IS_UNDEF && zend_is_true(&retval)) { ret = PHP_STREAM_OPTION_RETURN_OK; } else { ret = PHP_STREAM_OPTION_RETURN_ERR; @@ -1082,7 +1082,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value } -static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC) +static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context) { struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; zval zfuncname, zretval; @@ -1092,7 +1092,7 @@ static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int int ret = 0; /* create an instance of our class */ - user_stream_create_object(uwrap, context, &object TSRMLS_CC); + user_stream_create_object(uwrap, context, &object); if (Z_TYPE(object) == IS_UNDEF) { return ret; } @@ -1112,7 +1112,7 @@ static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int if (call_result == SUCCESS && (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE)) { ret = (Z_TYPE(zretval) == IS_TRUE); } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_UNLINK " is not implemented!", uwrap->classname); + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_UNLINK " is not implemented!", uwrap->classname); } /* clean up */ @@ -1126,7 +1126,7 @@ static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int } static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, - int options, php_stream_context *context TSRMLS_DC) + int options, php_stream_context *context) { struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; zval zfuncname, zretval; @@ -1136,7 +1136,7 @@ static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from int ret = 0; /* create an instance of our class */ - user_stream_create_object(uwrap, context, &object TSRMLS_CC); + user_stream_create_object(uwrap, context, &object); if (Z_TYPE(object) == IS_UNDEF) { return ret; } @@ -1157,7 +1157,7 @@ static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from if (call_result == SUCCESS && (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE)) { ret = (Z_TYPE(zretval) == IS_TRUE); } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_RENAME " is not implemented!", uwrap->classname); + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_RENAME " is not implemented!", uwrap->classname); } /* clean up */ @@ -1172,7 +1172,7 @@ static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from } static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int mode, - int options, php_stream_context *context TSRMLS_DC) + int options, php_stream_context *context) { struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; zval zfuncname, zretval; @@ -1182,7 +1182,7 @@ static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int int ret = 0; /* create an instance of our class */ - user_stream_create_object(uwrap, context, &object TSRMLS_CC); + user_stream_create_object(uwrap, context, &object); if (Z_TYPE(object) == IS_UNDEF) { return ret; } @@ -1204,7 +1204,7 @@ static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int if (call_result == SUCCESS && (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE)) { ret = (Z_TYPE(zretval) == IS_TRUE); } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_MKDIR " is not implemented!", uwrap->classname); + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_MKDIR " is not implemented!", uwrap->classname); } /* clean up */ @@ -1220,7 +1220,7 @@ static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int } static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, - int options, php_stream_context *context TSRMLS_DC) + int options, php_stream_context *context) { struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; zval zfuncname, zretval; @@ -1230,7 +1230,7 @@ static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int ret = 0; /* create an instance of our class */ - user_stream_create_object(uwrap, context, &object TSRMLS_CC); + user_stream_create_object(uwrap, context, &object); if (Z_TYPE(object) == IS_UNDEF) { return ret; } @@ -1251,7 +1251,7 @@ static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, if (call_result == SUCCESS && (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE)) { ret = (Z_TYPE(zretval) == IS_TRUE); } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_RMDIR " is not implemented!", uwrap->classname); + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_RMDIR " is not implemented!", uwrap->classname); } /* clean up */ @@ -1266,7 +1266,7 @@ static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, } static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, int option, - void *value, php_stream_context *context TSRMLS_DC) + void *value, php_stream_context *context) { struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; zval zfuncname, zretval; @@ -1294,13 +1294,13 @@ static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, i ZVAL_STRING(&args[2], value); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option %d for " USERSTREAM_METADATA, option); + php_error_docref(NULL, E_WARNING, "Unknown option %d for " USERSTREAM_METADATA, option); zval_ptr_dtor(&args[2]); return ret; } /* create an instance of our class */ - user_stream_create_object(uwrap, context, &object TSRMLS_CC); + user_stream_create_object(uwrap, context, &object); if (Z_TYPE(object) == IS_UNDEF) { zval_ptr_dtor(&args[2]); return ret; @@ -1322,7 +1322,7 @@ static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, i if (call_result == SUCCESS && (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE)) { ret = Z_TYPE(zretval) == IS_TRUE; } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_METADATA " is not implemented!", uwrap->classname); + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_METADATA " is not implemented!", uwrap->classname); } /* clean up */ @@ -1339,7 +1339,7 @@ static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, i static int user_wrapper_stat_url(php_stream_wrapper *wrapper, const char *url, int flags, - php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) + php_stream_statbuf *ssb, php_stream_context *context) { struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; zval zfuncname, zretval; @@ -1349,7 +1349,7 @@ static int user_wrapper_stat_url(php_stream_wrapper *wrapper, const char *url, i int ret = -1; /* create an instance of our class */ - user_stream_create_object(uwrap, context, &object TSRMLS_CC); + user_stream_create_object(uwrap, context, &object); if (Z_TYPE(object) == IS_UNDEF) { return ret; } @@ -1369,11 +1369,11 @@ static int user_wrapper_stat_url(php_stream_wrapper *wrapper, const char *url, i if (call_result == SUCCESS && Z_TYPE(zretval) == IS_ARRAY) { /* We got the info we needed */ - if (SUCCESS == statbuf_from_array(&zretval, ssb TSRMLS_CC)) + if (SUCCESS == statbuf_from_array(&zretval, ssb)) ret = 0; } else { if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_STATURL " is not implemented!", + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_STATURL " is not implemented!", uwrap->classname); } } @@ -1390,7 +1390,7 @@ static int user_wrapper_stat_url(php_stream_wrapper *wrapper, const char *url, i } -static size_t php_userstreamop_readdir(php_stream *stream, char *buf, size_t count TSRMLS_DC) +static size_t php_userstreamop_readdir(php_stream *stream, char *buf, size_t count) { zval func_name; zval retval; @@ -1410,7 +1410,7 @@ static size_t php_userstreamop_readdir(php_stream *stream, char *buf, size_t cou &func_name, &retval, 0, NULL, - 0, NULL TSRMLS_CC); + 0, NULL); if (call_result == SUCCESS && Z_TYPE(retval) != IS_FALSE && Z_TYPE(retval) != IS_TRUE) { convert_to_string(&retval); @@ -1418,7 +1418,7 @@ static size_t php_userstreamop_readdir(php_stream *stream, char *buf, size_t cou didread = sizeof(php_stream_dirent); } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_DIR_READ " is not implemented!", + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_DIR_READ " is not implemented!", us->wrapper->classname); } @@ -1428,7 +1428,7 @@ static size_t php_userstreamop_readdir(php_stream *stream, char *buf, size_t cou return didread; } -static int php_userstreamop_closedir(php_stream *stream, int close_handle TSRMLS_DC) +static int php_userstreamop_closedir(php_stream *stream, int close_handle) { zval func_name; zval retval; @@ -1442,7 +1442,7 @@ static int php_userstreamop_closedir(php_stream *stream, int close_handle TSRMLS Z_ISUNDEF(us->object)? NULL : &us->object, &func_name, &retval, - 0, NULL, 0, NULL TSRMLS_CC); + 0, NULL, 0, NULL); zval_ptr_dtor(&retval); zval_ptr_dtor(&func_name); @@ -1454,7 +1454,7 @@ static int php_userstreamop_closedir(php_stream *stream, int close_handle TSRMLS return 0; } -static int php_userstreamop_rewinddir(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC) +static int php_userstreamop_rewinddir(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs) { zval func_name; zval retval; @@ -1466,7 +1466,7 @@ static int php_userstreamop_rewinddir(php_stream *stream, zend_off_t offset, int Z_ISUNDEF(us->object)? NULL : &us->object, &func_name, &retval, - 0, NULL, 0, NULL TSRMLS_CC); + 0, NULL, 0, NULL); zval_ptr_dtor(&retval); zval_ptr_dtor(&func_name); @@ -1475,7 +1475,7 @@ static int php_userstreamop_rewinddir(php_stream *stream, zend_off_t offset, int } -static int php_userstreamop_cast(php_stream *stream, int castas, void **retptr TSRMLS_DC) +static int php_userstreamop_cast(php_stream *stream, int castas, void **retptr) { php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; zval func_name; @@ -1500,25 +1500,25 @@ static int php_userstreamop_cast(php_stream *stream, int castas, void **retptr T Z_ISUNDEF(us->object)? NULL : &us->object, &func_name, &retval, - 1, args, 0, NULL TSRMLS_CC); + 1, args, 0, NULL); do { if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_CAST " is not implemented!", + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_CAST " is not implemented!", us->wrapper->classname); break; } - if (Z_ISUNDEF(retval) || !zend_is_true(&retval TSRMLS_CC)) { + if (Z_ISUNDEF(retval) || !zend_is_true(&retval)) { break; } php_stream_from_zval_no_verify(intstream, &retval); if (!intstream) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_CAST " must return a stream resource", + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_CAST " must return a stream resource", us->wrapper->classname); break; } if (intstream == stream) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_CAST " must not return itself", + php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_CAST " must not return itself", us->wrapper->classname); intstream = NULL; break; diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c index 7427a794b4..983f403c9d 100644 --- a/main/streams/xp_socket.c +++ b/main/streams/xp_socket.c @@ -55,10 +55,10 @@ php_stream_ops php_stream_unixdg_socket_ops; #endif -static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC); +static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam); /* {{{ Generic socket stream operations */ -static size_t php_sockop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) +static size_t php_sockop_write(php_stream *stream, const char *buf, size_t count) { php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; int didwrite; @@ -102,7 +102,7 @@ retry: } while (err == EINTR); } estr = php_socket_strerror(err, NULL, 0); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "send of " ZEND_LONG_FMT " bytes failed with errno=%ld %s", + php_error_docref(NULL, E_NOTICE, "send of " ZEND_LONG_FMT " bytes failed with errno=%ld %s", (zend_long)count, err, estr); efree(estr); } @@ -118,7 +118,7 @@ retry: return didwrite; } -static void php_sock_stream_wait_for_data(php_stream *stream, php_netstream_data_t *sock TSRMLS_DC) +static void php_sock_stream_wait_for_data(php_stream *stream, php_netstream_data_t *sock) { int retval; struct timeval *ptimeout; @@ -148,7 +148,7 @@ static void php_sock_stream_wait_for_data(php_stream *stream, php_netstream_data } } -static size_t php_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) +static size_t php_sockop_read(php_stream *stream, char *buf, size_t count) { php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; ssize_t nr_bytes = 0; @@ -158,7 +158,7 @@ static size_t php_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS } if (sock->is_blocked) { - php_sock_stream_wait_for_data(stream, sock TSRMLS_CC); + php_sock_stream_wait_for_data(stream, sock); if (sock->timeout_event) return 0; } @@ -179,7 +179,7 @@ static size_t php_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS } -static int php_sockop_close(php_stream *stream, int close_handle TSRMLS_DC) +static int php_sockop_close(php_stream *stream, int close_handle) { php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; #ifdef PHP_WIN32 @@ -222,7 +222,7 @@ static int php_sockop_close(php_stream *stream, int close_handle TSRMLS_DC) return 0; } -static int php_sockop_flush(php_stream *stream TSRMLS_DC) +static int php_sockop_flush(php_stream *stream) { #if 0 php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; @@ -231,7 +231,7 @@ static int php_sockop_flush(php_stream *stream TSRMLS_DC) return 0; } -static int php_sockop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) +static int php_sockop_stat(php_stream *stream, php_stream_statbuf *ssb) { #if ZEND_WIN32 return 0; @@ -273,7 +273,7 @@ static inline int sock_recvfrom(php_netstream_data_t *sock, char *buf, size_t bu ret = recvfrom(sock->socket, buf, XP_SOCK_BUF_SIZE(buflen), flags, (struct sockaddr*)&sa, &sl); ret = (ret == SOCK_CONN_ERR) ? -1 : ret; php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl, - textaddr, addr, addrlen TSRMLS_CC); + textaddr, addr, addrlen); } else { ret = recv(sock->socket, buf, XP_SOCK_BUF_SIZE(buflen), flags); ret = (ret == SOCK_CONN_ERR) ? -1 : ret; @@ -282,7 +282,7 @@ static inline int sock_recvfrom(php_netstream_data_t *sock, char *buf, size_t bu return ret; } -static int php_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) +static int php_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam) { int oldmode, flags; php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; @@ -323,7 +323,7 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void case PHP_STREAM_OPTION_BLOCKING: oldmode = sock->is_blocked; - if (SUCCESS == php_set_sock_blocking(sock->socket, value TSRMLS_CC)) { + if (SUCCESS == php_set_sock_blocking(sock->socket, value)) { sock->is_blocked = value; return oldmode; } @@ -373,10 +373,10 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void xparam->inputs.buf, xparam->inputs.buflen, flags, xparam->inputs.addr, - xparam->inputs.addrlen TSRMLS_CC); + xparam->inputs.addrlen); if (xparam->outputs.returncode == -1) { char *err = php_socket_strerror(php_socket_errno(), NULL, 0); - php_error_docref(NULL TSRMLS_CC, E_WARNING, + php_error_docref(NULL, E_WARNING, "%s\n", err); efree(err); } @@ -427,7 +427,7 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void } } -static int php_sockop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) +static int php_sockop_cast(php_stream *stream, int castas, void **ret) { php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; @@ -518,7 +518,7 @@ php_stream_ops php_stream_unixdg_socket_ops = { /* network socket operations */ #ifdef AF_UNIX -static inline int parse_unix_address(php_stream_xport_param *xparam, struct sockaddr_un *unix_addr TSRMLS_DC) +static inline int parse_unix_address(php_stream_xport_param *xparam, struct sockaddr_un *unix_addr) { memset(unix_addr, 0, sizeof(*unix_addr)); unix_addr->sun_family = AF_UNIX; @@ -532,7 +532,7 @@ static inline int parse_unix_address(php_stream_xport_param *xparam, struct sock * BUT, to get into this branch of code, the name is too long, * so we don't care. */ xparam->inputs.namelen = sizeof(unix_addr->sun_path) - 1; - php_error_docref(NULL TSRMLS_CC, E_NOTICE, + php_error_docref(NULL, E_NOTICE, "socket path exceeded the maximum allowed length of %lu bytes " "and was truncated", (unsigned long)sizeof(unix_addr->sun_path)); } @@ -543,7 +543,7 @@ static inline int parse_unix_address(php_stream_xport_param *xparam, struct sock } #endif -static inline char *parse_ip_address_ex(const char *str, size_t str_len, int *portno, int get_err, zend_string **err TSRMLS_DC) +static inline char *parse_ip_address_ex(const char *str, size_t str_len, int *portno, int get_err, zend_string **err) { char *colon; char *host = NULL; @@ -582,13 +582,13 @@ static inline char *parse_ip_address_ex(const char *str, size_t str_len, int *po return host; } -static inline char *parse_ip_address(php_stream_xport_param *xparam, int *portno TSRMLS_DC) +static inline char *parse_ip_address(php_stream_xport_param *xparam, int *portno) { - return parse_ip_address_ex(xparam->inputs.name, xparam->inputs.namelen, portno, xparam->want_errortext, &xparam->outputs.error_text TSRMLS_CC); + return parse_ip_address_ex(xparam->inputs.name, xparam->inputs.namelen, portno, xparam->want_errortext, &xparam->outputs.error_text); } static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *sock, - php_stream_xport_param *xparam TSRMLS_DC) + php_stream_xport_param *xparam) { char *host = NULL; int portno, err; @@ -610,14 +610,14 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t * return -1; } - parse_unix_address(xparam, &unix_addr TSRMLS_CC); + parse_unix_address(xparam, &unix_addr); return bind(sock->socket, (const struct sockaddr *)&unix_addr, (socklen_t) XtOffsetOf(struct sockaddr_un, sun_path) + xparam->inputs.namelen); } #endif - host = parse_ip_address(xparam, &portno TSRMLS_CC); + host = parse_ip_address(xparam, &portno); if (host == NULL) { return -1; @@ -626,7 +626,7 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t * #ifdef SO_REUSEPORT if (PHP_STREAM_CONTEXT(stream) && (tmpzval = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "socket", "so_reuseport")) != NULL - && zend_is_true(tmpzval TSRMLS_CC) + && zend_is_true(tmpzval) ) { sockopts |= STREAM_SOCKOP_SO_REUSEPORT; } @@ -636,7 +636,7 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t * if (stream->ops == &php_stream_udp_socket_ops /* SO_BROADCAST is only applicable for UDP */ && PHP_STREAM_CONTEXT(stream) && (tmpzval = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "socket", "so_broadcast")) != NULL - && zend_is_true(tmpzval TSRMLS_CC) + && zend_is_true(tmpzval) ) { sockopts |= STREAM_SOCKOP_SO_BROADCAST; } @@ -657,7 +657,7 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t * } static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_t *sock, - php_stream_xport_param *xparam TSRMLS_DC) + php_stream_xport_param *xparam) { char *host = NULL, *bindto = NULL; int portno, bindport = 0; @@ -679,7 +679,7 @@ static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_ return -1; } - parse_unix_address(xparam, &unix_addr TSRMLS_CC); + parse_unix_address(xparam, &unix_addr); ret = php_network_connect_socket(sock->socket, (const struct sockaddr *)&unix_addr, (socklen_t) XtOffsetOf(struct sockaddr_un, sun_path) + xparam->inputs.namelen, @@ -693,7 +693,7 @@ static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_ } #endif - host = parse_ip_address(xparam, &portno TSRMLS_CC); + host = parse_ip_address(xparam, &portno); if (host == NULL) { return -1; @@ -707,14 +707,14 @@ static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_ efree(host); return -1; } - bindto = parse_ip_address_ex(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), &bindport, xparam->want_errortext, &xparam->outputs.error_text TSRMLS_CC); + bindto = parse_ip_address_ex(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), &bindport, xparam->want_errortext, &xparam->outputs.error_text); } #ifdef SO_BROADCAST if (stream->ops == &php_stream_udp_socket_ops /* SO_BROADCAST is only applicable for UDP */ && PHP_STREAM_CONTEXT(stream) && (tmpzval = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "socket", "so_broadcast")) != NULL - && zend_is_true(tmpzval TSRMLS_CC) + && zend_is_true(tmpzval) ) { sockopts |= STREAM_SOCKOP_SO_BROADCAST; } @@ -758,7 +758,7 @@ out: } static inline int php_tcp_sockop_accept(php_stream *stream, php_netstream_data_t *sock, - php_stream_xport_param *xparam STREAMS_DC TSRMLS_DC) + php_stream_xport_param *xparam STREAMS_DC) { int clisock; @@ -798,7 +798,7 @@ static inline int php_tcp_sockop_accept(php_stream *stream, php_netstream_data_t return xparam->outputs.client == NULL ? -1 : 0; } -static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) +static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam) { php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; php_stream_xport_param *xparam; @@ -810,23 +810,23 @@ static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, switch(xparam->op) { case STREAM_XPORT_OP_CONNECT: case STREAM_XPORT_OP_CONNECT_ASYNC: - xparam->outputs.returncode = php_tcp_sockop_connect(stream, sock, xparam TSRMLS_CC); + xparam->outputs.returncode = php_tcp_sockop_connect(stream, sock, xparam); return PHP_STREAM_OPTION_RETURN_OK; case STREAM_XPORT_OP_BIND: - xparam->outputs.returncode = php_tcp_sockop_bind(stream, sock, xparam TSRMLS_CC); + xparam->outputs.returncode = php_tcp_sockop_bind(stream, sock, xparam); return PHP_STREAM_OPTION_RETURN_OK; case STREAM_XPORT_OP_ACCEPT: - xparam->outputs.returncode = php_tcp_sockop_accept(stream, sock, xparam STREAMS_CC TSRMLS_CC); + xparam->outputs.returncode = php_tcp_sockop_accept(stream, sock, xparam STREAMS_CC); return PHP_STREAM_OPTION_RETURN_OK; default: /* fall through */ ; } } - return php_sockop_set_option(stream, option, value, ptrparam TSRMLS_CC); + return php_sockop_set_option(stream, option, value, ptrparam); } @@ -834,7 +834,7 @@ PHPAPI php_stream *php_stream_generic_socket_factory(const char *proto, size_t p const char *resourcename, size_t resourcenamelen, const char *persistent_id, int options, int flags, struct timeval *timeout, - php_stream_context *context STREAMS_DC TSRMLS_DC) + php_stream_context *context STREAMS_DC) { php_stream *stream = NULL; php_netstream_data_t *sock; |