Re: Zend API question

From: Date: Thu, 30 Aug 2001 04:07:21 +0000
Subject: Re: Zend API question
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-64679@lists.php.net to get a copy of this message
Ack...I saw the problem right after I hit send.  I guess the compiler error
had me looking at the wrong argument (rsrc not **rsrc).  I'd still
appreicate an explaination of ZEND_FETCH_RESOURCE though.

--Ricky


"Ricky Dhatt" <ricky@ea1.com> wrote in message
news:20010830043154.99457.qmail@pb1.pair.com...
> I'm writing my own extension and using the Zend API docs at Zend.com. They
> are very vague on using resources. I can create/destory them just fine,
but
> the docs
> leave out exactly how access the resource data. I've been looking at
> ext/curl/curl.c and ext/crack/crack.c for guidance but I can't get
> ZEND_FETCH_RESOURCE to work:
>
> ics.c:75: incompatible type for argument 1 of `zend_fetch_resource'
>
> Rasmus mentioned that argument 1 should be of type zval **, but that
doesn't
> seem
> consistant with the source I looked at? If someone could explain how
> ZEND_FETCH_RESOURCE works I'd be grateful.
>
> ZEND_FUNCTION(ics_fadd)      /* simplified  */
> {
>         zval **rsrc, **arg2, **arg3;
>         ics_msg *resource;     /* a struct */
>
>         if((ZEND_NUM_ARGS() != 3) || (zend_get_parameters_ex(3, &rsrc,
> &arg2, &arg3) != SUCCESS))
>         {  WRONG_PARAM_COUNT; }
>
>    ZEND_FETCH_RESOURCE(resource, ics_msg *, **rsrc, -1, le_ics_name,
> le_ics);
>
>    RETURN_LONG(ics_fadd(resource));
> }
>
>




Thread (2 messages)

« previous php.dev (#64679) next »