X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-propro;a=blobdiff_plain;f=src%2Fphp_propro_api.h;h=8f880458d2272e8acc18a1d14be818299e9576a7;hp=d82055ffa6d5c01b7bb98e02796221a66d2bf2c5;hb=HEAD;hpb=0ef55616b66a3f554d89142944a9f684f3e78d65 diff --git a/src/php_propro_api.h b/src/php_propro_api.h index d82055f..8f88045 100644 --- a/src/php_propro_api.h +++ b/src/php_propro_api.h @@ -21,7 +21,7 @@ * Container for the object/array holding the proxied property. */ struct php_property_proxy { - /** The container holding the property */ + /** The reference to the container holding the property */ zval container; /** The name of the proxied property */ zend_string *member; @@ -35,7 +35,7 @@ typedef struct php_property_proxy php_property_proxy_t; * member accessible by reference from PHP userland. * * Example: - * ~~~~~~~~~~{.c} + * \code{.c} * static zval *my_read_prop(zval *object, zval *member, int type, void **cache_slot, zval *tmp) * { * zval *return_value; @@ -46,20 +46,24 @@ typedef struct php_property_proxy php_property_proxy_t; * return_value = zend_get_std_object_handlers()->read_property(object, member, type, cache_slot, tmp); * * if (handler) { - * handler->read(object, tmp); - * - * zval_ptr_dtor(return_value); - * ZVAL_COPY_VALUE(return_value, tmp); + * handler->read(object, return_value); * } * } else { - * return_value = php_property_proxy_zval(object, member_name); + * php_property_proxy_t *proxy; + * php_property_proxy_object_t *proxy_obj; + * + * proxy = php_property_proxy_init(object, member_name); + * proxy_obj = php_property_proxy_object_new_ex(NULL, proxy); + * + * ZVAL_OBJ(tmp, &proxy_obj->zo); + * return_value = tmp; * } * * zend_string_release(member_name); * * return return_value; * } - * ~~~~~~~~~~ + * \endcode */ struct php_property_proxy_object { /** The actual property proxy */