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));
}
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]