Date: 09/13/00
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #6715 Updated: db.c ver 1.43 is not working properly on windows"
- Previous message: helio <email protected>: "[PHP-DEV] PHP 4.0 Bug #6717: db.c ver 1.43 is not working properly on windows"
- In reply to: Sterling Hughes: "Re: [PHP-DEV] Newbie creating extension"
- Next in thread: Sterling Hughes: "Re: [PHP-DEV] Newbie creating extension"
- Reply: Sterling Hughes: "Re: [PHP-DEV] Newbie creating extension"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Sounds good except for add_assoc_zval which I would make (ar, name,
namelength, val). I'll try and add them this evening.
Andi
At 04:14 PM 9/12/00 -0400, Sterling Hughes wrote:
>I find the zend_hash_* functions perfect for my uses. :-)
>
>
>If we were to abstract them i'd suggest
>
>add_index_zval
>add_next_index_zval
>add_assoc_zval
>
>That way it wouldn't have to just be used for arrays.
>
>#define add_index_zval(ar, i, val) \
> zend_hash_index_update((ar)->value.ht, i, &(val), sizeof(zval *), NULL);
>#deine add_next_index_zval(ar, val) \
> zend_hash_next_index_insert((ar)->value.ht, &(val), sizeof(zval *),
> NULL);
>#defne add_assoc_zval(ar, name, val) \
> zend_hash_add((ar)->value.ht, name, strlen(name) + 1, &(val), sizeof(zval
>*), NULL);
>
>
>-Sterling
>
> > Well we could maybe do an add_assoc_array() or something like that.
> > Maybe we can make a list of what would be useful to have and decide what
> > should be implemented and what not.
> >
> > Andi
> >
> > At 03:18 PM 9/12/00 -0400, Sterling Hughes wrote:
> > >Example:
> > >
> > >{
> > > zval *tmp, *ar;
> > >
> > > array_init(tmp);
> > > array_init(ar);
> > >
> > > add_assoc_long(tmp, "someval", 32);
> > >
> > > zend_hash_next_index_insert(ar->value.ht, &tmp, sizeof(zval *),
> NULL);
> > >}
> > >
> > >Moral:
> > >
> > > Use the zend_hash_* functions to perform advanced operations.
> > >
> > >-Sterling
> > >
> > >
> > >
> > > > Quick question all,
> > > > I have succesfully created an extension for PHP and everything seems
> > > to work
> > >correctly, except I am unsure how to return a multi-dimensional array.
> I am
> > >currently returning a single dimension array fine, but I haven't found any
> > >documentation on how to create a multi-dimension array. One would think in
>the
> > >add_index_<whatever> functions that the index argument would allow
> this. Am I
> > >missing something? Please let me know.
> > > >
> > > > -=-=-=-=-=-=-=-=-=-=-=-=-=-
> > > > Jason Woods
> > > > Structus Technologies, Inc.
> > > > jwoods <email protected>
> > > >
> > > >
> > > > --
> > > > Webmail provided by ISLC
> > > >
> > > > http://www.islc.net
> > > >
> > > >
> > > >
> > > > --
> > > > PHP Development Mailing List <http://www.php.net/>
> > > > To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
> > > > For additional commands, e-mail: php-dev-help <email protected>
> > > > To contact the list administrators, e-mail:
> php-list-admin <email protected>
> > > >
> > > >
> > >
> > >
> > >--
> > >PHP Development Mailing List <http://www.php.net/>
> > >To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
> > >For additional commands, e-mail: php-dev-help <email protected>
> > >To contact the list administrators, e-mail: php-list-admin <email protected>
> >
> > ---
> > Andi Gutmans <andi <email protected>>
> > http://www.zend.com/
> >
--- Andi Gutmans <andi <email protected>> http://www.zend.com/-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #6715 Updated: db.c ver 1.43 is not working properly on windows"
- Previous message: helio <email protected>: "[PHP-DEV] PHP 4.0 Bug #6717: db.c ver 1.43 is not working properly on windows"
- In reply to: Sterling Hughes: "Re: [PHP-DEV] Newbie creating extension"
- Next in thread: Sterling Hughes: "Re: [PHP-DEV] Newbie creating extension"
- Reply: Sterling Hughes: "Re: [PHP-DEV] Newbie creating extension"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

