#include <girepository.h>

int main() {
	GError *error = NULL;
	GIRepository *gir = g_irepository_get_default ();

	GITypelib *typelib = g_irepository_require(gir, "Gio", "2.0", 0, &error);
	g_assert_no_error (error);

	GIInterfaceInfo *info = g_irepository_find_by_name(gir, "Gio", "ListModel");
	g_assert (info != NULL);

	g_print ("%i vfuncs in ListStore iface\n", g_interface_info_get_n_vfuncs (info));
	for (int i=0; i< g_interface_info_get_n_vfuncs (info); i++) {
		GIVFuncInfo *vfunc_info = g_interface_info_get_vfunc (info, i);
		g_print ("%i: %s\n", i, g_base_info_get_name(vfunc_info));

		g_print ("%i: %i args\n", i, g_callable_info_get_n_args(vfunc_info));
		GITypeInfo *return_info = g_callable_info_get_return_type(vfunc_info);

		GITypeTag return_info_type_tag = g_type_info_get_tag (return_info);
		g_print ("%i: return type %s\n", i, g_type_tag_to_string(return_info_type_tag));
	}
}
