summaryrefslogtreecommitdiff
path: root/tests/dbus/no-reply_client.c-expected
blob: cc09434a726018a4cbcff56cb45d3cb7733d4eaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
/* dbus_no_reply_client.c generated by valac, the Vala compiler
 * generated from dbus_no_reply_client.vala, do not modify */

#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>

#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_free0(var) (var = (g_free (var), NULL))
typedef struct _Block1Data Block1Data;
#define _g_async_queue_unref0(var) ((var == NULL) ? NULL : (var = (g_async_queue_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _RunData RunData;
#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_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;
	gchar** (*list_messages) (Test* self, gint* result_length1, GError** error);
	void (*post_message) (Test* self, const gchar* message, GError** error);
	void (*post_message_no_reply) (Test* self, const gchar* message, GError** error);
};

struct _Block1Data {
	int _ref_count_;
	GAsyncQueue* events;
	gpointer _async_data_;
};

struct _RunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	Block1Data* _data1_;
	Test* test;
	Test* _tmp0_;
	GAsyncQueue* _tmp1_;
	GDBusConnection* connection;
	Test* _tmp2_;
	GDBusConnection* _tmp3_;
	GDBusConnection* _tmp4_;
	GDBusConnection* _tmp5_;
	gchar** messages;
	Test* _tmp6_;
	gint _tmp7_;
	gchar** _tmp8_;
	gint messages_length1;
	gint _messages_size_;
	gchar** _tmp9_;
	gint _tmp9__length1;
	Test* _tmp10_;
	GAsyncQueue* _tmp11_;
	gpointer _tmp12_;
	gchar* _tmp13_;
	GAsyncQueue* _tmp14_;
	gpointer _tmp15_;
	gchar* _tmp16_;
	Test* _tmp17_;
	GAsyncQueue* _tmp18_;
	gpointer _tmp19_;
	gchar* _tmp20_;
	GAsyncQueue* _tmp21_;
	gpointer _tmp22_;
	gchar* _tmp23_;
	gchar** _tmp24_;
	Test* _tmp25_;
	gint _tmp26_;
	gchar** _tmp27_;
	gint _tmp24__length1;
	gint __tmp24__size_;
	gchar** _tmp28_;
	gint _tmp28__length1;
	gchar** _tmp29_;
	gint _tmp29__length1;
	gchar** _tmp30_;
	gint _tmp30__length1;
	const gchar* _tmp31_;
	gchar** _tmp32_;
	gint _tmp32__length1;
	const gchar* _tmp33_;
	GMainLoop* _tmp34_;
	GError* _inner_error0_;
};

VALA_EXTERN GMainLoop* main_loop;
GMainLoop* main_loop = NULL;

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 gchar** test_list_messages (Test* self,
                            gint* result_length1,
                            GError** error);
VALA_EXTERN void test_post_message (Test* self,
                        const gchar* message,
                        GError** error);
VALA_EXTERN void test_post_message_no_reply (Test* self,
                                 const gchar* message,
                                 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 gchar** test_proxy_list_messages (Test* self,
                                  gint* result_length1,
                                  GError** error);
static void test_proxy_post_message (Test* self,
                              const gchar* message,
                              GError** error);
static void test_proxy_post_message_no_reply (Test* self,
                                       const gchar* message,
                                       GError** error);
static void test_proxy_test_interface_init (TestIface* iface);
static void _dbus_test_list_messages (Test* self,
                               GVariant* _parameters_,
                               GDBusMethodInvocation* invocation);
static void _dbus_test_post_message (Test* self,
                              GVariant* _parameters_,
                              GDBusMethodInvocation* invocation);
static void _dbus_test_post_message_no_reply (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 run_data_free (gpointer _data);
VALA_EXTERN void run (GAsyncReadyCallback _callback_,
          gpointer _user_data_);
VALA_EXTERN void run_finish (GAsyncResult* _res_);
static gboolean run_co (RunData* _data_);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void run_ready (GObject* source_object,
                GAsyncResult* _res_,
                gpointer _user_data_);
static void _g_free0_ (gpointer var);
static GDBusMessage* _vala_lambda0_ (Block1Data* _data1_,
                              GDBusConnection* conn,
                              GDBusMessage* message,
                              gboolean incoming);
static GDBusMessage* __vala_lambda0__gd_bus_message_filter_function (GDBusConnection* connection,
                                                              GDBusMessage* message,
                                                              gboolean incoming,
                                                              gpointer self);
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_list_messages_result = {-1, "result", "as", NULL};
static const GDBusArgInfo * const _test_dbus_arg_info_list_messages_in[] = {NULL};
static const GDBusArgInfo * const _test_dbus_arg_info_list_messages_out[] = {&_test_dbus_arg_info_list_messages_result, NULL};
static const GDBusMethodInfo _test_dbus_method_info_list_messages = {-1, "ListMessages", (GDBusArgInfo **) (&_test_dbus_arg_info_list_messages_in), (GDBusArgInfo **) (&_test_dbus_arg_info_list_messages_out), NULL};
static const GDBusArgInfo _test_dbus_arg_info_post_message_message = {-1, "message", "s", NULL};
static const GDBusArgInfo * const _test_dbus_arg_info_post_message_in[] = {&_test_dbus_arg_info_post_message_message, NULL};
static const GDBusArgInfo * const _test_dbus_arg_info_post_message_out[] = {NULL};
static const GDBusMethodInfo _test_dbus_method_info_post_message = {-1, "PostMessage", (GDBusArgInfo **) (&_test_dbus_arg_info_post_message_in), (GDBusArgInfo **) (&_test_dbus_arg_info_post_message_out), NULL};
static const GDBusArgInfo _test_dbus_arg_info_post_message_no_reply_message = {-1, "message", "s", NULL};
static const GDBusArgInfo * const _test_dbus_arg_info_post_message_no_reply_in[] = {&_test_dbus_arg_info_post_message_no_reply_message, NULL};
static const GDBusArgInfo * const _test_dbus_arg_info_post_message_no_reply_out[] = {NULL};
static const GDBusMethodInfo _test_dbus_method_info_post_message_no_reply = {-1, "PostMessageNoReply", (GDBusArgInfo **) (&_test_dbus_arg_info_post_message_no_reply_in), (GDBusArgInfo **) (&_test_dbus_arg_info_post_message_no_reply_out), NULL};
static const GDBusMethodInfo * const _test_dbus_method_info[] = {&_test_dbus_method_info_list_messages, &_test_dbus_method_info_post_message, &_test_dbus_method_info_post_message_no_reply, 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};

gchar**
test_list_messages (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_->list_messages) {
		return _iface_->list_messages (self, result_length1, error);
	}
	return NULL;
}

void
test_post_message (Test* self,
                   const gchar* message,
                   GError** error)
{
	TestIface* _iface_;
	g_return_if_fail (IS_TEST (self));
	_iface_ = TEST_GET_INTERFACE (self);
	if (_iface_->post_message) {
		_iface_->post_message (self, message, error);
	}
}

void
test_post_message_no_reply (Test* self,
                            const gchar* message,
                            GError** error)
{
	TestIface* _iface_;
	g_return_if_fail (IS_TEST (self));
	_iface_ = TEST_GET_INTERFACE (self);
	if (_iface_->post_message_no_reply) {
		_iface_->post_message_no_reply (self, message, error);
	}
}

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 gchar**
test_proxy_list_messages (Test* self,
                          gint* result_length1,
                          GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gchar** _result = NULL;
	gint _result_length1;
	GVariant* _tmp0_;
	gchar** _tmp1_;
	gint _tmp1__length;
	gint _tmp1__size;
	gint _tmp1__length1;
	GVariantIter _tmp2_;
	GVariant* _tmp3_;
	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", "ListMessages");
	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 (gchar*, 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 (gchar*, _tmp1_, _tmp1__size + 1);
		}
		_tmp1_[_tmp1__length++] = g_variant_dup_string (_tmp3_, NULL);
		g_variant_unref (_tmp3_);
	}
	_result_length1 = _tmp1__length1;
	_tmp1_[_tmp1__length] = NULL;
	_result = _tmp1_;
	g_variant_unref (_tmp0_);
	*result_length1 = _result_length1;
	g_object_unref (_reply_message);
	return _result;
}

static void
test_proxy_post_message (Test* self,
                         const gchar* message,
                         GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	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", "PostMessage");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (message));
	_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;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
test_proxy_post_message_no_reply (Test* self,
                                  const gchar* message,
                                  GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	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", "PostMessageNoReply");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (message));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
	g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, error);
	g_object_unref (_message);
}

static void
test_proxy_test_interface_init (TestIface* iface)
{
	iface->list_messages = test_proxy_list_messages;
	iface->post_message = test_proxy_post_message;
	iface->post_message_no_reply = test_proxy_post_message_no_reply;
}

static void
_dbus_test_list_messages (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;
	gchar** _tmp4_;
	GVariantBuilder _tmp5_;
	gint _tmp6_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = test_list_messages (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);
	_tmp4_ = result;
	g_variant_builder_init (&_tmp5_, G_VARIANT_TYPE ("as"));
	for (_tmp6_ = 0; _tmp6_ < result_length1; _tmp6_++) {
		g_variant_builder_add_value (&_tmp5_, g_variant_new_string (*_tmp4_));
		_tmp4_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp5_));
	result = (_vala_array_free (result, result_length1, (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
_dbus_test_post_message (Test* self,
                         GVariant* _parameters_,
                         GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* message = NULL;
	GVariant* _tmp7_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp7_ = g_variant_iter_next_value (&_arguments_iter);
	message = g_variant_dup_string (_tmp7_, NULL);
	g_variant_unref (_tmp7_);
	test_post_message (self, message, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_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);
	_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);
	_error:
	_g_free0 (message);
	;
}

static void
_dbus_test_post_message_no_reply (Test* self,
                                  GVariant* _parameters_,
                                  GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* message = NULL;
	GVariant* _tmp8_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp8_ = g_variant_iter_next_value (&_arguments_iter);
	message = g_variant_dup_string (_tmp8_, NULL);
	g_variant_unref (_tmp8_);
	test_post_message_no_reply (self, message, &error);
	_error:
	_g_free0 (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, "ListMessages") == 0) {
		_dbus_test_list_messages (object, parameters, invocation);
	} else if (strcmp (method_name, "PostMessage") == 0) {
		_dbus_test_post_message (object, parameters, invocation);
	} else if (strcmp (method_name, "PostMessageNoReply") == 0) {
		_dbus_test_post_message_no_reply (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
run_data_free (gpointer _data)
{
	RunData* _data_;
	_data_ = _data;
	g_slice_free (RunData, _data_);
}

void
run (GAsyncReadyCallback _callback_,
     gpointer _user_data_)
{
	RunData* _data_;
	_data_ = g_slice_new0 (RunData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, run_data_free);
	run_co (_data_);
}

void
run_finish (GAsyncResult* _res_)
{
	RunData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		_g_async_queue_unref0 (_data1_->events);
		g_slice_free (Block1Data, _data1_);
	}
}

static void
run_ready (GObject* source_object,
           GAsyncResult* _res_,
           gpointer _user_data_)
{
	RunData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	run_co (_data_);
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static GDBusMessage*
_vala_lambda0_ (Block1Data* _data1_,
                GDBusConnection* conn,
                GDBusMessage* message,
                gboolean incoming)
{
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	GDBusMessage* _tmp4_;
	GDBusMessage* result;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (conn, g_dbus_connection_get_type ()), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (message, g_dbus_message_get_type ()), NULL);
	_tmp1_ = g_dbus_message_get_interface (message);
	if (g_strcmp0 (_tmp1_, "org.example.Test") == 0) {
		const gchar* _tmp2_;
		_tmp2_ = g_dbus_message_get_member (message);
		_tmp0_ = g_strcmp0 (_tmp2_, "ListMessages") != 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		switch (g_dbus_message_get_message_type (message)) {
			case G_DBUS_MESSAGE_TYPE_METHOD_CALL:
			{
				GAsyncQueue* _tmp3_;
				_tmp3_ = _data1_->events;
				g_async_queue_push (_tmp3_, g_flags_to_string (g_dbus_message_flags_get_type (), g_dbus_message_get_flags (message)));
				break;
			}
			default:
			{
				g_assert_not_reached ();
			}
		}
	}
	_tmp4_ = _g_object_ref0 (message);
	result = _tmp4_;
	_g_object_unref0 (message);
	return result;
}

static GDBusMessage*
__vala_lambda0__gd_bus_message_filter_function (GDBusConnection* connection,
                                                GDBusMessage* message,
                                                gboolean incoming,
                                                gpointer self)
{
	GDBusMessage* result;
	result = _vala_lambda0_ (self, connection, message, incoming);
	return result;
}

static gboolean
run_co (RunData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data1_ = g_slice_new0 (Block1Data);
	_data_->_data1_->_ref_count_ = 1;
	_data_->_data1_->_async_data_ = _data_;
	_data_->_state_ = 1;
	g_async_initable_new_async (TYPE_TEST_PROXY, 0, NULL, run_ready, _data_, "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);
	return FALSE;
	_state_1:
	_data_->_tmp0_ = (Test*) g_async_initable_new_finish ((GAsyncInitable *) _data_->_source_object_, _data_->_res_, &_data_->_inner_error0_);
	_data_->test = (Test*) _data_->_tmp0_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block1_data_unref (_data_->_data1_);
		_data_->_data1_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp1_ = g_async_queue_new_full (_g_free0_);
	_data_->_data1_->events = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->test;
	g_object_get (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp2_, g_dbus_proxy_get_type (), GDBusProxy), "g-connection", &_data_->_tmp3_, NULL);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->connection = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->connection;
	g_dbus_connection_add_filter (_data_->_tmp5_, __vala_lambda0__gd_bus_message_filter_function, block1_data_ref (_data_->_data1_), block1_data_unref);
	_data_->_tmp6_ = _data_->test;
	_data_->_tmp7_ = 0;
	_data_->_tmp8_ = test_list_messages (_data_->_tmp6_, &_data_->_tmp7_, &_data_->_inner_error0_);
	_data_->messages = _data_->_tmp8_;
	_data_->messages_length1 = _data_->_tmp7_;
	_data_->_messages_size_ = _data_->messages_length1;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->connection);
		_g_object_unref0 (_data_->test);
		block1_data_unref (_data_->_data1_);
		_data_->_data1_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp9_ = _data_->messages;
	_data_->_tmp9__length1 = _data_->messages_length1;
	_vala_assert (_data_->_tmp9__length1 == 0, "messages.length == 0");
	_data_->_tmp10_ = _data_->test;
	test_post_message (_data_->_tmp10_, "round-trip", &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_data_->messages = (_vala_array_free (_data_->messages, _data_->messages_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (_data_->connection);
		_g_object_unref0 (_data_->test);
		block1_data_unref (_data_->_data1_);
		_data_->_data1_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp11_ = _data_->_data1_->events;
	_data_->_tmp12_ = g_async_queue_pop (_data_->_tmp11_);
	_data_->_tmp13_ = (gchar*) _data_->_tmp12_;
	_vala_assert (g_strcmp0 (_data_->_tmp13_, "G_DBUS_MESSAGE_FLAGS_NONE") == 0, "events.pop () == \"G_DBUS_MESSAGE_FLAGS_NONE\"");
	_g_free0 (_data_->_tmp13_);
	_data_->_tmp14_ = _data_->_data1_->events;
	_data_->_tmp15_ = g_async_queue_try_pop (_data_->_tmp14_);
	_data_->_tmp16_ = (gchar*) _data_->_tmp15_;
	_vala_assert (_data_->_tmp16_ == NULL, "events.try_pop () == null");
	_g_free0 (_data_->_tmp16_);
	_data_->_tmp17_ = _data_->test;
	test_post_message_no_reply (_data_->_tmp17_, "fire-and-forget", &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_data_->messages = (_vala_array_free (_data_->messages, _data_->messages_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (_data_->connection);
		_g_object_unref0 (_data_->test);
		block1_data_unref (_data_->_data1_);
		_data_->_data1_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp18_ = _data_->_data1_->events;
	_data_->_tmp19_ = g_async_queue_pop (_data_->_tmp18_);
	_data_->_tmp20_ = (gchar*) _data_->_tmp19_;
	_vala_assert (g_strcmp0 (_data_->_tmp20_, "G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED") == 0, "events.pop () == \"G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED\"");
	_g_free0 (_data_->_tmp20_);
	_data_->_tmp21_ = _data_->_data1_->events;
	_data_->_tmp22_ = g_async_queue_try_pop (_data_->_tmp21_);
	_data_->_tmp23_ = (gchar*) _data_->_tmp22_;
	_vala_assert (_data_->_tmp23_ == NULL, "events.try_pop () == null");
	_g_free0 (_data_->_tmp23_);
	_data_->_tmp25_ = _data_->test;
	_data_->_tmp26_ = 0;
	_data_->_tmp27_ = test_list_messages (_data_->_tmp25_, &_data_->_tmp26_, &_data_->_inner_error0_);
	_data_->_tmp24_ = _data_->_tmp27_;
	_data_->_tmp24__length1 = _data_->_tmp26_;
	_data_->__tmp24__size_ = _data_->_tmp24__length1;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_data_->messages = (_vala_array_free (_data_->messages, _data_->messages_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (_data_->connection);
		_g_object_unref0 (_data_->test);
		block1_data_unref (_data_->_data1_);
		_data_->_data1_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp28_ = _data_->_tmp24_;
	_data_->_tmp28__length1 = _data_->_tmp24__length1;
	_data_->_tmp24_ = NULL;
	_data_->_tmp24__length1 = 0;
	_data_->messages = (_vala_array_free (_data_->messages, _data_->messages_length1, (GDestroyNotify) g_free), NULL);
	_data_->messages = _data_->_tmp28_;
	_data_->messages_length1 = _data_->_tmp28__length1;
	_data_->_messages_size_ = _data_->messages_length1;
	_data_->_tmp29_ = _data_->messages;
	_data_->_tmp29__length1 = _data_->messages_length1;
	_vala_assert (_data_->_tmp29__length1 == 2, "messages.length == 2");
	_data_->_tmp30_ = _data_->messages;
	_data_->_tmp30__length1 = _data_->messages_length1;
	_data_->_tmp31_ = _data_->_tmp30_[0];
	_vala_assert (g_strcmp0 (_data_->_tmp31_, "round-trip") == 0, "messages[0] == \"round-trip\"");
	_data_->_tmp32_ = _data_->messages;
	_data_->_tmp32__length1 = _data_->messages_length1;
	_data_->_tmp33_ = _data_->_tmp32_[1];
	_vala_assert (g_strcmp0 (_data_->_tmp33_, "fire-and-forget") == 0, "messages[1] == \"fire-and-forget\"");
	_data_->_tmp34_ = main_loop;
	g_main_loop_quit (_data_->_tmp34_);
	_data_->_tmp24_ = (_vala_array_free (_data_->_tmp24_, _data_->_tmp24__length1, (GDestroyNotify) g_free), NULL);
	_data_->messages = (_vala_array_free (_data_->messages, _data_->messages_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (_data_->connection);
	_g_object_unref0 (_data_->test);
	block1_data_unref (_data_->_data1_);
	_data_->_data1_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
_vala_main (void)
{
	GMainLoop* _tmp0_;
	GMainLoop* _tmp1_;
	run (NULL, NULL);
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_g_main_loop_unref0 (main_loop);
	main_loop = _tmp0_;
	_tmp1_ = main_loop;
	g_main_loop_run (_tmp1_);
}

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);
}