--- embedaddon/php/ext/com_dotnet/com_handlers.c 2012/02/21 23:47:53 1.1.1.1 +++ embedaddon/php/ext/com_dotnet/com_handlers.c 2012/05/29 12:34:36 1.1.1.2 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: com_handlers.c,v 1.1.1.1 2012/02/21 23:47:53 misho Exp $ */ +/* $Id: com_handlers.c,v 1.1.1.2 2012/05/29 12:34:36 misho Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -29,7 +29,7 @@ #include "php_com_dotnet_internal.h" #include "Zend/zend_exceptions.h" -static zval *com_property_read(zval *object, zval *member, int type TSRMLS_DC) +static zval *com_property_read(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC) { zval *return_value; php_com_dotnet_object *obj; @@ -64,7 +64,7 @@ static zval *com_property_read(zval *object, zval *mem return return_value; } -static void com_property_write(zval *object, zval *member, zval *value TSRMLS_DC) +static void com_property_write(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC) { php_com_dotnet_object *obj; VARIANT v; @@ -196,7 +196,7 @@ static zval *com_object_get(zval *property TSRMLS_DC) } #endif -static int com_property_exists(zval *object, zval *member, int check_empty TSRMLS_DC) +static int com_property_exists(zval *object, zval *member, int check_empty, const zend_literal *key TSRMLS_DC) { DISPID dispid; php_com_dotnet_object *obj; @@ -222,7 +222,7 @@ static int com_dimension_exists(zval *object, zval *me return 0; } -static void com_property_delete(zval *object, zval *member TSRMLS_DC) +static void com_property_delete(zval *object, zval *member, const zend_literal *key TSRMLS_DC) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object"); } @@ -246,7 +246,7 @@ static void function_dtor(void *pDest) { zend_internal_function *f = (zend_internal_function*)pDest; - efree(f->function_name); + efree((char*)f->function_name); if (f->arg_info) { efree(f->arg_info); } @@ -259,7 +259,7 @@ static PHP_FUNCTION(com_method_handler) INTERNAL_FUNCTION_PARAM_PASSTHRU); } -static union _zend_function *com_method_get(zval **object_ptr, char *name, int len TSRMLS_DC) +static union _zend_function *com_method_get(zval **object_ptr, char *name, int len, const zend_literal *key TSRMLS_DC) { zend_internal_function f, *fptr = NULL; php_com_dotnet_object *obj; @@ -283,7 +283,7 @@ static union _zend_function *com_method_get(zval **obj f.num_args = 0; f.arg_info = NULL; f.scope = obj->ce; - f.fn_flags = 0; + f.fn_flags = ZEND_ACC_CALL_VIA_HANDLER; f.function_name = estrndup(name, len); f.handler = PHP_FN(com_method_handler); @@ -364,7 +364,7 @@ static union _zend_function *com_method_get(zval **obj return NULL; } -static int com_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS) +static int com_call_method(const char *method, INTERNAL_FUNCTION_PARAMETERS) { zval ***args = NULL; php_com_dotnet_object *obj; @@ -387,7 +387,7 @@ static int com_call_method(char *method, INTERNAL_FUNC VariantInit(&v); - if (SUCCESS == php_com_do_invoke_byref(obj, method, -1, DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, nargs, args TSRMLS_CC)) { + if (SUCCESS == php_com_do_invoke_byref(obj, (char*)method, -1, DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, nargs, args TSRMLS_CC)) { php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC); ret = SUCCESS; VariantClear(&v); @@ -409,7 +409,7 @@ static union _zend_function *com_constructor_get(zval #define POPULATE_CTOR(f, fn) \ f.type = ZEND_INTERNAL_FUNCTION; \ - f.function_name = obj->ce->name; \ + f.function_name = (char *) obj->ce->name; \ f.scope = obj->ce; \ f.arg_info = NULL; \ f.num_args = 0; \ @@ -442,7 +442,7 @@ static zend_class_entry *com_class_entry_get(const zva return obj->ce; } -static int com_class_name_get(const zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) +static int com_class_name_get(const zval *object, const char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) { php_com_dotnet_object *obj; obj = CDNO_FETCH(object); @@ -580,7 +580,10 @@ zend_object_handlers php_com_object_handlers = { com_class_name_get, com_objects_compare, com_object_cast, - com_object_count + com_object_count, + NULL, /* get_debug_info */ + NULL, /* get_closure */ + NULL, /* get_gc */ }; void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSRMLS_DC)