[prev in list] [next in list] [prev in thread] [next in thread] 

List:       enlightenment-devel
Subject:    Re: [E-devel] Need to pass void*data to Azy_Content_Cb functions
From:       Rui Miguel Silva Seabra <rms () 1407 ! org>
Date:       2010-12-26 16:03:26
Message-ID: 4D17674E.3040709 () 1407 ! org
[Download RAW message or body]

Em 26-12-2010 06:07, Mike Blumenkrantz escreveu:
> 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<rms@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.

Ok, I just wanted to spare one function call but I see that is useless. 
I've done it the more "standard" way and it works :)

Rui


------------------------------------------------------------------------------
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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic