cvs: ZendEngine2 / zend_object_handlers.h

From: Date: Thu, 12 Feb 2004 12:22:45 +0000
Subject: cvs: ZendEngine2 / zend_object_handlers.h
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-2368@lists.php.net to get a copy of this message
andi Thu Feb 12 07:22:45 2004 EDT Modified files: /ZendEngine2 zend_object_handlers.h Log: - Add comments to read/write property/dimension for extension authors http://cvs.php.net/diff.php/ZendEngine2/zend_object_handlers.h?r1=1.35&r2=1.36&ty=u Index: ZendEngine2/zend_object_handlers.h diff -u ZendEngine2/zend_object_handlers.h:1.35 ZendEngine2/zend_object_handlers.h:1.36 --- ZendEngine2/zend_object_handlers.h:1.35 Sun Feb 8 12:23:20 2004 +++ ZendEngine2/zend_object_handlers.h Thu Feb 12 07:22:45 2004 @@ -17,25 +17,36 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_object_handlers.h,v 1.35 2004/02/08 17:23:20 zeev Exp $ */ +/* $Id: zend_object_handlers.h,v 1.36 2004/02/12 12:22:45 andi Exp $ */ #ifndef ZEND_OBJECT_HANDLERS_H #define ZEND_OBJECT_HANDLERS_H union _zend_function; +/* The following rule applies to read_property() and read_dimension() implementations: + If you return a zval which is not otherwise referenced by the extension or the engine's + symbol table, its reference count should be 0. +*/ /* Used to fetch property from the object, read-only */ typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, zend_bool silent TSRMLS_DC); /* Used to fetch dimension from the object, read-only */ typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int type TSRMLS_DC); + +/* The following rule applies to write_property() and write_dimension() implementations: + If you receive a value zval in write_property/write_dimension, you may only modify it if + its reference count is 1. Otherwise, you must create a copy of that zval before making + any changes. You should NOT modify the reference count of the value passed to you. +*/ /* Used to set property of the object */ typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value TSRMLS_DC); /* Used to set dimension of the object */ typedef void (*zend_object_write_dimension_t)(zval *object, zval *offset, zval *value TSRMLS_DC); + /* Used to create pointer to the property of the object, for future direct r/w access */ typedef zval **(*zend_object_get_property_ptr_ptr_t)(zval *object, zval *member TSRMLS_DC);

« previous php.zend-engine.cvs (#2368) next »