Re: [PHP-DEV] Extension help

2001-03-20 Thread Barry Mitchelson
ok, I have managed to add a member variable, but am having problems when i try to retreive it using zend_find_hash here's the code : for the extension : PHP_FUNCTION(create_object) { ... other stuff add_property_string(return_value,"foo","hello!",1); ... other stuff

RE: [PHP-DEV] Extension help

2001-03-20 Thread Marc Boeren
zend_hash_find(obj-value.obj.properties,"foo",sizeof("foo"),(void**)tmpSt ring); You're almost correct, sizeof("foo") should be sizeof("foo")+1 Cheerio, Marc. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: [PHP-DEV] Extension help

2001-03-20 Thread Barry Mitchelson
On Tue, Mar 20, 2001 at 03:24:00PM +0100, Marc Boeren wrote: zend_hash_find(obj-value.obj.properties,"foo",sizeof("foo"),(void**)tmpSt ring); You're almost correct, sizeof("foo") should be sizeof("foo")+1 hmm... still not working :( Cheerio, Marc. -- PHP Development Mailing

RE: [PHP-DEV] Extension help

2001-03-20 Thread Marc Boeren
You're almost correct, sizeof("foo") should be sizeof("foo")+1 hmm... still not working :( My fault for not reading on beyond the first typo: zend_printf("foo = %s",tmpString); should probably be zend_printf("foo = %s", (*tmpString)-value.str.val); but I may be wrong on the level of

Re: [PHP-DEV] Extension help

2001-03-20 Thread Barry Mitchelson
On Tue, Mar 20, 2001 at 03:59:29PM +0100, Marc Boeren wrote: You're almost correct, sizeof("foo") should be sizeof("foo")+1 hmm... still not working :( My fault for not reading on beyond the first typo: zend_printf("foo = %s",tmpString); should probably be zend_printf("foo =

RE: [PHP-DEV] Extension help

2001-03-20 Thread Marc Boeren
Hi! even though i did convert_to_string_ex(tmpString) ? You should still do that, but the only thing that really does is set the zval type to IS_STRING, and the value union is set accordingly (instead of e.g. a long in value.lval, you get the value as a string in value.str.val (and the

Re: [PHP-DEV] Extension help

2001-03-20 Thread Stanislav Malyshev
BM but I may be wrong on the level of indirection. BM The zval cannot automagically be put in a %s and treated as a string, you BM should manually extract the pointer to the actual string. BM BM even though i did convert_to_string_ex(tmpString) ? The convert_to_string_ex makes tmpString to be

[PHP-DEV] Extension help mailing list???

2001-03-20 Thread Marc Boeren
is there full documentation of the Zend API - i found the stuff on the zend website to be useful, but didn't cover everything. If there is, I couldn't find it either. So it's that and the source code itself. If anyone knows about more documentation, could someone put it up (or just a

Re: [PHP-DEV] Extension help

2001-03-20 Thread Barry Mitchelson
On Tue, Mar 20, 2001 at 05:15:58PM +0100, Marc Boeren wrote: BTW, (*tmpString)-value.str.val == Z_STRVAL_PP(tmpString) but the latter looks much nicer :) Granted, but that's what happens if you just examine the code and don't read the documentation :-) is there full documentation of the

Re: [PHP-DEV] Extension help mailing list???

2001-03-20 Thread Stanislav Malyshev
MB If there is, I couldn't find it either. The docs are at http://www.zend.com/apidoc/ -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: [PHP-DEV] Extension help

2001-03-20 Thread Barry Mitchelson
On Tue, Mar 20, 2001 at 06:48:39PM +0200, Stanislav Malyshev wrote: BM is there full documentation of the Zend API - i found the stuff BM on the zend website to be useful, but didn't cover everything. Well, that's the most full one that exists. Eventually, it should be extended to cover the

Re: [PHP-DEV] Extension help

2001-03-20 Thread Sterling Hughes
On Tue, 20 Mar 2001, Barry Mitchelson wrote: ok, I have managed to add a member variable, but am having problems when i try to retreive it using zend_find_hash here's the code : for the extension : PHP_FUNCTION(create_object) { ... other stuff

[PHP-DEV] Extension help

2001-03-19 Thread Barry Mitchelson
hey, I'm writing an extension which defines a class. In the constructor, I'd like to create a member variable which I can then access with the other member functions in my extension. In php it would be like : class foo { var $m_bar; function foo() {

Re: [PHP-DEV] Extension help

2001-03-19 Thread Sterling Hughes
On Mon, 19 Mar 2001, Barry Mitchelson wrote: hey, I'm writing an extension which defines a class. In the constructor, I'd like to create a member variable which I can then access with the other member functions in my extension. In php it would be like : class foo { var