summaryrefslogtreecommitdiffstats
path: root/bus/connection.h
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-04-11 00:03:06 +0000
committerHavoc Pennington <hp@redhat.com>2003-04-11 00:03:06 +0000
commit6be547d32f018c23ba56426a0bccd08baa2cf440 (patch)
tree00edf1d2628538d66d3f5db7a998c18ffc30ce04 /bus/connection.h
parent7074a2469521949c706f3b9d789d7c8eb9f3ac85 (diff)
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.
Diffstat (limited to 'bus/connection.h')
-rw-r--r--bus/connection.h42
1 files changed, 26 insertions, 16 deletions
diff --git a/bus/connection.h b/bus/connection.h
index 0d64e987..6108bdfd 100644
--- a/bus/connection.h
+++ b/bus/connection.h
@@ -25,6 +25,7 @@
#define BUS_CONNECTION_H
#include <dbus/dbus.h>
+#include <dbus/dbus-list.h>
#include "bus.h"
typedef dbus_bool_t (* BusConnectionForeachFunction) (DBusConnection *connection,
@@ -53,10 +54,13 @@ void bus_connection_send_oom_error (DBusConnection *connection,
DBusMessage *in_reply_to);
/* called by services.c */
-dbus_bool_t bus_connection_add_owned_service (DBusConnection *connection,
- BusService *service);
-void bus_connection_remove_owned_service (DBusConnection *connection,
- BusService *service);
+dbus_bool_t bus_connection_add_owned_service (DBusConnection *connection,
+ BusService *service);
+void bus_connection_remove_owned_service (DBusConnection *connection,
+ BusService *service);
+void bus_connection_add_owned_service_link (DBusConnection *connection,
+ DBusList *link);
+
/* called by driver.c */
dbus_bool_t bus_connection_set_name (DBusConnection *connection,
@@ -74,18 +78,24 @@ dbus_bool_t bus_connection_get_groups (DBusConnection *connection,
BusPolicy* bus_connection_get_policy (DBusConnection *connection);
/* transaction API so we can send or not send a block of messages as a whole */
-BusTransaction* bus_transaction_new (BusContext *context);
-BusContext* bus_transaction_get_context (BusTransaction *transaction);
-BusConnections* bus_transaction_get_connections (BusTransaction *transaction);
-dbus_bool_t bus_transaction_send_message (BusTransaction *transaction,
- DBusConnection *connection,
- DBusMessage *message);
-dbus_bool_t bus_transaction_send_error_reply (BusTransaction *transaction,
- DBusConnection *connection,
- const DBusError *error,
- DBusMessage *in_reply_to);
-void bus_transaction_cancel_and_free (BusTransaction *transaction);
-void bus_transaction_execute_and_free (BusTransaction *transaction);
+typedef void (* BusTransactionCancelFunction) (void *data);
+
+BusTransaction* bus_transaction_new (BusContext *context);
+BusContext* bus_transaction_get_context (BusTransaction *transaction);
+BusConnections* bus_transaction_get_connections (BusTransaction *transaction);
+dbus_bool_t bus_transaction_send_message (BusTransaction *transaction,
+ DBusConnection *connection,
+ DBusMessage *message);
+dbus_bool_t bus_transaction_send_error_reply (BusTransaction *transaction,
+ DBusConnection *connection,
+ const DBusError *error,
+ DBusMessage *in_reply_to);
+void bus_transaction_cancel_and_free (BusTransaction *transaction);
+void bus_transaction_execute_and_free (BusTransaction *transaction);
+dbus_bool_t bus_transaction_add_cancel_hook (BusTransaction *transaction,
+ BusTransactionCancelFunction cancel_function,
+ void *data,
+ DBusFreeFunction free_data_function);
#endif /* BUS_CONNECTION_H */