Re: [PHP4BETA] Extending PHP, Zend API
| From: | Paul S. Gumerman | Date: | Tue, 07 Mar 2000 20:13:29 +0000 |
| Subject: | Re: [PHP4BETA] Extending PHP, Zend API | ||
| References: | 1 2 3 4 5 6 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-11706@lists.php.net to get a copy of this message | ||
Andrei,
But there is no add_*() function for arrays, so I'm concerned that the arrays that I create
inside my extension function are local to the function, and so causing the overrun errors
that I'm seeing in the log.
Paul
Andrei Zmievski wrote:
>
> If you use add_*() functions then they should set refcounts already.
> >From the code you posted, everything seems fine, just use (void **) to
> cast &arr...
>
> -Andrei
>
> "C combines all the power of assembly language with
> all the ease of use of assembly language" -- trad
>
> On Tue, 07 Mar 2000, Paul S. Gumerman wrote:
> > What do I need to do to make an array that is created within my extension module
> > function have global scope (and persistance)?
> >
> > Here's the current code:
> >
> >
> > int read_response(zval *response) {
> > zval *arr;
> > .
> > .
> > .
> >
> > case LTARRAY:
> > MAKE_STD_ZVAL(arr);
> > array_init(arr);
> >
> > if (read_response(arr) == FAILURE)
> > return FAILURE;
> >
> > if (*varname)
> > zend_hash_update(response->value.ht, varname, strlen(varname) + 1, (void *)
> > &arr, sizeof(zval *), NULL);
> > else
> > zend_hash_next_index_insert(response->value.ht, &arr, sizeof(zval *),
> > NULL);
> > break;
> >
> > Once I've got that right, do I need to do anything with the scalar objects I put in
> > it
> > to make them persist until the script exits?
>
> --
> PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net
> For additional commands, e-mail: php4beta-help@lists.php.net
> To contact the list administrators, e-mail: php4beta-admin@lists.php.net
>
> -------------------------------------------------------------------------
> This email server is running an evaluation copy of the MailShield anti-
> spam software. Please contact your email administrator if you have any
> questions about this message. MailShield product info: www.mailshield.com