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 (void);
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,
53 dbus_bool_t bus_service_add_owner (BusService *service,
54 DBusConnection *owner,
55 BusTransaction *transaction,
57 dbus_bool_t bus_service_remove_owner (BusService *service,
58 DBusConnection *owner,
59 BusTransaction *transaction,
61 dbus_bool_t bus_service_has_owner (BusService *service,
62 DBusConnection *owner);
63 DBusConnection* bus_service_get_primary_owner (BusService *service);
64 void bus_service_set_prohibit_replacement (BusService *service,
65 dbus_bool_t prohibit_replacement);
66 dbus_bool_t bus_service_get_prohibit_replacement (BusService *service);
67 const char* bus_service_get_name (BusService *service);
69 #endif /* BUS_SERVICES_H */