Re: generation user classes by the API

From: Date: Wed, 15 Nov 2000 13:39:21 +0000
Subject: Re: generation user classes by the API
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-38136@lists.php.net to get a copy of this message
thanks for the replaying, being spending some hours trying hack the code, the only thing i found is that i did't explain myself well. lets say i have this simple php code: ////////////////////////////////////////////// class a{ var $a; function a($a){ $this->a=$a; } } function do_a(){ $a = new a(1); } //////////////////////////////////////////////// now for some reasons [do_a() is complex string manipulation function] i wrote do_a() in C. those lines (taken from dir.c): // INIT_CLASS_ENTRY(dir_class_entry, "Directory", php_dir_class_functions); dir_class_entry_ptr = zend_register_internal_class(&dir_class_entry); object_init_ex(return_value, dir_class_entry_ptr); add_property_stringl(return_value, "path", (*arg)->value.str.val, (*arg)->value.str.len, 1); add_property_resource(return_value, "handle", dirp->id); // as i understood, used for creating new object but not referring to object that allready exist (by the *php* script). if i wrong here please correct me. so my questions are: 1. how i can get the dir_class_entry_ptr pointer of class that allready exist. 2. how to call this object function (constructor function this case) coz the object_init_ex() doesnt seem do it automatically. -- moshe. mosdoron@netvision.net.il icq: 1542485 <chrisv@b0rked.dhs.org> wrote in message news:Pine.LNX.4.21.0011130843330.13806-100000@b0rked.dhs.org... > On Mon, 13 Nov 2000, moshe doron wrote: > > > hi. > > > > can i generate classes from the c code like i can do it with the > > ZEND_API int call_user_function_ex() function? > > > > It's possible to do -- read ext/standard/dir.c for an example. > > Chris > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.dev (#38136) next »