/* gca-log.c generated by valac 0.28.0.11-bbdd, the Vala compiler
 * generated from gca-log.vala, do not modify */


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


#define GCA_TYPE_LOG (gca_log_get_type ())
#define GCA_LOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCA_TYPE_LOG, GcaLog))
#define GCA_LOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCA_TYPE_LOG, GcaLogClass))
#define GCA_IS_LOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCA_TYPE_LOG))
#define GCA_IS_LOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCA_TYPE_LOG))
#define GCA_LOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCA_TYPE_LOG, GcaLogClass))

typedef struct _GcaLog GcaLog;
typedef struct _GcaLogClass GcaLogClass;
typedef struct _GcaLogPrivate GcaLogPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _GcaParamSpecLog GcaParamSpecLog;

struct _GcaLog {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GcaLogPrivate * priv;
};

struct _GcaLogClass {
	GTypeClass parent_class;
	void (*finalize) (GcaLog *self);
};

struct _GcaParamSpecLog {
	GParamSpec parent_instance;
};


static gpointer gca_log_parent_class = NULL;

gpointer gca_log_ref (gpointer instance);
void gca_log_unref (gpointer instance);
GParamSpec* gca_param_spec_log (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void gca_value_set_log (GValue* value, gpointer v_object);
void gca_value_take_log (GValue* value, gpointer v_object);
gpointer gca_value_get_log (const GValue* value);
GType gca_log_get_type (void) G_GNUC_CONST;
enum  {
	GCA_LOG_DUMMY_PROPERTY
};
#define GCA_LOG_Domain "Gca"
void gca_log_error (const gchar* format, ...);
void gca_log_warning (const gchar* format, ...);
void gca_log_message (const gchar* format, ...);
void gca_log_info (const gchar* format, ...);
void gca_log_debug (const gchar* format, ...);
void gca_log_critical (const gchar* format, ...);
GcaLog* gca_log_new (void);
GcaLog* gca_log_construct (GType object_type);
static void gca_log_finalize (GcaLog* obj);


void gca_log_error (const gchar* format, ...) {
	va_list v = {0};
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	g_return_if_fail (format != NULL);
	va_start (v, format);
	_tmp0_ = format;
	_tmp1_ = g_strdup_vprintf (_tmp0_, v);
	_tmp2_ = _tmp1_;
	g_log (GCA_LOG_Domain, G_LOG_LEVEL_ERROR, "gca-log.vala:13: %s", _tmp2_);
	_g_free0 (_tmp2_);
	va_end (v);
}


void gca_log_warning (const gchar* format, ...) {
	va_list v = {0};
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	g_return_if_fail (format != NULL);
	va_start (v, format);
	_tmp0_ = format;
	_tmp1_ = g_strdup_vprintf (_tmp0_, v);
	_tmp2_ = _tmp1_;
	g_log (GCA_LOG_Domain, G_LOG_LEVEL_WARNING, "gca-log.vala:25: %s", _tmp2_);
	_g_free0 (_tmp2_);
	va_end (v);
}


void gca_log_message (const gchar* format, ...) {
	va_list v = {0};
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	g_return_if_fail (format != NULL);
	va_start (v, format);
	_tmp0_ = format;
	_tmp1_ = g_strdup_vprintf (_tmp0_, v);
	_tmp2_ = _tmp1_;
	g_log (GCA_LOG_Domain, G_LOG_LEVEL_MESSAGE, "gca-log.vala:37: %s", _tmp2_);
	_g_free0 (_tmp2_);
	va_end (v);
}


void gca_log_info (const gchar* format, ...) {
	va_list v = {0};
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	g_return_if_fail (format != NULL);
	va_start (v, format);
	_tmp0_ = format;
	_tmp1_ = g_strdup_vprintf (_tmp0_, v);
	_tmp2_ = _tmp1_;
	g_log (GCA_LOG_Domain, G_LOG_LEVEL_INFO, "gca-log.vala:49: %s", _tmp2_);
	_g_free0 (_tmp2_);
	va_end (v);
}


void gca_log_debug (const gchar* format, ...) {
	va_list v = {0};
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	g_return_if_fail (format != NULL);
	va_start (v, format);
	_tmp0_ = format;
	_tmp1_ = g_strdup_vprintf (_tmp0_, v);
	_tmp2_ = _tmp1_;
	g_log (GCA_LOG_Domain, G_LOG_LEVEL_DEBUG, "gca-log.vala:61: %s", _tmp2_);
	_g_free0 (_tmp2_);
	va_end (v);
}


void gca_log_critical (const gchar* format, ...) {
	va_list v = {0};
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	g_return_if_fail (format != NULL);
	va_start (v, format);
	_tmp0_ = format;
	_tmp1_ = g_strdup_vprintf (_tmp0_, v);
	_tmp2_ = _tmp1_;
	g_log (GCA_LOG_Domain, G_LOG_LEVEL_CRITICAL, "gca-log.vala:73: %s", _tmp2_);
	_g_free0 (_tmp2_);
	va_end (v);
}


GcaLog* gca_log_construct (GType object_type) {
	GcaLog* self = NULL;
	self = (GcaLog*) g_type_create_instance (object_type);
	return self;
}


GcaLog* gca_log_new (void) {
	return gca_log_construct (GCA_TYPE_LOG);
}


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


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


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


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


static gchar* gca_value_log_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		GcaLog* 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 = gca_log_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* gca_value_log_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	GcaLog** 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 = gca_log_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* gca_param_spec_log (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	GcaParamSpecLog* spec;
	g_return_val_if_fail (g_type_is_a (object_type, GCA_TYPE_LOG), 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 gca_value_get_log (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GCA_TYPE_LOG), NULL);
	return value->data[0].v_pointer;
}


void gca_value_set_log (GValue* value, gpointer v_object) {
	GcaLog* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GCA_TYPE_LOG));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GCA_TYPE_LOG));
		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;
		gca_log_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gca_log_unref (old);
	}
}


void gca_value_take_log (GValue* value, gpointer v_object) {
	GcaLog* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GCA_TYPE_LOG));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GCA_TYPE_LOG));
		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) {
		gca_log_unref (old);
	}
}


static void gca_log_class_init (GcaLogClass * klass) {
	gca_log_parent_class = g_type_class_peek_parent (klass);
	((GcaLogClass *) klass)->finalize = gca_log_finalize;
}


static void gca_log_instance_init (GcaLog * self) {
	self->ref_count = 1;
}


static void gca_log_finalize (GcaLog* obj) {
	GcaLog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GCA_TYPE_LOG, GcaLog);
	g_signal_handlers_destroy (self);
}


GType gca_log_get_type (void) {
	static volatile gsize gca_log_type_id__volatile = 0;
	if (g_once_init_enter (&gca_log_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { gca_value_log_init, gca_value_log_free_value, gca_value_log_copy_value, gca_value_log_peek_pointer, "p", gca_value_log_collect_value, "p", gca_value_log_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (GcaLogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gca_log_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GcaLog), 0, (GInstanceInitFunc) gca_log_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 gca_log_type_id;
		gca_log_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GcaLog", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&gca_log_type_id__volatile, gca_log_type_id);
	}
	return gca_log_type_id__volatile;
}


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


void gca_log_unref (gpointer instance) {
	GcaLog* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GCA_LOG_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}



