1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* services.h Service management
4 * Copyright (C) 2003 Red Hat, Inc.
6 * Licensed under the Academic Free License version 2.1
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #ifndef BUS_SERVICES_H
25 #define BUS_SERVICES_H
27 #include <dbus/dbus.h>
28 #include <dbus/dbus-string.h>
29 #include <dbus/dbus-hash.h>
30 #include "connection.h"
33 typedef void (* BusServiceForeachFunction) (BusService *service,
36 BusRegistry* bus_registry_new (BusContext *context);
37 BusRegistry* bus_registry_ref (BusRegistry *registry);
38 void bus_registry_unref (BusRegistry *registry);
39 BusService* bus_registry_lookup (BusRegistry *registry,
40 const DBusString *service_name);
41 BusService* bus_registry_ensure (BusRegistry *registry,
42 const DBusString *service_name,
43 DBusConnection *owner_if_created,
44 BusTransaction *transaction,
46 void bus_registry_foreach (BusRegistry *registry,
47 BusServiceForeachFunction function,
49 dbus_bool_t bus_registry_list_services (BusRegistry *registry,
52 dbus_bool_t bus_registry_acquire_service (BusRegistry *registry,
53 DBusConnection *connection,
54 const DBusString *service_name,
56 dbus_uint32_t *result,
57 BusTransaction *transaction,
59 dbus_bool_t bus_registry_set_service_context_table (BusRegistry *registry,
60 DBusHashTable *table);
62 BusService* bus_service_ref (BusService *service);
63 void bus_service_unref (BusService *service);
64 dbus_bool_t bus_service_add_owner (BusService *service,
65 DBusConnection *owner,
66 BusTransaction *transaction,
68 dbus_bool_t bus_service_remove_owner (BusService *service,
69 DBusConnection *owner,
70 BusTransaction *transaction,
72 dbus_bool_t bus_service_has_owner (BusService *service,
73 DBusConnection *owner);
74 DBusConnection* bus_service_get_primary_owner (BusService *service);
75 void bus_service_set_prohibit_replacement (BusService *service,
76 dbus_bool_t prohibit_replacement);
77 dbus_bool_t bus_service_get_prohibit_replacement (BusService *service);
78 const char* bus_service_get_name (BusService *service);
81 #endif /* BUS_SERVICES_H */