/* gcp-diagnostic-support.c generated by valac 0.19.0, the Vala compiler
 * generated from gcp-diagnostic-support.vala, do not modify */

/*
 * This file is part of gedit-code-assistant.
 *
 * Copyright (C) 2011 - Jesse van den Kieboom
 *
 * gedit-code-assistant is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * gedit-code-assistant is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with gedit-code-assistant.  If not, see <http://www.gnu.org/licenses/>.
 */

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


#define GCP_TYPE_SOURCE_INDEX (gcp_source_index_get_type ())
#define GCP_SOURCE_INDEX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCP_TYPE_SOURCE_INDEX, GcpSourceIndex))
#define GCP_SOURCE_INDEX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCP_TYPE_SOURCE_INDEX, GcpSourceIndexClass))
#define GCP_IS_SOURCE_INDEX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCP_TYPE_SOURCE_INDEX))
#define GCP_IS_SOURCE_INDEX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCP_TYPE_SOURCE_INDEX))
#define GCP_SOURCE_INDEX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCP_TYPE_SOURCE_INDEX, GcpSourceIndexClass))

typedef struct _GcpSourceIndex GcpSourceIndex;
typedef struct _GcpSourceIndexClass GcpSourceIndexClass;

#define GCP_TYPE_DOCUMENT (gcp_document_get_type ())
#define GCP_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCP_TYPE_DOCUMENT, GcpDocument))
#define GCP_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCP_TYPE_DOCUMENT, GcpDocumentClass))
#define GCP_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCP_TYPE_DOCUMENT))
#define GCP_IS_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCP_TYPE_DOCUMENT))
#define GCP_DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCP_TYPE_DOCUMENT, GcpDocumentClass))

typedef struct _GcpDocument GcpDocument;
typedef struct _GcpDocumentClass GcpDocumentClass;

#define GCP_TYPE_DIAGNOSTIC_SUPPORT (gcp_diagnostic_support_get_type ())
#define GCP_DIAGNOSTIC_SUPPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCP_TYPE_DIAGNOSTIC_SUPPORT, GcpDiagnosticSupport))
#define GCP_IS_DIAGNOSTIC_SUPPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCP_TYPE_DIAGNOSTIC_SUPPORT))
#define GCP_DIAGNOSTIC_SUPPORT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GCP_TYPE_DIAGNOSTIC_SUPPORT, GcpDiagnosticSupportIface))

typedef struct _GcpDiagnosticSupport GcpDiagnosticSupport;
typedef struct _GcpDiagnosticSupportIface GcpDiagnosticSupportIface;

#define GCP_TYPE_DIAGNOSTIC_TAGS (gcp_diagnostic_tags_get_type ())
#define GCP_DIAGNOSTIC_TAGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCP_TYPE_DIAGNOSTIC_TAGS, GcpDiagnosticTags))
#define GCP_DIAGNOSTIC_TAGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCP_TYPE_DIAGNOSTIC_TAGS, GcpDiagnosticTagsClass))
#define GCP_IS_DIAGNOSTIC_TAGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCP_TYPE_DIAGNOSTIC_TAGS))
#define GCP_IS_DIAGNOSTIC_TAGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCP_TYPE_DIAGNOSTIC_TAGS))
#define GCP_DIAGNOSTIC_TAGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCP_TYPE_DIAGNOSTIC_TAGS, GcpDiagnosticTagsClass))

typedef struct _GcpDiagnosticTags GcpDiagnosticTags;
typedef struct _GcpDiagnosticTagsClass GcpDiagnosticTagsClass;

#define GCP_TYPE_SOURCE_LOCATION (gcp_source_location_get_type ())
#define GCP_SOURCE_LOCATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCP_TYPE_SOURCE_LOCATION, GcpSourceLocation))
#define GCP_SOURCE_LOCATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCP_TYPE_SOURCE_LOCATION, GcpSourceLocationClass))
#define GCP_IS_SOURCE_LOCATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCP_TYPE_SOURCE_LOCATION))
#define GCP_IS_SOURCE_LOCATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCP_TYPE_SOURCE_LOCATION))
#define GCP_SOURCE_LOCATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCP_TYPE_SOURCE_LOCATION, GcpSourceLocationClass))

typedef struct _GcpSourceLocation GcpSourceLocation;
typedef struct _GcpSourceLocationClass GcpSourceLocationClass;

#define GCP_TYPE_DIAGNOSTIC (gcp_diagnostic_get_type ())
#define GCP_DIAGNOSTIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCP_TYPE_DIAGNOSTIC, GcpDiagnostic))
#define GCP_DIAGNOSTIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCP_TYPE_DIAGNOSTIC, GcpDiagnosticClass))
#define GCP_IS_DIAGNOSTIC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCP_TYPE_DIAGNOSTIC))
#define GCP_IS_DIAGNOSTIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCP_TYPE_DIAGNOSTIC))
#define GCP_DIAGNOSTIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCP_TYPE_DIAGNOSTIC, GcpDiagnosticClass))

typedef struct _GcpDiagnostic GcpDiagnostic;
typedef struct _GcpDiagnosticClass GcpDiagnosticClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define GCP_DIAGNOSTIC_TYPE_SEVERITY (gcp_diagnostic_severity_get_type ())

typedef void (*GcpWithDiagnosticsCallback) (GcpSourceIndex* diagnostics, void* user_data);
struct _GcpDiagnosticSupportIface {
	GTypeInterface parent_iface;
	GcpSourceIndex* (*begin_diagnostics) (GcpDiagnosticSupport* self);
	void (*end_diagnostics) (GcpDiagnosticSupport* self);
	void (*set_diagnostic_tags) (GcpDiagnosticSupport* self, GcpDiagnosticTags* tags);
	GcpDiagnosticTags* (*get_diagnostic_tags) (GcpDiagnosticSupport* self);
};

typedef enum  {
	GCP_DIAGNOSTIC_SEVERITY_NONE,
	GCP_DIAGNOSTIC_SEVERITY_INFO,
	GCP_DIAGNOSTIC_SEVERITY_WARNING,
	GCP_DIAGNOSTIC_SEVERITY_ERROR,
	GCP_DIAGNOSTIC_SEVERITY_FATAL,
	GCP_DIAGNOSTIC_SEVERITY_NUM
} GcpDiagnosticSeverity;



GType gcp_source_index_get_type (void) G_GNUC_CONST;
GType gcp_document_get_type (void) G_GNUC_CONST;
GType gcp_diagnostic_tags_get_type (void) G_GNUC_CONST;
GType gcp_diagnostic_support_get_type (void) G_GNUC_CONST;
GcpSourceIndex* gcp_diagnostic_support_begin_diagnostics (GcpDiagnosticSupport* self);
void gcp_diagnostic_support_end_diagnostics (GcpDiagnosticSupport* self);
GType gcp_source_location_get_type (void) G_GNUC_CONST;
GType gcp_diagnostic_get_type (void) G_GNUC_CONST;
GcpDiagnostic** gcp_diagnostic_support_find_at (GcpDiagnosticSupport* self, GcpSourceLocation* location, int* result_length1);
GObject** gcp_source_index_find_at (GcpSourceIndex* self, GcpSourceLocation* location, int* result_length1);
static void _vala_array_add1 (GcpDiagnostic*** array, int* length, int* size, GcpDiagnostic* value);
static gint gcp_diagnostic_support_sort_on_severity (GcpDiagnosticSupport* self, void* a, void* b);
GType gcp_diagnostic_severity_get_type (void) G_GNUC_CONST;
GcpDiagnosticSeverity gcp_diagnostic_get_severity (GcpDiagnostic* self);
GcpDiagnostic** gcp_diagnostic_support_find_at_line (GcpDiagnosticSupport* self, gint line, int* result_length1);
GObject** gcp_source_index_find_at_line (GcpSourceIndex* self, gint line, int* result_length1);
static void _vala_array_add2 (GcpDiagnostic*** array, int* length, int* size, GcpDiagnostic* value);
void gcp_diagnostic_support_with_diagnostics (GcpDiagnosticSupport* self, GcpWithDiagnosticsCallback callback, void* callback_target);
void gcp_diagnostic_support_set_diagnostic_tags (GcpDiagnosticSupport* self, GcpDiagnosticTags* tags);
GcpDiagnosticTags* gcp_diagnostic_support_get_diagnostic_tags (GcpDiagnosticSupport* self);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


GcpSourceIndex* gcp_diagnostic_support_begin_diagnostics (GcpDiagnosticSupport* self) {
	g_return_val_if_fail (self != NULL, NULL);
	return GCP_DIAGNOSTIC_SUPPORT_GET_INTERFACE (self)->begin_diagnostics (self);
}


void gcp_diagnostic_support_end_diagnostics (GcpDiagnosticSupport* self) {
	g_return_if_fail (self != NULL);
	GCP_DIAGNOSTIC_SUPPORT_GET_INTERFACE (self)->end_diagnostics (self);
}


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


static void _vala_array_add1 (GcpDiagnostic*** array, int* length, int* size, GcpDiagnostic* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GcpDiagnostic*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


GcpDiagnostic** gcp_diagnostic_support_find_at (GcpDiagnosticSupport* self, GcpSourceLocation* location, int* result_length1) {
	GcpDiagnostic** result = NULL;
	GcpDiagnostic** _tmp0_ = NULL;
	GcpDiagnostic** ret;
	gint ret_length1;
	gint _ret_size_;
	GcpSourceIndex* _tmp1_ = NULL;
	GcpSourceIndex* diagnostics;
	GcpSourceIndex* _tmp2_;
	GcpSourceLocation* _tmp3_;
	gint _tmp4_ = 0;
	GObject** _tmp5_ = NULL;
	GcpDiagnostic** _tmp10_;
	gint _tmp10__length1;
	GcpDiagnostic** _tmp11_;
	gint _tmp11__length1;
	GcpDiagnostic** _tmp12_;
	gint _tmp12__length1;
	g_return_val_if_fail (location != NULL, NULL);
	_tmp0_ = g_new0 (GcpDiagnostic*, 0 + 1);
	ret = _tmp0_;
	ret_length1 = 0;
	_ret_size_ = ret_length1;
	_tmp1_ = gcp_diagnostic_support_begin_diagnostics (self);
	diagnostics = _tmp1_;
	_tmp2_ = diagnostics;
	_tmp3_ = location;
	_tmp5_ = gcp_source_index_find_at (_tmp2_, _tmp3_, &_tmp4_);
	{
		GObject** d_collection = NULL;
		gint d_collection_length1 = 0;
		gint _d_collection_size_ = 0;
		gint d_it = 0;
		d_collection = _tmp5_;
		d_collection_length1 = _tmp4_;
		for (d_it = 0; d_it < _tmp4_; d_it = d_it + 1) {
			GObject* _tmp6_;
			GObject* d = NULL;
			_tmp6_ = _g_object_ref0 (d_collection[d_it]);
			d = _tmp6_;
			{
				GcpDiagnostic** _tmp7_;
				gint _tmp7__length1;
				GObject* _tmp8_;
				GcpDiagnostic* _tmp9_;
				_tmp7_ = ret;
				_tmp7__length1 = ret_length1;
				_tmp8_ = d;
				_tmp9_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GCP_TYPE_DIAGNOSTIC, GcpDiagnostic));
				_vala_array_add1 (&ret, &ret_length1, &_ret_size_, _tmp9_);
				_g_object_unref0 (d);
			}
		}
		d_collection = (_vala_array_free (d_collection, d_collection_length1, (GDestroyNotify) g_object_unref), NULL);
	}
	gcp_diagnostic_support_end_diagnostics (self);
	_tmp10_ = ret;
	_tmp10__length1 = ret_length1;
	_tmp11_ = ret;
	_tmp11__length1 = ret_length1;
	qsort (_tmp10_, (gsize) _tmp11__length1, (gsize) sizeof (GcpDiagnostic*), (__compar_fn_t) gcp_diagnostic_support_sort_on_severity);
	_tmp12_ = ret;
	_tmp12__length1 = ret_length1;
	if (result_length1) {
		*result_length1 = _tmp12__length1;
	}
	result = _tmp12_;
	_g_object_unref0 (diagnostics);
	return result;
}


static gint gcp_diagnostic_support_sort_on_severity (GcpDiagnosticSupport* self, void* a, void* b) {
	gint result = 0;
	void* _tmp0_;
	GcpDiagnostic* _tmp1_;
	GcpDiagnostic* da;
	void* _tmp2_;
	GcpDiagnostic* _tmp3_;
	GcpDiagnostic* db;
	GcpDiagnostic* _tmp4_;
	GcpDiagnosticSeverity _tmp5_;
	GcpDiagnosticSeverity _tmp6_;
	GcpDiagnostic* _tmp7_;
	GcpDiagnosticSeverity _tmp8_;
	GcpDiagnosticSeverity _tmp9_;
	gint _tmp10_ = 0;
	GcpDiagnostic* _tmp11_;
	GcpDiagnosticSeverity _tmp12_;
	GcpDiagnosticSeverity _tmp13_;
	GcpDiagnostic* _tmp14_;
	GcpDiagnosticSeverity _tmp15_;
	GcpDiagnosticSeverity _tmp16_;
	gint _tmp17_;
	_tmp0_ = a;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GCP_TYPE_DIAGNOSTIC, GcpDiagnostic));
	da = _tmp1_;
	_tmp2_ = b;
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GCP_TYPE_DIAGNOSTIC, GcpDiagnostic));
	db = _tmp3_;
	_tmp4_ = da;
	_tmp5_ = gcp_diagnostic_get_severity (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = db;
	_tmp8_ = gcp_diagnostic_get_severity (_tmp7_);
	_tmp9_ = _tmp8_;
	if (_tmp6_ == _tmp9_) {
		result = 0;
		_g_object_unref0 (db);
		_g_object_unref0 (da);
		return result;
	}
	_tmp11_ = da;
	_tmp12_ = gcp_diagnostic_get_severity (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = db;
	_tmp15_ = gcp_diagnostic_get_severity (_tmp14_);
	_tmp16_ = _tmp15_;
	if (_tmp13_ < _tmp16_) {
		_tmp10_ = -1;
	} else {
		_tmp10_ = 1;
	}
	_tmp17_ = _tmp10_;
	result = _tmp17_;
	_g_object_unref0 (db);
	_g_object_unref0 (da);
	return result;
}


static void _vala_array_add2 (GcpDiagnostic*** array, int* length, int* size, GcpDiagnostic* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GcpDiagnostic*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


GcpDiagnostic** gcp_diagnostic_support_find_at_line (GcpDiagnosticSupport* self, gint line, int* result_length1) {
	GcpDiagnostic** result = NULL;
	GcpDiagnostic** _tmp0_ = NULL;
	GcpDiagnostic** ret;
	gint ret_length1;
	gint _ret_size_;
	GcpSourceIndex* _tmp1_ = NULL;
	GcpSourceIndex* diagnostics;
	GcpSourceIndex* _tmp2_;
	gint _tmp3_;
	gint _tmp4_ = 0;
	GObject** _tmp5_ = NULL;
	GcpDiagnostic** _tmp10_;
	gint _tmp10__length1;
	GcpDiagnostic** _tmp11_;
	gint _tmp11__length1;
	GcpDiagnostic** _tmp12_;
	gint _tmp12__length1;
	_tmp0_ = g_new0 (GcpDiagnostic*, 0 + 1);
	ret = _tmp0_;
	ret_length1 = 0;
	_ret_size_ = ret_length1;
	_tmp1_ = gcp_diagnostic_support_begin_diagnostics (self);
	diagnostics = _tmp1_;
	_tmp2_ = diagnostics;
	_tmp3_ = line;
	_tmp5_ = gcp_source_index_find_at_line (_tmp2_, _tmp3_, &_tmp4_);
	{
		GObject** d_collection = NULL;
		gint d_collection_length1 = 0;
		gint _d_collection_size_ = 0;
		gint d_it = 0;
		d_collection = _tmp5_;
		d_collection_length1 = _tmp4_;
		for (d_it = 0; d_it < _tmp4_; d_it = d_it + 1) {
			GObject* _tmp6_;
			GObject* d = NULL;
			_tmp6_ = _g_object_ref0 (d_collection[d_it]);
			d = _tmp6_;
			{
				GcpDiagnostic** _tmp7_;
				gint _tmp7__length1;
				GObject* _tmp8_;
				GcpDiagnostic* _tmp9_;
				_tmp7_ = ret;
				_tmp7__length1 = ret_length1;
				_tmp8_ = d;
				_tmp9_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GCP_TYPE_DIAGNOSTIC, GcpDiagnostic));
				_vala_array_add2 (&ret, &ret_length1, &_ret_size_, _tmp9_);
				_g_object_unref0 (d);
			}
		}
		d_collection = (_vala_array_free (d_collection, d_collection_length1, (GDestroyNotify) g_object_unref), NULL);
	}
	gcp_diagnostic_support_end_diagnostics (self);
	_tmp10_ = ret;
	_tmp10__length1 = ret_length1;
	_tmp11_ = ret;
	_tmp11__length1 = ret_length1;
	qsort (_tmp10_, (gsize) _tmp11__length1, (gsize) sizeof (GcpDiagnostic*), (__compar_fn_t) gcp_diagnostic_support_sort_on_severity);
	_tmp12_ = ret;
	_tmp12__length1 = ret_length1;
	if (result_length1) {
		*result_length1 = _tmp12__length1;
	}
	result = _tmp12_;
	_g_object_unref0 (diagnostics);
	return result;
}


void gcp_diagnostic_support_with_diagnostics (GcpDiagnosticSupport* self, GcpWithDiagnosticsCallback callback, void* callback_target) {
	GcpSourceIndex* _tmp0_ = NULL;
	GcpSourceIndex* d;
	GcpWithDiagnosticsCallback _tmp1_;
	void* _tmp1__target;
	_tmp0_ = gcp_diagnostic_support_begin_diagnostics (self);
	d = _tmp0_;
	_tmp1_ = callback;
	_tmp1__target = callback_target;
	_tmp1_ (d, _tmp1__target);
	gcp_diagnostic_support_end_diagnostics (self);
	_g_object_unref0 (d);
}


void gcp_diagnostic_support_set_diagnostic_tags (GcpDiagnosticSupport* self, GcpDiagnosticTags* tags) {
	g_return_if_fail (self != NULL);
	GCP_DIAGNOSTIC_SUPPORT_GET_INTERFACE (self)->set_diagnostic_tags (self, tags);
}


GcpDiagnosticTags* gcp_diagnostic_support_get_diagnostic_tags (GcpDiagnosticSupport* self) {
	g_return_val_if_fail (self != NULL, NULL);
	return GCP_DIAGNOSTIC_SUPPORT_GET_INTERFACE (self)->get_diagnostic_tags (self);
}


static void gcp_diagnostic_support_base_init (GcpDiagnosticSupportIface * iface) {
	static gboolean initialized = FALSE;
	if (!initialized) {
		initialized = TRUE;
		g_signal_new ("diagnostics_updated", GCP_TYPE_DIAGNOSTIC_SUPPORT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	}
}


GType gcp_diagnostic_support_get_type (void) {
	static volatile gsize gcp_diagnostic_support_type_id__volatile = 0;
	if (g_once_init_enter (&gcp_diagnostic_support_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GcpDiagnosticSupportIface), (GBaseInitFunc) gcp_diagnostic_support_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
		GType gcp_diagnostic_support_type_id;
		gcp_diagnostic_support_type_id = g_type_register_static (G_TYPE_INTERFACE, "GcpDiagnosticSupport", &g_define_type_info, 0);
		g_type_interface_add_prerequisite (gcp_diagnostic_support_type_id, GCP_TYPE_DOCUMENT);
		g_once_init_leave (&gcp_diagnostic_support_type_id__volatile, gcp_diagnostic_support_type_id);
	}
	return gcp_diagnostic_support_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int 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, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



