On Sun, 5 Dec 2010 21:07:35 -0500 Mike Blumenkrantz <m...@zentific.com> wrote:
> On Sun, 5 Dec 2010 23:54:23 -0200 > Gustavo Sverzut Barbieri <barbi...@profusion.mobi> wrote: > > > Since ur breaking API, add void*data to callbacks, otherwise u make > > bindings harder if not impossible. > > > > On Sunday, December 5, 2010, Enlightenment SVN > > <no-re...@enlightenment.org> wrote: > > > Log: > > > api break: send return value of calls to client callbacks when set > > > typedef Eina_Error (*Azy_Client_Return_Cb)(Azy_Client *cli, Azy_Content > > > *ret_content, void *ret); > > > > > > > > > Author: discomfitor > > > Date: 2010-12-05 17:45:29 -0800 (Sun, 05 Dec 2010) > > > New Revision: 55306 > > > Trac: http://trac.enlightenment.org/e/changeset/55306 > > > > > > Modified: > > > trunk/PROTO/azy/src/include/Azy.h > > > trunk/PROTO/azy/src/lib/azy_client_events.c > > > trunk/PROTO/azy/src/tests/client.c > > > trunk/PROTO/azy/src/tests/stress_client.c > > > > > > Modified: trunk/PROTO/azy/src/include/Azy.h > > > =================================================================== > > > --- trunk/PROTO/azy/src/include/Azy.h 2010-12-06 01:37:43 UTC (rev > > > 55305) +++ trunk/PROTO/azy/src/include/Azy.h 2010-12-06 01:45:29 UTC > > > (rev 55306) @@ -204,7 +204,7 @@ > > > * Function must return AZY_ERROR_NONE (0) on success, else > > > * an error number. > > > */ > > > -typedef Eina_Error (*Azy_Client_Return_Cb)(Azy_Client *, Azy_Content *); > > > +typedef Eina_Error (*Azy_Client_Return_Cb)(Azy_Client *cli, Azy_Content > > > *ret_content, void *ret); /** }@ */ > > > #ifdef __cplusplus > > > extern "C" { > > > > > > Modified: trunk/PROTO/azy/src/lib/azy_client_events.c > > > =================================================================== > > > --- trunk/PROTO/azy/src/lib/azy_client_events.c 2010-12-06 01:37:43 UTC > > > (rev 55305) +++ trunk/PROTO/azy/src/lib/azy_client_events.c 2010-12-06 > > > 01:45:29 UTC (rev 55306) @@ -116,7 +116,7 @@ > > > if (cb) > > > { > > > Eina_Error ret; > > > - ret = cb(client, content); > > > + ret = cb(client, content, content->ret); > > > > > > ecore_event_add(AZY_CLIENT_RESULT, &ret, > > > (Ecore_End_Cb)_azy_event_handler_fake_free, NULL); > > > eina_hash_del_by_key(client->callbacks, &content->id); > > > > > > Modified: trunk/PROTO/azy/src/tests/client.c > > > =================================================================== > > > --- trunk/PROTO/azy/src/tests/client.c 2010-12-06 01:37:43 UTC (rev > > > 55305) +++ trunk/PROTO/azy/src/tests/client.c 2010-12-06 01:45:29 UTC > > > (rev 55306) @@ -36,7 +36,7 @@ > > > } > > > > > > static Eina_Error > > > -_T_Test1_getBigArray_ret(Azy_Client *client, Azy_Content *content) > > > +_T_Test1_getBigArray_ret(Azy_Client *client, Azy_Content *content, void > > > *r) { > > > Eina_List *ret; > > > > > > @@ -47,7 +47,7 @@ > > > ecore_main_loop_quit(); > > > return azy_content_error_code_get(content); > > > } > > > - ret = azy_content_return_get(content); > > > + ret = r; > > > > > > if (ret) > > > printf("%i list entries\n", eina_list_count(ret)); > > > @@ -56,7 +56,7 @@ > > > } > > > > > > static Eina_Error > > > -_T_Test1_putBigArray_ret(Azy_Client *client __UNUSED__, Azy_Content > > > *content) +_T_Test1_putBigArray_ret(Azy_Client *client __UNUSED__, > > > Azy_Content *content, void *r) { > > > Eina_Bool ret; > > > > > > @@ -68,13 +68,13 @@ > > > return azy_content_error_code_get(content); > > > } > > > > > > - ret = (intptr_t)azy_content_return_get(content); > > > + ret = (intptr_t)r; > > > printf("%s: Success? %s!\n", __PRETTY_FUNCTION__, ret ? "YES" : "NO"); > > > return AZY_ERROR_NONE; > > > } > > > > > > static Eina_Error > > > -_T_Test1_getAll_ret(Azy_Client *client __UNUSED__, Azy_Content *content) > > > +_T_Test1_getAll_ret(Azy_Client *client __UNUSED__, Azy_Content *content, > > > void *r) { > > > T_AllTypes *ret; > > > > > > @@ -86,13 +86,13 @@ > > > return azy_content_error_code_get(content); > > > } > > > > > > - ret = azy_content_return_get(content); > > > + ret = r; > > > printf("%s: Success? %s!\n", __PRETTY_FUNCTION__, ret ? "YES" : "NO"); > > > return AZY_ERROR_NONE; > > > } > > > > > > static Eina_Error > > > -_T_Test1_getAllArrays_ret(Azy_Client *client __UNUSED__, Azy_Content > > > *content) +_T_Test1_getAllArrays_ret(Azy_Client *client __UNUSED__, > > > Azy_Content *content, void *r) { > > > T_AllArrays *ret; > > > > > > @@ -104,13 +104,13 @@ > > > return azy_content_error_code_get(content); > > > } > > > > > > - ret = azy_content_return_get(content); > > > + ret = r; > > > printf("%s: Success? %s!\n", __PRETTY_FUNCTION__, ret ? "YES" : "NO"); > > > return AZY_ERROR_NONE; > > > } > > > > > > static Eina_Error > > > -_T_Test2_auth_ret(Azy_Client *client __UNUSED__, Azy_Content *content) > > > +_T_Test2_auth_ret(Azy_Client *client __UNUSED__, Azy_Content *content, > > > void *r) { > > > Eina_Bool ret; > > > > > > @@ -122,13 +122,13 @@ > > > return azy_content_error_code_get(content); > > > } > > > > > > - ret = (intptr_t)azy_content_return_get(content); > > > + ret = (intptr_t)r; > > > printf("%s: Success? %s!\n", __PRETTY_FUNCTION__, ret ? "YES" : "NO"); > > > return AZY_ERROR_NONE; > > > } > > > > > > static Eina_Error > > > -_T_Test1_undefined_ret(Azy_Client *client __UNUSED__, Azy_Content > > > *content) +_T_Test1_undefined_ret(Azy_Client *client __UNUSED__, > > > Azy_Content *content, void *r __UNUSED__) { > > > if (azy_content_error_is_set(content)) > > > printf("Error encountered: %s\n", > > > azy_content_error_message_get(content)); > > > > > > Modified: trunk/PROTO/azy/src/tests/stress_client.c > > > =================================================================== > > > --- trunk/PROTO/azy/src/tests/stress_client.c 2010-12-06 01:37:43 UTC > > > (rev 55305) +++ trunk/PROTO/azy/src/tests/stress_client.c 2010-12-06 > > > 01:45:29 UTC (rev 55306) @@ -35,7 +35,7 @@ > > > > > > #ifdef HAVE_MYSQL > > > static Eina_Error > > > -T_SQL_test_ret(Azy_Client *client __UNUSED__, Azy_Content *content) > > > +ret_(Azy_Client *client __UNUSED__, int type __UNUSED__, Azy_Content > > > *content) { > > > > > > static int x; > > > @@ -55,7 +55,7 @@ > > > #else > > > > > > static Eina_Error > > > -T_Test1_getAll_ret(Azy_Client *client __UNUSED__, Azy_Content *content) > > > +ret_(Azy_Client *client __UNUSED__, int type __UNUSED__, Azy_Content > > > *content) { > > > static int x; > > > T_AllTypes *ret; > > > @@ -102,12 +102,10 @@ > > > ret = T_SQL_test(ev, err, NULL); > > > if (check_err(err) || (!ret)) > > > goto error; > > > - azy_client_callback_set(ev, ret, T_SQL_test_ret); > > > #else > > > ret = T_Test1_getAll(ev, err, NULL); > > > if (check_err(err) || (!ret)) > > > goto error; > > > - azy_client_callback_set(ev, ret, T_Test1_getAll_ret); > > > #endif > > > } > > > azy_content_free(err); > > > @@ -158,7 +156,8 @@ > > > > > > ecore_job_add(spawn, NULL); > > > ecore_event_handler_add(AZY_CLIENT_CONNECTED, > > > (Ecore_Event_Handler_Cb)connected, NULL); > > > - ecore_event_handler_add(AZY_CLIENT_CONNECTED, > > > (Ecore_Event_Handler_Cb)disconnected, NULL); > > > + ecore_event_handler_add(AZY_CLIENT_RETURN, > > > (Ecore_Event_Handler_Cb)ret_, NULL); > > > + ecore_event_handler_add(AZY_CLIENT_DISCONNECTED, > > > (Ecore_Event_Handler_Cb)disconnected, NULL); ecore_main_loop_begin(); > > > > > > EINA_LIST_FREE(clients, cli) > > > > > > > > > ------------------------------------------------------------------------------ > > > What happens now with your Lotus Notes apps - do you make another costly > > > upgrade, or settle for being marooned without product support? Time to > > > move off Lotus Notes and onto the cloud with Force.com, apps are easier > > > to build, use, and manage than apps on traditional platforms. Sign up for > > > the Lotus Notes Migration Kit to learn more. > > > http://p.sf.net/sfu/salesforce-d2d > > > _______________________________________________ enlightenment-svn mailing > > > list enlightenment-...@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > > > > > > void *data exists already, just not in this context. azy_client_call is never > meant to be used directly. > I've updated client.c to demonstrate. -- Mike Blumenkrantz Zentific: We run the three-legged race individually. ------------------------------------------------------------------------------ What happens now with your Lotus Notes apps - do you make another costly upgrade, or settle for being marooned without product support? Time to move off Lotus Notes and onto the cloud with Force.com, apps are easier to build, use, and manage than apps on traditional platforms. Sign up for the Lotus Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel