g_free (v);
}
}
+ else if (g_variant_type_equal (type, G_VARIANT_TYPE_HANDLE))
+ {
+ if (!ensure_input_padding (mis, 4, &local_error))
+ goto fail;
+ if (!just_align)
+ {
+ gint32 v;
+ v = g_data_input_stream_read_int32 (dis, NULL, &local_error);
+ if (local_error != NULL)
+ goto fail;
+ ret = g_variant_new_handle (v);
+ }
+ }
else if (g_variant_type_is_array (type))
{
guint32 array_len;
g_data_output_stream_put_byte (dos, '\0', NULL, NULL);
}
}
+ else if (g_variant_type_equal (type, G_VARIANT_TYPE_HANDLE))
+ {
+ padding_added = ensure_output_padding (mos, dos, 4);
+ if (value != NULL)
+ {
+ gint32 v = g_variant_get_handle (value);
+ g_data_output_stream_put_int32 (dos, v, NULL, NULL);
+ }
+ }
else if (g_variant_type_is_array (type))
{
GVariant *item;
break;
}
+#ifdef DBUS_TYPE_UNIX_FD
+ case DBUS_TYPE_UNIX_FD:
+ {
+ /* unfortunately there's currently no way to get just the
+ * protocol value, since dbus_message_iter_get_basic() wants
+ * to be 'helpful' and dup the fd for the user...
+ */
+ g_string_append (s, "unix-fd: (not extracted)\n");
+ break;
+ }
+#endif
+
case DBUS_TYPE_VARIANT:
g_string_append_printf (s, "variant:\n");
dbus_message_iter_recurse (iter, &sub);
" string: `cwd'\n"
" variant:\n"
" string: `/home/davidz/Hacking/glib/gio/tests'\n");
+
+#ifdef DBUS_TYPE_UNIX_FD
+ value = g_variant_parse (G_VARIANT_TYPE ("(hah)"),
+ "(42, [43, 44])",
+ NULL, NULL, &error);
+ g_assert_no_error (error);
+ g_assert (value != NULL);
+ /* about (not extracted), see comment in DBUS_TYPE_UNIX_FD case in
+ * dbus_1_message_append() above.
+ */
+ check_serialization (value,
+ "value 0: unix-fd: (not extracted)\n"
+ "value 1: array:\n"
+ " unix-fd: (not extracted)\n"
+ " unix-fd: (not extracted)\n");
+#endif
}