00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef DBUS_CONNECTION_INTERNAL_H
00024 #define DBUS_CONNECTION_INTERNAL_H
00025
00026 #include <dbus/dbus-internals.h>
00027 #include <dbus/dbus-connection.h>
00028 #include <dbus/dbus-message.h>
00029 #include <dbus/dbus-transport.h>
00030 #include <dbus/dbus-resources.h>
00031 #include <dbus/dbus-list.h>
00032 #include <dbus/dbus-timeout.h>
00033 #include <dbus/dbus-dataslot.h>
00034
00035 DBUS_BEGIN_DECLS
00036
00037 typedef enum
00038 {
00039 DBUS_ITERATION_DO_WRITING = 1 << 0,
00040 DBUS_ITERATION_DO_READING = 1 << 1,
00041 DBUS_ITERATION_BLOCK = 1 << 2
00042 } DBusIterationFlags;
00043
00045 #define _DBUS_DEFAULT_TIMEOUT_VALUE (25 * 1000)
00046
00047 void _dbus_connection_lock (DBusConnection *connection);
00048 void _dbus_connection_unlock (DBusConnection *connection);
00049 DBusConnection * _dbus_connection_ref_unlocked (DBusConnection *connection);
00050 void _dbus_connection_unref_unlocked (DBusConnection *connection);
00051 dbus_bool_t _dbus_connection_queue_received_message (DBusConnection *connection,
00052 DBusMessage *message);
00053 void _dbus_connection_queue_received_message_link (DBusConnection *connection,
00054 DBusList *link);
00055 dbus_bool_t _dbus_connection_has_messages_to_send_unlocked (DBusConnection *connection);
00056 DBusMessage* _dbus_connection_get_message_to_send (DBusConnection *connection);
00057 void _dbus_connection_message_sent (DBusConnection *connection,
00058 DBusMessage *message);
00059 dbus_bool_t _dbus_connection_add_watch_unlocked (DBusConnection *connection,
00060 DBusWatch *watch);
00061 void _dbus_connection_remove_watch_unlocked (DBusConnection *connection,
00062 DBusWatch *watch);
00063 void _dbus_connection_toggle_watch_unlocked (DBusConnection *connection,
00064 DBusWatch *watch,
00065 dbus_bool_t enabled);
00066 dbus_bool_t _dbus_connection_handle_watch (DBusWatch *watch,
00067 unsigned int condition,
00068 void *data);
00069 dbus_bool_t _dbus_connection_add_timeout_unlocked (DBusConnection *connection,
00070 DBusTimeout *timeout);
00071 void _dbus_connection_remove_timeout_unlocked (DBusConnection *connection,
00072 DBusTimeout *timeout);
00073 void _dbus_connection_toggle_timeout_unlocked (DBusConnection *connection,
00074 DBusTimeout *timeout,
00075 dbus_bool_t enabled);
00076 DBusConnection* _dbus_connection_new_for_transport (DBusTransport *transport);
00077 void _dbus_connection_do_iteration_unlocked (DBusConnection *connection,
00078 unsigned int flags,
00079 int timeout_milliseconds);
00080 void _dbus_connection_close_possibly_shared (DBusConnection *connection);
00081 void _dbus_connection_close_if_only_one_ref (DBusConnection *connection);
00082
00083 DBusPendingCall* _dbus_pending_call_new (DBusConnection *connection,
00084 int timeout_milliseconds,
00085 DBusTimeoutHandler timeout_handler);
00086 void _dbus_pending_call_notify (DBusPendingCall *pending);
00087 void _dbus_connection_remove_pending_call (DBusConnection *connection,
00088 DBusPendingCall *pending);
00089 void _dbus_connection_block_pending_call (DBusPendingCall *pending);
00090 void _dbus_pending_call_complete_and_unlock (DBusPendingCall *pending,
00091 DBusMessage *message);
00092 dbus_bool_t _dbus_connection_send_and_unlock (DBusConnection *connection,
00093 DBusMessage *message,
00094 dbus_uint32_t *client_serial);
00095
00096 void _dbus_connection_queue_synthesized_message_link (DBusConnection *connection,
00097 DBusList *link);
00098 void _dbus_connection_test_get_locks (DBusConnection *conn,
00099 DBusMutex **mutex_loc,
00100 DBusMutex **dispatch_mutex_loc,
00101 DBusMutex **io_path_mutex_loc,
00102 DBusCondVar **dispatch_cond_loc,
00103 DBusCondVar **io_path_cond_loc);
00104
00105
00106
00107
00113 void _dbus_bus_notify_shared_connection_disconnected_unlocked (DBusConnection *connection);
00114
00118 DBUS_END_DECLS
00119
00120 #endif