summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/fopen_wrappers.c2
-rw-r--r--main/main.c32
-rw-r--r--main/output.c6
-rw-r--r--main/php_ini.c20
-rw-r--r--main/php_variables.c18
-rw-r--r--main/rfc1867.c4
6 files changed, 41 insertions, 41 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 4182d80c33..853a7fb558 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -360,7 +360,7 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC)
file_handle->filename = SG(request_info).path_translated;
file_handle->free_filename = 0;
file_handle->handle.fp = fp;
- file_handle->type = ZEND_HANDLE_FP;
+ Z_TYPE_P(file_handle) = ZEND_HANDLE_FP;
return SUCCESS;
}
diff --git a/main/main.c b/main/main.c
index 3c1f16d480..6b01a62c28 100644
--- a/main/main.c
+++ b/main/main.c
@@ -483,9 +483,9 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
ALLOC_ZVAL(tmp);
INIT_PZVAL(tmp);
- tmp->value.str.val = (char *) estrndup(buffer, buffer_len);
- tmp->value.str.len = buffer_len;
- tmp->type = IS_STRING;
+ Z_STRVAL_P(tmp) = (char *) estrndup(buffer, buffer_len);
+ Z_STRLEN_P(tmp) = buffer_len;
+ Z_TYPE_P(tmp) = IS_STRING;
zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) & tmp, sizeof(pval *), NULL);
}
}
@@ -1206,14 +1206,14 @@ static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC)
}
/* auto-type */
ALLOC_ZVAL(tmp);
- tmp->type = IS_STRING;
- tmp->value.str.len = strlen(ss);
- tmp->value.str.val = estrndup(ss, tmp->value.str.len);
+ Z_TYPE_P(tmp) = IS_STRING;
+ Z_STRLEN_P(tmp) = strlen(ss);
+ Z_STRVAL_P(tmp) = estrndup(ss, Z_STRLEN_P(tmp));
INIT_PZVAL(tmp);
count++;
- if (zend_hash_next_index_insert(arr->value.ht, &tmp, sizeof(pval *), NULL)==FAILURE) {
- if (tmp->type == IS_STRING) {
- efree(tmp->value.str.val);
+ if (zend_hash_next_index_insert(Z_ARRVAL_P(arr), &tmp, sizeof(pval *), NULL)==FAILURE) {
+ if (Z_TYPE_P(tmp) == IS_STRING) {
+ efree(Z_STRVAL_P(tmp));
}
}
if (space) {
@@ -1227,8 +1227,8 @@ static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC)
/* prepare argc */
ALLOC_ZVAL(argc);
- argc->value.lval = count;
- argc->type = IS_LONG;
+ Z_LVAL_P(argc) = count;
+ Z_TYPE_P(argc) = IS_LONG;
INIT_PZVAL(argc);
if (PG(register_globals)) {
@@ -1238,8 +1238,8 @@ static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC)
zend_hash_add(&EG(symbol_table), "argc", sizeof("argc"), &argc, sizeof(zval *), NULL);
}
- zend_hash_update(track_vars_array->value.ht, "argv", sizeof("argv"), &arr, sizeof(pval *), NULL);
- zend_hash_update(track_vars_array->value.ht, "argc", sizeof("argc"), &argc, sizeof(pval *), NULL);
+ zend_hash_update(Z_ARRVAL_P(track_vars_array), "argv", sizeof("argv"), &arr, sizeof(pval *), NULL);
+ zend_hash_update(Z_ARRVAL_P(track_vars_array), "argc", sizeof("argc"), &argc, sizeof(pval *), NULL);
}
/* }}} */
@@ -1283,7 +1283,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
PG(during_request_startup) = 0;
- if (primary_file->type == ZEND_HANDLE_FILENAME
+ if (Z_TYPE_P(primary_file) == ZEND_HANDLE_FILENAME
&& primary_file->filename) {
VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1);
VCWD_CHDIR_FILE(primary_file->filename);
@@ -1293,7 +1293,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
prepend_file.filename = PG(auto_prepend_file);
prepend_file.opened_path = NULL;
prepend_file.free_filename = 0;
- prepend_file.type = ZEND_HANDLE_FILENAME;
+ Z_TYPE(prepend_file) = ZEND_HANDLE_FILENAME;
prepend_file_p = &prepend_file;
} else {
prepend_file_p = NULL;
@@ -1302,7 +1302,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
append_file.filename = PG(auto_append_file);
append_file.opened_path = NULL;
append_file.free_filename = 0;
- append_file.type = ZEND_HANDLE_FILENAME;
+ Z_TYPE(append_file) = ZEND_HANDLE_FILENAME;
append_file_p = &append_file;
} else {
append_file_p = NULL;
diff --git a/main/output.c b/main/output.c
index edbb29612d..f03f15af23 100644
--- a/main/output.c
+++ b/main/output.c
@@ -174,8 +174,8 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS
OG(ob_lock) = 1;
if (call_user_function_ex(CG(function_table), NULL, OG(active_ob_buffer).output_handler, &alternate_buffer, 2, params, 1, NULL TSRMLS_CC)==SUCCESS) {
convert_to_string_ex(&alternate_buffer);
- final_buffer = alternate_buffer->value.str.val;
- final_buffer_length = alternate_buffer->value.str.len;
+ final_buffer = Z_STRVAL_P(alternate_buffer);
+ final_buffer_length = Z_STRLEN_P(alternate_buffer);
}
OG(ob_lock) = 0;
zval_ptr_dtor(&OG(active_ob_buffer).output_handler);
@@ -585,7 +585,7 @@ PHP_FUNCTION(ob_implicit_flush)
RETURN_FALSE;
}
convert_to_long_ex(zv_flag);
- flag = (*zv_flag)->value.lval;
+ flag = Z_LVAL_PP(zv_flag);
break;
default:
WRONG_PARAM_COUNT;
diff --git a/main/php_ini.c b/main/php_ini.c
index 782d44f7c7..b1d40daf52 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -135,8 +135,8 @@ PHPAPI void display_ini_entries(zend_module_entry *module)
*/
static void pvalue_config_destructor(zval *pvalue)
{
- if (pvalue->type == IS_STRING && pvalue->value.str.val != empty_string) {
- free(pvalue->value.str.val);
+ if (Z_TYPE_P(pvalue) == IS_STRING && Z_STRVAL_P(pvalue) != empty_string) {
+ free(Z_STRVAL_P(pvalue));
}
}
/* }}} */
@@ -262,7 +262,7 @@ int php_init_config(char *php_ini_path_override)
if (!fh.handle.fp) {
return SUCCESS; /* having no configuration file is ok */
}
- fh.type = ZEND_HANDLE_FP;
+ Z_TYPE(fh) = ZEND_HANDLE_FP;
fh.filename = php_ini_opened_path;
zend_parse_ini_file(&fh, 1, php_config_ini_parser_cb, &extension_lists);
@@ -270,12 +270,12 @@ int php_init_config(char *php_ini_path_override)
if (php_ini_opened_path) {
zval tmp;
- tmp.value.str.len = strlen(php_ini_opened_path);
- tmp.value.str.val = zend_strndup(php_ini_opened_path, tmp.value.str.len);
- tmp.type = IS_STRING;
+ Z_STRLEN(tmp) = strlen(php_ini_opened_path);
+ Z_STRVAL(tmp) = zend_strndup(php_ini_opened_path, Z_STRLEN(tmp));
+ Z_TYPE(tmp) = IS_STRING;
zend_hash_update(&configuration_hash, "cfg_file_path", sizeof("cfg_file_path"), (void *) &tmp, sizeof(zval), NULL);
efree(php_ini_opened_path);
- php_ini_opened_path = zend_strndup(tmp.value.str.val, tmp.value.str.len);
+ php_ini_opened_path = zend_strndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
}
return SUCCESS;
@@ -333,7 +333,7 @@ PHPAPI int cfg_get_long(char *varname, long *result)
var = *tmp;
zval_copy_ctor(&var);
convert_to_long(&var);
- *result = var.value.lval;
+ *result = Z_LVAL(var);
return SUCCESS;
}
/* }}} */
@@ -351,7 +351,7 @@ PHPAPI int cfg_get_double(char *varname, double *result)
var = *tmp;
zval_copy_ctor(&var);
convert_to_double(&var);
- *result = var.value.dval;
+ *result = Z_DVAL(var);
return SUCCESS;
}
/* }}} */
@@ -366,7 +366,7 @@ PHPAPI int cfg_get_string(char *varname, char **result)
*result=NULL;
return FAILURE;
}
- *result = tmp->value.str.val;
+ *result = Z_STRVAL_P(tmp);
return SUCCESS;
}
/* }}} */
diff --git a/main/php_variables.c b/main/php_variables.c
index 4d9bd6467a..29db3d351a 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -40,13 +40,13 @@ PHPAPI void php_register_variable_safe(char *var, char *strval, int str_len, zva
zval new_entry;
/* Prepare value */
- new_entry.value.str.len = str_len;
+ Z_STRLEN(new_entry) = str_len;
if (PG(magic_quotes_gpc)) {
- new_entry.value.str.val = php_addslashes(strval, new_entry.value.str.len, &new_entry.value.str.len, 0 TSRMLS_CC);
+ Z_STRVAL(new_entry) = php_addslashes(strval, Z_STRLEN(new_entry), &Z_STRLEN(new_entry), 0 TSRMLS_CC);
} else {
- new_entry.value.str.val = estrndup(strval, new_entry.value.str.len);
+ Z_STRVAL(new_entry) = estrndup(strval, Z_STRLEN(new_entry));
}
- new_entry.type = IS_STRING;
+ Z_TYPE(new_entry) = IS_STRING;
php_register_variable_ex(var, &new_entry, track_vars_array TSRMLS_CC);
}
@@ -69,9 +69,9 @@ PHPAPI void php_register_variable_ex(char *var, zval *val, pval *track_vars_arra
}
if (track_vars_array) {
if (symtable1) {
- symtable2 = track_vars_array->value.ht;
+ symtable2 = Z_ARRVAL_P(track_vars_array);
} else {
- symtable1 = track_vars_array->value.ht;
+ symtable1 = Z_ARRVAL_P(track_vars_array);
}
}
if (!symtable1) {
@@ -129,7 +129,7 @@ PHPAPI void php_register_variable_ex(char *var, zval *val, pval *track_vars_arra
escaped_index = index;
}
if (zend_hash_find(symtable1, escaped_index, index_len+1, (void **) &gpc_element_p)==FAILURE
- || (*gpc_element_p)->type != IS_ARRAY) {
+ || Z_TYPE_PP(gpc_element_p) != IS_ARRAY) {
MAKE_STD_ZVAL(gpc_element);
array_init(gpc_element);
zend_hash_update(symtable1, escaped_index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
@@ -141,7 +141,7 @@ PHPAPI void php_register_variable_ex(char *var, zval *val, pval *track_vars_arra
if (!top_gpc_p) {
top_gpc_p = gpc_element_p;
}
- symtable1 = (*gpc_element_p)->value.ht;
+ symtable1 = Z_ARRVAL_PP(gpc_element_p);
/* ip pointed to the '[' character, now obtain the key */
index = ++ip;
index_len = 0;
@@ -169,7 +169,7 @@ PHPAPI void php_register_variable_ex(char *var, zval *val, pval *track_vars_arra
} else {
MAKE_STD_ZVAL(gpc_element);
gpc_element->value = val->value;
- gpc_element->type = val->type;
+ Z_TYPE_P(gpc_element) = Z_TYPE_P(val);
if (!index) {
zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
} else {
diff --git a/main/rfc1867.c b/main/rfc1867.c
index 802ded822a..abba25c221 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -446,8 +446,8 @@ static void php_mime_split(char *buf, int cnt, char *boundary, int len, zval *ar
{
zval file_size;
- file_size.value.lval = bytes;
- file_size.type = IS_LONG;
+ Z_LVAL(file_size) = bytes;
+ Z_TYPE(file_size) = IS_LONG;
/* Add $foo_size */
if(is_arr_upload) {