summaryrefslogtreecommitdiff
path: root/ext/standard/dir.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-12-13 23:06:14 +0100
committerAnatol Belski <ab@php.net>2014-12-13 23:06:14 +0100
commitbdeb220f48825642f84cdbf3ff23a30613c92e86 (patch)
tree1a6cf34d20420e4815b4becb21311a4457d84103 /ext/standard/dir.c
parentbb66f385d09e7e55390e9f57fcbca08f6b43ff91 (diff)
downloadphp-git-bdeb220f48825642f84cdbf3ff23a30613c92e86.tar.gz
first shot remove TSRMLS_* things
Diffstat (limited to 'ext/standard/dir.c')
-rw-r--r--ext/standard/dir.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index b13f47be69..ec4e7045d7 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -75,14 +75,14 @@ static int le_dirp;
static zend_class_entry *dir_class_entry_ptr;
#define FETCH_DIRP() \
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &id) == FAILURE) { \
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &id) == FAILURE) { \
return; \
} \
if (ZEND_NUM_ARGS() == 0) { \
myself = getThis(); \
if (myself) { \
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(myself), "handle", sizeof("handle")-1)) == NULL) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find my handle property"); \
+ php_error_docref(NULL, E_WARNING, "Unable to find my handle property"); \
RETURN_FALSE; \
} \
ZEND_FETCH_RESOURCE(dirp, php_stream *, tmp, -1, "Directory", php_file_le_stream()); \
@@ -90,7 +90,7 @@ static zend_class_entry *dir_class_entry_ptr;
ZEND_FETCH_RESOURCE(dirp, php_stream *, 0, (int)DIRG(default_dir)->handle, "Directory", php_file_le_stream()); \
} \
} else { \
- dirp = (php_stream *) zend_fetch_resource(id TSRMLS_CC, -1, "Directory", NULL, 1, php_file_le_stream()); \
+ dirp = (php_stream *) zend_fetch_resource(id, -1, "Directory", NULL, 1, php_file_le_stream()); \
if (!dirp) \
RETURN_FALSE; \
}
@@ -109,7 +109,7 @@ static const zend_function_entry php_dir_class_functions[] = {
};
-static void php_set_default_dir(zend_resource *res TSRMLS_DC)
+static void php_set_default_dir(zend_resource *res)
{
if (DIRG(default_dir)) {
zend_list_delete(DIRG(default_dir));
@@ -134,7 +134,7 @@ PHP_MINIT_FUNCTION(dir)
zend_class_entry dir_class_entry;
INIT_CLASS_ENTRY(dir_class_entry, "Directory", php_dir_class_functions);
- dir_class_entry_ptr = zend_register_internal_class(&dir_class_entry TSRMLS_CC);
+ dir_class_entry_ptr = zend_register_internal_class(&dir_class_entry);
#ifdef ZTS
ts_allocate_id(&dir_globals_id, sizeof(php_dir_globals), NULL, NULL);
@@ -219,7 +219,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject)
php_stream_context *context = NULL;
php_stream *dirp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &dirname, &dir_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &dirname, &dir_len, &zcontext) == FAILURE) {
RETURN_NULL();
}
@@ -233,7 +233,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject)
dirp->flags |= PHP_STREAM_FLAG_NO_FCLOSE;
- php_set_default_dir(dirp->res TSRMLS_CC);
+ php_set_default_dir(dirp->res);
if (createobject) {
object_init_ex(return_value, dir_class_entry_ptr);
@@ -273,7 +273,7 @@ PHP_FUNCTION(closedir)
FETCH_DIRP();
if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
+ php_error_docref(NULL, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
RETURN_FALSE;
}
@@ -281,7 +281,7 @@ PHP_FUNCTION(closedir)
zend_list_close(dirp->res);
if (res == DIRG(default_dir)) {
- php_set_default_dir(NULL TSRMLS_CC);
+ php_set_default_dir(NULL);
}
}
/* }}} */
@@ -295,22 +295,22 @@ PHP_FUNCTION(chroot)
int ret;
size_t str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
RETURN_FALSE;
}
ret = chroot(str);
if (ret != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "%s (errno %d)", strerror(errno), errno);
RETURN_FALSE;
}
- php_clear_stat_cache(1, NULL, 0 TSRMLS_CC);
+ php_clear_stat_cache(1, NULL, 0);
ret = chdir("/");
if (ret != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "%s (errno %d)", strerror(errno), errno);
RETURN_FALSE;
}
@@ -327,17 +327,17 @@ PHP_FUNCTION(chdir)
int ret;
size_t str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &str, &str_len) == FAILURE) {
RETURN_FALSE;
}
- if (php_check_open_basedir(str TSRMLS_CC)) {
+ if (php_check_open_basedir(str)) {
RETURN_FALSE;
}
ret = VCWD_CHDIR(str);
if (ret != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "%s (errno %d)", strerror(errno), errno);
RETURN_FALSE;
}
@@ -389,7 +389,7 @@ PHP_FUNCTION(rewinddir)
FETCH_DIRP();
if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
+ php_error_docref(NULL, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
RETURN_FALSE;
}
@@ -408,7 +408,7 @@ PHP_NAMED_FUNCTION(php_if_readdir)
FETCH_DIRP();
if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
+ php_error_docref(NULL, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
RETURN_FALSE;
}
@@ -438,17 +438,17 @@ PHP_FUNCTION(glob)
int ret;
zend_bool basedir_limit = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &pattern, &pattern_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|l", &pattern, &pattern_len, &flags) == FAILURE) {
return;
}
if (pattern_len >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN);
+ php_error_docref(NULL, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN);
RETURN_FALSE;
}
if ((GLOB_AVAILABLE_FLAGS & flags) != flags) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "At least one of the passed flags is invalid or not supported on this platform");
+ php_error_docref(NULL, E_WARNING, "At least one of the passed flags is invalid or not supported on this platform");
RETURN_FALSE;
}
@@ -500,7 +500,7 @@ no_results:
query is senseless on windows. For instance while *.txt
is a pretty valid filename on EXT3, it's invalid on NTFS. */
if (PG(open_basedir) && *PG(open_basedir)) {
- if (php_check_open_basedir_ex(pattern, 0 TSRMLS_CC)) {
+ if (php_check_open_basedir_ex(pattern, 0)) {
RETURN_FALSE;
}
}
@@ -512,7 +512,7 @@ no_results:
array_init(return_value);
for (n = 0; n < globbuf.gl_pathc; n++) {
if (PG(open_basedir) && *PG(open_basedir)) {
- if (php_check_open_basedir_ex(globbuf.gl_pathv[n], 0 TSRMLS_CC)) {
+ if (php_check_open_basedir_ex(globbuf.gl_pathv[n], 0)) {
basedir_limit = 1;
continue;
}
@@ -561,12 +561,12 @@ PHP_FUNCTION(scandir)
zval *zcontext = NULL;
php_stream_context *context = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lr", &dirn, &dirn_len, &flags, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|lr", &dirn, &dirn_len, &flags, &zcontext) == FAILURE) {
return;
}
if (dirn_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Directory name cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Directory name cannot be empty");
RETURN_FALSE;
}
@@ -582,7 +582,7 @@ PHP_FUNCTION(scandir)
n = php_stream_scandir(dirn, &namelist, context, (void *) php_stream_dirent_alphasortr);
}
if (n < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "(errno %d): %s", errno, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "(errno %d): %s", errno, strerror(errno));
RETURN_FALSE;
}