/* functions.c generated by valac 0.20.1.52-2186, the Vala compiler
 * generated from functions.vala, do not modify */

/* functions.vala
 *
 * Copyright (C) 2009  Didier Villevalois, Maciej Piechotka
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library 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
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Didier 'Ptitjes' Villevalois <ptitjes@free.fr>
 * 	Maciej Piechotka <uzytkownik2@gmail.com>
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>


#define GEE_TYPE_HASHABLE (gee_hashable_get_type ())
#define GEE_HASHABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_HASHABLE, GeeHashable))
#define GEE_IS_HASHABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_HASHABLE))
#define GEE_HASHABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_HASHABLE, GeeHashableIface))

typedef struct _GeeHashable GeeHashable;
typedef struct _GeeHashableIface GeeHashableIface;

#define GEE_TYPE_COMPARABLE (gee_comparable_get_type ())
#define GEE_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COMPARABLE, GeeComparable))
#define GEE_IS_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COMPARABLE))
#define GEE_COMPARABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COMPARABLE, GeeComparableIface))

typedef struct _GeeComparable GeeComparable;
typedef struct _GeeComparableIface GeeComparableIface;

typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data);
struct _GeeHashableIface {
	GTypeInterface parent_iface;
	guint (*hash) (GeeHashable* self);
	gboolean (*equal_to) (GeeHashable* self, gconstpointer object);
};

struct _GeeComparableIface {
	GTypeInterface parent_iface;
	gint (*compare_to) (GeeComparable* self, gconstpointer object);
};

typedef guint (*GeeHashDataFunc) (gconstpointer v, void* user_data);


GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify);
static gboolean ___lambda22_ (gconstpointer a, gconstpointer b);
static gboolean ____lambda22__gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self);
GType gee_hashable_get_type (void) G_GNUC_CONST;
static gboolean ____lambda23_ (gconstpointer a, gconstpointer b);
gboolean gee_hashable_equal_to (GeeHashable* self, gconstpointer object);
static gboolean _____lambda23__gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self);
GType gee_comparable_get_type (void) G_GNUC_CONST;
static gboolean _____lambda24_ (gconstpointer a, gconstpointer b);
gint gee_comparable_compare_to (GeeComparable* self, gconstpointer object);
static gboolean ______lambda24__gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self);
static gboolean _____lambda25_ (gconstpointer a, gconstpointer b);
static gboolean ______lambda25__gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self);
GeeHashDataFunc gee_functions_get_hash_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify);
static guint ___lambda19_ (gconstpointer a);
static guint ____lambda19__gee_hash_data_func (gconstpointer v, gpointer self);
static guint ____lambda20_ (gconstpointer a);
guint gee_hashable_hash (GeeHashable* self);
static guint _____lambda20__gee_hash_data_func (gconstpointer v, gpointer self);
static guint ____lambda21_ (gconstpointer a);
static guint _____lambda21__gee_hash_data_func (gconstpointer v, gpointer self);
GCompareDataFunc gee_functions_get_compare_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify);
static gint ___lambda26_ (gconstpointer a, gconstpointer b);
static gint ____lambda26__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
static gint ____lambda27_ (gconstpointer a, gconstpointer b);
static gint _____lambda27__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
static gint ____lambda28_ (gconstpointer _val1, gconstpointer _val2);
static gint _____lambda28__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);


/**
 * Get a equality testing function for a given type.
 *
 * @param t the type which to get an equality testing function for.
 *
 * @return the equality testing function corresponding to the given type.
 */
static gboolean ___lambda22_ (gconstpointer a, gconstpointer b) {
	gboolean result = FALSE;
	gconstpointer _tmp0_ = NULL;
	gconstpointer _tmp1_ = NULL;
	_tmp0_ = a;
	_tmp1_ = b;
	if (_tmp0_ == _tmp1_) {
		result = TRUE;
		return result;
	} else {
		gboolean _tmp2_ = FALSE;
		gconstpointer _tmp3_ = NULL;
		gboolean _tmp5_ = FALSE;
		_tmp3_ = a;
		if (_tmp3_ == NULL) {
			_tmp2_ = TRUE;
		} else {
			gconstpointer _tmp4_ = NULL;
			_tmp4_ = b;
			_tmp2_ = _tmp4_ == NULL;
		}
		_tmp5_ = _tmp2_;
		if (_tmp5_) {
			result = FALSE;
			return result;
		} else {
			GEqualFunc _tmp6_ = NULL;
			gconstpointer _tmp7_ = NULL;
			gconstpointer _tmp8_ = NULL;
			gboolean _tmp9_ = FALSE;
			_tmp6_ = g_str_equal;
			_tmp7_ = a;
			_tmp8_ = b;
			_tmp9_ = _tmp6_ ((const gchar*) _tmp7_, (const gchar*) _tmp8_);
			result = _tmp9_;
			return result;
		}
	}
}


static gboolean ____lambda22__gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gboolean result;
	result = ___lambda22_ (a, b);
	return result;
}


static gboolean ____lambda23_ (gconstpointer a, gconstpointer b) {
	gboolean result = FALSE;
	gconstpointer _tmp0_ = NULL;
	gconstpointer _tmp1_ = NULL;
	_tmp0_ = a;
	_tmp1_ = b;
	if (_tmp0_ == _tmp1_) {
		result = TRUE;
		return result;
	} else {
		gboolean _tmp2_ = FALSE;
		gconstpointer _tmp3_ = NULL;
		gboolean _tmp5_ = FALSE;
		_tmp3_ = a;
		if (_tmp3_ == NULL) {
			_tmp2_ = TRUE;
		} else {
			gconstpointer _tmp4_ = NULL;
			_tmp4_ = b;
			_tmp2_ = _tmp4_ == NULL;
		}
		_tmp5_ = _tmp2_;
		if (_tmp5_) {
			result = FALSE;
			return result;
		} else {
			gconstpointer _tmp6_ = NULL;
			gconstpointer _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			_tmp6_ = a;
			_tmp7_ = b;
			_tmp8_ = gee_hashable_equal_to (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_HASHABLE, GeeHashable), G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_HASHABLE, GeeHashable));
			result = _tmp8_;
			return result;
		}
	}
}


static gboolean _____lambda23__gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gboolean result;
	result = ____lambda23_ (a, b);
	return result;
}


static gboolean _____lambda24_ (gconstpointer a, gconstpointer b) {
	gboolean result = FALSE;
	gconstpointer _tmp0_ = NULL;
	gconstpointer _tmp1_ = NULL;
	_tmp0_ = a;
	_tmp1_ = b;
	if (_tmp0_ == _tmp1_) {
		result = TRUE;
		return result;
	} else {
		gboolean _tmp2_ = FALSE;
		gconstpointer _tmp3_ = NULL;
		gboolean _tmp5_ = FALSE;
		_tmp3_ = a;
		if (_tmp3_ == NULL) {
			_tmp2_ = TRUE;
		} else {
			gconstpointer _tmp4_ = NULL;
			_tmp4_ = b;
			_tmp2_ = _tmp4_ == NULL;
		}
		_tmp5_ = _tmp2_;
		if (_tmp5_) {
			result = FALSE;
			return result;
		} else {
			gconstpointer _tmp6_ = NULL;
			gconstpointer _tmp7_ = NULL;
			gint _tmp8_ = 0;
			_tmp6_ = a;
			_tmp7_ = b;
			_tmp8_ = gee_comparable_compare_to (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_COMPARABLE, GeeComparable), G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_COMPARABLE, GeeComparable));
			result = _tmp8_ == 0;
			return result;
		}
	}
}


static gboolean ______lambda24__gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gboolean result;
	result = _____lambda24_ (a, b);
	return result;
}


static gboolean _____lambda25_ (gconstpointer a, gconstpointer b) {
	gboolean result = FALSE;
	GEqualFunc _tmp0_ = NULL;
	gconstpointer _tmp1_ = NULL;
	gconstpointer _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	_tmp0_ = g_direct_equal;
	_tmp1_ = a;
	_tmp2_ = b;
	_tmp3_ = _tmp0_ (_tmp1_, _tmp2_);
	result = _tmp3_;
	return result;
}


static gboolean ______lambda25__gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gboolean result;
	result = _____lambda25_ (a, b);
	return result;
}


GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify) {
	GeeEqualDataFunc result = NULL;
	GType _tmp0_ = 0UL;
	_tmp0_ = t;
	if (_tmp0_ == G_TYPE_STRING) {
		GeeEqualDataFunc _tmp1_ = NULL;
		void* _tmp1__target = NULL;
		GDestroyNotify _tmp1__target_destroy_notify = NULL;
		_tmp1_ = ____lambda22__gee_equal_data_func;
		_tmp1__target = NULL;
		_tmp1__target_destroy_notify = NULL;
		*result_target = _tmp1__target;
		*result_target_destroy_notify = _tmp1__target_destroy_notify;
		result = _tmp1_;
		return result;
	} else {
		GType _tmp2_ = 0UL;
		gboolean _tmp3_ = FALSE;
		_tmp2_ = t;
		_tmp3_ = g_type_is_a (_tmp2_, GEE_TYPE_HASHABLE);
		if (_tmp3_) {
			GeeEqualDataFunc _tmp4_ = NULL;
			void* _tmp4__target = NULL;
			GDestroyNotify _tmp4__target_destroy_notify = NULL;
			_tmp4_ = _____lambda23__gee_equal_data_func;
			_tmp4__target = NULL;
			_tmp4__target_destroy_notify = NULL;
			*result_target = _tmp4__target;
			*result_target_destroy_notify = _tmp4__target_destroy_notify;
			result = _tmp4_;
			return result;
		} else {
			GType _tmp5_ = 0UL;
			gboolean _tmp6_ = FALSE;
			_tmp5_ = t;
			_tmp6_ = g_type_is_a (_tmp5_, GEE_TYPE_COMPARABLE);
			if (_tmp6_) {
				GeeEqualDataFunc _tmp7_ = NULL;
				void* _tmp7__target = NULL;
				GDestroyNotify _tmp7__target_destroy_notify = NULL;
				_tmp7_ = ______lambda24__gee_equal_data_func;
				_tmp7__target = NULL;
				_tmp7__target_destroy_notify = NULL;
				*result_target = _tmp7__target;
				*result_target_destroy_notify = _tmp7__target_destroy_notify;
				result = _tmp7_;
				return result;
			} else {
				GeeEqualDataFunc _tmp8_ = NULL;
				void* _tmp8__target = NULL;
				GDestroyNotify _tmp8__target_destroy_notify = NULL;
				_tmp8_ = ______lambda25__gee_equal_data_func;
				_tmp8__target = NULL;
				_tmp8__target_destroy_notify = NULL;
				*result_target = _tmp8__target;
				*result_target_destroy_notify = _tmp8__target_destroy_notify;
				result = _tmp8_;
				return result;
			}
		}
	}
}


/**
 * Get a hash function for a given type.
 *
 * @param t the type which to get the hash function for.
 *
 * @return the hash function corresponding to the given type.
 */
static guint ___lambda19_ (gconstpointer a) {
	guint result = 0U;
	gconstpointer _tmp0_ = NULL;
	_tmp0_ = a;
	if (_tmp0_ == NULL) {
		result = (guint) 0xdeadbeefLL;
		return result;
	} else {
		GHashFunc _tmp1_ = NULL;
		gconstpointer _tmp2_ = NULL;
		guint _tmp3_ = 0U;
		_tmp1_ = g_str_hash;
		_tmp2_ = a;
		_tmp3_ = _tmp1_ ((const gchar*) _tmp2_);
		result = _tmp3_;
		return result;
	}
}


static guint ____lambda19__gee_hash_data_func (gconstpointer v, gpointer self) {
	guint result;
	result = ___lambda19_ (v);
	return result;
}


static guint ____lambda20_ (gconstpointer a) {
	guint result = 0U;
	gconstpointer _tmp0_ = NULL;
	_tmp0_ = a;
	if (_tmp0_ == NULL) {
		result = (guint) 0xdeadbeefLL;
		return result;
	} else {
		gconstpointer _tmp1_ = NULL;
		guint _tmp2_ = 0U;
		_tmp1_ = a;
		_tmp2_ = gee_hashable_hash (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_HASHABLE, GeeHashable));
		result = _tmp2_;
		return result;
	}
}


static guint _____lambda20__gee_hash_data_func (gconstpointer v, gpointer self) {
	guint result;
	result = ____lambda20_ (v);
	return result;
}


static guint ____lambda21_ (gconstpointer a) {
	guint result = 0U;
	GHashFunc _tmp0_ = NULL;
	gconstpointer _tmp1_ = NULL;
	guint _tmp2_ = 0U;
	_tmp0_ = g_direct_hash;
	_tmp1_ = a;
	_tmp2_ = _tmp0_ (_tmp1_);
	result = _tmp2_;
	return result;
}


static guint _____lambda21__gee_hash_data_func (gconstpointer v, gpointer self) {
	guint result;
	result = ____lambda21_ (v);
	return result;
}


GeeHashDataFunc gee_functions_get_hash_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify) {
	GeeHashDataFunc result = NULL;
	GType _tmp0_ = 0UL;
	_tmp0_ = t;
	if (_tmp0_ == G_TYPE_STRING) {
		GeeHashDataFunc _tmp1_ = NULL;
		void* _tmp1__target = NULL;
		GDestroyNotify _tmp1__target_destroy_notify = NULL;
		_tmp1_ = ____lambda19__gee_hash_data_func;
		_tmp1__target = NULL;
		_tmp1__target_destroy_notify = NULL;
		*result_target = _tmp1__target;
		*result_target_destroy_notify = _tmp1__target_destroy_notify;
		result = _tmp1_;
		return result;
	} else {
		GType _tmp2_ = 0UL;
		gboolean _tmp3_ = FALSE;
		_tmp2_ = t;
		_tmp3_ = g_type_is_a (_tmp2_, GEE_TYPE_HASHABLE);
		if (_tmp3_) {
			GeeHashDataFunc _tmp4_ = NULL;
			void* _tmp4__target = NULL;
			GDestroyNotify _tmp4__target_destroy_notify = NULL;
			_tmp4_ = _____lambda20__gee_hash_data_func;
			_tmp4__target = NULL;
			_tmp4__target_destroy_notify = NULL;
			*result_target = _tmp4__target;
			*result_target_destroy_notify = _tmp4__target_destroy_notify;
			result = _tmp4_;
			return result;
		} else {
			GeeHashDataFunc _tmp5_ = NULL;
			void* _tmp5__target = NULL;
			GDestroyNotify _tmp5__target_destroy_notify = NULL;
			_tmp5_ = _____lambda21__gee_hash_data_func;
			_tmp5__target = NULL;
			_tmp5__target_destroy_notify = NULL;
			*result_target = _tmp5__target;
			*result_target_destroy_notify = _tmp5__target_destroy_notify;
			result = _tmp5_;
			return result;
		}
	}
}


/**
 * Get a comparator function for a given type.
 *
 * @param t the type which to get a comparator function for.
 *
 * @return the comparator function corresponding to the given type.
 */
static gint ___lambda26_ (gconstpointer a, gconstpointer b) {
	gint result = 0;
	gconstpointer _tmp0_ = NULL;
	gconstpointer _tmp1_ = NULL;
	_tmp0_ = a;
	_tmp1_ = b;
	if (_tmp0_ == _tmp1_) {
		result = 0;
		return result;
	} else {
		gconstpointer _tmp2_ = NULL;
		_tmp2_ = a;
		if (_tmp2_ == NULL) {
			result = -1;
			return result;
		} else {
			gconstpointer _tmp3_ = NULL;
			_tmp3_ = b;
			if (_tmp3_ == NULL) {
				result = 1;
				return result;
			} else {
				GCompareFunc _tmp4_ = NULL;
				gconstpointer _tmp5_ = NULL;
				gconstpointer _tmp6_ = NULL;
				gint _tmp7_ = 0;
				_tmp4_ = g_strcmp0;
				_tmp5_ = a;
				_tmp6_ = b;
				_tmp7_ = _tmp4_ ((const gchar*) _tmp5_, (const gchar*) _tmp6_);
				result = _tmp7_;
				return result;
			}
		}
	}
}


static gint ____lambda26__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gint result;
	result = ___lambda26_ (a, b);
	return result;
}


static gint ____lambda27_ (gconstpointer a, gconstpointer b) {
	gint result = 0;
	gconstpointer _tmp0_ = NULL;
	gconstpointer _tmp1_ = NULL;
	_tmp0_ = a;
	_tmp1_ = b;
	if (_tmp0_ == _tmp1_) {
		result = 0;
		return result;
	} else {
		gconstpointer _tmp2_ = NULL;
		_tmp2_ = a;
		if (_tmp2_ == NULL) {
			result = -1;
			return result;
		} else {
			gconstpointer _tmp3_ = NULL;
			_tmp3_ = b;
			if (_tmp3_ == NULL) {
				result = 1;
				return result;
			} else {
				gconstpointer _tmp4_ = NULL;
				gconstpointer _tmp5_ = NULL;
				gint _tmp6_ = 0;
				_tmp4_ = a;
				_tmp5_ = b;
				_tmp6_ = gee_comparable_compare_to (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_COMPARABLE, GeeComparable), G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_COMPARABLE, GeeComparable));
				result = _tmp6_;
				return result;
			}
		}
	}
}


static gint _____lambda27__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gint result;
	result = ____lambda27_ (a, b);
	return result;
}


static gint ____lambda28_ (gconstpointer _val1, gconstpointer _val2) {
	gint result = 0;
	glong val1 = 0L;
	gconstpointer _tmp0_ = NULL;
	glong val2 = 0L;
	gconstpointer _tmp1_ = NULL;
	glong _tmp2_ = 0L;
	glong _tmp3_ = 0L;
	_tmp0_ = _val1;
	val1 = (glong) _tmp0_;
	_tmp1_ = _val2;
	val2 = (glong) _tmp1_;
	_tmp2_ = val1;
	_tmp3_ = val2;
	if (_tmp2_ > _tmp3_) {
		result = 1;
		return result;
	} else {
		glong _tmp4_ = 0L;
		glong _tmp5_ = 0L;
		_tmp4_ = val1;
		_tmp5_ = val2;
		if (_tmp4_ == _tmp5_) {
			result = 0;
			return result;
		} else {
			result = -1;
			return result;
		}
	}
}


static gint _____lambda28__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gint result;
	result = ____lambda28_ (a, b);
	return result;
}


GCompareDataFunc gee_functions_get_compare_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify) {
	GCompareDataFunc result = NULL;
	GType _tmp0_ = 0UL;
	_tmp0_ = t;
	if (_tmp0_ == G_TYPE_STRING) {
		GCompareDataFunc _tmp1_ = NULL;
		void* _tmp1__target = NULL;
		GDestroyNotify _tmp1__target_destroy_notify = NULL;
		_tmp1_ = ____lambda26__gcompare_data_func;
		_tmp1__target = NULL;
		_tmp1__target_destroy_notify = NULL;
		*result_target = _tmp1__target;
		*result_target_destroy_notify = _tmp1__target_destroy_notify;
		result = _tmp1_;
		return result;
	} else {
		GType _tmp2_ = 0UL;
		gboolean _tmp3_ = FALSE;
		_tmp2_ = t;
		_tmp3_ = g_type_is_a (_tmp2_, GEE_TYPE_COMPARABLE);
		if (_tmp3_) {
			GCompareDataFunc _tmp4_ = NULL;
			void* _tmp4__target = NULL;
			GDestroyNotify _tmp4__target_destroy_notify = NULL;
			_tmp4_ = _____lambda27__gcompare_data_func;
			_tmp4__target = NULL;
			_tmp4__target_destroy_notify = NULL;
			*result_target = _tmp4__target;
			*result_target_destroy_notify = _tmp4__target_destroy_notify;
			result = _tmp4_;
			return result;
		} else {
			GCompareDataFunc _tmp5_ = NULL;
			void* _tmp5__target = NULL;
			GDestroyNotify _tmp5__target_destroy_notify = NULL;
			_tmp5_ = _____lambda28__gcompare_data_func;
			_tmp5__target = NULL;
			_tmp5__target_destroy_notify = NULL;
			*result_target = _tmp5__target;
			*result_target_destroy_notify = _tmp5__target_destroy_notify;
			result = _tmp5_;
			return result;
		}
	}
}



