/* tracker-history.c generated by valac 0.35.1.15-f996c-dirty, the Vala compiler
 * generated from tracker-history.vala, do not modify */

/**/
/* Copyright 2010, Martyn Russell <martyn@lanedo.com>*/
/**/
/* 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 2*/
/* 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.*/
/**/

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gstdio.h>
#include <gobject/gvaluecollector.h>


#define TRACKER_TYPE_HISTORY (tracker_history_get_type ())
#define TRACKER_HISTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRACKER_TYPE_HISTORY, TrackerHistory))
#define TRACKER_HISTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRACKER_TYPE_HISTORY, TrackerHistoryClass))
#define TRACKER_IS_HISTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRACKER_TYPE_HISTORY))
#define TRACKER_IS_HISTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRACKER_TYPE_HISTORY))
#define TRACKER_HISTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRACKER_TYPE_HISTORY, TrackerHistoryClass))

typedef struct _TrackerHistory TrackerHistory;
typedef struct _TrackerHistoryClass TrackerHistoryClass;
typedef struct _TrackerHistoryPrivate TrackerHistoryPrivate;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_key_file_unref0(var) ((var == NULL) ? NULL : (var = (g_key_file_unref (var), NULL)))
typedef struct _TrackerParamSpecHistory TrackerParamSpecHistory;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _TrackerHistory {
	GTypeInstance parent_instance;
	volatile int ref_count;
	TrackerHistoryPrivate * priv;
};

struct _TrackerHistoryClass {
	GTypeClass parent_class;
	void (*finalize) (TrackerHistory *self);
};

struct _TrackerHistoryPrivate {
	GKeyFile* data;
	gchar* filename;
	gchar** history;
	gint history_length1;
	gint _history_size_;
};

struct _TrackerParamSpecHistory {
	GParamSpec parent_instance;
};


static gpointer tracker_history_parent_class = NULL;

gpointer tracker_history_ref (gpointer instance);
void tracker_history_unref (gpointer instance);
GParamSpec* tracker_param_spec_history (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void tracker_value_set_history (GValue* value, gpointer v_object);
void tracker_value_take_history (GValue* value, gpointer v_object);
gpointer tracker_value_get_history (const GValue* value);
GType tracker_history_get_type (void) G_GNUC_CONST;
#define TRACKER_HISTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_HISTORY, TrackerHistoryPrivate))
enum  {
	TRACKER_HISTORY_DUMMY_PROPERTY
};
TrackerHistory* tracker_history_new (void);
TrackerHistory* tracker_history_construct (GType object_type);
void tracker_history_add (TrackerHistory* self, const gchar* criteria);
static void _vala_array_add1 (gchar** * array, int* length, int* size, gchar* value);
gchar** tracker_history_get (TrackerHistory* self, int* result_length1);
static gchar** _vala_array_dup1 (gchar** self, int length);
static void tracker_history_finalize (TrackerHistory * obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


TrackerHistory* tracker_history_construct (GType object_type) {
	TrackerHistory* self = NULL;
	GKeyFile* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	GKeyFile* _tmp14_;
	gboolean _tmp15_;
	gchar** _tmp24_;
	gint _tmp24__length1;
	GError * _inner_error_ = NULL;
#line 25 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	self = (TrackerHistory*) g_type_create_instance (object_type);
#line 26 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_debug ("tracker-history.vala:26: Loading history");
#line 28 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp0_ = g_key_file_new ();
#line 28 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_g_key_file_unref0 (self->priv->data);
#line 28 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	self->priv->data = _tmp0_;
#line 29 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp1_ = g_get_user_data_dir ();
#line 29 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp2_ = g_build_filename (_tmp1_, "tracker", "tracker-needle.txt", NULL, NULL);
#line 29 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_free (self->priv->filename);
#line 29 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	self->priv->filename = _tmp2_;
#line 126 "tracker-history.c"
	{
		GKeyFile* _tmp3_;
		const gchar* _tmp4_;
#line 32 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp3_ = self->priv->data;
#line 32 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp4_ = self->priv->filename;
#line 32 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_key_file_load_from_file (_tmp3_, _tmp4_, G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS, &_inner_error_);
#line 32 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 32 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			if (_inner_error_->domain == G_KEY_FILE_ERROR) {
#line 140 "tracker-history.c"
				goto __catch1_g_key_file_error;
			}
#line 32 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			if (_inner_error_->domain == G_FILE_ERROR) {
#line 145 "tracker-history.c"
				goto __catch1_g_file_error;
			}
#line 32 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 32 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			g_clear_error (&_inner_error_);
#line 32 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			return NULL;
#line 154 "tracker-history.c"
		}
	}
	goto __finally1;
	__catch1_g_key_file_error:
	{
		GError* e1 = NULL;
		const gchar* _tmp5_;
		GError* _tmp6_;
		const gchar* _tmp7_;
#line 31 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		e1 = _inner_error_;
#line 31 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_inner_error_ = NULL;
#line 34 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp5_ = self->priv->filename;
#line 34 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp6_ = e1;
#line 34 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp7_ = _tmp6_->message;
#line 34 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_warning ("tracker-history.vala:34: Could not load history from file:'%s': %s", _tmp5_, _tmp7_);
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_g_error_free0 (e1);
#line 35 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		return self;
#line 180 "tracker-history.c"
	}
	goto __finally1;
	__catch1_g_file_error:
	{
		GError* e2 = NULL;
		GError* _tmp8_;
		gint _tmp9_;
#line 31 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		e2 = _inner_error_;
#line 31 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_inner_error_ = NULL;
#line 37 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp8_ = e2;
#line 37 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp9_ = _tmp8_->code;
#line 37 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		if (_tmp9_ == 4) {
#line 198 "tracker-history.c"
			const gchar* _tmp10_;
#line 38 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			_tmp10_ = self->priv->filename;
#line 38 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			g_message ("tracker-history.vala:38: Creating new history file:'%s'", _tmp10_);
#line 204 "tracker-history.c"
		} else {
			const gchar* _tmp11_;
			GError* _tmp12_;
			const gchar* _tmp13_;
#line 40 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			_tmp11_ = self->priv->filename;
#line 40 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			_tmp12_ = e2;
#line 40 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			_tmp13_ = _tmp12_->message;
#line 40 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			g_warning ("tracker-history.vala:40: Could not load history from file:'%s': %s", _tmp11_, _tmp13_);
#line 217 "tracker-history.c"
		}
#line 41 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_g_error_free0 (e2);
#line 41 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		return self;
#line 223 "tracker-history.c"
	}
	__finally1:
#line 31 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 31 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 31 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_clear_error (&_inner_error_);
#line 31 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		return NULL;
#line 234 "tracker-history.c"
	}
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp14_ = self->priv->data;
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp15_ = g_key_file_has_group (_tmp14_, "History");
#line 44 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	if (_tmp15_ == FALSE) {
#line 45 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_debug ("tracker-history.vala:45:   No history found");
#line 46 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		return self;
#line 246 "tracker-history.c"
	}
	{
		gchar** _tmp16_;
		GKeyFile* _tmp17_;
		gsize _tmp18_;
		gchar** _tmp19_;
		gint _tmp16__length1;
		gint __tmp16__size_;
		gchar** _tmp20_;
		gint _tmp20__length1;
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp17_ = self->priv->data;
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp19_ = g_key_file_get_string_list (_tmp17_, "History", "criteria", &_tmp18_, &_inner_error_);
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp16_ = _tmp19_;
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp16__length1 = _tmp18_;
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		__tmp16__size_ = _tmp16__length1;
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			if (_inner_error_->domain == G_KEY_FILE_ERROR) {
#line 271 "tracker-history.c"
				goto __catch2_g_key_file_error;
			}
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			g_clear_error (&_inner_error_);
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			return NULL;
#line 280 "tracker-history.c"
		}
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp20_ = _tmp16_;
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp20__length1 = _tmp16__length1;
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp16_ = NULL;
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp16__length1 = 0;
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		self->priv->history = (_vala_array_free (self->priv->history, self->priv->history_length1, (GDestroyNotify) g_free), NULL);
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		self->priv->history = _tmp20_;
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		self->priv->history_length1 = _tmp20__length1;
#line 50 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		self->priv->_history_size_ = self->priv->history_length1;
#line 49 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp16_ = (_vala_array_free (_tmp16_, _tmp16__length1, (GDestroyNotify) g_free), NULL);
#line 300 "tracker-history.c"
	}
	goto __finally2;
	__catch2_g_key_file_error:
	{
		GError* e1 = NULL;
		const gchar* _tmp21_;
		GError* _tmp22_;
		const gchar* _tmp23_;
#line 49 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		e1 = _inner_error_;
#line 49 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_inner_error_ = NULL;
#line 52 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp21_ = self->priv->filename;
#line 52 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp22_ = e1;
#line 52 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp23_ = _tmp22_->message;
#line 52 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_warning ("tracker-history.vala:52: Could not load history from file:'%s': %s", _tmp21_, _tmp23_);
#line 53 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_g_error_free0 (e1);
#line 53 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		return self;
#line 325 "tracker-history.c"
	}
	__finally2:
#line 49 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 49 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 49 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_clear_error (&_inner_error_);
#line 49 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		return NULL;
#line 336 "tracker-history.c"
	}
#line 56 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp24_ = self->priv->history;
#line 56 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp24__length1 = self->priv->history_length1;
#line 56 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_debug ("tracker-history.vala:56:   Found %d previous search histories", _tmp24__length1);
#line 58 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_debug ("tracker-history.vala:58:   Done");
#line 25 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	return self;
#line 348 "tracker-history.c"
}


TrackerHistory* tracker_history_new (void) {
#line 25 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	return tracker_history_construct (TRACKER_TYPE_HISTORY);
#line 355 "tracker-history.c"
}


static void _vala_array_add1 (gchar** * array, int* length, int* size, gchar* value) {
#line 86 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	if ((*length) == (*size)) {
#line 86 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 86 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 366 "tracker-history.c"
	}
#line 86 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	(*array)[(*length)++] = value;
#line 86 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	(*array)[*length] = NULL;
#line 372 "tracker-history.c"
}


void tracker_history_add (TrackerHistory* self, const gchar* criteria) {
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	gchar** _tmp8_;
	gint _tmp8__length1;
	const gchar* _tmp9_;
	gchar* _tmp10_;
#line 77 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_return_if_fail (self != NULL);
#line 77 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_return_if_fail (criteria != NULL);
#line 77 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp0_ = criteria;
#line 77 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp1_ = criteria;
#line 77 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp2_ = strlen (_tmp1_);
#line 77 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp3_ = _tmp2_;
#line 77 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_vala_return_if_fail ((_tmp0_ != NULL) && (_tmp3_ > 0), "criteria != null && criteria.length > 0");
#line 80 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp4_ = self->priv->history;
#line 80 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp4__length1 = self->priv->history_length1;
#line 405 "tracker-history.c"
	{
		gchar** check_collection = NULL;
		gint check_collection_length1 = 0;
		gint _check_collection_size_ = 0;
		gint check_it = 0;
#line 80 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		check_collection = _tmp4_;
#line 80 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		check_collection_length1 = _tmp4__length1;
#line 80 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		for (check_it = 0; check_it < _tmp4__length1; check_it = check_it + 1) {
#line 417 "tracker-history.c"
			gchar* _tmp5_;
			gchar* check = NULL;
#line 80 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			_tmp5_ = g_strdup (check_collection[check_it]);
#line 80 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			check = _tmp5_;
#line 424 "tracker-history.c"
			{
				const gchar* _tmp6_;
				const gchar* _tmp7_;
#line 81 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
				_tmp6_ = check;
#line 81 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
				_tmp7_ = criteria;
#line 81 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
				if (g_strcmp0 (_tmp6_, _tmp7_) == 0) {
#line 82 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
					g_free (check);
#line 82 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
					return;
#line 438 "tracker-history.c"
				}
#line 80 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
				g_free (check);
#line 442 "tracker-history.c"
			}
		}
	}
#line 86 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp8_ = self->priv->history;
#line 86 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp8__length1 = self->priv->history_length1;
#line 86 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp9_ = criteria;
#line 86 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp10_ = g_strdup (_tmp9_);
#line 86 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_vala_array_add1 (&self->priv->history, &self->priv->history_length1, &self->priv->_history_size_, _tmp10_);
#line 456 "tracker-history.c"
}


static gchar** _vala_array_dup1 (gchar** self, int length) {
	gchar** result;
	int i;
#line 90 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	result = g_new0 (gchar*, length + 1);
#line 90 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	for (i = 0; i < length; i++) {
#line 467 "tracker-history.c"
		gchar* _tmp0_;
#line 90 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp0_ = g_strdup (self[i]);
#line 90 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		result[i] = _tmp0_;
#line 473 "tracker-history.c"
	}
#line 90 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	return result;
#line 477 "tracker-history.c"
}


gchar** tracker_history_get (TrackerHistory* self, int* result_length1) {
	gchar** result = NULL;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gchar** _tmp2_;
	gint _tmp2__length1;
#line 89 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 90 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp0_ = self->priv->history;
#line 90 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp0__length1 = self->priv->history_length1;
#line 90 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup1 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
#line 90 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp1__length1 = _tmp0__length1;
#line 90 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp2_ = _tmp1_;
#line 90 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp2__length1 = _tmp1__length1;
#line 90 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	if (result_length1) {
#line 90 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		*result_length1 = _tmp2__length1;
#line 507 "tracker-history.c"
	}
#line 90 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	result = _tmp2_;
#line 90 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	return result;
#line 513 "tracker-history.c"
}


static void tracker_value_history_init (GValue* value) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	value->data[0].v_pointer = NULL;
#line 520 "tracker-history.c"
}


static void tracker_value_history_free_value (GValue* value) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	if (value->data[0].v_pointer) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		tracker_history_unref (value->data[0].v_pointer);
#line 529 "tracker-history.c"
	}
}


static void tracker_value_history_copy_value (const GValue* src_value, GValue* dest_value) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	if (src_value->data[0].v_pointer) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		dest_value->data[0].v_pointer = tracker_history_ref (src_value->data[0].v_pointer);
#line 539 "tracker-history.c"
	} else {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		dest_value->data[0].v_pointer = NULL;
#line 543 "tracker-history.c"
	}
}


static gpointer tracker_value_history_peek_pointer (const GValue* value) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	return value->data[0].v_pointer;
#line 551 "tracker-history.c"
}


static gchar* tracker_value_history_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	if (collect_values[0].v_pointer) {
#line 558 "tracker-history.c"
		TrackerHistory * object;
		object = collect_values[0].v_pointer;
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		if (object->parent_instance.g_class == NULL) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 565 "tracker-history.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 569 "tracker-history.c"
		}
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		value->data[0].v_pointer = tracker_history_ref (object);
#line 573 "tracker-history.c"
	} else {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		value->data[0].v_pointer = NULL;
#line 577 "tracker-history.c"
	}
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	return NULL;
#line 581 "tracker-history.c"
}


static gchar* tracker_value_history_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	TrackerHistory ** object_p;
	object_p = collect_values[0].v_pointer;
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	if (!object_p) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 592 "tracker-history.c"
	}
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	if (!value->data[0].v_pointer) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		*object_p = NULL;
#line 598 "tracker-history.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		*object_p = value->data[0].v_pointer;
#line 602 "tracker-history.c"
	} else {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		*object_p = tracker_history_ref (value->data[0].v_pointer);
#line 606 "tracker-history.c"
	}
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	return NULL;
#line 610 "tracker-history.c"
}


GParamSpec* tracker_param_spec_history (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	TrackerParamSpecHistory* spec;
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_return_val_if_fail (g_type_is_a (object_type, TRACKER_TYPE_HISTORY), NULL);
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	return G_PARAM_SPEC (spec);
#line 624 "tracker-history.c"
}


gpointer tracker_value_get_history (const GValue* value) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TRACKER_TYPE_HISTORY), NULL);
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	return value->data[0].v_pointer;
#line 633 "tracker-history.c"
}


void tracker_value_set_history (GValue* value, gpointer v_object) {
	TrackerHistory * old;
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TRACKER_TYPE_HISTORY));
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	old = value->data[0].v_pointer;
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	if (v_object) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TRACKER_TYPE_HISTORY));
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		value->data[0].v_pointer = v_object;
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		tracker_history_ref (value->data[0].v_pointer);
#line 653 "tracker-history.c"
	} else {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		value->data[0].v_pointer = NULL;
#line 657 "tracker-history.c"
	}
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	if (old) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		tracker_history_unref (old);
#line 663 "tracker-history.c"
	}
}


void tracker_value_take_history (GValue* value, gpointer v_object) {
	TrackerHistory * old;
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TRACKER_TYPE_HISTORY));
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	old = value->data[0].v_pointer;
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	if (v_object) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TRACKER_TYPE_HISTORY));
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		value->data[0].v_pointer = v_object;
#line 682 "tracker-history.c"
	} else {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		value->data[0].v_pointer = NULL;
#line 686 "tracker-history.c"
	}
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	if (old) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		tracker_history_unref (old);
#line 692 "tracker-history.c"
	}
}


static void tracker_history_class_init (TrackerHistoryClass * klass) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	tracker_history_parent_class = g_type_class_peek_parent (klass);
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	((TrackerHistoryClass *) klass)->finalize = tracker_history_finalize;
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_type_class_add_private (klass, sizeof (TrackerHistoryPrivate));
#line 704 "tracker-history.c"
}


static void tracker_history_instance_init (TrackerHistory * self) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	self->priv = TRACKER_HISTORY_GET_PRIVATE (self);
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	self->ref_count = 1;
#line 713 "tracker-history.c"
}


static void tracker_history_finalize (TrackerHistory * obj) {
	TrackerHistory * self;
	GKeyFile* _tmp0_;
	gchar** _tmp1_;
	gint _tmp1__length1;
	GError * _inner_error_ = NULL;
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TRACKER_TYPE_HISTORY, TrackerHistory);
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_signal_handlers_destroy (self);
#line 62 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_debug ("tracker-history.vala:62: Saving history");
#line 64 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp0_ = self->priv->data;
#line 64 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp1_ = self->priv->history;
#line 64 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_tmp1__length1 = self->priv->history_length1;
#line 64 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_key_file_set_string_list (_tmp0_, "History", "criteria", (const gchar* const*) _tmp1_, _tmp1__length1);
#line 737 "tracker-history.c"
	{
		gchar* output;
		GKeyFile* _tmp2_;
		gchar* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
#line 67 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp2_ = self->priv->data;
#line 67 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp3_ = g_key_file_to_data (_tmp2_, NULL, NULL);
#line 67 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		output = _tmp3_;
#line 69 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp4_ = self->priv->filename;
#line 69 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp5_ = output;
#line 69 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_file_set_contents (_tmp4_, _tmp5_, (gssize) -1, &_inner_error_);
#line 69 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 69 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			g_free (output);
#line 69 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			if (_inner_error_->domain == G_FILE_ERROR) {
#line 762 "tracker-history.c"
				goto __catch0_g_file_error;
			}
#line 69 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			g_free (output);
#line 69 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 69 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
			g_clear_error (&_inner_error_);
#line 771 "tracker-history.c"
		}
#line 66 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_free (output);
#line 775 "tracker-history.c"
	}
	goto __finally0;
	__catch0_g_file_error:
	{
		GError* e1 = NULL;
		const gchar* _tmp6_;
		GError* _tmp7_;
		const gchar* _tmp8_;
#line 66 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		e1 = _inner_error_;
#line 66 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_inner_error_ = NULL;
#line 71 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp6_ = self->priv->filename;
#line 71 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp7_ = e1;
#line 71 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_tmp8_ = _tmp7_->message;
#line 71 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_warning ("tracker-history.vala:71: Could not save history to file:'%s': %s", _tmp6_, _tmp8_);
#line 66 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		_g_error_free0 (e1);
#line 798 "tracker-history.c"
	}
	__finally0:
#line 66 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 66 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 66 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_clear_error (&_inner_error_);
#line 807 "tracker-history.c"
	}
#line 74 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_debug ("tracker-history.vala:74:   Done");
#line 21 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	_g_key_file_unref0 (self->priv->data);
#line 22 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_free (self->priv->filename);
#line 23 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	self->priv->history = (_vala_array_free (self->priv->history, self->priv->history_length1, (GDestroyNotify) g_free), NULL);
#line 817 "tracker-history.c"
}


GType tracker_history_get_type (void) {
	static volatile gsize tracker_history_type_id__volatile = 0;
	if (g_once_init_enter (&tracker_history_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { tracker_value_history_init, tracker_value_history_free_value, tracker_value_history_copy_value, tracker_value_history_peek_pointer, "p", tracker_value_history_collect_value, "p", tracker_value_history_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (TrackerHistoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tracker_history_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrackerHistory), 0, (GInstanceInitFunc) tracker_history_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType tracker_history_type_id;
		tracker_history_type_id = g_type_register_fundamental (g_type_fundamental_next (), "TrackerHistory", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&tracker_history_type_id__volatile, tracker_history_type_id);
	}
	return tracker_history_type_id__volatile;
}


gpointer tracker_history_ref (gpointer instance) {
	TrackerHistory * self;
	self = instance;
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	g_atomic_int_inc (&self->ref_count);
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	return instance;
#line 842 "tracker-history.c"
}


void tracker_history_unref (gpointer instance) {
	TrackerHistory * self;
	self = instance;
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		TRACKER_HISTORY_GET_CLASS (self)->finalize (self);
#line 20 "/home/carlos/Source/gnome/tracker/src/tracker-needle/tracker-history.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 855 "tracker-history.c"
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int 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, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



