From 655441b28ae5dd95c4a889a92a9be0f9cab2cf0d Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 25 Oct 2010 13:46:21 +0200 Subject: * dbusbind.c (Fdbus_call_method_asynchronously) (Fdbus_register_signal, Fdbus_register_method): Check, whether `dbus-registered-objects-table' is initialized. Must not be synchronized with the trunk. --- src/dbusbind.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/dbusbind.c') diff --git a/src/dbusbind.c b/src/dbusbind.c index 60697c8a4e9..37bfbf4badf 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -1175,6 +1175,10 @@ usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLE SDATA (interface), SDATA (method)); + /* Check dbus-registered-objects-table. */ + if (!HASH_TABLE_P (Vdbus_registered_objects_table)) + XD_SIGNAL1 (build_string ("dbus.el is not loaded")); + /* Open a connection to the bus. */ connection = xd_initialize (bus); @@ -1863,6 +1867,10 @@ usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARG wrong_type_argument (intern ("functionp"), handler); GCPRO6 (bus, service, path, interface, signal, handler); + /* Check dbus-registered-objects-table. */ + if (!HASH_TABLE_P (Vdbus_registered_objects_table)) + XD_SIGNAL1 (build_string ("dbus.el is not loaded")); + /* Retrieve unique name of service. If service is a known name, we will register for the corresponding unique name, if any. Signals are sent always with the unique name as sender. Note: the unique @@ -1976,6 +1984,10 @@ used for composing the returning D-Bus message. */) /* TODO: We must check for a valid service name, otherwise there is a segmentation fault. */ + /* Check dbus-registered-objects-table. */ + if (!HASH_TABLE_P (Vdbus_registered_objects_table)) + XD_SIGNAL1 (build_string ("dbus.el is not loaded")); + /* Open a connection to the bus. */ connection = xd_initialize (bus); -- cgit v1.2.1 From 91fd0b72816c99c0425ab783f6502a3e11f00956 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 1 Nov 2010 11:18:42 -0400 Subject: Fix error in last merge from branch. Remove 2010-10-25 commit by Michael Albinus to dbusbind.c, which is not intended for trunk. --- src/dbusbind.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/dbusbind.c') diff --git a/src/dbusbind.c b/src/dbusbind.c index beb1faaf4aa..683b7cb583b 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -1232,10 +1232,6 @@ usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLE SDATA (interface), SDATA (method)); - /* Check dbus-registered-objects-table. */ - if (!HASH_TABLE_P (Vdbus_registered_objects_table)) - XD_SIGNAL1 (build_string ("dbus.el is not loaded")); - /* Open a connection to the bus. */ connection = xd_initialize (bus, TRUE); @@ -1873,10 +1869,6 @@ usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARG wrong_type_argument (intern ("functionp"), handler); GCPRO6 (bus, service, path, interface, signal, handler); - /* Check dbus-registered-objects-table. */ - if (!HASH_TABLE_P (Vdbus_registered_objects_table)) - XD_SIGNAL1 (build_string ("dbus.el is not loaded")); - /* Retrieve unique name of service. If service is a known name, we will register for the corresponding unique name, if any. Signals are sent always with the unique name as sender. Note: the unique @@ -1989,10 +1981,6 @@ used for composing the returning D-Bus message. */) /* TODO: We must check for a valid service name, otherwise there is a segmentation fault. */ - /* Check dbus-registered-objects-table. */ - if (!HASH_TABLE_P (Vdbus_registered_objects_table)) - XD_SIGNAL1 (build_string ("dbus.el is not loaded")); - /* Open a connection to the bus. */ connection = xd_initialize (bus, TRUE); -- cgit v1.2.1 From da1fec2bc11a790e56d3473228f25c3dcfd59e59 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 10 Nov 2010 09:48:18 +0100 Subject: * dbusbind.c (QCdbus_type_unix_fd): New Lisp object. (XD_BASIC_DBUS_TYPE, xd_symbol_to_dbus_type, xd_signature) (xd_append_arg, xd_retrieve_arg): Support DBUS_TYPE_UNIX_FD. (Fdbus_call_method): Add DBUS_TYPE_UNIX_FD type mapping to doc string. (syms_of_dbusbind): Initialize QCdbus_type_unix_fd). --- src/dbusbind.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'src/dbusbind.c') diff --git a/src/dbusbind.c b/src/dbusbind.c index 683b7cb583b..ec7a3ff7217 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -57,6 +57,9 @@ Lisp_Object QCdbus_type_int32, QCdbus_type_uint32; Lisp_Object QCdbus_type_int64, QCdbus_type_uint64; Lisp_Object QCdbus_type_double, QCdbus_type_string; Lisp_Object QCdbus_type_object_path, QCdbus_type_signature; +#ifdef DBUS_TYPE_UNIX_FD +Lisp_Object QCdbus_type_unix_fd; +#endif Lisp_Object QCdbus_type_array, QCdbus_type_variant; Lisp_Object QCdbus_type_struct, QCdbus_type_dict_entry; @@ -147,6 +150,22 @@ int xd_in_read_queued_messages = 0; #endif /* Check whether TYPE is a basic DBusType. */ +#ifdef DBUS_TYPE_UNIX_FD +#define XD_BASIC_DBUS_TYPE(type) \ + ((type == DBUS_TYPE_BYTE) \ + || (type == DBUS_TYPE_BOOLEAN) \ + || (type == DBUS_TYPE_INT16) \ + || (type == DBUS_TYPE_UINT16) \ + || (type == DBUS_TYPE_INT32) \ + || (type == DBUS_TYPE_UINT32) \ + || (type == DBUS_TYPE_INT64) \ + || (type == DBUS_TYPE_UINT64) \ + || (type == DBUS_TYPE_DOUBLE) \ + || (type == DBUS_TYPE_STRING) \ + || (type == DBUS_TYPE_OBJECT_PATH) \ + || (type == DBUS_TYPE_SIGNATURE \ + || (type == DBUS_TYPE_UNIX_FD)) +#else #define XD_BASIC_DBUS_TYPE(type) \ ((type == DBUS_TYPE_BYTE) \ || (type == DBUS_TYPE_BOOLEAN) \ @@ -160,6 +179,7 @@ int xd_in_read_queued_messages = 0; || (type == DBUS_TYPE_STRING) \ || (type == DBUS_TYPE_OBJECT_PATH) \ || (type == DBUS_TYPE_SIGNATURE)) +#endif /* This was a macro. On Solaris 2.11 it was said to compile for hours, when optimzation is enabled. So we have transferred it into @@ -182,6 +202,9 @@ xd_symbol_to_dbus_type (Lisp_Object object) : (EQ (object, QCdbus_type_string)) ? DBUS_TYPE_STRING : (EQ (object, QCdbus_type_object_path)) ? DBUS_TYPE_OBJECT_PATH : (EQ (object, QCdbus_type_signature)) ? DBUS_TYPE_SIGNATURE +#ifdef DBUS_TYPE_UNIX_FD + : (EQ (object, QCdbus_type_unix_fd)) ? DBUS_TYPE_UNIX_FD +#endif : (EQ (object, QCdbus_type_array)) ? DBUS_TYPE_ARRAY : (EQ (object, QCdbus_type_variant)) ? DBUS_TYPE_VARIANT : (EQ (object, QCdbus_type_struct)) ? DBUS_TYPE_STRUCT @@ -238,6 +261,9 @@ xd_signature (char *signature, unsigned int dtype, unsigned int parent_type, Lis case DBUS_TYPE_UINT16: case DBUS_TYPE_UINT32: case DBUS_TYPE_UINT64: +#ifdef DBUS_TYPE_UNIX_FD + case DBUS_TYPE_UNIX_FD: +#endif CHECK_NATNUM (object); sprintf (signature, "%c", dtype); break; @@ -451,6 +477,9 @@ xd_append_arg (unsigned int dtype, Lisp_Object object, DBusMessageIter *iter) } case DBUS_TYPE_UINT32: +#ifdef DBUS_TYPE_UNIX_FD + case DBUS_TYPE_UNIX_FD: +#endif CHECK_NUMBER (object); { dbus_uint32_t val = XUINT (object); @@ -648,6 +677,9 @@ xd_retrieve_arg (unsigned int dtype, DBusMessageIter *iter) } case DBUS_TYPE_UINT32: +#ifdef DBUS_TYPE_UNIX_FD + case DBUS_TYPE_UNIX_FD: +#endif { dbus_uint32_t val; dbus_message_iter_get_basic (iter, &val); @@ -983,6 +1015,7 @@ input arguments. It follows the mapping rules: DBUS_TYPE_UINT16 => number DBUS_TYPE_INT16 => integer DBUS_TYPE_UINT32 => number or float + DBUS_TYPE_UNIX_FD => number or float DBUS_TYPE_INT32 => integer or float DBUS_TYPE_UINT64 => number or float DBUS_TYPE_INT64 => integer or float @@ -2104,6 +2137,11 @@ syms_of_dbusbind (void) QCdbus_type_signature = intern_c_string (":signature"); staticpro (&QCdbus_type_signature); +#ifdef DBUS_TYPE_UNIX_FD + QCdbus_type_unix_fd = intern_c_string (":unix-fd"); + staticpro (&QCdbus_type_unix_fd); +#endif + QCdbus_type_array = intern_c_string (":array"); staticpro (&QCdbus_type_array); -- cgit v1.2.1 From 01768686d4ad7b38f20170b8f791a1e7e33b791c Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 10 Nov 2010 10:08:05 +0100 Subject: Fix syntax error in previous commit. --- src/dbusbind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dbusbind.c') diff --git a/src/dbusbind.c b/src/dbusbind.c index ec7a3ff7217..6ab976b58da 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -163,7 +163,7 @@ int xd_in_read_queued_messages = 0; || (type == DBUS_TYPE_DOUBLE) \ || (type == DBUS_TYPE_STRING) \ || (type == DBUS_TYPE_OBJECT_PATH) \ - || (type == DBUS_TYPE_SIGNATURE \ + || (type == DBUS_TYPE_SIGNATURE) \ || (type == DBUS_TYPE_UNIX_FD)) #else #define XD_BASIC_DBUS_TYPE(type) \ -- cgit v1.2.1