summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Wolffelaar <jeroen@php.net>2001-09-27 20:01:23 +0000
committerJeroen van Wolffelaar <jeroen@php.net>2001-09-27 20:01:23 +0000
commiteb38ca844be8f6d1f975bbe1e7cbad30d58dfe48 (patch)
tree79cd09acaeff56b01bf568d078fb04663d43137c
parent6d9c04e82399d7892ce221cf807dbbb2abd0b2df (diff)
downloadphp-git-eb38ca844be8f6d1f975bbe1e7cbad30d58dfe48.tar.gz
Undo Z_ subst for sapi and ext/yaz
-rw-r--r--ext/yaz/php_yaz.c60
-rw-r--r--sapi/aolserver/aolserver.c2
-rw-r--r--sapi/apache/mod_php4.c12
-rw-r--r--sapi/apache/php_apache.c20
-rw-r--r--sapi/apache/sapi_apache.c2
-rw-r--r--sapi/apache2filter/sapi_apache2.c2
-rw-r--r--sapi/caudium/caudium.c38
-rw-r--r--sapi/cgi/cgi_main.c2
-rw-r--r--sapi/fastcgi/fastcgi.c2
-rw-r--r--sapi/isapi/php4isapi.c2
-rw-r--r--sapi/nsapi/nsapi.c2
-rw-r--r--sapi/phttpd/phttpd.c2
-rw-r--r--sapi/pi3web/pi3web_sapi.c8
-rw-r--r--sapi/roxen/roxen.c40
-rw-r--r--sapi/thttpd/thttpd.c2
-rw-r--r--sapi/tux/php_tux.c2
16 files changed, 99 insertions, 99 deletions
diff --git a/ext/yaz/php_yaz.c b/ext/yaz/php_yaz.c
index c8e0e9f9f7..a97e162473 100644
--- a/ext/yaz/php_yaz.c
+++ b/ext/yaz/php_yaz.c
@@ -369,7 +369,7 @@ static const char *array_lookup_string(HashTable *ht, const char *idx)
{
SEPARATE_ZVAL(pvalue);
convert_to_string(*pvalue);
- return Z_STRVAL_PP(pvalue);
+ return (*pvalue)->value.str.val;
}
return 0;
}
@@ -383,7 +383,7 @@ static long *array_lookup_long(HashTable *ht, const char *idx)
{
SEPARATE_ZVAL(pvalue);
convert_to_long(*pvalue);
- return &Z_LVAL_PP(pvalue);
+ return &(*pvalue)->value.lval;
}
return 0;
}
@@ -397,7 +397,7 @@ static long *array_lookup_bool(HashTable *ht, const char *idx)
{
SEPARATE_ZVAL(pvalue);
convert_to_boolean(*pvalue);
- return &Z_LVAL_PP(pvalue);
+ return &(*pvalue)->value.lval;
}
return 0;
}
@@ -1235,7 +1235,7 @@ PHP_FUNCTION(yaz_connect)
else
{
convert_to_string_ex (user);
- user_str = Z_STRVAL_PP(user);
+ user_str = (*user)->value.str.val;
}
}
else
@@ -1243,7 +1243,7 @@ PHP_FUNCTION(yaz_connect)
WRONG_PARAM_COUNT;
}
convert_to_string_ex (zurl);
- zurl_str = Z_STRVAL_PP(zurl);
+ zurl_str = (*zurl)->value.str.val;
for (cp = zurl_str; *cp && strchr("\t\n ", *cp); cp++)
;
if (!*cp)
@@ -1339,7 +1339,7 @@ PHP_FUNCTION(yaz_close)
if (!p)
RETURN_FALSE;
release_assoc (p);
- zend_list_delete (Z_LVAL_PP(id));
+ zend_list_delete ((*id)->value.lval);
RETURN_TRUE;
}
/* }}} */
@@ -1370,17 +1370,17 @@ PHP_FUNCTION(yaz_search)
}
p->action = 0;
convert_to_string_ex (type);
- type_str = Z_STRVAL_PP(type);
+ type_str = (*type)->value.str.val;
convert_to_string_ex (query);
- query_str = Z_STRVAL_PP(query);
+ query_str = (*query)->value.str.val;
yaz_resultset_destroy (p->resultSets);
r = p->resultSets = yaz_resultset_mk();
r->query = odr_malloc (r->odr, sizeof(*r->query));
if (!strcmp (type_str, "rpn"))
{
r->query->which = Z_Query_type_1;
- Z_TYPE(r->query->u)_1 = p_query_rpn (r->odr, PROTO_Z3950, query_str);
- if (!Z_TYPE(r->query->u)_1)
+ r->query->u.type_1 = p_query_rpn (r->odr, PROTO_Z3950, query_str);
+ if (!r->query->u.type_1)
{
yaz_resultset_destroy(r);
p->resultSets = 0;
@@ -1394,9 +1394,9 @@ PHP_FUNCTION(yaz_search)
else if (!strcmp(type_str, "ccl"))
{
r->query->which = Z_Query_type_2;
- Z_TYPE(r->query->u)_2 = odr_malloc (r->odr, sizeof(*Z_TYPE(r->query->u)_2));
- Z_TYPE(r->query->u)_2->buf = odr_strdup(r->odr, query_str);
- Z_TYPE(r->query->u)_2->len = strlen(query_str);
+ r->query->u.type_2 = odr_malloc (r->odr, sizeof(*r->query->u.type_2));
+ r->query->u.type_2->buf = odr_strdup(r->odr, query_str);
+ r->query->u.type_2->len = strlen(query_str);
}
else
{
@@ -1560,10 +1560,10 @@ PHP_FUNCTION(yaz_error)
msg = "unknown diagnostic";
}
/* Not macro using because RETURN_STRING throws away const */
- Z_STRLEN_P(return_value) = strlen(msg);
- Z_STRVAL_P(return_value) =
- estrndup(msg, Z_STRLEN_P(return_value));
- Z_TYPE_P(return_value) = IS_STRING;
+ return_value->value.str.len = strlen(msg);
+ return_value->value.str.val =
+ estrndup(msg, return_value->value.str.len);
+ return_value->type = IS_STRING;
}
release_assoc (p);
}
@@ -1867,7 +1867,7 @@ static void retval_grs1 (zval *return_value, Z_GenericRecord *p)
grs[level] = e->content->u.subtree;
eno[level] = -1;
}
- zend_hash_next_index_insert (Z_ARRVAL_P(return_value),
+ zend_hash_next_index_insert (return_value->value.ht,
(void *) &my_zval, sizeof(zval *), NULL);
eno[level]++;
}
@@ -1892,10 +1892,10 @@ PHP_FUNCTION(yaz_record)
get_assoc (INTERNAL_FUNCTION_PARAM_PASSTHRU, pval_id, &p);
convert_to_long_ex(pval_pos);
- pos = Z_LVAL_PP(pval_pos);
+ pos = (*pval_pos)->value.lval;
convert_to_string_ex(pval_type);
- type = Z_STRVAL_PP(pval_type);
+ type = (*pval_type)->value.str.val;
if (p && p->resultSets && p->resultSets->recordList &&
pos >= p->resultSetStartPoint &&
@@ -1996,7 +1996,7 @@ PHP_FUNCTION(yaz_syntax)
{
convert_to_string_ex (pval_syntax);
xfree (p->preferredRecordSyntax);
- p->preferredRecordSyntax = xstrdup (Z_STRVAL_PP(pval_syntax));
+ p->preferredRecordSyntax = xstrdup ((*pval_syntax)->value.str.val);
}
release_assoc (p);
}
@@ -2018,7 +2018,7 @@ PHP_FUNCTION(yaz_element)
{
convert_to_string_ex (pval_element);
xfree (p->elementSetNames);
- p->elementSetNames = xstrdup (Z_STRVAL_PP(pval_element));
+ p->elementSetNames = xstrdup ((*pval_element)->value.str.val);
}
release_assoc (p);
}
@@ -2041,11 +2041,11 @@ PHP_FUNCTION(yaz_range)
if (p)
{
convert_to_long_ex (pval_start);
- p->resultSetStartPoint = Z_LVAL_PP(pval_start);
+ p->resultSetStartPoint = (*pval_start)->value.lval;
if (p->resultSetStartPoint < 1)
p->resultSetStartPoint = 1;
convert_to_long_ex (pval_number);
- p->numberOfRecordsRequested = Z_LVAL_PP(pval_number);
+ p->numberOfRecordsRequested = (*pval_number)->value.lval;
}
release_assoc (p);
}
@@ -2071,11 +2071,11 @@ PHP_FUNCTION(yaz_sort)
if (p->resultSets && p->resultSets->sorted)
{
if (!p->sort_criteria || strcmp (p->sort_criteria,
- Z_STRVAL_PP(pval_criteria)))
+ (*pval_criteria)->value.str.val))
p->resultSets->sorted = 0;
}
xfree (p->sort_criteria);
- p->sort_criteria = xstrdup (Z_STRVAL_PP(pval_criteria));
+ p->sort_criteria = xstrdup ((*pval_criteria)->value.str.val);
}
release_assoc (p);
}
@@ -2441,7 +2441,7 @@ PHP_FUNCTION(yaz_scan_result)
add_next_index_string(my_zval, "unknown", 1);
zend_hash_next_index_insert (
- Z_ARRVAL_P(return_value), (void *) &my_zval, sizeof(zval *),
+ return_value->value.ht, (void *) &my_zval, sizeof(zval *),
NULL);
}
@@ -2492,7 +2492,7 @@ PHP_FUNCTION(yaz_ccl_conf)
#endif
if (type != HASH_KEY_IS_STRING || Z_TYPE_PP(ent) != IS_STRING)
continue;
- ccl_qual_fitem(p->ccl_parser->bibset, Z_STRVAL_PP(ent), key);
+ ccl_qual_fitem(p->ccl_parser->bibset, (*ent)->value.str.val, key);
}
}
release_assoc (p);
@@ -2523,7 +2523,7 @@ PHP_FUNCTION(yaz_ccl_parse)
get_assoc (INTERNAL_FUNCTION_PARAM_PASSTHRU, pval_id, &p);
if (p)
{
- const char *query_str = Z_STRVAL_PP(pval_query);
+ const char *query_str = (*pval_query)->value.str.val;
struct ccl_rpn_node *rpn;
struct ccl_token *token_list =
ccl_parser_tokenize(p->ccl_parser, query_str);
@@ -2575,7 +2575,7 @@ PHP_FUNCTION(yaz_database)
if (p)
{
xfree (p->local_databases);
- p->local_databases = xstrdup (Z_STRVAL_PP(pval_database));
+ p->local_databases = xstrdup ((*pval_database)->value.str.val);
RETVAL_TRUE;
}
else
diff --git a/sapi/aolserver/aolserver.c b/sapi/aolserver/aolserver.c
index 2178b98453..7fb350e4f5 100644
--- a/sapi/aolserver/aolserver.c
+++ b/sapi/aolserver/aolserver.c
@@ -403,7 +403,7 @@ php_ns_module_main(TSRMLS_D)
{
zend_file_handle file_handle;
- Z_TYPE(file_handle) = ZEND_HANDLE_FILENAME;
+ file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = SG(request_info).path_translated;
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c
index e9d39c86c4..3a248c0ebb 100644
--- a/sapi/apache/mod_php4.c
+++ b/sapi/apache/mod_php4.c
@@ -255,7 +255,7 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_
/* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */
if (track_vars_array) {
- symbol_table = Z_ARRVAL_P(track_vars_array);
+ symbol_table = track_vars_array->value.ht;
} else if (PG(register_globals)) {
/* should never happen nowadays */
symbol_table = EG(active_symbol_table);
@@ -458,7 +458,7 @@ static void init_request_info(TSRMLS_D)
*/
static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_DC)
{
- zend_alter_ini_entry(per_dir_entry->key, per_dir_entry->key_length+1, per_dir_entry->value, per_dir_entry->value_length, Z_TYPE_P(per_dir_entry), PHP_INI_STAGE_ACTIVATE);
+ zend_alter_ini_entry(per_dir_entry->key, per_dir_entry->key_length+1, per_dir_entry->value, per_dir_entry->value_length, per_dir_entry->type, PHP_INI_STAGE_ACTIVATE);
return 0;
}
/* }}} */
@@ -497,7 +497,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
fh.filename = r->filename;
fh.opened_path = NULL;
fh.free_filename = 0;
- Z_TYPE(fh) = ZEND_HANDLE_FILENAME;
+ fh.type = ZEND_HANDLE_FILENAME;
zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &fh);
return OK;
}
@@ -641,8 +641,8 @@ static void copy_per_dir_entry(php_per_dir_entry *per_dir_entry)
*/
static zend_bool should_overwrite_per_dir_entry(php_per_dir_entry *orig_per_dir_entry, php_per_dir_entry *new_per_dir_entry)
{
- if (Z_TYPE_P(new_per_dir_entry)==PHP_INI_SYSTEM
- && Z_TYPE_P(orig_per_dir_entry)!=PHP_INI_SYSTEM) {
+ if (new_per_dir_entry->type==PHP_INI_SYSTEM
+ && orig_per_dir_entry->type!=PHP_INI_SYSTEM) {
return 1;
} else {
return 0;
@@ -697,7 +697,7 @@ CONST_PREFIX char *php_apache_value_handler_ex(cmd_parms *cmd, HashTable *conf,
sapi_startup(&apache_sapi_module);
php_apache_startup(&apache_sapi_module);
}
- Z_TYPE(per_dir_entry) = mode;
+ per_dir_entry.type = mode;
if (strcasecmp(arg2, "none") == 0) {
arg2 = "";
diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c
index 9274ad2bc6..8cff77e6c4 100644
--- a/sapi/apache/php_apache.c
+++ b/sapi/apache/php_apache.c
@@ -151,11 +151,11 @@ PHP_FUNCTION(apache_note)
}
convert_to_string_ex(arg_name);
- note_val = (char *) table_get(((request_rec *)SG(server_context))->notes, Z_STRVAL_PP(arg_name));
+ note_val = (char *) table_get(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val);
if (arg_count == 2) {
convert_to_string_ex(arg_val);
- table_set(((request_rec *)SG(server_context))->notes, Z_STRVAL_PP(arg_name), Z_STRVAL_PP(arg_val));
+ table_set(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val, (*arg_val)->value.str.val);
}
if (note_val) {
@@ -307,14 +307,14 @@ PHP_FUNCTION(virtual)
}
convert_to_string_ex(filename);
- if (!(rr = sub_req_lookup_uri (Z_STRVAL_PP(filename), ((request_rec *) SG(server_context))))) {
- php_error(E_WARNING, "Unable to include '%s' - URI lookup failed", Z_STRVAL_PP(filename));
+ if (!(rr = sub_req_lookup_uri ((*filename)->value.str.val, ((request_rec *) SG(server_context))))) {
+ php_error(E_WARNING, "Unable to include '%s' - URI lookup failed", (*filename)->value.str.val);
if (rr) destroy_sub_req (rr);
RETURN_FALSE;
}
if (rr->status != 200) {
- php_error(E_WARNING, "Unable to include '%s' - error finding URI", Z_STRVAL_PP(filename));
+ php_error(E_WARNING, "Unable to include '%s' - error finding URI", (*filename)->value.str.val);
if (rr) destroy_sub_req (rr);
RETURN_FALSE;
}
@@ -323,7 +323,7 @@ PHP_FUNCTION(virtual)
php_header();
if (run_sub_req(rr)) {
- php_error(E_WARNING, "Unable to include '%s' - request execution failed", Z_STRVAL_PP(filename));
+ php_error(E_WARNING, "Unable to include '%s' - request execution failed", (*filename)->value.str.val);
if (rr) destroy_sub_req (rr);
RETURN_FALSE;
} else {
@@ -393,8 +393,8 @@ PHP_FUNCTION(apache_lookup_uri)
}
convert_to_string_ex(filename);
- if(!(rr = sub_req_lookup_uri(Z_STRVAL_PP(filename), ((request_rec *) SG(server_context))))) {
- php_error(E_WARNING, "URI lookup failed", Z_STRVAL_PP(filename));
+ if(!(rr = sub_req_lookup_uri((*filename)->value.str.val, ((request_rec *) SG(server_context))))) {
+ php_error(E_WARNING, "URI lookup failed", (*filename)->value.str.val);
RETURN_FALSE;
}
object_init(return_value);
@@ -468,8 +468,8 @@ PHP_FUNCTION(apache_exec_uri)
}
convert_to_string_ex(filename);
- if(!(rr = ap_sub_req_lookup_uri(Z_STRVAL_PP(filename), ((request_rec *) SG(server_context))))) {
- php_error(E_WARNING, "URI lookup failed", Z_STRVAL_PP(filename));
+ if(!(rr = ap_sub_req_lookup_uri((*filename)->value.str.val, ((request_rec *) SG(server_context))))) {
+ php_error(E_WARNING, "URI lookup failed", (*filename)->value.str.val);
RETURN_FALSE;
}
RETVAL_LONG(ap_run_sub_req(rr));
diff --git a/sapi/apache/sapi_apache.c b/sapi/apache/sapi_apache.c
index b62773e25a..30dff99c76 100644
--- a/sapi/apache/sapi_apache.c
+++ b/sapi/apache/sapi_apache.c
@@ -81,7 +81,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC)
return NOT_FOUND;
}
} else {
- Z_TYPE(file_handle) = ZEND_HANDLE_FILENAME;
+ file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.handle.fd = 0;
file_handle.filename = SG(request_info).path_translated;
file_handle.opened_path = NULL;
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index b3b6cd17ff..5dbb8947ff 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -369,7 +369,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
apr_file_name_get(&path, ((apr_bucket_file *) b->data)->fd);
- Z_TYPE(zfd) = ZEND_HANDLE_FILENAME;
+ zfd.type = ZEND_HANDLE_FILENAME;
zfd.filename = (char *) path;
zfd.free_filename = 0;
zfd.opened_path = NULL;
diff --git a/sapi/caudium/caudium.c b/sapi/caudium/caudium.c
index 6f6659508f..962b9acc92 100644
--- a/sapi/caudium/caudium.c
+++ b/sapi/caudium/caudium.c
@@ -165,7 +165,7 @@ INLINE static struct svalue *lookup_header(char *headername)
sind = make_shared_string("env");
headers = low_mapping_string_lookup(REQUEST_DATA, sind);
free_string(sind);
- if(!headers || Z_TYPE_P(headers) != PIKE_T_MAPPING) return NULL;
+ if(!headers || headers->type != PIKE_T_MAPPING) return NULL;
sind = make_shared_string(headername);
value = low_mapping_string_lookup(headers->u.mapping, sind);
free_string(sind);
@@ -180,7 +180,7 @@ INLINE static char *lookup_string_header(char *headername, char *default_value)
{
struct svalue *head = NULL;
THREAD_SAFE_RUN(head = lookup_header(headername), "header lookup");
- if(!head || Z_TYPE_P(head) != PIKE_T_STRING)
+ if(!head || head->type != PIKE_T_STRING)
return default_value;
return head->u.string->str;
}
@@ -192,7 +192,7 @@ INLINE static int lookup_integer_header(char *headername, int default_value)
{
struct svalue *head = NULL;
THREAD_SAFE_RUN(head = lookup_header(headername), "header lookup");
- if(!head || Z_TYPE_P(head) != PIKE_T_INT)
+ if(!head || head->type != PIKE_T_INT)
return default_value;
return head->u.integer;
}
@@ -288,10 +288,10 @@ php_caudium_set_header(char *header_name, char *value, char *p)
(int)(p - header_name));
s_headermap = low_mapping_string_lookup(REQUEST_DATA, ind);
- if(!s_headermap || Z_TYPE_P(s_headermap) != PIKE_T_MAPPING)
+ if(!s_headermap || s_headermap->type != PIKE_T_MAPPING)
{
struct svalue mappie;
- Z_TYPE(mappie) = PIKE_T_MAPPING;
+ mappie.type = PIKE_T_MAPPING;
headermap = allocate_mapping(1);
mappie.u.mapping = headermap;
mapping_string_insert(REQUEST_DATA, ind, &mappie);
@@ -302,7 +302,7 @@ php_caudium_set_header(char *header_name, char *value, char *p)
soldval = low_mapping_string_lookup(headermap, hind);
vallen = strlen(value);
if(soldval != NULL &&
- Z_TYPE_P(soldval) == PIKE_T_STRING &&
+ soldval->type == PIKE_T_STRING &&
soldval->u.string->size_shift == 0) {
/* Existing, valid header. Prepend.*/
hval = begin_shared_string(soldval->u.string->len + 1 + vallen);
@@ -314,7 +314,7 @@ php_caudium_set_header(char *header_name, char *value, char *p)
hval = make_shared_string(value);
}
}
- Z_TYPE(hsval) = PIKE_T_STRING;
+ hsval.type = PIKE_T_STRING;
hsval.u.string = hval;
mapping_string_insert(headermap, hind, &hsval);
@@ -367,7 +367,7 @@ php_caudium_low_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
free_string(ind);
push_int(SG(sapi_headers).http_response_code);
- if(s_headermap && Z_TYPE_P(s_headermap) == PIKE_T_MAPPING)
+ if(s_headermap && s_headermap->type == PIKE_T_MAPPING)
ref_push_mapping(s_headermap->u.mapping);
else
push_int(0);
@@ -566,21 +566,21 @@ static void php_caudium_hash_environment(TSRMLS_D)
sind = make_shared_string("env");
headers = low_mapping_string_lookup(REQUEST_DATA, sind);
free_string(sind);
- if(headers && Z_TYPE_P(headers) == PIKE_T_MAPPING) {
+ if(headers && headers->type == PIKE_T_MAPPING) {
indices = mapping_indices(headers->u.mapping);
for(i = 0; i < indices->size; i++) {
ind = &indices->item[i];
val = low_mapping_lookup(headers->u.mapping, ind);
- if(ind && Z_TYPE_P(ind) == PIKE_T_STRING &&
- val && Z_TYPE_P(val) == PIKE_T_STRING) {
+ if(ind && ind->type == PIKE_T_STRING &&
+ val && val->type == PIKE_T_STRING) {
int buf_len;
buf_len = MIN(511, ind->u.string->len);
strncpy(buf, ind->u.string->str, buf_len);
buf[buf_len] = '\0'; /* Terminate correctly */
MAKE_STD_ZVAL(pval);
- Z_TYPE_P(pval) = IS_STRING;
- Z_STRLEN_P(pval) = val->u.string->len;
- Z_STRVAL_P(pval) = estrndup(val->u.string->str, Z_STRLEN_P(pval));
+ pval->type = IS_STRING;
+ pval->value.str.len = val->u.string->len;
+ pval->value.str.val = estrndup(val->u.string->str, pval->value.str.len);
zend_hash_update(&EG(symbol_table), buf, buf_len + 1, &pval, sizeof(zval *), NULL);
}
@@ -590,8 +590,8 @@ static void php_caudium_hash_environment(TSRMLS_D)
/*
MAKE_STD_ZVAL(pval);
- Z_TYPE_P(pval) = IS_LONG;
- Z_LVAL_P(pval) = Ns_InfoBootTime();
+ pval->type = IS_LONG;
+ pval->value.lval = Ns_InfoBootTime();
zend_hash_update(&EG(symbol_table), "SERVER_BOOTTIME", sizeof("SERVER_BOOTTIME"), &pval, sizeof(zval *), NULL);
*/
}
@@ -688,7 +688,7 @@ static void php_caudium_module_main(php_caudium_request *ureq)
VCWD_CHDIR_FILE(THIS->filename->str);
#endif
- Z_TYPE(file_handle) = ZEND_HANDLE_FILENAME;
+ file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = THIS->filename->str;
file_handle.opened_path = NULL;
file_handle.free_filename = 0;
@@ -759,7 +759,7 @@ void f_php_caudium_request_handler(INT32 args)
get_all_args("PHP4.Interpreter->run", args, "%S%m%O%*", &script,
&request_data, &my_fd_obj, &done_callback);
- if(Z_TYPE_P(done_callback) != PIKE_T_FUNCTION)
+ if(done_callback->type != PIKE_T_FUNCTION)
Pike_error("PHP4.Interpreter->run: Bad argument 4, expected function.\n");
add_ref(request_data);
add_ref(my_fd_obj);
@@ -772,7 +772,7 @@ void f_php_caudium_request_handler(INT32 args)
ind = make_shared_binary_string("my_fd", 5);
raw_fd = low_mapping_string_lookup(THIS->request_data, ind);
- if(raw_fd && Z_TYPE_P(raw_fd) == PIKE_T_OBJECT)
+ if(raw_fd && raw_fd->type == PIKE_T_OBJECT)
{
int fd = fd_from_object(raw_fd->u.object);
if(fd == -1)
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 64a664184e..5c71db425c 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -676,7 +676,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
SG(request_info).no_headers = 1;
}
file_handle.filename = "-";
- Z_TYPE(file_handle) = ZEND_HANDLE_FP;
+ file_handle.type = ZEND_HANDLE_FP;
file_handle.handle.fp = stdin;
file_handle.opened_path = NULL;
file_handle.free_filename = 0;
diff --git a/sapi/fastcgi/fastcgi.c b/sapi/fastcgi/fastcgi.c
index 901b59bb9b..80b5c3c204 100644
--- a/sapi/fastcgi/fastcgi.c
+++ b/sapi/fastcgi/fastcgi.c
@@ -196,7 +196,7 @@ static void fastcgi_module_main(TSRMLS_D)
zend_file_handle file_handle;
int c, retval = FAILURE;
- Z_TYPE(file_handle) = ZEND_HANDLE_FILENAME;
+ file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = SG(request_info).path_translated;
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
diff --git a/sapi/isapi/php4isapi.c b/sapi/isapi/php4isapi.c
index db69ac4d93..6256d7f93b 100644
--- a/sapi/isapi/php4isapi.c
+++ b/sapi/isapi/php4isapi.c
@@ -748,7 +748,7 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB)
file_handle.filename = SG(request_info.path_translated);
file_handle.free_filename = 0;
#endif
- Z_TYPE(file_handle) = ZEND_HANDLE_FILENAME;
+ file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.opened_path = NULL;
php_request_startup(TSRMLS_C);
diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c
index c076fa711b..71d8c7ec28 100644
--- a/sapi/nsapi/nsapi.c
+++ b/sapi/nsapi/nsapi.c
@@ -449,7 +449,7 @@ nsapi_module_main(NSLS_D TSRMLS_DC)
return FAILURE;
}
- Z_TYPE(file_handle) = ZEND_HANDLE_FILENAME;
+ file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = SG(request_info).path_translated;
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
diff --git a/sapi/phttpd/phttpd.c b/sapi/phttpd/phttpd.c
index f7d46da7ce..dcd94a38e9 100644
--- a/sapi/phttpd/phttpd.c
+++ b/sapi/phttpd/phttpd.c
@@ -259,7 +259,7 @@ int php_doit(TSRMLS_D TSRMLS_DC)
return -1;
}
- Z_TYPE(file_handle) = ZEND_HANDLE_FILENAME;
+ file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = SG(request_info).path_translated;
file_handle.free_filename = 0;
diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c
index 33cc78613b..a1bb15f527 100644
--- a/sapi/pi3web/pi3web_sapi.c
+++ b/sapi/pi3web/pi3web_sapi.c
@@ -355,9 +355,9 @@ static void hash_pi3web_variables(TSRMLS_D)
}
*colon = 0;
INIT_PZVAL(entry);
- Z_STRLEN_P(entry) = strlen(value);
- Z_STRVAL_P(entry) = estrndup(value, Z_STRLEN_P(entry));
- Z_TYPE_P(entry) = IS_STRING;
+ entry->value.str.len = strlen(value);
+ entry->value.str.val = estrndup(value, entry->value.str.len);
+ entry->type = IS_STRING;
zend_hash_add(&EG(symbol_table), variable, strlen(variable)+1, &entry, sizeof(zval *), NULL);
*colon = ':';
}
@@ -379,7 +379,7 @@ DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB)
zend_first_try {
file_handle.filename = lpCB->lpszFileName;
file_handle.free_filename = 0;
- Z_TYPE(file_handle) = ZEND_HANDLE_FILENAME;
+ file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.opened_path = NULL;
CG(extended_info) = 0;
diff --git a/sapi/roxen/roxen.c b/sapi/roxen/roxen.c
index 5e38ea5d0c..81f67c43d0 100644
--- a/sapi/roxen/roxen.c
+++ b/sapi/roxen/roxen.c
@@ -172,7 +172,7 @@ static INLINE struct svalue *lookup_header(char *headername)
sind = make_shared_string("env");
headers = low_mapping_string_lookup(REQUEST_DATA, sind);
free_string(sind);
- if(!headers || Z_TYPE_P(headers) != PIKE_T_MAPPING) return NULL;
+ if(!headers || headers->type != PIKE_T_MAPPING) return NULL;
sind = make_shared_string(headername);
value = low_mapping_string_lookup(headers->u.mapping, sind);
free_string(sind);
@@ -187,7 +187,7 @@ INLINE static char *lookup_string_header(char *headername, char *default_value)
{
struct svalue *head = NULL;
THREAD_SAFE_RUN(head = lookup_header(headername), "header lookup");
- if(!head || Z_TYPE_P(head) != PIKE_T_STRING)
+ if(!head || head->type != PIKE_T_STRING)
return default_value;
return head->u.string->str;
}
@@ -199,7 +199,7 @@ INLINE static int lookup_integer_header(char *headername, int default_value)
{
struct svalue *head = NULL;
THREAD_SAFE_RUN(head = lookup_header(headername), "header lookup");
- if(!head || Z_TYPE_P(head) != PIKE_T_INT)
+ if(!head || head->type != PIKE_T_INT)
return default_value;
return head->u.integer;
}
@@ -301,7 +301,7 @@ static void php_roxen_set_header(char *header_name, char *value, char *p)
if(!s_headermap)
{
struct svalue mappie;
- Z_TYPE(mappie) = PIKE_T_MAPPING;
+ mappie.type = PIKE_T_MAPPING;
headermap = allocate_mapping(1);
mappie.u.mapping = headermap;
mapping_string_insert(REQUEST_DATA, ind, &mappie);
@@ -309,7 +309,7 @@ static void php_roxen_set_header(char *header_name, char *value, char *p)
} else
headermap = s_headermap->u.mapping;
- Z_TYPE(hsval) = PIKE_T_STRING;
+ hsval.type = PIKE_T_STRING;
hsval.u.string = hval;
mapping_string_insert(headermap, hind, &hsval);
@@ -364,7 +364,7 @@ php_roxen_low_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
free_string(ind);
push_int(SG(sapi_headers).http_response_code);
- if(s_headermap && Z_TYPE_P(s_headermap) == PIKE_T_MAPPING)
+ if(s_headermap && s_headermap->type == PIKE_T_MAPPING)
ref_push_mapping(s_headermap->u.mapping);
else
push_int(0);
@@ -513,9 +513,9 @@ static sapi_module_struct roxen_sapi_module = {
*/
#define ADD_STRING(name) \
MAKE_STD_ZVAL(pval); \
- Z_TYPE_P(pval) = IS_STRING; \
- Z_STRLEN_P(pval) = strlen(buf); \
- Z_STRVAL_P(pval) = estrndup(buf, Z_STRLEN_P(pval)); \
+ pval->type = IS_STRING; \
+ pval->value.str.len = strlen(buf); \
+ pval->value.str.val = estrndup(buf, pval->value.str.len); \
zend_hash_update(&EG(symbol_table), name, sizeof(name), \
&pval, sizeof(zval *), NULL)
@@ -535,21 +535,21 @@ php_roxen_hash_environment(TSRMLS_D)
sind = make_shared_string("env");
headers = low_mapping_string_lookup(REQUEST_DATA, sind);
free_string(sind);
- if(headers && Z_TYPE_P(headers) == PIKE_T_MAPPING) {
+ if(headers && headers->type == PIKE_T_MAPPING) {
indices = mapping_indices(headers->u.mapping);
for(i = 0; i < indices->size; i++) {
ind = &indices->item[i];
val = low_mapping_lookup(headers->u.mapping, ind);
- if(ind && Z_TYPE_P(ind) == PIKE_T_STRING &&
- val && Z_TYPE_P(val) == PIKE_T_STRING) {
+ if(ind && ind->type == PIKE_T_STRING &&
+ val && val->type == PIKE_T_STRING) {
int buf_len;
buf_len = MIN(511, ind->u.string->len);
strncpy(buf, ind->u.string->str, buf_len);
buf[buf_len] = '\0'; /* Terminate correctly */
MAKE_STD_ZVAL(pval);
- Z_TYPE_P(pval) = IS_STRING;
- Z_STRLEN_P(pval) = val->u.string->len;
- Z_STRVAL_P(pval) = estrndup(val->u.string->str, Z_STRLEN_P(pval));
+ pval->type = IS_STRING;
+ pval->value.str.len = val->u.string->len;
+ pval->value.str.val = estrndup(val->u.string->str, pval->value.str.len);
zend_hash_update(&EG(symbol_table), buf, buf_len + 1, &pval, sizeof(zval *), NULL);
}
@@ -559,8 +559,8 @@ php_roxen_hash_environment(TSRMLS_D)
/*
MAKE_STD_ZVAL(pval);
- Z_TYPE_P(pval) = IS_LONG;
- Z_LVAL_P(pval) = Ns_InfoBootTime();
+ pval->type = IS_LONG;
+ pval->value.lval = Ns_InfoBootTime();
zend_hash_update(&EG(symbol_table), "SERVER_BOOTTIME", sizeof("SERVER_BOOTTIME"), &pval, sizeof(zval *), NULL);
*/
}
@@ -579,7 +579,7 @@ static int php_roxen_module_main(TSRMLS_D)
GET_THIS();
#endif
- Z_TYPE(file_handle) = ZEND_HANDLE_FILENAME;
+ file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = THIS->filename;
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
@@ -620,7 +620,7 @@ void f_php_roxen_request_handler(INT32 args)
"callback!");
get_all_args("PHP4.Interpreter->run", args, "%S%m%O%*", &script,
&request_data, &my_fd_obj, &done_callback);
- if(Z_TYPE_P(done_callback) != PIKE_T_FUNCTION)
+ if(done_callback->type != PIKE_T_FUNCTION)
error("PHP4.Interpreter->run: Bad argument 4, expected function.\n");
PHP_LOCK(THIS); /* Need to lock here or reusing the same object might cause
* problems in changing stuff in that object */
@@ -653,7 +653,7 @@ void f_php_roxen_request_handler(INT32 args)
ind = make_shared_binary_string("my_fd", 5);
raw_fd = low_mapping_string_lookup(THIS->request_data, ind);
- if(raw_fd && Z_TYPE_P(raw_fd) == PIKE_T_OBJECT)
+ if(raw_fd && raw_fd->type == PIKE_T_OBJECT)
{
int fd = fd_from_object(raw_fd->u.object);
if(fd == -1)
diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c
index 8226194f99..ddb531a644 100644
--- a/sapi/thttpd/thttpd.c
+++ b/sapi/thttpd/thttpd.c
@@ -253,7 +253,7 @@ static void thttpd_module_main(TSRMLS_D)
{
zend_file_handle file_handle;
- Z_TYPE(file_handle) = ZEND_HANDLE_FILENAME;
+ file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = SG(request_info).path_translated;
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c
index 8aa9e51a1f..48fb84c86e 100644
--- a/sapi/tux/php_tux.c
+++ b/sapi/tux/php_tux.c
@@ -275,7 +275,7 @@ static void tux_module_main(TSRMLS_D)
{
zend_file_handle file_handle;
- Z_TYPE(file_handle) = ZEND_HANDLE_FILENAME;
+ file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = SG(request_info).path_translated;
file_handle.free_filename = 0;
file_handle.opened_path = NULL;