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

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

#define TYPE_BUILD (build_get_type ())
#define BUILD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BUILD, Build))
#define BUILD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BUILD, BuildClass))
#define IS_BUILD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BUILD))
#define IS_BUILD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BUILD))
#define BUILD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BUILD, BuildClass))

typedef struct _Build Build;
typedef struct _BuildClass BuildClass;
typedef struct _BuildPrivate BuildPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _ParamSpecBuild ParamSpecBuild;

struct _Build {
	GTypeInstance parent_instance;
	volatile int ref_count;
	BuildPrivate * priv;
};

struct _BuildClass {
	GTypeClass parent_class;
	void (*finalize) (Build *self);
};

struct _ParamSpecBuild {
	GParamSpec parent_instance;
};

static gpointer build_parent_class = NULL;

gpointer build_ref (gpointer instance);
void build_unref (gpointer instance);
GParamSpec* param_spec_build (const gchar* name,
                              const gchar* nick,
                              const gchar* blurb,
                              GType object_type,
                              GParamFlags flags);
void value_set_build (GValue* value,
                      gpointer v_object);
void value_take_build (GValue* value,
                       gpointer v_object);
gpointer value_get_build (const GValue* value);
GType build_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Build, build_unref)
#define BUILD_NAME "Tootle"
#define BUILD_VERSION "1.0.0"
#define BUILD_DOMAIN "com.github.bleakgrey.tootle"
#define BUILD_RESOURCES "/com/github/bleakgrey/tootle/"
#define BUILD_WEBSITE "https://github.com/bleakgrey/tootle"
#define BUILD_SUPPORT_WEBSITE "https://github.com/bleakgrey/tootle/issues"
#define BUILD_COPYRIGHT "© 2018-2020 bleak_grey"
#define BUILD_PREFIX "/usr"
#define BUILD_TRANSLATOR _ (" ")
gchar** build_get_authors (gint* result_length1);
gchar** build_get_artists (gint* result_length1);
void build_print_info (void);
static gchar* build_get_os_info (const gchar* key);
Build* build_new (void);
Build* build_construct (GType object_type);
static void build_finalize (Build * obj);
static GType build_get_type_once (void);

gchar**
build_get_authors (gint* result_length1)
{
	gchar* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gchar** result = NULL;
	_tmp0_ = g_strdup ("bleak_grey");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

gchar**
build_get_artists (gint* result_length1)
{
	gchar* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gchar** result = NULL;
	_tmp0_ = g_strdup ("Tobias Bernard");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

void
build_print_info (void)
{
	gchar* os_name = NULL;
	gchar* _tmp0_;
	gchar* os_ver = NULL;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	_tmp0_ = build_get_os_info ("NAME");
	os_name = _tmp0_;
	_tmp1_ = build_get_os_info ("VERSION");
	os_ver = _tmp1_;
	_tmp2_ = string_to_string (BUILD_NAME);
	_tmp3_ = string_to_string (BUILD_VERSION);
	_tmp4_ = g_strconcat (_tmp2_, " ", _tmp3_, NULL);
	_tmp5_ = _tmp4_;
	g_message ("Build.vala:32: %s", _tmp5_);
	_g_free0 (_tmp5_);
	_tmp6_ = string_to_string (os_name);
	_tmp7_ = string_to_string (os_ver);
	_tmp8_ = g_strconcat ("Running on: ", _tmp6_, " ", _tmp7_, NULL);
	_tmp9_ = _tmp8_;
	g_message ("Build.vala:33: %s", _tmp9_);
	_g_free0 (_tmp9_);
	_tmp10_ = string_to_string (BUILD_PREFIX);
	_tmp11_ = g_strconcat ("Build prefix: \"", _tmp10_, "\"", NULL);
	_tmp12_ = _tmp11_;
	g_message ("Build.vala:34: %s", _tmp12_);
	_g_free0 (_tmp12_);
	_g_free0 (os_ver);
	_g_free0 (os_name);
}

static gchar*
build_get_os_info (const gchar* key)
{
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* _tmp3_;
	gchar* result = NULL;
	g_return_val_if_fail (key != NULL, NULL);
	_tmp1_ = g_get_os_info (key);
	_tmp0_ = _tmp1_;
	if (_tmp0_ == NULL) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup ("Unknown");
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp2_;
	}
	_tmp3_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp3_;
	_g_free0 (_tmp0_);
	return result;
}

Build*
build_construct (GType object_type)
{
	Build* self = NULL;
	self = (Build*) g_type_create_instance (object_type);
	return self;
}

Build*
build_new (void)
{
	return build_construct (TYPE_BUILD);
}

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

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

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

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

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

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

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

void
value_set_build (GValue* value,
                 gpointer v_object)
{
	Build * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_BUILD));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_BUILD));
		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;
		build_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		build_unref (old);
	}
}

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

static void
build_class_init (BuildClass * klass,
                  gpointer klass_data)
{
	build_parent_class = g_type_class_peek_parent (klass);
	((BuildClass *) klass)->finalize = build_finalize;
}

static void
build_instance_init (Build * self,
                     gpointer klass)
{
	self->ref_count = 1;
}

static void
build_finalize (Build * obj)
{
	Build * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_BUILD, Build);
	g_signal_handlers_destroy (self);
}

static GType
build_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { value_build_init, value_build_free_value, value_build_copy_value, value_build_peek_pointer, "p", value_build_collect_value, "p", value_build_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (BuildClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) build_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Build), 0, (GInstanceInitFunc) build_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 build_type_id;
	build_type_id = g_type_register_fundamental (g_type_fundamental_next (), "Build", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return build_type_id;
}

GType
build_get_type (void)
{
	static volatile gsize build_type_id__volatile = 0;
	if (g_once_init_enter (&build_type_id__volatile)) {
		GType build_type_id;
		build_type_id = build_get_type_once ();
		g_once_init_leave (&build_type_id__volatile, build_type_id);
	}
	return build_type_id__volatile;
}

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

void
build_unref (gpointer instance)
{
	Build * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		BUILD_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

