Enlightenment CVS committal Author : sebastid Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/bin Modified Files: ecore_dbus_hal_test.c ecore_dbus_test.c Log Message: Add error callback =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/bin/ecore_dbus_hal_test.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ecore_dbus_hal_test.c 27 Jul 2006 15:06:13 -0000 1.3 +++ ecore_dbus_hal_test.c 27 Jul 2006 15:28:43 -0000 1.4 @@ -8,10 +8,9 @@ static int ecore_dbus_event_server_add(void *udata, int ev_type, void *ev); static int ecore_dbus_event_server_del(void *udata, int ev_type, void *ev); -static void ecore_dbus_method_name_has_owner_cb(void *data, Ecore_DBus_Message_Type type, - Ecore_DBus_Method_Return *reply); -static void ecore_dbus_method_add_match_cb(void *data, Ecore_DBus_Message_Type type, - Ecore_DBus_Method_Return *reply); +static void ecore_dbus_method_name_has_owner_cb(void *data, Ecore_DBus_Method_Return *reply); +static void ecore_dbus_method_add_match_cb(void *data, Ecore_DBus_Method_Return *reply); +static void ecore_dbus_method_error_cb(void *data, const char *error); static int ecore_dbus_event_server_signal(void *udata, int ev_type, void *ev); @@ -63,7 +62,8 @@ event = ev; printf("ecore_dbus_event_server_add\n"); ecore_dbus_method_name_has_owner(event->server, "org.freedesktop.Hal", - ecore_dbus_method_name_has_owner_cb, NULL); + ecore_dbus_method_name_has_owner_cb, + ecore_dbus_method_error_cb, NULL); return 0; } @@ -80,15 +80,9 @@ } static void -ecore_dbus_method_name_has_owner_cb(void *data, Ecore_DBus_Message_Type type, - Ecore_DBus_Method_Return *reply) +ecore_dbus_method_name_has_owner_cb(void *data, Ecore_DBus_Method_Return *reply) { unsigned int *exists; - if (type != ECORE_DBUS_MESSAGE_TYPE_METHOD_RETURN) - { - ecore_main_loop_quit(); - return; - } printf("ecore_dbus_event_server_method_return %s %s.%s\n", event_type_get(reply->type), reply->header.interface, reply->header.member); @@ -107,24 +101,26 @@ "interface='org.freedesktop.Hal.Manager'," "sender='org.freedesktop.Hal'," "path='/org/freedesktop/Hal/Manager'", - ecore_dbus_method_add_match_cb, NULL); + ecore_dbus_method_add_match_cb, + ecore_dbus_method_error_cb, NULL); } } static void -ecore_dbus_method_add_match_cb(void *data, Ecore_DBus_Message_Type type, - Ecore_DBus_Method_Return *reply) +ecore_dbus_method_add_match_cb(void *data, Ecore_DBus_Method_Return *reply) { - if (type != ECORE_DBUS_MESSAGE_TYPE_METHOD_RETURN) - { - ecore_main_loop_quit(); - return; - } printf("ecore_dbus_event_server_method_return %s %s.%s\n", event_type_get(reply->type), reply->header.interface, reply->header.member); printf("Should be listening for device changes!\n"); +} + +static void +ecore_dbus_method_error_cb(void *data, const char *error) +{ + printf("Error: %s\n", error); + ecore_main_loop_quit(); } static int =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/bin/ecore_dbus_test.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- ecore_dbus_test.c 27 Jul 2006 15:06:13 -0000 1.9 +++ ecore_dbus_test.c 27 Jul 2006 15:28:43 -0000 1.10 @@ -8,11 +8,10 @@ static int ecore_dbus_event_server_add(void *udata, int ev_type, void *ev); static int ecore_dbus_event_server_del(void *udata, int ev_type, void *ev); -static void ecore_dbus_method_list_names_cb(void *data, - Ecore_DBus_Message_Type type, - Ecore_DBus_Method_Return *ev); +static void ecore_dbus_method_list_names_cb(void *data, Ecore_DBus_Method_Return *reply); +static void ecore_dbus_method_error_cb(void *data, const char *error); -static const char * event_type_get(Ecore_DBus_Message_Type type); +static const char *event_type_get(Ecore_DBus_Message_Type type); static Ecore_DBus_Server *svr = NULL; @@ -56,7 +55,9 @@ event = ev; printf("ecore_dbus_event_server_add\n"); - ecore_dbus_method_list_names(event->server, ecore_dbus_method_list_names_cb, NULL); + ecore_dbus_method_list_names(event->server, + ecore_dbus_method_list_names_cb, + ecore_dbus_method_error_cb, NULL); return 0; } @@ -74,7 +75,6 @@ static void ecore_dbus_method_list_names_cb(void *data, - Ecore_DBus_Message_Type type, Ecore_DBus_Method_Return *reply) { Ecore_List *names; @@ -96,7 +96,13 @@ ecore_list_destroy(names); } ecore_main_loop_quit(); - return 0; +} + +static void +ecore_dbus_method_error_cb(void *data, const char *error) +{ + printf("Error: %s\n", error); + ecore_main_loop_quit(); } static const char * ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs