From 6ecc14ffabcffb69aa938a67940db48272e05046 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Thu, 13 Mar 2003 03:52:58 +0000 Subject: 2003-03-12 Havoc Pennington Throughout: purge global variables, introduce BusActivation, BusConnections, BusRegistry, etc. objects instead. * bus/bus.h, bus/bus.c: introduce BusContext as a global message bus object * test/Makefile.am (TEST_BINARIES): disable bus-test for now, going to redo this a bit differently I think --- bus/services.h | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'bus/services.h') diff --git a/bus/services.h b/bus/services.h index 97583582..5e9ece18 100644 --- a/bus/services.h +++ b/bus/services.h @@ -27,26 +27,29 @@ #include #include #include "connection.h" - -/* forward decl that probably shouldn't be in this file */ -typedef struct BusTransaction BusTransaction; - -/* Each service can have multiple owners; one owner is the "real - * owner" and the others are queued up. For example, if I have - * multiple text editors open, one might own the TextEditor service; - * if I close that one, the next in line will become the owner of it. - */ - -typedef struct BusService BusService; +#include "bus.h" typedef void (* BusServiceForeachFunction) (BusService *service, void *data); -BusService* bus_service_lookup (const DBusString *service_name); -BusService* bus_service_ensure (const DBusString *service_name, - DBusConnection *owner_if_created, - BusTransaction *transaction, - DBusError *error); +BusRegistry* bus_registry_new (void); +void bus_registry_ref (BusRegistry *registry); +void bus_registry_unref (BusRegistry *registry); +BusService* bus_registry_lookup (BusRegistry *registry, + const DBusString *service_name); +BusService* bus_registry_ensure (BusRegistry *registry, + const DBusString *service_name, + DBusConnection *owner_if_created, + BusTransaction *transaction, + DBusError *error); +void bus_registry_foreach (BusRegistry *registry, + BusServiceForeachFunction function, + void *data); +dbus_bool_t bus_registry_list_services (BusRegistry *registry, + char ***listp, + int *array_len); + + dbus_bool_t bus_service_add_owner (BusService *service, DBusConnection *owner, BusTransaction *transaction, @@ -62,10 +65,5 @@ void bus_service_set_prohibit_replacement (BusService dbus_bool_t prohibit_replacement); dbus_bool_t bus_service_get_prohibit_replacement (BusService *service); const char* bus_service_get_name (BusService *service); -void bus_service_foreach (BusServiceForeachFunction function, - void *data); - - -char **bus_services_list (int *array_len); #endif /* BUS_SERVICES_H */ -- cgit