2005-07-13 David Zeuthen <davidz@redhat.com>
authorDavid Zeuthen <davidz@redhat.com>
Wed, 13 Jul 2005 21:13:16 +0000 (21:13 +0000)
committerDavid Zeuthen <davidz@redhat.com>
Wed, 13 Jul 2005 21:13:16 +0000 (21:13 +0000)
        * tools/dbus-send.c (append_arg, type_from_name): Also support 16 and
        64 bit signed and unsigned parameters

ChangeLog
tools/dbus-send.c

index 765314a65feae28631c647a8db6ff81759956ab2..6f3e670a6236250c83eb9e340fe895e3ecee5837 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-13  David Zeuthen  <davidz@redhat.com>
+
+       * tools/dbus-send.c (append_arg, type_from_name): Also support 16 and
+       64 bit signed and unsigned parameters
+
 2005-07-13  John (J5) Palmieri  <johnp@redhat.com>
 
        * python/.cvsignore: remove dbus_bindings.pyx, add dbus_bindings.pxd
index 477a8abd8aaae535ea8e341979059b56201db241..6ab3518aefe8fd0cda6d0d6bf9cd6c1ed19d6003 100644 (file)
@@ -39,8 +39,12 @@ usage (int ecode)
 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 @@ append_arg (DBusMessageIter *iter, int type, const char *value)
       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 @@ append_arg (DBusMessageIter *iter, int type, const char *value)
       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 @@ type_from_name (const char *arg)
   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"))