summaryrefslogtreecommitdiff
path: root/ext/standard/var.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-06-30 04:05:24 +0300
committerDmitry Stogov <dmitry@zend.com>2015-06-30 04:05:24 +0300
commit4a2e40bb861bc3cf5fb6863e57486ed60316e97c (patch)
tree6579660b282fdd1bc50095e48d702913a0b6aa97 /ext/standard/var.c
parent8cce5b2641fb91c3073018b59f6f044b843041a8 (diff)
downloadphp-git-4a2e40bb861bc3cf5fb6863e57486ed60316e97c.tar.gz
Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes).
Diffstat (limited to 'ext/standard/var.c')
-rw-r--r--ext/standard/var.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/ext/standard/var.c b/ext/standard/var.c
index 2870821fad..055110382b 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -60,7 +60,7 @@ static void php_array_element_dump(zval *zv, zend_ulong index, zend_string *key,
php_printf("%*c[" ZEND_LONG_FMT "]=>\n", level + 1, ' ', index);
} else { /* string key */
php_printf("%*c[\"", level + 1, ' ');
- PHPWRITE(key->val, key->len);
+ PHPWRITE(ZSTR_VAL(key), ZSTR_LEN(key));
php_printf("\"]=>\n");
}
php_var_dump(zv, level + 2);
@@ -85,7 +85,7 @@ static void php_object_property_dump(zval *zv, zend_ulong index, zend_string *ke
}
} else {
php_printf("\"");
- PHPWRITE(key->val, key->len);
+ PHPWRITE(ZSTR_VAL(key), ZSTR_LEN(key));
php_printf("\"");
}
ZEND_PUTS("]=>\n");
@@ -164,7 +164,7 @@ again:
myht = Z_OBJDEBUG_P(struc, is_temp);
class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc));
- php_printf("%sobject(%s)#%d (%d) {\n", COMMON, class_name->val, Z_OBJ_HANDLE_P(struc), myht ? zend_obj_num_elements(myht) : 0);
+ php_printf("%sobject(%s)#%d (%d) {\n", COMMON, ZSTR_VAL(class_name), Z_OBJ_HANDLE_P(struc), myht ? zend_obj_num_elements(myht) : 0);
zend_string_release(class_name);
if (myht) {
@@ -230,7 +230,7 @@ static void zval_array_element_dump(zval *zv, zend_ulong index, zend_string *key
php_printf("%*c[" ZEND_LONG_FMT "]=>\n", level + 1, ' ', index);
} else { /* string key */
php_printf("%*c[\"", level + 1, ' ');
- PHPWRITE(key->val, key->len);
+ PHPWRITE(ZSTR_VAL(key), ZSTR_LEN(key));
php_printf("\"]=>\n");
}
php_debug_zval_dump(zv, level + 2);
@@ -332,7 +332,7 @@ again:
}
}
class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc));
- php_printf("%sobject(%s)#%d (%d) refcount(%u){\n", COMMON, class_name->val, Z_OBJ_HANDLE_P(struc), myht ? zend_obj_num_elements(myht) : 0, Z_REFCOUNT_P(struc));
+ php_printf("%sobject(%s)#%d (%d) refcount(%u){\n", COMMON, ZSTR_VAL(class_name), Z_OBJ_HANDLE_P(struc), myht ? zend_obj_num_elements(myht) : 0, Z_REFCOUNT_P(struc));
zend_string_release(class_name);
if (myht) {
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) {
@@ -405,7 +405,7 @@ static void php_array_element_export(zval *zv, zend_ulong index, zend_string *ke
} else { /* string key */
zend_string *tmp_str;
zend_string *ckey = php_addcslashes(key, 0, "'\\", 2);
- tmp_str = php_str_to_str(ckey->val, ckey->len, "\0", 1, "' . \"\\0\" . '", 12);
+ tmp_str = php_str_to_str(ZSTR_VAL(ckey), ZSTR_LEN(ckey), "\0", 1, "' . \"\\0\" . '", 12);
buffer_append_spaces(buf, level + 1);
@@ -479,7 +479,7 @@ again:
break;
case IS_STRING:
ztmp = php_addcslashes(Z_STR_P(struc), 0, "'\\", 2);
- ztmp2 = php_str_to_str(ztmp->val, ztmp->len, "\0", 1, "' . \"\\0\" . '", 12);
+ ztmp2 = php_str_to_str(ZSTR_VAL(ztmp), ZSTR_LEN(ztmp), "\0", 1, "' . \"\\0\" . '", 12);
smart_str_appendc(buf, '\'');
smart_str_append(buf, ztmp2);
@@ -562,7 +562,7 @@ PHPAPI void php_var_export(zval *struc, int level) /* {{{ */
smart_str buf = {0};
php_var_export_ex(struc, level, &buf);
smart_str_0(&buf);
- PHPWRITE(buf.s->val, buf.s->len);
+ PHPWRITE(ZSTR_VAL(buf.s), ZSTR_LEN(buf.s));
smart_str_free(&buf);
}
/* }}} */
@@ -586,7 +586,7 @@ PHP_FUNCTION(var_export)
if (return_output) {
RETURN_NEW_STR(buf.s);
} else {
- PHPWRITE(buf.s->val, buf.s->len);
+ PHPWRITE(ZSTR_VAL(buf.s), ZSTR_LEN(buf.s));
smart_str_free(&buf);
}
}
@@ -664,7 +664,7 @@ static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc
PHP_SET_CLASS_ATTRIBUTES(struc);
smart_str_appendl(buf, "O:", 2);
- smart_str_append_unsigned(buf, class_name->len);
+ smart_str_append_unsigned(buf, ZSTR_LEN(class_name));
smart_str_appendl(buf, ":\"", 2);
smart_str_append(buf, class_name);
smart_str_appendl(buf, "\":", 2);
@@ -700,7 +700,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
ht = HASH_OF(retval_ptr);
ZEND_HASH_FOREACH_STR_KEY_VAL(ht, key, val) {
- if (incomplete_class && strcmp(key->val, MAGIC_MEMBER) == 0) {
+ if (incomplete_class && strcmp(ZSTR_VAL(key), MAGIC_MEMBER) == 0) {
continue;
}
@@ -718,7 +718,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
continue;
}
}
- php_var_serialize_string(buf, name->val, name->len);
+ php_var_serialize_string(buf, ZSTR_VAL(name), ZSTR_LEN(name));
php_var_serialize_intern(buf, d, var_hash);
} else {
zend_class_entry *ce = Z_OBJ_P(struc)->ce;
@@ -727,7 +727,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
do {
priv_name = zend_mangle_property_name(
- ce->name->val, ce->name->len, name->val, name->len, ce->type & ZEND_INTERNAL_CLASS);
+ ZSTR_VAL(ce->name), ZSTR_LEN(ce->name), ZSTR_VAL(name), ZSTR_LEN(name), ce->type & ZEND_INTERNAL_CLASS);
if ((d = zend_hash_find(propers, priv_name)) != NULL) {
if (Z_TYPE_P(d) == IS_INDIRECT) {
d = Z_INDIRECT_P(d);
@@ -735,14 +735,14 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
break;
}
}
- php_var_serialize_string(buf, priv_name->val, priv_name->len);
+ php_var_serialize_string(buf, ZSTR_VAL(priv_name), ZSTR_LEN(priv_name));
zend_string_free(priv_name);
php_var_serialize_intern(buf, d, var_hash);
break;
}
zend_string_free(priv_name);
prot_name = zend_mangle_property_name(
- "*", 1, name->val, name->len, ce->type & ZEND_INTERNAL_CLASS);
+ "*", 1, ZSTR_VAL(name), ZSTR_LEN(name), ce->type & ZEND_INTERNAL_CLASS);
if ((d = zend_hash_find(propers, prot_name)) != NULL) {
if (Z_TYPE_P(d) == IS_INDIRECT) {
d = Z_INDIRECT_P(d);
@@ -751,19 +751,19 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
break;
}
}
- php_var_serialize_string(buf, prot_name->val, prot_name->len);
+ php_var_serialize_string(buf, ZSTR_VAL(prot_name), ZSTR_LEN(prot_name));
zend_string_free(prot_name);
php_var_serialize_intern(buf, d, var_hash);
break;
}
zend_string_free(prot_name);
- php_var_serialize_string(buf, name->val, name->len);
+ php_var_serialize_string(buf, ZSTR_VAL(name), ZSTR_LEN(name));
php_var_serialize_intern(buf, nvalp, var_hash);
php_error_docref(NULL, E_NOTICE,
- "\"%s\" returned as member variable from __sleep() but does not exist", name->val);
+ "\"%s\" returned as member variable from __sleep() but does not exist", ZSTR_VAL(name));
} while (0);
} else {
- php_var_serialize_string(buf, name->val, name->len);
+ php_var_serialize_string(buf, ZSTR_VAL(name), ZSTR_LEN(name));
php_var_serialize_intern(buf, nvalp, var_hash);
}
}
@@ -844,7 +844,7 @@ again:
if (ce->serialize(struc, &serialized_data, &serialized_length, (zend_serialize_data *)var_hash) == SUCCESS) {
smart_str_appendl(buf, "C:", 2);
- smart_str_append_unsigned(buf, Z_OBJCE_P(struc)->name->len);
+ smart_str_append_unsigned(buf, ZSTR_LEN(Z_OBJCE_P(struc)->name));
smart_str_appendl(buf, ":\"", 2);
smart_str_append(buf, Z_OBJCE_P(struc)->name);
smart_str_appendl(buf, "\":", 2);
@@ -918,14 +918,14 @@ again:
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, data) {
- if (incomplete_class && strcmp(key->val, MAGIC_MEMBER) == 0) {
+ if (incomplete_class && strcmp(ZSTR_VAL(key), MAGIC_MEMBER) == 0) {
continue;
}
if (!key) {
php_var_serialize_long(buf, index);
} else {
- php_var_serialize_string(buf, key->val, key->len);
+ php_var_serialize_string(buf, ZSTR_VAL(key), ZSTR_LEN(key));
}
/* we should still add element even if it's not OK,