/* test-vala.c generated by valac 0.21.1.22-31ca, the Vala compiler
 * generated from test-vala.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <stdio.h>


#define TYPE_IFACE (iface_get_type ())
#define IFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IFACE, IFace))
#define IS_IFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IFACE))
#define IFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_IFACE, IFaceIface))

typedef struct _IFace IFace;
typedef struct _IFaceIface IFaceIface;

#define TYPE_ACL (acl_get_type ())
#define ACL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ACL, ACl))
#define ACL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ACL, AClClass))
#define IS_ACL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ACL))
#define IS_ACL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ACL))
#define ACL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ACL, AClClass))

typedef struct _ACl ACl;
typedef struct _AClClass AClClass;
typedef struct _AClPrivate AClPrivate;

#define TYPE_BCL (bcl_get_type ())
#define BCL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BCL, BCl))
#define BCL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BCL, BClClass))
#define IS_BCL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BCL))
#define IS_BCL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BCL))
#define BCL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BCL, BClClass))

typedef struct _BCl BCl;
typedef struct _BClClass BClClass;
typedef struct _BClPrivate BClPrivate;

#define TYPE_CCL (ccl_get_type ())
#define CCL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CCL, CCl))
#define CCL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CCL, CClClass))
#define IS_CCL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CCL))
#define IS_CCL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CCL))
#define CCL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CCL, CClClass))

typedef struct _CCl CCl;
typedef struct _CClClass CClClass;
typedef struct _CClPrivate CClPrivate;

#define TYPE_DCL (dcl_get_type ())
#define DCL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DCL, DCl))
#define DCL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DCL, DClClass))
#define IS_DCL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DCL))
#define IS_DCL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DCL))
#define DCL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DCL, DClClass))

typedef struct _DCl DCl;
typedef struct _DClClass DClClass;
typedef struct _DClPrivate DClPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _IFaceIface {
	GTypeInterface parent_iface;
	void (*f) (IFace* self);
};

struct _ACl {
	GObject parent_instance;
	AClPrivate * priv;
};

struct _AClClass {
	GObjectClass parent_class;
	void (*f) (ACl* self);
};

struct _BCl {
	ACl parent_instance;
	BClPrivate * priv;
};

struct _BClClass {
	AClClass parent_class;
};

struct _CCl {
	BCl parent_instance;
	CClPrivate * priv;
};

struct _CClClass {
	BClClass parent_class;
};

struct _DCl {
	CCl parent_instance;
	DClPrivate * priv;
};

struct _DClClass {
	CClClass parent_class;
};


static gpointer acl_parent_class = NULL;
static IFaceIface* acl_iface_parent_iface = NULL;
static gpointer bcl_parent_class = NULL;
static gpointer ccl_parent_class = NULL;
static gpointer dcl_parent_class = NULL;

GType iface_get_type (void) G_GNUC_CONST;
void iface_f (IFace* self);
GType acl_get_type (void) G_GNUC_CONST;
enum  {
	ACL_DUMMY_PROPERTY
};
void acl_f (ACl* self);
static void acl_real_f (ACl* self);
ACl* acl_construct (GType object_type);
GType bcl_get_type (void) G_GNUC_CONST;
enum  {
	BCL_DUMMY_PROPERTY
};
static void bcl_real_f (ACl* base);
BCl* bcl_new (void);
BCl* bcl_construct (GType object_type);
GType ccl_get_type (void) G_GNUC_CONST;
enum  {
	CCL_DUMMY_PROPERTY
};
static void ccl_real_f (ACl* base);
CCl* ccl_new (void);
CCl* ccl_construct (GType object_type);
GType dcl_get_type (void) G_GNUC_CONST;
enum  {
	DCL_DUMMY_PROPERTY
};
static void dcl_real_f (ACl* base);
DCl* dcl_new (void);
DCl* dcl_construct (GType object_type);
gint _vala_main (void);


void iface_f (IFace* self) {
	g_return_if_fail (self != NULL);
	fprintf (stderr, "iface(%p)->f\n", IFACE_GET_INTERFACE (self));
	IFACE_GET_INTERFACE (self)->f (self);
}


static void iface_base_init (IFaceIface * iface) {
	static gboolean initialized = FALSE;
	if (!initialized) {
		initialized = TRUE;
	}
}


GType iface_get_type (void) {
	static volatile gsize iface_type_id__volatile = 0;
	if (g_once_init_enter (&iface_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (IFaceIface), (GBaseInitFunc) iface_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
		GType iface_type_id;
		iface_type_id = g_type_register_static (G_TYPE_INTERFACE, "IFace", &g_define_type_info, 0);
		g_type_interface_add_prerequisite (iface_type_id, G_TYPE_OBJECT);
		g_once_init_leave (&iface_type_id__volatile, iface_type_id);
	}
	return iface_type_id__volatile;
}


static void acl_real_f (ACl* self) {
	g_critical ("Type `%s' does not implement abstract method `acl_f'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}


void acl_f (ACl* self) {
	g_return_if_fail (self != NULL);
	ACL_GET_CLASS (self)->f (self);
}


ACl* acl_construct (GType object_type) {
	ACl * self = NULL;
	self = (ACl*) g_object_new (object_type, NULL);
	return self;
}

static void acl_child_iface_interface_init (IFaceIface * iface) {
	AClClass *class;
	fprintf (stderr, "acl_child_iface_interface_init: %s - %s\n", g_type_name (((GTypeInterface *)iface)->g_type), g_type_name (((GTypeInterface *)iface)->g_instance_type));
	fprintf (stderr, "    >>> %p->%p\n", iface, iface->f);

	class = g_type_class_ref (((GTypeInterface *)iface)->g_instance_type);
	iface->f = class->f;
	g_type_class_unref (class);
}

static void acl_base_init (AClClass * klass) {
	if (G_TYPE_FROM_CLASS (klass) != TYPE_ACL) {
		fprintf (stderr, "acl_class_init: %s\n", g_type_name (G_TYPE_FROM_CLASS (klass)));
		static const GInterfaceInfo iface_info = { (GInterfaceInitFunc) acl_child_iface_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		g_type_add_interface_static (G_TYPE_FROM_CLASS (klass),
					     TYPE_IFACE,
					     &iface_info);
	}
}

static void acl_class_init (AClClass * klass) {
	acl_parent_class = g_type_class_peek_parent (klass);
	ACL_CLASS (klass)->f = acl_real_f;
}


static void acl_iface_interface_init (IFaceIface * iface) {
	acl_iface_parent_iface = g_type_interface_peek_parent (iface);
	iface->f = (void (*)(IFace*)) acl_f;
}

static void acl_instance_init (ACl * self) {	
}


GType acl_get_type (void) {
	static volatile gsize acl_type_id__volatile = 0;
	if (g_once_init_enter (&acl_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (AClClass), (GBaseInitFunc) acl_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) acl_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ACl), 0, (GInstanceInitFunc) acl_instance_init, NULL };
		static const GInterfaceInfo iface_info = { (GInterfaceInitFunc) acl_iface_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType acl_type_id;
		acl_type_id = g_type_register_static (G_TYPE_OBJECT, "ACl", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
		g_type_add_interface_static (acl_type_id, TYPE_IFACE, &iface_info);
		g_once_init_leave (&acl_type_id__volatile, acl_type_id);
	}
	return acl_type_id__volatile;
}


static void bcl_real_f (ACl* base) {
	BCl * self;
	FILE* _tmp0_ = NULL;
	self = (BCl*) base;
	_tmp0_ = stderr;
	fprintf (_tmp0_, "BCl.f ()\n");
}


BCl* bcl_construct (GType object_type) {
	BCl * self = NULL;
	self = (BCl*) acl_construct (object_type);
	return self;
}


BCl* bcl_new (void) {
	return bcl_construct (TYPE_BCL);
}


static void bcl_class_init (BClClass * klass) {
	bcl_parent_class = g_type_class_peek_parent (klass);
	ACL_CLASS (klass)->f = bcl_real_f;
}


static void bcl_instance_init (BCl * self) {
}


GType bcl_get_type (void) {
	static volatile gsize bcl_type_id__volatile = 0;
	if (g_once_init_enter (&bcl_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BClClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bcl_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BCl), 0, (GInstanceInitFunc) bcl_instance_init, NULL };
		GType bcl_type_id;
		bcl_type_id = g_type_register_static (TYPE_ACL, "BCl", &g_define_type_info, 0);
		g_once_init_leave (&bcl_type_id__volatile, bcl_type_id);
	}
	return bcl_type_id__volatile;
}


static void ccl_real_f (ACl* base) {
	CCl * self;
	FILE* _tmp0_ = NULL;
	self = (CCl*) base;
	_tmp0_ = stderr;
	fprintf (_tmp0_, "CCl.f ()\n");
}


CCl* ccl_construct (GType object_type) {
	CCl * self = NULL;
	self = (CCl*) bcl_construct (object_type);
	return self;
}


CCl* ccl_new (void) {
	return ccl_construct (TYPE_CCL);
}


static void ccl_class_init (CClClass * klass) {
	ccl_parent_class = g_type_class_peek_parent (klass);
	ACL_CLASS (klass)->f = ccl_real_f;
}


static void ccl_instance_init (CCl * self) {
}


GType ccl_get_type (void) {
	static volatile gsize ccl_type_id__volatile = 0;
	if (g_once_init_enter (&ccl_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (CClClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ccl_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CCl), 0, (GInstanceInitFunc) ccl_instance_init, NULL };
		GType ccl_type_id;
		ccl_type_id = g_type_register_static (TYPE_BCL, "CCl", &g_define_type_info, 0);
		g_once_init_leave (&ccl_type_id__volatile, ccl_type_id);
	}
	return ccl_type_id__volatile;
}


static void dcl_real_f (ACl* base) {
	DCl * self;
	FILE* _tmp0_ = NULL;
	self = (DCl*) base;
	_tmp0_ = stderr;
	fprintf (_tmp0_, "DCl.f ()\n");
}


DCl* dcl_construct (GType object_type) {
	DCl * self = NULL;
	self = (DCl*) ccl_construct (object_type);
	return self;
}


DCl* dcl_new (void) {
	return dcl_construct (TYPE_DCL);
}


static void dcl_class_init (DClClass * klass) {
	dcl_parent_class = g_type_class_peek_parent (klass);
	ACL_CLASS (klass)->f = dcl_real_f;
}


static void dcl_instance_init (DCl * self) {
}


GType dcl_get_type (void) {
	static volatile gsize dcl_type_id__volatile = 0;
	if (g_once_init_enter (&dcl_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (DClClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dcl_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DCl), 0, (GInstanceInitFunc) dcl_instance_init, NULL };
		GType dcl_type_id;
		dcl_type_id = g_type_register_static (TYPE_CCL, "DCl", &g_define_type_info, 0);
		g_once_init_leave (&dcl_type_id__volatile, dcl_type_id);
	}
	return dcl_type_id__volatile;
}


gint _vala_main (void) {
	gint result = 0;
	FILE* _tmp0_ = NULL;
	IFace* b = NULL;
	BCl* _tmp1_ = NULL;
	IFace* _tmp2_ = NULL;
	FILE* _tmp3_ = NULL;
	IFace* c = NULL;
	CCl* _tmp4_ = NULL;
	FILE* _tmp5_ = NULL;
	IFace* d = NULL;
	DCl* _tmp6_ = NULL;
	FILE* _tmp7_ = NULL;
	BCl* _tmp8_ = NULL;
	IFace* _tmp9_ = NULL;
	_tmp0_ = stderr;
	fprintf (_tmp0_, ">>> BCl\n");
	_tmp1_ = bcl_new ();
	b = (IFace*) _tmp1_;
	_tmp2_ = b;
	iface_f (_tmp2_);
	_tmp3_ = stderr;
	fprintf (_tmp3_, ">>> CCl\n");
	_tmp4_ = ccl_new ();
	c = (IFace*) _tmp4_;
	iface_f (c);
	_tmp5_ = stderr;
	fprintf (_tmp5_, ">>> DCl\n");
	_tmp6_ = dcl_new ();
	d = (IFace*) _tmp6_;
	iface_f (d);
	_tmp7_ = stderr;
	fprintf (_tmp7_, ">>> BCl\n");
	_tmp8_ = bcl_new ();
	_g_object_unref0 (b);
	b = (IFace*) _tmp8_;
	_tmp9_ = b;
	iface_f (_tmp9_);
	result = 0;
	_g_object_unref0 (d);
	_g_object_unref0 (c);
	_g_object_unref0 (b);
	return result;
}


int main (int argc, char ** argv) {
	g_type_init ();
	return _vala_main ();
}



