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

/*
 * Copyright (C) 2013-2017 elementary Developers
 *
 * 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, see <http://www.gnu.org/licenses/>.
 */

#include <glib-object.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define CONTRACTOR_TYPE_CONTRACT (contractor_contract_get_type ())
#define CONTRACTOR_CONTRACT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTRACTOR_TYPE_CONTRACT, ContractorContract))
#define CONTRACTOR_CONTRACT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTRACTOR_TYPE_CONTRACT, ContractorContractClass))
#define CONTRACTOR_IS_CONTRACT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTRACTOR_TYPE_CONTRACT))
#define CONTRACTOR_IS_CONTRACT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTRACTOR_TYPE_CONTRACT))
#define CONTRACTOR_CONTRACT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTRACTOR_TYPE_CONTRACT, ContractorContractClass))

typedef struct _ContractorContract ContractorContract;
typedef struct _ContractorContractClass ContractorContractClass;
#define _g_free0(var) (var = (g_free (var), NULL))

VALA_EXTERN GType contractor_contract_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ContractorContract, g_object_unref)
VALA_EXTERN gint contractor_contract_sorter_compare_func (ContractorContract* a,
                                              ContractorContract* b);
VALA_EXTERN const gchar* contractor_contract_get_name (ContractorContract* self);

gint
contractor_contract_sorter_compare_func (ContractorContract* a,
                                         ContractorContract* b)
{
	GCompareFunc _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gint _tmp10_;
	gint result;
	if (a == NULL) {
		gint _tmp0_ = 0;
		if (b == NULL) {
			_tmp0_ = 0;
		} else {
			_tmp0_ = -1;
		}
		result = _tmp0_;
		return result;
	}
	if (b == NULL) {
		result = 1;
		return result;
	}
	_tmp1_ = ((GCompareFunc) g_strcmp0);
	_tmp2_ = contractor_contract_get_name (a);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_utf8_collate_key (_tmp3_, (gssize) -1);
	_tmp5_ = _tmp4_;
	_tmp6_ = contractor_contract_get_name (b);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_utf8_collate_key (_tmp7_, (gssize) -1);
	_tmp9_ = _tmp8_;
	_tmp10_ = _tmp1_ (_tmp5_, _tmp9_);
	_g_free0 (_tmp9_);
	_g_free0 (_tmp5_);
	result = _tmp10_;
	return result;
}

