X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_propro.h;h=511f468e12af73ec5206502a7955cb5eb0a84af9;hb=78ce5324565228f14ec2f32c96ad2f3972c8440f;hp=79c19925975d4402ad8220ea1a569966a53672ad;hpb=d705dc333abf485457263952f5d12c1e3cfa3334;p=m6w6%2Fext-propro diff --git a/php_propro.h b/php_propro.h index 79c1992..511f468 100644 --- a/php_propro.h +++ b/php_propro.h @@ -18,7 +18,7 @@ extern zend_module_entry propro_module_entry; #define phpext_propro_ptr &propro_module_entry -#define PHP_PROPRO_VERSION "1.0.1" +#define PHP_PROPRO_VERSION "2.0.0dev" #ifdef PHP_WIN32 # define PHP_PROPRO_API __declspec(dllexport) @@ -32,12 +32,9 @@ extern zend_module_entry propro_module_entry; # include #endif -#ifdef IS_UNDEF /* TODO: replace with version check */ -#define PHPNG -#define zend_object_value zend_object -#endif +#define PHP_PROPRO_PTR(zo) (void*)(((char*)(zo))-(zo)->handlers->offset) -#endif +#endif /* DOXYGEN */ /** * The internal property proxy. @@ -46,11 +43,9 @@ extern zend_module_entry propro_module_entry; */ struct php_property_proxy { /** The container holding the property */ - zval *container; + zval container; /** The name of the proxied property */ - char *member_str; - /** The length of the name */ - size_t member_len; + zend_string *member; }; typedef struct php_property_proxy php_property_proxy_t; @@ -100,16 +95,12 @@ typedef struct php_property_proxy php_property_proxy_t; * ~~~~~~~~~~ */ struct php_property_proxy_object { -#ifndef PHPNG - /** The std zend_object */ - zend_object zo; -#endif - /** The object value for easy zval creation */ - zend_object_value zv; /** The actual property proxy */ php_property_proxy_t *proxy; - /** A reference to any parent property proxy object */ - struct php_property_proxy_object *parent; + /** Any parent property proxy object */ + zval parent; + /** The std zend_object */ + zend_object zo; }; typedef struct php_property_proxy_object php_property_proxy_object_t; @@ -120,12 +111,11 @@ typedef struct php_property_proxy_object php_property_proxy_object_t; * proxied property with name \a member_str of \a container. * * @param container the container holding the property - * @param member_str the name of the proxied property - * @param member_len the length of the name + * @param member the name of the proxied property * @return a new property proxy */ PHP_PROPRO_API php_property_proxy_t *php_property_proxy_init(zval *container, - const char *member_str, size_t member_len TSRMLS_DC); + zend_string *member TSRMLS_DC); /** * Destroy and free a property proxy. @@ -142,25 +132,6 @@ PHP_PROPRO_API void php_property_proxy_free(php_property_proxy_t **proxy); */ PHP_PROPRO_API zend_class_entry *php_property_proxy_get_class_entry(void); -/** - * Instantiate a new php\\PropertyProxy - * @param ce the property proxy or derived class entry - * @return the zval object value - */ -PHP_PROPRO_API zend_object_value php_property_proxy_object_new( - zend_class_entry *ce TSRMLS_DC); - -/** - * Instantiate a new php\\PropertyProxy with \a proxy - * @param ce the property proxy or derived class entry - * @param proxy the internal property proxy - * @param ptr a pointer to store the resulting property proxy object - * @return the zval object value - */ -PHP_PROPRO_API zend_object_value php_property_proxy_object_new_ex( - zend_class_entry *ce, php_property_proxy_t *proxy, - php_property_proxy_object_t **ptr TSRMLS_DC); - #endif /* PHP_PROPRO_H */