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 1.2
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 "connection.h"
32 typedef void (* BusServiceForeachFunction) (BusService *service,
35 BusRegistry* bus_registry_new (BusContext *context);
36 void bus_registry_ref (BusRegistry *registry);
37 void bus_registry_unref (BusRegistry *registry);
38 BusService* bus_registry_lookup (BusRegistry *registry,
39 const DBusString *service_name);
40 BusService* bus_registry_ensure (BusRegistry *registry,
41 const DBusString *service_name,
42 DBusConnection *owner_if_created,
43 BusTransaction *transaction,
45 void bus_registry_foreach (BusRegistry *registry,
46 BusServiceForeachFunction function,
48 dbus_bool_t bus_registry_list_services (BusRegistry *registry,
51 dbus_bool_t bus_registry_acquire_service (BusRegistry *registry,
52 DBusConnection *connection,
53 const DBusString *service_name,
55 dbus_uint32_t *result,
56 BusTransaction *transaction,
59 void bus_service_ref (BusService *service);
60 void bus_service_unref (BusService *service);
61 dbus_bool_t bus_service_add_owner (BusService *service,
62 DBusConnection *owner,
63 BusTransaction *transaction,
65 dbus_bool_t bus_service_remove_owner (BusService *service,
66 DBusConnection *owner,
67 BusTransaction *transaction,
69 dbus_bool_t bus_service_has_owner (BusService *service,
70 DBusConnection *owner);
71 DBusConnection* bus_service_get_primary_owner (BusService *service);
72 void bus_service_set_prohibit_replacement (BusService *service,
73 dbus_bool_t prohibit_replacement);
74 dbus_bool_t bus_service_get_prohibit_replacement (BusService *service);
75 const char* bus_service_get_name (BusService *service);
78 #endif /* BUS_SERVICES_H */