/* rygel-cmdline-config.c generated by valac 0.20.1.2-ca5c2, the Vala compiler
 * generated from rygel-cmdline-config.vala, do not modify */

/*
 * Copyright (C) 2008,2009 Nokia Corporation.
 * Copyright (C) 2008,2009 Zeeshan Ali (Khattak) <zeeshanak@gnome.org>.
 * Copyright (C) 2012 Intel Corporation.
 *
 * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
 *                               <zeeshan.ali@nokia.com>
 *         Jens Georg <jensg@openismus.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 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 program; 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-core.h>
#include <stdlib.h>
#include <string.h>
#include <config.h>
#include <stdio.h>
#include <glib/gi18n-lib.h>
#include <gee.h>


#define RYGEL_TYPE_CMDLINE_CONFIG (rygel_cmdline_config_get_type ())
#define RYGEL_CMDLINE_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_CMDLINE_CONFIG, RygelCmdlineConfig))
#define RYGEL_CMDLINE_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_CMDLINE_CONFIG, RygelCmdlineConfigClass))
#define RYGEL_IS_CMDLINE_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_CMDLINE_CONFIG))
#define RYGEL_IS_CMDLINE_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_CMDLINE_CONFIG))
#define RYGEL_CMDLINE_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_CMDLINE_CONFIG, RygelCmdlineConfigClass))

typedef struct _RygelCmdlineConfig RygelCmdlineConfig;
typedef struct _RygelCmdlineConfigClass RygelCmdlineConfigClass;
typedef struct _RygelCmdlineConfigPrivate RygelCmdlineConfigPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL)))

typedef enum  {
	RYGEL_CMDLINE_CONFIG_ERROR_VERSION_ONLY
} RygelCmdlineConfigError;
#define RYGEL_CMDLINE_CONFIG_ERROR rygel_cmdline_config_error_quark ()
struct _RygelCmdlineConfig {
	GObject parent_instance;
	RygelCmdlineConfigPrivate * priv;
};

struct _RygelCmdlineConfigClass {
	GObjectClass parent_class;
};


static gpointer rygel_cmdline_config_parent_class = NULL;
static gchar* rygel_cmdline_config_iface;
static gchar* rygel_cmdline_config_iface = NULL;
static gint rygel_cmdline_config_port;
static gint rygel_cmdline_config_port = 0;
static gboolean rygel_cmdline_config_no_upnp;
static gboolean rygel_cmdline_config_no_upnp = FALSE;
static gboolean rygel_cmdline_config_no_transcoding;
static gboolean rygel_cmdline_config_no_transcoding = FALSE;
static gboolean rygel_cmdline_config_disallow_upload;
static gboolean rygel_cmdline_config_disallow_upload = FALSE;
static gboolean rygel_cmdline_config_disallow_deletion;
static gboolean rygel_cmdline_config_disallow_deletion = FALSE;
static gchar* rygel_cmdline_config_log_levels;
static gchar* rygel_cmdline_config_log_levels = NULL;
static gchar* rygel_cmdline_config_plugin_path;
static gchar* rygel_cmdline_config_plugin_path = NULL;
static gchar* rygel_cmdline_config_engine_path;
static gchar* rygel_cmdline_config_engine_path = NULL;
static gboolean rygel_cmdline_config_version;
static gboolean rygel_cmdline_config_version = FALSE;
static gchar* rygel_cmdline_config_config_file;
static gchar* rygel_cmdline_config_config_file = NULL;
static gchar** rygel_cmdline_config_disabled_plugins;
static gchar** rygel_cmdline_config_disabled_plugins = NULL;
static gchar** rygel_cmdline_config_plugin_titles;
static gchar** rygel_cmdline_config_plugin_titles = NULL;
static gchar** rygel_cmdline_config_plugin_options;
static gchar** rygel_cmdline_config_plugin_options = NULL;
static RygelCmdlineConfig* rygel_cmdline_config_config;
static RygelCmdlineConfig* rygel_cmdline_config_config = NULL;
static RygelConfigurationIface* rygel_cmdline_config_rygel_configuration_parent_iface = NULL;

GQuark rygel_cmdline_config_error_quark (void);
GType rygel_cmdline_config_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_CMDLINE_CONFIG_DUMMY_PROPERTY
};
RygelCmdlineConfig* rygel_cmdline_config_get_default (void);
RygelCmdlineConfig* rygel_cmdline_config_new (void);
RygelCmdlineConfig* rygel_cmdline_config_construct (GType object_type);
void rygel_cmdline_config_parse_args (gchar*** args, int* args_length1, GError** error);
static gboolean rygel_cmdline_config_real_get_upnp_enabled (RygelConfiguration* base, GError** error);
static gchar* rygel_cmdline_config_real_get_interface (RygelConfiguration* base, GError** error);
static gint rygel_cmdline_config_real_get_port (RygelConfiguration* base, GError** error);
static gboolean rygel_cmdline_config_real_get_transcoding (RygelConfiguration* base, GError** error);
static gboolean rygel_cmdline_config_real_get_allow_upload (RygelConfiguration* base, GError** error);
static gboolean rygel_cmdline_config_real_get_allow_deletion (RygelConfiguration* base, GError** error);
static gchar* rygel_cmdline_config_real_get_log_levels (RygelConfiguration* base, GError** error);
static gchar* rygel_cmdline_config_real_get_plugin_path (RygelConfiguration* base, GError** error);
static gchar* rygel_cmdline_config_real_get_engine_path (RygelConfiguration* base, GError** error);
static gchar* rygel_cmdline_config_real_get_media_engine (RygelConfiguration* base, GError** error);
static gboolean rygel_cmdline_config_real_get_enabled (RygelConfiguration* base, const gchar* section, GError** error);
static gchar* rygel_cmdline_config_real_get_title (RygelConfiguration* base, const gchar* section, GError** error);
gchar* rygel_cmdline_config_get_config_file (RygelCmdlineConfig* self, GError** error);
static gchar* rygel_cmdline_config_real_get_video_upload_folder (RygelConfiguration* base, GError** error);
static gchar* rygel_cmdline_config_real_get_music_upload_folder (RygelConfiguration* base, GError** error);
static gchar* rygel_cmdline_config_real_get_picture_upload_folder (RygelConfiguration* base, GError** error);
static gchar* rygel_cmdline_config_real_get_string (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error);
static GeeArrayList* rygel_cmdline_config_real_get_string_list (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error);
static gint rygel_cmdline_config_real_get_int (RygelConfiguration* base, const gchar* section, const gchar* key, gint min, gint max, GError** error);
static GeeArrayList* rygel_cmdline_config_real_get_int_list (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error);
static gboolean rygel_cmdline_config_real_get_bool (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error);
static void rygel_cmdline_config_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 gint _vala_array_length (gpointer array);

static const GOptionEntry RYGEL_CMDLINE_CONFIG_OPTIONS[15] = {{"version", (gchar) 0, 0, G_OPTION_ARG_NONE, &rygel_cmdline_config_version, "Display version number", NULL}, {"network-interface", 'n', 0, G_OPTION_ARG_STRING, &rygel_cmdline_config_iface, "Network Interface", "INTERFACE"}, {"port", 'p', 0, G_OPTION_ARG_INT, &rygel_cmdline_config_port, "Port", "PORT"}, {"disable-transcoding", 't', 0, G_OPTION_ARG_NONE, &rygel_cmdline_config_no_transcoding, "Disable transcoding", NULL}, {"disallow-upload", 'U', 0, G_OPTION_ARG_NONE, &rygel_cmdline_config_disallow_upload, "Disallow upload", NULL}, {"disallow-deletion", 'D', 0, G_OPTION_ARG_NONE, &rygel_cmdline_config_disallow_deletion, "Disallow deletion", NULL}, {"log-level", 'g', 0, G_OPTION_ARG_STRING, &rygel_cmdline_config_log_levels, "Comma-separated list of domain:level pairs to specify log level " "thresholds for individual domains. domain could be either " "'rygel', name of a plugin or '*' for all domains. " " Allowed levels are: " "0=critical,2=error,3=warning,4=message/info,5=debug.", "DOMAIN1:LEVEL1[,DOMAIN2:LEVEL2,..]"}, {"plugin-path", 'u', 0, G_OPTION_ARG_STRING, &rygel_cmdline_config_plugin_path, "Plugin Path", "PLUGIN_PATH"}, {"engine-path", 'e', 0, G_OPTION_ARG_STRING, &rygel_cmdline_config_engine_path, "Engine Path", "ENGINE_PATH"}, {"disable-plugin", 'd', 0, G_OPTION_ARG_STRING_ARRAY, &rygel_cmdline_config_disabled_plugins, "Disable plugin", "PluginName"}, {"title", 'i', 0, G_OPTION_ARG_STRING_ARRAY, &rygel_cmdline_config_plugin_titles, "Set plugin titles", "PluginName:TITLE"}, {"plugin-option", 'o', 0, G_OPTION_ARG_STRING_ARRAY, &rygel_cmdline_config_plugin_options, "Set plugin options", "PluginName:OPTION:VALUE1[,VALUE2,..]"}, {"disable-upnp", 'P', 0, G_OPTION_ARG_NONE, &rygel_cmdline_config_no_upnp, "Disable UPnP (streaming-only)", NULL}, {"config", 'c', 0, G_OPTION_ARG_FILENAME, &rygel_cmdline_config_config_file, "Use configuration file instead of user configuration", "FILE"}, {NULL}};

GQuark rygel_cmdline_config_error_quark (void) {
	return g_quark_from_static_string ("rygel_cmdline_config_error-quark");
}


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


RygelCmdlineConfig* rygel_cmdline_config_get_default (void) {
	RygelCmdlineConfig* result = NULL;
	RygelCmdlineConfig* _tmp0_;
	RygelCmdlineConfig* _tmp2_;
	RygelCmdlineConfig* _tmp3_;
	_tmp0_ = rygel_cmdline_config_config;
	if (_tmp0_ == NULL) {
		RygelCmdlineConfig* _tmp1_;
		_tmp1_ = rygel_cmdline_config_new ();
		_g_object_unref0 (rygel_cmdline_config_config);
		rygel_cmdline_config_config = _tmp1_;
	}
	_tmp2_ = rygel_cmdline_config_config;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	result = _tmp3_;
	return result;
}


void rygel_cmdline_config_parse_args (gchar*** args, int* args_length1, GError** error) {
	gchar* _tmp0_;
	gchar* parameter_string;
	const gchar* _tmp1_;
	GOptionContext* _tmp2_;
	GOptionContext* opt_context;
	GOptionContext* _tmp3_;
	GOptionContext* _tmp4_;
	GOptionContext* _tmp5_;
	gboolean _tmp12_;
	GError * _inner_error_ = NULL;
	_tmp0_ = g_strdup ("- " PACKAGE_NAME);
	parameter_string = _tmp0_;
	_tmp1_ = parameter_string;
	_tmp2_ = g_option_context_new (_tmp1_);
	opt_context = _tmp2_;
	_tmp3_ = opt_context;
	g_option_context_set_help_enabled (_tmp3_, TRUE);
	_tmp4_ = opt_context;
	g_option_context_set_ignore_unknown_options (_tmp4_, TRUE);
	_tmp5_ = opt_context;
	g_option_context_add_main_entries (_tmp5_, RYGEL_CMDLINE_CONFIG_OPTIONS, NULL);
	{
		GOptionContext* _tmp6_;
		_tmp6_ = opt_context;
		g_option_context_parse (_tmp6_, args_length1, args, &_inner_error_);
		if (_inner_error_ != NULL) {
			if (g_error_matches (_inner_error_, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE)) {
				goto __catch11_g_option_error_bad_value;
			}
			goto __finally11;
		}
	}
	goto __finally11;
	__catch11_g_option_error_bad_value:
	{
		GError* err = NULL;
		FILE* _tmp7_;
		GOptionContext* _tmp8_;
		gchar* _tmp9_ = NULL;
		gchar* _tmp10_;
		GError* _tmp11_;
		err = _inner_error_;
		_inner_error_ = NULL;
		_tmp7_ = stdout;
		_tmp8_ = opt_context;
		_tmp9_ = g_option_context_get_help (_tmp8_, TRUE, NULL);
		_tmp10_ = _tmp9_;
		fprintf (_tmp7_, "%s", _tmp10_);
		_g_free0 (_tmp10_);
		_tmp11_ = g_error_new_literal (RYGEL_CMDLINE_CONFIG_ERROR, RYGEL_CMDLINE_CONFIG_ERROR_VERSION_ONLY, "");
		_inner_error_ = _tmp11_;
		_g_error_free0 (err);
		goto __finally11;
	}
	__finally11:
	if (_inner_error_ != NULL) {
		if ((_inner_error_->domain == RYGEL_CMDLINE_CONFIG_ERROR) || (_inner_error_->domain == G_OPTION_ERROR)) {
			g_propagate_error (error, _inner_error_);
			_g_option_context_free0 (opt_context);
			_g_free0 (parameter_string);
			return;
		} else {
			_g_option_context_free0 (opt_context);
			_g_free0 (parameter_string);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
	}
	_tmp12_ = rygel_cmdline_config_version;
	if (_tmp12_) {
		FILE* _tmp13_;
		GError* _tmp14_;
		_tmp13_ = stdout;
		fprintf (_tmp13_, "%s\n", PACKAGE_STRING);
		_tmp14_ = g_error_new_literal (RYGEL_CMDLINE_CONFIG_ERROR, RYGEL_CMDLINE_CONFIG_ERROR_VERSION_ONLY, "");
		_inner_error_ = _tmp14_;
		if ((_inner_error_->domain == RYGEL_CMDLINE_CONFIG_ERROR) || (_inner_error_->domain == G_OPTION_ERROR)) {
			g_propagate_error (error, _inner_error_);
			_g_option_context_free0 (opt_context);
			_g_free0 (parameter_string);
			return;
		} else {
			_g_option_context_free0 (opt_context);
			_g_free0 (parameter_string);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
	}
	_g_option_context_free0 (opt_context);
	_g_free0 (parameter_string);
}


static gboolean rygel_cmdline_config_real_get_upnp_enabled (RygelConfiguration* base, GError** error) {
	RygelCmdlineConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	_tmp0_ = rygel_cmdline_config_no_upnp;
	if (!_tmp0_) {
		const gchar* _tmp1_ = NULL;
		GError* _tmp2_;
		_tmp1_ = _ ("No value available");
		_tmp2_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp1_);
		_inner_error_ = _tmp2_;
		g_propagate_error (error, _inner_error_);
		return FALSE;
	} else {
		result = FALSE;
		return result;
	}
}


static gchar* rygel_cmdline_config_real_get_interface (RygelConfiguration* base, GError** error) {
	RygelCmdlineConfig * self;
	gchar* result = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	_tmp0_ = rygel_cmdline_config_iface;
	if (_tmp0_ == NULL) {
		const gchar* _tmp1_ = NULL;
		GError* _tmp2_;
		_tmp1_ = _ ("No value available");
		_tmp2_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp1_);
		_inner_error_ = _tmp2_;
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp3_ = rygel_cmdline_config_iface;
	_tmp4_ = g_strdup (_tmp3_);
	result = _tmp4_;
	return result;
}


static gint rygel_cmdline_config_real_get_port (RygelConfiguration* base, GError** error) {
	RygelCmdlineConfig * self;
	gint result = 0;
	gint _tmp0_;
	gint _tmp3_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	_tmp0_ = rygel_cmdline_config_port;
	if (_tmp0_ <= 0) {
		const gchar* _tmp1_ = NULL;
		GError* _tmp2_;
		_tmp1_ = _ ("No value available");
		_tmp2_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp1_);
		_inner_error_ = _tmp2_;
		g_propagate_error (error, _inner_error_);
		return 0;
	}
	_tmp3_ = rygel_cmdline_config_port;
	result = _tmp3_;
	return result;
}


static gboolean rygel_cmdline_config_real_get_transcoding (RygelConfiguration* base, GError** error) {
	RygelCmdlineConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	_tmp0_ = rygel_cmdline_config_no_transcoding;
	if (!_tmp0_) {
		const gchar* _tmp1_ = NULL;
		GError* _tmp2_;
		_tmp1_ = _ ("No value available");
		_tmp2_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp1_);
		_inner_error_ = _tmp2_;
		g_propagate_error (error, _inner_error_);
		return FALSE;
	} else {
		result = FALSE;
		return result;
	}
}


static gboolean rygel_cmdline_config_real_get_allow_upload (RygelConfiguration* base, GError** error) {
	RygelCmdlineConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	_tmp0_ = rygel_cmdline_config_disallow_upload;
	if (!_tmp0_) {
		const gchar* _tmp1_ = NULL;
		GError* _tmp2_;
		_tmp1_ = _ ("No value available");
		_tmp2_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp1_);
		_inner_error_ = _tmp2_;
		g_propagate_error (error, _inner_error_);
		return FALSE;
	} else {
		result = FALSE;
		return result;
	}
}


static gboolean rygel_cmdline_config_real_get_allow_deletion (RygelConfiguration* base, GError** error) {
	RygelCmdlineConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	_tmp0_ = rygel_cmdline_config_disallow_deletion;
	if (!_tmp0_) {
		const gchar* _tmp1_ = NULL;
		GError* _tmp2_;
		_tmp1_ = _ ("No value available");
		_tmp2_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp1_);
		_inner_error_ = _tmp2_;
		g_propagate_error (error, _inner_error_);
		return FALSE;
	} else {
		result = FALSE;
		return result;
	}
}


static gchar* rygel_cmdline_config_real_get_log_levels (RygelConfiguration* base, GError** error) {
	RygelCmdlineConfig * self;
	gchar* result = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	_tmp0_ = rygel_cmdline_config_log_levels;
	if (_tmp0_ == NULL) {
		const gchar* _tmp1_ = NULL;
		GError* _tmp2_;
		_tmp1_ = _ ("No value available");
		_tmp2_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp1_);
		_inner_error_ = _tmp2_;
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp3_ = rygel_cmdline_config_log_levels;
	_tmp4_ = g_strdup (_tmp3_);
	result = _tmp4_;
	return result;
}


static gchar* rygel_cmdline_config_real_get_plugin_path (RygelConfiguration* base, GError** error) {
	RygelCmdlineConfig * self;
	gchar* result = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	_tmp0_ = rygel_cmdline_config_plugin_path;
	if (_tmp0_ == NULL) {
		GError* _tmp1_;
		_tmp1_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, "No value available");
		_inner_error_ = _tmp1_;
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp2_ = rygel_cmdline_config_plugin_path;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}


static gchar* rygel_cmdline_config_real_get_engine_path (RygelConfiguration* base, GError** error) {
	RygelCmdlineConfig * self;
	gchar* result = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	_tmp0_ = rygel_cmdline_config_engine_path;
	if (_tmp0_ == NULL) {
		GError* _tmp1_;
		_tmp1_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, "No value available");
		_inner_error_ = _tmp1_;
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp2_ = rygel_cmdline_config_plugin_path;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}


static gchar* rygel_cmdline_config_real_get_media_engine (RygelConfiguration* base, GError** error) {
	RygelCmdlineConfig * self;
	gchar* result = NULL;
	GError* _tmp0_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	_tmp0_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, "No value available");
	_inner_error_ = _tmp0_;
	g_propagate_error (error, _inner_error_);
	return NULL;
	return result;
}


static gboolean rygel_cmdline_config_real_get_enabled (RygelConfiguration* base, const gchar* section, GError** error) {
	RygelCmdlineConfig * self;
	gboolean result = FALSE;
	gboolean disabled;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gboolean _tmp4_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	g_return_val_if_fail (section != NULL, FALSE);
	disabled = FALSE;
	_tmp0_ = rygel_cmdline_config_disabled_plugins;
	_tmp0__length1 = _vala_array_length (rygel_cmdline_config_disabled_plugins);
	{
		gchar** plugin_collection = NULL;
		gint plugin_collection_length1 = 0;
		gint _plugin_collection_size_ = 0;
		gint plugin_it = 0;
		plugin_collection = _tmp0_;
		plugin_collection_length1 = _tmp0__length1;
		for (plugin_it = 0; plugin_it < _tmp0__length1; plugin_it = plugin_it + 1) {
			gchar* _tmp1_;
			gchar* plugin = NULL;
			_tmp1_ = g_strdup (plugin_collection[plugin_it]);
			plugin = _tmp1_;
			{
				const gchar* _tmp2_;
				const gchar* _tmp3_;
				_tmp2_ = plugin;
				_tmp3_ = section;
				if (g_strcmp0 (_tmp2_, _tmp3_) == 0) {
					disabled = TRUE;
					_g_free0 (plugin);
					break;
				}
				_g_free0 (plugin);
			}
		}
	}
	_tmp4_ = disabled;
	if (_tmp4_) {
		result = FALSE;
		return result;
	} else {
		const gchar* _tmp5_ = NULL;
		GError* _tmp6_;
		_tmp5_ = _ ("No value available");
		_tmp6_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp5_);
		_inner_error_ = _tmp6_;
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
}


static gchar* rygel_cmdline_config_real_get_title (RygelConfiguration* base, const gchar* section, GError** error) {
	RygelCmdlineConfig * self;
	gchar* result = NULL;
	gchar* title;
	gchar** _tmp0_;
	gint _tmp0__length1;
	const gchar* _tmp19_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	g_return_val_if_fail (section != NULL, NULL);
	title = NULL;
	_tmp0_ = rygel_cmdline_config_plugin_titles;
	_tmp0__length1 = _vala_array_length (rygel_cmdline_config_plugin_titles);
	{
		gchar** plugin_title_collection = NULL;
		gint plugin_title_collection_length1 = 0;
		gint _plugin_title_collection_size_ = 0;
		gint plugin_title_it = 0;
		plugin_title_collection = _tmp0_;
		plugin_title_collection_length1 = _tmp0__length1;
		for (plugin_title_it = 0; plugin_title_it < _tmp0__length1; plugin_title_it = plugin_title_it + 1) {
			gchar* _tmp1_;
			gchar* plugin_title = NULL;
			_tmp1_ = g_strdup (plugin_title_collection[plugin_title_it]);
			plugin_title = _tmp1_;
			{
				const gchar* _tmp2_;
				gchar** _tmp3_;
				gchar** _tmp4_ = NULL;
				gchar** tokens;
				gint tokens_length1;
				gint _tokens_size_;
				gboolean _tmp5_ = FALSE;
				gboolean _tmp6_ = FALSE;
				gchar** _tmp7_;
				gint _tmp7__length1;
				const gchar* _tmp8_;
				gboolean _tmp11_;
				gboolean _tmp15_;
				_tmp2_ = plugin_title;
				_tmp4_ = _tmp3_ = g_strsplit (_tmp2_, ":", 2);
				tokens = _tmp4_;
				tokens_length1 = _vala_array_length (_tmp3_);
				_tokens_size_ = tokens_length1;
				_tmp7_ = tokens;
				_tmp7__length1 = tokens_length1;
				_tmp8_ = _tmp7_[0];
				if (_tmp8_ != NULL) {
					gchar** _tmp9_;
					gint _tmp9__length1;
					const gchar* _tmp10_;
					_tmp9_ = tokens;
					_tmp9__length1 = tokens_length1;
					_tmp10_ = _tmp9_[1];
					_tmp6_ = _tmp10_ != NULL;
				} else {
					_tmp6_ = FALSE;
				}
				_tmp11_ = _tmp6_;
				if (_tmp11_) {
					gchar** _tmp12_;
					gint _tmp12__length1;
					const gchar* _tmp13_;
					const gchar* _tmp14_;
					_tmp12_ = tokens;
					_tmp12__length1 = tokens_length1;
					_tmp13_ = _tmp12_[0];
					_tmp14_ = section;
					_tmp5_ = g_strcmp0 (_tmp13_, _tmp14_) == 0;
				} else {
					_tmp5_ = FALSE;
				}
				_tmp15_ = _tmp5_;
				if (_tmp15_) {
					gchar** _tmp16_;
					gint _tmp16__length1;
					const gchar* _tmp17_;
					gchar* _tmp18_;
					_tmp16_ = tokens;
					_tmp16__length1 = tokens_length1;
					_tmp17_ = _tmp16_[1];
					_tmp18_ = g_strdup (_tmp17_);
					_g_free0 (title);
					title = _tmp18_;
					tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
					_g_free0 (plugin_title);
					break;
				}
				tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (plugin_title);
			}
		}
	}
	_tmp19_ = title;
	if (_tmp19_ != NULL) {
		result = title;
		return result;
	} else {
		const gchar* _tmp20_ = NULL;
		GError* _tmp21_;
		_tmp20_ = _ ("No value available");
		_tmp21_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp20_);
		_inner_error_ = _tmp21_;
		g_propagate_error (error, _inner_error_);
		_g_free0 (title);
		return NULL;
	}
	_g_free0 (title);
}


gchar* rygel_cmdline_config_get_config_file (RygelCmdlineConfig* self, GError** error) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = rygel_cmdline_config_config_file;
	if (_tmp0_ == NULL) {
		const gchar* _tmp1_ = NULL;
		GError* _tmp2_;
		_tmp1_ = _ ("No value available");
		_tmp2_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp1_);
		_inner_error_ = _tmp2_;
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp3_ = rygel_cmdline_config_config_file;
	_tmp4_ = g_strdup (_tmp3_);
	result = _tmp4_;
	return result;
}


static gchar* rygel_cmdline_config_real_get_video_upload_folder (RygelConfiguration* base, GError** error) {
	RygelCmdlineConfig * self;
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	GError* _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	_tmp0_ = _ ("No value available");
	_tmp1_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp0_);
	_inner_error_ = _tmp1_;
	g_propagate_error (error, _inner_error_);
	return NULL;
	return result;
}


static gchar* rygel_cmdline_config_real_get_music_upload_folder (RygelConfiguration* base, GError** error) {
	RygelCmdlineConfig * self;
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	GError* _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	_tmp0_ = _ ("No value available");
	_tmp1_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp0_);
	_inner_error_ = _tmp1_;
	g_propagate_error (error, _inner_error_);
	return NULL;
	return result;
}


static gchar* rygel_cmdline_config_real_get_picture_upload_folder (RygelConfiguration* base, GError** error) {
	RygelCmdlineConfig * self;
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	GError* _tmp1_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	_tmp0_ = _ ("No value available");
	_tmp1_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp0_);
	_inner_error_ = _tmp1_;
	g_propagate_error (error, _inner_error_);
	return NULL;
	return result;
}


static gchar* rygel_cmdline_config_real_get_string (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error) {
	RygelCmdlineConfig * self;
	gchar* result = NULL;
	gchar* value;
	gchar** _tmp0_;
	gint _tmp0__length1;
	const gchar* _tmp28_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	g_return_val_if_fail (section != NULL, NULL);
	g_return_val_if_fail (key != NULL, NULL);
	value = NULL;
	_tmp0_ = rygel_cmdline_config_plugin_options;
	_tmp0__length1 = _vala_array_length (rygel_cmdline_config_plugin_options);
	{
		gchar** option_collection = NULL;
		gint option_collection_length1 = 0;
		gint _option_collection_size_ = 0;
		gint option_it = 0;
		option_collection = _tmp0_;
		option_collection_length1 = _tmp0__length1;
		for (option_it = 0; option_it < _tmp0__length1; option_it = option_it + 1) {
			gchar* _tmp1_;
			gchar* option = NULL;
			_tmp1_ = g_strdup (option_collection[option_it]);
			option = _tmp1_;
			{
				const gchar* _tmp2_;
				gchar** _tmp3_;
				gchar** _tmp4_ = NULL;
				gchar** tokens;
				gint tokens_length1;
				gint _tokens_size_;
				gboolean _tmp5_ = FALSE;
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gboolean _tmp8_ = FALSE;
				gchar** _tmp9_;
				gint _tmp9__length1;
				const gchar* _tmp10_;
				gboolean _tmp13_;
				gboolean _tmp16_;
				gboolean _tmp20_;
				gboolean _tmp24_;
				_tmp2_ = option;
				_tmp4_ = _tmp3_ = g_strsplit (_tmp2_, ":", 3);
				tokens = _tmp4_;
				tokens_length1 = _vala_array_length (_tmp3_);
				_tokens_size_ = tokens_length1;
				_tmp9_ = tokens;
				_tmp9__length1 = tokens_length1;
				_tmp10_ = _tmp9_[0];
				if (_tmp10_ != NULL) {
					gchar** _tmp11_;
					gint _tmp11__length1;
					const gchar* _tmp12_;
					_tmp11_ = tokens;
					_tmp11__length1 = tokens_length1;
					_tmp12_ = _tmp11_[1];
					_tmp8_ = _tmp12_ != NULL;
				} else {
					_tmp8_ = FALSE;
				}
				_tmp13_ = _tmp8_;
				if (_tmp13_) {
					gchar** _tmp14_;
					gint _tmp14__length1;
					const gchar* _tmp15_;
					_tmp14_ = tokens;
					_tmp14__length1 = tokens_length1;
					_tmp15_ = _tmp14_[2];
					_tmp7_ = _tmp15_ != NULL;
				} else {
					_tmp7_ = FALSE;
				}
				_tmp16_ = _tmp7_;
				if (_tmp16_) {
					gchar** _tmp17_;
					gint _tmp17__length1;
					const gchar* _tmp18_;
					const gchar* _tmp19_;
					_tmp17_ = tokens;
					_tmp17__length1 = tokens_length1;
					_tmp18_ = _tmp17_[0];
					_tmp19_ = section;
					_tmp6_ = g_strcmp0 (_tmp18_, _tmp19_) == 0;
				} else {
					_tmp6_ = FALSE;
				}
				_tmp20_ = _tmp6_;
				if (_tmp20_) {
					gchar** _tmp21_;
					gint _tmp21__length1;
					const gchar* _tmp22_;
					const gchar* _tmp23_;
					_tmp21_ = tokens;
					_tmp21__length1 = tokens_length1;
					_tmp22_ = _tmp21_[1];
					_tmp23_ = key;
					_tmp5_ = g_strcmp0 (_tmp22_, _tmp23_) == 0;
				} else {
					_tmp5_ = FALSE;
				}
				_tmp24_ = _tmp5_;
				if (_tmp24_) {
					gchar** _tmp25_;
					gint _tmp25__length1;
					const gchar* _tmp26_;
					gchar* _tmp27_;
					_tmp25_ = tokens;
					_tmp25__length1 = tokens_length1;
					_tmp26_ = _tmp25_[2];
					_tmp27_ = g_strdup (_tmp26_);
					_g_free0 (value);
					value = _tmp27_;
					tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
					_g_free0 (option);
					break;
				}
				tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (option);
			}
		}
	}
	_tmp28_ = value;
	if (_tmp28_ != NULL) {
		result = value;
		return result;
	} else {
		const gchar* _tmp29_ = NULL;
		GError* _tmp30_;
		_tmp29_ = _ ("No value available");
		_tmp30_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp29_);
		_inner_error_ = _tmp30_;
		g_propagate_error (error, _inner_error_);
		_g_free0 (value);
		return NULL;
	}
	_g_free0 (value);
}


static GeeArrayList* rygel_cmdline_config_real_get_string_list (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error) {
	RygelCmdlineConfig * self;
	GeeArrayList* result = NULL;
	GeeArrayList* value;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GeeArrayList* _tmp33_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	g_return_val_if_fail (section != NULL, NULL);
	g_return_val_if_fail (key != NULL, NULL);
	value = NULL;
	_tmp0_ = rygel_cmdline_config_plugin_options;
	_tmp0__length1 = _vala_array_length (rygel_cmdline_config_plugin_options);
	{
		gchar** option_collection = NULL;
		gint option_collection_length1 = 0;
		gint _option_collection_size_ = 0;
		gint option_it = 0;
		option_collection = _tmp0_;
		option_collection_length1 = _tmp0__length1;
		for (option_it = 0; option_it < _tmp0__length1; option_it = option_it + 1) {
			gchar* _tmp1_;
			gchar* option = NULL;
			_tmp1_ = g_strdup (option_collection[option_it]);
			option = _tmp1_;
			{
				const gchar* _tmp2_;
				gchar** _tmp3_;
				gchar** _tmp4_ = NULL;
				gchar** tokens;
				gint tokens_length1;
				gint _tokens_size_;
				gboolean _tmp5_ = FALSE;
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gboolean _tmp8_ = FALSE;
				gchar** _tmp9_;
				gint _tmp9__length1;
				const gchar* _tmp10_;
				gboolean _tmp13_;
				gboolean _tmp16_;
				gboolean _tmp20_;
				gboolean _tmp24_;
				_tmp2_ = option;
				_tmp4_ = _tmp3_ = g_strsplit (_tmp2_, ":", 3);
				tokens = _tmp4_;
				tokens_length1 = _vala_array_length (_tmp3_);
				_tokens_size_ = tokens_length1;
				_tmp9_ = tokens;
				_tmp9__length1 = tokens_length1;
				_tmp10_ = _tmp9_[0];
				if (_tmp10_ != NULL) {
					gchar** _tmp11_;
					gint _tmp11__length1;
					const gchar* _tmp12_;
					_tmp11_ = tokens;
					_tmp11__length1 = tokens_length1;
					_tmp12_ = _tmp11_[1];
					_tmp8_ = _tmp12_ != NULL;
				} else {
					_tmp8_ = FALSE;
				}
				_tmp13_ = _tmp8_;
				if (_tmp13_) {
					gchar** _tmp14_;
					gint _tmp14__length1;
					const gchar* _tmp15_;
					_tmp14_ = tokens;
					_tmp14__length1 = tokens_length1;
					_tmp15_ = _tmp14_[2];
					_tmp7_ = _tmp15_ != NULL;
				} else {
					_tmp7_ = FALSE;
				}
				_tmp16_ = _tmp7_;
				if (_tmp16_) {
					gchar** _tmp17_;
					gint _tmp17__length1;
					const gchar* _tmp18_;
					const gchar* _tmp19_;
					_tmp17_ = tokens;
					_tmp17__length1 = tokens_length1;
					_tmp18_ = _tmp17_[0];
					_tmp19_ = section;
					_tmp6_ = g_strcmp0 (_tmp18_, _tmp19_) == 0;
				} else {
					_tmp6_ = FALSE;
				}
				_tmp20_ = _tmp6_;
				if (_tmp20_) {
					gchar** _tmp21_;
					gint _tmp21__length1;
					const gchar* _tmp22_;
					const gchar* _tmp23_;
					_tmp21_ = tokens;
					_tmp21__length1 = tokens_length1;
					_tmp22_ = _tmp21_[1];
					_tmp23_ = key;
					_tmp5_ = g_strcmp0 (_tmp22_, _tmp23_) == 0;
				} else {
					_tmp5_ = FALSE;
				}
				_tmp24_ = _tmp5_;
				if (_tmp24_) {
					GeeArrayList* _tmp25_;
					gchar** _tmp26_;
					gint _tmp26__length1;
					const gchar* _tmp27_;
					gchar** _tmp28_;
					gchar** _tmp29_ = NULL;
					_tmp25_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL);
					_g_object_unref0 (value);
					value = _tmp25_;
					_tmp26_ = tokens;
					_tmp26__length1 = tokens_length1;
					_tmp27_ = _tmp26_[2];
					_tmp29_ = _tmp28_ = g_strsplit (_tmp27_, ",", -1);
					{
						gchar** val_token_collection = NULL;
						gint val_token_collection_length1 = 0;
						gint _val_token_collection_size_ = 0;
						gint val_token_it = 0;
						val_token_collection = _tmp29_;
						val_token_collection_length1 = _vala_array_length (_tmp28_);
						for (val_token_it = 0; val_token_it < _vala_array_length (_tmp28_); val_token_it = val_token_it + 1) {
							gchar* _tmp30_;
							gchar* val_token = NULL;
							_tmp30_ = g_strdup (val_token_collection[val_token_it]);
							val_token = _tmp30_;
							{
								GeeArrayList* _tmp31_;
								const gchar* _tmp32_;
								_tmp31_ = value;
								_tmp32_ = val_token;
								gee_abstract_collection_add ((GeeAbstractCollection*) _tmp31_, _tmp32_);
								_g_free0 (val_token);
							}
						}
						val_token_collection = (_vala_array_free (val_token_collection, val_token_collection_length1, (GDestroyNotify) g_free), NULL);
					}
					tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
					_g_free0 (option);
					break;
				}
				tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (option);
			}
		}
	}
	_tmp33_ = value;
	if (_tmp33_ != NULL) {
		result = value;
		return result;
	} else {
		const gchar* _tmp34_ = NULL;
		GError* _tmp35_;
		_tmp34_ = _ ("No value available");
		_tmp35_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp34_);
		_inner_error_ = _tmp35_;
		g_propagate_error (error, _inner_error_);
		_g_object_unref0 (value);
		return NULL;
	}
	_g_object_unref0 (value);
}


static gint rygel_cmdline_config_real_get_int (RygelConfiguration* base, const gchar* section, const gchar* key, gint min, gint max, GError** error) {
	RygelCmdlineConfig * self;
	gint result = 0;
	gint value;
	gboolean value_set;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gboolean _tmp34_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	g_return_val_if_fail (section != NULL, 0);
	g_return_val_if_fail (key != NULL, 0);
	value = 0;
	value_set = FALSE;
	_tmp0_ = rygel_cmdline_config_plugin_options;
	_tmp0__length1 = _vala_array_length (rygel_cmdline_config_plugin_options);
	{
		gchar** option_collection = NULL;
		gint option_collection_length1 = 0;
		gint _option_collection_size_ = 0;
		gint option_it = 0;
		option_collection = _tmp0_;
		option_collection_length1 = _tmp0__length1;
		for (option_it = 0; option_it < _tmp0__length1; option_it = option_it + 1) {
			gchar* _tmp1_;
			gchar* option = NULL;
			_tmp1_ = g_strdup (option_collection[option_it]);
			option = _tmp1_;
			{
				const gchar* _tmp2_;
				gchar** _tmp3_;
				gchar** _tmp4_ = NULL;
				gchar** tokens;
				gint tokens_length1;
				gint _tokens_size_;
				gboolean _tmp5_ = FALSE;
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gboolean _tmp8_ = FALSE;
				gchar** _tmp9_;
				gint _tmp9__length1;
				const gchar* _tmp10_;
				gboolean _tmp13_;
				gboolean _tmp16_;
				gboolean _tmp20_;
				gboolean _tmp24_;
				_tmp2_ = option;
				_tmp4_ = _tmp3_ = g_strsplit (_tmp2_, ":", 3);
				tokens = _tmp4_;
				tokens_length1 = _vala_array_length (_tmp3_);
				_tokens_size_ = tokens_length1;
				_tmp9_ = tokens;
				_tmp9__length1 = tokens_length1;
				_tmp10_ = _tmp9_[0];
				if (_tmp10_ != NULL) {
					gchar** _tmp11_;
					gint _tmp11__length1;
					const gchar* _tmp12_;
					_tmp11_ = tokens;
					_tmp11__length1 = tokens_length1;
					_tmp12_ = _tmp11_[1];
					_tmp8_ = _tmp12_ != NULL;
				} else {
					_tmp8_ = FALSE;
				}
				_tmp13_ = _tmp8_;
				if (_tmp13_) {
					gchar** _tmp14_;
					gint _tmp14__length1;
					const gchar* _tmp15_;
					_tmp14_ = tokens;
					_tmp14__length1 = tokens_length1;
					_tmp15_ = _tmp14_[2];
					_tmp7_ = _tmp15_ != NULL;
				} else {
					_tmp7_ = FALSE;
				}
				_tmp16_ = _tmp7_;
				if (_tmp16_) {
					gchar** _tmp17_;
					gint _tmp17__length1;
					const gchar* _tmp18_;
					const gchar* _tmp19_;
					_tmp17_ = tokens;
					_tmp17__length1 = tokens_length1;
					_tmp18_ = _tmp17_[0];
					_tmp19_ = section;
					_tmp6_ = g_strcmp0 (_tmp18_, _tmp19_) == 0;
				} else {
					_tmp6_ = FALSE;
				}
				_tmp20_ = _tmp6_;
				if (_tmp20_) {
					gchar** _tmp21_;
					gint _tmp21__length1;
					const gchar* _tmp22_;
					const gchar* _tmp23_;
					_tmp21_ = tokens;
					_tmp21__length1 = tokens_length1;
					_tmp22_ = _tmp21_[1];
					_tmp23_ = key;
					_tmp5_ = g_strcmp0 (_tmp22_, _tmp23_) == 0;
				} else {
					_tmp5_ = FALSE;
				}
				_tmp24_ = _tmp5_;
				if (_tmp24_) {
					gchar** _tmp25_;
					gint _tmp25__length1;
					const gchar* _tmp26_;
					gint _tmp27_ = 0;
					gboolean _tmp28_ = FALSE;
					gint _tmp29_;
					gint _tmp30_;
					gboolean _tmp33_;
					_tmp25_ = tokens;
					_tmp25__length1 = tokens_length1;
					_tmp26_ = _tmp25_[2];
					_tmp27_ = atoi (_tmp26_);
					value = _tmp27_;
					_tmp29_ = value;
					_tmp30_ = min;
					if (_tmp29_ >= _tmp30_) {
						gint _tmp31_;
						gint _tmp32_;
						_tmp31_ = value;
						_tmp32_ = max;
						_tmp28_ = _tmp31_ <= _tmp32_;
					} else {
						_tmp28_ = FALSE;
					}
					_tmp33_ = _tmp28_;
					if (_tmp33_) {
						value_set = TRUE;
					}
					tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
					_g_free0 (option);
					break;
				}
				tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (option);
			}
		}
	}
	_tmp34_ = value_set;
	if (_tmp34_) {
		result = value;
		return result;
	} else {
		const gchar* _tmp35_ = NULL;
		GError* _tmp36_;
		_tmp35_ = _ ("No value available");
		_tmp36_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp35_);
		_inner_error_ = _tmp36_;
		g_propagate_error (error, _inner_error_);
		return 0;
	}
}


static GeeArrayList* rygel_cmdline_config_real_get_int_list (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error) {
	RygelCmdlineConfig * self;
	GeeArrayList* result = NULL;
	GeeArrayList* value;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GeeArrayList* _tmp34_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	g_return_val_if_fail (section != NULL, NULL);
	g_return_val_if_fail (key != NULL, NULL);
	value = NULL;
	_tmp0_ = rygel_cmdline_config_plugin_options;
	_tmp0__length1 = _vala_array_length (rygel_cmdline_config_plugin_options);
	{
		gchar** option_collection = NULL;
		gint option_collection_length1 = 0;
		gint _option_collection_size_ = 0;
		gint option_it = 0;
		option_collection = _tmp0_;
		option_collection_length1 = _tmp0__length1;
		for (option_it = 0; option_it < _tmp0__length1; option_it = option_it + 1) {
			gchar* _tmp1_;
			gchar* option = NULL;
			_tmp1_ = g_strdup (option_collection[option_it]);
			option = _tmp1_;
			{
				const gchar* _tmp2_;
				gchar** _tmp3_;
				gchar** _tmp4_ = NULL;
				gchar** tokens;
				gint tokens_length1;
				gint _tokens_size_;
				gboolean _tmp5_ = FALSE;
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gboolean _tmp8_ = FALSE;
				gchar** _tmp9_;
				gint _tmp9__length1;
				const gchar* _tmp10_;
				gboolean _tmp13_;
				gboolean _tmp16_;
				gboolean _tmp20_;
				gboolean _tmp24_;
				_tmp2_ = option;
				_tmp4_ = _tmp3_ = g_strsplit (_tmp2_, ":", 3);
				tokens = _tmp4_;
				tokens_length1 = _vala_array_length (_tmp3_);
				_tokens_size_ = tokens_length1;
				_tmp9_ = tokens;
				_tmp9__length1 = tokens_length1;
				_tmp10_ = _tmp9_[0];
				if (_tmp10_ != NULL) {
					gchar** _tmp11_;
					gint _tmp11__length1;
					const gchar* _tmp12_;
					_tmp11_ = tokens;
					_tmp11__length1 = tokens_length1;
					_tmp12_ = _tmp11_[1];
					_tmp8_ = _tmp12_ != NULL;
				} else {
					_tmp8_ = FALSE;
				}
				_tmp13_ = _tmp8_;
				if (_tmp13_) {
					gchar** _tmp14_;
					gint _tmp14__length1;
					const gchar* _tmp15_;
					_tmp14_ = tokens;
					_tmp14__length1 = tokens_length1;
					_tmp15_ = _tmp14_[2];
					_tmp7_ = _tmp15_ != NULL;
				} else {
					_tmp7_ = FALSE;
				}
				_tmp16_ = _tmp7_;
				if (_tmp16_) {
					gchar** _tmp17_;
					gint _tmp17__length1;
					const gchar* _tmp18_;
					const gchar* _tmp19_;
					_tmp17_ = tokens;
					_tmp17__length1 = tokens_length1;
					_tmp18_ = _tmp17_[0];
					_tmp19_ = section;
					_tmp6_ = g_strcmp0 (_tmp18_, _tmp19_) == 0;
				} else {
					_tmp6_ = FALSE;
				}
				_tmp20_ = _tmp6_;
				if (_tmp20_) {
					gchar** _tmp21_;
					gint _tmp21__length1;
					const gchar* _tmp22_;
					const gchar* _tmp23_;
					_tmp21_ = tokens;
					_tmp21__length1 = tokens_length1;
					_tmp22_ = _tmp21_[1];
					_tmp23_ = key;
					_tmp5_ = g_strcmp0 (_tmp22_, _tmp23_) == 0;
				} else {
					_tmp5_ = FALSE;
				}
				_tmp24_ = _tmp5_;
				if (_tmp24_) {
					GeeArrayList* _tmp25_;
					gchar** _tmp26_;
					gint _tmp26__length1;
					const gchar* _tmp27_;
					gchar** _tmp28_;
					gchar** _tmp29_ = NULL;
					_tmp25_ = gee_array_list_new (G_TYPE_INT, NULL, NULL, NULL, NULL, NULL);
					_g_object_unref0 (value);
					value = _tmp25_;
					_tmp26_ = tokens;
					_tmp26__length1 = tokens_length1;
					_tmp27_ = _tmp26_[2];
					_tmp29_ = _tmp28_ = g_strsplit (_tmp27_, ",", -1);
					{
						gchar** val_token_collection = NULL;
						gint val_token_collection_length1 = 0;
						gint _val_token_collection_size_ = 0;
						gint val_token_it = 0;
						val_token_collection = _tmp29_;
						val_token_collection_length1 = _vala_array_length (_tmp28_);
						for (val_token_it = 0; val_token_it < _vala_array_length (_tmp28_); val_token_it = val_token_it + 1) {
							gchar* _tmp30_;
							gchar* val_token = NULL;
							_tmp30_ = g_strdup (val_token_collection[val_token_it]);
							val_token = _tmp30_;
							{
								GeeArrayList* _tmp31_;
								const gchar* _tmp32_;
								gint _tmp33_ = 0;
								_tmp31_ = value;
								_tmp32_ = val_token;
								_tmp33_ = atoi (_tmp32_);
								gee_abstract_collection_add ((GeeAbstractCollection*) _tmp31_, (gpointer) ((gintptr) _tmp33_));
								_g_free0 (val_token);
							}
						}
						val_token_collection = (_vala_array_free (val_token_collection, val_token_collection_length1, (GDestroyNotify) g_free), NULL);
					}
					tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
					_g_free0 (option);
					break;
				}
				tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (option);
			}
		}
	}
	_tmp34_ = value;
	if (_tmp34_ != NULL) {
		result = value;
		return result;
	} else {
		const gchar* _tmp35_ = NULL;
		GError* _tmp36_;
		_tmp35_ = _ ("No value available");
		_tmp36_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp35_);
		_inner_error_ = _tmp36_;
		g_propagate_error (error, _inner_error_);
		_g_object_unref0 (value);
		return NULL;
	}
	_g_object_unref0 (value);
}


static gboolean bool_parse (const gchar* str) {
	gboolean result = FALSE;
	const gchar* _tmp0_;
	g_return_val_if_fail (str != NULL, FALSE);
	_tmp0_ = str;
	if (g_strcmp0 (_tmp0_, "true") == 0) {
		result = TRUE;
		return result;
	} else {
		result = FALSE;
		return result;
	}
}


static gboolean rygel_cmdline_config_real_get_bool (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error) {
	RygelCmdlineConfig * self;
	gboolean result = FALSE;
	gboolean value;
	gboolean value_set;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gboolean _tmp28_;
	GError * _inner_error_ = NULL;
	self = (RygelCmdlineConfig*) base;
	g_return_val_if_fail (section != NULL, FALSE);
	g_return_val_if_fail (key != NULL, FALSE);
	value = FALSE;
	value_set = FALSE;
	_tmp0_ = rygel_cmdline_config_plugin_options;
	_tmp0__length1 = _vala_array_length (rygel_cmdline_config_plugin_options);
	{
		gchar** option_collection = NULL;
		gint option_collection_length1 = 0;
		gint _option_collection_size_ = 0;
		gint option_it = 0;
		option_collection = _tmp0_;
		option_collection_length1 = _tmp0__length1;
		for (option_it = 0; option_it < _tmp0__length1; option_it = option_it + 1) {
			gchar* _tmp1_;
			gchar* option = NULL;
			_tmp1_ = g_strdup (option_collection[option_it]);
			option = _tmp1_;
			{
				const gchar* _tmp2_;
				gchar** _tmp3_;
				gchar** _tmp4_ = NULL;
				gchar** tokens;
				gint tokens_length1;
				gint _tokens_size_;
				gboolean _tmp5_ = FALSE;
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gboolean _tmp8_ = FALSE;
				gchar** _tmp9_;
				gint _tmp9__length1;
				const gchar* _tmp10_;
				gboolean _tmp13_;
				gboolean _tmp16_;
				gboolean _tmp20_;
				gboolean _tmp24_;
				_tmp2_ = option;
				_tmp4_ = _tmp3_ = g_strsplit (_tmp2_, ":", 3);
				tokens = _tmp4_;
				tokens_length1 = _vala_array_length (_tmp3_);
				_tokens_size_ = tokens_length1;
				_tmp9_ = tokens;
				_tmp9__length1 = tokens_length1;
				_tmp10_ = _tmp9_[0];
				if (_tmp10_ != NULL) {
					gchar** _tmp11_;
					gint _tmp11__length1;
					const gchar* _tmp12_;
					_tmp11_ = tokens;
					_tmp11__length1 = tokens_length1;
					_tmp12_ = _tmp11_[1];
					_tmp8_ = _tmp12_ != NULL;
				} else {
					_tmp8_ = FALSE;
				}
				_tmp13_ = _tmp8_;
				if (_tmp13_) {
					gchar** _tmp14_;
					gint _tmp14__length1;
					const gchar* _tmp15_;
					_tmp14_ = tokens;
					_tmp14__length1 = tokens_length1;
					_tmp15_ = _tmp14_[2];
					_tmp7_ = _tmp15_ != NULL;
				} else {
					_tmp7_ = FALSE;
				}
				_tmp16_ = _tmp7_;
				if (_tmp16_) {
					gchar** _tmp17_;
					gint _tmp17__length1;
					const gchar* _tmp18_;
					const gchar* _tmp19_;
					_tmp17_ = tokens;
					_tmp17__length1 = tokens_length1;
					_tmp18_ = _tmp17_[0];
					_tmp19_ = section;
					_tmp6_ = g_strcmp0 (_tmp18_, _tmp19_) == 0;
				} else {
					_tmp6_ = FALSE;
				}
				_tmp20_ = _tmp6_;
				if (_tmp20_) {
					gchar** _tmp21_;
					gint _tmp21__length1;
					const gchar* _tmp22_;
					const gchar* _tmp23_;
					_tmp21_ = tokens;
					_tmp21__length1 = tokens_length1;
					_tmp22_ = _tmp21_[1];
					_tmp23_ = key;
					_tmp5_ = g_strcmp0 (_tmp22_, _tmp23_) == 0;
				} else {
					_tmp5_ = FALSE;
				}
				_tmp24_ = _tmp5_;
				if (_tmp24_) {
					gchar** _tmp25_;
					gint _tmp25__length1;
					const gchar* _tmp26_;
					gboolean _tmp27_ = FALSE;
					_tmp25_ = tokens;
					_tmp25__length1 = tokens_length1;
					_tmp26_ = _tmp25_[2];
					_tmp27_ = bool_parse (_tmp26_);
					value = _tmp27_;
					value_set = TRUE;
					tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
					_g_free0 (option);
					break;
				}
				tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (option);
			}
		}
	}
	_tmp28_ = value_set;
	if (_tmp28_) {
		result = value;
		return result;
	} else {
		const gchar* _tmp29_ = NULL;
		GError* _tmp30_;
		_tmp29_ = _ ("No value available");
		_tmp30_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, _tmp29_);
		_inner_error_ = _tmp30_;
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
}


RygelCmdlineConfig* rygel_cmdline_config_construct (GType object_type) {
	RygelCmdlineConfig * self = NULL;
	self = (RygelCmdlineConfig*) g_object_new (object_type, NULL);
	return self;
}


RygelCmdlineConfig* rygel_cmdline_config_new (void) {
	return rygel_cmdline_config_construct (RYGEL_TYPE_CMDLINE_CONFIG);
}


static void rygel_cmdline_config_class_init (RygelCmdlineConfigClass * klass) {
	rygel_cmdline_config_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = rygel_cmdline_config_finalize;
}


static void rygel_cmdline_config_rygel_configuration_interface_init (RygelConfigurationIface * iface) {
	rygel_cmdline_config_rygel_configuration_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_upnp_enabled = (gboolean (*)(RygelConfiguration*, GError**)) rygel_cmdline_config_real_get_upnp_enabled;
	iface->get_interface = (gchar* (*)(RygelConfiguration*, GError**)) rygel_cmdline_config_real_get_interface;
	iface->get_port = (gint (*)(RygelConfiguration*, GError**)) rygel_cmdline_config_real_get_port;
	iface->get_transcoding = (gboolean (*)(RygelConfiguration*, GError**)) rygel_cmdline_config_real_get_transcoding;
	iface->get_allow_upload = (gboolean (*)(RygelConfiguration*, GError**)) rygel_cmdline_config_real_get_allow_upload;
	iface->get_allow_deletion = (gboolean (*)(RygelConfiguration*, GError**)) rygel_cmdline_config_real_get_allow_deletion;
	iface->get_log_levels = (gchar* (*)(RygelConfiguration*, GError**)) rygel_cmdline_config_real_get_log_levels;
	iface->get_plugin_path = (gchar* (*)(RygelConfiguration*, GError**)) rygel_cmdline_config_real_get_plugin_path;
	iface->get_engine_path = (gchar* (*)(RygelConfiguration*, GError**)) rygel_cmdline_config_real_get_engine_path;
	iface->get_media_engine = (gchar* (*)(RygelConfiguration*, GError**)) rygel_cmdline_config_real_get_media_engine;
	iface->get_enabled = (gboolean (*)(RygelConfiguration*, const gchar*, GError**)) rygel_cmdline_config_real_get_enabled;
	iface->get_title = (gchar* (*)(RygelConfiguration*, const gchar*, GError**)) rygel_cmdline_config_real_get_title;
	iface->get_video_upload_folder = (gchar* (*)(RygelConfiguration*, GError**)) rygel_cmdline_config_real_get_video_upload_folder;
	iface->get_music_upload_folder = (gchar* (*)(RygelConfiguration*, GError**)) rygel_cmdline_config_real_get_music_upload_folder;
	iface->get_picture_upload_folder = (gchar* (*)(RygelConfiguration*, GError**)) rygel_cmdline_config_real_get_picture_upload_folder;
	iface->get_string = (gchar* (*)(RygelConfiguration*, const gchar*, const gchar*, GError**)) rygel_cmdline_config_real_get_string;
	iface->get_string_list = (GeeArrayList* (*)(RygelConfiguration*, const gchar*, const gchar*, GError**)) rygel_cmdline_config_real_get_string_list;
	iface->get_int = (gint (*)(RygelConfiguration*, const gchar*, const gchar*, gint, gint, GError**)) rygel_cmdline_config_real_get_int;
	iface->get_int_list = (GeeArrayList* (*)(RygelConfiguration*, const gchar*, const gchar*, GError**)) rygel_cmdline_config_real_get_int_list;
	iface->get_bool = (gboolean (*)(RygelConfiguration*, const gchar*, const gchar*, GError**)) rygel_cmdline_config_real_get_bool;
}


static void rygel_cmdline_config_instance_init (RygelCmdlineConfig * self) {
}


static void rygel_cmdline_config_finalize (GObject* obj) {
	RygelCmdlineConfig * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_TYPE_CMDLINE_CONFIG, RygelCmdlineConfig);
	G_OBJECT_CLASS (rygel_cmdline_config_parent_class)->finalize (obj);
}


/**
 * Manages configuration from Commandline arguments.
 */
GType rygel_cmdline_config_get_type (void) {
	static volatile gsize rygel_cmdline_config_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_cmdline_config_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelCmdlineConfigClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_cmdline_config_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelCmdlineConfig), 0, (GInstanceInitFunc) rygel_cmdline_config_instance_init, NULL };
		static const GInterfaceInfo rygel_configuration_info = { (GInterfaceInitFunc) rygel_cmdline_config_rygel_configuration_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType rygel_cmdline_config_type_id;
		rygel_cmdline_config_type_id = g_type_register_static (G_TYPE_OBJECT, "RygelCmdlineConfig", &g_define_type_info, 0);
		g_type_add_interface_static (rygel_cmdline_config_type_id, RYGEL_TYPE_CONFIGURATION, &rygel_configuration_info);
		g_once_init_leave (&rygel_cmdline_config_type_id__volatile, rygel_cmdline_config_type_id);
	}
	return rygel_cmdline_config_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);
}


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



