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

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

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "gnome-games.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

#define GAMES_TYPE_RETRO_SIMPLE_TYPE (games_retro_simple_type_get_type ())
typedef struct _GamesRetroSimpleType GamesRetroSimpleType;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _GamesRetroSimpleType {
	gchar* mime_type;
	gboolean search_mime_type;
	gchar* platform;
	gchar* prefix;
};

VALA_EXTERN GType games_retro_simple_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GamesRetroSimpleType* games_retro_simple_type_dup (const GamesRetroSimpleType* self);
VALA_EXTERN void games_retro_simple_type_free (GamesRetroSimpleType* self);
VALA_EXTERN void games_retro_simple_type_copy (const GamesRetroSimpleType* self,
                                   GamesRetroSimpleType* dest);
VALA_EXTERN void games_retro_simple_type_destroy (GamesRetroSimpleType* self);
VALA_EXTERN gchar* games_retro_simple_type_get_platform_name (GamesRetroSimpleType *self);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

gchar*
games_retro_simple_type_get_platform_name (GamesRetroSimpleType *self)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GQuark _tmp3_ = 0U;
	static GQuark _tmp2_label0 = 0;
	static GQuark _tmp2_label1 = 0;
	static GQuark _tmp2_label2 = 0;
	static GQuark _tmp2_label3 = 0;
	static GQuark _tmp2_label4 = 0;
	static GQuark _tmp2_label5 = 0;
	static GQuark _tmp2_label6 = 0;
	static GQuark _tmp2_label7 = 0;
	static GQuark _tmp2_label8 = 0;
	static GQuark _tmp2_label9 = 0;
	static GQuark _tmp2_label10 = 0;
	static GQuark _tmp2_label11 = 0;
	static GQuark _tmp2_label12 = 0;
	static GQuark _tmp2_label13 = 0;
	static GQuark _tmp2_label14 = 0;
	static GQuark _tmp2_label15 = 0;
	static GQuark _tmp2_label16 = 0;
	static GQuark _tmp2_label17 = 0;
	static GQuark _tmp2_label18 = 0;
	static GQuark _tmp2_label19 = 0;
	static GQuark _tmp2_label20 = 0;
	static GQuark _tmp2_label21 = 0;
	static GQuark _tmp2_label22 = 0;
	gchar* result;
	_tmp0_ = (*self).platform;
	_tmp1_ = _tmp0_;
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
	if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("Amiga")))) {
		switch (0) {
			default:
			{
				gchar* _tmp4_;
				_tmp4_ = g_strdup (_ ("Amiga"));
				result = _tmp4_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("Atari2600")))) {
		switch (0) {
			default:
			{
				gchar* _tmp5_;
				_tmp5_ = g_strdup (_ ("Atari 2600"));
				result = _tmp5_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("Atari7800")))) {
		switch (0) {
			default:
			{
				gchar* _tmp6_;
				_tmp6_ = g_strdup (_ ("Atari 7800"));
				result = _tmp6_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("AtariLynx")))) {
		switch (0) {
			default:
			{
				gchar* _tmp7_;
				_tmp7_ = g_strdup (_ ("Atari Lynx"));
				result = _tmp7_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label4) ? _tmp2_label4 : (_tmp2_label4 = g_quark_from_static_string ("DOOM")))) {
		switch (0) {
			default:
			{
				gchar* _tmp8_;
				_tmp8_ = g_strdup (_ ("DOOM"));
				result = _tmp8_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label5) ? _tmp2_label5 : (_tmp2_label5 = g_quark_from_static_string ("FamicomDiskSystem")))) {
		switch (0) {
			default:
			{
				gchar* _tmp9_;
				_tmp9_ = g_strdup (_ ("Famicom Disk System"));
				result = _tmp9_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label6) ? _tmp2_label6 : (_tmp2_label6 = g_quark_from_static_string ("GameBoy")))) {
		switch (0) {
			default:
			{
				gchar* _tmp10_;
				_tmp10_ = g_strdup (_ ("Game Boy"));
				result = _tmp10_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label7) ? _tmp2_label7 : (_tmp2_label7 = g_quark_from_static_string ("GameBoyColor")))) {
		switch (0) {
			default:
			{
				gchar* _tmp11_;
				_tmp11_ = g_strdup (_ ("Game Boy Color"));
				result = _tmp11_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label8) ? _tmp2_label8 : (_tmp2_label8 = g_quark_from_static_string ("GameBoyAdvance")))) {
		switch (0) {
			default:
			{
				gchar* _tmp12_;
				_tmp12_ = g_strdup (_ ("Game Boy Advance"));
				result = _tmp12_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label9) ? _tmp2_label9 : (_tmp2_label9 = g_quark_from_static_string ("GameGear")))) {
		switch (0) {
			default:
			{
				gchar* _tmp13_;
				_tmp13_ = g_strdup (_ ("Game Gear"));
				result = _tmp13_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label10) ? _tmp2_label10 : (_tmp2_label10 = g_quark_from_static_string ("MasterSystem")))) {
		switch (0) {
			default:
			{
				gchar* _tmp14_;
				_tmp14_ = g_strdup (_ ("Master System"));
				result = _tmp14_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label11) ? _tmp2_label11 : (_tmp2_label11 = g_quark_from_static_string ("NeoGeoPocket")))) {
		switch (0) {
			default:
			{
				gchar* _tmp15_;
				_tmp15_ = g_strdup (_ ("Neo Geo Pocket"));
				result = _tmp15_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label12) ? _tmp2_label12 : (_tmp2_label12 = g_quark_from_static_string ("NeoGeoPocketColor")))) {
		switch (0) {
			default:
			{
				gchar* _tmp16_;
				_tmp16_ = g_strdup (_ ("Neo Geo Pocket Color"));
				result = _tmp16_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label13) ? _tmp2_label13 : (_tmp2_label13 = g_quark_from_static_string ("NintendoEntertainmentSystem")))) {
		switch (0) {
			default:
			{
				gchar* _tmp17_;
				_tmp17_ = g_strdup (_ ("Nintendo Entertainment System"));
				result = _tmp17_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label14) ? _tmp2_label14 : (_tmp2_label14 = g_quark_from_static_string ("Sega32X")))) {
		switch (0) {
			default:
			{
				gchar* _tmp18_;
				_tmp18_ = g_strdup (_ ("Genesis 32X"));
				result = _tmp18_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label15) ? _tmp2_label15 : (_tmp2_label15 = g_quark_from_static_string ("SegaGenesis")))) {
		switch (0) {
			default:
			{
				gchar* _tmp19_;
				_tmp19_ = g_strdup (_ ("Sega Genesis"));
				result = _tmp19_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label16) ? _tmp2_label16 : (_tmp2_label16 = g_quark_from_static_string ("SegaPico")))) {
		switch (0) {
			default:
			{
				gchar* _tmp20_;
				_tmp20_ = g_strdup (_ ("Sega Pico"));
				result = _tmp20_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label17) ? _tmp2_label17 : (_tmp2_label17 = g_quark_from_static_string ("SG1000")))) {
		switch (0) {
			default:
			{
				gchar* _tmp21_;
				_tmp21_ = g_strdup (_ ("SG-1000"));
				result = _tmp21_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label18) ? _tmp2_label18 : (_tmp2_label18 = g_quark_from_static_string ("SuperNintendoEntertainmentSystem")))) {
		switch (0) {
			default:
			{
				gchar* _tmp22_;
				_tmp22_ = g_strdup (_ ("Super Nintendo Entertainment System"));
				result = _tmp22_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label19) ? _tmp2_label19 : (_tmp2_label19 = g_quark_from_static_string ("TurboGrafx16")))) {
		switch (0) {
			default:
			{
				gchar* _tmp23_;
				_tmp23_ = g_strdup (_ ("TurboGrafx-16"));
				result = _tmp23_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label20) ? _tmp2_label20 : (_tmp2_label20 = g_quark_from_static_string ("WiiWare")))) {
		switch (0) {
			default:
			{
				gchar* _tmp24_;
				_tmp24_ = g_strdup (_ ("WiiWare"));
				result = _tmp24_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label21) ? _tmp2_label21 : (_tmp2_label21 = g_quark_from_static_string ("WonderSwan")))) {
		switch (0) {
			default:
			{
				gchar* _tmp25_;
				_tmp25_ = g_strdup (_ ("WonderSwan"));
				result = _tmp25_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label22) ? _tmp2_label22 : (_tmp2_label22 = g_quark_from_static_string ("WonderSwanColor")))) {
		switch (0) {
			default:
			{
				gchar* _tmp26_;
				_tmp26_ = g_strdup (_ ("WonderSwan Color"));
				result = _tmp26_;
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				result = NULL;
				return result;
			}
		}
	}
}

void
games_retro_simple_type_copy (const GamesRetroSimpleType* self,
                              GamesRetroSimpleType* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	_tmp0_ = (*self).mime_type;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).mime_type);
	(*dest).mime_type = _tmp1_;
	(*dest).search_mime_type = (*self).search_mime_type;
	_tmp2_ = (*self).platform;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 ((*dest).platform);
	(*dest).platform = _tmp3_;
	_tmp4_ = (*self).prefix;
	_tmp5_ = g_strdup (_tmp4_);
	_g_free0 ((*dest).prefix);
	(*dest).prefix = _tmp5_;
}

void
games_retro_simple_type_destroy (GamesRetroSimpleType* self)
{
	_g_free0 ((*self).mime_type);
	_g_free0 ((*self).platform);
	_g_free0 ((*self).prefix);
}

GamesRetroSimpleType*
games_retro_simple_type_dup (const GamesRetroSimpleType* self)
{
	GamesRetroSimpleType* dup;
	dup = g_new0 (GamesRetroSimpleType, 1);
	games_retro_simple_type_copy (self, dup);
	return dup;
}

void
games_retro_simple_type_free (GamesRetroSimpleType* self)
{
	games_retro_simple_type_destroy (self);
	g_free (self);
}

static GType
games_retro_simple_type_get_type_once (void)
{
	GType games_retro_simple_type_type_id;
	games_retro_simple_type_type_id = g_boxed_type_register_static ("GamesRetroSimpleType", (GBoxedCopyFunc) games_retro_simple_type_dup, (GBoxedFreeFunc) games_retro_simple_type_free);
	return games_retro_simple_type_type_id;
}

GType
games_retro_simple_type_get_type (void)
{
	static volatile gsize games_retro_simple_type_type_id__once = 0;
	if (g_once_init_enter (&games_retro_simple_type_type_id__once)) {
		GType games_retro_simple_type_type_id;
		games_retro_simple_type_type_id = games_retro_simple_type_get_type_once ();
		g_once_init_leave (&games_retro_simple_type_type_id__once, games_retro_simple_type_type_id);
	}
	return games_retro_simple_type_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

