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

/*
 * Copyright (C) 2011 Collabora Ltd.
 *
 * 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, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *       Raul Gutierrez Segales <raul.gutierrez.segales@collabora.co.uk>
 */

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


#define FOLKS_TYPE_UTILS (folks_utils_get_type ())
#define FOLKS_UTILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_TYPE_UTILS, FolksUtils))
#define FOLKS_UTILS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_TYPE_UTILS, FolksUtilsClass))
#define FOLKS_IS_UTILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_TYPE_UTILS))
#define FOLKS_IS_UTILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_TYPE_UTILS))
#define FOLKS_UTILS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_TYPE_UTILS, FolksUtilsClass))

typedef struct _FolksUtils FolksUtils;
typedef struct _FolksUtilsClass FolksUtilsClass;
typedef struct _FolksUtilsPrivate FolksUtilsPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _FolksUtils {
	GObject parent_instance;
	FolksUtilsPrivate * priv;
};

struct _FolksUtilsClass {
	GObjectClass parent_class;
};


static gpointer folks_utils_parent_class = NULL;

GType folks_utils_get_type (void) G_GNUC_CONST;
enum  {
	FOLKS_UTILS_DUMMY_PROPERTY
};
gboolean _folks_utils_str_equal_safe (const gchar* a, const gchar* b);
FolksUtils* folks_utils_new (void);
FolksUtils* folks_utils_construct (GType object_type);


gboolean _folks_utils_str_equal_safe (const gchar* a, const gchar* b) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	g_return_val_if_fail (a != NULL, FALSE);
	g_return_val_if_fail (b != NULL, FALSE);
	if (g_strcmp0 (a, "") != 0) {
		_tmp1_ = g_strcmp0 (b, "") != 0;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_;
		_tmp2_ = g_utf8_strdown (a, (gssize) (-1));
		_tmp3_ = _tmp2_;
		_tmp4_ = g_utf8_strdown (b, (gssize) (-1));
		_tmp5_ = _tmp4_;
		_tmp0_ = g_strcmp0 (_tmp3_, _tmp5_) == 0;
		_g_free0 (_tmp5_);
		_g_free0 (_tmp3_);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}


FolksUtils* folks_utils_construct (GType object_type) {
	FolksUtils * self = NULL;
	self = (FolksUtils*) g_object_new (object_type, NULL);
	return self;
}


FolksUtils* folks_utils_new (void) {
	return folks_utils_construct (FOLKS_TYPE_UTILS);
}


static void folks_utils_class_init (FolksUtilsClass * klass) {
	folks_utils_parent_class = g_type_class_peek_parent (klass);
}


static void folks_utils_instance_init (FolksUtils * self) {
}


GType folks_utils_get_type (void) {
	static volatile gsize folks_utils_type_id__volatile = 0;
	if (g_once_init_enter (&folks_utils_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (FolksUtilsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) folks_utils_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FolksUtils), 0, (GInstanceInitFunc) folks_utils_instance_init, NULL };
		GType folks_utils_type_id;
		folks_utils_type_id = g_type_register_static (G_TYPE_OBJECT, "FolksUtils", &g_define_type_info, 0);
		g_once_init_leave (&folks_utils_type_id__volatile, folks_utils_type_id);
	}
	return folks_utils_type_id__volatile;
}



