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

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later).  See the COPYING file in this distribution.
 */

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

#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))

#define TYPE_PREPARE_INPUT_TEXT_OPTIONS (prepare_input_text_options_get_type ())
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

typedef enum  {
	PREPARE_INPUT_TEXT_OPTIONS_EMPTY_IS_NULL = 1 << 0,
	PREPARE_INPUT_TEXT_OPTIONS_VALIDATE = 1 << 1,
	PREPARE_INPUT_TEXT_OPTIONS_INVALID_IS_NULL = 1 << 2,
	PREPARE_INPUT_TEXT_OPTIONS_STRIP = 1 << 3,
	PREPARE_INPUT_TEXT_OPTIONS_STRIP_CRLF = 1 << 4,
	PREPARE_INPUT_TEXT_OPTIONS_NORMALIZE = 1 << 5,
	PREPARE_INPUT_TEXT_OPTIONS_DEFAULT = ((((PREPARE_INPUT_TEXT_OPTIONS_EMPTY_IS_NULL | PREPARE_INPUT_TEXT_OPTIONS_VALIDATE) | PREPARE_INPUT_TEXT_OPTIONS_INVALID_IS_NULL) | PREPARE_INPUT_TEXT_OPTIONS_STRIP_CRLF) | PREPARE_INPUT_TEXT_OPTIONS_STRIP) | PREPARE_INPUT_TEXT_OPTIONS_NORMALIZE
} PrepareInputTextOptions;



gint64 g_ascii_strtoll (const gchar* str, gchar** endptr, guint num_base);
#define DEFAULT_USER_TEXT_INPUT_LENGTH 1024
gboolean is_string_empty (const gchar* s);
gint utf8_cs_compare (void* a, void* b);
gint utf8_ci_compare (void* a, void* b);
gchar* uchar_array_to_string (guchar* data, int data_length1, gint length);
guchar* string_to_uchar_array (const gchar* str, int* result_length1);
static void _vala_array_add1 (guchar* * array, int* length, int* size, guchar value);
gchar* guarded_markup_escape_text (const gchar* plain);
glong find_last_offset (const gchar* str, gchar c);
gboolean is_in_ci_array (const gchar* str, gchar** strings, int strings_length1);
GType prepare_input_text_options_get_type (void) G_GNUC_CONST;
gchar* guess_convert (const gchar* text);
gchar* prepare_input_text (const gchar* text, PrepareInputTextOptions options, gint dest_length);
gint64 parse_int64 (const gchar* str, gint num_base);
gboolean string_contains_char (const gchar* haystack, gunichar needle);
gboolean string_contains_str (const gchar* haystack, const gchar* needle);
gchar* string_sliced_at (const gchar* str, gint index);
gchar* string_sliced_at_first_str (const gchar* haystack, const gchar* needle, gint start_index);
gchar* string_sliced_at_last_str (const gchar* haystack, const gchar* needle, gint start_index);
gchar* string_sliced_at_first_char (const gchar* haystack, gunichar ch, gint start_index);
gchar* string_sliced_at_last_char (const gchar* haystack, gunichar ch, gint start_index);
gchar* string_strip_leading_zeroes (const gchar* str);
gchar* string_remove_diacritics (const gchar* istring);
gchar* string_to_hex_string (const gchar* str);
guint string_collated_hash (void* ptr);
guint string_precollated_hash (void* ptr);
gint string_collated_compare (void* a, void* b);
gint string_precollated_compare (const gchar* astr, const gchar* akey, const gchar* bstr, const gchar* bkey);
gboolean string_collated_equals (void* a, void* b);
gboolean string_precollated_equals (const gchar* astr, const gchar* akey, const gchar* bstr, const gchar* bkey);


static gchar string_get (const gchar* self, glong index) {
	gchar result = '\0';
	glong _tmp0_;
	gchar _tmp1_;
#line 1110 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, '\0');
#line 1111 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp0_ = index;
#line 1111 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp1_ = ((gchar*) self)[_tmp0_];
#line 1111 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	result = _tmp1_;
#line 1111 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	return result;
#line 81 "string.c"
}


inline gboolean is_string_empty (const gchar* s) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
#line 12 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = s;
#line 12 "/home/jens/Source/shotwell/src/util/string.vala"
	if (_tmp1_ == NULL) {
#line 12 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp0_ = TRUE;
#line 95 "string.c"
	} else {
		const gchar* _tmp2_;
		gchar _tmp3_;
#line 12 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp2_ = s;
#line 12 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp3_ = string_get (_tmp2_, (glong) 0);
#line 12 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp0_ = _tmp3_ == '\0';
#line 105 "string.c"
	}
#line 12 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp0_;
#line 12 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 111 "string.c"
}


gint utf8_cs_compare (void* a, void* b) {
	gint result = 0;
	void* _tmp0_;
	void* _tmp1_;
	gint _tmp2_;
#line 17 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = a;
#line 17 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = b;
#line 17 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = g_utf8_collate ((const gchar*) _tmp0_, (const gchar*) _tmp1_);
#line 17 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp2_;
#line 17 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 130 "string.c"
}


gint utf8_ci_compare (void* a, void* b) {
	gint result = 0;
	void* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	void* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
#line 22 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = a;
#line 22 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = g_utf8_strdown ((const gchar*) _tmp0_, (gssize) -1);
#line 22 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = _tmp1_;
#line 22 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp3_ = b;
#line 22 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp4_ = g_utf8_strdown ((const gchar*) _tmp3_, (gssize) -1);
#line 22 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp5_ = _tmp4_;
#line 22 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp6_ = g_utf8_collate (_tmp2_, _tmp5_);
#line 22 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp7_ = _tmp6_;
#line 22 "/home/jens/Source/shotwell/src/util/string.vala"
	_g_free0 (_tmp5_);
#line 22 "/home/jens/Source/shotwell/src/util/string.vala"
	_g_free0 (_tmp2_);
#line 22 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp7_;
#line 22 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 168 "string.c"
}


gchar* uchar_array_to_string (guchar* data, int data_length1, gint length) {
	gchar* result = NULL;
	gint _tmp0_;
	GString* builder = NULL;
	GString* _tmp2_;
	GString* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
#line 27 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = length;
#line 27 "/home/jens/Source/shotwell/src/util/string.vala"
	if (_tmp0_ < 0) {
#line 184 "string.c"
		guchar* _tmp1_;
		gint _tmp1__length1;
#line 28 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp1_ = data;
#line 28 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp1__length1 = data_length1;
#line 28 "/home/jens/Source/shotwell/src/util/string.vala"
		length = _tmp1__length1;
#line 193 "string.c"
	}
#line 30 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = g_string_new ("");
#line 30 "/home/jens/Source/shotwell/src/util/string.vala"
	builder = _tmp2_;
#line 199 "string.c"
	{
		gint ctr = 0;
#line 31 "/home/jens/Source/shotwell/src/util/string.vala"
		ctr = 0;
#line 204 "string.c"
		{
			gboolean _tmp3_ = FALSE;
#line 31 "/home/jens/Source/shotwell/src/util/string.vala"
			_tmp3_ = TRUE;
#line 31 "/home/jens/Source/shotwell/src/util/string.vala"
			while (TRUE) {
#line 211 "string.c"
				gint _tmp5_;
				gint _tmp6_;
				guchar* _tmp7_;
				gint _tmp7__length1;
				gint _tmp8_;
				guchar _tmp9_;
#line 31 "/home/jens/Source/shotwell/src/util/string.vala"
				if (!_tmp3_) {
#line 220 "string.c"
					gint _tmp4_;
#line 31 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp4_ = ctr;
#line 31 "/home/jens/Source/shotwell/src/util/string.vala"
					ctr = _tmp4_ + 1;
#line 226 "string.c"
				}
#line 31 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp3_ = FALSE;
#line 31 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp5_ = ctr;
#line 31 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp6_ = length;
#line 31 "/home/jens/Source/shotwell/src/util/string.vala"
				if (!(_tmp5_ < _tmp6_)) {
#line 31 "/home/jens/Source/shotwell/src/util/string.vala"
					break;
#line 238 "string.c"
				}
#line 32 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp7_ = data;
#line 32 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp7__length1 = data_length1;
#line 32 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp8_ = ctr;
#line 32 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp9_ = _tmp7_[_tmp8_];
#line 32 "/home/jens/Source/shotwell/src/util/string.vala"
				if (_tmp9_ != ((guchar) '\0')) {
#line 250 "string.c"
					GString* _tmp10_;
					guchar* _tmp11_;
					gint _tmp11__length1;
					gint _tmp12_;
					guchar _tmp13_;
#line 33 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp10_ = builder;
#line 33 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp11_ = data;
#line 33 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp11__length1 = data_length1;
#line 33 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp12_ = ctr;
#line 33 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp13_ = _tmp11_[_tmp12_];
#line 33 "/home/jens/Source/shotwell/src/util/string.vala"
					g_string_append_c (_tmp10_, (gchar) _tmp13_);
#line 268 "string.c"
				} else {
#line 35 "/home/jens/Source/shotwell/src/util/string.vala"
					break;
#line 272 "string.c"
				}
			}
		}
	}
#line 38 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp14_ = builder;
#line 38 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp15_ = _tmp14_->str;
#line 38 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp16_ = g_strdup (_tmp15_);
#line 38 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp16_;
#line 38 "/home/jens/Source/shotwell/src/util/string.vala"
	_g_string_free0 (builder);
#line 38 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 289 "string.c"
}


static void _vala_array_add1 (guchar* * array, int* length, int* size, guchar value) {
#line 45 "/home/jens/Source/shotwell/src/util/string.vala"
	if ((*length) == (*size)) {
#line 45 "/home/jens/Source/shotwell/src/util/string.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 45 "/home/jens/Source/shotwell/src/util/string.vala"
		*array = g_renew (guchar, *array, *size);
#line 300 "string.c"
	}
#line 45 "/home/jens/Source/shotwell/src/util/string.vala"
	(*array)[(*length)++] = value;
#line 304 "string.c"
}


guchar* string_to_uchar_array (const gchar* str, int* result_length1) {
	guchar* result = NULL;
	guchar* data = NULL;
	guchar* _tmp0_;
	gint data_length1;
	gint _data_size_;
	guchar* _tmp11_;
	gint _tmp11__length1;
#line 42 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (str != NULL, NULL);
#line 43 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = g_new0 (guchar, 0);
#line 43 "/home/jens/Source/shotwell/src/util/string.vala"
	data = _tmp0_;
#line 43 "/home/jens/Source/shotwell/src/util/string.vala"
	data_length1 = 0;
#line 43 "/home/jens/Source/shotwell/src/util/string.vala"
	_data_size_ = data_length1;
#line 326 "string.c"
	{
		gint ctr = 0;
#line 44 "/home/jens/Source/shotwell/src/util/string.vala"
		ctr = 0;
#line 331 "string.c"
		{
			gboolean _tmp1_ = FALSE;
#line 44 "/home/jens/Source/shotwell/src/util/string.vala"
			_tmp1_ = TRUE;
#line 44 "/home/jens/Source/shotwell/src/util/string.vala"
			while (TRUE) {
#line 338 "string.c"
				gint _tmp3_;
				const gchar* _tmp4_;
				gint _tmp5_;
				gint _tmp6_;
				guchar* _tmp7_;
				gint _tmp7__length1;
				const gchar* _tmp8_;
				gint _tmp9_;
				gchar _tmp10_;
#line 44 "/home/jens/Source/shotwell/src/util/string.vala"
				if (!_tmp1_) {
#line 350 "string.c"
					gint _tmp2_;
#line 44 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp2_ = ctr;
#line 44 "/home/jens/Source/shotwell/src/util/string.vala"
					ctr = _tmp2_ + 1;
#line 356 "string.c"
				}
#line 44 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp1_ = FALSE;
#line 44 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp3_ = ctr;
#line 44 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp4_ = str;
#line 44 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp5_ = strlen (_tmp4_);
#line 44 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp6_ = _tmp5_;
#line 44 "/home/jens/Source/shotwell/src/util/string.vala"
				if (!(_tmp3_ < _tmp6_)) {
#line 44 "/home/jens/Source/shotwell/src/util/string.vala"
					break;
#line 372 "string.c"
				}
#line 45 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp7_ = data;
#line 45 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp7__length1 = data_length1;
#line 45 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp8_ = str;
#line 45 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp9_ = ctr;
#line 45 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp10_ = string_get (_tmp8_, (glong) _tmp9_);
#line 45 "/home/jens/Source/shotwell/src/util/string.vala"
				_vala_array_add1 (&data, &data_length1, &_data_size_, (guchar) _tmp10_);
#line 386 "string.c"
			}
		}
	}
#line 47 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp11_ = data;
#line 47 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp11__length1 = data_length1;
#line 47 "/home/jens/Source/shotwell/src/util/string.vala"
	if (result_length1) {
#line 47 "/home/jens/Source/shotwell/src/util/string.vala"
		*result_length1 = _tmp11__length1;
#line 398 "string.c"
	}
#line 47 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp11_;
#line 47 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 404 "string.c"
}


inline gchar* guarded_markup_escape_text (const gchar* plain) {
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp2_;
	gboolean _tmp3_;
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = plain;
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp3_ = is_string_empty (_tmp2_);
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
	if (!_tmp3_) {
#line 420 "string.c"
		const gchar* _tmp4_;
		gboolean _tmp5_;
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp4_ = plain;
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp5_ = g_utf8_validate (_tmp4_, (gssize) -1, NULL);
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp1_ = _tmp5_;
#line 429 "string.c"
	} else {
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp1_ = FALSE;
#line 433 "string.c"
	}
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
	if (_tmp1_) {
#line 437 "string.c"
		const gchar* _tmp6_;
		gchar* _tmp7_;
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp6_ = plain;
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp7_ = g_markup_escape_text (_tmp6_, (gssize) -1);
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
		_g_free0 (_tmp0_);
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp0_ = _tmp7_;
#line 448 "string.c"
	} else {
		gchar* _tmp8_;
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp8_ = g_strdup ("");
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
		_g_free0 (_tmp0_);
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp0_ = _tmp8_;
#line 457 "string.c"
	}
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp0_;
#line 58 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 463 "string.c"
}


glong find_last_offset (const gchar* str, gchar c) {
	glong result = 0L;
	glong offset = 0L;
	const gchar* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
#line 61 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (str != NULL, 0L);
#line 62 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = str;
#line 62 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = strlen (_tmp0_);
#line 62 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = _tmp1_;
#line 62 "/home/jens/Source/shotwell/src/util/string.vala"
	offset = (glong) _tmp2_;
#line 63 "/home/jens/Source/shotwell/src/util/string.vala"
	while (TRUE) {
#line 485 "string.c"
		glong _tmp3_;
		glong _tmp4_;
		const gchar* _tmp5_;
		glong _tmp6_;
		gchar _tmp7_;
		gchar _tmp8_;
#line 63 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp3_ = offset;
#line 63 "/home/jens/Source/shotwell/src/util/string.vala"
		offset = _tmp3_ - 1;
#line 63 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp4_ = offset;
#line 63 "/home/jens/Source/shotwell/src/util/string.vala"
		if (!(_tmp4_ >= ((glong) 0))) {
#line 63 "/home/jens/Source/shotwell/src/util/string.vala"
			break;
#line 502 "string.c"
		}
#line 64 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp5_ = str;
#line 64 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp6_ = offset;
#line 64 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp7_ = string_get (_tmp5_, _tmp6_);
#line 64 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp8_ = c;
#line 64 "/home/jens/Source/shotwell/src/util/string.vala"
		if (_tmp7_ == _tmp8_) {
#line 65 "/home/jens/Source/shotwell/src/util/string.vala"
			result = offset;
#line 65 "/home/jens/Source/shotwell/src/util/string.vala"
			return result;
#line 518 "string.c"
		}
	}
#line 68 "/home/jens/Source/shotwell/src/util/string.vala"
	result = (glong) -1;
#line 68 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 525 "string.c"
}


gboolean is_in_ci_array (const gchar* str, gchar** strings, int strings_length1) {
	gboolean result = FALSE;
	gchar* strdown = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
#line 73 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (str != NULL, FALSE);
#line 74 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = str;
#line 74 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = g_utf8_strdown (_tmp0_, (gssize) -1);
#line 74 "/home/jens/Source/shotwell/src/util/string.vala"
	strdown = _tmp1_;
#line 75 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = strings;
#line 75 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2__length1 = strings_length1;
#line 548 "string.c"
	{
		gchar** str_element_collection = NULL;
		gint str_element_collection_length1 = 0;
		gint _str_element_collection_size_ = 0;
		gint str_element_it = 0;
#line 75 "/home/jens/Source/shotwell/src/util/string.vala"
		str_element_collection = _tmp2_;
#line 75 "/home/jens/Source/shotwell/src/util/string.vala"
		str_element_collection_length1 = _tmp2__length1;
#line 75 "/home/jens/Source/shotwell/src/util/string.vala"
		for (str_element_it = 0; str_element_it < _tmp2__length1; str_element_it = str_element_it + 1) {
#line 560 "string.c"
			gchar* _tmp3_;
			gchar* str_element = NULL;
#line 75 "/home/jens/Source/shotwell/src/util/string.vala"
			_tmp3_ = g_strdup (str_element_collection[str_element_it]);
#line 75 "/home/jens/Source/shotwell/src/util/string.vala"
			str_element = _tmp3_;
#line 567 "string.c"
			{
				const gchar* _tmp4_;
				const gchar* _tmp5_;
#line 76 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp4_ = strdown;
#line 76 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp5_ = str_element;
#line 76 "/home/jens/Source/shotwell/src/util/string.vala"
				if (g_strcmp0 (_tmp4_, _tmp5_) == 0) {
#line 77 "/home/jens/Source/shotwell/src/util/string.vala"
					result = TRUE;
#line 77 "/home/jens/Source/shotwell/src/util/string.vala"
					_g_free0 (str_element);
#line 77 "/home/jens/Source/shotwell/src/util/string.vala"
					_g_free0 (strdown);
#line 77 "/home/jens/Source/shotwell/src/util/string.vala"
					return result;
#line 585 "string.c"
				}
#line 75 "/home/jens/Source/shotwell/src/util/string.vala"
				_g_free0 (str_element);
#line 589 "string.c"
			}
		}
	}
#line 80 "/home/jens/Source/shotwell/src/util/string.vala"
	result = FALSE;
#line 80 "/home/jens/Source/shotwell/src/util/string.vala"
	_g_free0 (strdown);
#line 80 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 599 "string.c"
}


GType prepare_input_text_options_get_type (void) {
	static volatile gsize prepare_input_text_options_type_id__volatile = 0;
	if (g_once_init_enter (&prepare_input_text_options_type_id__volatile)) {
		static const GFlagsValue values[] = {{PREPARE_INPUT_TEXT_OPTIONS_EMPTY_IS_NULL, "PREPARE_INPUT_TEXT_OPTIONS_EMPTY_IS_NULL", "empty-is-null"}, {PREPARE_INPUT_TEXT_OPTIONS_VALIDATE, "PREPARE_INPUT_TEXT_OPTIONS_VALIDATE", "validate"}, {PREPARE_INPUT_TEXT_OPTIONS_INVALID_IS_NULL, "PREPARE_INPUT_TEXT_OPTIONS_INVALID_IS_NULL", "invalid-is-null"}, {PREPARE_INPUT_TEXT_OPTIONS_STRIP, "PREPARE_INPUT_TEXT_OPTIONS_STRIP", "strip"}, {PREPARE_INPUT_TEXT_OPTIONS_STRIP_CRLF, "PREPARE_INPUT_TEXT_OPTIONS_STRIP_CRLF", "strip-crlf"}, {PREPARE_INPUT_TEXT_OPTIONS_NORMALIZE, "PREPARE_INPUT_TEXT_OPTIONS_NORMALIZE", "normalize"}, {PREPARE_INPUT_TEXT_OPTIONS_DEFAULT, "PREPARE_INPUT_TEXT_OPTIONS_DEFAULT", "default"}, {0, NULL, NULL}};
		GType prepare_input_text_options_type_id;
		prepare_input_text_options_type_id = g_flags_register_static ("PrepareInputTextOptions", values);
		g_once_init_leave (&prepare_input_text_options_type_id__volatile, prepare_input_text_options_type_id);
	}
	return prepare_input_text_options_type_id__volatile;
}


gchar* guess_convert (const gchar* text) {
	gchar* result = NULL;
	gchar* output = NULL;
	gsize bytes_read = 0UL;
	const gchar* charset = NULL;
	const gchar* _tmp0_ = NULL;
	gboolean _tmp1_;
	gsize _tmp30_;
	const gchar* _tmp31_;
	gint _tmp32_;
	gint _tmp33_;
	GError * _inner_error_ = NULL;
#line 94 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (text != NULL, NULL);
#line 95 "/home/jens/Source/shotwell/src/util/string.vala"
	output = NULL;
#line 96 "/home/jens/Source/shotwell/src/util/string.vala"
	bytes_read = (gsize) 0;
#line 97 "/home/jens/Source/shotwell/src/util/string.vala"
	charset = NULL;
#line 98 "/home/jens/Source/shotwell/src/util/string.vala"
	g_debug ("string.vala:98: CONVERT: Text did not validate as UTF-8, trying conver" \
"sion");
#line 101 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = g_get_charset (&_tmp0_);
#line 101 "/home/jens/Source/shotwell/src/util/string.vala"
	charset = _tmp0_;
#line 101 "/home/jens/Source/shotwell/src/util/string.vala"
	if (!_tmp1_) {
#line 643 "string.c"
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		gsize _tmp6_ = 0UL;
		gchar* _tmp7_;
		gsize _tmp8_;
		const gchar* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
#line 102 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp2_ = text;
#line 102 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp3_ = text;
#line 102 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp4_ = strlen (_tmp3_);
#line 102 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp5_ = _tmp4_;
#line 102 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp7_ = g_locale_to_utf8 (_tmp2_, (gssize) _tmp5_, &_tmp6_, NULL, NULL);
#line 102 "/home/jens/Source/shotwell/src/util/string.vala"
		bytes_read = _tmp6_;
#line 102 "/home/jens/Source/shotwell/src/util/string.vala"
		_g_free0 (output);
#line 102 "/home/jens/Source/shotwell/src/util/string.vala"
		output = _tmp7_;
#line 103 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp8_ = bytes_read;
#line 103 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp9_ = text;
#line 103 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp10_ = strlen (_tmp9_);
#line 103 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp11_ = _tmp10_;
#line 103 "/home/jens/Source/shotwell/src/util/string.vala"
		if (_tmp8_ == ((gsize) _tmp11_)) {
#line 680 "string.c"
			const gchar* _tmp12_;
#line 104 "/home/jens/Source/shotwell/src/util/string.vala"
			_tmp12_ = charset;
#line 104 "/home/jens/Source/shotwell/src/util/string.vala"
			g_debug ("string.vala:104: CONVERT: Locale is not UTF-8, convert from %s", _tmp12_);
#line 105 "/home/jens/Source/shotwell/src/util/string.vala"
			result = output;
#line 105 "/home/jens/Source/shotwell/src/util/string.vala"
			return result;
#line 690 "string.c"
		}
	}
	{
		gchar* _tmp13_ = NULL;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		gint _tmp16_;
		gint _tmp17_;
		gsize _tmp18_ = 0UL;
		gchar* _tmp19_;
		gchar* _tmp20_;
#line 110 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp14_ = text;
#line 110 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp15_ = text;
#line 110 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp16_ = strlen (_tmp15_);
#line 110 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp17_ = _tmp16_;
#line 110 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp19_ = g_convert (_tmp14_, (gssize) _tmp17_, "UTF-8", "WINDOWS-1252", &_tmp18_, NULL, &_inner_error_);
#line 110 "/home/jens/Source/shotwell/src/util/string.vala"
		bytes_read = _tmp18_;
#line 110 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp13_ = _tmp19_;
#line 110 "/home/jens/Source/shotwell/src/util/string.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 110 "/home/jens/Source/shotwell/src/util/string.vala"
			if (_inner_error_->domain == G_CONVERT_ERROR) {
#line 720 "string.c"
				goto __catch6_g_convert_error;
			}
#line 110 "/home/jens/Source/shotwell/src/util/string.vala"
			_g_free0 (output);
#line 110 "/home/jens/Source/shotwell/src/util/string.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 110 "/home/jens/Source/shotwell/src/util/string.vala"
			g_clear_error (&_inner_error_);
#line 110 "/home/jens/Source/shotwell/src/util/string.vala"
			return NULL;
#line 731 "string.c"
		}
#line 110 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp20_ = _tmp13_;
#line 110 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp13_ = NULL;
#line 110 "/home/jens/Source/shotwell/src/util/string.vala"
		_g_free0 (output);
#line 110 "/home/jens/Source/shotwell/src/util/string.vala"
		output = _tmp20_;
#line 111 "/home/jens/Source/shotwell/src/util/string.vala"
		charset = "WINDOWS-1252";
#line 109 "/home/jens/Source/shotwell/src/util/string.vala"
		_g_free0 (_tmp13_);
#line 745 "string.c"
	}
	goto __finally6;
	__catch6_g_convert_error:
	{
		GError* _error_ = NULL;
		GError* _tmp21_;
#line 109 "/home/jens/Source/shotwell/src/util/string.vala"
		_error_ = _inner_error_;
#line 109 "/home/jens/Source/shotwell/src/util/string.vala"
		_inner_error_ = NULL;
#line 113 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp21_ = _error_;
#line 113 "/home/jens/Source/shotwell/src/util/string.vala"
		if (g_error_matches (_tmp21_, G_CONVERT_ERROR, G_CONVERT_ERROR_NO_CONVERSION)) {
#line 760 "string.c"
			{
				gchar* _tmp22_ = NULL;
				const gchar* _tmp23_;
				const gchar* _tmp24_;
				gint _tmp25_;
				gint _tmp26_;
				gsize _tmp27_ = 0UL;
				gchar* _tmp28_;
				gchar* _tmp29_;
#line 115 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp23_ = text;
#line 115 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp24_ = text;
#line 115 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp25_ = strlen (_tmp24_);
#line 115 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp26_ = _tmp25_;
#line 115 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp28_ = g_convert (_tmp23_, (gssize) _tmp26_, "UTF-8", "ISO-8859-1", &_tmp27_, NULL, &_inner_error_);
#line 115 "/home/jens/Source/shotwell/src/util/string.vala"
				bytes_read = _tmp27_;
#line 115 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp22_ = _tmp28_;
#line 115 "/home/jens/Source/shotwell/src/util/string.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 786 "string.c"
					goto __catch7_g_error;
				}
#line 115 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp29_ = _tmp22_;
#line 115 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp22_ = NULL;
#line 115 "/home/jens/Source/shotwell/src/util/string.vala"
				_g_free0 (output);
#line 115 "/home/jens/Source/shotwell/src/util/string.vala"
				output = _tmp29_;
#line 116 "/home/jens/Source/shotwell/src/util/string.vala"
				charset = "ISO-8859-1";
#line 114 "/home/jens/Source/shotwell/src/util/string.vala"
				_g_free0 (_tmp22_);
#line 801 "string.c"
			}
			goto __finally7;
			__catch7_g_error:
			{
				GError* _error_ = NULL;
#line 114 "/home/jens/Source/shotwell/src/util/string.vala"
				_error_ = _inner_error_;
#line 114 "/home/jens/Source/shotwell/src/util/string.vala"
				_inner_error_ = NULL;
#line 114 "/home/jens/Source/shotwell/src/util/string.vala"
				_g_error_free0 (_error_);
#line 813 "string.c"
			}
			__finally7:
#line 114 "/home/jens/Source/shotwell/src/util/string.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 114 "/home/jens/Source/shotwell/src/util/string.vala"
				_g_error_free0 (_error_);
#line 114 "/home/jens/Source/shotwell/src/util/string.vala"
				_g_error_free0 (_error_);
#line 114 "/home/jens/Source/shotwell/src/util/string.vala"
				_g_free0 (output);
#line 114 "/home/jens/Source/shotwell/src/util/string.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 114 "/home/jens/Source/shotwell/src/util/string.vala"
				g_clear_error (&_inner_error_);
#line 114 "/home/jens/Source/shotwell/src/util/string.vala"
				return NULL;
#line 830 "string.c"
			}
		}
#line 109 "/home/jens/Source/shotwell/src/util/string.vala"
		_g_error_free0 (_error_);
#line 835 "string.c"
	}
	__finally6:
#line 109 "/home/jens/Source/shotwell/src/util/string.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 109 "/home/jens/Source/shotwell/src/util/string.vala"
		_g_free0 (output);
#line 109 "/home/jens/Source/shotwell/src/util/string.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 109 "/home/jens/Source/shotwell/src/util/string.vala"
		g_clear_error (&_inner_error_);
#line 109 "/home/jens/Source/shotwell/src/util/string.vala"
		return NULL;
#line 848 "string.c"
	}
#line 121 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp30_ = bytes_read;
#line 121 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp31_ = text;
#line 121 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp32_ = strlen (_tmp31_);
#line 121 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp33_ = _tmp32_;
#line 121 "/home/jens/Source/shotwell/src/util/string.vala"
	if (_tmp30_ == ((gsize) _tmp33_)) {
#line 860 "string.c"
		const gchar* _tmp34_;
#line 122 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp34_ = charset;
#line 122 "/home/jens/Source/shotwell/src/util/string.vala"
		g_debug ("string.vala:122: CONVERT: Guessed conversion from %s", _tmp34_);
#line 124 "/home/jens/Source/shotwell/src/util/string.vala"
		result = output;
#line 124 "/home/jens/Source/shotwell/src/util/string.vala"
		return result;
#line 870 "string.c"
	}
#line 127 "/home/jens/Source/shotwell/src/util/string.vala"
	result = NULL;
#line 127 "/home/jens/Source/shotwell/src/util/string.vala"
	_g_free0 (output);
#line 127 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 878 "string.c"
}


static gchar* string_strip (const gchar* self) {
	gchar* result = NULL;
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
#line 1234 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1235 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp0_ = g_strdup (self);
#line 1235 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_result_ = _tmp0_;
#line 1236 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp1_ = _result_;
#line 1236 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_strstrip (_tmp1_);
#line 1237 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	result = _result_;
#line 1237 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	return result;
#line 901 "string.c"
}


static gchar* string_delimit (const gchar* self, const gchar* delimiters, gchar new_delimiter) {
	gchar* result = NULL;
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar _tmp3_;
#line 1242 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1242 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (delimiters != NULL, NULL);
#line 1243 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp0_ = g_strdup (self);
#line 1243 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_result_ = _tmp0_;
#line 1244 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp1_ = _result_;
#line 1244 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp2_ = delimiters;
#line 1244 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp3_ = new_delimiter;
#line 1244 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_strdelimit (_tmp1_, _tmp2_, _tmp3_);
#line 1245 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	result = _result_;
#line 1245 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	return result;
#line 932 "string.c"
}


gchar* prepare_input_text (const gchar* text, PrepareInputTextOptions options, gint dest_length) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	gchar* prepped = NULL;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	PrepareInputTextOptions _tmp3_;
	PrepareInputTextOptions _tmp12_;
	PrepareInputTextOptions _tmp15_;
	PrepareInputTextOptions _tmp18_;
	gboolean _tmp21_ = FALSE;
	PrepareInputTextOptions _tmp22_;
	gint _tmp25_;
#line 131 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = text;
#line 131 "/home/jens/Source/shotwell/src/util/string.vala"
	if (_tmp0_ == NULL) {
#line 132 "/home/jens/Source/shotwell/src/util/string.vala"
		result = NULL;
#line 132 "/home/jens/Source/shotwell/src/util/string.vala"
		return result;
#line 957 "string.c"
	}
#line 134 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = text;
#line 134 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 134 "/home/jens/Source/shotwell/src/util/string.vala"
	prepped = _tmp2_;
#line 135 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp3_ = options;
#line 135 "/home/jens/Source/shotwell/src/util/string.vala"
	if ((_tmp3_ & PREPARE_INPUT_TEXT_OPTIONS_VALIDATE) == PREPARE_INPUT_TEXT_OPTIONS_VALIDATE) {
#line 969 "string.c"
		const gchar* _tmp4_;
		gboolean _tmp5_;
#line 136 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp4_ = text;
#line 136 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp5_ = g_utf8_validate (_tmp4_, (gssize) -1, NULL);
#line 136 "/home/jens/Source/shotwell/src/util/string.vala"
		if (!_tmp5_) {
#line 978 "string.c"
			const gchar* _tmp6_;
			gchar* _tmp7_;
			const gchar* _tmp8_;
#line 137 "/home/jens/Source/shotwell/src/util/string.vala"
			_tmp6_ = text;
#line 137 "/home/jens/Source/shotwell/src/util/string.vala"
			_tmp7_ = guess_convert (_tmp6_);
#line 137 "/home/jens/Source/shotwell/src/util/string.vala"
			_g_free0 (prepped);
#line 137 "/home/jens/Source/shotwell/src/util/string.vala"
			prepped = _tmp7_;
#line 139 "/home/jens/Source/shotwell/src/util/string.vala"
			_tmp8_ = prepped;
#line 139 "/home/jens/Source/shotwell/src/util/string.vala"
			if (_tmp8_ == NULL) {
#line 994 "string.c"
				const gchar* _tmp9_ = NULL;
				PrepareInputTextOptions _tmp10_;
				gchar* _tmp11_;
#line 140 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp10_ = options;
#line 140 "/home/jens/Source/shotwell/src/util/string.vala"
				if ((_tmp10_ & PREPARE_INPUT_TEXT_OPTIONS_INVALID_IS_NULL) != 0) {
#line 140 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp9_ = NULL;
#line 1004 "string.c"
				} else {
#line 140 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp9_ = "";
#line 1008 "string.c"
				}
#line 140 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp11_ = g_strdup (_tmp9_);
#line 140 "/home/jens/Source/shotwell/src/util/string.vala"
				result = _tmp11_;
#line 140 "/home/jens/Source/shotwell/src/util/string.vala"
				_g_free0 (prepped);
#line 140 "/home/jens/Source/shotwell/src/util/string.vala"
				return result;
#line 1018 "string.c"
			}
		}
	}
#line 149 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp12_ = options;
#line 149 "/home/jens/Source/shotwell/src/util/string.vala"
	if ((_tmp12_ & PREPARE_INPUT_TEXT_OPTIONS_NORMALIZE) != 0) {
#line 1026 "string.c"
		const gchar* _tmp13_;
		gchar* _tmp14_;
#line 150 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp13_ = prepped;
#line 150 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp14_ = g_utf8_normalize (_tmp13_, (gssize) -1, G_NORMALIZE_NFC);
#line 150 "/home/jens/Source/shotwell/src/util/string.vala"
		_g_free0 (prepped);
#line 150 "/home/jens/Source/shotwell/src/util/string.vala"
		prepped = _tmp14_;
#line 1037 "string.c"
	}
#line 152 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp15_ = options;
#line 152 "/home/jens/Source/shotwell/src/util/string.vala"
	if ((_tmp15_ & PREPARE_INPUT_TEXT_OPTIONS_STRIP) != 0) {
#line 1043 "string.c"
		const gchar* _tmp16_;
		gchar* _tmp17_;
#line 153 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp16_ = prepped;
#line 153 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp17_ = string_strip (_tmp16_);
#line 153 "/home/jens/Source/shotwell/src/util/string.vala"
		_g_free0 (prepped);
#line 153 "/home/jens/Source/shotwell/src/util/string.vala"
		prepped = _tmp17_;
#line 1054 "string.c"
	}
#line 157 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp18_ = options;
#line 157 "/home/jens/Source/shotwell/src/util/string.vala"
	if ((_tmp18_ & PREPARE_INPUT_TEXT_OPTIONS_STRIP_CRLF) != 0) {
#line 1060 "string.c"
		const gchar* _tmp19_;
		gchar* _tmp20_;
#line 158 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp19_ = prepped;
#line 158 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp20_ = string_delimit (_tmp19_, "\n\r", ' ');
#line 158 "/home/jens/Source/shotwell/src/util/string.vala"
		_g_free0 (prepped);
#line 158 "/home/jens/Source/shotwell/src/util/string.vala"
		prepped = _tmp20_;
#line 1071 "string.c"
	}
#line 160 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp22_ = options;
#line 160 "/home/jens/Source/shotwell/src/util/string.vala"
	if ((_tmp22_ & PREPARE_INPUT_TEXT_OPTIONS_EMPTY_IS_NULL) != 0) {
#line 1077 "string.c"
		const gchar* _tmp23_;
		gboolean _tmp24_;
#line 160 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp23_ = prepped;
#line 160 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp24_ = is_string_empty (_tmp23_);
#line 160 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp21_ = _tmp24_;
#line 1086 "string.c"
	} else {
#line 160 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp21_ = FALSE;
#line 1090 "string.c"
	}
#line 160 "/home/jens/Source/shotwell/src/util/string.vala"
	if (_tmp21_) {
#line 161 "/home/jens/Source/shotwell/src/util/string.vala"
		result = NULL;
#line 161 "/home/jens/Source/shotwell/src/util/string.vala"
		_g_free0 (prepped);
#line 161 "/home/jens/Source/shotwell/src/util/string.vala"
		return result;
#line 1100 "string.c"
	}
#line 166 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp25_ = dest_length;
#line 166 "/home/jens/Source/shotwell/src/util/string.vala"
	if (_tmp25_ >= 0) {
#line 1106 "string.c"
		GString* sb = NULL;
		const gchar* _tmp26_;
		GString* _tmp27_;
		GString* _tmp28_;
		gint _tmp29_;
		GString* _tmp30_;
		const gchar* _tmp31_;
		gchar* _tmp32_;
#line 167 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp26_ = prepped;
#line 167 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp27_ = g_string_new (_tmp26_);
#line 167 "/home/jens/Source/shotwell/src/util/string.vala"
		sb = _tmp27_;
#line 168 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp28_ = sb;
#line 168 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp29_ = dest_length;
#line 168 "/home/jens/Source/shotwell/src/util/string.vala"
		g_string_truncate (_tmp28_, (gsize) _tmp29_);
#line 169 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp30_ = sb;
#line 169 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp31_ = _tmp30_->str;
#line 169 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp32_ = g_strdup (_tmp31_);
#line 169 "/home/jens/Source/shotwell/src/util/string.vala"
		result = _tmp32_;
#line 169 "/home/jens/Source/shotwell/src/util/string.vala"
		_g_string_free0 (sb);
#line 169 "/home/jens/Source/shotwell/src/util/string.vala"
		_g_free0 (prepped);
#line 169 "/home/jens/Source/shotwell/src/util/string.vala"
		return result;
#line 1141 "string.c"
	}
#line 173 "/home/jens/Source/shotwell/src/util/string.vala"
	result = prepped;
#line 173 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 1147 "string.c"
}


gint64 parse_int64 (const gchar* str, gint num_base) {
	gint64 result = 0LL;
	const gchar* _tmp0_;
	gint _tmp1_;
	gint64 _tmp2_;
#line 176 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (str != NULL, 0LL);
#line 177 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = str;
#line 177 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = num_base;
#line 177 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = g_ascii_strtoll (_tmp0_, NULL, (guint) _tmp1_);
#line 177 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp2_;
#line 177 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 1168 "string.c"
}


static gint string_index_of_char (const gchar* self, gunichar c, gint start_index) {
	gint result = 0;
	gchar* _result_ = NULL;
	gint _tmp0_;
	gunichar _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
#line 1031 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, 0);
#line 1032 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp0_ = start_index;
#line 1032 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp1_ = c;
#line 1032 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp2_ = g_utf8_strchr (((gchar*) self) + _tmp0_, (gssize) -1, _tmp1_);
#line 1032 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_result_ = _tmp2_;
#line 1034 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp3_ = _result_;
#line 1034 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp3_ != NULL) {
#line 1193 "string.c"
		gchar* _tmp4_;
#line 1035 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp4_ = _result_;
#line 1035 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		result = (gint) (_tmp4_ - ((gchar*) self));
#line 1035 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		return result;
#line 1201 "string.c"
	} else {
#line 1037 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		result = -1;
#line 1037 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		return result;
#line 1207 "string.c"
	}
}


inline gboolean string_contains_char (const gchar* haystack, gunichar needle) {
	gboolean result = FALSE;
	const gchar* _tmp0_;
	gunichar _tmp1_;
	gint _tmp2_;
#line 182 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (haystack != NULL, FALSE);
#line 183 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = haystack;
#line 183 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = needle;
#line 183 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = string_index_of_char (_tmp0_, _tmp1_, 0);
#line 183 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp2_ >= 0;
#line 183 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 1229 "string.c"
}


static gint string_index_of (const gchar* self, const gchar* needle, gint start_index) {
	gint result = 0;
	gchar* _result_ = NULL;
	gint _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
#line 1011 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, 0);
#line 1011 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (needle != NULL, 0);
#line 1012 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp0_ = start_index;
#line 1012 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp1_ = needle;
#line 1012 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp2_ = strstr (((gchar*) self) + _tmp0_, (gchar*) _tmp1_);
#line 1012 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_result_ = _tmp2_;
#line 1014 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp3_ = _result_;
#line 1014 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp3_ != NULL) {
#line 1256 "string.c"
		gchar* _tmp4_;
#line 1015 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp4_ = _result_;
#line 1015 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		result = (gint) (_tmp4_ - ((gchar*) self));
#line 1015 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		return result;
#line 1264 "string.c"
	} else {
#line 1017 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		result = -1;
#line 1017 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		return result;
#line 1270 "string.c"
	}
}


inline gboolean string_contains_str (const gchar* haystack, const gchar* needle) {
	gboolean result = FALSE;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gint _tmp2_;
#line 186 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (haystack != NULL, FALSE);
#line 186 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (needle != NULL, FALSE);
#line 187 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = haystack;
#line 187 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = needle;
#line 187 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = string_index_of (_tmp0_, _tmp1_, 0);
#line 187 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp2_ >= 0;
#line 187 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 1294 "string.c"
}


static gchar* string_slice (const gchar* self, glong start, glong end) {
	gchar* result = NULL;
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	glong _tmp2_;
	glong _tmp5_;
	gboolean _tmp8_ = FALSE;
	glong _tmp9_;
	gboolean _tmp12_ = FALSE;
	glong _tmp13_;
	glong _tmp16_;
	glong _tmp17_;
	glong _tmp18_;
	glong _tmp19_;
	glong _tmp20_;
	gchar* _tmp21_;
#line 1355 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1356 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp0_ = strlen (self);
#line 1356 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp1_ = _tmp0_;
#line 1356 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	string_length = (glong) _tmp1_;
#line 1357 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp2_ = start;
#line 1357 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp2_ < ((glong) 0)) {
#line 1327 "string.c"
		glong _tmp3_;
		glong _tmp4_;
#line 1358 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp3_ = string_length;
#line 1358 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp4_ = start;
#line 1358 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		start = _tmp3_ + _tmp4_;
#line 1336 "string.c"
	}
#line 1360 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp5_ = end;
#line 1360 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp5_ < ((glong) 0)) {
#line 1342 "string.c"
		glong _tmp6_;
		glong _tmp7_;
#line 1361 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp6_ = string_length;
#line 1361 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp7_ = end;
#line 1361 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		end = _tmp6_ + _tmp7_;
#line 1351 "string.c"
	}
#line 1363 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp9_ = start;
#line 1363 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp9_ >= ((glong) 0)) {
#line 1357 "string.c"
		glong _tmp10_;
		glong _tmp11_;
#line 1363 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp10_ = start;
#line 1363 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp11_ = string_length;
#line 1363 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp8_ = _tmp10_ <= _tmp11_;
#line 1366 "string.c"
	} else {
#line 1363 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp8_ = FALSE;
#line 1370 "string.c"
	}
#line 1363 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (_tmp8_, NULL);
#line 1364 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp13_ = end;
#line 1364 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp13_ >= ((glong) 0)) {
#line 1378 "string.c"
		glong _tmp14_;
		glong _tmp15_;
#line 1364 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp14_ = end;
#line 1364 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp15_ = string_length;
#line 1364 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp12_ = _tmp14_ <= _tmp15_;
#line 1387 "string.c"
	} else {
#line 1364 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp12_ = FALSE;
#line 1391 "string.c"
	}
#line 1364 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (_tmp12_, NULL);
#line 1365 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp16_ = start;
#line 1365 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp17_ = end;
#line 1365 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (_tmp16_ <= _tmp17_, NULL);
#line 1366 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp18_ = start;
#line 1366 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp19_ = end;
#line 1366 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp20_ = start;
#line 1366 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp21_ = g_strndup (((gchar*) self) + _tmp18_, (gsize) (_tmp19_ - _tmp20_));
#line 1366 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	result = _tmp21_;
#line 1366 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	return result;
#line 1413 "string.c"
}


inline gchar* string_sliced_at (const gchar* str, gint index) {
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	gint _tmp1_;
#line 190 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (str != NULL, NULL);
#line 191 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = index;
#line 191 "/home/jens/Source/shotwell/src/util/string.vala"
	if (_tmp1_ >= 0) {
#line 1427 "string.c"
		const gchar* _tmp2_;
		gint _tmp3_;
		const gchar* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gchar* _tmp7_;
#line 191 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp2_ = str;
#line 191 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp3_ = index;
#line 191 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp4_ = str;
#line 191 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp5_ = strlen (_tmp4_);
#line 191 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp6_ = _tmp5_;
#line 191 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp7_ = string_slice (_tmp2_, (glong) _tmp3_, (glong) _tmp6_);
#line 191 "/home/jens/Source/shotwell/src/util/string.vala"
		_g_free0 (_tmp0_);
#line 191 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp0_ = _tmp7_;
#line 1450 "string.c"
	} else {
#line 191 "/home/jens/Source/shotwell/src/util/string.vala"
		_g_free0 (_tmp0_);
#line 191 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp0_ = NULL;
#line 1456 "string.c"
	}
#line 191 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp0_;
#line 191 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 1462 "string.c"
}


inline gchar* string_sliced_at_first_str (const gchar* haystack, const gchar* needle, gint start_index) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gchar* _tmp5_;
#line 194 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (haystack != NULL, NULL);
#line 194 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (needle != NULL, NULL);
#line 195 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = haystack;
#line 195 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = haystack;
#line 195 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = needle;
#line 195 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp3_ = start_index;
#line 195 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp4_ = string_index_of (_tmp1_, _tmp2_, _tmp3_);
#line 195 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp5_ = string_sliced_at (_tmp0_, _tmp4_);
#line 195 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp5_;
#line 195 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 1494 "string.c"
}


static gint string_last_index_of (const gchar* self, const gchar* needle, gint start_index) {
	gint result = 0;
	gchar* _result_ = NULL;
	gint _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
#line 1021 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, 0);
#line 1021 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (needle != NULL, 0);
#line 1022 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp0_ = start_index;
#line 1022 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp1_ = needle;
#line 1022 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp2_ = g_strrstr (((gchar*) self) + _tmp0_, (gchar*) _tmp1_);
#line 1022 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_result_ = _tmp2_;
#line 1024 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp3_ = _result_;
#line 1024 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp3_ != NULL) {
#line 1521 "string.c"
		gchar* _tmp4_;
#line 1025 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp4_ = _result_;
#line 1025 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		result = (gint) (_tmp4_ - ((gchar*) self));
#line 1025 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		return result;
#line 1529 "string.c"
	} else {
#line 1027 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		result = -1;
#line 1027 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		return result;
#line 1535 "string.c"
	}
}


inline gchar* string_sliced_at_last_str (const gchar* haystack, const gchar* needle, gint start_index) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gchar* _tmp5_;
#line 198 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (haystack != NULL, NULL);
#line 198 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (needle != NULL, NULL);
#line 199 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = haystack;
#line 199 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = haystack;
#line 199 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = needle;
#line 199 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp3_ = start_index;
#line 199 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp4_ = string_last_index_of (_tmp1_, _tmp2_, _tmp3_);
#line 199 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp5_ = string_sliced_at (_tmp0_, _tmp4_);
#line 199 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp5_;
#line 199 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 1568 "string.c"
}


inline gchar* string_sliced_at_first_char (const gchar* haystack, gunichar ch, gint start_index) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gunichar _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gchar* _tmp5_;
#line 202 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (haystack != NULL, NULL);
#line 203 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = haystack;
#line 203 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = haystack;
#line 203 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = ch;
#line 203 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp3_ = start_index;
#line 203 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp4_ = string_index_of_char (_tmp1_, _tmp2_, _tmp3_);
#line 203 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp5_ = string_sliced_at (_tmp0_, _tmp4_);
#line 203 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp5_;
#line 203 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 1598 "string.c"
}


static gint string_last_index_of_char (const gchar* self, gunichar c, gint start_index) {
	gint result = 0;
	gchar* _result_ = NULL;
	gint _tmp0_;
	gunichar _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
#line 1041 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, 0);
#line 1042 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp0_ = start_index;
#line 1042 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp1_ = c;
#line 1042 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp2_ = g_utf8_strrchr (((gchar*) self) + _tmp0_, (gssize) -1, _tmp1_);
#line 1042 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_result_ = _tmp2_;
#line 1044 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp3_ = _result_;
#line 1044 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp3_ != NULL) {
#line 1623 "string.c"
		gchar* _tmp4_;
#line 1045 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp4_ = _result_;
#line 1045 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		result = (gint) (_tmp4_ - ((gchar*) self));
#line 1045 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		return result;
#line 1631 "string.c"
	} else {
#line 1047 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		result = -1;
#line 1047 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		return result;
#line 1637 "string.c"
	}
}


inline gchar* string_sliced_at_last_char (const gchar* haystack, gunichar ch, gint start_index) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gunichar _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gchar* _tmp5_;
#line 206 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (haystack != NULL, NULL);
#line 207 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = haystack;
#line 207 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = haystack;
#line 207 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = ch;
#line 207 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp3_ = start_index;
#line 207 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp4_ = string_last_index_of_char (_tmp1_, _tmp2_, _tmp3_);
#line 207 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp5_ = string_sliced_at (_tmp0_, _tmp4_);
#line 207 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp5_;
#line 207 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 1668 "string.c"
}


static gunichar string_get_char (const gchar* self, glong index) {
	gunichar result = 0U;
	glong _tmp0_;
	gunichar _tmp1_;
#line 1140 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, 0U);
#line 1141 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp0_ = index;
#line 1141 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp1_ = g_utf8_get_char (((gchar*) self) + _tmp0_);
#line 1141 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	result = _tmp1_;
#line 1141 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	return result;
#line 1686 "string.c"
}


gchar* string_strip_leading_zeroes (const gchar* str) {
	gchar* result = NULL;
	GString* stripped = NULL;
	GString* _tmp0_;
	gboolean prev_is_space = FALSE;
	GString* _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
#line 211 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (str != NULL, NULL);
#line 212 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = g_string_new ("");
#line 212 "/home/jens/Source/shotwell/src/util/string.vala"
	stripped = _tmp0_;
#line 213 "/home/jens/Source/shotwell/src/util/string.vala"
	prev_is_space = TRUE;
#line 1706 "string.c"
	{
		const gchar* iter = NULL;
		const gchar* _tmp1_;
#line 214 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp1_ = str;
#line 214 "/home/jens/Source/shotwell/src/util/string.vala"
		iter = _tmp1_;
#line 1714 "string.c"
		{
			gboolean _tmp2_ = FALSE;
#line 214 "/home/jens/Source/shotwell/src/util/string.vala"
			_tmp2_ = TRUE;
#line 214 "/home/jens/Source/shotwell/src/util/string.vala"
			while (TRUE) {
#line 1721 "string.c"
				const gchar* _tmp5_;
				gunichar _tmp6_;
				gunichar ch = 0U;
				const gchar* _tmp7_;
				gunichar _tmp8_;
				gboolean _tmp9_ = FALSE;
				gboolean _tmp10_;
#line 214 "/home/jens/Source/shotwell/src/util/string.vala"
				if (!_tmp2_) {
#line 1731 "string.c"
					const gchar* _tmp3_;
					const gchar* _tmp4_;
#line 214 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp3_ = iter;
#line 214 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp4_ = g_utf8_next_char (_tmp3_);
#line 214 "/home/jens/Source/shotwell/src/util/string.vala"
					iter = _tmp4_;
#line 1740 "string.c"
				}
#line 214 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp2_ = FALSE;
#line 214 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp5_ = iter;
#line 214 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp6_ = string_get_char (_tmp5_, (glong) 0);
#line 214 "/home/jens/Source/shotwell/src/util/string.vala"
				if (!(_tmp6_ != ((gunichar) 0))) {
#line 214 "/home/jens/Source/shotwell/src/util/string.vala"
					break;
#line 1752 "string.c"
				}
#line 215 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp7_ = iter;
#line 215 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp8_ = string_get_char (_tmp7_, (glong) 0);
#line 215 "/home/jens/Source/shotwell/src/util/string.vala"
				ch = _tmp8_;
#line 217 "/home/jens/Source/shotwell/src/util/string.vala"
				_tmp10_ = prev_is_space;
#line 217 "/home/jens/Source/shotwell/src/util/string.vala"
				if (!_tmp10_) {
#line 217 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp9_ = TRUE;
#line 1766 "string.c"
				} else {
					gunichar _tmp11_;
#line 217 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp11_ = ch;
#line 217 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp9_ = _tmp11_ != ((gunichar) '0');
#line 1773 "string.c"
				}
#line 217 "/home/jens/Source/shotwell/src/util/string.vala"
				if (_tmp9_) {
#line 1777 "string.c"
					GString* _tmp12_;
					gunichar _tmp13_;
					gunichar _tmp14_;
					gboolean _tmp15_;
#line 218 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp12_ = stripped;
#line 218 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp13_ = ch;
#line 218 "/home/jens/Source/shotwell/src/util/string.vala"
					g_string_append_unichar (_tmp12_, _tmp13_);
#line 219 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp14_ = ch;
#line 219 "/home/jens/Source/shotwell/src/util/string.vala"
					_tmp15_ = g_unichar_isspace (_tmp14_);
#line 219 "/home/jens/Source/shotwell/src/util/string.vala"
					prev_is_space = _tmp15_;
#line 1794 "string.c"
				}
			}
		}
	}
#line 223 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp16_ = stripped;
#line 223 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp17_ = _tmp16_->str;
#line 223 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp18_ = g_strdup (_tmp17_);
#line 223 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp18_;
#line 223 "/home/jens/Source/shotwell/src/util/string.vala"
	_g_string_free0 (stripped);
#line 223 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 1811 "string.c"
}


static gboolean string_get_next_char (const gchar* self, gint* index, gunichar* c) {
	gunichar _vala_c = 0U;
	gboolean result = FALSE;
	gint _tmp0_;
	gunichar _tmp1_;
	gunichar _tmp2_;
#line 1129 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, FALSE);
#line 1130 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp0_ = *index;
#line 1130 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp1_ = g_utf8_get_char (((gchar*) self) + _tmp0_);
#line 1130 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_vala_c = _tmp1_;
#line 1131 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	_tmp2_ = _vala_c;
#line 1131 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	if (_tmp2_ != ((gunichar) 0)) {
#line 1833 "string.c"
		gint _tmp3_;
		gchar* _tmp4_;
#line 1132 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp3_ = *index;
#line 1132 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		_tmp4_ = g_utf8_next_char (((gchar*) self) + _tmp3_);
#line 1132 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		*index = (gint) (_tmp4_ - ((gchar*) self));
#line 1133 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		result = TRUE;
#line 1133 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		if (c) {
#line 1133 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
			*c = _vala_c;
#line 1848 "string.c"
		}
#line 1133 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		return result;
#line 1852 "string.c"
	} else {
#line 1135 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		result = FALSE;
#line 1135 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		if (c) {
#line 1135 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
			*c = _vala_c;
#line 1860 "string.c"
		}
#line 1135 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		return result;
#line 1864 "string.c"
	}
#line 1129 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
	if (c) {
#line 1129 "/usr/share/vala-0.36/vapi/glib-2.0.vapi"
		*c = _vala_c;
#line 1870 "string.c"
	}
}


gchar* string_remove_diacritics (const gchar* istring) {
	gchar* result = NULL;
	GString* builder = NULL;
	GString* _tmp0_;
	gunichar ch = 0U;
	gint i = 0;
	GString* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
#line 226 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (istring != NULL, NULL);
#line 227 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = g_string_new ("");
#line 227 "/home/jens/Source/shotwell/src/util/string.vala"
	builder = _tmp0_;
#line 229 "/home/jens/Source/shotwell/src/util/string.vala"
	i = 0;
#line 230 "/home/jens/Source/shotwell/src/util/string.vala"
	while (TRUE) {
#line 1894 "string.c"
		const gchar* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
		gunichar _tmp4_ = 0U;
		gboolean _tmp5_;
		gboolean _tmp6_;
		gunichar _tmp7_;
		GUnicodeType _tmp8_;
		GString* _tmp9_;
		gunichar _tmp10_;
#line 230 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp1_ = istring;
#line 230 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp2_ = g_utf8_normalize (_tmp1_, (gssize) -1, G_NORMALIZE_DEFAULT);
#line 230 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp3_ = _tmp2_;
#line 230 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp5_ = string_get_next_char (_tmp3_, &i, &_tmp4_);
#line 230 "/home/jens/Source/shotwell/src/util/string.vala"
		ch = _tmp4_;
#line 230 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp6_ = !_tmp5_;
#line 230 "/home/jens/Source/shotwell/src/util/string.vala"
		_g_free0 (_tmp3_);
#line 230 "/home/jens/Source/shotwell/src/util/string.vala"
		if (_tmp6_) {
#line 230 "/home/jens/Source/shotwell/src/util/string.vala"
			break;
#line 1923 "string.c"
		}
#line 231 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp7_ = ch;
#line 231 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp8_ = g_unichar_type (_tmp7_);
#line 231 "/home/jens/Source/shotwell/src/util/string.vala"
		switch (_tmp8_) {
#line 231 "/home/jens/Source/shotwell/src/util/string.vala"
			case G_UNICODE_CONTROL:
#line 231 "/home/jens/Source/shotwell/src/util/string.vala"
			case G_UNICODE_FORMAT:
#line 231 "/home/jens/Source/shotwell/src/util/string.vala"
			case G_UNICODE_UNASSIGNED:
#line 231 "/home/jens/Source/shotwell/src/util/string.vala"
			case G_UNICODE_NON_SPACING_MARK:
#line 231 "/home/jens/Source/shotwell/src/util/string.vala"
			case G_UNICODE_COMBINING_MARK:
#line 231 "/home/jens/Source/shotwell/src/util/string.vala"
			case G_UNICODE_ENCLOSING_MARK:
#line 1943 "string.c"
			{
#line 239 "/home/jens/Source/shotwell/src/util/string.vala"
				continue;
#line 1947 "string.c"
			}
			default:
#line 231 "/home/jens/Source/shotwell/src/util/string.vala"
			break;
#line 1952 "string.c"
		}
#line 241 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp9_ = builder;
#line 241 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp10_ = ch;
#line 241 "/home/jens/Source/shotwell/src/util/string.vala"
		g_string_append_unichar (_tmp9_, _tmp10_);
#line 1960 "string.c"
	}
#line 243 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp11_ = builder;
#line 243 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp12_ = _tmp11_->str;
#line 243 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp13_ = g_strdup (_tmp12_);
#line 243 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp13_;
#line 243 "/home/jens/Source/shotwell/src/util/string.vala"
	_g_string_free0 (builder);
#line 243 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 1974 "string.c"
}


gchar* string_to_hex_string (const gchar* str) {
	gchar* result = NULL;
	GString* builder = NULL;
	GString* _tmp0_;
	guint8* data = NULL;
	const gchar* _tmp1_;
	GString* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
#line 246 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (str != NULL, NULL);
#line 247 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = g_string_new ("");
#line 247 "/home/jens/Source/shotwell/src/util/string.vala"
	builder = _tmp0_;
#line 249 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = str;
#line 249 "/home/jens/Source/shotwell/src/util/string.vala"
	data = (guint8*) _tmp1_;
#line 250 "/home/jens/Source/shotwell/src/util/string.vala"
	while (TRUE) {
#line 1999 "string.c"
		guint8* _tmp2_;
		const gchar* _tmp3_ = NULL;
		guint8* _tmp4_;
		GString* _tmp5_;
		guint8* _tmp6_;
#line 250 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp2_ = data;
#line 250 "/home/jens/Source/shotwell/src/util/string.vala"
		if (!(((gint) (*_tmp2_)) != 0)) {
#line 250 "/home/jens/Source/shotwell/src/util/string.vala"
			break;
#line 2011 "string.c"
		}
#line 251 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp4_ = data;
#line 251 "/home/jens/Source/shotwell/src/util/string.vala"
		if (((gint) (*_tmp4_)) != 0) {
#line 251 "/home/jens/Source/shotwell/src/util/string.vala"
			_tmp3_ = " ";
#line 2019 "string.c"
		} else {
#line 251 "/home/jens/Source/shotwell/src/util/string.vala"
			_tmp3_ = "";
#line 2023 "string.c"
		}
#line 251 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp5_ = builder;
#line 251 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp6_ = data;
#line 251 "/home/jens/Source/shotwell/src/util/string.vala"
		data = _tmp6_ + 1;
#line 251 "/home/jens/Source/shotwell/src/util/string.vala"
		g_string_append_printf (_tmp5_, "%02Xh%s", (guint) (*_tmp6_), _tmp3_);
#line 2033 "string.c"
	}
#line 253 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp7_ = builder;
#line 253 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp8_ = _tmp7_->str;
#line 253 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp9_ = g_strdup (_tmp8_);
#line 253 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp9_;
#line 253 "/home/jens/Source/shotwell/src/util/string.vala"
	_g_string_free0 (builder);
#line 253 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 2047 "string.c"
}


guint string_collated_hash (void* ptr) {
	guint result = 0U;
	gchar* str = NULL;
	void* _tmp0_;
	gchar* _tmp1_;
	GHashFunc _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	guint _tmp5_;
	guint _tmp6_;
#line 273 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = ptr;
#line 273 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = g_strdup ((const gchar*) _tmp0_);
#line 273 "/home/jens/Source/shotwell/src/util/string.vala"
	str = _tmp1_;
#line 275 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = g_str_hash;
#line 275 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp3_ = g_utf8_collate_key (str, (gssize) -1);
#line 275 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp4_ = _tmp3_;
#line 275 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp5_ = _tmp2_ (_tmp4_);
#line 275 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp6_ = _tmp5_;
#line 275 "/home/jens/Source/shotwell/src/util/string.vala"
	_g_free0 (_tmp4_);
#line 275 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp6_;
#line 275 "/home/jens/Source/shotwell/src/util/string.vala"
	_g_free0 (str);
#line 275 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 2085 "string.c"
}


guint string_precollated_hash (void* ptr) {
	guint result = 0U;
	GHashFunc _tmp0_;
	void* _tmp1_;
	guint _tmp2_;
#line 280 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = g_str_hash;
#line 280 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = ptr;
#line 280 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = _tmp0_ ((const gchar*) _tmp1_);
#line 280 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp2_;
#line 280 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 2104 "string.c"
}


gint string_collated_compare (void* a, void* b) {
	gint result = 0;
	gchar* astr = NULL;
	void* _tmp0_;
	gchar* _tmp1_;
	gchar* bstr = NULL;
	void* _tmp2_;
	gchar* _tmp3_;
	gint _result_ = 0;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gint _tmp6_;
	gint _tmp7_ = 0;
	gint _tmp8_;
#line 285 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = a;
#line 285 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = g_strdup ((const gchar*) _tmp0_);
#line 285 "/home/jens/Source/shotwell/src/util/string.vala"
	astr = _tmp1_;
#line 286 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = b;
#line 286 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp3_ = g_strdup ((const gchar*) _tmp2_);
#line 286 "/home/jens/Source/shotwell/src/util/string.vala"
	bstr = _tmp3_;
#line 288 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp4_ = astr;
#line 288 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp5_ = bstr;
#line 288 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp6_ = g_utf8_collate (_tmp4_, _tmp5_);
#line 288 "/home/jens/Source/shotwell/src/util/string.vala"
	_result_ = _tmp6_;
#line 290 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp8_ = _result_;
#line 290 "/home/jens/Source/shotwell/src/util/string.vala"
	if (_tmp8_ != 0) {
#line 2146 "string.c"
		gint _tmp9_;
#line 290 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp9_ = _result_;
#line 290 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp7_ = _tmp9_;
#line 2152 "string.c"
	} else {
		GCompareFunc _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		gint _tmp13_;
#line 290 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp10_ = g_strcmp0;
#line 290 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp11_ = astr;
#line 290 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp12_ = bstr;
#line 290 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp13_ = _tmp10_ (_tmp11_, _tmp12_);
#line 290 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp7_ = _tmp13_;
#line 2168 "string.c"
	}
#line 290 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp7_;
#line 290 "/home/jens/Source/shotwell/src/util/string.vala"
	_g_free0 (bstr);
#line 290 "/home/jens/Source/shotwell/src/util/string.vala"
	_g_free0 (astr);
#line 290 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 2178 "string.c"
}


gint string_precollated_compare (const gchar* astr, const gchar* akey, const gchar* bstr, const gchar* bkey) {
	gint result = 0;
	gint _result_ = 0;
	GCompareFunc _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_ = 0;
	gint _tmp5_;
#line 294 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (astr != NULL, 0);
#line 294 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (akey != NULL, 0);
#line 294 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (bstr != NULL, 0);
#line 294 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (bkey != NULL, 0);
#line 295 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = g_strcmp0;
#line 295 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = akey;
#line 295 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = bkey;
#line 295 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp3_ = _tmp0_ (_tmp1_, _tmp2_);
#line 295 "/home/jens/Source/shotwell/src/util/string.vala"
	_result_ = _tmp3_;
#line 297 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp5_ = _result_;
#line 297 "/home/jens/Source/shotwell/src/util/string.vala"
	if (_tmp5_ != 0) {
#line 2213 "string.c"
		gint _tmp6_;
#line 297 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp6_ = _result_;
#line 297 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp4_ = _tmp6_;
#line 2219 "string.c"
	} else {
		GCompareFunc _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		gint _tmp10_;
#line 297 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp7_ = g_strcmp0;
#line 297 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp8_ = astr;
#line 297 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp9_ = bstr;
#line 297 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp10_ = _tmp7_ (_tmp8_, _tmp9_);
#line 297 "/home/jens/Source/shotwell/src/util/string.vala"
		_tmp4_ = _tmp10_;
#line 2235 "string.c"
	}
#line 297 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp4_;
#line 297 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 2241 "string.c"
}


gboolean string_collated_equals (void* a, void* b) {
	gboolean result = FALSE;
	void* _tmp0_;
	void* _tmp1_;
	gint _tmp2_;
#line 302 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = a;
#line 302 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = b;
#line 302 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = string_collated_compare (_tmp0_, _tmp1_);
#line 302 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp2_ == 0;
#line 302 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 2260 "string.c"
}


gboolean string_precollated_equals (const gchar* astr, const gchar* akey, const gchar* bstr, const gchar* bkey) {
	gboolean result = FALSE;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gint _tmp4_;
#line 306 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (astr != NULL, FALSE);
#line 306 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (akey != NULL, FALSE);
#line 306 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (bstr != NULL, FALSE);
#line 306 "/home/jens/Source/shotwell/src/util/string.vala"
	g_return_val_if_fail (bkey != NULL, FALSE);
#line 307 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp0_ = astr;
#line 307 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp1_ = akey;
#line 307 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp2_ = bstr;
#line 307 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp3_ = bkey;
#line 307 "/home/jens/Source/shotwell/src/util/string.vala"
	_tmp4_ = string_precollated_compare (_tmp0_, _tmp1_, _tmp2_, _tmp3_);
#line 307 "/home/jens/Source/shotwell/src/util/string.vala"
	result = _tmp4_ == 0;
#line 307 "/home/jens/Source/shotwell/src/util/string.vala"
	return result;
#line 2293 "string.c"
}



