changeset 111472:943d9b433fca

* 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).
author Michael Albinus <michael.albinus@gmx.de>
date Wed, 10 Nov 2010 09:48:18 +0100
parents 5cb8f9659806
children 1e95f3ea022d
files src/ChangeLog src/dbusbind.c
diffstat 2 files changed, 46 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Nov 10 09:41:53 2010 +0100
+++ b/src/ChangeLog	Wed Nov 10 09:48:18 2010 +0100
@@ -1,3 +1,11 @@
+2010-11-10  Michael Albinus  <michael.albinus@gmx.de>
+
+	* 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).
+
 2010-11-10  Glenn Morris  <rgm@gnu.org>
 
 	* emacs.c (syms_of_emacs) <system-type>: Doc fix.
--- a/src/dbusbind.c	Wed Nov 10 09:41:53 2010 +0100
+++ b/src/dbusbind.c	Wed Nov 10 09:48:18 2010 +0100
@@ -57,6 +57,9 @@
 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 @@
 #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 @@
    || (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 @@
      : (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 @@
     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 @@
 	}
 
       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 @@
       }
 
     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 @@
   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 @@
   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);