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

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

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "config.h"
#include <grilo.h>
#include <glib-object.h>
#include <gio/gio.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 _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

static gint _vala_main (gchar** args,
                 gint args_length1);
VALA_EXTERN GamesApplication* games_application_new (void);
VALA_EXTERN GamesApplication* games_application_construct (GType object_type);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static gint
_vala_main (gchar** args,
            gint args_length1)
{
	gchar** empty_args = NULL;
	gchar** _tmp0_;
	gint empty_args_length1;
	gint _empty_args_size_;
	gchar** unowned_args = NULL;
	gint unowned_args_length1;
	gint _unowned_args_size_;
	GamesApplication* app = NULL;
	GamesApplication* _tmp1_;
	gint _result_ = 0;
	gint result;
	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
	textdomain (GETTEXT_PACKAGE);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	empty_args = _tmp0_;
	empty_args_length1 = 0;
	_empty_args_size_ = empty_args_length1;
	unowned_args = empty_args;
	unowned_args_length1 = empty_args_length1;
	_unowned_args_size_ = unowned_args_length1;
	grl_init ((gint*) (&unowned_args_length1), &unowned_args);
	_unowned_args_size_ = unowned_args_length1;
	g_type_ensure (g_themed_icon_get_type ());
	_tmp1_ = games_application_new ();
	app = _tmp1_;
	_result_ = g_application_run ((GApplication*) app, (gint) args_length1, args);
	grl_deinit ();
	result = _result_;
	_g_object_unref0 (app);
	empty_args = (_vala_array_free (empty_args, empty_args_length1, (GDestroyNotify) g_free), NULL);
	return result;
}

int
main (int argc,
      char ** argv)
{
	return _vala_main (argv, argc);
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

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;
}

