summaryrefslogtreecommitdiff
path: root/dbus/dbus-gvalue-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'dbus/dbus-gvalue-utils.c')
-rw-r--r--dbus/dbus-gvalue-utils.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/dbus/dbus-gvalue-utils.c b/dbus/dbus-gvalue-utils.c
index 3413ecc..3ad20e8 100644
--- a/dbus/dbus-gvalue-utils.c
+++ b/dbus/dbus-gvalue-utils.c
@@ -30,6 +30,34 @@
#include <string.h>
#include <gobject/gvaluecollector.h>
+guint
+_dbus_g_typecode_fixed_get_size (char typecode)
+{
+ switch (typecode)
+ {
+ case DBUS_TYPE_BYTE:
+ return 1;
+
+ case DBUS_TYPE_BOOLEAN:
+ case DBUS_TYPE_INT32:
+ case DBUS_TYPE_UINT32:
+ return sizeof (dbus_uint32_t);
+
+ case DBUS_TYPE_INT16:
+ case DBUS_TYPE_UINT16:
+ return sizeof (dbus_uint16_t);
+
+ case DBUS_TYPE_DOUBLE:
+ return sizeof (double);
+
+ case DBUS_TYPE_INT64:
+ case DBUS_TYPE_UINT64:
+ return sizeof (dbus_uint64_t);
+
+ default:
+ return 0;
+ }
+}
static guint
fixed_type_get_size (GType type)