diff options
Diffstat (limited to 'ext/rpc')
| -rw-r--r-- | ext/rpc/com/com_wrapper.c | 12 | ||||
| -rw-r--r-- | ext/rpc/com/conversion.c | 6 | ||||
| -rw-r--r-- | ext/rpc/com/variant.c | 6 | ||||
| -rw-r--r-- | ext/rpc/java/java.c | 90 | ||||
| -rw-r--r-- | ext/rpc/xmlrpc/xmlrpc-epi-php.c | 220 |
5 files changed, 167 insertions, 167 deletions
diff --git a/ext/rpc/com/com_wrapper.c b/ext/rpc/com/com_wrapper.c index e67084523b..93f296280d 100644 --- a/ext/rpc/com/com_wrapper.c +++ b/ext/rpc/com/com_wrapper.c @@ -433,7 +433,7 @@ PHP_INI_ENTRY_EX("com.allow_dcom", "0", PHP_INI_SYSTEM, NULL, php_ini_boolean_di PHP_INI_ENTRY_EX("com.autoregister_typelib", "0", PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb) PHP_INI_ENTRY_EX("com.autoregister_verbose", "0", PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb) PHP_INI_ENTRY_EX("com.autoregister_casesensitive", "1", PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb) -PHP_INI_ENTRY("com.typelib_file", "", PHP_INI_SYSTEM, OnTypelibFileChange) +PHP_INI_ENTRY("Z_TYPE(com)lib_file", "", PHP_INI_SYSTEM, OnTypelibFileChange) PHP_INI_END() @@ -467,7 +467,7 @@ PHP_FUNCTION(com_load) zend_get_parameters(ht, 3, &module_name, &server_name, &code_page); convert_to_long_ex(&code_page); - codepage = code_page->value.lval; + codepage = Z_LVAL_P(code_page); break; case 4: @@ -1123,7 +1123,7 @@ PHP_FUNCTION(com_load_typelib) case 2: zend_get_parameters(ht, 2, &arg_typelib, &arg_cis); convert_to_boolean_ex(&arg_cis); - if (arg_cis->value.lval) { + if (Z_LVAL_P(arg_cis)) { mode &= ~CONST_CS; } break; @@ -1171,7 +1171,7 @@ PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_refer for (element=property_reference->elements_list->head; element; element=element->next) { overloaded_property = (zend_overloaded_element *) element->data; - switch (overloaded_property->type) { + switch (Z_TYPE_P(overloaded_property)) { case OE_IS_ARRAY: if (do_COM_offget(var_result, obj, &overloaded_property->element, FALSE TSRMLS_CC) == FAILURE) { FREE_VARIANT(var_result); @@ -1261,7 +1261,7 @@ PHPAPI int php_COM_set_property_handler(zend_property_reference *property_refere for (element=property_reference->elements_list->head; element != property_reference->elements_list->tail; element=element->next) { overloaded_property = (zend_overloaded_element *) element->data; - switch (overloaded_property->type) { + switch (Z_TYPE_P(overloaded_property)) { case OE_IS_ARRAY: if (do_COM_offget(var_result, obj, &overloaded_property->element, FALSE TSRMLS_CC) == FAILURE) { FREE_VARIANT(var_result); @@ -1347,7 +1347,7 @@ PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_pro } property = php_COM_get_property_handler(property_reference); - if (property.type == IS_NULL) { + if (Z_TYPE(property) == IS_NULL) { if (property.refcount == 1) { pval_destructor(&property); } diff --git a/ext/rpc/com/conversion.c b/ext/rpc/com/conversion.c index ea5cde6188..8449e41461 100644 --- a/ext/rpc/com/conversion.c +++ b/ext/rpc/com/conversion.c @@ -199,7 +199,7 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type, SYSTEMTIME wintime; struct tm *phptime; - phptime = gmtime(&(pval_arg->value.lval)); + phptime = gmtime(&(Z_LVAL_P(pval_arg))); memset(&wintime, 0, sizeof(wintime)); wintime.wYear = phptime->tm_year + 1900; @@ -288,14 +288,14 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type, case VT_CY|VT_BYREF: convert_to_double_ex(&pval_arg); - VarCyFromR8(pval_arg->value.dval, var_arg->pcyVal); + VarCyFromR8(Z_DVAL_P(pval_arg), var_arg->pcyVal); break; case VT_DATE|VT_BYREF: { SYSTEMTIME wintime; struct tm *phptime; - phptime = gmtime(&(pval_arg->value.lval)); + phptime = gmtime(&(Z_LVAL_P(pval_arg))); memset(&wintime, 0, sizeof(wintime)); wintime.wYear = phptime->tm_year + 1900; diff --git a/ext/rpc/com/variant.c b/ext/rpc/com/variant.c index 4f521cdd4c..80b48550e6 100644 --- a/ext/rpc/com/variant.c +++ b/ext/rpc/com/variant.c @@ -133,7 +133,7 @@ static void php_VARIANT_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend zend_get_parameters(ht, 3, &data, &type, &code_page); php_pval_to_variant_ex(data, pVar, type, codepage TSRMLS_CC); convert_to_long(code_page); - codepage = code_page->value.lval; + codepage = Z_LVAL_P(code_page); break; default: ZEND_WRONG_PARAM_COUNT(); @@ -174,13 +174,13 @@ static pval php_VARIANT_get_property_handler(zend_property_reference *property_r ZVAL_FALSE(&result); } else { overloaded_property = (zend_overloaded_element *) property_reference->elements_list->head->data; - switch (overloaded_property->type) { + switch (Z_TYPE_P(overloaded_property)) { case OE_IS_ARRAY: ZVAL_FALSE(&result); break; case OE_IS_OBJECT: - if (!strcmp(overloaded_property->element.value.str.val, "value")) { + if (!strcmp(overloaded_property->Z_STRVAL(element), "value")) { php_variant_to_pval(var_arg, &result, codepage TSRMLS_CC); } else if (!strcmp(Z_STRVAL(overloaded_property->element), "type")) { ZVAL_LONG(&result, V_VT(var_arg)) diff --git a/ext/rpc/java/java.c b/ext/rpc/java/java.c index 9d8a9ad2e9..0780c4b7b7 100644 --- a/ext/rpc/java/java.c +++ b/ext/rpc/java/java.c @@ -280,37 +280,37 @@ static jobject _java_makeObject(pval* arg TSRMLS_DC) jmethodID makeArg; jclass hashClass; - switch (arg->type) { + switch (Z_TYPE_P(arg)) { case IS_STRING: - result=(*jenv)->NewByteArray(jenv, arg->value.str.len); + result=(*jenv)->NewByteArray(jenv, Z_STRLEN_P(arg)); (*jenv)->SetByteArrayRegion(jenv, (jbyteArray)result, 0, - arg->value.str.len, arg->value.str.val); + Z_STRLEN_P(arg), Z_STRVAL_P(arg)); break; case IS_OBJECT: zend_hash_index_find(Z_OBJPROP_P(arg), 0, (void*)&handle); - result = zend_list_find((*handle)->value.lval, &type); + result = zend_list_find(Z_LVAL_PP(handle), &type); break; case IS_BOOL: makeArg = (*jenv)->GetMethodID(jenv, JG(reflect_class), "MakeArg", "(Z)Ljava/lang/Object;"); result = (*jenv)->CallObjectMethod(jenv, JG(php_reflect), makeArg, - (jboolean)(arg->value.lval)); + (jboolean)(Z_LVAL_P(arg))); break; case IS_LONG: makeArg = (*jenv)->GetMethodID(jenv, JG(reflect_class), "MakeArg", "(J)Ljava/lang/Object;"); result = (*jenv)->CallObjectMethod(jenv, JG(php_reflect), makeArg, - (jlong)(arg->value.lval)); + (jlong)(Z_LVAL_P(arg))); break; case IS_DOUBLE: makeArg = (*jenv)->GetMethodID(jenv, JG(reflect_class), "MakeArg", "(D)Ljava/lang/Object;"); result = (*jenv)->CallObjectMethod(jenv, JG(php_reflect), makeArg, - (jdouble)(arg->value.dval)); + (jdouble)(Z_DVAL_P(arg))); break; case IS_ARRAY: @@ -331,28 +331,28 @@ static jobject _java_makeObject(pval* arg TSRMLS_DC) "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); /* Iterate through hash */ - zend_hash_internal_pointer_reset(arg->value.ht); - while(zend_hash_get_current_data(arg->value.ht, (void**)&value) == SUCCESS) { + zend_hash_internal_pointer_reset(Z_ARRVAL_P(arg)); + while(zend_hash_get_current_data(Z_ARRVAL_P(arg), (void**)&value) == SUCCESS) { jval = _java_makeObject(*value TSRMLS_CC); - switch (zend_hash_get_current_key(arg->value.ht, &string_key, &num_key, 0)) { + switch (zend_hash_get_current_key(Z_ARRVAL_P(arg), &string_key, &num_key, 0)) { case HASH_KEY_IS_STRING: - key.type = IS_STRING; - key.value.str.val = string_key; - key.value.str.len = strlen(string_key); + Z_TYPE(key) = IS_STRING; + Z_STRVAL(key) = string_key; + Z_STRLEN(key) = strlen(string_key); jkey = _java_makeObject(&key TSRMLS_CC); break; case HASH_KEY_IS_LONG: - key.type = IS_LONG; - key.value.lval = num_key; + Z_TYPE(key) = IS_LONG; + Z_LVAL(key) = num_key; jkey = _java_makeObject(&key TSRMLS_CC); break; default: /* HASH_KEY_NON_EXISTANT */ jkey = 0; } jold = (*jenv)->CallObjectMethod(jenv, result, put, jkey, jval); - if ((*value)->type != IS_OBJECT) (*jenv)->DeleteLocalRef(jenv, jval); - zend_hash_move_forward(arg->value.ht); + if (Z_TYPE_PP(value) != IS_OBJECT) (*jenv)->DeleteLocalRef(jenv, jval); + zend_hash_move_forward(Z_ARRVAL_P(arg)); } break; @@ -379,7 +379,7 @@ static jobjectArray _java_makeArray(int argc, pval** argv TSRMLS_DC) for (i=0; i<argc; i++) { arg = _java_makeObject(argv[i] TSRMLS_CC); (*jenv)->SetObjectArrayElement(jenv, result, i, arg); - if (argv[i]->type != IS_OBJECT) (*jenv)->DeleteLocalRef(jenv, arg); + if (Z_TYPE_P(argv[i]) != IS_OBJECT) (*jenv)->DeleteLocalRef(jenv, arg); } return result; } @@ -387,9 +387,9 @@ static jobjectArray _java_makeArray(int argc, pval** argv TSRMLS_DC) static int checkError(pval *value) { - if (value->type == IS_EXCEPTION) { - php_error(E_WARNING, "%s", value->value.str.val); - efree(value->value.str.val); + if (Z_TYPE_P(value) == IS_EXCEPTION) { + php_error(E_WARNING, "%s", Z_STRVAL_P(value)); + efree(Z_STRVAL_P(value)); ZVAL_FALSE(value); return 1; }; @@ -422,7 +422,7 @@ void java_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_refe if (!JG(jenv)) return; jenv = JG(jenv); - if (!strcmp("java", function_name->element.value.str.val)) { + if (!strcmp("java", function_name->Z_STRVAL(element))) { /* construct a Java object: First argument is the class name. Any additional arguments will @@ -456,8 +456,8 @@ void java_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_refe jmethodID invoke = (*jenv)->GetMethodID(jenv, JG(reflect_class), "Invoke", "(Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;J)V"); zend_hash_index_find(Z_OBJPROP_P(object), 0, (void**) &handle); - obj = zend_list_find((*handle)->value.lval, &type); - method = (*jenv)->NewStringUTF(jenv, function_name->element.value.str.val); + obj = zend_list_find(Z_LVAL_PP(handle), &type); + method = (*jenv)->NewStringUTF(jenv, function_name->Z_STRVAL(element)); result = (jlong)(long)return_value; (*jenv)->CallVoidMethod(jenv, JG(php_reflect), invoke, @@ -526,14 +526,14 @@ static pval _java_getset_property JNIEnv *jenv; jenv = JG(jenv); - propName = (*jenv)->NewStringUTF(jenv, property->element.value.str.val); + propName = (*jenv)->NewStringUTF(jenv, property->Z_STRVAL(element)); /* get the object */ zend_hash_index_find(Z_OBJPROP_P(property_reference->object), 0, (void **) &pobject); - obj = zend_list_find((*pobject)->value.lval, &type); + obj = zend_list_find(Z_LVAL_PP(pobject), &type); result = (jlong)(long) &presult; - presult.type = IS_NULL; + Z_TYPE(presult) = IS_NULL; if (!obj || (type!=le_jobject)) { php_error(E_ERROR, @@ -651,11 +651,11 @@ JNIEXPORT void JNICALL Java_net_php_reflect_setResultFromString jboolean isCopy; jbyte *value = (*jenv)->GetByteArrayElements(jenv, jvalue, &isCopy); pval *presult = (pval*)(long)result; - presult->type=IS_STRING; - presult->value.str.len=(*jenv)->GetArrayLength(jenv, jvalue); - presult->value.str.val=emalloc(presult->value.str.len+1); - memcpy(presult->value.str.val, value, presult->value.str.len); - presult->value.str.val[presult->value.str.len]=0; + Z_TYPE_P(presult)=IS_STRING; + Z_STRLEN_P(presult)=(*jenv)->GetArrayLength(jenv, jvalue); + Z_STRVAL_P(presult)=emalloc(Z_STRLEN_P(presult)+1); + memcpy(Z_STRVAL_P(presult), value, Z_STRLEN_P(presult)); + Z_STRVAL_P(presult)[Z_STRLEN_P(presult)]=0; if (isCopy) (*jenv)->ReleaseByteArrayElements(jenv, jvalue, value, 0); } @@ -663,24 +663,24 @@ JNIEXPORT void JNICALL Java_net_php_reflect_setResultFromLong (JNIEnv *jenv, jclass self, jlong result, jlong value) { pval *presult = (pval*)(long)result; - presult->type=IS_LONG; - presult->value.lval=(long)value; + Z_TYPE_P(presult)=IS_LONG; + Z_LVAL_P(presult)=(long)value; } JNIEXPORT void JNICALL Java_net_php_reflect_setResultFromDouble (JNIEnv *jenv, jclass self, jlong result, jdouble value) { pval *presult = (pval*)(long)result; - presult->type=IS_DOUBLE; - presult->value.dval=value; + Z_TYPE_P(presult)=IS_DOUBLE; + Z_DVAL_P(presult)=value; } JNIEXPORT void JNICALL Java_net_php_reflect_setResultFromBoolean (JNIEnv *jenv, jclass self, jlong result, jboolean value) { pval *presult = (pval*)(long)result; - presult->type=IS_BOOL; - presult->value.lval=value; + Z_TYPE_P(presult)=IS_BOOL; + Z_LVAL_P(presult)=value; } JNIEXPORT void JNICALL Java_net_php_reflect_setResultFromObject @@ -691,15 +691,15 @@ JNIEXPORT void JNICALL Java_net_php_reflect_setResultFromObject pval *handle; TSRMLS_FETCH(); - if (presult->type != IS_OBJECT) { + if (Z_TYPE_P(presult) != IS_OBJECT) { object_init_ex(presult, &java_class_entry); presult->is_ref=1; presult->refcount=1; } ALLOC_ZVAL(handle); - handle->type = IS_LONG; - handle->value.lval = + Z_TYPE_P(handle) = IS_LONG; + Z_LVAL_P(handle) = zend_list_insert((*jenv)->NewGlobalRef(jenv, value), le_jobject); pval_copy_constructor(handle); INIT_PZVAL(handle); @@ -718,7 +718,7 @@ JNIEXPORT jlong JNICALL Java_net_php_reflect_nextElement pval *result; pval *handle = (pval*)(long)array; ALLOC_ZVAL(result); - zend_hash_next_index_insert(handle->value.ht, &result, sizeof(zval *), NULL); + zend_hash_next_index_insert(Z_ARRVAL_P(handle), &result, sizeof(zval *), NULL); return (jlong)(long)result; } @@ -728,7 +728,7 @@ JNIEXPORT jlong JNICALL Java_net_php_reflect_hashIndexUpdate pval *result; pval *handle = (pval*)(long)array; ALLOC_ZVAL(result); - zend_hash_index_update(handle->value.ht, (unsigned long)key, + zend_hash_index_update(Z_ARRVAL_P(handle), (unsigned long)key, &result, sizeof(zval *), NULL); return (jlong)(long)result; } @@ -741,7 +741,7 @@ JNIEXPORT jlong JNICALL Java_net_php_reflect_hashUpdate pval *handle = (pval*)(long)array; ALLOC_ZVAL(result); Java_net_php_reflect_setResultFromString(jenv, self, (jlong)(long)&pkey, key); - zend_hash_update(handle->value.ht, pkey.value.str.val, pkey.value.str.len+1, + zend_hash_update(Z_ARRVAL_P(handle), Z_STRVAL(pkey), Z_STRLEN(pkey)+1, &result, sizeof(zval *), NULL); return (jlong)(long)result; } @@ -751,7 +751,7 @@ JNIEXPORT void JNICALL Java_net_php_reflect_setException { pval *presult = (pval*)(long)result; Java_net_php_reflect_setResultFromString(jenv, self, result, value); - presult->type=IS_EXCEPTION; + Z_TYPE_P(presult)=IS_EXCEPTION; } JNIEXPORT void JNICALL Java_net_php_reflect_setEnv diff --git a/ext/rpc/xmlrpc/xmlrpc-epi-php.c b/ext/rpc/xmlrpc/xmlrpc-epi-php.c index 589adaad05..21d6c05e30 100644 --- a/ext/rpc/xmlrpc/xmlrpc-epi-php.c +++ b/ext/rpc/xmlrpc/xmlrpc-epi-php.c @@ -281,8 +281,8 @@ static int add_stringl(pval* list, char* id, char* string, uint length, int dupl static int add_pval(pval* list, const char* id, pval** val) { if(list && val) { - if(id) return zend_hash_update(list->value.ht, (char*)id, strlen(id)+1, (void *) val, sizeof(pval **), NULL); - else return zend_hash_next_index_insert(list->value.ht, (void *) val, sizeof(pval **), NULL); + if(id) return zend_hash_update(Z_ARRVAL_P(list), (char*)id, strlen(id)+1, (void *) val, sizeof(pval **), NULL); + else return zend_hash_next_index_insert(Z_ARRVAL_P(list), (void *) val, sizeof(pval **), NULL); } } @@ -311,85 +311,85 @@ static void set_output_options(php_output_options* options, pval* output_opts) { options->xmlrpc_out.xml_elem_opts.verbosity = xml_elem_pretty; options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_markup_escaping | xml_elem_non_ascii_escaping | xml_elem_non_print_escaping; - if(output_opts && output_opts->type == IS_ARRAY) { + if(output_opts && Z_TYPE_P(output_opts) == IS_ARRAY) { pval** val; /* verbosity of generated xml */ - if(zend_hash_find(output_opts->value.ht, + if(zend_hash_find(Z_ARRVAL_P(output_opts), OUTPUT_TYPE_KEY, OUTPUT_TYPE_KEY_LEN + 1, (void**)&val) == SUCCESS) { - if((*val)->type == IS_STRING) { - if(!strcmp((*val)->value.str.val, OUTPUT_TYPE_VALUE_PHP)) { + if(Z_TYPE_PP(val) == IS_STRING) { + if(!strcmp(Z_STRVAL_PP(val), OUTPUT_TYPE_VALUE_PHP)) { options->b_php_out = 1; } - else if(!strcmp((*val)->value.str.val, OUTPUT_TYPE_VALUE_XML)) { + else if(!strcmp(Z_STRVAL_PP(val), OUTPUT_TYPE_VALUE_XML)) { options->b_php_out = 0; } } } /* verbosity of generated xml */ - if(zend_hash_find(output_opts->value.ht, + if(zend_hash_find(Z_ARRVAL_P(output_opts), VERBOSITY_KEY, VERBOSITY_KEY_LEN + 1, (void**)&val) == SUCCESS) { - if((*val)->type == IS_STRING) { - if(!strcmp((*val)->value.str.val, VERBOSITY_VALUE_NO_WHITE_SPACE)) { + if(Z_TYPE_PP(val) == IS_STRING) { + if(!strcmp(Z_STRVAL_PP(val), VERBOSITY_VALUE_NO_WHITE_SPACE)) { options->xmlrpc_out.xml_elem_opts.verbosity = xml_elem_no_white_space; } - else if(!strcmp((*val)->value.str.val, VERBOSITY_VALUE_NEWLINES_ONLY)) { + else if(!strcmp(Z_STRVAL_PP(val), VERBOSITY_VALUE_NEWLINES_ONLY)) { options->xmlrpc_out.xml_elem_opts.verbosity = xml_elem_newlines_only; } - else if(!strcmp((*val)->value.str.val, VERBOSITY_VALUE_PRETTY)) { + else if(!strcmp(Z_STRVAL_PP(val), VERBOSITY_VALUE_PRETTY)) { options->xmlrpc_out.xml_elem_opts.verbosity = xml_elem_pretty; } } } /* version of xml to output */ - if(zend_hash_find(output_opts->value.ht, + if(zend_hash_find(Z_ARRVAL_P(output_opts), VERSION_KEY, VERSION_KEY_LEN + 1, (void**)&val) == SUCCESS) { - if((*val)->type == IS_STRING) { - if(!strcmp((*val)->value.str.val, VERSION_VALUE_XMLRPC)) { + if(Z_TYPE_PP(val) == IS_STRING) { + if(!strcmp(Z_STRVAL_PP(val), VERSION_VALUE_XMLRPC)) { options->xmlrpc_out.version = xmlrpc_version_1_0; } - else if(!strcmp((*val)->value.str.val, VERSION_VALUE_SIMPLE)) { + else if(!strcmp(Z_STRVAL_PP(val), VERSION_VALUE_SIMPLE)) { options->xmlrpc_out.version = xmlrpc_version_simple; } } } /* encoding code set */ - if(zend_hash_find(output_opts->value.ht, + if(zend_hash_find(Z_ARRVAL_P(output_opts), ENCODING_KEY, ENCODING_KEY_LEN + 1, (void**)&val) == SUCCESS) { - if((*val)->type == IS_STRING) { - options->xmlrpc_out.xml_elem_opts.encoding = estrdup((*val)->value.str.val); + if(Z_TYPE_PP(val) == IS_STRING) { + options->xmlrpc_out.xml_elem_opts.encoding = estrdup(Z_STRVAL_PP(val)); } } /* escaping options */ - if(zend_hash_find(output_opts->value.ht, + if(zend_hash_find(Z_ARRVAL_P(output_opts), ESCAPING_KEY, ESCAPING_KEY_LEN + 1, (void**)&val) == SUCCESS) { /* multiple values allowed. check if array */ - if((*val)->type == IS_ARRAY) { + if(Z_TYPE_PP(val) == IS_ARRAY) { pval** iter_val; - zend_hash_internal_pointer_reset((*val)->value.ht); + zend_hash_internal_pointer_reset(Z_ARRVAL_PP(val)); options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_no_escaping; while(1) { - if(zend_hash_get_current_data((*val)->value.ht, (void**)&iter_val) == SUCCESS) { - if((*iter_val)->type == IS_STRING && (*iter_val)->value.str.val) { - if(!strcmp((*iter_val)->value.str.val, ESCAPING_VALUE_CDATA)) { + if(zend_hash_get_current_data(Z_ARRVAL_PP(val), (void**)&iter_val) == SUCCESS) { + if(Z_TYPE_PP(iter_val) == IS_STRING && Z_STRVAL_PP(iter_val)) { + if(!strcmp(Z_STRVAL_PP(iter_val), ESCAPING_VALUE_CDATA)) { options->xmlrpc_out.xml_elem_opts.escaping |= xml_elem_cdata_escaping; } - else if(!strcmp((*iter_val)->value.str.val, ESCAPING_VALUE_NON_ASCII)) { + else if(!strcmp(Z_STRVAL_PP(iter_val), ESCAPING_VALUE_NON_ASCII)) { options->xmlrpc_out.xml_elem_opts.escaping |= xml_elem_non_ascii_escaping; } - else if(!strcmp((*iter_val)->value.str.val, ESCAPING_VALUE_NON_PRINT)) { + else if(!strcmp(Z_STRVAL_PP(iter_val), ESCAPING_VALUE_NON_PRINT)) { options->xmlrpc_out.xml_elem_opts.escaping |= xml_elem_non_print_escaping; } - else if(!strcmp((*iter_val)->value.str.val, ESCAPING_VALUE_MARKUP)) { + else if(!strcmp(Z_STRVAL_PP(iter_val), ESCAPING_VALUE_MARKUP)) { options->xmlrpc_out.xml_elem_opts.escaping |= xml_elem_markup_escaping; } } @@ -398,21 +398,21 @@ static void set_output_options(php_output_options* options, pval* output_opts) { break; } - zend_hash_move_forward((*val)->value.ht); + zend_hash_move_forward(Z_ARRVAL_PP(val)); } } /* else, check for single value */ - else if((*val)->type == IS_STRING) { - if(!strcmp((*val)->value.str.val, ESCAPING_VALUE_CDATA)) { + else if(Z_TYPE_PP(val) == IS_STRING) { + if(!strcmp(Z_STRVAL_PP(val), ESCAPING_VALUE_CDATA)) { options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_cdata_escaping; } - else if(!strcmp((*val)->value.str.val, ESCAPING_VALUE_NON_ASCII)) { + else if(!strcmp(Z_STRVAL_PP(val), ESCAPING_VALUE_NON_ASCII)) { options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_non_ascii_escaping; } - else if(!strcmp((*val)->value.str.val, ESCAPING_VALUE_NON_PRINT)) { + else if(!strcmp(Z_STRVAL_PP(val), ESCAPING_VALUE_NON_PRINT)) { options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_non_print_escaping; } - else if(!strcmp((*val)->value.str.val, ESCAPING_VALUE_MARKUP)) { + else if(!strcmp(Z_STRVAL_PP(val), ESCAPING_VALUE_MARKUP)) { options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_markup_escaping; } } @@ -471,32 +471,32 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker(const char* key, pval* in_val, int dept if(val) { switch(type) { case xmlrpc_base64: - if(val->type == IS_NULL) { + if(Z_TYPE_P(val) == IS_NULL) { xReturn = XMLRPC_CreateValueBase64(key, "", 1); } else { - xReturn = XMLRPC_CreateValueBase64(key, val->value.str.val, val->value.str.len); + xReturn = XMLRPC_CreateValueBase64(key, Z_STRVAL_P(val), Z_STRLEN_P(val)); } break; case xmlrpc_datetime: convert_to_string(val); - xReturn = XMLRPC_CreateValueDateTime_ISO8601(key, val->value.str.val); + xReturn = XMLRPC_CreateValueDateTime_ISO8601(key, Z_STRVAL_P(val)); break; case xmlrpc_boolean: convert_to_boolean(val); - xReturn = XMLRPC_CreateValueBoolean(key, val->value.lval); + xReturn = XMLRPC_CreateValueBoolean(key, Z_LVAL_P(val)); break; case xmlrpc_int: convert_to_long(val); - xReturn = XMLRPC_CreateValueInt(key, val->value.lval); + xReturn = XMLRPC_CreateValueInt(key, Z_LVAL_P(val)); break; case xmlrpc_double: convert_to_double(val); - xReturn = XMLRPC_CreateValueDouble(key, val->value.dval); + xReturn = XMLRPC_CreateValueDouble(key, Z_DVAL_P(val)); break; case xmlrpc_string: convert_to_string(val); - xReturn = XMLRPC_CreateValueString(key, val->value.str.val, val->value.str.len); + xReturn = XMLRPC_CreateValueString(key, Z_STRVAL_P(val), Z_STRLEN_P(val)); break; case xmlrpc_vector: { @@ -506,13 +506,13 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker(const char* key, pval* in_val, int dept convert_to_array(val); - xReturn = XMLRPC_CreateVector(key, determine_vector_type(val->value.ht)); + xReturn = XMLRPC_CreateVector(key, determine_vector_type(Z_ARRVAL_P(val))); - zend_hash_internal_pointer_reset(val->value.ht); + zend_hash_internal_pointer_reset(Z_ARRVAL_P(val)); while(1) { - int res = my_zend_hash_get_current_key(val->value.ht, &my_key, &num_index); + int res = my_zend_hash_get_current_key(Z_ARRVAL_P(val), &my_key, &num_index); if(res == HASH_KEY_IS_LONG) { - if(zend_hash_get_current_data(val->value.ht, (void**)&pIter) == SUCCESS) { + if(zend_hash_get_current_data(Z_ARRVAL_P(val), (void**)&pIter) == SUCCESS) { XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(0, *pIter, depth++)); } } @@ -520,12 +520,12 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker(const char* key, pval* in_val, int dept break; } else if(res == HASH_KEY_IS_STRING) { - if(zend_hash_get_current_data(val->value.ht, (void**)&pIter) == SUCCESS) { + if(zend_hash_get_current_data(Z_ARRVAL_P(val), (void**)&pIter) == SUCCESS) { XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key, *pIter, depth++)); } } - zend_hash_move_forward(val->value.ht); + zend_hash_move_forward(Z_ARRVAL_P(val)); } } break; @@ -554,39 +554,39 @@ static pval* XMLRPC_to_PHP(XMLRPC_VALUE el) { switch(type) { case xmlrpc_empty: - elem->type = IS_NULL; + Z_TYPE_P(elem) = IS_NULL; break; case xmlrpc_string: pStr = XMLRPC_GetValueString(el); if(pStr) { - elem->value.str.len = XMLRPC_GetValueStringLen(el); - elem->value.str.val = estrndup(pStr, elem->value.str.len); - elem->type = IS_STRING; + Z_STRLEN_P(elem) = XMLRPC_GetValueStringLen(el); + Z_STRVAL_P(elem) = estrndup(pStr, Z_STRLEN_P(elem)); + Z_TYPE_P(elem) = IS_STRING; } break; case xmlrpc_int: - elem->value.lval = XMLRPC_GetValueInt(el); - elem->type = IS_LONG; + Z_LVAL_P(elem) = XMLRPC_GetValueInt(el); + Z_TYPE_P(elem) = IS_LONG; break; case xmlrpc_boolean: - elem->value.lval = XMLRPC_GetValueBoolean(el); - elem->type = IS_BOOL; + Z_LVAL_P(elem) = XMLRPC_GetValueBoolean(el); + Z_TYPE_P(elem) = IS_BOOL; break; case xmlrpc_double: - elem->value.dval = XMLRPC_GetValueDouble(el); - elem->type = IS_DOUBLE; + Z_DVAL_P(elem) = XMLRPC_GetValueDouble(el); + Z_TYPE_P(elem) = IS_DOUBLE; break; case xmlrpc_datetime: - elem->value.str.len = XMLRPC_GetValueStringLen(el); - elem->value.str.val = estrndup(XMLRPC_GetValueDateTime_ISO8601(el), elem->value.str.len); - elem->type = IS_STRING; + Z_STRLEN_P(elem) = XMLRPC_GetValueStringLen(el); + Z_STRVAL_P(elem) = estrndup(XMLRPC_GetValueDateTime_ISO8601(el), Z_STRLEN_P(elem)); + Z_TYPE_P(elem) = IS_STRING; break; case xmlrpc_base64: pStr = XMLRPC_GetValueBase64(el); if(pStr) { - elem->value.str.len = XMLRPC_GetValueStringLen(el); - elem->value.str.val = estrndup(pStr, elem->value.str.len); - elem->type = IS_STRING; + Z_STRLEN_P(elem) = XMLRPC_GetValueStringLen(el); + Z_STRVAL_P(elem) = estrndup(pStr, Z_STRLEN_P(elem)); + Z_TYPE_P(elem) = IS_STRING; } break; case xmlrpc_vector: @@ -630,14 +630,14 @@ PHP_FUNCTION(xmlrpc_encode_request) { if(xRequest) { XMLRPC_RequestSetOutputOptions(xRequest, &out.xmlrpc_out); - if(method->type == IS_NULL) { + if(Z_TYPE_P(method) == IS_NULL) { XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_response); } else { - XMLRPC_RequestSetMethodName(xRequest, method->value.str.val); + XMLRPC_RequestSetMethodName(xRequest, Z_STRVAL_P(method)); XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_call); } - if(vals->type != IS_NULL) { + if(Z_TYPE_P(vals) != IS_NULL) { XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(vals)); } @@ -690,10 +690,10 @@ pval* decode_request_worker(pval* xml_in, pval* encoding_in, pval* method_name_o pval* retval = NULL; XMLRPC_REQUEST response; STRUCT_XMLRPC_REQUEST_INPUT_OPTIONS opts = {0}; - opts.xml_elem_opts.encoding = encoding_in ? utf8_get_encoding_id_from_string(encoding_in->value.str.val) : ENCODING_DEFAULT; + opts.xml_elem_opts.encoding = encoding_in ? utf8_get_encoding_id_from_string(Z_STRVAL_P(encoding_in)) : ENCODING_DEFAULT; /* generate XMLRPC_REQUEST from raw xml */ - response = XMLRPC_REQUEST_FromXML(xml_in->value.str.val, xml_in->value.str.len, &opts); + response = XMLRPC_REQUEST_FromXML(Z_STRVAL_P(xml_in), Z_STRLEN_P(xml_in), &opts); if(response) { /* convert xmlrpc data to native php types */ retval = XMLRPC_to_PHP(XMLRPC_RequestGetData(response)); @@ -701,9 +701,9 @@ pval* decode_request_worker(pval* xml_in, pval* encoding_in, pval* method_name_o if(XMLRPC_RequestGetRequestType(response) == xmlrpc_request_call) { if(method_name_out) { convert_to_string(method_name_out); - method_name_out->type = IS_STRING; - method_name_out->value.str.val = estrdup(XMLRPC_RequestGetMethodName(response)); - method_name_out->value.str.len = strlen(method_name_out->value.str.val); + Z_TYPE_P(method_name_out) = IS_STRING; + Z_STRVAL_P(method_name_out) = estrdup(XMLRPC_RequestGetMethodName(response)); + Z_STRLEN_P(method_name_out) = strlen(Z_STRVAL_P(method_name_out)); } } @@ -866,15 +866,15 @@ static void php_xmlrpc_introspection_callback(XMLRPC_SERVER server, void* data) xmlrpc_callback_data* pData = (xmlrpc_callback_data*)data; MAKE_STD_ZVAL(retval_ptr); - retval_ptr->type = IS_NULL; + Z_TYPE_P(retval_ptr) = IS_NULL; /* setup data hoojum */ callback_params[0] = pData->caller_params; /* loop through and call all registered callbacks */ - zend_hash_internal_pointer_reset(pData->server->introspection_map->value.ht); + zend_hash_internal_pointer_reset(pData->server->Z_ARRVAL_P(introspection_map)); while(1) { - if(zend_hash_get_current_data(pData->server->introspection_map->value.ht, + if(zend_hash_get_current_data(pData->server->Z_ARRVAL_P(introspection_map), (void**)&php_function) == SUCCESS) { /* php func prototype: function string user_func($user_params) */ @@ -886,11 +886,11 @@ static void php_xmlrpc_introspection_callback(XMLRPC_SERVER server, void* data) /* return value should be a string */ convert_to_string(retval_ptr); - xData = XMLRPC_IntrospectionCreateDescription(retval_ptr->value.str.val, &err); + xData = XMLRPC_IntrospectionCreateDescription(Z_STRVAL_P(retval_ptr), &err); if(xData) { if(!XMLRPC_ServerAddIntrospectionData(server, xData)) { - zend_error(E_WARNING, "Unable to add introspection data returned from %s(), improper element structure", (*php_function)->value.str.val); + zend_error(E_WARNING, "Unable to add introspection data returned from %s(), improper element structure", Z_STRVAL_PP(php_function)); } XMLRPC_CleanupValue(xData); } @@ -898,28 +898,28 @@ static void php_xmlrpc_introspection_callback(XMLRPC_SERVER server, void* data) /* could not create description */ if(err.xml_elem_error.parser_code) { zend_error(E_WARNING, "xml parse error: [line %i, column %i, message: %s] Unable to add introspection data returned from %s()", - err.xml_elem_error.column, err.xml_elem_error.line, err.xml_elem_error.parser_error, (*php_function)->value.str.val); + err.xml_elem_error.column, err.xml_elem_error.line, err.xml_elem_error.parser_error, Z_STRVAL_PP(php_function)); } else { zend_error(E_WARNING, "Unable to add introspection data returned from %s()", - (*php_function)->value.str.val); + Z_STRVAL_PP(php_function)); } } } else { /* user func failed */ - zend_error(E_WARNING, "Error calling user introspection callback: %s()", (*php_function)->value.str.val); + zend_error(E_WARNING, "Error calling user introspection callback: %s()", Z_STRVAL_PP(php_function)); } } else { break; } - zend_hash_move_forward(pData->server->introspection_map->value.ht); + zend_hash_move_forward(pData->server->Z_ARRVAL_P(introspection_map)); } /* so we don't call the same callbacks ever again */ - zend_hash_clean(pData->server->introspection_map->value.ht); + zend_hash_clean(pData->server->Z_ARRVAL_P(introspection_map)); } /* {{{ proto boolean xmlrpc_server_register_method(handle server, string method_name, string function) @@ -935,20 +935,20 @@ PHP_FUNCTION(xmlrpc_server_register_method) { WRONG_PARAM_COUNT; /* prints/logs a warning and returns */ } - server = zend_list_find(handle->value.lval, &type); + server = zend_list_find(Z_LVAL_P(handle), &type); if(type == XMLRPCG(le_xmlrpc_server)) { /* register with C engine. every method just calls our standard callback, * and it then dispatches to php as necessary */ - if(XMLRPC_ServerRegisterMethod(server->server_ptr, method_key->value.str.val, php_xmlrpc_callback)) { + if(XMLRPC_ServerRegisterMethod(server->server_ptr, Z_STRVAL_P(method_key), php_xmlrpc_callback)) { /* save for later use */ MAKE_STD_ZVAL(method_name_save); *method_name_save = *method_name; zval_copy_ctor(method_name_save); /* register our php method */ - add_pval(server->method_map, method_key->value.str.val, &method_name_save); + add_pval(server->method_map, Z_STRVAL_P(method_key), &method_name_save); RETURN_BOOL(1); } @@ -970,7 +970,7 @@ PHP_FUNCTION(xmlrpc_server_register_introspection_callback) { WRONG_PARAM_COUNT; /* prints/logs a warning and returns */ } - server = zend_list_find(handle->value.lval, &type); + server = zend_list_find(Z_LVAL_P(handle), &type); if(type == XMLRPCG(le_xmlrpc_server)) { { @@ -1022,14 +1022,14 @@ PHP_FUNCTION(xmlrpc_server_call_method) { WRONG_PARAM_COUNT; } - server = zend_list_find(handle->value.lval, &type); + server = zend_list_find(Z_LVAL_P(handle), &type); if(type == XMLRPCG(le_xmlrpc_server)) { /* HACK: use output encoding for now */ input_opts.xml_elem_opts.encoding = utf8_get_encoding_id_from_string(out.xmlrpc_out.xml_elem_opts.encoding); /* generate an XMLRPC_REQUEST from the raw xml input */ - xRequest = XMLRPC_REQUEST_FromXML(rawxml->value.str.val, rawxml->value.str.len, &input_opts); + xRequest = XMLRPC_REQUEST_FromXML(Z_STRVAL_P(rawxml), Z_STRLEN_P(rawxml), &input_opts); if(xRequest) { @@ -1039,21 +1039,21 @@ PHP_FUNCTION(xmlrpc_server_call_method) { XMLRPC_VALUE xAnswer = NULL; MAKE_STD_ZVAL(data.xmlrpc_method); /* init. very important. spent a frustrating day finding this out. */ MAKE_STD_ZVAL(data.return_data); - data.return_data->type = IS_NULL; /* in case value is never init'd, we don't dtor to think it is a string or something */ - data.xmlrpc_method->type = IS_NULL; + data.Z_TYPE_P(return_data) = IS_NULL; /* in case value is never init'd, we don't dtor to think it is a string or something */ + data.Z_TYPE_P(xmlrpc_method) = IS_NULL; /* setup some data to pass to the callback function */ - data.xmlrpc_method->value.str.val = estrdup(XMLRPC_RequestGetMethodName(xRequest)); - data.xmlrpc_method->value.str.len = strlen(data.xmlrpc_method->value.str.val); - data.xmlrpc_method->type = IS_STRING; + data.Z_STRVAL_P(xmlrpc_method) = estrdup(XMLRPC_RequestGetMethodName(xRequest)); + data.Z_STRLEN_P(xmlrpc_method) = strlen(data.Z_STRVAL_P(xmlrpc_method)); + data.Z_TYPE_P(xmlrpc_method) = IS_STRING; data.caller_params = caller_params; data.php_executed = 0; data.server = server; /* check if the called method has been previous registered */ - if(zend_hash_find(server->method_map->value.ht, - data.xmlrpc_method->value.str.val, - data.xmlrpc_method->value.str.len + 1, + if(zend_hash_find(server->Z_ARRVAL_P(method_map), + data.Z_STRVAL_P(xmlrpc_method), + data.Z_STRLEN_P(xmlrpc_method) + 1, (void**)&php_function) == SUCCESS) { data.php_function = *php_function; @@ -1135,7 +1135,7 @@ PHP_FUNCTION(xmlrpc_server_add_introspection_data) { WRONG_PARAM_COUNT; /* prints/logs a warning and returns */ } - server = zend_list_find(handle->value.lval, &type); + server = zend_list_find(Z_LVAL_P(handle), &type); if (type == XMLRPCG(le_xmlrpc_server)) { XMLRPC_VALUE xDesc = PHP_to_XMLRPC(desc); @@ -1274,19 +1274,19 @@ int set_pval_xmlrpc_type(pval* value, XMLRPC_VALUE_TYPE type) { /* we only really care about strings because they can represent * base64 and datetime. all other types have corresponding php types */ - if(value->type == IS_STRING) { + if(Z_TYPE_P(value) == IS_STRING) { if(type == xmlrpc_base64 || type == xmlrpc_datetime) { const char* typestr = xmlrpc_type_as_str(type, xmlrpc_vector_none); pval* type; MAKE_STD_ZVAL(type); - type->type = IS_STRING; - type->value.str.val = estrdup(typestr); - type->value.str.len = strlen(typestr); + Z_TYPE_P(type) = IS_STRING; + Z_STRVAL_P(type) = estrdup(typestr); + Z_STRLEN_P(type) = strlen(typestr); convert_to_object(value); - bSuccess = zend_hash_update(value->value.obj.properties, OBJECT_TYPE_ATTR, sizeof(OBJECT_TYPE_ATTR), (void *) &type, sizeof(zval *), NULL); + bSuccess = zend_hash_update(Z_OBJPROP_P(value), OBJECT_TYPE_ATTR, sizeof(OBJECT_TYPE_ATTR), (void *) &type, sizeof(zval *), NULL); } } @@ -1298,7 +1298,7 @@ XMLRPC_VALUE_TYPE get_pval_xmlrpc_type(pval* value, pval** newvalue) { XMLRPC_VALUE_TYPE type = xmlrpc_none; if(value) { - switch(value->type) { + switch(Z_TYPE_P(value)) { case IS_NULL: type = xmlrpc_base64; break; @@ -1333,11 +1333,11 @@ XMLRPC_VALUE_TYPE get_pval_xmlrpc_type(pval* value, pval** newvalue) { pval** attr; type = xmlrpc_vector; - if(zend_hash_find(value->value.obj.properties, + if(zend_hash_find(Z_OBJPROP_P(value), OBJECT_TYPE_ATTR, sizeof(OBJECT_TYPE_ATTR), (void**)&attr) == SUCCESS) { - if((*attr)->type == IS_STRING) { - type = xmlrpc_str_as_type((*attr)->value.str.val); + if(Z_TYPE_PP(attr) == IS_STRING) { + type = xmlrpc_str_as_type(Z_STRVAL_PP(attr)); } } break; @@ -1347,8 +1347,8 @@ XMLRPC_VALUE_TYPE get_pval_xmlrpc_type(pval* value, pval** newvalue) { /* if requested, return an unmolested (magic removed) copy of the value */ if(newvalue) { pval** val; - if( (type == xmlrpc_base64 && value->type != IS_NULL) || type == xmlrpc_datetime) { - if(zend_hash_find(value->value.obj.properties, + if( (type == xmlrpc_base64 && Z_TYPE_P(value) != IS_NULL) || type == xmlrpc_datetime) { + if(zend_hash_find(Z_OBJPROP_P(value), OBJECT_VALUE_ATTR, sizeof(OBJECT_VALUE_ATTR), (void**)&val) == SUCCESS) { *newvalue = *val; @@ -1380,14 +1380,14 @@ PHP_FUNCTION(xmlrpc_set_type) { #endif convert_to_string(type); - vtype = xmlrpc_str_as_type(type->value.str.val); + vtype = xmlrpc_str_as_type(Z_STRVAL_P(type)); if(vtype != xmlrpc_none) { if(set_pval_xmlrpc_type(arg, vtype) == SUCCESS) { RETURN_TRUE; } } else { - zend_error(E_WARNING,"invalid type '%s' passed to xmlrpc_set_type()", type->value.str.val); + zend_error(E_WARNING,"invalid type '%s' passed to xmlrpc_set_type()", Z_STRVAL_P(type)); } RETURN_FALSE; } @@ -1405,7 +1405,7 @@ PHP_FUNCTION(xmlrpc_get_type) { type = get_pval_xmlrpc_type(arg, 0); if(type == xmlrpc_vector) { - vtype = determine_vector_type(arg->value.ht); + vtype = determine_vector_type(Z_ARRVAL_P(arg)); } RETURN_STRING((char*)xmlrpc_type_as_str(type, vtype), 1); |
