summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2006-03-01 16:27:47 +0000
committerDmitry Stogov <dmitry@php.net>2006-03-01 16:27:47 +0000
commit6f7619cf6fbfd24af6b90e437d4cde0b7ec33d41 (patch)
treedd5a04cfcb5960c19638267d659daa056dcd938e
parent9158218d3a76256de1adaffd185f1429631b8b20 (diff)
downloadphp-git-6f7619cf6fbfd24af6b90e437d4cde0b7ec33d41.tar.gz
Unicode support: zstr union
-rw-r--r--sapi/apache/mod_php5.c2
-rw-r--r--sapi/apache2filter/apache_config.c12
-rw-r--r--sapi/apache2handler/apache_config.c12
-rw-r--r--sapi/apache_hooks/mod_php5.c2
-rw-r--r--sapi/apache_hooks/php_apache.c8
-rw-r--r--sapi/cli/php_cli_readline.c6
6 files changed, 21 insertions, 21 deletions
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c
index 8598869318..74042ad777 100644
--- a/sapi/apache/mod_php5.c
+++ b/sapi/apache/mod_php5.c
@@ -718,7 +718,7 @@ static zend_bool should_overwrite_per_dir_entry(HashTable *target_ht, php_per_di
{
php_per_dir_entry *orig_per_dir_entry;
- if (zend_u_hash_find(target_ht, hash_key->type, hash_key->u.string, hash_key->nKeyLength, (void **) &orig_per_dir_entry)==FAILURE) {
+ if (zend_u_hash_find(target_ht, hash_key->type, hash_key->arKey, hash_key->nKeyLength, (void **) &orig_per_dir_entry)==FAILURE) {
return 1; /* does not exist in dest, copy from source */
}
diff --git a/sapi/apache2filter/apache_config.c b/sapi/apache2filter/apache_config.c
index a77a6b5714..8d6f766995 100644
--- a/sapi/apache2filter/apache_config.c
+++ b/sapi/apache2filter/apache_config.c
@@ -131,7 +131,7 @@ void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf)
php_conf_rec *d = base_conf, *e = new_conf;
php_dir_entry *pe;
php_dir_entry *data;
- char *str;
+ zstr str;
uint str_len;
ulong num_index;
@@ -142,10 +142,10 @@ void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf)
zend_hash_move_forward(&d->config)) {
pe = NULL;
zend_hash_get_current_data(&d->config, (void **) &data);
- if (zend_hash_find(&e->config, str, str_len, (void **) &pe) == SUCCESS) {
+ if (zend_hash_find(&e->config, str.s, str_len, (void **) &pe) == SUCCESS) {
if (pe->status >= data->status) continue;
}
- zend_hash_update(&e->config, str, str_len, data, sizeof(*data), NULL);
+ zend_hash_update(&e->config, str.s, str_len, data, sizeof(*data), NULL);
phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", str,
data->status, pe?pe->status:-1));
}
@@ -167,7 +167,7 @@ char *get_php_config(void *conf, char *name, size_t name_len)
void apply_config(void *dummy)
{
php_conf_rec *d = dummy;
- char *str;
+ zstr str;
uint str_len;
php_dir_entry *data;
@@ -176,8 +176,8 @@ void apply_config(void *dummy)
NULL) == HASH_KEY_IS_STRING;
zend_hash_move_forward(&d->config)) {
zend_hash_get_current_data(&d->config, (void **) &data);
- phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value));
- if (zend_alter_ini_entry(str, str_len, data->value, data->value_len,
+ phpapdebug((stderr, "APPLYING (%s)(%s)\n", str.s, data->value));
+ if (zend_alter_ini_entry(str.s, str_len, data->value, data->value_len,
data->status, PHP_INI_STAGE_ACTIVATE) == FAILURE) {
phpapdebug((stderr, "..FAILED\n"));
}
diff --git a/sapi/apache2handler/apache_config.c b/sapi/apache2handler/apache_config.c
index 729a478125..49173b86ff 100644
--- a/sapi/apache2handler/apache_config.c
+++ b/sapi/apache2handler/apache_config.c
@@ -121,7 +121,7 @@ void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf)
php_conf_rec *d = base_conf, *e = new_conf;
php_dir_entry *pe;
php_dir_entry *data;
- char *str;
+ zstr str;
uint str_len;
ulong num_index;
@@ -132,10 +132,10 @@ void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf)
zend_hash_move_forward(&d->config)) {
pe = NULL;
zend_hash_get_current_data(&d->config, (void **) &data);
- if (zend_hash_find(&e->config, str, str_len, (void **) &pe) == SUCCESS) {
+ if (zend_hash_find(&e->config, str.s, str_len, (void **) &pe) == SUCCESS) {
if (pe->status >= data->status) continue;
}
- zend_hash_update(&e->config, str, str_len, data, sizeof(*data), NULL);
+ zend_hash_update(&e->config, str.s, str_len, data, sizeof(*data), NULL);
phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", str, data->status, pe?pe->status:-1));
}
return new_conf;
@@ -156,7 +156,7 @@ char *get_php_config(void *conf, char *name, size_t name_len)
void apply_config(void *dummy)
{
php_conf_rec *d = dummy;
- char *str;
+ zstr str;
uint str_len;
php_dir_entry *data;
@@ -165,8 +165,8 @@ void apply_config(void *dummy)
NULL) == HASH_KEY_IS_STRING;
zend_hash_move_forward(&d->config)) {
zend_hash_get_current_data(&d->config, (void **) &data);
- phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value));
- if (zend_alter_ini_entry(str, str_len, data->value, data->value_len, data->status, PHP_INI_STAGE_ACTIVATE) == FAILURE) {
+ phpapdebug((stderr, "APPLYING (%s)(%s)\n", str.s, data->value));
+ if (zend_alter_ini_entry(str.s, str_len, data->value, data->value_len, data->status, PHP_INI_STAGE_ACTIVATE) == FAILURE) {
phpapdebug((stderr, "..FAILED\n"));
}
}
diff --git a/sapi/apache_hooks/mod_php5.c b/sapi/apache_hooks/mod_php5.c
index e829986629..6fb54fcac6 100644
--- a/sapi/apache_hooks/mod_php5.c
+++ b/sapi/apache_hooks/mod_php5.c
@@ -781,7 +781,7 @@ static zend_bool should_overwrite_per_dir_entry(HashTable *target_ht, php_per_di
{
php_per_dir_entry *new_per_dir_entry;
- if (zend_hash_find(target_ht, hash_key->arKey, hash_key->nKeyLength, (void **) &new_per_dir_entry)==FAILURE) {
+ if (zend_u_hash_find(target_ht, hash_key->type, hash_key->arKey, hash_key->nKeyLength, (void **) &new_per_dir_entry)==FAILURE) {
return 1; /* does not exist in dest, copy from source */
}
diff --git a/sapi/apache_hooks/php_apache.c b/sapi/apache_hooks/php_apache.c
index dff34bdad7..aaeaa76d6c 100644
--- a/sapi/apache_hooks/php_apache.c
+++ b/sapi/apache_hooks/php_apache.c
@@ -566,7 +566,7 @@ static void add_header_to_table(table *t, INTERNAL_FUNCTION_PARAMETERS)
zval *first = NULL;
zval *second = NULL;
zval **entry, **value;
- char *string_key;
+ zstr string_key;
uint string_key_len;
ulong num_key;
@@ -584,7 +584,7 @@ static void add_header_to_table(table *t, INTERNAL_FUNCTION_PARAMETERS)
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(first), (void **)&entry, &pos) == SUCCESS) {
switch(zend_hash_get_current_key_ex(Z_ARRVAL_P(first), &string_key, &string_key_len, &num_key, 0, &pos)) {
case HASH_KEY_IS_STRING:
- if (zend_hash_find(Z_ARRVAL_P(first), string_key, string_key_len, (void **)&value) == FAILURE) {
+ if (zend_hash_find(Z_ARRVAL_P(first), string_key.s, string_key_len, (void **)&value) == FAILURE) {
zend_hash_move_forward_ex(Z_ARRVAL_P(first), &pos);
continue;
}
@@ -595,9 +595,9 @@ static void add_header_to_table(table *t, INTERNAL_FUNCTION_PARAMETERS)
convert_to_string_ex(value);
if (replace)
- ap_table_set(t, string_key, Z_STRVAL_PP(value));
+ ap_table_set(t, string_key.s, Z_STRVAL_PP(value));
else
- ap_table_merge(t, string_key, Z_STRVAL_PP(value));
+ ap_table_merge(t, string_key.s, Z_STRVAL_PP(value));
break;
case HASH_KEY_IS_LONG:
diff --git a/sapi/cli/php_cli_readline.c b/sapi/cli/php_cli_readline.c
index 6cd3effcf2..23729d58e6 100644
--- a/sapi/cli/php_cli_readline.c
+++ b/sapi/cli/php_cli_readline.c
@@ -277,7 +277,7 @@ int cli_is_valid_code(char *code, int len, char **prompt TSRMLS_DC)
static char *cli_completion_generator_ht(const char *text, int textlen, int *state, HashTable *ht, void **pData TSRMLS_DC) /* {{{ */
{
- char *name;
+ zstr name;
ulong number;
if (!(*state % 2)) {
@@ -286,12 +286,12 @@ static char *cli_completion_generator_ht(const char *text, int textlen, int *sta
}
while(zend_hash_has_more_elements(ht) == SUCCESS) {
zend_hash_get_current_key(ht, &name, &number, 0);
- if (!textlen || (UG(unicode) ? !zend_cmp_unicode_and_string((UChar *)name, (char *)text, textlen) : !strncmp(name, text, textlen))) {
+ if (!textlen || (UG(unicode) ? !zend_cmp_unicode_and_string(name.u, (char *)text, textlen) : !strncmp(name.s, text, textlen))) {
if (pData) {
zend_hash_get_current_data(ht, pData);
}
zend_hash_move_forward(ht);
- return name;
+ return name.s;
}
if (zend_hash_move_forward(ht) == FAILURE) {
break;