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


#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <gio/gio.h>
#include <unistd.h>

#define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL)))
#define _g_type_class_unref0(var) ((var == NULL) ? NULL : (var = (g_type_class_unref (var), NULL)))
#define _g_checksum_free0(var) ((var == NULL) ? NULL : (var = (g_checksum_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define WIXL_TYPE_UNIX_INPUT_STREAM (wixl_unix_input_stream_get_type ())
#define WIXL_UNIX_INPUT_STREAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIXL_TYPE_UNIX_INPUT_STREAM, WixlUnixInputStream))
#define WIXL_UNIX_INPUT_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIXL_TYPE_UNIX_INPUT_STREAM, WixlUnixInputStreamClass))
#define WIXL_IS_UNIX_INPUT_STREAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIXL_TYPE_UNIX_INPUT_STREAM))
#define WIXL_IS_UNIX_INPUT_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIXL_TYPE_UNIX_INPUT_STREAM))
#define WIXL_UNIX_INPUT_STREAM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIXL_TYPE_UNIX_INPUT_STREAM, WixlUnixInputStreamClass))

typedef struct _WixlUnixInputStream WixlUnixInputStream;
typedef struct _WixlUnixInputStreamClass WixlUnixInputStreamClass;
typedef struct _WixlUnixInputStreamPrivate WixlUnixInputStreamPrivate;

typedef enum  {
	WIXL_ERROR_FAILED,
	WIXL_ERROR_FIXME
} WixlError;
#define WIXL_ERROR wixl_error_quark ()
struct _WixlUnixInputStream {
	GInputStream parent_instance;
	WixlUnixInputStreamPrivate * priv;
};

struct _WixlUnixInputStreamClass {
	GInputStreamClass parent_class;
};

struct _WixlUnixInputStreamPrivate {
	gint _fd;
};


static gpointer wixl_unix_input_stream_parent_class = NULL;

GQuark wixl_error_quark (void);
void uuid_generate (guchar* uuid);
void uuid_unparse (guchar* uuid, guchar* output);
gchar* wixl_uuid_generate (void);
gpointer wixl_enum_from_string (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, const gchar* str, GError** error);
static GEnumValue* _g_enum_value_dup (GEnumValue* self);
void wixl_hash_table_add (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashTable* h, gconstpointer o);
gchar* wixl_add_braces (const gchar* str);
gchar* wixl_get_uuid (gchar* uuid, GError** error);
glong wixl_now (void);
guint64 wixl_time_to_filetime (glong t);
gchar* wixl_indent (const gchar* space, const gchar* text);
#define WIXL_uuid_namespace "\xde\x73\xba\x5a\xed\x96\x4a\x66\xba\x1b\xfb\xb4\x4e\x65\x9a\xd7"
gchar* wixl_uuid_from_name (const gchar* s);
gchar* wixl_generate_id (const gchar* prefix, guint n, ...);
gchar* wixl_random_id (const gchar* prefix);
gchar* wixl_yesno (gboolean yes);
gboolean wixl_parse_yesno (const gchar* str, gboolean _default_);
gchar* wixl_unquote (const gchar* str);
gchar* wixl_remove_prefix (const gchar* prefix, const gchar* str);
gint wixl_find_closing_paren (const gchar* str);
void wixl_compute_md5 (GFile* file, gint* hash1, gint* hash2, gint* hash3, gint* hash4, GError** error);
GType wixl_unix_input_stream_get_type (void) G_GNUC_CONST;
#define WIXL_UNIX_INPUT_STREAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WIXL_TYPE_UNIX_INPUT_STREAM, WixlUnixInputStreamPrivate))
enum  {
	WIXL_UNIX_INPUT_STREAM_DUMMY_PROPERTY,
	WIXL_UNIX_INPUT_STREAM_FD
};
WixlUnixInputStream* wixl_unix_input_stream_new (gint fd_);
WixlUnixInputStream* wixl_unix_input_stream_construct (GType object_type, gint fd_);
void wixl_unix_input_stream_set_fd (WixlUnixInputStream* self, gint value);
static gssize wixl_unix_input_stream_real_read (GInputStream* base, guint8* buffer, gsize buffer_length1, GCancellable* cancellable, GError** error);
gint wixl_unix_input_stream_get_fd (WixlUnixInputStream* self);
static gboolean wixl_unix_input_stream_real_close (GInputStream* base, GCancellable* cancellable, GError** error);
static void wixl_unix_input_stream_finalize (GObject* obj);
static void _vala_wixl_unix_input_stream_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_wixl_unix_input_stream_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
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);
static gint _vala_array_length (gpointer array);


GQuark wixl_error_quark (void) {
	return g_quark_from_static_string ("wixl_error-quark");
}


gchar* wixl_uuid_generate (void) {
	gchar* result = NULL;
	guchar* udn = NULL;
	guchar* _tmp0_ = NULL;
	gint udn_length1 = 0;
	gint _udn_size_ = 0;
	guchar* id = NULL;
	guchar* _tmp1_ = NULL;
	gint id_length1 = 0;
	gint _id_size_ = 0;
	gchar* _tmp2_ = NULL;
	_tmp0_ = g_new0 (guchar, 50);
	udn = _tmp0_;
	udn_length1 = 50;
	_udn_size_ = udn_length1;
	_tmp1_ = g_new0 (guchar, 16);
	id = _tmp1_;
	id_length1 = 16;
	_id_size_ = id_length1;
	uuid_generate (id);
	uuid_unparse (id, udn);
	_tmp2_ = g_strdup ((const gchar*) udn);
	result = _tmp2_;
	id = (g_free (id), NULL);
	udn = (g_free (udn), NULL);
	return result;
}


static GEnumValue* _g_enum_value_dup (GEnumValue* self) {
	GEnumValue* dup;
	dup = g_new0 (GEnumValue, 1);
	memcpy (dup, self, sizeof (GEnumValue));
	return dup;
}


static gpointer __g_enum_value_dup0 (gpointer self) {
	return self ? _g_enum_value_dup (self) : NULL;
}


gpointer wixl_enum_from_string (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, const gchar* str, GError** error) {
	gpointer result = NULL;
	GEnumClass* k = NULL;
	GTypeClass* _tmp0_ = NULL;
	GEnumValue* v = NULL;
	GEnumClass* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	GEnumValue* _tmp3_ = NULL;
	GEnumValue* _tmp4_ = NULL;
	GEnumValue* _tmp5_ = NULL;
	GEnumValue* _tmp7_ = NULL;
	gint _tmp8_ = 0;
	gpointer _tmp9_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (str != NULL, NULL);
	_tmp0_ = g_type_class_ref (g_type);
	k = (GEnumClass*) _tmp0_;
	_tmp1_ = k;
	_tmp2_ = str;
	_tmp3_ = g_enum_get_value_by_nick (_tmp1_, _tmp2_);
	_tmp4_ = __g_enum_value_dup0 (_tmp3_);
	v = _tmp4_;
	_tmp5_ = v;
	if (_tmp5_ == NULL) {
		GError* _tmp6_ = NULL;
		_tmp6_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FAILED, "Can't convert string to enum");
		_inner_error_ = _tmp6_;
		g_propagate_error (error, _inner_error_);
		_g_free0 (v);
		_g_type_class_unref0 (k);
		return NULL;
	}
	_tmp7_ = v;
	_tmp8_ = (*_tmp7_).value;
	_tmp9_ = ((_tmp8_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_);
	result = _tmp9_;
	_g_free0 (v);
	_g_type_class_unref0 (k);
	return result;
}


void wixl_hash_table_add (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GHashTable* h, gconstpointer o) {
	GHashTable* _tmp0_ = NULL;
	gconstpointer _tmp1_ = NULL;
	gpointer _tmp2_ = NULL;
	gconstpointer _tmp3_ = NULL;
	g_return_if_fail (h != NULL);
	_tmp0_ = h;
	_tmp1_ = o;
	_tmp2_ = ((_tmp1_ != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) _tmp1_) : ((gpointer) _tmp1_);
	_tmp3_ = o;
	g_hash_table_replace (_tmp0_, _tmp2_, _tmp3_);
}


static gchar string_get (const gchar* self, glong index) {
	gchar result = '\0';
	glong _tmp0_ = 0L;
	gchar _tmp1_ = '\0';
	g_return_val_if_fail (self != NULL, '\0');
	_tmp0_ = index;
	_tmp1_ = ((gchar*) self)[_tmp0_];
	result = _tmp1_;
	return result;
}


gchar* wixl_add_braces (const gchar* str) {
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	gchar _tmp1_ = '\0';
	const gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	g_return_val_if_fail (str != NULL, NULL);
	_tmp0_ = str;
	_tmp1_ = string_get (_tmp0_, (glong) 0);
	if (_tmp1_ == '{') {
		const gchar* _tmp2_ = NULL;
		gchar* _tmp3_ = NULL;
		_tmp2_ = str;
		_tmp3_ = g_strdup (_tmp2_);
		result = _tmp3_;
		return result;
	}
	_tmp4_ = str;
	_tmp5_ = g_strconcat ("{", _tmp4_, NULL);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strconcat (_tmp6_, "}", NULL);
	_tmp8_ = _tmp7_;
	_g_free0 (_tmp6_);
	result = _tmp8_;
	return result;
}


gchar* wixl_get_uuid (gchar* uuid, GError** error) {
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	g_return_val_if_fail (uuid != NULL, NULL);
	_tmp0_ = uuid;
	if (g_strcmp0 (_tmp0_, "*") == 0) {
		gchar* _tmp1_ = NULL;
		_tmp1_ = wixl_uuid_generate ();
		_g_free0 (uuid);
		uuid = _tmp1_;
	}
	_tmp2_ = uuid;
	_tmp3_ = wixl_add_braces (_tmp2_);
	_g_free0 (uuid);
	uuid = _tmp3_;
	_tmp4_ = uuid;
	_tmp5_ = g_utf8_strup (_tmp4_, (gssize) -1);
	_g_free0 (uuid);
	uuid = _tmp5_;
	_tmp6_ = uuid;
	_tmp7_ = g_strdup (_tmp6_);
	result = _tmp7_;
	_g_free0 (uuid);
	return result;
}


glong wixl_now (void) {
	glong result = 0L;
	GTimeVal tv = {0};
	GTimeVal _tmp0_ = {0};
	glong _tmp1_ = 0L;
	g_get_current_time (&tv);
	g_get_current_time (&tv);
	_tmp0_ = tv;
	_tmp1_ = _tmp0_.tv_sec;
	result = _tmp1_;
	return result;
}


guint64 wixl_time_to_filetime (glong t) {
	guint64 result = 0ULL;
	glong _tmp0_ = 0L;
	_tmp0_ = t;
	result = (_tmp0_ + (134774ULL * 86400ULL)) * 10000000ULL;
	return result;
}


gchar* wixl_indent (const gchar* space, const gchar* text) {
	gchar* result = NULL;
	gchar* indented = NULL;
	gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar** _tmp2_ = NULL;
	gchar** _tmp3_ = NULL;
	g_return_val_if_fail (space != NULL, NULL);
	g_return_val_if_fail (text != NULL, NULL);
	_tmp0_ = g_strdup ("");
	indented = _tmp0_;
	_tmp1_ = text;
	_tmp3_ = _tmp2_ = g_strsplit (_tmp1_, "\n", 0);
	{
		gchar** l_collection = NULL;
		gint l_collection_length1 = 0;
		gint _l_collection_size_ = 0;
		gint l_it = 0;
		l_collection = _tmp3_;
		l_collection_length1 = _vala_array_length (_tmp2_);
		for (l_it = 0; l_it < _vala_array_length (_tmp2_); l_it = l_it + 1) {
			gchar* _tmp4_ = NULL;
			gchar* l = NULL;
			_tmp4_ = g_strdup (l_collection[l_it]);
			l = _tmp4_;
			{
				const gchar* _tmp5_ = NULL;
				gint _tmp6_ = 0;
				gint _tmp7_ = 0;
				const gchar* _tmp10_ = NULL;
				gint _tmp11_ = 0;
				gint _tmp12_ = 0;
				_tmp5_ = indented;
				_tmp6_ = strlen (_tmp5_);
				_tmp7_ = _tmp6_;
				if (_tmp7_ != 0) {
					const gchar* _tmp8_ = NULL;
					gchar* _tmp9_ = NULL;
					_tmp8_ = indented;
					_tmp9_ = g_strconcat (_tmp8_, "\n", NULL);
					_g_free0 (indented);
					indented = _tmp9_;
				}
				_tmp10_ = l;
				_tmp11_ = strlen (_tmp10_);
				_tmp12_ = _tmp11_;
				if (_tmp12_ != 0) {
					const gchar* _tmp13_ = NULL;
					const gchar* _tmp14_ = NULL;
					const gchar* _tmp15_ = NULL;
					gchar* _tmp16_ = NULL;
					gchar* _tmp17_ = NULL;
					gchar* _tmp18_ = NULL;
					_tmp13_ = indented;
					_tmp14_ = space;
					_tmp15_ = l;
					_tmp16_ = g_strconcat (_tmp14_, _tmp15_, NULL);
					_tmp17_ = _tmp16_;
					_tmp18_ = g_strconcat (_tmp13_, _tmp17_, NULL);
					_g_free0 (indented);
					indented = _tmp18_;
					_g_free0 (_tmp17_);
				}
				_g_free0 (l);
			}
		}
		l_collection = (_vala_array_free (l_collection, l_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	result = indented;
	return result;
}


static guint8* string_get_data (const gchar* self, int* result_length1) {
	guint8* result;
	guint8* res = NULL;
	gint res_length1 = 0;
	gint _res_size_ = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	guint8* _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	guint8* _tmp4_ = NULL;
	gint _tmp4__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	res = (guint8*) self;
	res_length1 = -1;
	_res_size_ = res_length1;
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	res_length1 = (gint) _tmp1_;
	_tmp2_ = res_length1;
	_tmp3_ = res;
	_tmp3__length1 = res_length1;
	_tmp4_ = _tmp3_;
	_tmp4__length1 = _tmp3__length1;
	if (result_length1) {
		*result_length1 = _tmp4__length1;
	}
	result = _tmp4_;
	return result;
}


gchar* wixl_uuid_from_name (const gchar* s) {
	gchar* result = NULL;
	GChecksum* cs = NULL;
	GChecksum* _tmp0_ = NULL;
	guint8 buffer[20] = {0};
	gsize buflen = 0UL;
	guint8* _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	guint8* _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	const gchar* _tmp3_ = NULL;
	guint8* _tmp4_ = NULL;
	gint _tmp4__length1 = 0;
	guint8* _tmp5_ = NULL;
	gint _tmp5__length1 = 0;
	const gchar* _tmp6_ = NULL;
	gint _tmp7_ = 0;
	gint _tmp8_ = 0;
	guint8 _tmp9_ = 0U;
	guint8 _tmp10_ = 0U;
	guint8 _tmp11_ = 0U;
	guint8 _tmp12_ = 0U;
	guint8 _tmp13_ = 0U;
	guint8 _tmp14_ = 0U;
	guint8 _tmp15_ = 0U;
	guint8 _tmp16_ = 0U;
	guint8 _tmp17_ = 0U;
	guint8 _tmp18_ = 0U;
	guint8 _tmp19_ = 0U;
	guint8 _tmp20_ = 0U;
	guint8 _tmp21_ = 0U;
	guint8 _tmp22_ = 0U;
	guint8 _tmp23_ = 0U;
	guint8 _tmp24_ = 0U;
	gchar* _tmp25_ = NULL;
	g_return_val_if_fail (s != NULL, NULL);
	_tmp0_ = g_checksum_new (G_CHECKSUM_SHA1);
	cs = _tmp0_;
	buflen = (gsize) 20;
	_tmp1_ = string_get_data (WIXL_uuid_namespace, &_tmp1__length1);
	_tmp2_ = _tmp1_;
	_tmp2__length1 = _tmp1__length1;
	g_checksum_update (cs, _tmp2_, (gsize) 16);
	_tmp3_ = s;
	_tmp4_ = string_get_data (_tmp3_, &_tmp4__length1);
	_tmp5_ = _tmp4_;
	_tmp5__length1 = _tmp4__length1;
	_tmp6_ = s;
	_tmp7_ = strlen (_tmp6_);
	_tmp8_ = _tmp7_;
	g_checksum_update (cs, _tmp5_, (gsize) _tmp8_);
	g_checksum_get_digest (cs, buffer, &buflen);
	_tmp9_ = buffer[0];
	_tmp10_ = buffer[1];
	_tmp11_ = buffer[2];
	_tmp12_ = buffer[3];
	_tmp13_ = buffer[4];
	_tmp14_ = buffer[5];
	_tmp15_ = buffer[6];
	_tmp16_ = buffer[7];
	_tmp17_ = buffer[8];
	_tmp18_ = buffer[9];
	_tmp19_ = buffer[10];
	_tmp20_ = buffer[11];
	_tmp21_ = buffer[12];
	_tmp22_ = buffer[13];
	_tmp23_ = buffer[14];
	_tmp24_ = buffer[15];
	_tmp25_ = g_strdup_printf ("{%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X}", (guint) _tmp9_, (guint) _tmp10_, (guint) _tmp11_, (guint) _tmp12_, (guint) _tmp13_, (guint) _tmp14_, (guint) ((_tmp15_ & 15) | 0x50), (guint) _tmp16_, (guint) ((_tmp17_ & 0x3F) | 0x80), (guint) _tmp18_, (guint) _tmp19_, (guint) _tmp20_, (guint) _tmp21_, (guint) _tmp22_, (guint) _tmp23_, (guint) _tmp24_);
	result = _tmp25_;
	_g_checksum_free0 (cs);
	return result;
}


static gchar* _vala_g_strjoinv (const gchar* separator, gchar** str_array, int str_array_length1) {
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gchar** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	_tmp0_ = separator;
	if (_tmp0_ == NULL) {
		separator = "";
	}
	_tmp3_ = str_array;
	_tmp3__length1 = str_array_length1;
	if (_tmp3_ != NULL) {
		_tmp2_ = TRUE;
	} else {
		gchar** _tmp4_ = NULL;
		gint _tmp4__length1 = 0;
		_tmp4_ = str_array;
		_tmp4__length1 = str_array_length1;
		_tmp2_ = _tmp4__length1 > 0;
	}
	if (_tmp2_) {
		_tmp1_ = TRUE;
	} else {
		gboolean _tmp5_ = FALSE;
		gchar** _tmp6_ = NULL;
		gint _tmp6__length1 = 0;
		_tmp6_ = str_array;
		_tmp6__length1 = str_array_length1;
		if (_tmp6__length1 == -1) {
			gchar** _tmp7_ = NULL;
			gint _tmp7__length1 = 0;
			const gchar* _tmp8_ = NULL;
			_tmp7_ = str_array;
			_tmp7__length1 = str_array_length1;
			_tmp8_ = _tmp7_[0];
			_tmp5_ = _tmp8_ != NULL;
		} else {
			_tmp5_ = FALSE;
		}
		_tmp1_ = _tmp5_;
	}
	if (_tmp1_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp31_ = 0;
		gint _tmp33_ = 0;
		gint _tmp34_ = 0;
		gsize _tmp35_ = 0UL;
		const gchar* _tmp36_ = NULL;
		gint _tmp37_ = 0;
		gint _tmp38_ = 0;
		gint _tmp39_ = 0;
		const gchar* res = NULL;
		gsize _tmp40_ = 0UL;
		void* _tmp41_ = NULL;
		void* ptr = NULL;
		const gchar* _tmp42_ = NULL;
		gchar** _tmp43_ = NULL;
		gint _tmp43__length1 = 0;
		const gchar* _tmp44_ = NULL;
		void* _tmp45_ = NULL;
		const gchar* _tmp62_ = NULL;
		len = (gsize) 1;
		{
			gboolean _tmp9_ = FALSE;
			i = 0;
			_tmp9_ = TRUE;
			while (TRUE) {
				gboolean _tmp11_ = FALSE;
				gboolean _tmp12_ = FALSE;
				gchar** _tmp13_ = NULL;
				gint _tmp13__length1 = 0;
				gint _tmp21_ = 0;
				gchar** _tmp22_ = NULL;
				gint _tmp22__length1 = 0;
				gint _tmp23_ = 0;
				const gchar* _tmp24_ = NULL;
				gsize _tmp30_ = 0UL;
				if (!_tmp9_) {
					gint _tmp10_ = 0;
					_tmp10_ = i;
					i = _tmp10_ + 1;
				}
				_tmp9_ = FALSE;
				_tmp13_ = str_array;
				_tmp13__length1 = str_array_length1;
				if (_tmp13__length1 != -1) {
					gint _tmp14_ = 0;
					gchar** _tmp15_ = NULL;
					gint _tmp15__length1 = 0;
					_tmp14_ = i;
					_tmp15_ = str_array;
					_tmp15__length1 = str_array_length1;
					_tmp12_ = _tmp14_ < _tmp15__length1;
				} else {
					_tmp12_ = FALSE;
				}
				if (_tmp12_) {
					_tmp11_ = TRUE;
				} else {
					gboolean _tmp16_ = FALSE;
					gchar** _tmp17_ = NULL;
					gint _tmp17__length1 = 0;
					_tmp17_ = str_array;
					_tmp17__length1 = str_array_length1;
					if (_tmp17__length1 == -1) {
						gchar** _tmp18_ = NULL;
						gint _tmp18__length1 = 0;
						gint _tmp19_ = 0;
						const gchar* _tmp20_ = NULL;
						_tmp18_ = str_array;
						_tmp18__length1 = str_array_length1;
						_tmp19_ = i;
						_tmp20_ = _tmp18_[_tmp19_];
						_tmp16_ = _tmp20_ != NULL;
					} else {
						_tmp16_ = FALSE;
					}
					_tmp11_ = _tmp16_;
				}
				if (!_tmp11_) {
					break;
				}
				_tmp22_ = str_array;
				_tmp22__length1 = str_array_length1;
				_tmp23_ = i;
				_tmp24_ = _tmp22_[_tmp23_];
				if (_tmp24_ != NULL) {
					gchar** _tmp25_ = NULL;
					gint _tmp25__length1 = 0;
					gint _tmp26_ = 0;
					const gchar* _tmp27_ = NULL;
					gint _tmp28_ = 0;
					gint _tmp29_ = 0;
					_tmp25_ = str_array;
					_tmp25__length1 = str_array_length1;
					_tmp26_ = i;
					_tmp27_ = _tmp25_[_tmp26_];
					_tmp28_ = strlen ((const gchar*) _tmp27_);
					_tmp29_ = _tmp28_;
					_tmp21_ = _tmp29_;
				} else {
					_tmp21_ = 0;
				}
				_tmp30_ = len;
				len = _tmp30_ + _tmp21_;
			}
		}
		_tmp31_ = i;
		if (_tmp31_ == 0) {
			gchar* _tmp32_ = NULL;
			_tmp32_ = g_strdup ("");
			result = _tmp32_;
			return result;
		}
		_tmp33_ = i;
		str_array_length1 = _tmp33_;
		_tmp34_ = str_array_length1;
		_tmp35_ = len;
		_tmp36_ = separator;
		_tmp37_ = strlen ((const gchar*) _tmp36_);
		_tmp38_ = _tmp37_;
		_tmp39_ = i;
		len = _tmp35_ + (_tmp38_ * (_tmp39_ - 1));
		_tmp40_ = len;
		_tmp41_ = g_malloc (_tmp40_);
		res = _tmp41_;
		_tmp42_ = res;
		_tmp43_ = str_array;
		_tmp43__length1 = str_array_length1;
		_tmp44_ = _tmp43_[0];
		_tmp45_ = g_stpcpy ((void*) _tmp42_, (const gchar*) _tmp44_);
		ptr = _tmp45_;
		{
			gboolean _tmp46_ = FALSE;
			i = 1;
			_tmp46_ = TRUE;
			while (TRUE) {
				gint _tmp48_ = 0;
				gchar** _tmp49_ = NULL;
				gint _tmp49__length1 = 0;
				void* _tmp50_ = NULL;
				const gchar* _tmp51_ = NULL;
				void* _tmp52_ = NULL;
				const gchar* _tmp53_ = NULL;
				gchar** _tmp54_ = NULL;
				gint _tmp54__length1 = 0;
				gint _tmp55_ = 0;
				const gchar* _tmp56_ = NULL;
				void* _tmp60_ = NULL;
				void* _tmp61_ = NULL;
				if (!_tmp46_) {
					gint _tmp47_ = 0;
					_tmp47_ = i;
					i = _tmp47_ + 1;
				}
				_tmp46_ = FALSE;
				_tmp48_ = i;
				_tmp49_ = str_array;
				_tmp49__length1 = str_array_length1;
				if (!(_tmp48_ < _tmp49__length1)) {
					break;
				}
				_tmp50_ = ptr;
				_tmp51_ = separator;
				_tmp52_ = g_stpcpy (_tmp50_, (const gchar*) _tmp51_);
				ptr = _tmp52_;
				_tmp54_ = str_array;
				_tmp54__length1 = str_array_length1;
				_tmp55_ = i;
				_tmp56_ = _tmp54_[_tmp55_];
				if (_tmp56_ != NULL) {
					gchar** _tmp57_ = NULL;
					gint _tmp57__length1 = 0;
					gint _tmp58_ = 0;
					const gchar* _tmp59_ = NULL;
					_tmp57_ = str_array;
					_tmp57__length1 = str_array_length1;
					_tmp58_ = i;
					_tmp59_ = _tmp57_[_tmp58_];
					_tmp53_ = (const gchar*) _tmp59_;
				} else {
					_tmp53_ = "";
				}
				_tmp60_ = ptr;
				_tmp61_ = g_stpcpy (_tmp60_, _tmp53_);
				ptr = _tmp61_;
			}
		}
		_tmp62_ = res;
		res = NULL;
		result = (gchar*) _tmp62_;
		return result;
	} else {
		gchar* _tmp63_ = NULL;
		_tmp63_ = g_strdup ("");
		result = _tmp63_;
		return result;
	}
}


static gchar* string_slice (const gchar* self, glong start, glong end) {
	gchar* result = NULL;
	glong string_length = 0L;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	glong _tmp2_ = 0L;
	glong _tmp5_ = 0L;
	gboolean _tmp8_ = FALSE;
	glong _tmp9_ = 0L;
	gboolean _tmp12_ = FALSE;
	glong _tmp13_ = 0L;
	glong _tmp16_ = 0L;
	glong _tmp17_ = 0L;
	glong _tmp18_ = 0L;
	glong _tmp19_ = 0L;
	glong _tmp20_ = 0L;
	gchar* _tmp21_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	_tmp2_ = start;
	if (_tmp2_ < ((glong) 0)) {
		glong _tmp3_ = 0L;
		glong _tmp4_ = 0L;
		_tmp3_ = string_length;
		_tmp4_ = start;
		start = _tmp3_ + _tmp4_;
	}
	_tmp5_ = end;
	if (_tmp5_ < ((glong) 0)) {
		glong _tmp6_ = 0L;
		glong _tmp7_ = 0L;
		_tmp6_ = string_length;
		_tmp7_ = end;
		end = _tmp6_ + _tmp7_;
	}
	_tmp9_ = start;
	if (_tmp9_ >= ((glong) 0)) {
		glong _tmp10_ = 0L;
		glong _tmp11_ = 0L;
		_tmp10_ = start;
		_tmp11_ = string_length;
		_tmp8_ = _tmp10_ <= _tmp11_;
	} else {
		_tmp8_ = FALSE;
	}
	g_return_val_if_fail (_tmp8_, NULL);
	_tmp13_ = end;
	if (_tmp13_ >= ((glong) 0)) {
		glong _tmp14_ = 0L;
		glong _tmp15_ = 0L;
		_tmp14_ = end;
		_tmp15_ = string_length;
		_tmp12_ = _tmp14_ <= _tmp15_;
	} else {
		_tmp12_ = FALSE;
	}
	g_return_val_if_fail (_tmp12_, NULL);
	_tmp16_ = start;
	_tmp17_ = end;
	g_return_val_if_fail (_tmp16_ <= _tmp17_, NULL);
	_tmp18_ = start;
	_tmp19_ = end;
	_tmp20_ = start;
	_tmp21_ = g_strndup (((gchar*) self) + _tmp18_, (gsize) (_tmp19_ - _tmp20_));
	result = _tmp21_;
	return result;
}


gchar* wixl_generate_id (const gchar* prefix, guint n, ...) {
	gchar* result = NULL;
	va_list l = {0};
	gchar** args = NULL;
	guint _tmp0_ = 0U;
	gchar** _tmp1_ = NULL;
	gint args_length1 = 0;
	gint _args_size_ = 0;
	gchar* data = NULL;
	gchar** _tmp14_ = NULL;
	gint _tmp14__length1 = 0;
	gchar* _tmp15_ = NULL;
	gchar* hash = NULL;
	gchar* _tmp16_ = NULL;
	gchar* str = NULL;
	const gchar* _tmp17_ = NULL;
	gchar* _tmp18_ = NULL;
	gchar* _tmp19_ = NULL;
	gchar* _tmp20_ = NULL;
	gchar* _tmp21_ = NULL;
	gchar* _tmp22_ = NULL;
	gchar* _tmp23_ = NULL;
	g_return_val_if_fail (prefix != NULL, NULL);
	va_start (l, n);
	_tmp0_ = n;
	_tmp1_ = g_new0 (gchar*, _tmp0_ + 1);
	args = _tmp1_;
	args_length1 = _tmp0_;
	_args_size_ = args_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				guint _tmp4_ = 0U;
				gchar* val = NULL;
				const gchar* _tmp5_ = NULL;
				gchar* _tmp6_ = NULL;
				const gchar* _tmp7_ = NULL;
				gchar** _tmp8_ = NULL;
				gint _tmp8__length1 = 0;
				gint _tmp9_ = 0;
				const gchar* _tmp10_ = NULL;
				gchar* _tmp11_ = NULL;
				gchar* _tmp12_ = NULL;
				gint _tmp13_ = 0;
				if (!_tmp2_) {
					guint _tmp3_ = 0U;
					_tmp3_ = n;
					n = _tmp3_ - 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = n;
				if (!(_tmp4_ > ((guint) 0))) {
					break;
				}
				_tmp5_ = va_arg (l, gchar*);
				_tmp6_ = g_strdup (_tmp5_);
				val = _tmp6_;
				_tmp7_ = val;
				if (_tmp7_ == NULL) {
					_g_free0 (val);
					continue;
				}
				_tmp8_ = args;
				_tmp8__length1 = args_length1;
				_tmp9_ = i;
				_tmp10_ = val;
				_tmp11_ = g_strdup (_tmp10_);
				_g_free0 (_tmp8_[_tmp9_]);
				_tmp8_[_tmp9_] = _tmp11_;
				_tmp12_ = _tmp8_[_tmp9_];
				_tmp13_ = i;
				i = _tmp13_ + 1;
				_g_free0 (val);
			}
		}
	}
	_tmp14_ = args;
	_tmp14__length1 = args_length1;
	_tmp15_ = _vala_g_strjoinv ("|", _tmp14_, _tmp14__length1);
	data = _tmp15_;
	_tmp16_ = g_compute_checksum_for_string (G_CHECKSUM_SHA1, data, (gsize) -1);
	hash = _tmp16_;
	_tmp17_ = prefix;
	_tmp18_ = string_slice (hash, (glong) 0, (glong) 32);
	_tmp19_ = _tmp18_;
	_tmp20_ = g_utf8_strup (_tmp19_, (gssize) -1);
	_tmp21_ = _tmp20_;
	_tmp22_ = g_strconcat (_tmp17_, _tmp21_, NULL);
	_tmp23_ = _tmp22_;
	_g_free0 (_tmp21_);
	_g_free0 (_tmp19_);
	str = _tmp23_;
	result = str;
	_g_free0 (hash);
	_g_free0 (data);
	args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
	va_end (l);
	return result;
}


gchar* wixl_random_id (const gchar* prefix) {
	gchar* result = NULL;
	guint32* data = NULL;
	guint32* _tmp0_ = NULL;
	gint data_length1 = 0;
	gint _data_size_ = 0;
	gchar* hash = NULL;
	guint32* _tmp8_ = NULL;
	gint _tmp8__length1 = 0;
	gchar* _tmp9_ = NULL;
	const gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	gchar* _tmp14_ = NULL;
	gchar* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	g_return_val_if_fail (prefix != NULL, NULL);
	_tmp0_ = g_new0 (guint32, 8);
	data = _tmp0_;
	data_length1 = 8;
	_data_size_ = data_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				gint _tmp3_ = 0;
				guint32* _tmp4_ = NULL;
				gint _tmp4__length1 = 0;
				gint _tmp5_ = 0;
				guint32 _tmp6_ = 0U;
				guint32 _tmp7_ = 0U;
				if (!_tmp1_) {
					gint _tmp2_ = 0;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				_tmp3_ = i;
				if (!(_tmp3_ < 8)) {
					break;
				}
				_tmp4_ = data;
				_tmp4__length1 = data_length1;
				_tmp5_ = i;
				_tmp6_ = g_random_int ();
				_tmp4_[_tmp5_] = _tmp6_;
				_tmp7_ = _tmp4_[_tmp5_];
			}
		}
	}
	_tmp8_ = data;
	_tmp8__length1 = data_length1;
	_tmp9_ = g_compute_checksum_for_data (G_CHECKSUM_SHA1, (guint8*) _tmp8_, (_tmp8__length1 * sizeof (guint32)) / sizeof (guint8));
	hash = _tmp9_;
	_tmp10_ = prefix;
	_tmp11_ = string_slice (hash, (glong) 0, (glong) 32);
	_tmp12_ = _tmp11_;
	_tmp13_ = g_utf8_strup (_tmp12_, (gssize) -1);
	_tmp14_ = _tmp13_;
	_tmp15_ = g_strconcat (_tmp10_, _tmp14_, NULL);
	_tmp16_ = _tmp15_;
	_g_free0 (_tmp14_);
	_g_free0 (_tmp12_);
	result = _tmp16_;
	_g_free0 (hash);
	data = (g_free (data), NULL);
	return result;
}


gchar* wixl_yesno (gboolean yes) {
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	gchar* _tmp2_ = NULL;
	_tmp1_ = yes;
	if (_tmp1_) {
		_tmp0_ = "yes";
	} else {
		_tmp0_ = "no";
	}
	_tmp2_ = g_strdup (_tmp0_);
	result = _tmp2_;
	return result;
}


gboolean wixl_parse_yesno (const gchar* str, gboolean _default_) {
	gboolean result = FALSE;
	const gchar* _tmp0_ = NULL;
	gboolean _tmp2_ = FALSE;
	const gchar* _tmp3_ = NULL;
	gchar _tmp4_ = '\0';
	_tmp0_ = str;
	if (_tmp0_ == NULL) {
		gboolean _tmp1_ = FALSE;
		_tmp1_ = _default_;
		result = _tmp1_;
		return result;
	}
	_tmp3_ = str;
	_tmp4_ = string_get (_tmp3_, (glong) 0);
	if (_tmp4_ == 'Y') {
		_tmp2_ = TRUE;
	} else {
		const gchar* _tmp5_ = NULL;
		gchar _tmp6_ = '\0';
		_tmp5_ = str;
		_tmp6_ = string_get (_tmp5_, (glong) 0);
		_tmp2_ = _tmp6_ == 'y';
	}
	result = _tmp2_;
	return result;
}


gchar* wixl_unquote (const gchar* str) {
	gchar* result = NULL;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp2_ = NULL;
	gchar _tmp3_ = '\0';
	const gchar* _tmp19_ = NULL;
	gchar* _tmp20_ = NULL;
	g_return_val_if_fail (str != NULL, NULL);
	_tmp2_ = str;
	_tmp3_ = string_get (_tmp2_, (glong) 0);
	if (_tmp3_ == '\'') {
		const gchar* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
		gint _tmp6_ = 0;
		gint _tmp7_ = 0;
		gchar _tmp8_ = '\0';
		_tmp4_ = str;
		_tmp5_ = str;
		_tmp6_ = strlen (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = string_get (_tmp4_, (glong) (_tmp7_ - 1));
		_tmp1_ = _tmp8_ == '\'';
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp9_ = FALSE;
		const gchar* _tmp10_ = NULL;
		gchar _tmp11_ = '\0';
		_tmp10_ = str;
		_tmp11_ = string_get (_tmp10_, (glong) 0);
		if (_tmp11_ == '"') {
			const gchar* _tmp12_ = NULL;
			const gchar* _tmp13_ = NULL;
			gint _tmp14_ = 0;
			gint _tmp15_ = 0;
			gchar _tmp16_ = '\0';
			_tmp12_ = str;
			_tmp13_ = str;
			_tmp14_ = strlen (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = string_get (_tmp12_, (glong) (_tmp15_ - 1));
			_tmp9_ = _tmp16_ == '"';
		} else {
			_tmp9_ = FALSE;
		}
		_tmp0_ = _tmp9_;
	}
	if (_tmp0_) {
		const gchar* _tmp17_ = NULL;
		gchar* _tmp18_ = NULL;
		_tmp17_ = str;
		_tmp18_ = string_slice (_tmp17_, (glong) 1, (glong) -1);
		result = _tmp18_;
		return result;
	}
	_tmp19_ = str;
	_tmp20_ = g_strdup (_tmp19_);
	result = _tmp20_;
	return result;
}


gchar* wixl_remove_prefix (const gchar* prefix, const gchar* str) {
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	const gchar* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	g_return_val_if_fail (prefix != NULL, NULL);
	g_return_val_if_fail (str != NULL, NULL);
	_tmp0_ = str;
	_tmp1_ = prefix;
	_tmp2_ = g_str_has_prefix (_tmp0_, _tmp1_);
	if (_tmp2_) {
		const gchar* _tmp3_ = NULL;
		const gchar* _tmp4_ = NULL;
		gint _tmp5_ = 0;
		gint _tmp6_ = 0;
		const gchar* _tmp7_ = NULL;
		gint _tmp8_ = 0;
		gint _tmp9_ = 0;
		gchar* _tmp10_ = NULL;
		_tmp3_ = str;
		_tmp4_ = prefix;
		_tmp5_ = strlen (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = str;
		_tmp8_ = strlen (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = string_slice (_tmp3_, (glong) _tmp6_, (glong) _tmp9_);
		result = _tmp10_;
		return result;
	}
	_tmp11_ = str;
	_tmp12_ = g_strdup (_tmp11_);
	result = _tmp12_;
	return result;
}


gint wixl_find_closing_paren (const gchar* str) {
	gint result = 0;
	const gchar* _tmp0_ = NULL;
	gchar _tmp1_ = '\0';
	gint open_count = 0;
	gint close_count = 0;
	g_return_val_if_fail (str != NULL, 0);
	_tmp0_ = str;
	_tmp1_ = string_get (_tmp0_, (glong) 0);
	g_return_val_if_fail (_tmp1_ == '(', -1);
	open_count = 1;
	close_count = 0;
	{
		gint pos = 0;
		pos = 1;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gint _tmp4_ = 0;
				const gchar* _tmp5_ = NULL;
				gint _tmp6_ = 0;
				gint _tmp7_ = 0;
				const gchar* _tmp8_ = NULL;
				gint _tmp9_ = 0;
				gchar _tmp10_ = '\0';
				if (!_tmp2_) {
					gint _tmp3_ = 0;
					_tmp3_ = pos;
					pos = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = pos;
				_tmp5_ = str;
				_tmp6_ = strlen (_tmp5_);
				_tmp7_ = _tmp6_;
				if (!(_tmp4_ < _tmp7_)) {
					break;
				}
				_tmp8_ = str;
				_tmp9_ = pos;
				_tmp10_ = string_get (_tmp8_, (glong) _tmp9_);
				if (_tmp10_ == '(') {
					gint _tmp11_ = 0;
					_tmp11_ = open_count;
					open_count = _tmp11_ + 1;
				} else {
					const gchar* _tmp12_ = NULL;
					gint _tmp13_ = 0;
					gchar _tmp14_ = '\0';
					_tmp12_ = str;
					_tmp13_ = pos;
					_tmp14_ = string_get (_tmp12_, (glong) _tmp13_);
					if (_tmp14_ == ')') {
						gint _tmp15_ = 0;
						gint _tmp16_ = 0;
						gint _tmp17_ = 0;
						_tmp15_ = close_count;
						close_count = _tmp15_ + 1;
						_tmp16_ = open_count;
						_tmp17_ = close_count;
						if (_tmp16_ == _tmp17_) {
							result = pos;
							return result;
						}
					}
				}
			}
		}
	}
	result = -1;
	return result;
}


void wixl_compute_md5 (GFile* file, gint* hash1, gint* hash2, gint* hash3, gint* hash4, GError** error) {
	GChecksum* checksum = NULL;
	GChecksum* _tmp0_ = NULL;
	GFileInputStream* stream = NULL;
	GFile* _tmp1_ = NULL;
	GFileInputStream* _tmp2_ = NULL;
	guint8 fbuf[4096] = {0};
	gsize size = 0UL;
	gint buffer[4] = {0};
	gsize buflen = 0UL;
	GChecksum* _tmp9_ = NULL;
	gint _tmp10_ = 0;
	gint _tmp11_ = 0;
	gint _tmp12_ = 0;
	gint _tmp13_ = 0;
	GError * _inner_error_ = NULL;
	g_return_if_fail (file != NULL);
	_tmp0_ = g_checksum_new (G_CHECKSUM_MD5);
	checksum = _tmp0_;
	_tmp1_ = file;
	_tmp2_ = g_file_read (_tmp1_, NULL, &_inner_error_);
	stream = _tmp2_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		_g_checksum_free0 (checksum);
		return;
	}
	while (TRUE) {
		gssize _tmp3_ = 0L;
		GFileInputStream* _tmp4_ = NULL;
		gssize _tmp5_ = 0L;
		gsize _tmp6_ = 0UL;
		GChecksum* _tmp7_ = NULL;
		gsize _tmp8_ = 0UL;
		_tmp4_ = stream;
		_tmp5_ = g_input_stream_read ((GInputStream*) _tmp4_, fbuf, (gsize) 4096, NULL, &_inner_error_);
		_tmp3_ = _tmp5_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			g_propagate_error (error, _inner_error_);
			_g_object_unref0 (stream);
			_g_checksum_free0 (checksum);
			return;
		}
		size = (gsize) _tmp3_;
		_tmp6_ = size;
		if (!(_tmp6_ > ((gsize) 0))) {
			break;
		}
		_tmp7_ = checksum;
		_tmp8_ = size;
		g_checksum_update (_tmp7_, fbuf, _tmp8_);
	}
	buflen = (gsize) 16;
	_tmp9_ = checksum;
	g_checksum_get_digest (_tmp9_, (guint8*) buffer, &buflen);
	_tmp10_ = buffer[0];
	*hash1 = _tmp10_;
	_tmp11_ = buffer[1];
	*hash2 = _tmp11_;
	_tmp12_ = buffer[2];
	*hash3 = _tmp12_;
	_tmp13_ = buffer[3];
	*hash4 = _tmp13_;
	_g_object_unref0 (stream);
	_g_checksum_free0 (checksum);
}


WixlUnixInputStream* wixl_unix_input_stream_construct (GType object_type, gint fd_) {
	WixlUnixInputStream * self = NULL;
	gint _tmp0_ = 0;
	self = (WixlUnixInputStream*) g_object_new (object_type, NULL);
	_tmp0_ = fd_;
	wixl_unix_input_stream_set_fd (self, _tmp0_);
	return self;
}


WixlUnixInputStream* wixl_unix_input_stream_new (gint fd_) {
	return wixl_unix_input_stream_construct (WIXL_TYPE_UNIX_INPUT_STREAM, fd_);
}


static gssize wixl_unix_input_stream_real_read (GInputStream* base, guint8* buffer, gsize buffer_length1, GCancellable* cancellable, GError** error) {
	WixlUnixInputStream * self;
	gssize result = 0L;
	gint _tmp0_ = 0;
	guint8* _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	guint8* _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	gssize _tmp3_ = 0L;
	self = (WixlUnixInputStream*) base;
	_tmp0_ = self->priv->_fd;
	_tmp1_ = buffer;
	_tmp1__length1 = (gint) buffer_length1;
	_tmp2_ = buffer;
	_tmp2__length1 = (gint) buffer_length1;
	_tmp3_ = read (_tmp0_, _tmp1_, (gsize) _tmp2__length1);
	result = _tmp3_;
	return result;
}


static gboolean wixl_unix_input_stream_real_close (GInputStream* base, GCancellable* cancellable, GError** error) {
	WixlUnixInputStream * self;
	gboolean result = FALSE;
	self = (WixlUnixInputStream*) base;
	result = TRUE;
	return result;
}


gint wixl_unix_input_stream_get_fd (WixlUnixInputStream* self) {
	gint result;
	gint _tmp0_ = 0;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_fd;
	result = _tmp0_;
	return result;
}


void wixl_unix_input_stream_set_fd (WixlUnixInputStream* self, gint value) {
	gint _tmp0_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_fd = _tmp0_;
	g_object_notify ((GObject *) self, "fd");
}


static void wixl_unix_input_stream_class_init (WixlUnixInputStreamClass * klass) {
	wixl_unix_input_stream_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (WixlUnixInputStreamPrivate));
	((GInputStreamClass *) klass)->read_fn = (gssize (*)(GInputStream*, guint8*, gsize, GCancellable*, GError**)) wixl_unix_input_stream_real_read;
	((GInputStreamClass *) klass)->close_fn = (gboolean (*)(GInputStream*, GCancellable*, GError**)) wixl_unix_input_stream_real_close;
	G_OBJECT_CLASS (klass)->get_property = _vala_wixl_unix_input_stream_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_wixl_unix_input_stream_set_property;
	G_OBJECT_CLASS (klass)->finalize = wixl_unix_input_stream_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIXL_UNIX_INPUT_STREAM_FD, g_param_spec_int ("fd", "fd", "fd", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
}


static void wixl_unix_input_stream_instance_init (WixlUnixInputStream * self) {
	self->priv = WIXL_UNIX_INPUT_STREAM_GET_PRIVATE (self);
}


static void wixl_unix_input_stream_finalize (GObject* obj) {
	WixlUnixInputStream * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIXL_TYPE_UNIX_INPUT_STREAM, WixlUnixInputStream);
	G_OBJECT_CLASS (wixl_unix_input_stream_parent_class)->finalize (obj);
}


GType wixl_unix_input_stream_get_type (void) {
	static volatile gsize wixl_unix_input_stream_type_id__volatile = 0;
	if (g_once_init_enter (&wixl_unix_input_stream_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (WixlUnixInputStreamClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) wixl_unix_input_stream_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WixlUnixInputStream), 0, (GInstanceInitFunc) wixl_unix_input_stream_instance_init, NULL };
		GType wixl_unix_input_stream_type_id;
		wixl_unix_input_stream_type_id = g_type_register_static (g_input_stream_get_type (), "WixlUnixInputStream", &g_define_type_info, 0);
		g_once_init_leave (&wixl_unix_input_stream_type_id__volatile, wixl_unix_input_stream_type_id);
	}
	return wixl_unix_input_stream_type_id__volatile;
}


static void _vala_wixl_unix_input_stream_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	WixlUnixInputStream * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIXL_TYPE_UNIX_INPUT_STREAM, WixlUnixInputStream);
	switch (property_id) {
		case WIXL_UNIX_INPUT_STREAM_FD:
		g_value_set_int (value, wixl_unix_input_stream_get_fd (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_wixl_unix_input_stream_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	WixlUnixInputStream * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIXL_TYPE_UNIX_INPUT_STREAM, WixlUnixInputStream);
	switch (property_id) {
		case WIXL_UNIX_INPUT_STREAM_FD:
		wixl_unix_input_stream_set_fd (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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);
}


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



