From: Enlightenment C. <no...@cv...> - 2007-07-11 00:48:34
|
Enlightenment CVS committal Author : rephorm Project : e17 Module : proto Dir : e17/proto/e_dbus/src/lib/notification Modified Files: e_notify_private.h marshal.c Log Message: use const char ** instead of a list for capabilities =================================================================== RCS file: /cvs/e/e17/proto/e_dbus/src/lib/notification/e_notify_private.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- e_notify_private.h 11 Jul 2007 00:48:25 -0000 1.4 +++ e_notify_private.h 11 Jul 2007 00:48:33 -0000 1.5 @@ -15,10 +15,11 @@ void e_notify_marshal_dict_byte(DBusMessageIter *iter, const char *key, char value); void e_notify_marshal_dict_int(DBusMessageIter *iter, const char *key, int value); +void e_notify_marshal_string_array(DBusMessageIter *iter, const char **strings); void e_notify_marshal_string_list_as_array(DBusMessageIter *iter, Ecore_List *strings); Ecore_List * e_notify_unmarshal_string_array_as_list(DBusMessageIter *iter, DBusError *err); DBusMessage * e_notify_marshal_get_capabilities(); -DBusMessage * e_notify_marshal_get_capabilities_return(DBusMessage *method_call, Ecore_List *capabilities); +DBusMessage * e_notify_marshal_get_capabilities_return(DBusMessage *method_call, const char **capabilities); E_Notification_Return_Get_Capabilities * e_notify_unmarshal_get_capabilities_return(DBusMessage *msg, DBusError *err); DBusMessage * e_notify_marshal_get_server_information(); DBusMessage * e_notify_marshal_get_server_information_return(DBusMessage *method_call, const char *name, const char *vendor, const char *version); =================================================================== RCS file: /cvs/e/e17/proto/e_dbus/src/lib/notification/marshal.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- marshal.c 11 Jul 2007 00:47:19 -0000 1.5 +++ marshal.c 11 Jul 2007 00:48:33 -0000 1.6 @@ -60,6 +60,20 @@ } void +e_notify_marshal_string_array(DBusMessageIter *iter, const char **strings) +{ + const char **str; + DBusMessageIter arr; + + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "s", &arr); + + for (str = strings; *str; str++) + dbus_message_iter_append_basic(&arr, DBUS_TYPE_STRING, str); + + dbus_message_iter_close_container(iter, &arr); +} + +void e_notify_marshal_string_list_as_array(DBusMessageIter *iter, Ecore_List *strings) { const char *str; @@ -113,14 +127,14 @@ } DBusMessage * -e_notify_marshal_get_capabilities_return(DBusMessage *method_call, Ecore_List *capabilities) +e_notify_marshal_get_capabilities_return(DBusMessage *method_call, const char **capabilities) { DBusMessage *msg; DBusMessageIter iter; msg = dbus_message_new_method_return(method_call); dbus_message_iter_init_append(msg, &iter); - e_notify_marshal_string_list_as_array(&iter, capabilities); + e_notify_marshal_string_array(&iter, capabilities); return msg; } |