/* gcp-log.c generated by valac 0.19.0, the Vala compiler
 * generated from gcp-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 GCP_TYPE_LOG (gcp_log_get_type ())
#define GCP_LOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCP_TYPE_LOG, GcpLog))
#define GCP_LOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCP_TYPE_LOG, GcpLogClass))
#define GCP_IS_LOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCP_TYPE_LOG))
#define GCP_IS_LOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCP_TYPE_LOG))
#define GCP_LOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCP_TYPE_LOG, GcpLogClass))

typedef struct _GcpLog GcpLog;
typedef struct _GcpLogClass GcpLogClass;
typedef struct _GcpLogPrivate GcpLogPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _GcpParamSpecLog GcpParamSpecLog;

struct _GcpLog {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GcpLogPrivate * priv;
};

struct _GcpLogClass {
	GTypeClass parent_class;
	void (*finalize) (GcpLog *self);
};

struct _GcpParamSpecLog {
	GParamSpec parent_instance;
};


static gpointer gcp_log_parent_class = NULL;
static gchar* gcp_log_Domain;
static gchar* gcp_log_Domain = NULL;

gpointer gcp_log_ref (gpointer instance);
void gcp_log_unref (gpointer instance);
GParamSpec* gcp_param_spec_log (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void gcp_value_set_log (GValue* value, gpointer v_object);
void gcp_value_take_log (GValue* value, gpointer v_object);
gpointer gcp_value_get_log (const GValue* value);
GType gcp_log_get_type (void) G_GNUC_CONST;
enum  {
	GCP_LOG_DUMMY_PROPERTY
};
void gcp_log_error (const gchar* format, ...);
void gcp_log_warning (const gchar* format, ...);
void gcp_log_message (const gchar* format, ...);
void gcp_log_info (const gchar* format, ...);
void gcp_log_debug (const gchar* format, ...);
void gcp_log_critical (const gchar* format, ...);
GcpLog* gcp_log_new (void);
GcpLog* gcp_log_construct (GType object_type);
static void gcp_log_finalize (GcpLog* obj);


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


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


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


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


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


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


GcpLog* gcp_log_construct (GType object_type) {
	GcpLog* self = NULL;
	self = (GcpLog*) g_type_create_instance (object_type);
	return self;
}


GcpLog* gcp_log_new (void) {
	return gcp_log_construct (GCP_TYPE_LOG);
}


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


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


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


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


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


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


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


void gcp_value_set_log (GValue* value, gpointer v_object) {
	GcpLog* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GCP_TYPE_LOG));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GCP_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;
		gcp_log_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gcp_log_unref (old);
	}
}


void gcp_value_take_log (GValue* value, gpointer v_object) {
	GcpLog* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GCP_TYPE_LOG));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GCP_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) {
		gcp_log_unref (old);
	}
}


static void gcp_log_class_init (GcpLogClass * klass) {
	gchar* _tmp0_;
	gcp_log_parent_class = g_type_class_peek_parent (klass);
	GCP_LOG_CLASS (klass)->finalize = gcp_log_finalize;
	_tmp0_ = g_strdup ("Gcp");
	gcp_log_Domain = _tmp0_;
}


static void gcp_log_instance_init (GcpLog * self) {
	self->ref_count = 1;
}


static void gcp_log_finalize (GcpLog* obj) {
	GcpLog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GCP_TYPE_LOG, GcpLog);
}


GType gcp_log_get_type (void) {
	static volatile gsize gcp_log_type_id__volatile = 0;
	if (g_once_init_enter (&gcp_log_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { gcp_value_log_init, gcp_value_log_free_value, gcp_value_log_copy_value, gcp_value_log_peek_pointer, "p", gcp_value_log_collect_value, "p", gcp_value_log_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (GcpLogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gcp_log_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GcpLog), 0, (GInstanceInitFunc) gcp_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 gcp_log_type_id;
		gcp_log_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GcpLog", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&gcp_log_type_id__volatile, gcp_log_type_id);
	}
	return gcp_log_type_id__volatile;
}


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


void gcp_log_unref (gpointer instance) {
	GcpLog* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GCP_LOG_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}



