/* configuration.c generated by valac 0.16.0, the Vala compiler
 * generated from configuration.vala, do not modify */

/*

this is a part of vattery
copyright 2011 jezra lickter http://www.jezra.net

vattery is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

vattery is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with vattery.	If not, see <http://www.gnu.org/licenses/>.

*/

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <glib/gstdio.h>
#include <gobject/gvaluecollector.h>


#define TYPE_CONFIGURATION (configuration_get_type ())
#define CONFIGURATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONFIGURATION, Configuration))
#define CONFIGURATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONFIGURATION, ConfigurationClass))
#define IS_CONFIGURATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONFIGURATION))
#define IS_CONFIGURATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONFIGURATION))
#define CONFIGURATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONFIGURATION, ConfigurationClass))

typedef struct _Configuration Configuration;
typedef struct _ConfigurationClass ConfigurationClass;
typedef struct _ConfigurationPrivate ConfigurationPrivate;
#define _g_key_file_free0(var) ((var == NULL) ? NULL : (var = (g_key_file_free (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)))
typedef struct _ParamSpecConfiguration ParamSpecConfiguration;

typedef enum  {
	CONFIG_ERROR_CREATE_DIR_FAILED,
	CONFIG_ERROR_FILE_NOT_FOUND,
	CONFIG_ERROR_DOCUMENT_EMPTY,
	CONFIG_ERROR_READ_FAILED,
	CONFIG_ERROR_WRITE_FAILED,
	CONFIG_ERROR_NO_KEY_VALUE
} ConfigError;
#define CONFIG_ERROR config_error_quark ()
struct _Configuration {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ConfigurationPrivate * priv;
};

struct _ConfigurationClass {
	GTypeClass parent_class;
	void (*finalize) (Configuration *self);
};

struct _ConfigurationPrivate {
	GKeyFile* keyfile;
	gchar* config_file;
	gboolean config_changed;
};

struct _ParamSpecConfiguration {
	GParamSpec parent_instance;
};


static gpointer configuration_parent_class = NULL;

GQuark config_error_quark (void);
gpointer configuration_ref (gpointer instance);
void configuration_unref (gpointer instance);
GParamSpec* param_spec_configuration (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_configuration (GValue* value, gpointer v_object);
void value_take_configuration (GValue* value, gpointer v_object);
gpointer value_get_configuration (const GValue* value);
GType configuration_get_type (void) G_GNUC_CONST;
#define CONFIGURATION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_CONFIGURATION, ConfigurationPrivate))
enum  {
	CONFIGURATION_DUMMY_PROPERTY
};
void configuration_save_config (Configuration* self, GError** error);
Configuration* configuration_new (const gchar* config_file_path);
Configuration* configuration_construct (GType object_type, const gchar* config_file_path);
void configuration_read_config (Configuration* self, GError** error);
void configuration_set_key_value (Configuration* self, const gchar* group, const gchar* key, const gchar* val);
gchar* configuration_get_value (Configuration* self, const gchar* group, const gchar* key);
gboolean configuration_get_boolean_value (Configuration* self, const gchar* group, const gchar* key);
static void configuration_finalize (Configuration* obj);


GQuark config_error_quark (void) {
	return g_quark_from_static_string ("config_error-quark");
}


Configuration* configuration_construct (GType object_type, const gchar* config_file_path) {
	Configuration* self = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	GKeyFile* _tmp2_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (config_file_path != NULL, NULL);
	self = (Configuration*) g_type_create_instance (object_type);
	self->priv->config_changed = FALSE;
	_tmp0_ = config_file_path;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->config_file);
	self->priv->config_file = _tmp1_;
	_tmp2_ = g_key_file_new ();
	_g_key_file_free0 (self->priv->keyfile);
	self->priv->keyfile = _tmp2_;
	{
		configuration_read_config (self, &_inner_error_);
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == CONFIG_ERROR) {
				goto __catch4_config_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;
		}
	}
	goto __finally4;
	__catch4_config_error:
	{
		GError* _error_ = NULL;
		FILE* _tmp3_;
		GError* _tmp4_;
		const gchar* _tmp5_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp3_ = stdout;
		_tmp4_ = _error_;
		_tmp5_ = _tmp4_->message;
		fprintf (_tmp3_, "%s\n", _tmp5_);
		_g_error_free0 (_error_);
	}
	__finally4:
	if (_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;
	}
	return self;
}


Configuration* configuration_new (const gchar* config_file_path) {
	return configuration_construct (TYPE_CONFIGURATION, config_file_path);
}


void configuration_save_config (Configuration* self, GError** error) {
	GKeyFile* _tmp0_;
	gchar* _tmp1_ = NULL;
	gchar* config_text;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->keyfile;
	_tmp1_ = g_key_file_to_data (_tmp0_, NULL, NULL);
	config_text = _tmp1_;
	{
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		_tmp2_ = self->priv->config_file;
		_tmp3_ = config_text;
		g_file_set_contents (_tmp2_, _tmp3_, (gssize) (-1), &_inner_error_);
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_FILE_ERROR) {
				goto __catch5_g_file_error;
			}
			_g_free0 (config_text);
			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;
		}
		self->priv->config_changed = FALSE;
	}
	goto __finally5;
	__catch5_g_file_error:
	{
		GError* err = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		GError* _tmp6_;
		err = _inner_error_;
		_inner_error_ = NULL;
		_tmp4_ = err;
		_tmp5_ = _tmp4_->message;
		_tmp6_ = g_error_new_literal (CONFIG_ERROR, CONFIG_ERROR_WRITE_FAILED, _tmp5_);
		_inner_error_ = _tmp6_;
		_g_error_free0 (err);
		goto __finally5;
	}
	__finally5:
	if (_inner_error_ != NULL) {
		if (_inner_error_->domain == CONFIG_ERROR) {
			g_propagate_error (error, _inner_error_);
			_g_free0 (config_text);
			return;
		} else {
			_g_free0 (config_text);
			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_free0 (config_text);
}


void configuration_read_config (Configuration* self, GError** error) {
	const gchar* _tmp0_;
	gchar* _tmp1_ = NULL;
	gchar* dirpath;
	const gchar* _tmp2_;
	gboolean _tmp3_ = FALSE;
	const gchar* _tmp11_;
	gboolean _tmp12_ = FALSE;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->config_file;
	_tmp1_ = g_path_get_dirname (_tmp0_);
	dirpath = _tmp1_;
	_tmp2_ = dirpath;
	_tmp3_ = g_file_test (_tmp2_, G_FILE_TEST_EXISTS);
	if (!_tmp3_) {
		const gchar* _tmp4_;
		gint _tmp5_ = 0;
		_tmp4_ = dirpath;
		_tmp5_ = g_mkdir_with_parents (_tmp4_, 0744);
		if (_tmp5_ == (-1)) {
			const gchar* _tmp6_;
			gchar* _tmp7_;
			gchar* _tmp8_;
			GError* _tmp9_;
			GError* _tmp10_;
			_tmp6_ = dirpath;
			_tmp7_ = g_strconcat ("failed to make ", _tmp6_, NULL);
			_tmp8_ = _tmp7_;
			_tmp9_ = g_error_new_literal (CONFIG_ERROR, CONFIG_ERROR_CREATE_DIR_FAILED, _tmp8_);
			_tmp10_ = _tmp9_;
			_g_free0 (_tmp8_);
			_inner_error_ = _tmp10_;
			if (_inner_error_->domain == CONFIG_ERROR) {
				g_propagate_error (error, _inner_error_);
				_g_free0 (dirpath);
				return;
			} else {
				_g_free0 (dirpath);
				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;
			}
		}
	}
	_tmp11_ = self->priv->config_file;
	_tmp12_ = g_file_test (_tmp11_, G_FILE_TEST_EXISTS);
	if (!_tmp12_) {
		{
			const gchar* _tmp13_;
			_tmp13_ = self->priv->config_file;
			g_file_set_contents (_tmp13_, "", (gssize) (-1), &_inner_error_);
			if (_inner_error_ != NULL) {
				if (_inner_error_->domain == G_FILE_ERROR) {
					goto __catch6_g_file_error;
				}
				_g_free0 (dirpath);
				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;
			}
		}
		goto __finally6;
		__catch6_g_file_error:
		{
			GError* err = NULL;
			GError* _tmp14_;
			const gchar* _tmp15_;
			GError* _tmp16_;
			err = _inner_error_;
			_inner_error_ = NULL;
			_tmp14_ = err;
			_tmp15_ = _tmp14_->message;
			_tmp16_ = g_error_new_literal (CONFIG_ERROR, CONFIG_ERROR_WRITE_FAILED, _tmp15_);
			_inner_error_ = _tmp16_;
			_g_error_free0 (err);
			goto __finally6;
		}
		__finally6:
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == CONFIG_ERROR) {
				g_propagate_error (error, _inner_error_);
				_g_free0 (dirpath);
				return;
			} else {
				_g_free0 (dirpath);
				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;
			}
		}
	}
	{
		GKeyFile* _tmp17_;
		const gchar* _tmp18_;
		_tmp17_ = self->priv->keyfile;
		_tmp18_ = self->priv->config_file;
		g_key_file_load_from_file (_tmp17_, _tmp18_, G_KEY_FILE_NONE, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch7_g_error;
		}
	}
	goto __finally7;
	__catch7_g_error:
	{
		GError* err = NULL;
		const gchar* _tmp19_;
		GError* _tmp20_;
		const gchar* _tmp21_;
		GError* _tmp22_;
		err = _inner_error_;
		_inner_error_ = NULL;
		_tmp19_ = self->priv->config_file;
		_tmp20_ = err;
		_tmp21_ = _tmp20_->message;
		_tmp22_ = g_error_new (CONFIG_ERROR, CONFIG_ERROR_READ_FAILED, "can not read %s: %s", _tmp19_, _tmp21_);
		_inner_error_ = _tmp22_;
		_g_error_free0 (err);
		goto __finally7;
	}
	__finally7:
	if (_inner_error_ != NULL) {
		if (_inner_error_->domain == CONFIG_ERROR) {
			g_propagate_error (error, _inner_error_);
			_g_free0 (dirpath);
			return;
		} else {
			_g_free0 (dirpath);
			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_free0 (dirpath);
}


void configuration_set_key_value (Configuration* self, const gchar* group, const gchar* key, const gchar* val) {
	GKeyFile* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (group != NULL);
	g_return_if_fail (key != NULL);
	g_return_if_fail (val != NULL);
	_tmp0_ = self->priv->keyfile;
	_tmp1_ = group;
	_tmp2_ = key;
	_tmp3_ = val;
	g_key_file_set_string (_tmp0_, _tmp1_, _tmp2_, _tmp3_);
	self->priv->config_changed = TRUE;
}


gchar* configuration_get_value (Configuration* self, const gchar* group, const gchar* key) {
	gchar* result = NULL;
	gchar* val = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (group != NULL, NULL);
	g_return_val_if_fail (key != NULL, NULL);
	{
		GKeyFile* _tmp0_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_ = NULL;
		gchar* _tmp4_;
		_tmp0_ = self->priv->keyfile;
		_tmp1_ = group;
		_tmp2_ = key;
		_tmp3_ = g_key_file_get_string (_tmp0_, _tmp1_, _tmp2_, &_inner_error_);
		_tmp4_ = _tmp3_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_KEY_FILE_ERROR) {
				goto __catch8_g_key_file_error;
			}
			_g_free0 (val);
			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;
		}
		_g_free0 (val);
		val = _tmp4_;
	}
	goto __finally8;
	__catch8_g_key_file_error:
	{
		GError* err = NULL;
		err = _inner_error_;
		_inner_error_ = NULL;
		_g_free0 (val);
		val = NULL;
		_g_error_free0 (err);
	}
	__finally8:
	if (_inner_error_ != NULL) {
		_g_free0 (val);
		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;
	}
	result = val;
	return result;
}


gboolean configuration_get_boolean_value (Configuration* self, const gchar* group, const gchar* key) {
	gboolean result = FALSE;
	gchar* val = NULL;
	gboolean _tmp5_ = FALSE;
	const gchar* _tmp6_;
	gboolean _tmp8_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (group != NULL, FALSE);
	g_return_val_if_fail (key != NULL, FALSE);
	{
		GKeyFile* _tmp0_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_ = NULL;
		gchar* _tmp4_;
		_tmp0_ = self->priv->keyfile;
		_tmp1_ = group;
		_tmp2_ = key;
		_tmp3_ = g_key_file_get_string (_tmp0_, _tmp1_, _tmp2_, &_inner_error_);
		_tmp4_ = _tmp3_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_KEY_FILE_ERROR) {
				goto __catch9_g_key_file_error;
			}
			_g_free0 (val);
			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 FALSE;
		}
		_g_free0 (val);
		val = _tmp4_;
	}
	goto __finally9;
	__catch9_g_key_file_error:
	{
		GError* err = NULL;
		err = _inner_error_;
		_inner_error_ = NULL;
		_g_free0 (val);
		val = NULL;
		_g_error_free0 (err);
	}
	__finally9:
	if (_inner_error_ != NULL) {
		_g_free0 (val);
		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 FALSE;
	}
	_tmp6_ = val;
	if (_tmp6_ != NULL) {
		const gchar* _tmp7_;
		_tmp7_ = val;
		_tmp5_ = g_strcmp0 (_tmp7_, "false") != 0;
	} else {
		_tmp5_ = FALSE;
	}
	_tmp8_ = _tmp5_;
	if (_tmp8_) {
		result = TRUE;
		_g_free0 (val);
		return result;
	} else {
		result = FALSE;
		_g_free0 (val);
		return result;
	}
	_g_free0 (val);
}


static void value_configuration_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void value_configuration_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		configuration_unref (value->data[0].v_pointer);
	}
}


static void value_configuration_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = configuration_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer value_configuration_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* value_configuration_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		Configuration* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = configuration_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* value_configuration_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	Configuration** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = configuration_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* param_spec_configuration (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ParamSpecConfiguration* spec;
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_CONFIGURATION), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer value_get_configuration (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_CONFIGURATION), NULL);
	return value->data[0].v_pointer;
}


void value_set_configuration (GValue* value, gpointer v_object) {
	Configuration* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_CONFIGURATION));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_CONFIGURATION));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		configuration_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		configuration_unref (old);
	}
}


void value_take_configuration (GValue* value, gpointer v_object) {
	Configuration* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_CONFIGURATION));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_CONFIGURATION));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		configuration_unref (old);
	}
}


static void configuration_class_init (ConfigurationClass * klass) {
	configuration_parent_class = g_type_class_peek_parent (klass);
	CONFIGURATION_CLASS (klass)->finalize = configuration_finalize;
	g_type_class_add_private (klass, sizeof (ConfigurationPrivate));
}


static void configuration_instance_init (Configuration * self) {
	self->priv = CONFIGURATION_GET_PRIVATE (self);
	self->ref_count = 1;
}


static void configuration_finalize (Configuration* obj) {
	Configuration * self;
	gboolean _tmp0_;
	GError * _inner_error_ = NULL;
	self = CONFIGURATION (obj);
	_tmp0_ = self->priv->config_changed;
	if (_tmp0_) {
		configuration_save_config (self, &_inner_error_);
		if (_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_);
		}
	}
	_g_key_file_free0 (self->priv->keyfile);
	_g_free0 (self->priv->config_file);
}


GType configuration_get_type (void) {
	static volatile gsize configuration_type_id__volatile = 0;
	if (g_once_init_enter (&configuration_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { value_configuration_init, value_configuration_free_value, value_configuration_copy_value, value_configuration_peek_pointer, "p", value_configuration_collect_value, "p", value_configuration_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (ConfigurationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) configuration_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Configuration), 0, (GInstanceInitFunc) configuration_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType configuration_type_id;
		configuration_type_id = g_type_register_fundamental (g_type_fundamental_next (), "Configuration", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&configuration_type_id__volatile, configuration_type_id);
	}
	return configuration_type_id__volatile;
}


gpointer configuration_ref (gpointer instance) {
	Configuration* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void configuration_unref (gpointer instance) {
	Configuration* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		CONFIGURATION_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}



