cvs: ZendEngine2 / zend_objects_API.c zend_objects_API.h

From: Date: Mon, 17 May 2004 11:27:16 +0000
Subject: cvs: ZendEngine2 / zend_objects_API.c zend_objects_API.h
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-2641@lists.php.net to get a copy of this message
wez Mon May 17 07:27:16 2004 EDT Modified files: /ZendEngine2 zend_objects_API.c zend_objects_API.h Log: As discussed with Andi, add this helper API for setting the object pointer from within the constructor. Please read the comment for notes about how to use it; in general, you don't need it, so don't use it. http://cvs.php.net/diff.php/ZendEngine2/zend_objects_API.c?r1=1.39&r2=1.40&ty=u Index: ZendEngine2/zend_objects_API.c diff -u ZendEngine2/zend_objects_API.c:1.39 ZendEngine2/zend_objects_API.c:1.40 --- ZendEngine2/zend_objects_API.c:1.39 Tue May 4 11:03:28 2004 +++ ZendEngine2/zend_objects_API.c Mon May 17 07:27:16 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_objects_API.c,v 1.39 2004/05/04 15:03:28 wez Exp $ */ +/* $Id: zend_objects_API.c,v 1.40 2004/05/17 11:27:16 wez Exp $ */ #include "zend.h" #include "zend_globals.h" @@ -190,6 +190,20 @@ return EG(objects_store).object_buckets[handle].bucket.obj.object; } +/* zend_object_store_set_object: + * It is ONLY valid to call this function from within the constructor of an + * overloaded object. Its purpose is to set the object pointer for the object + * when you can't possibly know its value until you have parsed the arguments + * from the constructor function. You MUST NOT use this function for any other + * weird games, or call it at any other time after the object is constructed. + * */ +ZEND_API void zend_object_store_set_object(zval *zobject, void *object TSRMLS_DC) +{ + zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); + + EG(objects_store).object_buckets[handle].bucket.obj.object = object; +} + /* Proxy objects workings */ typedef struct _zend_proxy_object { http://cvs.php.net/diff.php/ZendEngine2/zend_objects_API.h?r1=1.12&r2=1.13&ty=u Index: ZendEngine2/zend_objects_API.h diff -u ZendEngine2/zend_objects_API.h:1.12 ZendEngine2/zend_objects_API.h:1.13 --- ZendEngine2/zend_objects_API.h:1.12 Sun Mar 21 13:27:58 2004 +++ ZendEngine2/zend_objects_API.h Mon May 17 07:27:16 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_objects_API.h,v 1.12 2004/03/21 18:27:58 stas Exp $ */ +/* $Id: zend_objects_API.h,v 1.13 2004/05/17 11:27:16 wez Exp $ */ #ifndef ZEND_OBJECTS_API_H #define ZEND_OBJECTS_API_H @@ -67,6 +67,9 @@ ZEND_API void zend_objects_store_delete_obj(zval *object TSRMLS_DC); ZEND_API zend_object_value zend_objects_store_clone_obj(zval *object TSRMLS_DC); ZEND_API void *zend_object_store_get_object(zval *object TSRMLS_DC); +/* See comment in zend_objects_API.c before you use this */ +ZEND_API void zend_object_store_set_object(zval *zobject, void *object TSRMLS_DC); + ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects TSRMLS_DC); #define ZEND_OBJECTS_STORE_HANDLERS zend_objects_store_add_ref, zend_objects_store_del_ref, zend_objects_store_clone_obj

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