/* iso-extractor.c generated by valac 0.21.2, the Vala compiler
 * generated from iso-extractor.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/
/* Helper class to extract files from an ISO image*/

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <libcommon.h>
#include <gio/gio.h>
#include <glib/gstdio.h>
#include <errno.h>


#define BOXES_TYPE_ISO_EXTRACTOR (boxes_iso_extractor_get_type ())
#define BOXES_ISO_EXTRACTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_ISO_EXTRACTOR, BoxesISOExtractor))
#define BOXES_ISO_EXTRACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_ISO_EXTRACTOR, BoxesISOExtractorClass))
#define BOXES_IS_ISO_EXTRACTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_ISO_EXTRACTOR))
#define BOXES_IS_ISO_EXTRACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_ISO_EXTRACTOR))
#define BOXES_ISO_EXTRACTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_ISO_EXTRACTOR, BoxesISOExtractorClass))

typedef struct _BoxesISOExtractor BoxesISOExtractor;
typedef struct _BoxesISOExtractorClass BoxesISOExtractorClass;
typedef struct _BoxesISOExtractorPrivate BoxesISOExtractorPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _BoxesIsoExtractorMountMediaData BoxesIsoExtractorMountMediaData;

struct _BoxesISOExtractor {
	GObject parent_instance;
	BoxesISOExtractorPrivate * priv;
};

struct _BoxesISOExtractorClass {
	GObjectClass parent_class;
};

struct _BoxesISOExtractorPrivate {
	gchar* device_file;
	gchar* mount_point;
	gboolean mounted;
};

struct _BoxesIsoExtractorMountMediaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesISOExtractor* self;
	GCancellable* cancellable;
	gboolean _tmp0_;
	gchar* iso_name;
	const gchar* _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* temp_name;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* mount_point;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	const gchar* _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	const gchar* _tmp17_;
	GError* _tmp18_;
	const gchar* _tmp19_;
	gchar* _tmp20_;
	const gchar* _tmp21_;
	const gchar* _tmp22_;
	gchar** argv;
	gchar* _tmp23_;
	gchar* _tmp24_;
	const gchar* _tmp25_;
	gchar* _tmp26_;
	const gchar* _tmp27_;
	gchar* _tmp28_;
	gchar** _tmp29_;
	gint argv_length1;
	gint _argv_size_;
	gchar** _tmp30_;
	gint _tmp30__length1;
	GCancellable* _tmp31_;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	GError * _inner_error_;
};


static gpointer boxes_iso_extractor_parent_class = NULL;

GType boxes_iso_extractor_get_type (void) G_GNUC_CONST;
#define BOXES_ISO_EXTRACTOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_ISO_EXTRACTOR, BoxesISOExtractorPrivate))
enum  {
	BOXES_ISO_EXTRACTOR_DUMMY_PROPERTY
};
BoxesISOExtractor* boxes_iso_extractor_new (const gchar* iso_path);
BoxesISOExtractor* boxes_iso_extractor_construct (GType object_type, const gchar* iso_path);
static void boxes_iso_extractor_mount_media_data_free (gpointer _data);
void boxes_iso_extractor_mount_media (BoxesISOExtractor* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_iso_extractor_mount_media_finish (BoxesISOExtractor* self, GAsyncResult* _res_, GError** error);
static gboolean boxes_iso_extractor_mount_media_co (BoxesIsoExtractorMountMediaData* _data_);
static void boxes_iso_extractor_mount_media_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
gchar* boxes_iso_extractor_get_absolute_path (BoxesISOExtractor* self, const gchar* relative_path, GError** error);
static void boxes_iso_extractor_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


BoxesISOExtractor* boxes_iso_extractor_construct (GType object_type, const gchar* iso_path) {
	BoxesISOExtractor * self = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
#line 9 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	g_return_val_if_fail (iso_path != NULL, NULL);
#line 9 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	self = (BoxesISOExtractor*) g_object_new (object_type, NULL);
#line 10 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp0_ = iso_path;
#line 10 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 10 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_g_free0 (self->priv->device_file);
#line 10 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	self->priv->device_file = _tmp1_;
#line 9 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	return self;
#line 137 "iso-extractor.c"
}


BoxesISOExtractor* boxes_iso_extractor_new (const gchar* iso_path) {
#line 9 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	return boxes_iso_extractor_construct (BOXES_TYPE_ISO_EXTRACTOR, iso_path);
#line 144 "iso-extractor.c"
}


static void boxes_iso_extractor_mount_media_data_free (gpointer _data) {
	BoxesIsoExtractorMountMediaData* _data_;
	_data_ = _data;
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_g_object_unref0 (_data_->cancellable);
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_g_object_unref0 (_data_->self);
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	g_slice_free (BoxesIsoExtractorMountMediaData, _data_);
#line 157 "iso-extractor.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	return self ? g_object_ref (self) : NULL;
#line 164 "iso-extractor.c"
}


void boxes_iso_extractor_mount_media (BoxesISOExtractor* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesIsoExtractorMountMediaData* _data_;
	BoxesISOExtractor* _tmp0_ = NULL;
	GCancellable* _tmp1_ = NULL;
	GCancellable* _tmp2_ = NULL;
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_ = g_slice_new0 (BoxesIsoExtractorMountMediaData);
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_iso_extractor_mount_media);
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_iso_extractor_mount_media_data_free);
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->self = _tmp0_;
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp1_ = cancellable;
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_g_object_unref0 (_data_->cancellable);
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->cancellable = _tmp2_;
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	boxes_iso_extractor_mount_media_co (_data_);
#line 193 "iso-extractor.c"
}


void boxes_iso_extractor_mount_media_finish (BoxesISOExtractor* self, GAsyncResult* _res_, GError** error) {
	BoxesIsoExtractorMountMediaData* _data_;
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		return;
#line 203 "iso-extractor.c"
	}
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 207 "iso-extractor.c"
}


static void boxes_iso_extractor_mount_media_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesIsoExtractorMountMediaData* _data_;
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_ = _user_data_;
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_source_object_ = source_object;
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_res_ = _res_;
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	boxes_iso_extractor_mount_media_co (_data_);
#line 221 "iso-extractor.c"
}


static gboolean boxes_iso_extractor_mount_media_co (BoxesIsoExtractorMountMediaData* _data_) {
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	switch (_data_->_state_) {
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		case 0:
#line 230 "iso-extractor.c"
		goto _state_0;
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		case 1:
#line 234 "iso-extractor.c"
		goto _state_1;
		default:
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		g_assert_not_reached ();
#line 239 "iso-extractor.c"
	}
	_state_0:
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp0_ = FALSE;
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp0_ = _data_->self->priv->mounted;
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	if (_data_->_tmp0_) {
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		if (_data_->_state_ == 0) {
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 252 "iso-extractor.c"
		} else {
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 256 "iso-extractor.c"
		}
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		g_object_unref (_data_->_async_result);
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		return FALSE;
#line 262 "iso-extractor.c"
	}
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp1_ = NULL;
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp1_ = _data_->self->priv->device_file;
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp2_ = NULL;
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp2_ = g_file_new_for_path (_data_->_tmp1_);
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp3_ = NULL;
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp3_ = _data_->_tmp2_;
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp4_ = NULL;
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp4_ = g_file_get_basename (_data_->_tmp3_);
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp5_ = NULL;
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp5_ = _data_->_tmp4_;
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_g_object_unref0 (_data_->_tmp3_);
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->iso_name = _data_->_tmp5_;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp6_ = NULL;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp6_ = _data_->iso_name;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp7_ = NULL;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp7_ = g_strconcat (_data_->_tmp6_, "-XXXXXX", NULL);
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp8_ = NULL;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp8_ = _data_->_tmp7_;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp9_ = NULL;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp9_ = boxes_get_user_pkgcache (_data_->_tmp8_);
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp10_ = NULL;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp10_ = _data_->_tmp9_;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_g_free0 (_data_->_tmp8_);
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->temp_name = _data_->_tmp10_;
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp11_ = NULL;
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp11_ = _data_->temp_name;
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp12_ = NULL;
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp12_ = mkdtemp (_data_->_tmp11_);
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp13_ = NULL;
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp13_ = g_strdup (_data_->_tmp12_);
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->mount_point = _data_->_tmp13_;
#line 31 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp14_ = NULL;
#line 31 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp14_ = _data_->mount_point;
#line 31 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	if (_data_->_tmp14_ == NULL) {
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		_data_->_tmp15_ = 0;
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		_data_->_tmp15_ = errno;
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		_data_->_tmp16_ = 0;
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		_data_->_tmp16_ = g_io_error_from_errno (_data_->_tmp15_);
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		_data_->_tmp17_ = NULL;
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		_data_->_tmp17_ = _data_->temp_name;
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		_data_->_tmp18_ = NULL;
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		_data_->_tmp18_ = g_error_new ((GQuark) G_IO_ERROR, _data_->_tmp16_, "Failed to create temporary mountpoint %s", _data_->_tmp17_);
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		_data_->_inner_error_ = (GError*) _data_->_tmp18_;
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		g_error_free (_data_->_inner_error_);
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		_g_free0 (_data_->mount_point);
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		_g_free0 (_data_->temp_name);
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		_g_free0 (_data_->iso_name);
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		if (_data_->_state_ == 0) {
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 364 "iso-extractor.c"
		} else {
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 368 "iso-extractor.c"
		}
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		g_object_unref (_data_->_async_result);
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		return FALSE;
#line 374 "iso-extractor.c"
	}
#line 33 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp19_ = NULL;
#line 33 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp19_ = _data_->mount_point;
#line 33 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp20_ = NULL;
#line 33 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp20_ = g_strdup (_data_->_tmp19_);
#line 33 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_g_free0 (_data_->self->priv->mount_point);
#line 33 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->self->priv->mount_point = _data_->_tmp20_;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp21_ = NULL;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp21_ = _data_->self->priv->device_file;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp22_ = NULL;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp22_ = _data_->mount_point;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	g_debug ("iso-extractor.vala:35: Mounting '%s' on '%s'..", _data_->_tmp21_, _data_->_tmp22_);
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp23_ = NULL;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp23_ = g_strdup ("fuseiso");
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp24_ = NULL;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp24_ = g_strdup ("-p");
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp25_ = NULL;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp25_ = _data_->self->priv->device_file;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp26_ = NULL;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp26_ = g_strdup (_data_->_tmp25_);
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp27_ = NULL;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp27_ = _data_->mount_point;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp28_ = NULL;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp28_ = g_strdup (_data_->_tmp27_);
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp29_ = NULL;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp29_ = g_new0 (gchar*, 4 + 1);
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp29_[0] = _data_->_tmp23_;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp29_[1] = _data_->_tmp24_;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp29_[2] = _data_->_tmp26_;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp29_[3] = _data_->_tmp28_;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->argv_length1 = 0;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_argv_size_ = 0;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->argv = _data_->_tmp29_;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->argv_length1 = 4;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_argv_size_ = _data_->argv_length1;
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp30_ = NULL;
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp30__length1 = 0;
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp30_ = _data_->argv;
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp30__length1 = _data_->argv_length1;
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp31_ = NULL;
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp31_ = _data_->cancellable;
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_state_ = 1;
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	boxes_exec (_data_->_tmp30_, _data_->_tmp30__length1, _data_->_tmp31_, boxes_iso_extractor_mount_media_ready, _data_);
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	return FALSE;
#line 462 "iso-extractor.c"
	_state_1:
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	boxes_exec_finish (_data_->_res_, NULL, NULL, &_data_->_inner_error_);
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	if (_data_->_inner_error_ != NULL) {
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		g_error_free (_data_->_inner_error_);
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		_g_free0 (_data_->mount_point);
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		_g_free0 (_data_->temp_name);
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		_g_free0 (_data_->iso_name);
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		if (_data_->_state_ == 0) {
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 484 "iso-extractor.c"
		} else {
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 488 "iso-extractor.c"
		}
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		g_object_unref (_data_->_async_result);
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		return FALSE;
#line 494 "iso-extractor.c"
	}
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp32_ = NULL;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp32_ = _data_->self->priv->device_file;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp33_ = NULL;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->_tmp33_ = _data_->mount_point;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	g_debug ("iso-extractor.vala:39: '%s' now mounted on '%s'.", _data_->_tmp32_, _data_->_tmp33_);
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->self->priv->mounted = TRUE;
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_g_free0 (_data_->mount_point);
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_g_free0 (_data_->temp_name);
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_g_free0 (_data_->iso_name);
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	if (_data_->_state_ == 0) {
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 520 "iso-extractor.c"
	} else {
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 524 "iso-extractor.c"
	}
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	g_object_unref (_data_->_async_result);
#line 23 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	return FALSE;
#line 530 "iso-extractor.c"
}


gchar* boxes_iso_extractor_get_absolute_path (BoxesISOExtractor* self, const gchar* relative_path, GError** error) {
	gchar* result = NULL;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	g_return_val_if_fail (relative_path != NULL, NULL);
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp0_ = self->priv->mounted;
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	g_return_val_if_fail (_tmp0_, NULL);
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp1_ = self->priv->mount_point;
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp2_ = relative_path;
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp3_ = g_build_filename (_tmp1_, _tmp2_, NULL);
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	result = _tmp3_;
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	return result;
#line 558 "iso-extractor.c"
}


static void boxes_iso_extractor_class_init (BoxesISOExtractorClass * klass) {
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	boxes_iso_extractor_parent_class = g_type_class_peek_parent (klass);
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	g_type_class_add_private (klass, sizeof (BoxesISOExtractorPrivate));
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_iso_extractor_finalize;
#line 569 "iso-extractor.c"
}


static void boxes_iso_extractor_instance_init (BoxesISOExtractor * self) {
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	self->priv = BOXES_ISO_EXTRACTOR_GET_PRIVATE (self);
#line 576 "iso-extractor.c"
}


static void boxes_iso_extractor_finalize (GObject* obj) {
	BoxesISOExtractor * self;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_ = NULL;
	gchar** argv = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar** _tmp6_ = NULL;
	gint argv_length1 = 0;
	gint _argv_size_ = 0;
	gchar** _tmp7_ = NULL;
	gint _tmp7__length1 = 0;
	const gchar* _tmp8_ = NULL;
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_ISO_EXTRACTOR, BoxesISOExtractor);
#line 14 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp0_ = self->priv->mounted;
#line 14 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	if (!_tmp0_) {
#line 601 "iso-extractor.c"
		goto _return;
	}
#line 17 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp1_ = self->priv->mount_point;
#line 17 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	g_debug ("iso-extractor.vala:17: Unmounting '%s'..", _tmp1_);
#line 18 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp2_ = g_strdup ("fusermount");
#line 18 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp3_ = g_strdup ("-u");
#line 18 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp4_ = self->priv->mount_point;
#line 18 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp5_ = g_strdup (_tmp4_);
#line 18 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp6_ = g_new0 (gchar*, 3 + 1);
#line 18 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp6_[0] = _tmp2_;
#line 18 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp6_[1] = _tmp3_;
#line 18 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp6_[2] = _tmp5_;
#line 18 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	argv = _tmp6_;
#line 18 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	argv_length1 = 3;
#line 18 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_argv_size_ = argv_length1;
#line 19 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp7_ = argv;
#line 19 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp7__length1 = argv_length1;
#line 19 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	boxes_exec (_tmp7_, _tmp7__length1, NULL, NULL, NULL);
#line 20 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_tmp8_ = self->priv->mount_point;
#line 20 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	g_debug ("iso-extractor.vala:20: Unmounted '%s'.", _tmp8_);
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
#line 642 "iso-extractor.c"
	_return:
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_g_free0 (self->priv->device_file);
#line 6 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	_g_free0 (self->priv->mount_point);
#line 4 "/extra-data/checkout/gnome/gnome-boxes/src/iso-extractor.vala"
	G_OBJECT_CLASS (boxes_iso_extractor_parent_class)->finalize (obj);
#line 650 "iso-extractor.c"
}


GType boxes_iso_extractor_get_type (void) {
	static volatile gsize boxes_iso_extractor_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_iso_extractor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesISOExtractorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_iso_extractor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesISOExtractor), 0, (GInstanceInitFunc) boxes_iso_extractor_instance_init, NULL };
		GType boxes_iso_extractor_type_id;
		boxes_iso_extractor_type_id = g_type_register_static (G_TYPE_OBJECT, "BoxesISOExtractor", &g_define_type_info, 0);
		g_once_init_leave (&boxes_iso_extractor_type_id__volatile, boxes_iso_extractor_type_id);
	}
	return boxes_iso_extractor_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
#line 10 "/extra-data/checkout/gnome/gnome-boxes/src/collection-view.vala"
	if ((array != NULL) && (destroy_func != NULL)) {
#line 669 "iso-extractor.c"
		int i;
#line 10 "/extra-data/checkout/gnome/gnome-boxes/src/collection-view.vala"
		for (i = 0; i < array_length; i = i + 1) {
#line 10 "/extra-data/checkout/gnome/gnome-boxes/src/collection-view.vala"
			if (((gpointer*) array)[i] != NULL) {
#line 10 "/extra-data/checkout/gnome/gnome-boxes/src/collection-view.vala"
				destroy_func (((gpointer*) array)[i]);
#line 677 "iso-extractor.c"
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
#line 10 "/extra-data/checkout/gnome/gnome-boxes/src/collection-view.vala"
	_vala_array_destroy (array, array_length, destroy_func);
#line 10 "/extra-data/checkout/gnome/gnome-boxes/src/collection-view.vala"
	g_free (array);
#line 689 "iso-extractor.c"
}



