/* dbus_bug735437_client.c generated by valac, the Vala compiler * generated from dbus_bug735437_client.vala, do not modify */ #include #include #include #include #include #include #include #if !defined(VALA_EXTERN) #if defined(_WIN32) || defined(__CYGWIN__) #define VALA_EXTERN __declspec(dllexport) extern #elif __GNUC__ >= 4 #define VALA_EXTERN __attribute__((visibility("default"))) extern #else #define VALA_EXTERN extern #endif #endif #define TYPE_TEST (test_get_type ()) #define TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEST, Test)) #define IS_TEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEST)) #define TEST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_TEST, TestIface)) typedef struct _Test Test; typedef struct _TestIface TestIface; #define TYPE_TEST_PROXY (test_proxy_get_type ()) typedef GDBusProxy TestProxy; typedef GDBusProxyClass TestProxyClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); #define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; } #define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; } #define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); struct _TestIface { GTypeInterface parent_iface; gdouble* (*array) (Test* self, gint* result_length1, GError** error); gdouble* (*multi_array) (Test* self, gint* result_length1, gint* result_length2, GError** error); gchar** (*multi_array2) (Test* self, gint* result_length1, gint* result_length2, gint* result_length3, GError** error); }; VALA_EXTERN GType test_proxy_get_type (void) G_GNUC_CONST ; VALA_EXTERN guint test_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error); VALA_EXTERN GType test_get_type (void) G_GNUC_CONST ; G_DEFINE_AUTOPTR_CLEANUP_FUNC (Test, g_object_unref) VALA_EXTERN gdouble* test_array (Test* self, gint* result_length1, GError** error); VALA_EXTERN gdouble* test_multi_array (Test* self, gint* result_length1, gint* result_length2, GError** error); VALA_EXTERN gchar** test_multi_array2 (Test* self, gint* result_length1, gint* result_length2, gint* result_length3, GError** error); static GType test_get_type_once (void); static void test_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters); static gdouble* test_proxy_array (Test* self, gint* result_length1, GError** error); static gdouble* test_proxy_multi_array (Test* self, gint* result_length1, gint* result_length2, GError** error); static gchar** test_proxy_multi_array2 (Test* self, gint* result_length1, gint* result_length2, gint* result_length3, GError** error); static void test_proxy_test_interface_init (TestIface* iface); static void _dbus_test_array (Test* self, GVariant* _parameters_, GDBusMethodInvocation* invocation); static void _dbus_test_multi_array (Test* self, GVariant* _parameters_, GDBusMethodInvocation* invocation); static void _dbus_test_multi_array2 (Test* self, GVariant* _parameters_, GDBusMethodInvocation* invocation); static void test_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data); static GVariant* test_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data); static gboolean test_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data); static void _test_unregister_object (gpointer user_data); static void _vala_main (void); static void _vala_array_destroy (gpointer array, gssize array_length, GDestroyNotify destroy_func); static void _vala_array_free (gpointer array, gssize array_length, GDestroyNotify destroy_func); static const GDBusArgInfo _test_dbus_arg_info_array_result = {-1, "result", "ad", NULL}; static const GDBusArgInfo * const _test_dbus_arg_info_array_in[] = {NULL}; static const GDBusArgInfo * const _test_dbus_arg_info_array_out[] = {&_test_dbus_arg_info_array_result, NULL}; static const GDBusMethodInfo _test_dbus_method_info_array = {-1, "Array", (GDBusArgInfo **) (&_test_dbus_arg_info_array_in), (GDBusArgInfo **) (&_test_dbus_arg_info_array_out), NULL}; static const GDBusArgInfo _test_dbus_arg_info_multi_array_result = {-1, "result", "aad", NULL}; static const GDBusArgInfo * const _test_dbus_arg_info_multi_array_in[] = {NULL}; static const GDBusArgInfo * const _test_dbus_arg_info_multi_array_out[] = {&_test_dbus_arg_info_multi_array_result, NULL}; static const GDBusMethodInfo _test_dbus_method_info_multi_array = {-1, "MultiArray", (GDBusArgInfo **) (&_test_dbus_arg_info_multi_array_in), (GDBusArgInfo **) (&_test_dbus_arg_info_multi_array_out), NULL}; static const GDBusArgInfo _test_dbus_arg_info_multi_array2_result = {-1, "result", "aaas", NULL}; static const GDBusArgInfo * const _test_dbus_arg_info_multi_array2_in[] = {NULL}; static const GDBusArgInfo * const _test_dbus_arg_info_multi_array2_out[] = {&_test_dbus_arg_info_multi_array2_result, NULL}; static const GDBusMethodInfo _test_dbus_method_info_multi_array2 = {-1, "MultiArray2", (GDBusArgInfo **) (&_test_dbus_arg_info_multi_array2_in), (GDBusArgInfo **) (&_test_dbus_arg_info_multi_array2_out), NULL}; static const GDBusMethodInfo * const _test_dbus_method_info[] = {&_test_dbus_method_info_array, &_test_dbus_method_info_multi_array, &_test_dbus_method_info_multi_array2, NULL}; static const GDBusSignalInfo * const _test_dbus_signal_info[] = {NULL}; static const GDBusPropertyInfo * const _test_dbus_property_info[] = {NULL}; static const GDBusInterfaceInfo _test_dbus_interface_info = {-1, "org.example.Test", (GDBusMethodInfo **) (&_test_dbus_method_info), (GDBusSignalInfo **) (&_test_dbus_signal_info), (GDBusPropertyInfo **) (&_test_dbus_property_info), NULL}; static const GDBusInterfaceVTable _test_dbus_interface_vtable = {test_dbus_interface_method_call, test_dbus_interface_get_property, test_dbus_interface_set_property}; gdouble* test_array (Test* self, gint* result_length1, GError** error) { TestIface* _iface_; g_return_val_if_fail (IS_TEST (self), NULL); _iface_ = TEST_GET_INTERFACE (self); if (_iface_->array) { return _iface_->array (self, result_length1, error); } return NULL; } gdouble* test_multi_array (Test* self, gint* result_length1, gint* result_length2, GError** error) { TestIface* _iface_; g_return_val_if_fail (IS_TEST (self), NULL); _iface_ = TEST_GET_INTERFACE (self); if (_iface_->multi_array) { return _iface_->multi_array (self, result_length1, result_length2, error); } return NULL; } gchar** test_multi_array2 (Test* self, gint* result_length1, gint* result_length2, gint* result_length3, GError** error) { TestIface* _iface_; g_return_val_if_fail (IS_TEST (self), NULL); _iface_ = TEST_GET_INTERFACE (self); if (_iface_->multi_array2) { return _iface_->multi_array2 (self, result_length1, result_length2, result_length3, error); } return NULL; } static void test_default_init (TestIface * iface, gpointer iface_data) { } static GType test_get_type_once (void) { static const GTypeInfo g_define_type_info = { sizeof (TestIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) test_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; GType test_type_id; test_type_id = g_type_register_static (G_TYPE_INTERFACE, "Test", &g_define_type_info, 0); g_type_interface_add_prerequisite (test_type_id, G_TYPE_OBJECT); g_type_set_qdata (test_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) test_proxy_get_type); g_type_set_qdata (test_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.example.Test"); g_type_set_qdata (test_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_test_dbus_interface_info)); g_type_set_qdata (test_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) test_register_object); return test_type_id; } GType test_get_type (void) { static volatile gsize test_type_id__once = 0; if (g_once_init_enter (&test_type_id__once)) { GType test_type_id; test_type_id = test_get_type_once (); g_once_init_leave (&test_type_id__once, test_type_id); } return test_type_id__once; } G_DEFINE_TYPE_EXTENDED (TestProxy, test_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (TYPE_TEST, test_proxy_test_interface_init) ) static void test_proxy_class_init (TestProxyClass* klass) { G_DBUS_PROXY_CLASS (klass)->g_signal = test_proxy_g_signal; } static void test_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters) { } static void test_proxy_init (TestProxy* self) { g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_test_dbus_interface_info)); } static gdouble* test_proxy_array (Test* self, gint* result_length1, GError** error) { GDBusMessage *_message; GVariant *_arguments; GVariantBuilder _arguments_builder; GDBusMessage *_reply_message; GVariant *_reply; GVariantIter _reply_iter; gdouble* _result = NULL; gint _result_length1; GVariant* _tmp0_; gdouble* _tmp1_; gint _tmp1__length; gint _tmp1__size; gint _tmp1__length1; GVariantIter _tmp2_; GVariant* _tmp3_; G_DBUS_ERROR; G_IO_ERROR; _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.example.Test", "Array"); g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); _arguments = g_variant_builder_end (&_arguments_builder); g_dbus_message_set_body (_message, _arguments); _reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error); g_object_unref (_message); if (!_reply_message) { return NULL; } if (g_dbus_message_to_gerror (_reply_message, error)) { g_object_unref (_reply_message); return NULL; } _reply = g_dbus_message_get_body (_reply_message); g_variant_iter_init (&_reply_iter, _reply); _result_length1 = 0; _tmp0_ = g_variant_iter_next_value (&_reply_iter); _tmp1_ = g_new (gdouble, 5); _tmp1__length = 0; _tmp1__size = 4; _tmp1__length1 = 0; g_variant_iter_init (&_tmp2_, _tmp0_); for (; (_tmp3_ = g_variant_iter_next_value (&_tmp2_)) != NULL; _tmp1__length1++) { if (_tmp1__size == _tmp1__length) { _tmp1__size = 2 * _tmp1__size; _tmp1_ = g_renew (gdouble, _tmp1_, _tmp1__size + 1); } _tmp1_[_tmp1__length++] = g_variant_get_double (_tmp3_); g_variant_unref (_tmp3_); } _result_length1 = _tmp1__length1; _result = _tmp1_; g_variant_unref (_tmp0_); *result_length1 = _result_length1; g_object_unref (_reply_message); return _result; } static gdouble* test_proxy_multi_array (Test* self, gint* result_length1, gint* result_length2, GError** error) { GDBusMessage *_message; GVariant *_arguments; GVariantBuilder _arguments_builder; GDBusMessage *_reply_message; GVariant *_reply; GVariantIter _reply_iter; gdouble* _result = NULL; gint _result_length1; gint _result_length2; GVariant* _tmp4_; gdouble* _tmp5_; gint _tmp5__length; gint _tmp5__size; gint _tmp5__length1; GVariantIter _tmp6_; GVariant* _tmp7_; G_DBUS_ERROR; G_IO_ERROR; _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.example.Test", "MultiArray"); g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); _arguments = g_variant_builder_end (&_arguments_builder); g_dbus_message_set_body (_message, _arguments); _reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error); g_object_unref (_message); if (!_reply_message) { return NULL; } if (g_dbus_message_to_gerror (_reply_message, error)) { g_object_unref (_reply_message); return NULL; } _reply = g_dbus_message_get_body (_reply_message); g_variant_iter_init (&_reply_iter, _reply); _result_length1 = 0; _result_length2 = 0; _tmp4_ = g_variant_iter_next_value (&_reply_iter); _tmp5_ = g_new (gdouble, 5); _tmp5__length = 0; _tmp5__size = 4; _tmp5__length1 = 0; g_variant_iter_init (&_tmp6_, _tmp4_); for (; (_tmp7_ = g_variant_iter_next_value (&_tmp6_)) != NULL; _tmp5__length1++) { gint _tmp5__length2; GVariantIter _tmp8_; GVariant* _tmp9_; _tmp5__length2 = 0; g_variant_iter_init (&_tmp8_, _tmp7_); for (; (_tmp9_ = g_variant_iter_next_value (&_tmp8_)) != NULL; _tmp5__length2++) { if (_tmp5__size == _tmp5__length) { _tmp5__size = 2 * _tmp5__size; _tmp5_ = g_renew (gdouble, _tmp5_, _tmp5__size + 1); } _tmp5_[_tmp5__length++] = g_variant_get_double (_tmp9_); g_variant_unref (_tmp9_); } _result_length2 = _tmp5__length2; g_variant_unref (_tmp7_); } _result_length1 = _tmp5__length1; _result = _tmp5_; g_variant_unref (_tmp4_); *result_length1 = _result_length1; *result_length2 = _result_length2; g_object_unref (_reply_message); return _result; } static gchar** test_proxy_multi_array2 (Test* self, gint* result_length1, gint* result_length2, gint* result_length3, GError** error) { GDBusMessage *_message; GVariant *_arguments; GVariantBuilder _arguments_builder; GDBusMessage *_reply_message; GVariant *_reply; GVariantIter _reply_iter; gchar** _result = NULL; gint _result_length1; gint _result_length2; gint _result_length3; GVariant* _tmp10_; gchar** _tmp11_; gint _tmp11__length; gint _tmp11__size; gint _tmp11__length1; GVariantIter _tmp12_; GVariant* _tmp13_; G_DBUS_ERROR; G_IO_ERROR; _message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.example.Test", "MultiArray2"); g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); _arguments = g_variant_builder_end (&_arguments_builder); g_dbus_message_set_body (_message, _arguments); _reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error); g_object_unref (_message); if (!_reply_message) { return NULL; } if (g_dbus_message_to_gerror (_reply_message, error)) { g_object_unref (_reply_message); return NULL; } _reply = g_dbus_message_get_body (_reply_message); g_variant_iter_init (&_reply_iter, _reply); _result_length1 = 0; _result_length2 = 0; _result_length3 = 0; _tmp10_ = g_variant_iter_next_value (&_reply_iter); _tmp11_ = g_new (gchar*, 5); _tmp11__length = 0; _tmp11__size = 4; _tmp11__length1 = 0; g_variant_iter_init (&_tmp12_, _tmp10_); for (; (_tmp13_ = g_variant_iter_next_value (&_tmp12_)) != NULL; _tmp11__length1++) { gint _tmp11__length2; GVariantIter _tmp14_; GVariant* _tmp15_; _tmp11__length2 = 0; g_variant_iter_init (&_tmp14_, _tmp13_); for (; (_tmp15_ = g_variant_iter_next_value (&_tmp14_)) != NULL; _tmp11__length2++) { gint _tmp11__length3; GVariantIter _tmp16_; GVariant* _tmp17_; _tmp11__length3 = 0; g_variant_iter_init (&_tmp16_, _tmp15_); for (; (_tmp17_ = g_variant_iter_next_value (&_tmp16_)) != NULL; _tmp11__length3++) { if (_tmp11__size == _tmp11__length) { _tmp11__size = 2 * _tmp11__size; _tmp11_ = g_renew (gchar*, _tmp11_, _tmp11__size + 1); } _tmp11_[_tmp11__length++] = g_variant_dup_string (_tmp17_, NULL); g_variant_unref (_tmp17_); } _result_length3 = _tmp11__length3; g_variant_unref (_tmp15_); } _result_length2 = _tmp11__length2; g_variant_unref (_tmp13_); } _result_length1 = _tmp11__length1; _tmp11_[_tmp11__length] = NULL; _result = _tmp11_; g_variant_unref (_tmp10_); *result_length1 = _result_length1; *result_length2 = _result_length2; *result_length3 = _result_length3; g_object_unref (_reply_message); return _result; } static void test_proxy_test_interface_init (TestIface* iface) { iface->array = test_proxy_array; iface->multi_array = test_proxy_multi_array; iface->multi_array2 = test_proxy_multi_array2; } static void _dbus_test_array (Test* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) { GError* error = NULL; GVariantIter _arguments_iter; GDBusMessage* _reply_message = NULL; GVariant* _reply; GVariantBuilder _reply_builder; gdouble* result; gint result_length1 = 0; gdouble* _tmp18_; GVariantBuilder _tmp19_; gint _tmp20_; g_variant_iter_init (&_arguments_iter, _parameters_); result = test_array (self, &result_length1, &error); if (error) { g_dbus_method_invocation_take_error (invocation, error); return; } _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE); _tmp18_ = result; g_variant_builder_init (&_tmp19_, G_VARIANT_TYPE ("ad")); for (_tmp20_ = 0; _tmp20_ < result_length1; _tmp20_++) { g_variant_builder_add_value (&_tmp19_, g_variant_new_double (*_tmp18_)); _tmp18_++; } g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp19_)); result = (g_free (result), NULL); _reply = g_variant_builder_end (&_reply_builder); g_dbus_message_set_body (_reply_message, _reply); g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); g_object_unref (invocation); g_object_unref (_reply_message); } static void _dbus_test_multi_array (Test* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) { GError* error = NULL; GVariantIter _arguments_iter; GDBusMessage* _reply_message = NULL; GVariant* _reply; GVariantBuilder _reply_builder; gdouble* result; gint result_length1 = 0; gint result_length2 = 0; gdouble* _tmp21_; GVariantBuilder _tmp22_; gint _tmp23_; g_variant_iter_init (&_arguments_iter, _parameters_); result = test_multi_array (self, &result_length1, &result_length2, &error); if (error) { g_dbus_method_invocation_take_error (invocation, error); return; } _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE); _tmp21_ = result; g_variant_builder_init (&_tmp22_, G_VARIANT_TYPE ("aad")); for (_tmp23_ = 0; _tmp23_ < result_length1; _tmp23_++) { GVariantBuilder _tmp24_; gint _tmp25_; g_variant_builder_init (&_tmp24_, G_VARIANT_TYPE ("ad")); for (_tmp25_ = 0; _tmp25_ < result_length2; _tmp25_++) { g_variant_builder_add_value (&_tmp24_, g_variant_new_double (*_tmp21_)); _tmp21_++; } g_variant_builder_add_value (&_tmp22_, g_variant_builder_end (&_tmp24_)); } g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp22_)); result = (g_free (result), NULL); _reply = g_variant_builder_end (&_reply_builder); g_dbus_message_set_body (_reply_message, _reply); g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); g_object_unref (invocation); g_object_unref (_reply_message); } static void _dbus_test_multi_array2 (Test* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) { GError* error = NULL; GVariantIter _arguments_iter; GDBusMessage* _reply_message = NULL; GVariant* _reply; GVariantBuilder _reply_builder; gchar** result; gint result_length1 = 0; gint result_length2 = 0; gint result_length3 = 0; gchar** _tmp26_; GVariantBuilder _tmp27_; gint _tmp28_; g_variant_iter_init (&_arguments_iter, _parameters_); result = test_multi_array2 (self, &result_length1, &result_length2, &result_length3, &error); if (error) { g_dbus_method_invocation_take_error (invocation, error); return; } _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation)); g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE); _tmp26_ = result; g_variant_builder_init (&_tmp27_, G_VARIANT_TYPE ("aaas")); for (_tmp28_ = 0; _tmp28_ < result_length1; _tmp28_++) { GVariantBuilder _tmp29_; gint _tmp30_; g_variant_builder_init (&_tmp29_, G_VARIANT_TYPE ("aas")); for (_tmp30_ = 0; _tmp30_ < result_length2; _tmp30_++) { GVariantBuilder _tmp31_; gint _tmp32_; g_variant_builder_init (&_tmp31_, G_VARIANT_TYPE ("as")); for (_tmp32_ = 0; _tmp32_ < result_length3; _tmp32_++) { g_variant_builder_add_value (&_tmp31_, g_variant_new_string (*_tmp26_)); _tmp26_++; } g_variant_builder_add_value (&_tmp29_, g_variant_builder_end (&_tmp31_)); } g_variant_builder_add_value (&_tmp27_, g_variant_builder_end (&_tmp29_)); } g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp27_)); result = (_vala_array_free (result, (result_length1 * result_length2) * result_length3, (GDestroyNotify) g_free), NULL); _reply = g_variant_builder_end (&_reply_builder); g_dbus_message_set_body (_reply_message, _reply); g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); g_object_unref (invocation); g_object_unref (_reply_message); } static void test_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) { gpointer* data; gpointer object; data = user_data; object = data[0]; if (strcmp (method_name, "Array") == 0) { _dbus_test_array (object, parameters, invocation); } else if (strcmp (method_name, "MultiArray") == 0) { _dbus_test_multi_array (object, parameters, invocation); } else if (strcmp (method_name, "MultiArray2") == 0) { _dbus_test_multi_array2 (object, parameters, invocation); } else { g_object_unref (invocation); } } static GVariant* test_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data) { gpointer* data; gpointer object; data = user_data; object = data[0]; return NULL; } static gboolean test_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) { gpointer* data; gpointer object; data = user_data; object = data[0]; return FALSE; } guint test_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) { guint result; gpointer *data; data = g_new (gpointer, 3); data[0] = g_object_ref (object); data[1] = g_object_ref (connection); data[2] = g_strdup (path); result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_test_dbus_interface_info), &_test_dbus_interface_vtable, data, _test_unregister_object, error); if (!result) { return 0; } return result; } static void _test_unregister_object (gpointer user_data) { gpointer* data; data = user_data; g_object_unref (data[0]); g_object_unref (data[1]); g_free (data[2]); g_free (data); } static void _vala_main (void) { Test* test = NULL; Test* _tmp0_; gdouble* a = NULL; Test* _tmp1_; gint _tmp2_ = 0; gdouble* _tmp3_; gint a_length1; gint _a_size_; gboolean _tmp4_ = FALSE; gboolean _tmp5_ = FALSE; gdouble* _tmp6_; gint _tmp6__length1; gdouble* b = NULL; Test* _tmp11_; gint _tmp12_ = 0; gint _tmp13_ = 0; gdouble* _tmp14_; gint b_length1; gint b_length2; gboolean _tmp15_ = FALSE; gboolean _tmp16_ = FALSE; gboolean _tmp17_ = FALSE; gboolean _tmp18_ = FALSE; gboolean _tmp19_ = FALSE; gdouble* _tmp20_; gint _tmp20__length1; gint _tmp20__length2; gint _tmp21_; gchar** c = NULL; Test* _tmp32_; gint _tmp33_ = 0; gint _tmp34_ = 0; gint _tmp35_ = 0; gchar** _tmp36_; gint c_length1; gint c_length2; gint c_length3; gboolean _tmp37_ = FALSE; gboolean _tmp38_ = FALSE; gboolean _tmp39_ = FALSE; gboolean _tmp40_ = FALSE; gboolean _tmp41_ = FALSE; gboolean _tmp42_ = FALSE; gchar** _tmp43_; gint _tmp43__length1; gint _tmp43__length2; gint _tmp43__length3; gint _tmp44_; GError* _inner_error0_ = NULL; _tmp0_ = (Test*) g_initable_new (TYPE_TEST_PROXY, NULL, &_inner_error0_, "g-flags", 0, "g-name", "org.example.Test", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/example/test", "g-interface-name", "org.example.Test", NULL); test = (Test*) _tmp0_; if (G_UNLIKELY (_inner_error0_ != NULL)) { g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code); g_clear_error (&_inner_error0_); return; } _tmp1_ = test; _tmp3_ = test_array (_tmp1_, &_tmp2_, &_inner_error0_); a = _tmp3_; a_length1 = _tmp2_; _a_size_ = a_length1; if (G_UNLIKELY (_inner_error0_ != NULL)) { _g_object_unref0 (test); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code); g_clear_error (&_inner_error0_); return; } _tmp6_ = a; _tmp6__length1 = a_length1; if (_tmp6__length1 == 2) { gdouble* _tmp7_; gint _tmp7__length1; gdouble _tmp8_; _tmp7_ = a; _tmp7__length1 = a_length1; _tmp8_ = _tmp7_[0]; _tmp5_ = _tmp8_ == 2.0; } else { _tmp5_ = FALSE; } if (_tmp5_) { gdouble* _tmp9_; gint _tmp9__length1; gdouble _tmp10_; _tmp9_ = a; _tmp9__length1 = a_length1; _tmp10_ = _tmp9_[1]; _tmp4_ = _tmp10_ == 3.0; } else { _tmp4_ = FALSE; } _vala_assert (_tmp4_, "a.length == 2 && a[0] == 2.0 && a[1] == 3.0"); _tmp11_ = test; _tmp14_ = test_multi_array (_tmp11_, &_tmp12_, &_tmp13_, &_inner_error0_); b = _tmp14_; b_length1 = _tmp12_; b_length2 = _tmp13_; if (G_UNLIKELY (_inner_error0_ != NULL)) { a = (g_free (a), NULL); _g_object_unref0 (test); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code); g_clear_error (&_inner_error0_); return; } _tmp20_ = b; _tmp20__length1 = b_length1; _tmp20__length2 = b_length2; _tmp21_ = _tmp20__length1; if (_tmp21_ == 2) { gdouble* _tmp22_; gint _tmp22__length1; gint _tmp22__length2; gint _tmp23_; _tmp22_ = b; _tmp22__length1 = b_length1; _tmp22__length2 = b_length2; _tmp23_ = _tmp22__length2; _tmp19_ = _tmp23_ == 2; } else { _tmp19_ = FALSE; } if (_tmp19_) { gdouble* _tmp24_; gint _tmp24__length1; gint _tmp24__length2; gdouble _tmp25_; _tmp24_ = b; _tmp24__length1 = b_length1; _tmp24__length2 = b_length2; _tmp25_ = _tmp24_[(0 * _tmp24__length2) + 0]; _tmp18_ = _tmp25_ == 2.0; } else { _tmp18_ = FALSE; } if (_tmp18_) { gdouble* _tmp26_; gint _tmp26__length1; gint _tmp26__length2; gdouble _tmp27_; _tmp26_ = b; _tmp26__length1 = b_length1; _tmp26__length2 = b_length2; _tmp27_ = _tmp26_[(0 * _tmp26__length2) + 1]; _tmp17_ = _tmp27_ == 3.0; } else { _tmp17_ = FALSE; } if (_tmp17_) { gdouble* _tmp28_; gint _tmp28__length1; gint _tmp28__length2; gdouble _tmp29_; _tmp28_ = b; _tmp28__length1 = b_length1; _tmp28__length2 = b_length2; _tmp29_ = _tmp28_[(1 * _tmp28__length2) + 0]; _tmp16_ = _tmp29_ == 4.0; } else { _tmp16_ = FALSE; } if (_tmp16_) { gdouble* _tmp30_; gint _tmp30__length1; gint _tmp30__length2; gdouble _tmp31_; _tmp30_ = b; _tmp30__length1 = b_length1; _tmp30__length2 = b_length2; _tmp31_ = _tmp30_[(1 * _tmp30__length2) + 1]; _tmp15_ = _tmp31_ == 5.0; } else { _tmp15_ = FALSE; } _vala_assert (_tmp15_, "b.length[0] == 2 && b.length[1] == 2 && b[0,0] == 2.0 && b[0,1] == 3.0 && b[1,0] == 4.0 && b[1,1] == 5.0"); _tmp32_ = test; _tmp36_ = test_multi_array2 (_tmp32_, &_tmp33_, &_tmp34_, &_tmp35_, &_inner_error0_); c = _tmp36_; c_length1 = _tmp33_; c_length2 = _tmp34_; c_length3 = _tmp35_; if (G_UNLIKELY (_inner_error0_ != NULL)) { b = (g_free (b), NULL); a = (g_free (a), NULL); _g_object_unref0 (test); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code); g_clear_error (&_inner_error0_); return; } _tmp43_ = c; _tmp43__length1 = c_length1; _tmp43__length2 = c_length2; _tmp43__length3 = c_length3; _tmp44_ = _tmp43__length1; if (_tmp44_ == 2) { gchar** _tmp45_; gint _tmp45__length1; gint _tmp45__length2; gint _tmp45__length3; gint _tmp46_; _tmp45_ = c; _tmp45__length1 = c_length1; _tmp45__length2 = c_length2; _tmp45__length3 = c_length3; _tmp46_ = _tmp45__length2; _tmp42_ = _tmp46_ == 2; } else { _tmp42_ = FALSE; } if (_tmp42_) { gchar** _tmp47_; gint _tmp47__length1; gint _tmp47__length2; gint _tmp47__length3; gint _tmp48_; _tmp47_ = c; _tmp47__length1 = c_length1; _tmp47__length2 = c_length2; _tmp47__length3 = c_length3; _tmp48_ = _tmp47__length3; _tmp41_ = _tmp48_ == 2; } else { _tmp41_ = FALSE; } if (_tmp41_) { gchar** _tmp49_; gint _tmp49__length1; gint _tmp49__length2; gint _tmp49__length3; const gchar* _tmp50_; _tmp49_ = c; _tmp49__length1 = c_length1; _tmp49__length2 = c_length2; _tmp49__length3 = c_length3; _tmp50_ = _tmp49_[(((0 * _tmp49__length2) + 0) * _tmp49__length3) + 0]; _tmp40_ = g_strcmp0 (_tmp50_, "foo") == 0; } else { _tmp40_ = FALSE; } if (_tmp40_) { gchar** _tmp51_; gint _tmp51__length1; gint _tmp51__length2; gint _tmp51__length3; const gchar* _tmp52_; _tmp51_ = c; _tmp51__length1 = c_length1; _tmp51__length2 = c_length2; _tmp51__length3 = c_length3; _tmp52_ = _tmp51_[(((0 * _tmp51__length2) + 0) * _tmp51__length3) + 1]; _tmp39_ = g_strcmp0 (_tmp52_, "bar") == 0; } else { _tmp39_ = FALSE; } if (_tmp39_) { gchar** _tmp53_; gint _tmp53__length1; gint _tmp53__length2; gint _tmp53__length3; const gchar* _tmp54_; _tmp53_ = c; _tmp53__length1 = c_length1; _tmp53__length2 = c_length2; _tmp53__length3 = c_length3; _tmp54_ = _tmp53_[(((1 * _tmp53__length2) + 1) * _tmp53__length3) + 0]; _tmp38_ = g_strcmp0 (_tmp54_, "baz2") == 0; } else { _tmp38_ = FALSE; } if (_tmp38_) { gchar** _tmp55_; gint _tmp55__length1; gint _tmp55__length2; gint _tmp55__length3; const gchar* _tmp56_; _tmp55_ = c; _tmp55__length1 = c_length1; _tmp55__length2 = c_length2; _tmp55__length3 = c_length3; _tmp56_ = _tmp55_[(((1 * _tmp55__length2) + 1) * _tmp55__length3) + 1]; _tmp37_ = g_strcmp0 (_tmp56_, "man2") == 0; } else { _tmp37_ = FALSE; } _vala_assert (_tmp37_, "c.length[0] == 2 && c.length[1] == 2 && c.length[2] == 2 && c[0,0,0] == \"foo\" && c[0,0,1] == \"bar\" && c[1,1,0] == \"baz2\" && c[1,1,1] == \"man2\""); c = (_vala_array_free (c, (c_length1 * c_length2) * c_length3, (GDestroyNotify) g_free), NULL); b = (g_free (b), NULL); a = (g_free (a), NULL); _g_object_unref0 (test); } int main (int argc, char ** argv) { _vala_main (); return 0; } static void _vala_array_destroy (gpointer array, gssize array_length, GDestroyNotify destroy_func) { if ((array != NULL) && (destroy_func != NULL)) { gssize i; for (i = 0; i < array_length; i = i + 1) { if (((gpointer*) array)[i] != NULL) { destroy_func (((gpointer*) array)[i]); } } } } static void _vala_array_free (gpointer array, gssize array_length, GDestroyNotify destroy_func) { _vala_array_destroy (array, array_length, destroy_func); g_free (array); }