1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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_connection_if_created,
45 BusTransaction *transaction,
47 void bus_registry_foreach (BusRegistry *registry,
48 BusServiceForeachFunction function,
50 dbus_bool_t bus_registry_list_services (BusRegistry *registry,
53 dbus_bool_t bus_registry_acquire_service (BusRegistry *registry,
54 DBusConnection *connection,
55 const DBusString *service_name,
57 dbus_uint32_t *result,
58 BusTransaction *transaction,
60 dbus_bool_t bus_registry_release_service (BusRegistry *registry,
61 DBusConnection *connection,
62 const DBusString *service_name,
63 dbus_uint32_t *result,
64 BusTransaction *transaction,
66 dbus_bool_t bus_registry_set_service_context_table (BusRegistry *registry,
67 DBusHashTable *table);
69 BusService* bus_service_ref (BusService *service);
70 void bus_service_unref (BusService *service);
71 dbus_bool_t bus_service_add_owner (BusService *service,
72 DBusConnection *connection,
74 BusTransaction *transaction,
76 dbus_bool_t bus_service_swap_owner (BusService *service,
77 DBusConnection *connection,
78 BusTransaction *transaction,
80 dbus_bool_t bus_service_remove_owner (BusService *service,
81 DBusConnection *connection,
82 BusTransaction *transaction,
84 dbus_bool_t bus_service_has_owner (BusService *service,
85 DBusConnection *connection);
86 BusOwner* bus_service_get_primary_owner (BusService *service);
87 dbus_bool_t bus_service_get_allow_replacement (BusService *service);
88 const char* bus_service_get_name (BusService *service);
89 dbus_bool_t bus_service_list_queued_owners (BusService *service,
90 DBusList **return_list,
93 DBusConnection* bus_service_get_primary_owners_connection (BusService *service);
94 #endif /* BUS_SERVICES_H */