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 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141
|
/* asynchronous_bug614294.c generated by valac, the Vala compiler
* generated from asynchronous_bug614294.vala, do not modify */
#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#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_IFOO (ifoo_get_type ())
#define IFOO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IFOO, IFoo))
#define IS_IFOO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IFOO))
#define IFOO_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_IFOO, IFooIface))
typedef struct _IFoo IFoo;
typedef struct _IFooIface IFooIface;
#define TYPE_BAR (bar_get_type ())
#define BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BAR, Bar))
#define BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BAR, BarClass))
#define IS_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BAR))
#define IS_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BAR))
#define BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BAR, BarClass))
typedef struct _Bar Bar;
typedef struct _BarClass BarClass;
typedef struct _BarPrivate BarPrivate;
enum {
BAR_0_PROPERTY,
BAR_NUM_PROPERTIES
};
static GParamSpec* bar_properties[BAR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _BarFooAsyncData BarFooAsyncData;
#define TYPE_SUB_BAR (sub_bar_get_type ())
#define SUB_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SUB_BAR, SubBar))
#define SUB_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SUB_BAR, SubBarClass))
#define IS_SUB_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SUB_BAR))
#define IS_SUB_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SUB_BAR))
#define SUB_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SUB_BAR, SubBarClass))
typedef struct _SubBar SubBar;
typedef struct _SubBarClass SubBarClass;
typedef struct _SubBarPrivate SubBarPrivate;
enum {
SUB_BAR_0_PROPERTY,
SUB_BAR_NUM_PROPERTIES
};
static GParamSpec* sub_bar_properties[SUB_BAR_NUM_PROPERTIES];
typedef struct _SubBarFooAsyncData SubBarFooAsyncData;
#define TYPE_AFOO (afoo_get_type ())
#define AFOO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_AFOO, AFoo))
#define AFOO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_AFOO, AFooClass))
#define IS_AFOO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_AFOO))
#define IS_AFOO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_AFOO))
#define AFOO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_AFOO, AFooClass))
typedef struct _AFoo AFoo;
typedef struct _AFooClass AFooClass;
typedef struct _AFooPrivate AFooPrivate;
enum {
AFOO_0_PROPERTY,
AFOO_NUM_PROPERTIES
};
static GParamSpec* afoo_properties[AFOO_NUM_PROPERTIES];
#define TYPE_BAZ (baz_get_type ())
#define BAZ(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BAZ, Baz))
#define BAZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BAZ, BazClass))
#define IS_BAZ(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BAZ))
#define IS_BAZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BAZ))
#define BAZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BAZ, BazClass))
typedef struct _Baz Baz;
typedef struct _BazClass BazClass;
typedef struct _BazPrivate BazPrivate;
enum {
BAZ_0_PROPERTY,
BAZ_NUM_PROPERTIES
};
static GParamSpec* baz_properties[BAZ_NUM_PROPERTIES];
typedef struct _BazFooAsyncData BazFooAsyncData;
#define TYPE_SUB_BAZ (sub_baz_get_type ())
#define SUB_BAZ(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SUB_BAZ, SubBaz))
#define SUB_BAZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SUB_BAZ, SubBazClass))
#define IS_SUB_BAZ(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SUB_BAZ))
#define IS_SUB_BAZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SUB_BAZ))
#define SUB_BAZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SUB_BAZ, SubBazClass))
typedef struct _SubBaz SubBaz;
typedef struct _SubBazClass SubBazClass;
typedef struct _SubBazPrivate SubBazPrivate;
enum {
SUB_BAZ_0_PROPERTY,
SUB_BAZ_NUM_PROPERTIES
};
static GParamSpec* sub_baz_properties[SUB_BAZ_NUM_PROPERTIES];
typedef struct _SubBazFooAsyncData SubBazFooAsyncData;
typedef struct _RunData RunData;
struct _IFooIface {
GTypeInterface parent_iface;
void (*foo_async) (IFoo* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void (*foo_finish) (IFoo* self, GAsyncResult* _res_, GError** error);
void (*foo) (IFoo* self, GError** error);
};
struct _Bar {
GObject parent_instance;
BarPrivate * priv;
};
struct _BarClass {
GObjectClass parent_class;
void (*foo_async) (Bar* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void (*foo_finish) (Bar* self, GAsyncResult* _res_, GError** error);
void (*foo) (Bar* self, GError** error);
};
struct _BarFooAsyncData {
int _state_;
GObject* _source_object_;
GAsyncResult* _res_;
GTask* _async_result;
Bar* self;
};
struct _SubBar {
Bar parent_instance;
SubBarPrivate * priv;
};
struct _SubBarClass {
BarClass parent_class;
};
struct _SubBarFooAsyncData {
int _state_;
GObject* _source_object_;
GAsyncResult* _res_;
GTask* _async_result;
SubBar* self;
};
struct _AFoo {
GObject parent_instance;
AFooPrivate * priv;
};
struct _AFooClass {
GObjectClass parent_class;
void (*foo_async) (AFoo* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void (*foo_finish) (AFoo* self, GAsyncResult* _res_, GError** error);
void (*foo) (AFoo* self, GError** error);
};
struct _Baz {
AFoo parent_instance;
BazPrivate * priv;
};
struct _BazClass {
AFooClass parent_class;
};
struct _BazFooAsyncData {
int _state_;
GObject* _source_object_;
GAsyncResult* _res_;
GTask* _async_result;
Baz* self;
};
struct _SubBaz {
Baz parent_instance;
SubBazPrivate * priv;
};
struct _SubBazClass {
BazClass parent_class;
};
struct _SubBazFooAsyncData {
int _state_;
GObject* _source_object_;
GAsyncResult* _res_;
GTask* _async_result;
SubBaz* self;
};
struct _RunData {
int _state_;
GObject* _source_object_;
GAsyncResult* _res_;
GTask* _async_result;
Bar* bar;
Bar* _tmp0_;
Bar* _tmp1_;
Bar* _tmp2_;
SubBar* subbar;
SubBar* _tmp3_;
SubBar* _tmp4_;
SubBar* _tmp5_;
Baz* baz;
Baz* _tmp6_;
Baz* _tmp7_;
Bar* _tmp8_;
SubBaz* subbaz;
SubBaz* _tmp9_;
SubBaz* _tmp10_;
SubBaz* _tmp11_;
GError* _inner_error0_;
};
static gpointer bar_parent_class = NULL;
static IFooIface * bar_ifoo_parent_iface = NULL;
static gpointer sub_bar_parent_class = NULL;
static gpointer afoo_parent_class = NULL;
static gpointer baz_parent_class = NULL;
static gpointer sub_baz_parent_class = NULL;
VALA_EXTERN GType ifoo_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (IFoo, g_object_unref)
VALA_EXTERN void ifoo_foo_async (IFoo* self,
GAsyncReadyCallback _callback_,
gpointer _user_data_);
VALA_EXTERN void ifoo_foo_finish (IFoo* self,
GAsyncResult* _res_,
GError** error);
VALA_EXTERN void ifoo_foo (IFoo* self,
GError** error);
static GType ifoo_get_type_once (void);
VALA_EXTERN GType bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Bar, g_object_unref)
VALA_EXTERN void bar_foo_async (Bar* self,
GAsyncReadyCallback _callback_,
gpointer _user_data_);
VALA_EXTERN void bar_foo_finish (Bar* self,
GAsyncResult* _res_,
GError** error);
VALA_EXTERN void bar_foo (Bar* self,
GError** error);
static void bar_real_foo_async_data_free (gpointer _data);
static void bar_real_foo_async (Bar* self,
GAsyncReadyCallback _callback_,
gpointer _user_data_);
static gboolean bar_real_foo_async_co (BarFooAsyncData* _data_);
static void bar_real_foo (Bar* self,
GError** error);
VALA_EXTERN Bar* bar_new (void);
VALA_EXTERN Bar* bar_construct (GType object_type);
static GType bar_get_type_once (void);
VALA_EXTERN GType sub_bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SubBar, g_object_unref)
static void sub_bar_real_foo_async_data_free (gpointer _data);
static void sub_bar_real_foo_async (Bar* base,
GAsyncReadyCallback _callback_,
gpointer _user_data_);
static gboolean sub_bar_real_foo_async_co (SubBarFooAsyncData* _data_);
static void sub_bar_real_foo (Bar* base,
GError** error);
VALA_EXTERN SubBar* sub_bar_new (void);
VALA_EXTERN SubBar* sub_bar_construct (GType object_type);
static GType sub_bar_get_type_once (void);
VALA_EXTERN GType afoo_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AFoo, g_object_unref)
VALA_EXTERN void afoo_foo (AFoo* self,
GError** error);
VALA_EXTERN void afoo_foo_async (AFoo* self,
GAsyncReadyCallback _callback_,
gpointer _user_data_);
VALA_EXTERN void afoo_foo_finish (AFoo* self,
GAsyncResult* _res_,
GError** error);
static void afoo_real_foo (AFoo* self,
GError** error);
VALA_EXTERN AFoo* afoo_construct (GType object_type);
static GType afoo_get_type_once (void);
VALA_EXTERN GType baz_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Baz, g_object_unref)
static void baz_real_foo_async_data_free (gpointer _data);
static void baz_real_foo_async (AFoo* base,
GAsyncReadyCallback _callback_,
gpointer _user_data_);
static gboolean baz_real_foo_async_co (BazFooAsyncData* _data_);
static void baz_real_foo (AFoo* base,
GError** error);
VALA_EXTERN Baz* baz_new (void);
VALA_EXTERN Baz* baz_construct (GType object_type);
static GType baz_get_type_once (void);
VALA_EXTERN GType sub_baz_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SubBaz, g_object_unref)
static void sub_baz_real_foo_async_data_free (gpointer _data);
static void sub_baz_real_foo_async (AFoo* base,
GAsyncReadyCallback _callback_,
gpointer _user_data_);
static gboolean sub_baz_real_foo_async_co (SubBazFooAsyncData* _data_);
static void sub_baz_real_foo (AFoo* base,
GError** error);
VALA_EXTERN SubBaz* sub_baz_new (void);
VALA_EXTERN SubBaz* sub_baz_construct (GType object_type);
static GType sub_baz_get_type_once (void);
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 void run_ready (GObject* source_object,
GAsyncResult* _res_,
gpointer _user_data_);
static void _vala_main (void);
void
ifoo_foo_async (IFoo* self,
GAsyncReadyCallback _callback_,
gpointer _user_data_)
{
IFooIface* _iface_;
_iface_ = IFOO_GET_INTERFACE (self);
if (_iface_->foo_async) {
_iface_->foo_async (self, _callback_, _user_data_);
}
}
void
ifoo_foo_finish (IFoo* self,
GAsyncResult* _res_,
GError** error)
{
IFooIface* _iface_;
_iface_ = IFOO_GET_INTERFACE (self);
if (_iface_->foo_finish) {
_iface_->foo_finish (self, _res_, error);
}
}
void
ifoo_foo (IFoo* self,
GError** error)
{
IFooIface* _iface_;
g_return_if_fail (IS_IFOO (self));
_iface_ = IFOO_GET_INTERFACE (self);
if (_iface_->foo) {
_iface_->foo (self, error);
}
}
static void
ifoo_default_init (IFooIface * iface,
gpointer iface_data)
{
}
static GType
ifoo_get_type_once (void)
{
static const GTypeInfo g_define_type_info = { sizeof (IFooIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ifoo_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
GType ifoo_type_id;
ifoo_type_id = g_type_register_static (G_TYPE_INTERFACE, "IFoo", &g_define_type_info, 0);
g_type_interface_add_prerequisite (ifoo_type_id, G_TYPE_OBJECT);
return ifoo_type_id;
}
GType
ifoo_get_type (void)
{
static volatile gsize ifoo_type_id__once = 0;
if (g_once_init_enter (&ifoo_type_id__once)) {
GType ifoo_type_id;
ifoo_type_id = ifoo_get_type_once ();
g_once_init_leave (&ifoo_type_id__once, ifoo_type_id);
}
return ifoo_type_id__once;
}
static void
bar_real_foo_async_data_free (gpointer _data)
{
BarFooAsyncData* _data_;
_data_ = _data;
_g_object_unref0 (_data_->self);
g_slice_free (BarFooAsyncData, _data_);
}
static gpointer
_g_object_ref0 (gpointer self)
{
return self ? g_object_ref (self) : NULL;
}
static void
bar_real_foo_async (Bar* self,
GAsyncReadyCallback _callback_,
gpointer _user_data_)
{
BarFooAsyncData* _data_;
Bar* _tmp0_;
_data_ = g_slice_new0 (BarFooAsyncData);
_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
g_task_set_task_data (_data_->_async_result, _data_, bar_real_foo_async_data_free);
_tmp0_ = _g_object_ref0 (self);
_data_->self = _tmp0_;
bar_real_foo_async_co (_data_);
}
static void
bar_real_foo_finish (Bar* self,
GAsyncResult* _res_,
GError** error)
{
BarFooAsyncData* _data_;
_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}
static gboolean
bar_real_foo_async_co (BarFooAsyncData* _data_)
{
switch (_data_->_state_) {
case 0:
goto _state_0;
default:
g_assert_not_reached ();
}
_state_0:
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;
}
void
bar_foo_async (Bar* self,
GAsyncReadyCallback _callback_,
gpointer _user_data_)
{
BarClass* _klass_;
_klass_ = BAR_GET_CLASS (self);
if (_klass_->foo_async) {
_klass_->foo_async (self, _callback_, _user_data_);
}
}
void
bar_foo_finish (Bar* self,
GAsyncResult* _res_,
GError** error)
{
BarClass* _klass_;
_klass_ = BAR_GET_CLASS (self);
if (_klass_->foo_finish) {
_klass_->foo_finish (self, _res_, error);
}
}
static void
bar_real_foo (Bar* self,
GError** error)
{
}
void
bar_foo (Bar* self,
GError** error)
{
BarClass* _klass_;
g_return_if_fail (IS_BAR (self));
_klass_ = BAR_GET_CLASS (self);
if (_klass_->foo) {
_klass_->foo (self, error);
}
}
Bar*
bar_construct (GType object_type)
{
Bar * self = NULL;
self = (Bar*) g_object_new (object_type, NULL);
return self;
}
Bar*
bar_new (void)
{
return bar_construct (TYPE_BAR);
}
static void
bar_class_init (BarClass * klass,
gpointer klass_data)
{
bar_parent_class = g_type_class_peek_parent (klass);
((BarClass *) klass)->foo_async = (void (*) (Bar*, GAsyncReadyCallback, gpointer)) bar_real_foo_async;
((BarClass *) klass)->foo_finish = (void (*) (Bar*, GAsyncResult*, GError**)) bar_real_foo_finish;
((BarClass *) klass)->foo = (void (*) (Bar*, GError**)) bar_real_foo;
}
static void
bar_ifoo_interface_init (IFooIface * iface,
gpointer iface_data)
{
bar_ifoo_parent_iface = g_type_interface_peek_parent (iface);
iface->foo_async = (void (*) (IFoo*, GAsyncReadyCallback, gpointer)) bar_foo_async;
iface->foo_finish = (void (*) (IFoo*, GAsyncResult*, GError**)) bar_foo_finish;
iface->foo = (void (*) (IFoo*, GError**)) bar_foo;
}
static void
bar_instance_init (Bar * self,
gpointer klass)
{
}
static GType
bar_get_type_once (void)
{
static const GTypeInfo g_define_type_info = { sizeof (BarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Bar), 0, (GInstanceInitFunc) bar_instance_init, NULL };
static const GInterfaceInfo ifoo_info = { (GInterfaceInitFunc) bar_ifoo_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
GType bar_type_id;
bar_type_id = g_type_register_static (G_TYPE_OBJECT, "Bar", &g_define_type_info, 0);
g_type_add_interface_static (bar_type_id, TYPE_IFOO, &ifoo_info);
return bar_type_id;
}
GType
bar_get_type (void)
{
static volatile gsize bar_type_id__once = 0;
if (g_once_init_enter (&bar_type_id__once)) {
GType bar_type_id;
bar_type_id = bar_get_type_once ();
g_once_init_leave (&bar_type_id__once, bar_type_id);
}
return bar_type_id__once;
}
static void
sub_bar_real_foo_async_data_free (gpointer _data)
{
SubBarFooAsyncData* _data_;
_data_ = _data;
_g_object_unref0 (_data_->self);
g_slice_free (SubBarFooAsyncData, _data_);
}
static void
sub_bar_real_foo_async (Bar* base,
GAsyncReadyCallback _callback_,
gpointer _user_data_)
{
SubBar * self;
SubBarFooAsyncData* _data_;
SubBar* _tmp0_;
self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SUB_BAR, SubBar);
_data_ = g_slice_new0 (SubBarFooAsyncData);
_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
g_task_set_task_data (_data_->_async_result, _data_, sub_bar_real_foo_async_data_free);
_tmp0_ = _g_object_ref0 (self);
_data_->self = _tmp0_;
sub_bar_real_foo_async_co (_data_);
}
static void
sub_bar_foo_finish (Bar* base,
GAsyncResult* _res_,
GError** error)
{
SubBarFooAsyncData* _data_;
_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}
static gboolean
sub_bar_real_foo_async_co (SubBarFooAsyncData* _data_)
{
switch (_data_->_state_) {
case 0:
goto _state_0;
default:
g_assert_not_reached ();
}
_state_0:
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
sub_bar_real_foo (Bar* base,
GError** error)
{
SubBar * self;
self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SUB_BAR, SubBar);
}
SubBar*
sub_bar_construct (GType object_type)
{
SubBar * self = NULL;
self = (SubBar*) bar_construct (object_type);
return self;
}
SubBar*
sub_bar_new (void)
{
return sub_bar_construct (TYPE_SUB_BAR);
}
static void
sub_bar_class_init (SubBarClass * klass,
gpointer klass_data)
{
sub_bar_parent_class = g_type_class_peek_parent (klass);
((BarClass *) klass)->foo_async = (void (*) (Bar*, GAsyncReadyCallback, gpointer)) sub_bar_real_foo_async;
((BarClass *) klass)->foo_finish = (void (*) (Bar*, GAsyncResult*, GError**)) sub_bar_foo_finish;
((BarClass *) klass)->foo = (void (*) (Bar*, GError**)) sub_bar_real_foo;
}
static void
sub_bar_instance_init (SubBar * self,
gpointer klass)
{
}
static GType
sub_bar_get_type_once (void)
{
static const GTypeInfo g_define_type_info = { sizeof (SubBarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sub_bar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SubBar), 0, (GInstanceInitFunc) sub_bar_instance_init, NULL };
GType sub_bar_type_id;
sub_bar_type_id = g_type_register_static (TYPE_BAR, "SubBar", &g_define_type_info, 0);
return sub_bar_type_id;
}
GType
sub_bar_get_type (void)
{
static volatile gsize sub_bar_type_id__once = 0;
if (g_once_init_enter (&sub_bar_type_id__once)) {
GType sub_bar_type_id;
sub_bar_type_id = sub_bar_get_type_once ();
g_once_init_leave (&sub_bar_type_id__once, sub_bar_type_id);
}
return sub_bar_type_id__once;
}
void
afoo_foo_async (AFoo* self,
GAsyncReadyCallback _callback_,
gpointer _user_data_)
{
AFooClass* _klass_;
_klass_ = AFOO_GET_CLASS (self);
if (_klass_->foo_async) {
_klass_->foo_async (self, _callback_, _user_data_);
}
}
void
afoo_foo_finish (AFoo* self,
GAsyncResult* _res_,
GError** error)
{
AFooClass* _klass_;
_klass_ = AFOO_GET_CLASS (self);
if (_klass_->foo_finish) {
_klass_->foo_finish (self, _res_, error);
}
}
static void
afoo_real_foo (AFoo* self,
GError** error)
{
g_critical ("Type `%s' does not implement abstract method `afoo_foo'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
return;
}
void
afoo_foo (AFoo* self,
GError** error)
{
AFooClass* _klass_;
g_return_if_fail (IS_AFOO (self));
_klass_ = AFOO_GET_CLASS (self);
if (_klass_->foo) {
_klass_->foo (self, error);
}
}
AFoo*
afoo_construct (GType object_type)
{
AFoo * self = NULL;
self = (AFoo*) g_object_new (object_type, NULL);
return self;
}
static void
afoo_class_init (AFooClass * klass,
gpointer klass_data)
{
afoo_parent_class = g_type_class_peek_parent (klass);
((AFooClass *) klass)->foo = (void (*) (AFoo*, GError**)) afoo_real_foo;
}
static void
afoo_instance_init (AFoo * self,
gpointer klass)
{
}
static GType
afoo_get_type_once (void)
{
static const GTypeInfo g_define_type_info = { sizeof (AFooClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) afoo_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AFoo), 0, (GInstanceInitFunc) afoo_instance_init, NULL };
GType afoo_type_id;
afoo_type_id = g_type_register_static (G_TYPE_OBJECT, "AFoo", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
return afoo_type_id;
}
GType
afoo_get_type (void)
{
static volatile gsize afoo_type_id__once = 0;
if (g_once_init_enter (&afoo_type_id__once)) {
GType afoo_type_id;
afoo_type_id = afoo_get_type_once ();
g_once_init_leave (&afoo_type_id__once, afoo_type_id);
}
return afoo_type_id__once;
}
static void
baz_real_foo_async_data_free (gpointer _data)
{
BazFooAsyncData* _data_;
_data_ = _data;
_g_object_unref0 (_data_->self);
g_slice_free (BazFooAsyncData, _data_);
}
static void
baz_real_foo_async (AFoo* base,
GAsyncReadyCallback _callback_,
gpointer _user_data_)
{
Baz * self;
BazFooAsyncData* _data_;
Baz* _tmp0_;
self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_BAZ, Baz);
_data_ = g_slice_new0 (BazFooAsyncData);
_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
g_task_set_task_data (_data_->_async_result, _data_, baz_real_foo_async_data_free);
_tmp0_ = _g_object_ref0 (self);
_data_->self = _tmp0_;
baz_real_foo_async_co (_data_);
}
static void
baz_foo_finish (AFoo* base,
GAsyncResult* _res_,
GError** error)
{
BazFooAsyncData* _data_;
_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}
static gboolean
baz_real_foo_async_co (BazFooAsyncData* _data_)
{
switch (_data_->_state_) {
case 0:
goto _state_0;
default:
g_assert_not_reached ();
}
_state_0:
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
baz_real_foo (AFoo* base,
GError** error)
{
Baz * self;
self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_BAZ, Baz);
}
Baz*
baz_construct (GType object_type)
{
Baz * self = NULL;
self = (Baz*) afoo_construct (object_type);
return self;
}
Baz*
baz_new (void)
{
return baz_construct (TYPE_BAZ);
}
static void
baz_class_init (BazClass * klass,
gpointer klass_data)
{
baz_parent_class = g_type_class_peek_parent (klass);
((AFooClass *) klass)->foo_async = (void (*) (AFoo*, GAsyncReadyCallback, gpointer)) baz_real_foo_async;
((AFooClass *) klass)->foo_finish = (void (*) (AFoo*, GAsyncResult*, GError**)) baz_foo_finish;
((AFooClass *) klass)->foo = (void (*) (AFoo*, GError**)) baz_real_foo;
}
static void
baz_instance_init (Baz * self,
gpointer klass)
{
}
static GType
baz_get_type_once (void)
{
static const GTypeInfo g_define_type_info = { sizeof (BazClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) baz_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Baz), 0, (GInstanceInitFunc) baz_instance_init, NULL };
GType baz_type_id;
baz_type_id = g_type_register_static (TYPE_AFOO, "Baz", &g_define_type_info, 0);
return baz_type_id;
}
GType
baz_get_type (void)
{
static volatile gsize baz_type_id__once = 0;
if (g_once_init_enter (&baz_type_id__once)) {
GType baz_type_id;
baz_type_id = baz_get_type_once ();
g_once_init_leave (&baz_type_id__once, baz_type_id);
}
return baz_type_id__once;
}
static void
sub_baz_real_foo_async_data_free (gpointer _data)
{
SubBazFooAsyncData* _data_;
_data_ = _data;
_g_object_unref0 (_data_->self);
g_slice_free (SubBazFooAsyncData, _data_);
}
static void
sub_baz_real_foo_async (AFoo* base,
GAsyncReadyCallback _callback_,
gpointer _user_data_)
{
SubBaz * self;
SubBazFooAsyncData* _data_;
SubBaz* _tmp0_;
self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SUB_BAZ, SubBaz);
_data_ = g_slice_new0 (SubBazFooAsyncData);
_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
g_task_set_task_data (_data_->_async_result, _data_, sub_baz_real_foo_async_data_free);
_tmp0_ = _g_object_ref0 (self);
_data_->self = _tmp0_;
sub_baz_real_foo_async_co (_data_);
}
static void
sub_baz_foo_finish (AFoo* base,
GAsyncResult* _res_,
GError** error)
{
SubBazFooAsyncData* _data_;
_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}
static gboolean
sub_baz_real_foo_async_co (SubBazFooAsyncData* _data_)
{
switch (_data_->_state_) {
case 0:
goto _state_0;
default:
g_assert_not_reached ();
}
_state_0:
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
sub_baz_real_foo (AFoo* base,
GError** error)
{
SubBaz * self;
self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SUB_BAZ, SubBaz);
}
SubBaz*
sub_baz_construct (GType object_type)
{
SubBaz * self = NULL;
self = (SubBaz*) baz_construct (object_type);
return self;
}
SubBaz*
sub_baz_new (void)
{
return sub_baz_construct (TYPE_SUB_BAZ);
}
static void
sub_baz_class_init (SubBazClass * klass,
gpointer klass_data)
{
sub_baz_parent_class = g_type_class_peek_parent (klass);
((AFooClass *) klass)->foo_async = (void (*) (AFoo*, GAsyncReadyCallback, gpointer)) sub_baz_real_foo_async;
((AFooClass *) klass)->foo_finish = (void (*) (AFoo*, GAsyncResult*, GError**)) sub_baz_foo_finish;
((AFooClass *) klass)->foo = (void (*) (AFoo*, GError**)) sub_baz_real_foo;
}
static void
sub_baz_instance_init (SubBaz * self,
gpointer klass)
{
}
static GType
sub_baz_get_type_once (void)
{
static const GTypeInfo g_define_type_info = { sizeof (SubBazClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sub_baz_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SubBaz), 0, (GInstanceInitFunc) sub_baz_instance_init, NULL };
GType sub_baz_type_id;
sub_baz_type_id = g_type_register_static (TYPE_BAZ, "SubBaz", &g_define_type_info, 0);
return sub_baz_type_id;
}
GType
sub_baz_get_type (void)
{
static volatile gsize sub_baz_type_id__once = 0;
if (g_once_init_enter (&sub_baz_type_id__once)) {
GType sub_baz_type_id;
sub_baz_type_id = sub_baz_get_type_once ();
g_once_init_leave (&sub_baz_type_id__once, sub_baz_type_id);
}
return sub_baz_type_id__once;
}
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 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 gboolean
run_co (RunData* _data_)
{
switch (_data_->_state_) {
case 0:
goto _state_0;
case 1:
goto _state_1;
case 2:
goto _state_2;
case 3:
goto _state_3;
case 4:
goto _state_4;
default:
g_assert_not_reached ();
}
_state_0:
_data_->_tmp0_ = bar_new ();
_data_->bar = _data_->_tmp0_;
_data_->_tmp1_ = _data_->bar;
bar_foo (_data_->_tmp1_, NULL);
_data_->_tmp2_ = _data_->bar;
_data_->_state_ = 1;
bar_foo_async (_data_->_tmp2_, run_ready, _data_);
return FALSE;
_state_1:
bar_foo_finish (_data_->_tmp2_, _data_->_res_, NULL);
_data_->_tmp3_ = sub_bar_new ();
_data_->subbar = _data_->_tmp3_;
_data_->_tmp4_ = _data_->subbar;
bar_foo (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp4_, TYPE_BAR, Bar), NULL);
_data_->_tmp5_ = _data_->subbar;
_data_->_state_ = 2;
bar_foo_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp5_, TYPE_BAR, Bar), run_ready, _data_);
return FALSE;
_state_2:
bar_foo_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp5_, TYPE_BAR, Bar), _data_->_res_, NULL);
_data_->_tmp6_ = baz_new ();
_data_->baz = _data_->_tmp6_;
_data_->_tmp7_ = _data_->baz;
afoo_foo (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp7_, TYPE_AFOO, AFoo), &_data_->_inner_error0_);
if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
_g_object_unref0 (_data_->baz);
_g_object_unref0 (_data_->subbar);
_g_object_unref0 (_data_->bar);
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_->_tmp8_ = _data_->bar;
_data_->_state_ = 3;
bar_foo_async (_data_->_tmp8_, run_ready, _data_);
return FALSE;
_state_3:
bar_foo_finish (_data_->_tmp8_, _data_->_res_, NULL);
_data_->_tmp9_ = sub_baz_new ();
_data_->subbaz = _data_->_tmp9_;
_data_->_tmp10_ = _data_->subbaz;
afoo_foo (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp10_, TYPE_AFOO, AFoo), &_data_->_inner_error0_);
if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
_g_object_unref0 (_data_->subbaz);
_g_object_unref0 (_data_->baz);
_g_object_unref0 (_data_->subbar);
_g_object_unref0 (_data_->bar);
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_->subbaz;
_data_->_state_ = 4;
afoo_foo_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp11_, TYPE_AFOO, AFoo), run_ready, _data_);
return FALSE;
_state_4:
afoo_foo_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp11_, TYPE_AFOO, AFoo), _data_->_res_, &_data_->_inner_error0_);
if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
_g_object_unref0 (_data_->subbaz);
_g_object_unref0 (_data_->baz);
_g_object_unref0 (_data_->subbar);
_g_object_unref0 (_data_->bar);
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;
}
_g_object_unref0 (_data_->subbaz);
_g_object_unref0 (_data_->baz);
_g_object_unref0 (_data_->subbar);
_g_object_unref0 (_data_->bar);
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)
{
run (NULL, NULL);
}
int
main (int argc,
char ** argv)
{
_vala_main ();
return 0;
}
|