X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-propro;a=blobdiff_plain;f=v1.0.x%2Fphp__propro_8h.html;h=ed1ee77777cc0587796520ec0d120bf0992141fa;hp=d89ae2aada9f61cb4200d27e562123b533a42f66;hb=81669568e8efb556df803a2bb02afd93764f4868;hpb=1d9bb866738b09085bc6f387e83690c16d26c762 diff --git a/v1.0.x/php__propro_8h.html b/v1.0.x/php__propro_8h.html index d89ae2a..ed1ee77 100644 --- a/v1.0.x/php__propro_8h.html +++ b/v1.0.x/php__propro_8h.html @@ -3,22 +3,24 @@ - + Property proxy API: php_propro.h File Reference + + @@ -28,7 +30,7 @@ -
+
Property proxy API
A facility to manage extension object properties tied to C-struct members
@@ -38,14 +40,13 @@
- +
@@ -102,351 +103,85 @@ $(document).ready(function(){initNavTree('php__propro_8h.html','');});
+Macros | +Variables
php_propro.h File Reference
- +
#include "php_propro_api.h"
+
+Include dependency graph for php_propro.h:
+
+
+ + +
+

Go to the source code of this file.

- - - - - - - + + + + + + +

-Data Structures

struct  php_property_proxy
 The internal property proxy. More...
 
struct  php_property_proxy_object
 The userland object. More...
 

+Macros

#define phpext_propro_ptr   &propro_module_entry
 
#define PHP_PROPRO_VERSION   "1.0.1"
 
#define PHP_PROPRO_API   extern
 
- - - - - -

-Typedefs

typedef struct php_property_proxy php_property_proxy_t
 
typedef struct
-php_property_proxy_object 
php_property_proxy_object_t
 
- - - - - - - - - - - - - - - - -

-Functions

php_property_proxy_tphp_property_proxy_init (zval *container, const char *member_str, size_t member_len)
 Create a property proxy. More...
 
void php_property_proxy_free (php_property_proxy_t **proxy)
 Destroy and free a property proxy. More...
 
zend_class_entry * php_property_proxy_get_class_entry (void)
 Get the zend_class_entry of php\PropertyProxy. More...
 
zend_object_value php_property_proxy_object_new (zend_class_entry *ce)
 Instantiate a new php\PropertyProxy. More...
 
zend_object_value php_property_proxy_object_new_ex (zend_class_entry *ce, php_property_proxy_t *proxy, php_property_proxy_object_t **ptr)
 Instantiate a new php\PropertyProxy with proxy. More...
 
-

Data Structure Documentation

- -
-
- - - - -
struct php_property_proxy
-
-

The internal property proxy.

-

Container for the object/array holding the proxied property.

-
- - - - - - - - - - -
Data Fields
-zval * -container -The container holding the property.
-size_t -member_len -The length of the name.
-char * -member_str -The name of the proxied property.
- -
-
- -
-
- - - - -
struct php_property_proxy_object
-
-

The userland object.

-

Return an object instance of php\PropertyProxy to make your C-struct member accessible by reference from PHP userland.

-

Example:

-
static zval *my_read_prop(zval *object, zval *member, int type, zend_literal *key TSRMLS_DC)
-
{
-
my_object_t *obj = zend_object_store_get_object(object TSRMLS_CC);
-
my_prophandler_t *handler;
-
zval *return_value, *copy = my_cast(IS_STRING, member);
-
-
if (SUCCESS == my_get_prophandler(Z_STRVAL_P(copy), Z_STRLEN_P(copy), &handler)) {
-
ALLOC_ZVAL(return_value);
-
Z_SET_REFCOUNT_P(return_value, 0);
-
Z_UNSET_ISREF_P(return_value);
-
-
if (type == BP_VAR_R) {
-
handler->read(obj, return_value TSRMLS_CC);
-
} else {
-
//
-
// This is the interesting part
-
//
- -
zend_object_value proxy_ov;
-
zend_class_entry *proxy_ce;
-
-
proxy = php_property_proxy_init(object, Z_STRVAL_P(copy), Z_STRLEN_P(copy) TSRMLS_CC);
- -
proxy_ov = php_property_proxy_object_new_ex(proxy_ce, proxy, NULL TSRMLS_CC);
-
RETVAL_OBJVAL(proxy_ov, 0);
-
}
-
} else {
-
zend_object_handlers *oh = zend_get_std_object_handlers();
-
return_value = oh->read_property(object, member, type, key TSRMLS_CC);
-
}
-
-
zval_ptr_dtor(&copy);
-
-
return return_value;
-
}
-
-Collaboration diagram for php_property_proxy_object:
-
-
Collaboration graph
- - -
[legend]
- - - - - - - - - - - - - - + + +
Data Fields
-struct php_property_proxy_object * -parent -A reference to any parent property proxy object.
-php_property_proxy_t * -proxy -The actual property proxy.
-zend_object -zo -The std zend_object.
-zend_object_value -zv -The object value for easy zval creation.

+Variables

zend_module_entry propro_module_entry
 
- -
-
-

Typedef Documentation

- -
-
- -
-
- -
-
- - - - -
typedef struct php_property_proxy php_property_proxy_t
-
- -
-
-

Function Documentation

- -
-
- - - - - - - - -
void php_property_proxy_free (php_property_proxy_t ** proxy)
-
- -

Destroy and free a property proxy.

-

The destruction of the property proxy object calls this.

-
Parameters
- - -
proxya pointer to the allocated property proxy
-
-
- -
-
- +

Macro Definition Documentation

+
- - - - - +
zend_class_entry* php_property_proxy_get_class_entry (void )#define PHP_PROPRO_API   extern
-

Get the zend_class_entry of php\PropertyProxy.

-
Returns
the class entry pointer
-
- +
- - - - - - - - - - - - - - - - - - - - - +
php_property_proxy_t* php_property_proxy_init (zval * container,
const char * member_str,
size_t member_len 
)#define PHP_PROPRO_VERSION   "1.0.1"
-

Create a property proxy.

-

The property proxy will forward reads and writes to itself to the proxied property with name member_str of container.

-
Parameters
- - - - -
containerthe container holding the property
member_strthe name of the proxied property
member_lenthe length of the name
-
-
-
Returns
a new property proxy
-
- +
- - - - - +
zend_object_value php_property_proxy_object_new (zend_class_entry * ce)#define phpext_propro_ptr   &propro_module_entry
-

Instantiate a new php\PropertyProxy.

-
Parameters
- - -
cethe property proxy or derived class entry
-
-
-
Returns
the zval object value
-
- +

Variable Documentation

+
- - - - - - - - - - - - - - - - - - - - - +
zend_object_value php_property_proxy_object_new_ex (zend_class_entry * ce,
php_property_proxy_tproxy,
php_property_proxy_object_t ** ptr 
)zend_module_entry propro_module_entry
-

Instantiate a new php\PropertyProxy with proxy.

-
Parameters
- - - - -
cethe property proxy or derived class entry
proxythe internal property proxy
ptra pointer to store the resulting property proxy object
-
-
-
Returns
the zval object value
-
@@ -457,7 +192,7 @@ The object value for easy zval creation. + doxygen 1.8.10