summaryrefslogtreecommitdiff
path: root/ext/spl/spl_functions.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2005-08-15 17:29:07 +0000
committerDmitry Stogov <dmitry@php.net>2005-08-15 17:29:07 +0000
commit909e0a1c4edd870c0afdde96e6922643cf66152b (patch)
tree5da0b3b4b5ca6991c12f5dbc84b7d509256dc039 /ext/spl/spl_functions.c
parentbbe63287e766a25818cff48ec869a897e7747bb4 (diff)
downloadphp-git-909e0a1c4edd870c0afdde96e6922643cf66152b.tar.gz
Unicode support
Diffstat (limited to 'ext/spl/spl_functions.c')
-rwxr-xr-xext/spl/spl_functions.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/ext/spl/spl_functions.c b/ext/spl/spl_functions.c
index 82a6bfb8b9..e86d723234 100755
--- a/ext/spl/spl_functions.c
+++ b/ext/spl/spl_functions.c
@@ -115,11 +115,16 @@ void spl_add_class_name(zval *list, zend_class_entry * pce, int allow, int ce_fl
if (!allow || (allow > 0 && pce->ce_flags & ce_flags) || (allow < 0 && !(pce->ce_flags & ce_flags))) {
size_t len = pce->name_length;
zval *tmp;
+ zend_uchar ztype = UG(unicode)?IS_UNICODE:IS_STRING;
- if (zend_hash_find(Z_ARRVAL_P(list), pce->name, len+1, (void*)&tmp) == FAILURE) {
+ if (zend_u_hash_find(Z_ARRVAL_P(list), ztype, pce->name, len+1, (void*)&tmp) == FAILURE) {
MAKE_STD_ZVAL(tmp);
- ZVAL_STRING(tmp, pce->name, 1);
- zend_hash_add(Z_ARRVAL_P(list), pce->name, len+1, &tmp, sizeof(zval *), NULL);
+ if (UG(unicode)) {
+ ZVAL_UNICODEL(tmp, pce->name, pce->name_length, 1);
+ } else {
+ ZVAL_STRINGL(tmp, pce->name, pce->name_length, 1);
+ }
+ zend_u_hash_add(Z_ARRVAL_P(list), ztype, pce->name, len+1, &tmp, sizeof(zval *), NULL);
}
}
}
@@ -137,10 +142,8 @@ void spl_add_interfaces(zval *list, zend_class_entry * pce, int allow, int ce_fl
/* }}} */
/* {{{ spl_add_classes */
-int spl_add_classes(zend_class_entry ** ppce, zval *list, int sub, int allow, int ce_flags TSRMLS_DC)
+int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags TSRMLS_DC)
{
- zend_class_entry *pce = *ppce;
-
if (!pce) {
return 0;
}
@@ -149,7 +152,7 @@ int spl_add_classes(zend_class_entry ** ppce, zval *list, int sub, int allow, in
spl_add_interfaces(list, pce, allow, ce_flags TSRMLS_CC);
while (pce->parent) {
pce = pce->parent;
- spl_add_classes(&pce, list, sub, allow, ce_flags TSRMLS_CC);
+ spl_add_classes(pce, list, sub, allow, ce_flags TSRMLS_CC);
}
}
return 0;