/* rygel-mpris-plugin.c generated by valac 0.30.0, the Vala compiler
 * generated from rygel-mpris-plugin.vala, do not modify */

/*
 * Copyright (C) 2008 Zeeshan Ali (Khattak) <zeeshanak@gnome.org>.
 * Copyright (C) 2008 Nokia Corporation.
 *
 * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
 *                               <zeeshan.ali@nokia.com>
 *
 * This file is part of Rygel.
 *
 * Rygel is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * Rygel 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <glib.h>
#include <glib-object.h>
#include <rygel-renderer.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <rygel-core.h>


#define RYGEL_MPRIS_TYPE_PLUGIN (rygel_mpris_plugin_get_type ())
#define RYGEL_MPRIS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_MPRIS_TYPE_PLUGIN, RygelMPRISPlugin))
#define RYGEL_MPRIS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_MPRIS_TYPE_PLUGIN, RygelMPRISPluginClass))
#define RYGEL_MPRIS_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_MPRIS_TYPE_PLUGIN))
#define RYGEL_MPRIS_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_MPRIS_TYPE_PLUGIN))
#define RYGEL_MPRIS_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_MPRIS_TYPE_PLUGIN, RygelMPRISPluginClass))

typedef struct _RygelMPRISPlugin RygelMPRISPlugin;
typedef struct _RygelMPRISPluginClass RygelMPRISPluginClass;
typedef struct _RygelMPRISPluginPrivate RygelMPRISPluginPrivate;

#define RYGEL_MPRIS_TYPE_MEDIA_PLAYER_PROXY (rygel_mpris_media_player_proxy_get_type ())
#define RYGEL_MPRIS_MEDIA_PLAYER_PROXY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_MPRIS_TYPE_MEDIA_PLAYER_PROXY, RygelMPRISMediaPlayerProxy))
#define RYGEL_MPRIS_IS_MEDIA_PLAYER_PROXY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_MPRIS_TYPE_MEDIA_PLAYER_PROXY))
#define RYGEL_MPRIS_MEDIA_PLAYER_PROXY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), RYGEL_MPRIS_TYPE_MEDIA_PLAYER_PROXY, RygelMPRISMediaPlayerProxyIface))

typedef struct _RygelMPRISMediaPlayerProxy RygelMPRISMediaPlayerProxy;
typedef struct _RygelMPRISMediaPlayerProxyIface RygelMPRISMediaPlayerProxyIface;

#define RYGEL_MPRIS_TYPE_MEDIA_PLAYER_PROXY_PROXY (rygel_mpris_media_player_proxy_proxy_get_type ())

#define RYGEL_MPRIS_MEDIA_PLAYER_TYPE_PLAYER_PROXY (rygel_mpris_media_player_player_proxy_get_type ())
#define RYGEL_MPRIS_MEDIA_PLAYER_PLAYER_PROXY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_MPRIS_MEDIA_PLAYER_TYPE_PLAYER_PROXY, RygelMPRISMediaPlayerPlayerProxy))
#define RYGEL_MPRIS_MEDIA_PLAYER_IS_PLAYER_PROXY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_MPRIS_MEDIA_PLAYER_TYPE_PLAYER_PROXY))
#define RYGEL_MPRIS_MEDIA_PLAYER_PLAYER_PROXY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), RYGEL_MPRIS_MEDIA_PLAYER_TYPE_PLAYER_PROXY, RygelMPRISMediaPlayerPlayerProxyIface))

typedef struct _RygelMPRISMediaPlayerPlayerProxy RygelMPRISMediaPlayerPlayerProxy;
typedef struct _RygelMPRISMediaPlayerPlayerProxyIface RygelMPRISMediaPlayerPlayerProxyIface;

#define RYGEL_MPRIS_MEDIA_PLAYER_TYPE_PLAYER_PROXY_PROXY (rygel_mpris_media_player_player_proxy_proxy_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define RYGEL_MPRIS_TYPE_PLAYER (rygel_mpris_player_get_type ())
#define RYGEL_MPRIS_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_MPRIS_TYPE_PLAYER, RygelMPRISPlayer))
#define RYGEL_MPRIS_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_MPRIS_TYPE_PLAYER, RygelMPRISPlayerClass))
#define RYGEL_MPRIS_IS_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_MPRIS_TYPE_PLAYER))
#define RYGEL_MPRIS_IS_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_MPRIS_TYPE_PLAYER))
#define RYGEL_MPRIS_PLAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_MPRIS_TYPE_PLAYER, RygelMPRISPlayerClass))

typedef struct _RygelMPRISPlayer RygelMPRISPlayer;
typedef struct _RygelMPRISPlayerClass RygelMPRISPlayerClass;

struct _RygelMPRISMediaPlayerProxyIface {
	GTypeInterface parent_iface;
	gchar* (*get_identity) (RygelMPRISMediaPlayerProxy* self);
	gchar** (*get_supported_uri_schemes) (RygelMPRISMediaPlayerProxy* self, int* result_length1);
	gchar** (*get_supported_mime_types) (RygelMPRISMediaPlayerProxy* self, int* result_length1);
};

struct _RygelMPRISMediaPlayerPlayerProxyIface {
	GTypeInterface parent_iface;
	void (*pause) (RygelMPRISMediaPlayerPlayerProxy* self, GError** error);
	void (*play_pause) (RygelMPRISMediaPlayerPlayerProxy* self, GError** error);
	void (*stop) (RygelMPRISMediaPlayerPlayerProxy* self, GError** error);
	void (*play) (RygelMPRISMediaPlayerPlayerProxy* self, GError** error);
	void (*seek) (RygelMPRISMediaPlayerPlayerProxy* self, gint64 offset, GError** error);
	void (*open_uri) (RygelMPRISMediaPlayerPlayerProxy* self, const gchar* uri, GError** error);
	gchar* (*get_playback_status) (RygelMPRISMediaPlayerPlayerProxy* self);
	gdouble (*get_rate) (RygelMPRISMediaPlayerPlayerProxy* self);
	void (*set_rate) (RygelMPRISMediaPlayerPlayerProxy* self, gdouble value);
	gdouble (*get_minimum_rate) (RygelMPRISMediaPlayerPlayerProxy* self);
	gdouble (*get_maximum_rate) (RygelMPRISMediaPlayerPlayerProxy* self);
	gdouble (*get_volume) (RygelMPRISMediaPlayerPlayerProxy* self);
	void (*set_volume) (RygelMPRISMediaPlayerPlayerProxy* self, gdouble value);
	gint64 (*get_position) (RygelMPRISMediaPlayerPlayerProxy* self);
	gboolean (*get_can_seek) (RygelMPRISMediaPlayerPlayerProxy* self);
	gboolean (*get_can_control) (RygelMPRISMediaPlayerPlayerProxy* self);
	GHashTable* (*get_metadata) (RygelMPRISMediaPlayerPlayerProxy* self);
};

struct _RygelMPRISPlugin {
	RygelMediaRendererPlugin parent_instance;
	RygelMPRISPluginPrivate * priv;
	RygelMPRISMediaPlayerPlayerProxy* actual_player;
	gchar** mime_types;
	gint mime_types_length1;
	gchar** protocols;
	gint protocols_length1;
};

struct _RygelMPRISPluginClass {
	RygelMediaRendererPluginClass parent_class;
};


static gpointer rygel_mpris_plugin_parent_class = NULL;

GType rygel_mpris_plugin_get_type (void) G_GNUC_CONST;
GType rygel_mpris_media_player_proxy_get_type (void) G_GNUC_CONST;
GType rygel_mpris_media_player_proxy_proxy_get_type (void) G_GNUC_CONST;
guint rygel_mpris_media_player_proxy_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
GType rygel_mpris_media_player_player_proxy_proxy_get_type (void) G_GNUC_CONST;
guint rygel_mpris_media_player_player_proxy_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
GType rygel_mpris_media_player_player_proxy_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_MPRIS_PLUGIN_DUMMY_PROPERTY
};
#define RYGEL_MPRIS_PLUGIN_MODULE_NAME "MPRIS"
#define RYGEL_MPRIS_PLUGIN_MEDIA_PLAYER_PATH "/org/mpris/MediaPlayer2"
RygelMPRISPlugin* rygel_mpris_plugin_new (const gchar* service_name, RygelMPRISMediaPlayerPlayerProxy* actual_player);
RygelMPRISPlugin* rygel_mpris_plugin_construct (GType object_type, const gchar* service_name, RygelMPRISMediaPlayerPlayerProxy* actual_player);
gchar* rygel_mpris_media_player_proxy_get_identity (RygelMPRISMediaPlayerProxy* self);
gchar** rygel_mpris_media_player_proxy_get_supported_mime_types (RygelMPRISMediaPlayerProxy* self, int* result_length1);
static gchar** rygel_mpris_plugin_schemes_to_protocols (RygelMPRISPlugin* self, gchar** schemes, int schemes_length1, int* result_length1);
gchar** rygel_mpris_media_player_proxy_get_supported_uri_schemes (RygelMPRISMediaPlayerProxy* self, int* result_length1);
static RygelMediaPlayer* rygel_mpris_plugin_real_get_player (RygelMediaRendererPlugin* base);
RygelMPRISPlayer* rygel_mpris_player_new (RygelMPRISPlugin* plugin);
RygelMPRISPlayer* rygel_mpris_player_construct (GType object_type, RygelMPRISPlugin* plugin);
GType rygel_mpris_player_get_type (void) G_GNUC_CONST;
static gchar* rygel_mpris_plugin_scheme_to_protocol (RygelMPRISPlugin* self, const gchar* scheme);
static void rygel_mpris_plugin_finalize (GObject* obj);
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);


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


RygelMPRISPlugin* rygel_mpris_plugin_construct (GType object_type, const gchar* service_name, RygelMPRISMediaPlayerPlayerProxy* actual_player) {
	RygelMPRISPlugin * self = NULL;
	gchar* title = NULL;
	RygelMPRISMediaPlayerPlayerProxy* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	const gchar* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	RygelMPRISMediaPlayerPlayerProxy* _tmp8_ = NULL;
	RygelMPRISMediaPlayerPlayerProxy* _tmp9_ = NULL;
	RygelMPRISMediaPlayerPlayerProxy* _tmp10_ = NULL;
	gchar** _tmp11_ = NULL;
	gint _tmp11__length1 = 0;
	gchar** _tmp12_ = NULL;
	gint _tmp12__length1 = 0;
	RygelMPRISMediaPlayerPlayerProxy* _tmp13_ = NULL;
	gchar** _tmp14_ = NULL;
	gint _tmp14__length1 = 0;
	gchar** _tmp15_ = NULL;
	gint _tmp15__length1 = 0;
	gchar** _tmp16_ = NULL;
	gint _tmp16__length1 = 0;
	gint _tmp17_ = 0;
	gchar** _tmp18_ = NULL;
	g_return_val_if_fail (service_name != NULL, NULL);
	g_return_val_if_fail (actual_player != NULL, NULL);
	_tmp0_ = actual_player;
	_tmp1_ = rygel_mpris_media_player_proxy_get_identity ((RygelMPRISMediaPlayerProxy*) _tmp0_);
	_tmp2_ = _tmp1_;
	title = _tmp2_;
	_tmp3_ = title;
	if (_tmp3_ == NULL) {
		const gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		_tmp4_ = service_name;
		_tmp5_ = g_strdup (_tmp4_);
		_g_free0 (title);
		title = _tmp5_;
	}
	_tmp6_ = service_name;
	_tmp7_ = title;
	self = (RygelMPRISPlugin*) rygel_media_renderer_plugin_construct (object_type, _tmp6_, _tmp7_, NULL, RYGEL_PLUGIN_CAPABILITIES_NONE);
	_tmp8_ = actual_player;
	_tmp9_ = _g_object_ref0 (_tmp8_);
	_g_object_unref0 (self->actual_player);
	self->actual_player = _tmp9_;
	_tmp10_ = actual_player;
	_tmp11_ = rygel_mpris_media_player_proxy_get_supported_mime_types ((RygelMPRISMediaPlayerProxy*) _tmp10_, &_tmp11__length1);
	_tmp12_ = _tmp11_;
	_tmp12__length1 = _tmp11__length1;
	self->mime_types = (_vala_array_free (self->mime_types, self->mime_types_length1, (GDestroyNotify) g_free), NULL);
	self->mime_types = _tmp12_;
	self->mime_types_length1 = _tmp12__length1;
	_tmp13_ = actual_player;
	_tmp14_ = rygel_mpris_media_player_proxy_get_supported_uri_schemes ((RygelMPRISMediaPlayerProxy*) _tmp13_, &_tmp14__length1);
	_tmp15_ = _tmp14_;
	_tmp15__length1 = _tmp14__length1;
	_tmp16_ = _tmp15_;
	_tmp16__length1 = _tmp15__length1;
	_tmp18_ = rygel_mpris_plugin_schemes_to_protocols (self, _tmp16_, _tmp15__length1, &_tmp17_);
	self->protocols = (_vala_array_free (self->protocols, self->protocols_length1, (GDestroyNotify) g_free), NULL);
	self->protocols = _tmp18_;
	self->protocols_length1 = _tmp17_;
	_tmp16_ = (_vala_array_free (_tmp16_, _tmp16__length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (title);
	return self;
}


RygelMPRISPlugin* rygel_mpris_plugin_new (const gchar* service_name, RygelMPRISMediaPlayerPlayerProxy* actual_player) {
	return rygel_mpris_plugin_construct (RYGEL_MPRIS_TYPE_PLUGIN, service_name, actual_player);
}


static RygelMediaPlayer* rygel_mpris_plugin_real_get_player (RygelMediaRendererPlugin* base) {
	RygelMPRISPlugin * self;
	RygelMediaPlayer* result = NULL;
	RygelMPRISPlayer* _tmp0_ = NULL;
	self = (RygelMPRISPlugin*) base;
	_tmp0_ = rygel_mpris_player_new (self);
	result = (RygelMediaPlayer*) _tmp0_;
	return result;
}


static gchar** rygel_mpris_plugin_schemes_to_protocols (RygelMPRISPlugin* self, gchar** schemes, int schemes_length1, int* result_length1) {
	gchar** result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** protocols = NULL;
	gchar** _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	gchar** _tmp3_ = NULL;
	gint protocols_length1 = 0;
	gint _protocols_size_ = 0;
	gchar** _tmp15_ = NULL;
	gint _tmp15__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = schemes;
	_tmp0__length1 = schemes_length1;
	if (_tmp0_ == NULL) {
		gchar** _tmp1_ = NULL;
		gint _tmp1__length1 = 0;
		_tmp1_ = NULL;
		_tmp1__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp1__length1;
		}
		result = _tmp1_;
		return result;
	}
	_tmp2_ = schemes;
	_tmp2__length1 = schemes_length1;
	_tmp3_ = g_new0 (gchar*, _tmp2__length1 + 1);
	protocols = _tmp3_;
	protocols_length1 = _tmp2__length1;
	_protocols_size_ = protocols_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp4_ = FALSE;
			_tmp4_ = TRUE;
			while (TRUE) {
				gint _tmp6_ = 0;
				gchar** _tmp7_ = NULL;
				gint _tmp7__length1 = 0;
				gchar** _tmp8_ = NULL;
				gint _tmp8__length1 = 0;
				gint _tmp9_ = 0;
				gchar** _tmp10_ = NULL;
				gint _tmp10__length1 = 0;
				gint _tmp11_ = 0;
				const gchar* _tmp12_ = NULL;
				gchar* _tmp13_ = NULL;
				gchar* _tmp14_ = NULL;
				if (!_tmp4_) {
					gint _tmp5_ = 0;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				_tmp6_ = i;
				_tmp7_ = schemes;
				_tmp7__length1 = schemes_length1;
				if (!(_tmp6_ < _tmp7__length1)) {
					break;
				}
				_tmp8_ = protocols;
				_tmp8__length1 = protocols_length1;
				_tmp9_ = i;
				_tmp10_ = schemes;
				_tmp10__length1 = schemes_length1;
				_tmp11_ = i;
				_tmp12_ = _tmp10_[_tmp11_];
				_tmp13_ = rygel_mpris_plugin_scheme_to_protocol (self, _tmp12_);
				_g_free0 (_tmp8_[_tmp9_]);
				_tmp8_[_tmp9_] = _tmp13_;
				_tmp14_ = _tmp8_[_tmp9_];
			}
		}
	}
	_tmp15_ = protocols;
	_tmp15__length1 = protocols_length1;
	if (result_length1) {
		*result_length1 = _tmp15__length1;
	}
	result = _tmp15_;
	return result;
}


static gchar* rygel_mpris_plugin_scheme_to_protocol (RygelMPRISPlugin* self, const gchar* scheme) {
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GQuark _tmp3_ = 0U;
	static GQuark _tmp2_label0 = 0;
	static GQuark _tmp2_label1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (scheme != NULL, NULL);
	_tmp0_ = scheme;
	_tmp1_ = _tmp0_;
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
	if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("http")))) {
		switch (0) {
			default:
			{
				gchar* _tmp4_ = NULL;
				_tmp4_ = g_strdup ("http-get");
				result = _tmp4_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("file")))) {
		switch (0) {
			default:
			{
				gchar* _tmp5_ = NULL;
				_tmp5_ = g_strdup ("internal");
				result = _tmp5_;
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				const gchar* _tmp6_ = NULL;
				gchar* _tmp7_ = NULL;
				_tmp6_ = scheme;
				_tmp7_ = g_strdup (_tmp6_);
				result = _tmp7_;
				return result;
			}
		}
	}
}


static void rygel_mpris_plugin_class_init (RygelMPRISPluginClass * klass) {
	rygel_mpris_plugin_parent_class = g_type_class_peek_parent (klass);
	((RygelMediaRendererPluginClass *) klass)->get_player = rygel_mpris_plugin_real_get_player;
	G_OBJECT_CLASS (klass)->finalize = rygel_mpris_plugin_finalize;
}


static void rygel_mpris_plugin_instance_init (RygelMPRISPlugin * self) {
}


static void rygel_mpris_plugin_finalize (GObject* obj) {
	RygelMPRISPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_MPRIS_TYPE_PLUGIN, RygelMPRISPlugin);
	_g_object_unref0 (self->actual_player);
	self->mime_types = (_vala_array_free (self->mime_types, self->mime_types_length1, (GDestroyNotify) g_free), NULL);
	self->protocols = (_vala_array_free (self->protocols, self->protocols_length1, (GDestroyNotify) g_free), NULL);
	G_OBJECT_CLASS (rygel_mpris_plugin_parent_class)->finalize (obj);
}


GType rygel_mpris_plugin_get_type (void) {
	static volatile gsize rygel_mpris_plugin_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_mpris_plugin_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelMPRISPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_mpris_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelMPRISPlugin), 0, (GInstanceInitFunc) rygel_mpris_plugin_instance_init, NULL };
		GType rygel_mpris_plugin_type_id;
		rygel_mpris_plugin_type_id = g_type_register_static (RYGEL_TYPE_MEDIA_RENDERER_PLUGIN, "RygelMPRISPlugin", &g_define_type_info, 0);
		g_once_init_leave (&rygel_mpris_plugin_type_id__volatile, rygel_mpris_plugin_type_id);
	}
	return rygel_mpris_plugin_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);
}



