Zend API question

From: Date: Thu, 30 Aug 2001 03:55:55 +0000
Subject: Zend API question
Groups: php.dev 
Request: Send a blank email to php-dev+get-64678@lists.php.net to get a copy of this message
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 (#64678) next »