/* rygel-environment-config.c generated by valac 0.25.1.16-16e7a, the Vala compiler
 * generated from rygel-environment-config.vala, do not modify */

/*
 * Copyright (C) 2008-2010 Nokia Corporation.
 * Copyright (C) 2008 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 <glib/gi18n-lib.h>
#include <gee.h>


#define RYGEL_TYPE_ENVIRONMENT_CONFIG (rygel_environment_config_get_type ())
#define RYGEL_ENVIRONMENT_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_ENVIRONMENT_CONFIG, RygelEnvironmentConfig))
#define RYGEL_ENVIRONMENT_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_ENVIRONMENT_CONFIG, RygelEnvironmentConfigClass))
#define RYGEL_IS_ENVIRONMENT_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_ENVIRONMENT_CONFIG))
#define RYGEL_IS_ENVIRONMENT_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_ENVIRONMENT_CONFIG))
#define RYGEL_ENVIRONMENT_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_ENVIRONMENT_CONFIG, RygelEnvironmentConfigClass))

typedef struct _RygelEnvironmentConfig RygelEnvironmentConfig;
typedef struct _RygelEnvironmentConfigClass RygelEnvironmentConfigClass;
typedef struct _RygelEnvironmentConfigPrivate RygelEnvironmentConfigPrivate;
#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_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _RygelEnvironmentConfig {
	GObject parent_instance;
	RygelEnvironmentConfigPrivate * priv;
};

struct _RygelEnvironmentConfigClass {
	GObjectClass parent_class;
};


static gpointer rygel_environment_config_parent_class = NULL;
static gchar* rygel_environment_config_RYGEL_PREFIX;
static gchar* rygel_environment_config_RYGEL_PREFIX = NULL;
static gchar* rygel_environment_config_TITLE_KEY;
static gchar* rygel_environment_config_TITLE_KEY = NULL;
static gchar* rygel_environment_config_DISABLE_PREFIX;
static gchar* rygel_environment_config_DISABLE_PREFIX = NULL;
static gchar* rygel_environment_config_ENABLED_KEY;
static gchar* rygel_environment_config_ENABLED_KEY = NULL;
static gchar* rygel_environment_config_INTERFACE_ENV;
static gchar* rygel_environment_config_INTERFACE_ENV = NULL;
static gchar* rygel_environment_config_PORT_ENV;
static gchar* rygel_environment_config_PORT_ENV = NULL;
static gchar* rygel_environment_config_DISABLE_UPNP_ENV;
static gchar* rygel_environment_config_DISABLE_UPNP_ENV = NULL;
static gchar* rygel_environment_config_TRANSCODING_ENV;
static gchar* rygel_environment_config_TRANSCODING_ENV = NULL;
static gchar* rygel_environment_config_DISALLOW_UPLOAD_ENV;
static gchar* rygel_environment_config_DISALLOW_UPLOAD_ENV = NULL;
static gchar* rygel_environment_config_DISALLOW_DELETION_ENV;
static gchar* rygel_environment_config_DISALLOW_DELETION_ENV = NULL;
static gchar* rygel_environment_config_LOG_LEVELS_ENV;
static gchar* rygel_environment_config_LOG_LEVELS_ENV = NULL;
static gchar* rygel_environment_config_PLUGIN_PATH_ENV;
static gchar* rygel_environment_config_PLUGIN_PATH_ENV = NULL;
static gchar* rygel_environment_config_ENGINE_PATH_ENV;
static gchar* rygel_environment_config_ENGINE_PATH_ENV = NULL;
static gchar* rygel_environment_config_MEDIA_ENGINE_ENV;
static gchar* rygel_environment_config_MEDIA_ENGINE_ENV = NULL;
static RygelEnvironmentConfig* rygel_environment_config_config;
static RygelEnvironmentConfig* rygel_environment_config_config = NULL;
static RygelConfigurationIface* rygel_environment_config_rygel_configuration_parent_iface = NULL;

GType rygel_environment_config_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_ENVIRONMENT_CONFIG_DUMMY_PROPERTY
};
RygelEnvironmentConfig* rygel_environment_config_get_default (void);
RygelEnvironmentConfig* rygel_environment_config_new (void);
RygelEnvironmentConfig* rygel_environment_config_construct (GType object_type);
static gboolean rygel_environment_config_real_get_upnp_enabled (RygelConfiguration* base, GError** error);
static gboolean rygel_environment_config_get_bool_variable (RygelEnvironmentConfig* self, const gchar* variable, GError** error);
static gchar* rygel_environment_config_real_get_interface (RygelConfiguration* base, GError** error);
static gchar* rygel_environment_config_get_string_variable (RygelEnvironmentConfig* self, const gchar* variable, GError** error);
static gchar** rygel_environment_config_real_get_interfaces (RygelConfiguration* base, GError** error);
static gint rygel_environment_config_real_get_port (RygelConfiguration* base, GError** error);
static gint rygel_environment_config_get_int_variable (RygelEnvironmentConfig* self, const gchar* variable, gint min, gint max, GError** error);
static gboolean rygel_environment_config_real_get_transcoding (RygelConfiguration* base, GError** error);
static gboolean rygel_environment_config_real_get_allow_upload (RygelConfiguration* base, GError** error);
static gboolean rygel_environment_config_real_get_allow_deletion (RygelConfiguration* base, GError** error);
static gchar* rygel_environment_config_real_get_log_levels (RygelConfiguration* base, GError** error);
static gchar* rygel_environment_config_real_get_plugin_path (RygelConfiguration* base, GError** error);
static gchar* rygel_environment_config_real_get_engine_path (RygelConfiguration* base, GError** error);
static gchar* rygel_environment_config_real_get_media_engine (RygelConfiguration* base, GError** error);
static gchar* rygel_environment_config_real_get_video_upload_folder (RygelConfiguration* base, GError** error);
static gchar* rygel_environment_config_real_get_music_upload_folder (RygelConfiguration* base, GError** error);
static gchar* rygel_environment_config_real_get_picture_upload_folder (RygelConfiguration* base, GError** error);
static gboolean rygel_environment_config_real_get_enabled (RygelConfiguration* base, const gchar* section, GError** error);
static gchar* rygel_environment_config_real_get_title (RygelConfiguration* base, const gchar* section, GError** error);
static gchar* rygel_environment_config_real_get_string (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error);
static GeeArrayList* rygel_environment_config_real_get_string_list (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error);
static gint rygel_environment_config_real_get_int (RygelConfiguration* base, const gchar* section, const gchar* key, gint min, gint max, GError** error);
static GeeArrayList* rygel_environment_config_real_get_int_list (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error);
static gboolean rygel_environment_config_real_get_bool (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error);
static void rygel_environment_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 gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


RygelEnvironmentConfig* rygel_environment_config_get_default (void) {
	RygelEnvironmentConfig* result = NULL;
	RygelEnvironmentConfig* _tmp0_ = NULL;
	RygelEnvironmentConfig* _tmp2_ = NULL;
	RygelEnvironmentConfig* _tmp3_ = NULL;
	_tmp0_ = rygel_environment_config_config;
	if (_tmp0_ == NULL) {
		RygelEnvironmentConfig* _tmp1_ = NULL;
		_tmp1_ = rygel_environment_config_new ();
		_g_object_unref0 (rygel_environment_config_config);
		rygel_environment_config_config = _tmp1_;
	}
	_tmp2_ = rygel_environment_config_config;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	result = _tmp3_;
	return result;
}


static gboolean rygel_environment_config_real_get_upnp_enabled (RygelConfiguration* base, GError** error) {
	RygelEnvironmentConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	_tmp1_ = rygel_environment_config_DISABLE_UPNP_ENV;
	_tmp2_ = rygel_environment_config_get_bool_variable (self, _tmp1_, &_inner_error_);
	_tmp0_ = _tmp2_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = !_tmp0_;
	return result;
}


static gchar* rygel_environment_config_real_get_interface (RygelConfiguration* base, GError** error) {
	RygelEnvironmentConfig * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	_tmp1_ = rygel_environment_config_INTERFACE_ENV;
	_tmp2_ = rygel_environment_config_get_string_variable (self, _tmp1_, &_inner_error_);
	_tmp0_ = _tmp2_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp3_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp3_;
	_g_free0 (_tmp0_);
	return result;
}


static gchar** rygel_environment_config_real_get_interfaces (RygelConfiguration* base, GError** error) {
	RygelEnvironmentConfig * self;
	gchar** result = NULL;
	gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar** _tmp5_ = NULL;
	gchar** _tmp6_ = NULL;
	gchar** _tmp7_ = NULL;
	gint _tmp7__length1 = 0;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	_tmp1_ = rygel_environment_config_INTERFACE_ENV;
	_tmp2_ = rygel_environment_config_get_string_variable (self, _tmp1_, &_inner_error_);
	_tmp0_ = _tmp2_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp3_ = _tmp0_;
	_tmp0_ = NULL;
	_tmp4_ = _tmp3_;
	_tmp6_ = _tmp5_ = g_strsplit (_tmp4_, ",", 0);
	_tmp7_ = _tmp6_;
	_tmp7__length1 = _vala_array_length (_tmp5_);
	_g_free0 (_tmp4_);
	result = _tmp7_;
	_g_free0 (_tmp0_);
	return result;
}


static gint rygel_environment_config_real_get_port (RygelConfiguration* base, GError** error) {
	RygelEnvironmentConfig * self;
	gint result = 0;
	gint _tmp0_ = 0;
	const gchar* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	_tmp1_ = rygel_environment_config_PORT_ENV;
	_tmp2_ = rygel_environment_config_get_int_variable (self, _tmp1_, 0, (gint) G_MAXINT16, &_inner_error_);
	_tmp0_ = _tmp2_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return 0;
	}
	result = _tmp0_;
	return result;
}


static gboolean rygel_environment_config_real_get_transcoding (RygelConfiguration* base, GError** error) {
	RygelEnvironmentConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	_tmp1_ = rygel_environment_config_TRANSCODING_ENV;
	_tmp2_ = rygel_environment_config_get_bool_variable (self, _tmp1_, &_inner_error_);
	_tmp0_ = _tmp2_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = !_tmp0_;
	return result;
}


static gboolean rygel_environment_config_real_get_allow_upload (RygelConfiguration* base, GError** error) {
	RygelEnvironmentConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	_tmp1_ = rygel_environment_config_DISALLOW_UPLOAD_ENV;
	_tmp2_ = rygel_environment_config_get_bool_variable (self, _tmp1_, &_inner_error_);
	_tmp0_ = _tmp2_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = !_tmp0_;
	return result;
}


static gboolean rygel_environment_config_real_get_allow_deletion (RygelConfiguration* base, GError** error) {
	RygelEnvironmentConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	_tmp1_ = rygel_environment_config_DISALLOW_DELETION_ENV;
	_tmp2_ = rygel_environment_config_get_bool_variable (self, _tmp1_, &_inner_error_);
	_tmp0_ = _tmp2_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = !_tmp0_;
	return result;
}


static gchar* rygel_environment_config_real_get_log_levels (RygelConfiguration* base, GError** error) {
	RygelEnvironmentConfig * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	_tmp1_ = rygel_environment_config_LOG_LEVELS_ENV;
	_tmp2_ = rygel_environment_config_get_string_variable (self, _tmp1_, &_inner_error_);
	_tmp0_ = _tmp2_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp3_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp3_;
	_g_free0 (_tmp0_);
	return result;
}


static gchar* rygel_environment_config_real_get_plugin_path (RygelConfiguration* base, GError** error) {
	RygelEnvironmentConfig * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	_tmp1_ = rygel_environment_config_PLUGIN_PATH_ENV;
	_tmp2_ = rygel_environment_config_get_string_variable (self, _tmp1_, &_inner_error_);
	_tmp0_ = _tmp2_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp3_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp3_;
	_g_free0 (_tmp0_);
	return result;
}


static gchar* rygel_environment_config_real_get_engine_path (RygelConfiguration* base, GError** error) {
	RygelEnvironmentConfig * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	_tmp1_ = rygel_environment_config_ENGINE_PATH_ENV;
	_tmp2_ = rygel_environment_config_get_string_variable (self, _tmp1_, &_inner_error_);
	_tmp0_ = _tmp2_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp3_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp3_;
	_g_free0 (_tmp0_);
	return result;
}


static gchar* rygel_environment_config_real_get_media_engine (RygelConfiguration* base, GError** error) {
	RygelEnvironmentConfig * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	_tmp1_ = rygel_environment_config_MEDIA_ENGINE_ENV;
	_tmp2_ = rygel_environment_config_get_string_variable (self, _tmp1_, &_inner_error_);
	_tmp0_ = _tmp2_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp3_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp3_;
	_g_free0 (_tmp0_);
	return result;
}


static gchar* rygel_environment_config_real_get_video_upload_folder (RygelConfiguration* base, GError** error) {
	RygelEnvironmentConfig * self;
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	GError* _tmp1_ = NULL;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) 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_environment_config_real_get_music_upload_folder (RygelConfiguration* base, GError** error) {
	RygelEnvironmentConfig * self;
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	GError* _tmp1_ = NULL;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) 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_environment_config_real_get_picture_upload_folder (RygelConfiguration* base, GError** error) {
	RygelEnvironmentConfig * self;
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	GError* _tmp1_ = NULL;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) 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 gboolean rygel_environment_config_real_get_enabled (RygelConfiguration* base, const gchar* section, GError** error) {
	RygelEnvironmentConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	g_return_val_if_fail (section != NULL, FALSE);
	_tmp1_ = section;
	_tmp2_ = rygel_environment_config_ENABLED_KEY;
	_tmp3_ = rygel_configuration_get_bool ((RygelConfiguration*) self, _tmp1_, _tmp2_, &_inner_error_);
	_tmp0_ = _tmp3_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = _tmp0_;
	return result;
}


static gchar* rygel_environment_config_real_get_title (RygelConfiguration* base, const gchar* section, GError** error) {
	RygelEnvironmentConfig * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	g_return_val_if_fail (section != NULL, NULL);
	_tmp1_ = section;
	_tmp2_ = rygel_environment_config_TITLE_KEY;
	_tmp3_ = rygel_configuration_get_string ((RygelConfiguration*) self, _tmp1_, _tmp2_, &_inner_error_);
	_tmp0_ = _tmp3_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp4_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp4_;
	_g_free0 (_tmp0_);
	return result;
}


static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
	gchar* result = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	{
		GRegex* regex = NULL;
		const gchar* _tmp0_ = NULL;
		gchar* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		GRegex* _tmp3_ = NULL;
		GRegex* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		GRegex* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
		_tmp0_ = old;
		_tmp1_ = g_regex_escape_string (_tmp0_, -1);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_);
		_tmp4_ = _tmp3_;
		_g_free0 (_tmp2_);
		regex = _tmp4_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch13_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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 NULL;
		}
		_tmp6_ = regex;
		_tmp7_ = replacement;
		_tmp8_ = g_regex_replace_literal (_tmp6_, self, (gssize) (-1), 0, _tmp7_, 0, &_inner_error_);
		_tmp5_ = _tmp8_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch13_g_regex_error;
			}
			_g_regex_unref0 (regex);
			g_critical ("file %s: line %d: unexpected 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 NULL;
		}
		_tmp9_ = _tmp5_;
		_tmp5_ = NULL;
		result = _tmp9_;
		_g_free0 (_tmp5_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally13;
	__catch13_g_regex_error:
	{
		GError* e = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (e);
	}
	__finally13:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		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 NULL;
	}
}


static gchar* rygel_environment_config_real_get_string (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error) {
	RygelEnvironmentConfig * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	const gchar* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	gchar* _tmp14_ = NULL;
	gchar* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	gchar* _tmp17_ = NULL;
	gchar* _tmp18_ = NULL;
	gchar* _tmp19_ = NULL;
	gchar* _tmp20_ = NULL;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	g_return_val_if_fail (section != NULL, NULL);
	g_return_val_if_fail (key != NULL, NULL);
	_tmp1_ = rygel_environment_config_RYGEL_PREFIX;
	_tmp2_ = g_strconcat (_tmp1_, "_", NULL);
	_tmp3_ = _tmp2_;
	_tmp4_ = section;
	_tmp5_ = g_utf8_strup (_tmp4_, (gssize) (-1));
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strconcat (_tmp3_, _tmp6_, NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_strconcat (_tmp8_, "_", NULL);
	_tmp10_ = _tmp9_;
	_tmp11_ = key;
	_tmp12_ = g_utf8_strup (_tmp11_, (gssize) (-1));
	_tmp13_ = _tmp12_;
	_tmp14_ = string_replace (_tmp13_, "-", "_");
	_tmp15_ = _tmp14_;
	_tmp16_ = g_strconcat (_tmp10_, _tmp15_, NULL);
	_tmp17_ = _tmp16_;
	_tmp18_ = rygel_environment_config_get_string_variable (self, _tmp17_, &_inner_error_);
	_tmp19_ = _tmp18_;
	_g_free0 (_tmp17_);
	_g_free0 (_tmp15_);
	_g_free0 (_tmp13_);
	_g_free0 (_tmp10_);
	_g_free0 (_tmp8_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp3_);
	_tmp0_ = _tmp19_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp20_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp20_;
	_g_free0 (_tmp0_);
	return result;
}


static GeeArrayList* rygel_environment_config_real_get_string_list (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error) {
	RygelEnvironmentConfig * self;
	GeeArrayList* result = NULL;
	gchar* str = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	GeeArrayList* value = NULL;
	GeeArrayList* _tmp3_ = NULL;
	gchar** _tmp4_ = NULL;
	gchar** _tmp5_ = NULL;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	g_return_val_if_fail (section != NULL, NULL);
	g_return_val_if_fail (key != NULL, NULL);
	_tmp0_ = section;
	_tmp1_ = key;
	_tmp2_ = rygel_configuration_get_string ((RygelConfiguration*) self, _tmp0_, _tmp1_, &_inner_error_);
	str = _tmp2_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp3_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL);
	value = _tmp3_;
	_tmp5_ = _tmp4_ = g_strsplit (str, ",", -1);
	{
		gchar** token_collection = NULL;
		gint token_collection_length1 = 0;
		gint _token_collection_size_ = 0;
		gint token_it = 0;
		token_collection = _tmp5_;
		token_collection_length1 = _vala_array_length (_tmp4_);
		for (token_it = 0; token_it < _vala_array_length (_tmp4_); token_it = token_it + 1) {
			gchar* _tmp6_ = NULL;
			gchar* token = NULL;
			_tmp6_ = g_strdup (token_collection[token_it]);
			token = _tmp6_;
			{
				GeeArrayList* _tmp7_ = NULL;
				const gchar* _tmp8_ = NULL;
				_tmp7_ = value;
				_tmp8_ = token;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp7_, _tmp8_);
				_g_free0 (token);
			}
		}
		token_collection = (_vala_array_free (token_collection, token_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	result = value;
	_g_free0 (str);
	return result;
}


static gint rygel_environment_config_real_get_int (RygelConfiguration* base, const gchar* section, const gchar* key, gint min, gint max, GError** error) {
	RygelEnvironmentConfig * self;
	gint result = 0;
	gint _tmp0_ = 0;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	const gchar* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	gchar* _tmp14_ = NULL;
	gchar* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	gchar* _tmp17_ = NULL;
	gint _tmp18_ = 0;
	gint _tmp19_ = 0;
	gint _tmp20_ = 0;
	gint _tmp21_ = 0;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	g_return_val_if_fail (section != NULL, 0);
	g_return_val_if_fail (key != NULL, 0);
	_tmp1_ = rygel_environment_config_RYGEL_PREFIX;
	_tmp2_ = g_strconcat (_tmp1_, "_", NULL);
	_tmp3_ = _tmp2_;
	_tmp4_ = section;
	_tmp5_ = g_utf8_strup (_tmp4_, (gssize) (-1));
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strconcat (_tmp3_, _tmp6_, NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_strconcat (_tmp8_, "_", NULL);
	_tmp10_ = _tmp9_;
	_tmp11_ = key;
	_tmp12_ = g_utf8_strup (_tmp11_, (gssize) (-1));
	_tmp13_ = _tmp12_;
	_tmp14_ = string_replace (_tmp13_, "-", "_");
	_tmp15_ = _tmp14_;
	_tmp16_ = g_strconcat (_tmp10_, _tmp15_, NULL);
	_tmp17_ = _tmp16_;
	_tmp18_ = min;
	_tmp19_ = max;
	_tmp20_ = rygel_environment_config_get_int_variable (self, _tmp17_, _tmp18_, _tmp19_, &_inner_error_);
	_tmp21_ = _tmp20_;
	_g_free0 (_tmp17_);
	_g_free0 (_tmp15_);
	_g_free0 (_tmp13_);
	_g_free0 (_tmp10_);
	_g_free0 (_tmp8_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp3_);
	_tmp0_ = _tmp21_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return 0;
	}
	result = _tmp0_;
	return result;
}


static GeeArrayList* rygel_environment_config_real_get_int_list (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error) {
	RygelEnvironmentConfig * self;
	GeeArrayList* result = NULL;
	gchar* str = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	GeeArrayList* value = NULL;
	GeeArrayList* _tmp3_ = NULL;
	gchar** _tmp4_ = NULL;
	gchar** _tmp5_ = NULL;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	g_return_val_if_fail (section != NULL, NULL);
	g_return_val_if_fail (key != NULL, NULL);
	_tmp0_ = section;
	_tmp1_ = key;
	_tmp2_ = rygel_configuration_get_string ((RygelConfiguration*) self, _tmp0_, _tmp1_, &_inner_error_);
	str = _tmp2_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return NULL;
	}
	_tmp3_ = gee_array_list_new (G_TYPE_INT, NULL, NULL, NULL, NULL, NULL);
	value = _tmp3_;
	_tmp5_ = _tmp4_ = g_strsplit (str, ",", -1);
	{
		gchar** token_collection = NULL;
		gint token_collection_length1 = 0;
		gint _token_collection_size_ = 0;
		gint token_it = 0;
		token_collection = _tmp5_;
		token_collection_length1 = _vala_array_length (_tmp4_);
		for (token_it = 0; token_it < _vala_array_length (_tmp4_); token_it = token_it + 1) {
			gchar* _tmp6_ = NULL;
			gchar* token = NULL;
			_tmp6_ = g_strdup (token_collection[token_it]);
			token = _tmp6_;
			{
				GeeArrayList* _tmp7_ = NULL;
				const gchar* _tmp8_ = NULL;
				gint _tmp9_ = 0;
				_tmp7_ = value;
				_tmp8_ = token;
				_tmp9_ = atoi (_tmp8_);
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp7_, (gpointer) ((gintptr) _tmp9_));
				_g_free0 (token);
			}
		}
		token_collection = (_vala_array_free (token_collection, token_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	result = value;
	_g_free0 (str);
	return result;
}


static gboolean rygel_environment_config_real_get_bool (RygelConfiguration* base, const gchar* section, const gchar* key, GError** error) {
	RygelEnvironmentConfig * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	const gchar* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	gchar* _tmp14_ = NULL;
	gchar* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	gchar* _tmp17_ = NULL;
	gboolean _tmp18_ = FALSE;
	gboolean _tmp19_ = FALSE;
	GError * _inner_error_ = NULL;
	self = (RygelEnvironmentConfig*) base;
	g_return_val_if_fail (section != NULL, FALSE);
	g_return_val_if_fail (key != NULL, FALSE);
	_tmp1_ = rygel_environment_config_RYGEL_PREFIX;
	_tmp2_ = g_strconcat (_tmp1_, "_", NULL);
	_tmp3_ = _tmp2_;
	_tmp4_ = section;
	_tmp5_ = g_utf8_strup (_tmp4_, (gssize) (-1));
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strconcat (_tmp3_, _tmp6_, NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_strconcat (_tmp8_, "_", NULL);
	_tmp10_ = _tmp9_;
	_tmp11_ = key;
	_tmp12_ = g_utf8_strup (_tmp11_, (gssize) (-1));
	_tmp13_ = _tmp12_;
	_tmp14_ = string_replace (_tmp13_, "-", "_");
	_tmp15_ = _tmp14_;
	_tmp16_ = g_strconcat (_tmp10_, _tmp15_, NULL);
	_tmp17_ = _tmp16_;
	_tmp18_ = rygel_environment_config_get_bool_variable (self, _tmp17_, &_inner_error_);
	_tmp19_ = _tmp18_;
	_g_free0 (_tmp17_);
	_g_free0 (_tmp15_);
	_g_free0 (_tmp13_);
	_g_free0 (_tmp10_);
	_g_free0 (_tmp8_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp3_);
	_tmp0_ = _tmp19_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		return FALSE;
	}
	result = _tmp0_;
	return result;
}


static gchar* rygel_environment_config_get_string_variable (RygelEnvironmentConfig* self, const gchar* variable, GError** error) {
	gchar* result = NULL;
	gchar* str = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (variable != NULL, NULL);
	_tmp0_ = variable;
	_tmp1_ = g_getenv (_tmp0_);
	_tmp2_ = g_strdup (_tmp1_);
	str = _tmp2_;
	_tmp3_ = str;
	if (_tmp3_ == NULL) {
		GError* _tmp4_ = NULL;
		_tmp4_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, "No value available");
		_inner_error_ = _tmp4_;
		g_propagate_error (error, _inner_error_);
		_g_free0 (str);
		return NULL;
	}
	result = str;
	return result;
}


static gint rygel_environment_config_get_int_variable (RygelEnvironmentConfig* self, const gchar* variable, gint min, gint max, GError** error) {
	gint result = 0;
	gchar* val = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	const gchar* _tmp5_ = NULL;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	gint _tmp8_ = 0;
	gint _tmp9_ = 0;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (variable != NULL, 0);
	_tmp0_ = variable;
	_tmp1_ = g_getenv (_tmp0_);
	_tmp2_ = g_strdup (_tmp1_);
	val = _tmp2_;
	_tmp3_ = val;
	if (_tmp3_ == NULL) {
		GError* _tmp4_ = NULL;
		_tmp4_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, "No value available");
		_inner_error_ = _tmp4_;
		g_propagate_error (error, _inner_error_);
		_g_free0 (val);
		return 0;
	}
	_tmp5_ = val;
	_tmp6_ = atoi (_tmp5_);
	_tmp7_ = min;
	_tmp8_ = max;
	_tmp9_ = CLAMP (_tmp6_, _tmp7_, _tmp8_);
	result = _tmp9_;
	_g_free0 (val);
	return result;
}


static gboolean rygel_environment_config_get_bool_variable (RygelEnvironmentConfig* self, const gchar* variable, GError** error) {
	gboolean result = FALSE;
	gchar* enabled = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (variable != NULL, FALSE);
	_tmp0_ = variable;
	_tmp1_ = g_getenv (_tmp0_);
	_tmp2_ = g_strdup (_tmp1_);
	enabled = _tmp2_;
	_tmp3_ = enabled;
	if (_tmp3_ == NULL) {
		GError* _tmp4_ = NULL;
		_tmp4_ = g_error_new_literal (RYGEL_CONFIGURATION_ERROR, RYGEL_CONFIGURATION_ERROR_NO_VALUE_SET, "No value available");
		_inner_error_ = _tmp4_;
		g_propagate_error (error, _inner_error_);
		_g_free0 (enabled);
		return FALSE;
	}
	result = TRUE;
	_g_free0 (enabled);
	return result;
}


RygelEnvironmentConfig* rygel_environment_config_construct (GType object_type) {
	RygelEnvironmentConfig * self = NULL;
	self = (RygelEnvironmentConfig*) g_object_new (object_type, NULL);
	return self;
}


RygelEnvironmentConfig* rygel_environment_config_new (void) {
	return rygel_environment_config_construct (RYGEL_TYPE_ENVIRONMENT_CONFIG);
}


static void rygel_environment_config_class_init (RygelEnvironmentConfigClass * klass) {
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	const gchar* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	const gchar* _tmp13_ = NULL;
	gchar* _tmp14_ = NULL;
	const gchar* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	const gchar* _tmp17_ = NULL;
	gchar* _tmp18_ = NULL;
	const gchar* _tmp19_ = NULL;
	gchar* _tmp20_ = NULL;
	const gchar* _tmp21_ = NULL;
	gchar* _tmp22_ = NULL;
	const gchar* _tmp23_ = NULL;
	gchar* _tmp24_ = NULL;
	rygel_environment_config_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = rygel_environment_config_finalize;
	_tmp0_ = g_strdup ("RYGEL");
	rygel_environment_config_RYGEL_PREFIX = _tmp0_;
	_tmp1_ = g_strdup ("TITLE");
	rygel_environment_config_TITLE_KEY = _tmp1_;
	_tmp2_ = rygel_environment_config_RYGEL_PREFIX;
	_tmp3_ = g_strconcat (_tmp2_, "_DISABLE", NULL);
	rygel_environment_config_DISABLE_PREFIX = _tmp3_;
	_tmp4_ = g_strdup ("ENABLED");
	rygel_environment_config_ENABLED_KEY = _tmp4_;
	_tmp5_ = rygel_environment_config_RYGEL_PREFIX;
	_tmp6_ = g_strconcat (_tmp5_, "_IFACE", NULL);
	rygel_environment_config_INTERFACE_ENV = _tmp6_;
	_tmp7_ = rygel_environment_config_RYGEL_PREFIX;
	_tmp8_ = g_strconcat (_tmp7_, "_PORT", NULL);
	rygel_environment_config_PORT_ENV = _tmp8_;
	_tmp9_ = rygel_environment_config_DISABLE_PREFIX;
	_tmp10_ = g_strconcat (_tmp9_, "_UPNP", NULL);
	rygel_environment_config_DISABLE_UPNP_ENV = _tmp10_;
	_tmp11_ = rygel_environment_config_DISABLE_PREFIX;
	_tmp12_ = g_strconcat (_tmp11_, "_TRANSCODING", NULL);
	rygel_environment_config_TRANSCODING_ENV = _tmp12_;
	_tmp13_ = rygel_environment_config_DISABLE_PREFIX;
	_tmp14_ = g_strconcat (_tmp13_, "_UPLOAD", NULL);
	rygel_environment_config_DISALLOW_UPLOAD_ENV = _tmp14_;
	_tmp15_ = rygel_environment_config_DISABLE_PREFIX;
	_tmp16_ = g_strconcat (_tmp15_, "_DELETION", NULL);
	rygel_environment_config_DISALLOW_DELETION_ENV = _tmp16_;
	_tmp17_ = rygel_environment_config_RYGEL_PREFIX;
	_tmp18_ = g_strconcat (_tmp17_, "_LOG", NULL);
	rygel_environment_config_LOG_LEVELS_ENV = _tmp18_;
	_tmp19_ = rygel_environment_config_RYGEL_PREFIX;
	_tmp20_ = g_strconcat (_tmp19_, "_PLUGIN_PATH", NULL);
	rygel_environment_config_PLUGIN_PATH_ENV = _tmp20_;
	_tmp21_ = rygel_environment_config_RYGEL_PREFIX;
	_tmp22_ = g_strconcat (_tmp21_, "_ENGINE_PATH", NULL);
	rygel_environment_config_ENGINE_PATH_ENV = _tmp22_;
	_tmp23_ = rygel_environment_config_RYGEL_PREFIX;
	_tmp24_ = g_strconcat (_tmp23_, "_MEDIA_ENGINE", NULL);
	rygel_environment_config_MEDIA_ENGINE_ENV = _tmp24_;
}


static void rygel_environment_config_rygel_configuration_interface_init (RygelConfigurationIface * iface) {
	rygel_environment_config_rygel_configuration_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_upnp_enabled = (gboolean (*)(RygelConfiguration*, GError**)) rygel_environment_config_real_get_upnp_enabled;
	iface->get_interface = (gchar* (*)(RygelConfiguration*, GError**)) rygel_environment_config_real_get_interface;
	iface->get_interfaces = (gchar** (*)(RygelConfiguration*, GError**)) rygel_environment_config_real_get_interfaces;
	iface->get_port = (gint (*)(RygelConfiguration*, GError**)) rygel_environment_config_real_get_port;
	iface->get_transcoding = (gboolean (*)(RygelConfiguration*, GError**)) rygel_environment_config_real_get_transcoding;
	iface->get_allow_upload = (gboolean (*)(RygelConfiguration*, GError**)) rygel_environment_config_real_get_allow_upload;
	iface->get_allow_deletion = (gboolean (*)(RygelConfiguration*, GError**)) rygel_environment_config_real_get_allow_deletion;
	iface->get_log_levels = (gchar* (*)(RygelConfiguration*, GError**)) rygel_environment_config_real_get_log_levels;
	iface->get_plugin_path = (gchar* (*)(RygelConfiguration*, GError**)) rygel_environment_config_real_get_plugin_path;
	iface->get_engine_path = (gchar* (*)(RygelConfiguration*, GError**)) rygel_environment_config_real_get_engine_path;
	iface->get_media_engine = (gchar* (*)(RygelConfiguration*, GError**)) rygel_environment_config_real_get_media_engine;
	iface->get_video_upload_folder = (gchar* (*)(RygelConfiguration*, GError**)) rygel_environment_config_real_get_video_upload_folder;
	iface->get_music_upload_folder = (gchar* (*)(RygelConfiguration*, GError**)) rygel_environment_config_real_get_music_upload_folder;
	iface->get_picture_upload_folder = (gchar* (*)(RygelConfiguration*, GError**)) rygel_environment_config_real_get_picture_upload_folder;
	iface->get_enabled = (gboolean (*)(RygelConfiguration*, const gchar*, GError**)) rygel_environment_config_real_get_enabled;
	iface->get_title = (gchar* (*)(RygelConfiguration*, const gchar*, GError**)) rygel_environment_config_real_get_title;
	iface->get_string = (gchar* (*)(RygelConfiguration*, const gchar*, const gchar*, GError**)) rygel_environment_config_real_get_string;
	iface->get_string_list = (GeeArrayList* (*)(RygelConfiguration*, const gchar*, const gchar*, GError**)) rygel_environment_config_real_get_string_list;
	iface->get_int = (gint (*)(RygelConfiguration*, const gchar*, const gchar*, gint, gint, GError**)) rygel_environment_config_real_get_int;
	iface->get_int_list = (GeeArrayList* (*)(RygelConfiguration*, const gchar*, const gchar*, GError**)) rygel_environment_config_real_get_int_list;
	iface->get_bool = (gboolean (*)(RygelConfiguration*, const gchar*, const gchar*, GError**)) rygel_environment_config_real_get_bool;
}


static void rygel_environment_config_instance_init (RygelEnvironmentConfig * self) {
}


static void rygel_environment_config_finalize (GObject* obj) {
	RygelEnvironmentConfig * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_TYPE_ENVIRONMENT_CONFIG, RygelEnvironmentConfig);
	G_OBJECT_CLASS (rygel_environment_config_parent_class)->finalize (obj);
}


/**
 * Manages configuration from Environment.
 */
GType rygel_environment_config_get_type (void) {
	static volatile gsize rygel_environment_config_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_environment_config_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelEnvironmentConfigClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_environment_config_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelEnvironmentConfig), 0, (GInstanceInitFunc) rygel_environment_config_instance_init, NULL };
		static const GInterfaceInfo rygel_configuration_info = { (GInterfaceInitFunc) rygel_environment_config_rygel_configuration_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType rygel_environment_config_type_id;
		rygel_environment_config_type_id = g_type_register_static (G_TYPE_OBJECT, "RygelEnvironmentConfig", &g_define_type_info, 0);
		g_type_add_interface_static (rygel_environment_config_type_id, RYGEL_TYPE_CONFIGURATION, &rygel_configuration_info);
		g_once_init_leave (&rygel_environment_config_type_id__volatile, rygel_environment_config_type_id);
	}
	return rygel_environment_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;
}



