/* uid.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from uid.vala, do not modify */

/* This file is part of GNOME Games. License: GPL-3.0+.*/

#include "gnome-games.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	GAMES_UID_0_PROPERTY,
	GAMES_UID_NUM_PROPERTIES
};
static GParamSpec* games_uid_properties[GAMES_UID_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

struct _GamesUidPrivate {
	gchar* uid;
};

static gint GamesUid_private_offset;
static gpointer games_uid_parent_class = NULL;

static void games_uid_finalize (GObject * obj);
static GType games_uid_get_type_once (void);

static inline gpointer
games_uid_get_instance_private (GamesUid* self)
{
	return G_STRUCT_MEMBER_P (self, GamesUid_private_offset);
}

GamesUid*
games_uid_construct (GType object_type,
                     const gchar* uid)
{
	GamesUid * self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (uid != NULL, NULL);
	self = (GamesUid*) g_object_new (object_type, NULL);
	_tmp0_ = g_strdup (uid);
	_g_free0 (self->priv->uid);
	self->priv->uid = _tmp0_;
	return self;
}

GamesUid*
games_uid_new (const gchar* uid)
{
	return games_uid_construct (GAMES_TYPE_UID, uid);
}

gchar*
games_uid_to_string (GamesUid* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->uid;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

guint
games_uid_hash (GamesUid* key)
{
	GHashFunc _tmp0_;
	const gchar* _tmp1_;
	guint result;
	g_return_val_if_fail (key != NULL, 0U);
	_tmp0_ = g_str_hash;
	_tmp1_ = key->priv->uid;
	result = _tmp0_ (_tmp1_);
	return result;
}

gboolean
games_uid_equal (GamesUid* a,
                 GamesUid* b)
{
	GEqualFunc _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gboolean result;
	g_return_val_if_fail (a != NULL, FALSE);
	g_return_val_if_fail (b != NULL, FALSE);
	_tmp0_ = g_str_equal;
	_tmp1_ = a->priv->uid;
	_tmp2_ = b->priv->uid;
	result = _tmp0_ (_tmp1_, _tmp2_);
	return result;
}

gint
games_uid_compare (GamesUid* a,
                   GamesUid* b)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gint result;
	g_return_val_if_fail (a != NULL, 0);
	g_return_val_if_fail (b != NULL, 0);
	_tmp0_ = a->priv->uid;
	_tmp1_ = b->priv->uid;
	result = g_utf8_collate (_tmp0_, _tmp1_);
	return result;
}

static void
games_uid_class_init (GamesUidClass * klass,
                      gpointer klass_data)
{
	games_uid_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GamesUid_private_offset);
	G_OBJECT_CLASS (klass)->finalize = games_uid_finalize;
}

static void
games_uid_instance_init (GamesUid * self,
                         gpointer klass)
{
	self->priv = games_uid_get_instance_private (self);
}

static void
games_uid_finalize (GObject * obj)
{
	GamesUid * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_UID, GamesUid);
	_g_free0 (self->priv->uid);
	G_OBJECT_CLASS (games_uid_parent_class)->finalize (obj);
}

static GType
games_uid_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GamesUidClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_uid_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesUid), 0, (GInstanceInitFunc) games_uid_instance_init, NULL };
	GType games_uid_type_id;
	games_uid_type_id = g_type_register_static (G_TYPE_OBJECT, "GamesUid", &g_define_type_info, 0);
	GamesUid_private_offset = g_type_add_instance_private (games_uid_type_id, sizeof (GamesUidPrivate));
	return games_uid_type_id;
}

GType
games_uid_get_type (void)
{
	static volatile gsize games_uid_type_id__once = 0;
	if (g_once_init_enter (&games_uid_type_id__once)) {
		GType games_uid_type_id;
		games_uid_type_id = games_uid_get_type_once ();
		g_once_init_leave (&games_uid_type_id__once, games_uid_type_id);
	}
	return games_uid_type_id__once;
}

