From d8abf955f5bff3e83cabd267883039f7a42c98c3 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Tue, 8 Jul 2003 05:07:32 +0000 Subject: 2003-07-08 Havoc Pennington * dbus/dbus-object.h: sketch out an API for registering objects with a connection, that allows us to use as little as 24 bytes per object and lets application code represent an object in any conceivable way. * dbus/dbus-object-registry.c: implement the hard bits of the DBusConnection aspect of object API. Not yet wired up. --- dbus/dbus-connection-internal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'dbus/dbus-connection-internal.h') diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h index 5ddc0e0a..eaa35955 100644 --- a/dbus/dbus-connection-internal.h +++ b/dbus/dbus-connection-internal.h @@ -81,6 +81,7 @@ void _dbus_message_handler_remove_connection (DBusMessageHandl DBusHandlerResult _dbus_message_handler_handle_message (DBusMessageHandler *handler, DBusConnection *connection, DBusMessage *message); +dbus_uint32_t _dbus_connection_get_id (DBusConnection *connection); DBUS_END_DECLS; -- cgit From fe195a911d86d0a71349988360de65cfac1b3f86 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 2 Aug 2003 01:59:14 +0000 Subject: 2003-08-01 Havoc Pennington * dbus/dbus-protocol.h (DBUS_MESSAGE_TYPE_*): introduce a message type enum to distinguish kinds of message (DBUS_HEADER_FLAG_NO_REPLY_EXPECTED): flag for a message that need not be replied to 2003-08-01 Havoc Pennington * dbus/dbus-marshal.c: adapt to DBusObjectID changes (unpack_8_octets): fix no-64-bit-int bug * dbus/dbus-object-registry.c (validate_id): validate the connection ID bits, not just the instance ID. * dbus/dbus-connection.c (_dbus_connection_init_id): initialize the connection-global 33 bits of the object ID * dbus/dbus-object-registry.c (info_from_entry): fill in object ID in the new way * dbus/dbus-objectid.h: rather than high/low bits, specifically define server/client/instance bits. --- dbus/dbus-connection-internal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dbus/dbus-connection-internal.h') diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h index eaa35955..5bcbcc2f 100644 --- a/dbus/dbus-connection-internal.h +++ b/dbus/dbus-connection-internal.h @@ -81,7 +81,8 @@ void _dbus_message_handler_remove_connection (DBusMessageHandl DBusHandlerResult _dbus_message_handler_handle_message (DBusMessageHandler *handler, DBusConnection *connection, DBusMessage *message); -dbus_uint32_t _dbus_connection_get_id (DBusConnection *connection); +void _dbus_connection_init_id (DBusConnection *connection, + DBusObjectID *id); DBUS_END_DECLS; -- cgit From cefb84edc5f84011c5a171e5d052e37c56c55d27 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Thu, 7 Aug 2003 02:18:54 +0000 Subject: 2003-08-06 Havoc Pennington * dbus/dbus-object-registry.c: implement signal connection and dispatch * dbus/dbus-connection.c (_dbus_connection_unref_unlocked): new * dbus/dbus-internals.c (_dbus_memdup): new function --- dbus/dbus-connection-internal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'dbus/dbus-connection-internal.h') diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h index 5bcbcc2f..423df5f8 100644 --- a/dbus/dbus-connection-internal.h +++ b/dbus/dbus-connection-internal.h @@ -42,6 +42,7 @@ typedef enum void _dbus_connection_lock (DBusConnection *connection); void _dbus_connection_unlock (DBusConnection *connection); void _dbus_connection_ref_unlocked (DBusConnection *connection); +void _dbus_connection_unref_unlocked (DBusConnection *connection); dbus_bool_t _dbus_connection_queue_received_message (DBusConnection *connection, DBusMessage *message); void _dbus_connection_queue_received_message_link (DBusConnection *connection, -- cgit From ef614207fc4f03e5cc02faeb109f739eb1ccdf31 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 15 Aug 2003 04:17:58 +0000 Subject: 2003-08-15 Havoc Pennington * dbus/dbus-connection.c, dbus/dbus-pending-call.c: Finish the pending call stuff --- dbus/dbus-connection-internal.h | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'dbus/dbus-connection-internal.h') diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h index 423df5f8..d9d5c5b4 100644 --- a/dbus/dbus-connection-internal.h +++ b/dbus/dbus-connection-internal.h @@ -29,6 +29,7 @@ #include #include #include +#include DBUS_BEGIN_DECLS; @@ -39,6 +40,9 @@ typedef enum DBUS_ITERATION_BLOCK = 1 << 2 /**< Block if nothing to do. */ } DBusIterationFlags; +/** default timeout value when waiting for a message reply */ +#define _DBUS_DEFAULT_TIMEOUT_VALUE (15 * 1000) + void _dbus_connection_lock (DBusConnection *connection); void _dbus_connection_unlock (DBusConnection *connection); void _dbus_connection_ref_unlocked (DBusConnection *connection); @@ -85,6 +89,47 @@ DBusHandlerResult _dbus_message_handler_handle_message (DBusMessageHandl void _dbus_connection_init_id (DBusConnection *connection, DBusObjectID *id); +DBusPendingCall* _dbus_pending_call_new (DBusConnection *connection, + int timeout_milliseconds, + DBusTimeoutHandler timeout_handler); + +void _dbus_pending_call_notify (DBusPendingCall *pending); + +void _dbus_connection_remove_pending_call (DBusConnection *connection, + DBusPendingCall *pending); + +/** + * @addtogroup DBusPendingCallInternals DBusPendingCall implementation details + * @{ + */ +/** + * @brief Internals of DBusPendingCall + * + * Object representing a reply message that we're waiting for. + */ +struct DBusPendingCall +{ + DBusAtomic refcount; /**< reference count */ + + DBusPendingCallNotifyFunction function; /**< Notifier when reply arrives. */ + void *user_data; /**< user data for function */ + DBusFreeFunction free_user_data; /**< free the user data */ + + DBusConnection *connection; /**< Connections we're associated with */ + DBusMessage *reply; /**< Reply (after we've received it) */ + DBusTimeout *timeout; /**< Timeout */ + + DBusList *timeout_link; /**< Preallocated timeout response */ + + dbus_uint32_t reply_serial; /**< Expected serial of reply */ + + unsigned int completed : 1; /**< TRUE if completed */ + unsigned int timeout_added : 1; /**< Have added the timeout */ +}; + +/** @} End of DBusPendingCallInternals */ + + DBUS_END_DECLS; #endif /* DBUS_CONNECTION_INTERNAL_H */ -- cgit From a1b0bd33408f03894987ac32b4e6b46c6a15a594 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 15 Aug 2003 23:10:12 +0000 Subject: 2003-08-15 Havoc Pennington * dbus/dbus-pending-call.c (dbus_pending_call_block): implement * dbus/dbus-connection.c (dbus_connection_send_with_reply_and_block): factor out internals; change to convert any error replies to DBusError instead of returning them as a message --- dbus/dbus-connection-internal.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'dbus/dbus-connection-internal.h') diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h index d9d5c5b4..f26c92e6 100644 --- a/dbus/dbus-connection-internal.h +++ b/dbus/dbus-connection-internal.h @@ -88,15 +88,18 @@ DBusHandlerResult _dbus_message_handler_handle_message (DBusMessageHandl DBusMessage *message); void _dbus_connection_init_id (DBusConnection *connection, DBusObjectID *id); - DBusPendingCall* _dbus_pending_call_new (DBusConnection *connection, int timeout_milliseconds, DBusTimeoutHandler timeout_handler); - void _dbus_pending_call_notify (DBusPendingCall *pending); - void _dbus_connection_remove_pending_call (DBusConnection *connection, DBusPendingCall *pending); +DBusMessage* _dbus_connection_block_for_reply (DBusConnection *connection, + dbus_uint32_t client_serial, + int timeout_milliseconds); +void _dbus_pending_call_complete_and_unlock (DBusPendingCall *pending, + DBusMessage *message); + /** * @addtogroup DBusPendingCallInternals DBusPendingCall implementation details -- cgit From 8d38a2e2c5dc95de992c4d856ec1b0c0948bca3e Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 29 Aug 2003 01:05:00 +0000 Subject: 2003-08-28 Havoc Pennington purge DBusObjectID * dbus/dbus-connection.c: port to no ObjectID, create a DBusObjectTree, rename ObjectTree to ObjectPath in public API * dbus/dbus-connection.h (struct DBusObjectTreeVTable): delete everything except UnregisterFunction and MessageFunction * dbus/dbus-marshal.c: port away from DBusObjectID, add DBUS_TYPE_OBJECT_PATH * dbus/dbus-object-registry.[hc], dbus/dbus-object.[hc], dbus/dbus-objectid.[hc]: remove these, we are moving to path-based object IDs --- dbus/dbus-connection-internal.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'dbus/dbus-connection-internal.h') diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h index f26c92e6..93b1b4a3 100644 --- a/dbus/dbus-connection-internal.h +++ b/dbus/dbus-connection-internal.h @@ -86,8 +86,7 @@ void _dbus_message_handler_remove_connection (DBusMessageHandl DBusHandlerResult _dbus_message_handler_handle_message (DBusMessageHandler *handler, DBusConnection *connection, DBusMessage *message); -void _dbus_connection_init_id (DBusConnection *connection, - DBusObjectID *id); + DBusPendingCall* _dbus_pending_call_new (DBusConnection *connection, int timeout_milliseconds, DBusTimeoutHandler timeout_handler); -- cgit From 1dd3f1788f1b4c9af2f4fa744abdb7892d0a14b9 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sun, 31 Aug 2003 03:25:24 +0000 Subject: 2003-08-30 Havoc Pennington * dbus/dbus-connection.c: purge DBusMessageHandler * dbus/dbus-message-handler.c: remove DBusMessageHandler, just use callbacks everywhere --- dbus/dbus-connection-internal.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'dbus/dbus-connection-internal.h') diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h index 93b1b4a3..5a04dece 100644 --- a/dbus/dbus-connection-internal.h +++ b/dbus/dbus-connection-internal.h @@ -77,15 +77,6 @@ void _dbus_connection_do_iteration (DBusConnection unsigned int flags, int timeout_milliseconds); void _dbus_connection_notify_disconnected (DBusConnection *connection); -void _dbus_connection_handler_destroyed_locked (DBusConnection *connection, - DBusMessageHandler *handler); -dbus_bool_t _dbus_message_handler_add_connection (DBusMessageHandler *handler, - DBusConnection *connection); -void _dbus_message_handler_remove_connection (DBusMessageHandler *handler, - DBusConnection *connection); -DBusHandlerResult _dbus_message_handler_handle_message (DBusMessageHandler *handler, - DBusConnection *connection, - DBusMessage *message); DBusPendingCall* _dbus_pending_call_new (DBusConnection *connection, int timeout_milliseconds, -- cgit From 583994cb3b7f5562fb7b8c37b4cb0d5af78e4ce2 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Wed, 17 Sep 2003 03:52:07 +0000 Subject: 2003-09-15 Havoc Pennington * dbus/dbus-pending-call.c: add the get/set object data boilerplate as for DBusConnection, etc. Use generic object data for the notify callback. * glib/dbus-gparser.c (parse_node): parse child nodes * tools/dbus-viewer.c: more hacking on the dbus-viewer * glib/dbus-gutils.c (_dbus_gutils_split_path): add a file to contain functions shared between the convenience lib and the installed lib * glib/Makefile.am (libdbus_glib_1_la_LDFLAGS): add -export-symbols-regex to the GLib library * dbus/dbus-object-tree.c (_dbus_object_tree_dispatch_and_unlock): fix the locking in here, and add a default handler for Introspect() that just returns sub-nodes. 2003-09-14 Havoc Pennington * glib/dbus-gthread.c (dbus_g_thread_init): rename to make g_foo rather than gfoo consistent * glib/dbus-gproxy.h: delete for now, move contents to dbus-glib.h, because the include files don't work right since we aren't in the dbus/ subdir. * glib/dbus-gproxy.c (dbus_gproxy_send): finish implementing (dbus_gproxy_end_call): finish (dbus_gproxy_begin_call): finish * glib/dbus-gmain.c (dbus_set_g_error): new * glib/dbus-gobject.c (handle_introspect): include information about child nodes in the introspection * dbus/dbus-connection.c (dbus_connection_list_registered): new function to help in implementation of introspection * dbus/dbus-object-tree.c (_dbus_object_tree_list_registered_and_unlock): new function 2003-09-12 Havoc Pennington * glib/dbus-gidl.h: add common base class for all the foo_info types * tools/dbus-viewer.c: add GTK-based introspection UI thingy similar to kdcop * test/Makefile.am: try test srcdir -ef . in addition to test srcdir = ., one of them should work (yeah lame) * glib/Makefile.am: build the "idl" parser stuff as a convenience library * glib/dbus-gparser.h: make description_load routines return NodeInfo* not Parser* * Makefile.am (SUBDIRS): build test dir after all library dirs * configure.in: add GTK+ detection --- dbus/dbus-connection-internal.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'dbus/dbus-connection-internal.h') diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h index 5a04dece..b19ab636 100644 --- a/dbus/dbus-connection-internal.h +++ b/dbus/dbus-connection-internal.h @@ -30,6 +30,7 @@ #include #include #include +#include DBUS_BEGIN_DECLS; @@ -104,9 +105,9 @@ struct DBusPendingCall { DBusAtomic refcount; /**< reference count */ + DBusDataSlotList slot_list; /**< Data stored by allocated integer ID */ + DBusPendingCallNotifyFunction function; /**< Notifier when reply arrives. */ - void *user_data; /**< user data for function */ - DBusFreeFunction free_user_data; /**< free the user data */ DBusConnection *connection; /**< Connections we're associated with */ DBusMessage *reply; /**< Reply (after we've received it) */ -- cgit