I have added a CC to edevel in case someone else has this question in the
future.

On Sun, 26 Dec 2010 02:02:30 +0000
Rui Miguel Silva Seabra <r...@1407.org> wrote:

> How do I pass data to Azy_Content_Cb functions?
> 
> Azy defines blank as...
> 
>     EAPI Azy_Client_Call_Id azy_client_blank(Azy_Client       *client,
>                                              Azy_Net_Type      type,
>                                              const char       *uri,
>                                              Azy_Content_Cb    cb,
>                                              void             *data);
> 
> And...
> 
> typedef void *(*Azy_Content_Cb)(Azy_Value *, void **);
> 
> 
> This is how I use it...
> 
>      id = azy_client_blank(cli, AZY_NET_TYPE_GET, NULL, 
> (Azy_Content_Cb)azy_value_to_Array_statusnet_Status, &data);
> 
> And in my function...
> 
> Eina_Bool azy_value_to_Array_statusnet_Status(Azy_Value *array, void* 
> *data) {
> }
This is wrong.  The way that the generated conversion functions (such as the
above) work is as follows:
Azy_Value struct is param #1
Pointer to conversion type struct pointer is param #2 (in this case
&(statusnet_Status*))
If successful, function will return EINA_TRUE, and the statusnet_Status* object
can be used since conversion was successful.  If the function returns
EINA_FALSE for any reason, the object will be NULL and an error must be
presented.
> 
> Data is *not* what I sent in _blank() :|
> 
> Rui
Data should not be passed to conversion functions, as they are autogenerated
and exist SOLELY for the purpose of converting.  If you read through
azy_client_events.c a little, you will see that conversion functions, if
specified, are called just prior to the main client event/callback is handled
(callback taking priority over event if existing).
User data passed in azy_client_blank is handled like user data passed to
generated rpc functions: you must call azy_content_data_get on the content
presented in the event/callback to retrieve it.

-- 
Mike Blumenkrantz
Zentific: We run the three-legged race individually.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to