summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorJeroen van Wolffelaar <jeroen@php.net>2001-09-25 21:58:48 +0000
committerJeroen van Wolffelaar <jeroen@php.net>2001-09-25 21:58:48 +0000
commitc03328857394bef36ffa9678d33079ad96e4a4e4 (patch)
treec0fb250db3b1bb996fc305bf56c2b74eb6d00935 /sapi
parent158d34c9a57816326e141e88e1409d9f377dc2ea (diff)
downloadphp-git-c03328857394bef36ffa9678d33079ad96e4a4e4.tar.gz
Back-substitute for Z_* macro's. If it breaks some extension (the script isn't optimal, it parses for example var->zval.value incorrect) please let me know.
Diffstat (limited to 'sapi')
-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
15 files changed, 69 insertions, 69 deletions
diff --git a/sapi/aolserver/aolserver.c b/sapi/aolserver/aolserver.c
index 7fb350e4f5..2178b98453 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;
- file_handle.type = ZEND_HANDLE_FILENAME;
+ Z_TYPE(file_handle) = 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 3a248c0ebb..e9d39c86c4 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 = track_vars_array->value.ht;
+ symbol_table = Z_ARRVAL_P(track_vars_array);
} 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, per_dir_entry->type, 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, Z_TYPE_P(per_dir_entry), 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;
- fh.type = ZEND_HANDLE_FILENAME;
+ Z_TYPE(fh) = 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 (new_per_dir_entry->type==PHP_INI_SYSTEM
- && orig_per_dir_entry->type!=PHP_INI_SYSTEM) {
+ if (Z_TYPE_P(new_per_dir_entry)==PHP_INI_SYSTEM
+ && Z_TYPE_P(orig_per_dir_entry)!=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);
}
- per_dir_entry.type = mode;
+ Z_TYPE(per_dir_entry) = mode;
if (strcasecmp(arg2, "none") == 0) {
arg2 = "";
diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c
index 8cff77e6c4..9274ad2bc6 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, (*arg_name)->value.str.val);
+ note_val = (char *) table_get(((request_rec *)SG(server_context))->notes, Z_STRVAL_PP(arg_name));
if (arg_count == 2) {
convert_to_string_ex(arg_val);
- table_set(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val, (*arg_val)->value.str.val);
+ table_set(((request_rec *)SG(server_context))->notes, Z_STRVAL_PP(arg_name), Z_STRVAL_PP(arg_val));
}
if (note_val) {
@@ -307,14 +307,14 @@ PHP_FUNCTION(virtual)
}
convert_to_string_ex(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 = 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) destroy_sub_req (rr);
RETURN_FALSE;
}
if (rr->status != 200) {
- php_error(E_WARNING, "Unable to include '%s' - error finding URI", (*filename)->value.str.val);
+ php_error(E_WARNING, "Unable to include '%s' - error finding URI", Z_STRVAL_PP(filename));
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", (*filename)->value.str.val);
+ php_error(E_WARNING, "Unable to include '%s' - request execution failed", Z_STRVAL_PP(filename));
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((*filename)->value.str.val, ((request_rec *) SG(server_context))))) {
- php_error(E_WARNING, "URI lookup failed", (*filename)->value.str.val);
+ 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));
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((*filename)->value.str.val, ((request_rec *) SG(server_context))))) {
- php_error(E_WARNING, "URI lookup failed", (*filename)->value.str.val);
+ 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));
RETURN_FALSE;
}
RETVAL_LONG(ap_run_sub_req(rr));
diff --git a/sapi/apache/sapi_apache.c b/sapi/apache/sapi_apache.c
index 30dff99c76..b62773e25a 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 {
- file_handle.type = ZEND_HANDLE_FILENAME;
+ Z_TYPE(file_handle) = 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 5dbb8947ff..b3b6cd17ff 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);
- zfd.type = ZEND_HANDLE_FILENAME;
+ Z_TYPE(zfd) = 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 962b9acc92..6f6659508f 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 || headers->type != PIKE_T_MAPPING) return NULL;
+ if(!headers || Z_TYPE_P(headers) != 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 || head->type != PIKE_T_STRING)
+ if(!head || Z_TYPE_P(head) != 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 || head->type != PIKE_T_INT)
+ if(!head || Z_TYPE_P(head) != 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 || s_headermap->type != PIKE_T_MAPPING)
+ if(!s_headermap || Z_TYPE_P(s_headermap) != PIKE_T_MAPPING)
{
struct svalue mappie;
- mappie.type = PIKE_T_MAPPING;
+ Z_TYPE(mappie) = 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 &&
- soldval->type == PIKE_T_STRING &&
+ Z_TYPE_P(soldval) == 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);
}
}
- hsval.type = PIKE_T_STRING;
+ Z_TYPE(hsval) = 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 && s_headermap->type == PIKE_T_MAPPING)
+ if(s_headermap && Z_TYPE_P(s_headermap) == 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 && headers->type == PIKE_T_MAPPING) {
+ if(headers && Z_TYPE_P(headers) == 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 && ind->type == PIKE_T_STRING &&
- val && val->type == PIKE_T_STRING) {
+ if(ind && Z_TYPE_P(ind) == PIKE_T_STRING &&
+ val && Z_TYPE_P(val) == 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);
- 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);
+ 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));
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);
- pval->type = IS_LONG;
- pval->value.lval = Ns_InfoBootTime();
+ Z_TYPE_P(pval) = IS_LONG;
+ Z_LVAL_P(pval) = 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
- file_handle.type = ZEND_HANDLE_FILENAME;
+ Z_TYPE(file_handle) = 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(done_callback->type != PIKE_T_FUNCTION)
+ if(Z_TYPE_P(done_callback) != 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 && raw_fd->type == PIKE_T_OBJECT)
+ if(raw_fd && Z_TYPE_P(raw_fd) == 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 5c71db425c..64a664184e 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 = "-";
- file_handle.type = ZEND_HANDLE_FP;
+ Z_TYPE(file_handle) = 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 80b5c3c204..901b59bb9b 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;
- file_handle.type = ZEND_HANDLE_FILENAME;
+ Z_TYPE(file_handle) = 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 6256d7f93b..db69ac4d93 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
- file_handle.type = ZEND_HANDLE_FILENAME;
+ Z_TYPE(file_handle) = 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 71d8c7ec28..c076fa711b 100644
--- a/sapi/nsapi/nsapi.c
+++ b/sapi/nsapi/nsapi.c
@@ -449,7 +449,7 @@ nsapi_module_main(NSLS_D TSRMLS_DC)
return FAILURE;
}
- file_handle.type = ZEND_HANDLE_FILENAME;
+ Z_TYPE(file_handle) = 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 dcd94a38e9..f7d46da7ce 100644
--- a/sapi/phttpd/phttpd.c
+++ b/sapi/phttpd/phttpd.c
@@ -259,7 +259,7 @@ int php_doit(TSRMLS_D TSRMLS_DC)
return -1;
}
- file_handle.type = ZEND_HANDLE_FILENAME;
+ Z_TYPE(file_handle) = 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 a1bb15f527..33cc78613b 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);
- entry->value.str.len = strlen(value);
- entry->value.str.val = estrndup(value, entry->value.str.len);
- entry->type = IS_STRING;
+ Z_STRLEN_P(entry) = strlen(value);
+ Z_STRVAL_P(entry) = estrndup(value, Z_STRLEN_P(entry));
+ Z_TYPE_P(entry) = 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;
- file_handle.type = ZEND_HANDLE_FILENAME;
+ Z_TYPE(file_handle) = 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 81f67c43d0..5e38ea5d0c 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 || headers->type != PIKE_T_MAPPING) return NULL;
+ if(!headers || Z_TYPE_P(headers) != 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 || head->type != PIKE_T_STRING)
+ if(!head || Z_TYPE_P(head) != 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 || head->type != PIKE_T_INT)
+ if(!head || Z_TYPE_P(head) != 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;
- mappie.type = PIKE_T_MAPPING;
+ Z_TYPE(mappie) = 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;
- hsval.type = PIKE_T_STRING;
+ Z_TYPE(hsval) = 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 && s_headermap->type == PIKE_T_MAPPING)
+ if(s_headermap && Z_TYPE_P(s_headermap) == 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); \
- pval->type = IS_STRING; \
- pval->value.str.len = strlen(buf); \
- pval->value.str.val = estrndup(buf, pval->value.str.len); \
+ Z_TYPE_P(pval) = IS_STRING; \
+ Z_STRLEN_P(pval) = strlen(buf); \
+ Z_STRVAL_P(pval) = estrndup(buf, Z_STRLEN_P(pval)); \
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 && headers->type == PIKE_T_MAPPING) {
+ if(headers && Z_TYPE_P(headers) == 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 && ind->type == PIKE_T_STRING &&
- val && val->type == PIKE_T_STRING) {
+ if(ind && Z_TYPE_P(ind) == PIKE_T_STRING &&
+ val && Z_TYPE_P(val) == 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);
- 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);
+ 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));
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);
- pval->type = IS_LONG;
- pval->value.lval = Ns_InfoBootTime();
+ Z_TYPE_P(pval) = IS_LONG;
+ Z_LVAL_P(pval) = 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
- file_handle.type = ZEND_HANDLE_FILENAME;
+ Z_TYPE(file_handle) = 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(done_callback->type != PIKE_T_FUNCTION)
+ if(Z_TYPE_P(done_callback) != 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 && raw_fd->type == PIKE_T_OBJECT)
+ if(raw_fd && Z_TYPE_P(raw_fd) == 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 ddb531a644..8226194f99 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;
- file_handle.type = ZEND_HANDLE_FILENAME;
+ Z_TYPE(file_handle) = 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 48fb84c86e..8aa9e51a1f 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;
- file_handle.type = ZEND_HANDLE_FILENAME;
+ Z_TYPE(file_handle) = ZEND_HANDLE_FILENAME;
file_handle.filename = SG(request_info).path_translated;
file_handle.free_filename = 0;
file_handle.opened_path = NULL;