dbus/tools dbus-send.c,1.18,1.19

David Zeuthen david at freedesktop.org
Thu Jul 14 07:13:18 EST 2005


Update of /cvs/dbus/dbus/tools
In directory gabe:/tmp/cvs-serv32619/tools

Modified Files:
	dbus-send.c 
Log Message:
2005-07-13  David Zeuthen  <davidz at redhat.com>

        * tools/dbus-send.c (append_arg, type_from_name): Also support 16 and
        64 bit signed and unsigned parameters



Index: dbus-send.c
===================================================================
RCS file: /cvs/dbus/dbus/tools/dbus-send.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- dbus-send.c	6 Jul 2005 21:27:45 -0000	1.18
+++ dbus-send.c	13 Jul 2005 21:13:16 -0000	1.19
@@ -39,8 +39,12 @@
 static void
 append_arg (DBusMessageIter *iter, int type, const char *value)
 {
+  dbus_uint16_t uint16;
+  dbus_int16_t int16;
   dbus_uint32_t uint32;
   dbus_int32_t int32;
+  dbus_uint64_t uint64;
+  dbus_int64_t int64;
   double d;
   unsigned char byte;
   dbus_bool_t v_BOOLEAN;
@@ -58,6 +62,16 @@
       dbus_message_iter_append_basic (iter, DBUS_TYPE_DOUBLE, &d);
       break;
 
+    case DBUS_TYPE_INT16:
+      int16 = strtol (value, NULL, 0);
+      dbus_message_iter_append_basic (iter, DBUS_TYPE_INT16, &int16);
+      break;
+
+    case DBUS_TYPE_UINT16:
+      uint16 = strtoul (value, NULL, 0);
+      dbus_message_iter_append_basic (iter, DBUS_TYPE_UINT16, &uint16);
+      break;
+
     case DBUS_TYPE_INT32:
       int32 = strtol (value, NULL, 0);
       dbus_message_iter_append_basic (iter, DBUS_TYPE_INT32, &int32);
@@ -68,6 +82,16 @@
       dbus_message_iter_append_basic (iter, DBUS_TYPE_UINT32, &uint32);
       break;
 
+    case DBUS_TYPE_INT64:
+      int64 = strtoll (value, NULL, 0);
+      dbus_message_iter_append_basic (iter, DBUS_TYPE_INT64, &int64);
+      break;
+
+    case DBUS_TYPE_UINT64:
+      uint64 = strtoull (value, NULL, 0);
+      dbus_message_iter_append_basic (iter, DBUS_TYPE_UINT64, &uint64);
+      break;
+
     case DBUS_TYPE_STRING:
       dbus_message_iter_append_basic (iter, DBUS_TYPE_STRING, &value);
       break;
@@ -156,10 +180,18 @@
   int type;
   if (!strcmp (arg, "string"))
     type = DBUS_TYPE_STRING;
+  else if (!strcmp (arg, "int16"))
+    type = DBUS_TYPE_INT16;
+  else if (!strcmp (arg, "uint16"))
+    type = DBUS_TYPE_UINT16;
   else if (!strcmp (arg, "int32"))
     type = DBUS_TYPE_INT32;
   else if (!strcmp (arg, "uint32"))
     type = DBUS_TYPE_UINT32;
+  else if (!strcmp (arg, "int64"))
+    type = DBUS_TYPE_INT64;
+  else if (!strcmp (arg, "uint64"))
+    type = DBUS_TYPE_UINT64;
   else if (!strcmp (arg, "double"))
     type = DBUS_TYPE_DOUBLE;
   else if (!strcmp (arg, "byte"))



More information about the dbus-commit mailing list