dbus/bus/services.h
Havoc Pennington 6be547d32f 2003-04-10 Havoc Pennington <hp@redhat.com>
* dbus/dbus-connection.c (dbus_connection_flush): don't spin on
	the connection if it's disconnected

	* bus/activation.c (bus_activation_service_created): use new
	transaction features to roll back removal of pending activation if
	we don't successfully create the service after all. Don't remove
	pending activation if the function fails.

	* dbus/dbus-list.c (_dbus_list_insert_before_link)
	(_dbus_list_insert_after_link): new code to facilitate
	services.c fixes

	* dbus/dbus-hash.c (_dbus_hash_table_insert_string_preallocated):
	new functionality, so we can preallocate the ability to insert
	into a hash table.

	* bus/connection.c (bus_transaction_add_cancel_hook): new function
	allowing us to put custom hooks in a transaction to be used for
	cancelling said transaction

	* doc/dbus-specification.sgml: add some discussion of secondary
	service owners, and disallow zero-length service names

	* bus/services.c (bus_registry_acquire_service): new function,
	splits out part of bus_driver_handle_acquire_service() and fixes
	a bug where we didn't remove the service doing the acquiring
	from the secondary queue if we failed to remove the current owner
	from the front of the queue.
2003-04-11 00:03:06 +00:00

78 lines
4.4 KiB
C

/* -*- mode: C; c-file-style: "gnu" -*- */
/* services.h Service management
*
* Copyright (C) 2003 Red Hat, Inc.
*
* Licensed under the Academic Free License version 1.2
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef BUS_SERVICES_H
#define BUS_SERVICES_H
#include <dbus/dbus.h>
#include <dbus/dbus-string.h>
#include "connection.h"
#include "bus.h"
typedef void (* BusServiceForeachFunction) (BusService *service,
void *data);
BusRegistry* bus_registry_new (BusContext *context);
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_registry_acquire_service (BusRegistry *registry,
DBusConnection *connection,
const DBusString *service_name,
dbus_uint32_t flags,
dbus_uint32_t *result,
BusTransaction *transaction,
DBusError *error);
void bus_service_ref (BusService *service);
void bus_service_unref (BusService *service);
dbus_bool_t bus_service_add_owner (BusService *service,
DBusConnection *owner,
BusTransaction *transaction,
DBusError *error);
dbus_bool_t bus_service_remove_owner (BusService *service,
DBusConnection *owner,
BusTransaction *transaction,
DBusError *error);
dbus_bool_t bus_service_has_owner (BusService *service,
DBusConnection *owner);
DBusConnection* bus_service_get_primary_owner (BusService *service);
void bus_service_set_prohibit_replacement (BusService *service,
dbus_bool_t prohibit_replacement);
dbus_bool_t bus_service_get_prohibit_replacement (BusService *service);
const char* bus_service_get_name (BusService *service);
#endif /* BUS_SERVICES_H */