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

/*
* Copyright 2013-2017 elementary, Inc. (https://elementary.io)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* Authored by: Julien Spautz <spautz.julien@gmail.com>
*/

#include "applications.h"
#include <glib.h>
#include <stdlib.h>
#include <string.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_free0(var) (var = (g_free (var), NULL))

gboolean
startup_entity_app_info_equal (StartupEntityAppInfo *self,
                               StartupEntityAppInfo* other_app_info)
{
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	StartupEntityAppInfo _tmp2_;
	const gchar* _tmp3_;
	gboolean result;
	g_return_val_if_fail (other_app_info != NULL, FALSE);
	_tmp1_ = (*self).name;
	_tmp2_ = *other_app_info;
	_tmp3_ = _tmp2_.name;
	if (g_strcmp0 (_tmp1_, _tmp3_) == 0) {
		const gchar* _tmp4_;
		StartupEntityAppInfo _tmp5_;
		const gchar* _tmp6_;
		_tmp4_ = (*self).path;
		_tmp5_ = *other_app_info;
		_tmp6_ = _tmp5_.path;
		_tmp0_ = g_strcmp0 (_tmp4_, _tmp6_) == 0;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

void
startup_entity_app_info_copy (const StartupEntityAppInfo* self,
                              StartupEntityAppInfo* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	_tmp0_ = (*self).name;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).name);
	(*dest).name = _tmp1_;
	_tmp2_ = (*self).comment;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 ((*dest).comment);
	(*dest).comment = _tmp3_;
	_tmp4_ = (*self).icon;
	_tmp5_ = g_strdup (_tmp4_);
	_g_free0 ((*dest).icon);
	(*dest).icon = _tmp5_;
	(*dest).active = (*self).active;
	_tmp6_ = (*self).path;
	_tmp7_ = g_strdup (_tmp6_);
	_g_free0 ((*dest).path);
	(*dest).path = _tmp7_;
}

void
startup_entity_app_info_destroy (StartupEntityAppInfo* self)
{
	_g_free0 ((*self).name);
	_g_free0 ((*self).comment);
	_g_free0 ((*self).icon);
	_g_free0 ((*self).path);
}

StartupEntityAppInfo*
startup_entity_app_info_dup (const StartupEntityAppInfo* self)
{
	StartupEntityAppInfo* dup;
	dup = g_new0 (StartupEntityAppInfo, 1);
	startup_entity_app_info_copy (self, dup);
	return dup;
}

void
startup_entity_app_info_free (StartupEntityAppInfo* self)
{
	startup_entity_app_info_destroy (self);
	g_free (self);
}

static GType
startup_entity_app_info_get_type_once (void)
{
	GType startup_entity_app_info_type_id;
	startup_entity_app_info_type_id = g_boxed_type_register_static ("StartupEntityAppInfo", (GBoxedCopyFunc) startup_entity_app_info_dup, (GBoxedFreeFunc) startup_entity_app_info_free);
	return startup_entity_app_info_type_id;
}

GType
startup_entity_app_info_get_type (void)
{
	static volatile gsize startup_entity_app_info_type_id__once = 0;
	if (g_once_init_enter (&startup_entity_app_info_type_id__once)) {
		GType startup_entity_app_info_type_id;
		startup_entity_app_info_type_id = startup_entity_app_info_get_type_once ();
		g_once_init_leave (&startup_entity_app_info_type_id__once, startup_entity_app_info_type_id);
	}
	return startup_entity_app_info_type_id__once;
}

