From a088c98546d9d39d8d7fc26c8a55567677205d0e Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Mon, 12 Nov 2012 16:07:01 +0000 Subject: [PATCH] edbus: move function up - no fwd declaration when not needed SVN revision: 79177 --- src/lib/edbus_service.c | 57 ++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/src/lib/edbus_service.c b/src/lib/edbus_service.c index 109ef60..33ce0cc 100644 --- a/src/lib/edbus_service.c +++ b/src/lib/edbus_service.c @@ -52,7 +52,6 @@ static DBusHandlerResult _object_handler(DBusConnection *conn, DBusMessage *mess static void _object_free(EDBus_Service_Object *obj); static void _interface_free(EDBus_Service_Interface *interface); static void _on_connection_free(void *data, const void *dead_pointer); -static EDBus_Service_Object *_edbus_service_object_parent_find(EDBus_Service_Object *obj); static DBusObjectPathVTable vtable = { _object_unregister, @@ -488,6 +487,34 @@ edbus_service_shutdown(void) } static EDBus_Service_Object * +_edbus_service_object_parent_find(EDBus_Service_Object *obj) +{ + size_t len = strlen(obj->path); + char *path = strdup(obj->path); + char *slash; + + for (slash = path[len] != '/' ? &path[len - 1] : &path[len - 2]; + slash > path; slash--) + { + EDBus_Service_Object *parent = NULL; + + if (*slash != '/') + continue; + + *slash = '\0'; + + if (dbus_connection_get_object_path_data(obj->conn->dbus_conn, path,(void **)&parent) && parent != NULL) + { + free(path); + return parent; + } + } + + free(path); + return NULL; +} + +static EDBus_Service_Object * _edbus_service_object_add(EDBus_Connection *conn, const char *path) { EDBus_Service_Object *obj, *aux; @@ -1092,31 +1119,3 @@ edbus_service_property_invalidate_set(EDBus_Service_Interface *iface, const char iface->prop_invalidated = eina_array_new(1); return eina_array_push(iface->prop_invalidated, prop); } - -static EDBus_Service_Object * -_edbus_service_object_parent_find(EDBus_Service_Object *obj) -{ - size_t len = strlen(obj->path); - char *path = strdup(obj->path); - char *slash; - - for (slash = path[len] != '/' ? &path[len - 1] : &path[len - 2]; - slash > path; slash--) - { - EDBus_Service_Object *parent = NULL; - - if (*slash != '/') - continue; - - *slash = '\0'; - - if (dbus_connection_get_object_path_data(obj->conn->dbus_conn, path,(void **)&parent) && parent != NULL) - { - free(path); - return parent; - } - } - - free(path); - return NULL; -} -- 2.7.4