Re: [PHP4BETA] access to $this->myvar from C

From: Date: Tue, 01 Feb 2000 19:28:51 +0000
Subject: Re: [PHP4BETA] access to $this->myvar from C
References: 1 2  Groups: php.version4 
Request: Send a blank email to php-version4+get-9638@lists.php.net to get a copy of this message
On Tue, 01 Feb 2000, php@home.uh.nu wrote: > > On Tue, 01 Feb 2000, php@home.uh.nu wrote: > > > > On Tue, 01 Feb 2000, php@home.uh.nu wrote: > > > > > hehe that would work in php of course. I guess I didn't explain it > > > > > well. > > > > > the myc_wrapper function is a C function that lives in a .so php > > > > > extension library. > > > > > > > > You could still pass the object to the function and then modify its > > > > properties hash. > > > --ok. Do you know of any example source I can see that does something > > > similar to this. There just isn't ANY decent docs on this stuff. > > > > > > Thanks so much for your help. > > > > No problem. Check out _php_do_opendir function in ext/standard/dir.c > > file. > --ok so it looks like _php_do_opendir creates an object to pass back and doesn't > use a object ptr passed in.... > At the point where I am calling my C function, I am inside a php object that > has already been created. I just need to be able to write data back to the > php object in some class variables that are already defined. Is there some > other way I should be doing this? > The C function that I'm calling already takes about 15 parameters, and I need to > pass back another 15 or so different parameters. Thats the reason I'm tryiing to > get access to the $this->variable1, $this->var2 and so on. The fact that you're calling your C function from inside an object has no bearing on what parameters are passed to it. You'd need to pass $this to the function and then in the C function itself receive that object parameter just like any others and then use its properties hash to add stuff to. -Andrei * George Orwell was an optimist. *

« previous php.version4 (#9638) next »