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

/*
 * Copyright (c) 2024-2025 focus-timer contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 * Authors: Kamil Prusko <kamilprusko@gmail.com>
 */

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "ft_core.h"
#include <unistd.h>
#include <sys/types.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <signal.h>

#define FT_COMMAND_EXECUTION_SPAWN_FLAGS ((G_SPAWN_SEARCH_PATH | G_SPAWN_LEAVE_DESCRIPTORS_OPEN) | G_SPAWN_DO_NOT_REAP_CHILD)
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define FT_TYPE_COMMAND_VARIABLE (ft_command_variable_get_type ())
typedef struct _FtCommandVariable FtCommandVariable;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
enum  {
	FT_COMMAND_EXECUTION_0_PROPERTY,
	FT_COMMAND_EXECUTION_ARGS_PROPERTY,
	FT_COMMAND_EXECUTION_WORKING_DIRECTORY_PROPERTY,
	FT_COMMAND_EXECUTION_INPUT_PROPERTY,
	FT_COMMAND_EXECUTION_TIMEOUT_PROPERTY,
	FT_COMMAND_EXECUTION_EXIT_CODE_PROPERTY,
	FT_COMMAND_EXECUTION_OUTPUT_PROPERTY,
	FT_COMMAND_EXECUTION_EXECUTION_TIME_PROPERTY,
	FT_COMMAND_EXECUTION_COMPLETED_PROPERTY,
	FT_COMMAND_EXECUTION_ERROR_PROPERTY,
	FT_COMMAND_EXECUTION_NUM_PROPERTIES
};
static GParamSpec* ft_command_execution_properties[FT_COMMAND_EXECUTION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block3Data Block3Data;
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
typedef struct _Block4Data Block4Data;
#define _g_io_channel_unref0(var) ((var == NULL) ? NULL : (var = (g_io_channel_unref (var), NULL)))
typedef struct _FtCommandExecutionRunData FtCommandExecutionRunData;
enum  {
	FT_COMMAND_0_PROPERTY,
	FT_COMMAND_LINE_PROPERTY,
	FT_COMMAND_USE_SUBSHELL_PROPERTY,
	FT_COMMAND_WORKING_DIRECTORY_PROPERTY,
	FT_COMMAND_PASS_INPUT_PROPERTY,
	FT_COMMAND_NUM_PROPERTIES
};
static GParamSpec* ft_command_properties[FT_COMMAND_NUM_PROPERTIES];
typedef struct _Block5Data Block5Data;
typedef struct _Block6Data Block6Data;
typedef struct _Block7Data Block7Data;
#define _ft_value_unref0(var) ((var == NULL) ? NULL : (var = (ft_value_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef struct _Block8Data Block8Data;
#define _ft_context_unref0(var) ((var == NULL) ? NULL : (var = (ft_context_unref (var), NULL)))
typedef struct _FtCommandExecuteAsyncData FtCommandExecuteAsyncData;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _FtCommandVariable {
	gchar* name_raw;
	gchar* name;
	gchar* format_raw;
	gchar* format;
	gint span_start;
	gint span_end;
	gint arg_index;
};

struct _FtCommandExecutionPrivate {
	gchar** _args;
	gint _args_length1;
	gint __args_size_;
	gchar* _working_directory;
	gchar* _input;
	gint _timeout;
	gint _exit_code;
	gchar* _output;
	gint64 _execution_time;
	GCancellable* cancellable;
	GError* _error;
	gboolean _completed;
};

struct _Block3Data {
	int _ref_count_;
	FtCommandExecution* self;
	GSourceFunc callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
	GPid child_pid;
	guint timeout_id;
	GString* output_builder;
	gpointer _async_data_;
};

struct _Block4Data {
	int _ref_count_;
	Block3Data * _data3_;
	gint64 start_time;
};

struct _FtCommandExecutionRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	FtCommandExecution* self;
	gboolean result;
	GCancellable* _tmp0_;
	Block3Data* _data3_;
	GError* _tmp1_;
	GError* _tmp2_;
	GError* _tmp3_;
	gint standard_input;
	gint standard_output;
	gint standard_error;
	gchar** args;
	gint args_length1;
	gint _args_size_;
	gint timeout;
	gint _tmp4_;
	gchar* working_directory;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	GString* _tmp7_;
	GCancellable* _tmp8_;
	Block4Data* _data4_;
	gchar** flatpak_spawn_args;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar** _tmp11_;
	gint flatpak_spawn_args_length1;
	gint _flatpak_spawn_args_size_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	gchar** _tmp16_;
	gint _tmp16__length1;
	gint _tmp17_;
	gchar** _tmp18_;
	gint _tmp18__length1;
	gchar** arg_collection;
	gint arg_collection_length1;
	gint _arg_collection_size_;
	gint arg_it;
	gchar* _tmp19_;
	gchar* arg;
	const gchar* _tmp20_;
	gchar* _tmp21_;
	gchar** _tmp22_;
	gint _tmp22__length1;
	gchar** _tmp23_;
	gint _tmp23__length1;
	gchar** _tmp24_;
	gint _tmp24__length1;
	gint _tmp25_;
	gchar** _tmp26_;
	gint _tmp26__length1;
	gchar** _tmp27_;
	gint _tmp27__length1;
	const gchar* _tmp28_;
	gchar** _tmp29_;
	gint _tmp29__length1;
	GPid _tmp30_;
	gint _tmp31_;
	gint _tmp32_;
	gint _tmp33_;
	const gchar* _tmp34_;
	GIOChannel* input_channel;
	GIOChannel* _tmp35_;
	GIOChannel* _tmp36_;
	const gchar* _tmp37_;
	gint _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_;
	gint _tmp40__length1;
	GError* _error_;
	GError* _tmp41_;
	const gchar* _tmp42_;
	GIOChannel* _tmp43_;
	GIOChannel* output_channel;
	GIOChannel* _tmp44_;
	GIOChannel* _tmp45_;
	GIOChannel* error_channel;
	GIOChannel* _tmp46_;
	GIOChannel* _tmp47_;
	GCancellable* _tmp48_;
	GError* _vala1__error_;
	gchar* command_line;
	gchar** _tmp49_;
	gint _tmp49__length1;
	gint _tmp50_;
	gchar** _tmp51_;
	gint _tmp51__length1;
	gchar* _tmp52_;
	const gchar* _tmp53_;
	GError* _tmp54_;
	const gchar* _tmp55_;
	GError* _tmp56_;
	GError* _tmp57_;
	GError* _tmp58_;
	GError* _tmp59_;
	GError* _tmp60_;
	GError* _inner_error1_;
	gboolean _tmp61_;
	GError* _tmp62_;
	GError* _tmp63_;
	gint _tmp64_;
	GError* _inner_error0_;
};

struct _FtCommandPrivate {
	gchar* _working_directory;
	gboolean _pass_input;
	gchar* _line;
	gboolean _use_subshell;
	gboolean prepared;
	gchar** args;
	gint args_length1;
	gint _args_size_;
	FtCommandVariable* variables;
	gint variables_length1;
	gint _variables_size_;
};

struct _Block5Data {
	int _ref_count_;
	FtCommand* self;
	FtCommandVariable* variables;
	gint variables_length1;
	gint _variables_size_;
};

struct _Block6Data {
	int _ref_count_;
	Block5Data * _data5_;
	gint index;
};

struct _Block7Data {
	int _ref_count_;
	Block6Data * _data6_;
	GError* _error_;
};

struct _Block8Data {
	int _ref_count_;
	FtCommand* self;
	FtCommandExecution* execution;
};

struct _FtCommandExecuteAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	FtCommand* self;
	FtContext* context;
	FtCommandExecution* result;
	FtCommandExecution* execution;
	FtCommandExecution* _tmp0_;
	gboolean _tmp1_;
	FtCommandExecution* _tmp2_;
	FtCommandExecution* _tmp3_;
	GError* _tmp4_;
	GError* _tmp5_;
	FtCommandExecution* _tmp6_;
	GError* _error_;
	FtCommandExecution* _tmp7_;
	GError* _tmp8_;
	GError* _inner_error0_;
};

static gint FtCommandExecution_private_offset;
static gpointer ft_command_execution_parent_class = NULL;
static FtJobIface * ft_command_execution_ft_job_parent_iface = NULL;
static gint FtCommand_private_offset;
static gpointer ft_command_parent_class = NULL;

VALA_EXTERN GType ft_command_variable_get_type (void) G_GNUC_CONST ;
VALA_EXTERN FtCommandVariable* ft_command_variable_dup (const FtCommandVariable* self);
VALA_EXTERN void ft_command_variable_free (FtCommandVariable* self);
VALA_EXTERN void ft_command_variable_copy (const FtCommandVariable* self,
                               FtCommandVariable* dest);
VALA_EXTERN void ft_command_variable_destroy (FtCommandVariable* self);
VALA_EXTERN void ft_command_variable_init (FtCommandVariable *self);
VALA_EXTERN void ft_find_variables (const gchar* text,
                        GFunc callback,
                        gpointer callback_target);
VALA_EXTERN gchar* ft_find_program_in_host_path (const gchar* program);
VALA_EXTERN void ft_setup_child (void);
static void _ft_setup_child_gspawn_child_setup_func (gpointer self);
static gboolean ft_command_execution_process_output_line (GIOChannel* channel,
                                                   GIOCondition condition,
                                                   GString* output);
static void ft_command_execution_real_run_data_free (gpointer _data);
static void ft_command_execution_real_run (FtJob* base,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
static gboolean ft_command_execution_real_run_co (FtCommandExecutionRunData* _data_);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static void _vala_array_add5 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add6 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static gchar** _vala_array_dup3 (gchar** self,
                          gssize length);
static gchar** _vala_array_dup4 (gchar** self,
                          gssize length);
static gboolean ___lambda63_ (Block4Data* _data4_,
                       GIOChannel* channel,
                       GIOCondition condition);
static gboolean ____lambda63__gio_func (GIOChannel* source,
                                 GIOCondition condition,
                                 gpointer self);
static gboolean ___lambda64_ (Block4Data* _data4_,
                       GIOChannel* channel,
                       GIOCondition condition);
static gboolean ____lambda64__gio_func (GIOChannel* source,
                                 GIOCondition condition,
                                 gpointer self);
static void ___lambda65_ (Block4Data* _data4_,
                   GPid pid,
                   gint status);
static void ft_command_execution_set_exit_code (FtCommandExecution* self,
                                         gint value);
static void ft_command_execution_set_execution_time (FtCommandExecution* self,
                                              gint64 value);
static void ft_command_execution_set_output (FtCommandExecution* self,
                                      const gchar* value);
static void ____lambda65__gchild_watch_func (GPid pid,
                                      gint wait_status,
                                      gpointer self);
static gboolean _ft_command_execution_real_run_co_gsource_func (gpointer self);
static gboolean ____lambda66_ (Block4Data* _data4_);
static gboolean _____lambda66__gsource_func (gpointer self);
static void ___lambda67_ (Block4Data* _data4_);
static void ____lambda67__g_cancellable_cancelled (GCancellable* _sender,
                                            gpointer self);
static gchar** _vala_array_dup5 (gchar** self,
                          gssize length);
static void ft_command_execution_finalize (GObject * obj);
static GType ft_command_execution_get_type_once (void);
static void _vala_ft_command_execution_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void _vala_ft_command_execution_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec);
static void _vala_FtCommandVariable_array_free (FtCommandVariable * array,
                                         gssize array_length);
static void ft_command_prepare_args (FtCommand* self,
                              GError** error);
static void ft_command_prepare_variables (FtCommand* self,
                                   GError** error);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
static void _____lambda62_ (Block7Data* _data7_,
                     FtCommandVariable* variable);
static void _vala_array_add7 (FtCommandVariable* * array,
                       gint* length,
                       gint* size,
                       const FtCommandVariable* value);
static void ______lambda62__gfunc (gconstpointer data,
                            gpointer self);
static FtCommandVariable* _vala_array_dup6 (FtCommandVariable* self,
                                     gssize length);
static gchar** ft_command_interpolate_args (FtCommand* self,
                                     FtContext* context,
                                     gint* result_length1);
static gchar** _vala_array_dup7 (gchar** self,
                          gssize length);
static void ft_command_prepare_internal (FtCommand* self,
                                  GError** error);
static Block8Data* block8_data_ref (Block8Data* _data8_);
static void block8_data_unref (void * _userdata_);
static void ___lambda68_ (Block8Data* _data8_,
                   GObject* obj,
                   GAsyncResult* res);
static void ____lambda68__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void ft_command_execute_async_data_free (gpointer _data);
static gboolean ft_command_execute_async_co (FtCommandExecuteAsyncData* _data_);
static void ft_command_execute_async_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_);
static void ft_command_finalize (GObject * obj);
static GType ft_command_get_type_once (void);
static void _vala_ft_command_get_property (GObject * object,
                                    guint property_id,
                                    GValue * value,
                                    GParamSpec * pspec);
static void _vala_ft_command_set_property (GObject * object,
                                    guint property_id,
                                    const GValue * value,
                                    GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

void
ft_command_variable_init (FtCommandVariable *self)
{
	memset (self, 0, sizeof (FtCommandVariable));
	(*self).span_start = -1;
	(*self).span_end = -1;
}

void
ft_command_variable_copy (const FtCommandVariable* self,
                          FtCommandVariable* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	_tmp0_ = (*self).name_raw;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).name_raw);
	(*dest).name_raw = _tmp1_;
	_tmp2_ = (*self).name;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 ((*dest).name);
	(*dest).name = _tmp3_;
	_tmp4_ = (*self).format_raw;
	_tmp5_ = g_strdup (_tmp4_);
	_g_free0 ((*dest).format_raw);
	(*dest).format_raw = _tmp5_;
	_tmp6_ = (*self).format;
	_tmp7_ = g_strdup (_tmp6_);
	_g_free0 ((*dest).format);
	(*dest).format = _tmp7_;
	(*dest).span_start = (*self).span_start;
	(*dest).span_end = (*self).span_end;
	(*dest).arg_index = (*self).arg_index;
}

void
ft_command_variable_destroy (FtCommandVariable* self)
{
	_g_free0 ((*self).name_raw);
	_g_free0 ((*self).name);
	_g_free0 ((*self).format_raw);
	_g_free0 ((*self).format);
}

FtCommandVariable*
ft_command_variable_dup (const FtCommandVariable* self)
{
	FtCommandVariable* dup;
	dup = g_new0 (FtCommandVariable, 1);
	ft_command_variable_copy (self, dup);
	return dup;
}

void
ft_command_variable_free (FtCommandVariable* self)
{
	ft_command_variable_destroy (self);
	g_free (self);
}

static GType
ft_command_variable_get_type_once (void)
{
	GType ft_command_variable_type_id;
	ft_command_variable_type_id = g_boxed_type_register_static ("FtCommandVariable", (GBoxedCopyFunc) ft_command_variable_dup, (GBoxedFreeFunc) ft_command_variable_free);
	return ft_command_variable_type_id;
}

GType
ft_command_variable_get_type (void)
{
	static volatile gsize ft_command_variable_type_id__once = 0;
	if (g_once_init_enter (&ft_command_variable_type_id__once)) {
		GType ft_command_variable_type_id;
		ft_command_variable_type_id = ft_command_variable_get_type_once ();
		g_once_init_leave (&ft_command_variable_type_id__once, ft_command_variable_type_id);
	}
	return ft_command_variable_type_id__once;
}

static gboolean
string_get_next_char (const gchar* self,
                      gint* index,
                      gunichar* c)
{
	gunichar _vala_c = 0U;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_vala_c = g_utf8_get_char (((gchar*) self) + (*index));
	if (_vala_c != ((gunichar) 0)) {
		gchar* _tmp0_;
		_tmp0_ = g_utf8_next_char (((gchar*) self) + (*index));
		*index = (gint) (_tmp0_ - ((gchar*) self));
		result = TRUE;
		if (c) {
			*c = _vala_c;
		}
		return result;
	} else {
		result = FALSE;
		if (c) {
			*c = _vala_c;
		}
		return result;
	}
}

static gchar*
string_slice (const gchar* self,
              glong start,
              glong end)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	_tmp4_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
	result = _tmp4_;
	return result;
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

void
ft_find_variables (const gchar* text,
                   GFunc callback,
                   gpointer callback_target)
{
	gunichar chr = 0U;
	gint chr_span_start = 0;
	gint chr_span_end = 0;
	FtCommandVariable variable = {0};
	gboolean within_brackets = FALSE;
	gboolean _tmp43_ = FALSE;
	FtCommandVariable _tmp44_;
	g_return_if_fail (text != NULL);
	chr_span_start = 0;
	chr_span_end = 0;
	ft_command_variable_init (&variable);
	within_brackets = FALSE;
	while (TRUE) {
		gunichar _tmp0_ = 0U;
		gboolean _tmp1_;
		FtCommandVariable _tmp2_;
		_tmp1_ = string_get_next_char (text, &chr_span_end, &_tmp0_);
		chr = _tmp0_;
		if (!_tmp1_) {
			break;
		}
		_tmp2_ = variable;
		if (_tmp2_.span_start < 0) {
			if (chr == ((gunichar) '$')) {
				variable.span_start = chr_span_start;
			}
		} else {
			if (!within_brackets) {
				gboolean _tmp3_ = FALSE;
				if (chr == ((gunichar) '{')) {
					FtCommandVariable _tmp4_;
					_tmp4_ = variable;
					_tmp3_ = chr_span_start == (_tmp4_.span_start + 1);
				} else {
					_tmp3_ = FALSE;
				}
				if (_tmp3_) {
					within_brackets = TRUE;
				} else {
					if (!g_unichar_isalnum (chr)) {
						FtCommandVariable _tmp5_;
						FtCommandVariable _tmp6_;
						gchar* _tmp7_;
						FtCommandVariable _tmp8_;
						const gchar* _tmp9_;
						gchar* _tmp10_;
						gchar* _tmp11_;
						gchar* _tmp12_;
						FtCommandVariable _tmp13_;
						const gchar* _tmp14_;
						variable.span_end = chr_span_start;
						_tmp5_ = variable;
						_tmp6_ = variable;
						_tmp7_ = string_slice (text, ((glong) _tmp5_.span_start) + 1, (glong) _tmp6_.span_end);
						_g_free0 (variable.name_raw);
						variable.name_raw = _tmp7_;
						_tmp8_ = variable;
						_tmp9_ = _tmp8_.name_raw;
						_tmp10_ = ft_from_camel_case (_tmp9_);
						_g_free0 (variable.name);
						variable.name = _tmp10_;
						_tmp11_ = g_strdup ("");
						_g_free0 (variable.format_raw);
						variable.format_raw = _tmp11_;
						_tmp12_ = g_strdup ("");
						_g_free0 (variable.format);
						variable.format = _tmp12_;
						_tmp13_ = variable;
						_tmp14_ = _tmp13_.name;
						if (g_strcmp0 (_tmp14_, "") != 0) {
							FtCommandVariable _tmp15_;
							_tmp15_ = variable;
							callback (&_tmp15_, callback_target);
						}
						ft_command_variable_destroy (&variable);
						ft_command_variable_init (&variable);
					}
				}
			} else {
				if (chr == ((gunichar) '}')) {
					gchar* bracket_text = NULL;
					FtCommandVariable _tmp16_;
					FtCommandVariable _tmp17_;
					gchar* _tmp18_;
					gchar** bracket_tokens = NULL;
					const gchar* _tmp19_;
					gchar** _tmp20_;
					gchar** _tmp21_;
					gint bracket_tokens_length1;
					gint _bracket_tokens_size_;
					gchar** _tmp22_;
					gint _tmp22__length1;
					FtCommandVariable _tmp42_;
					variable.span_end = chr_span_end;
					_tmp16_ = variable;
					_tmp17_ = variable;
					_tmp18_ = string_slice (text, ((glong) _tmp16_.span_start) + 2, ((glong) _tmp17_.span_end) - 1);
					bracket_text = _tmp18_;
					_tmp19_ = bracket_text;
					_tmp21_ = _tmp20_ = g_strsplit (_tmp19_, ":", 2);
					bracket_tokens = _tmp21_;
					bracket_tokens_length1 = _vala_array_length (_tmp20_);
					_bracket_tokens_size_ = bracket_tokens_length1;
					_tmp22_ = bracket_tokens;
					_tmp22__length1 = bracket_tokens_length1;
					if (_tmp22__length1 == 2) {
						gchar** _tmp23_;
						gint _tmp23__length1;
						const gchar* _tmp24_;
						gchar* _tmp25_;
						FtCommandVariable _tmp26_;
						const gchar* _tmp27_;
						gchar* _tmp28_;
						gchar** _tmp29_;
						gint _tmp29__length1;
						const gchar* _tmp30_;
						gchar* _tmp31_;
						FtCommandVariable _tmp32_;
						const gchar* _tmp33_;
						gchar* _tmp34_;
						_tmp23_ = bracket_tokens;
						_tmp23__length1 = bracket_tokens_length1;
						_tmp24_ = _tmp23_[0];
						_tmp25_ = string_strip (_tmp24_);
						_g_free0 (variable.name_raw);
						variable.name_raw = _tmp25_;
						_tmp26_ = variable;
						_tmp27_ = _tmp26_.name_raw;
						_tmp28_ = ft_from_camel_case (_tmp27_);
						_g_free0 (variable.name);
						variable.name = _tmp28_;
						_tmp29_ = bracket_tokens;
						_tmp29__length1 = bracket_tokens_length1;
						_tmp30_ = _tmp29_[1];
						_tmp31_ = string_strip (_tmp30_);
						_g_free0 (variable.format_raw);
						variable.format_raw = _tmp31_;
						_tmp32_ = variable;
						_tmp33_ = _tmp32_.format_raw;
						_tmp34_ = ft_from_camel_case (_tmp33_);
						_g_free0 (variable.format);
						variable.format = _tmp34_;
					} else {
						const gchar* _tmp35_;
						gchar* _tmp36_;
						FtCommandVariable _tmp37_;
						const gchar* _tmp38_;
						gchar* _tmp39_;
						gchar* _tmp40_;
						gchar* _tmp41_;
						_tmp35_ = bracket_text;
						_tmp36_ = string_strip (_tmp35_);
						_g_free0 (variable.name_raw);
						variable.name_raw = _tmp36_;
						_tmp37_ = variable;
						_tmp38_ = _tmp37_.name_raw;
						_tmp39_ = ft_from_camel_case (_tmp38_);
						_g_free0 (variable.name);
						variable.name = _tmp39_;
						_tmp40_ = g_strdup ("");
						_g_free0 (variable.format_raw);
						variable.format_raw = _tmp40_;
						_tmp41_ = g_strdup ("");
						_g_free0 (variable.format);
						variable.format = _tmp41_;
					}
					_tmp42_ = variable;
					callback (&_tmp42_, callback_target);
					within_brackets = FALSE;
					ft_command_variable_destroy (&variable);
					ft_command_variable_init (&variable);
					bracket_tokens = (_vala_array_free (bracket_tokens, bracket_tokens_length1, (GDestroyNotify) g_free), NULL);
					_g_free0 (bracket_text);
				}
			}
		}
		chr_span_start = chr_span_end;
	}
	_tmp44_ = variable;
	if (_tmp44_.span_start >= 0) {
		_tmp43_ = !within_brackets;
	} else {
		_tmp43_ = FALSE;
	}
	if (_tmp43_) {
		FtCommandVariable _tmp45_;
		FtCommandVariable _tmp46_;
		gchar* _tmp47_;
		gchar* _tmp48_;
		FtCommandVariable _tmp49_;
		const gchar* _tmp50_;
		variable.span_end = chr_span_end;
		_tmp45_ = variable;
		_tmp46_ = variable;
		_tmp47_ = string_slice (text, ((glong) _tmp45_.span_start) + 1, (glong) _tmp46_.span_end);
		_g_free0 (variable.name);
		variable.name = _tmp47_;
		_tmp48_ = g_strdup ("");
		_g_free0 (variable.format);
		variable.format = _tmp48_;
		_tmp49_ = variable;
		_tmp50_ = _tmp49_.name;
		if (g_strcmp0 (_tmp50_, "") != 0) {
			FtCommandVariable _tmp51_;
			_tmp51_ = variable;
			callback (&_tmp51_, callback_target);
		}
	}
	ft_command_variable_destroy (&variable);
}

static void
_ft_setup_child_gspawn_child_setup_func (gpointer self)
{
	ft_setup_child ();
}

gchar*
ft_find_program_in_host_path (const gchar* program)
{
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (program != NULL, NULL);
	if (program == NULL) {
		result = NULL;
		return result;
	}
	if (ft_is_flatpak ()) {
		gchar* standard_output = NULL;
		gint wait_status = 0;
		{
			gchar* _tmp0_;
			gchar* _tmp1_;
			gchar* _tmp2_;
			gchar* _tmp3_;
			gchar** _tmp4_;
			gchar** _tmp5_;
			gint _tmp5__length1;
			gchar* _tmp6_ = NULL;
			gint _tmp7_ = 0;
			gboolean _tmp8_ = FALSE;
			gboolean _tmp9_ = FALSE;
			_tmp0_ = g_strdup ("flatpak-spawn");
			_tmp1_ = g_strdup ("--host");
			_tmp2_ = g_strdup ("which");
			_tmp3_ = g_strdup (program);
			_tmp4_ = g_new0 (gchar*, 4 + 1);
			_tmp4_[0] = _tmp0_;
			_tmp4_[1] = _tmp1_;
			_tmp4_[2] = _tmp2_;
			_tmp4_[3] = _tmp3_;
			_tmp5_ = _tmp4_;
			_tmp5__length1 = 4;
			g_spawn_sync (NULL, _tmp5_, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL, _ft_setup_child_gspawn_child_setup_func, NULL, &_tmp6_, NULL, &_tmp7_, &_inner_error0_);
			_g_free0 (standard_output);
			standard_output = _tmp6_;
			wait_status = _tmp7_;
			_tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_free), NULL);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == G_SPAWN_ERROR) {
					goto __catch0_g_spawn_error;
				}
				_g_free0 (standard_output);
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return NULL;
			}
			if (wait_status == 0) {
				const gchar* _tmp10_;
				_tmp10_ = standard_output;
				_tmp9_ = _tmp10_ != NULL;
			} else {
				_tmp9_ = FALSE;
			}
			if (_tmp9_) {
				const gchar* _tmp11_;
				gint _tmp12_;
				gint _tmp13_;
				_tmp11_ = standard_output;
				_tmp12_ = strlen (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp8_ = _tmp13_ > 0;
			} else {
				_tmp8_ = FALSE;
			}
			if (_tmp8_) {
				result = standard_output;
				return result;
			}
		}
		goto __finally0;
		__catch0_g_spawn_error:
		{
			GError* _error_ = NULL;
			GError* _tmp14_;
			const gchar* _tmp15_;
			_error_ = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp14_ = _error_;
			_tmp15_ = _tmp14_->message;
			g_warning ("command.vala:143: Error finding program: %s", _tmp15_);
			_g_error_free0 (_error_);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (standard_output);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		result = NULL;
		_g_free0 (standard_output);
		return result;
	} else {
		gchar* _tmp16_;
		_tmp16_ = g_find_program_in_path (program);
		result = _tmp16_;
		return result;
	}
}

void
ft_setup_child (void)
{
	setsid ();
	setpgid ((pid_t) 0, (pid_t) 0);
}

GQuark
ft_command_error_quark (void)
{
	return g_quark_from_static_string ("ft-command-error-quark");
}

static GType
ft_command_error_get_type_once (void)
{
	static const GEnumValue values[] = {{FT_COMMAND_ERROR_EMPTY_LINE, "FT_COMMAND_ERROR_EMPTY_LINE", "empty-line"}, {FT_COMMAND_ERROR_SYNTAX_ERROR, "FT_COMMAND_ERROR_SYNTAX_ERROR", "syntax-error"}, {FT_COMMAND_ERROR_UNKNOWN_VARIABLE, "FT_COMMAND_ERROR_UNKNOWN_VARIABLE", "unknown-variable"}, {FT_COMMAND_ERROR_UNKNOWN_VARIABLE_FORMAT, "FT_COMMAND_ERROR_UNKNOWN_VARIABLE_FORMAT", "unknown-variable-format"}, {FT_COMMAND_ERROR_NOT_FOUND, "FT_COMMAND_ERROR_NOT_FOUND", "not-found"}, {FT_COMMAND_ERROR_FAILED, "FT_COMMAND_ERROR_FAILED", "failed"}, {0, NULL, NULL}};
	GType ft_command_error_type_id;
	ft_command_error_type_id = g_enum_register_static ("FtCommandError", values);
	return ft_command_error_type_id;
}

GType
ft_command_error_get_type (void)
{
	static volatile gsize ft_command_error_type_id__once = 0;
	if (g_once_init_enter (&ft_command_error_type_id__once)) {
		GType ft_command_error_type_id;
		ft_command_error_type_id = ft_command_error_get_type_once ();
		g_once_init_leave (&ft_command_error_type_id__once, ft_command_error_type_id);
	}
	return ft_command_error_type_id__once;
}

static inline gpointer
ft_command_execution_get_instance_private (FtCommandExecution* self)
{
	return G_STRUCT_MEMBER_P (self, FtCommandExecution_private_offset);
}

FtCommandExecution*
ft_command_execution_construct (GType object_type,
                                gchar** args,
                                gint args_length1,
                                const gchar* working_directory)
{
	FtCommandExecution * self = NULL;
	self = (FtCommandExecution*) g_object_new (object_type, "args", args, "working-directory", working_directory, NULL);
	return self;
}

FtCommandExecution*
ft_command_execution_new (gchar** args,
                          gint args_length1,
                          const gchar* working_directory)
{
	return ft_command_execution_construct (FT_TYPE_COMMAND_EXECUTION, args, args_length1, working_directory);
}

static gboolean
ft_command_execution_process_output_line (GIOChannel* channel,
                                          GIOCondition condition,
                                          GString* output)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (channel != NULL, FALSE);
	g_return_val_if_fail (output != NULL, FALSE);
	if (condition == G_IO_HUP) {
		result = FALSE;
		return result;
	}
	{
		gchar* line = NULL;
		gchar* _tmp0_ = NULL;
		const gchar* _tmp2_;
		g_io_channel_read_line (channel, &_tmp0_, NULL, NULL, &_inner_error0_);
		_g_free0 (line);
		line = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp1_ = FALSE;
			_g_free0 (line);
			if (_inner_error0_->domain == G_IO_CHANNEL_ERROR) {
				goto __catch0_g_io_channel_error;
			}
			if (_inner_error0_->domain == G_CONVERT_ERROR) {
				goto __catch0_g_convert_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return _tmp1_;
		}
		_tmp2_ = line;
		g_string_append (output, _tmp2_);
		_g_free0 (line);
	}
	goto __finally0;
	__catch0_g_io_channel_error:
	{
		GError* _error_ = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = _error_;
		_tmp4_ = _tmp3_->message;
		g_debug ("command.vala:244: IOChannelError: %s", _tmp4_);
		result = FALSE;
		_g_error_free0 (_error_);
		return result;
	}
	goto __finally0;
	__catch0_g_convert_error:
	{
		GError* _error_ = NULL;
		GError* _tmp5_;
		const gchar* _tmp6_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp5_ = _error_;
		_tmp6_ = _tmp5_->message;
		g_debug ("command.vala:248: ConvertError: %s", _tmp6_);
		result = FALSE;
		_g_error_free0 (_error_);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp7_ = FALSE;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp7_;
	}
	result = TRUE;
	return result;
}

static void
ft_command_execution_real_run_data_free (gpointer _data)
{
	FtCommandExecutionRunData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (FtCommandExecutionRunData, _data_);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
ft_command_execution_real_run (FtJob* base,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	FtCommandExecution * self;
	FtCommandExecutionRunData* _data_;
	FtCommandExecution* _tmp0_;
	self = (FtCommandExecution*) base;
	_data_ = g_slice_new0 (FtCommandExecutionRunData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, ft_command_execution_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	ft_command_execution_real_run_co (_data_);
}

static gboolean
ft_command_execution_run_finish (FtJob* base,
                                 GAsyncResult* _res_,
                                 GError** error)
{
	gboolean result;
	FtCommandExecutionRunData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gboolean _tmp0_ = FALSE;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

/**
         * TODO: Currently there may be several executions ongoing for a command - it should always
         *       execute once at a time
         */
static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		FtCommandExecution* self;
		self = _data3_->self;
		_g_string_free0 (_data3_->output_builder);
		(_data3_->callback_target_destroy_notify == NULL) ? NULL : (_data3_->callback_target_destroy_notify (_data3_->callback_target), NULL);
		_data3_->callback = NULL;
		_data3_->callback_target = NULL;
		_data3_->callback_target_destroy_notify = NULL;
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

static Block4Data*
block4_data_ref (Block4Data* _data4_)
{
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}

static void
block4_data_unref (void * _userdata_)
{
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		FtCommandExecution* self;
		self = _data4_->_data3_->self;
		block3_data_unref (_data4_->_data3_);
		_data4_->_data3_ = NULL;
		g_slice_free (Block4Data, _data4_);
	}
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static void
_vala_array_add5 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add6 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static gchar**
_vala_array_dup3 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static gchar**
_vala_array_dup4 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static gchar*
string_to_utf8 (const gchar* self,
                gint* result_length1)
{
	gint string_length = 0;
	gint _tmp0_;
	gint _tmp1_;
	gchar* _result_ = NULL;
	gchar* _tmp2_;
	gint _result__length1;
	gint __result__size_;
	gint _tmp3_;
	gchar* _tmp4_;
	gint _tmp4__length1;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = _tmp1_;
	_tmp2_ = g_new0 (gchar, string_length + 1);
	_result_ = _tmp2_;
	_result__length1 = string_length + 1;
	__result__size_ = _result__length1;
	_tmp3_ = _result__length1;
	_result__length1 = _tmp3_ - 1;
	memcpy (_result_, self, (gsize) string_length);
	_tmp4_ = _result_;
	_tmp4__length1 = _result__length1;
	if (result_length1) {
		*result_length1 = _tmp4__length1;
	}
	result = _tmp4_;
	return result;
}

static gboolean
___lambda63_ (Block4Data* _data4_,
              GIOChannel* channel,
              GIOCondition condition)
{
	Block3Data* _data3_;
	FtCommandExecution* self;
	GString* _tmp0_;
	gboolean result;
	_data3_ = _data4_->_data3_;
	self = _data3_->self;
	g_return_val_if_fail (channel != NULL, FALSE);
	_tmp0_ = _data3_->output_builder;
	result = ft_command_execution_process_output_line (channel, condition, _tmp0_);
	return result;
}

static gboolean
____lambda63__gio_func (GIOChannel* source,
                        GIOCondition condition,
                        gpointer self)
{
	gboolean result;
	result = ___lambda63_ (self, source, condition);
	return result;
}

static gboolean
___lambda64_ (Block4Data* _data4_,
              GIOChannel* channel,
              GIOCondition condition)
{
	Block3Data* _data3_;
	FtCommandExecution* self;
	GString* _tmp0_;
	gboolean result;
	_data3_ = _data4_->_data3_;
	self = _data3_->self;
	g_return_val_if_fail (channel != NULL, FALSE);
	_tmp0_ = _data3_->output_builder;
	result = ft_command_execution_process_output_line (channel, condition, _tmp0_);
	return result;
}

static gboolean
____lambda64__gio_func (GIOChannel* source,
                        GIOCondition condition,
                        gpointer self)
{
	gboolean result;
	result = ___lambda64_ (self, source, condition);
	return result;
}

static gchar*
_vala_g_strjoinv (const gchar* separator,
                  gchar** str_array,
                  gint str_array_length1)
{
	gboolean _tmp0_ = FALSE;
	gchar* result;
	if (separator == NULL) {
		separator = "";
	}
	if (str_array != NULL) {
		gboolean _tmp1_ = FALSE;
		if (str_array_length1 > 0) {
			_tmp1_ = TRUE;
		} else {
			gboolean _tmp2_ = FALSE;
			if (str_array_length1 == -1) {
				const gchar* _tmp3_;
				_tmp3_ = str_array[0];
				_tmp2_ = _tmp3_ != NULL;
			} else {
				_tmp2_ = FALSE;
			}
			_tmp1_ = _tmp2_;
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp16_;
		gint _tmp17_;
		const gchar* res = NULL;
		void* _tmp18_;
		const gchar* _tmp19_ = NULL;
		const gchar* _tmp20_;
		void* ptr = NULL;
		const gchar* _tmp22_;
		void* _tmp23_;
		const gchar* _tmp33_;
		len = (gsize) 1;
		{
			gboolean _tmp4_ = FALSE;
			i = 0;
			_tmp4_ = TRUE;
			while (TRUE) {
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gint _tmp10_ = 0;
				const gchar* _tmp11_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				if (str_array_length1 != -1) {
					_tmp7_ = i < str_array_length1;
				} else {
					_tmp7_ = FALSE;
				}
				if (_tmp7_) {
					_tmp6_ = TRUE;
				} else {
					gboolean _tmp8_ = FALSE;
					if (str_array_length1 == -1) {
						const gchar* _tmp9_;
						_tmp9_ = str_array[i];
						_tmp8_ = _tmp9_ != NULL;
					} else {
						_tmp8_ = FALSE;
					}
					_tmp6_ = _tmp8_;
				}
				if (!_tmp6_) {
					break;
				}
				_tmp11_ = str_array[i];
				if (_tmp11_ != NULL) {
					const gchar* _tmp12_;
					gint _tmp13_;
					gint _tmp14_;
					_tmp12_ = str_array[i];
					_tmp13_ = strlen ((const gchar*) _tmp12_);
					_tmp14_ = _tmp13_;
					_tmp10_ = _tmp14_;
				} else {
					_tmp10_ = 0;
				}
				len += (gsize) _tmp10_;
			}
		}
		if (i == 0) {
			gchar* _tmp15_;
			_tmp15_ = g_strdup ("");
			result = _tmp15_;
			return result;
		}
		str_array_length1 = i;
		_tmp16_ = strlen ((const gchar*) separator);
		_tmp17_ = _tmp16_;
		len += (gsize) (_tmp17_ * (i - 1));
		_tmp18_ = g_malloc (len);
		res = _tmp18_;
		_tmp20_ = str_array[0];
		if (_tmp20_ != NULL) {
			const gchar* _tmp21_;
			_tmp21_ = str_array[0];
			_tmp19_ = (const gchar*) _tmp21_;
		} else {
			_tmp19_ = "";
		}
		_tmp22_ = res;
		_tmp23_ = g_stpcpy ((void*) _tmp22_, _tmp19_);
		ptr = _tmp23_;
		{
			gboolean _tmp24_ = FALSE;
			i = 1;
			_tmp24_ = TRUE;
			while (TRUE) {
				void* _tmp26_;
				void* _tmp27_;
				const gchar* _tmp28_ = NULL;
				const gchar* _tmp29_;
				void* _tmp31_;
				void* _tmp32_;
				if (!_tmp24_) {
					gint _tmp25_;
					_tmp25_ = i;
					i = _tmp25_ + 1;
				}
				_tmp24_ = FALSE;
				if (!(i < str_array_length1)) {
					break;
				}
				_tmp26_ = ptr;
				_tmp27_ = g_stpcpy (_tmp26_, (const gchar*) separator);
				ptr = _tmp27_;
				_tmp29_ = str_array[i];
				if (_tmp29_ != NULL) {
					const gchar* _tmp30_;
					_tmp30_ = str_array[i];
					_tmp28_ = (const gchar*) _tmp30_;
				} else {
					_tmp28_ = "";
				}
				_tmp31_ = ptr;
				_tmp32_ = g_stpcpy (_tmp31_, _tmp28_);
				ptr = _tmp32_;
			}
		}
		_tmp33_ = res;
		res = NULL;
		result = (gchar*) _tmp33_;
		return result;
	} else {
		gchar* _tmp34_;
		_tmp34_ = g_strdup ("");
		result = _tmp34_;
		return result;
	}
}

static void
___lambda65_ (Block4Data* _data4_,
              GPid pid,
              gint status)
{
	Block3Data* _data3_;
	FtCommandExecution* self;
	GSourceFunc _tmp15_;
	gpointer _tmp15__target;
	GError* _inner_error0_ = NULL;
	_data3_ = _data4_->_data3_;
	self = _data3_->self;
	{
		g_spawn_check_wait_status (status, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		ft_command_execution_set_exit_code (self, 0);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp0_;
		GError* _tmp1_;
		GError* _tmp2_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = _error_;
		ft_command_execution_set_exit_code (self, _tmp0_->code);
		_tmp1_ = ft_job_get_error ((FtJob*) self);
		_tmp2_ = _tmp1_;
		if (_tmp2_ == NULL) {
			gchar* command_line = NULL;
			gchar** _tmp3_;
			gint _tmp3__length1;
			gint _tmp4_ = 0;
			gchar** _tmp5_;
			gint _tmp5__length1;
			gchar* _tmp6_;
			const gchar* _tmp7_;
			GError* _tmp8_;
			const gchar* _tmp9_;
			GError* _tmp10_;
			GError* _tmp11_;
			GError* _tmp12_;
			_tmp3_ = ft_command_execution_get_args (self, &_tmp4_);
			_tmp3__length1 = _tmp4_;
			_tmp5_ = _tmp3_;
			_tmp5__length1 = _tmp3__length1;
			_tmp6_ = _vala_g_strjoinv (" ", _tmp5_, (gint) _tmp5__length1);
			command_line = _tmp6_;
			_tmp7_ = command_line;
			_tmp8_ = _error_;
			_tmp9_ = _tmp8_->message;
			g_warning ("command.vala:356: Spawned command '%s' exited abnormally: %s", _tmp7_, _tmp9_);
			_tmp10_ = _error_;
			_tmp11_ = g_error_copy (_tmp10_);
			_tmp12_ = _tmp11_;
			ft_job_set_error ((FtJob*) self, _tmp12_);
			_g_error_free0 (_tmp12_);
			_g_free0 (command_line);
		}
		_g_error_free0 (_error_);
	}
	__finally0:
	{
		GError* _inner_error1_ = NULL;
		GString* _tmp13_;
		const gchar* _tmp14_;
		ft_command_execution_set_execution_time (self, g_get_monotonic_time () - _data4_->start_time);
		_tmp13_ = _data3_->output_builder;
		_tmp14_ = _tmp13_->str;
		ft_command_execution_set_output (self, _tmp14_);
	}
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp15_ = _data3_->callback;
	_tmp15__target = _data3_->callback_target;
	if (_tmp15_ != NULL) {
		GSourceFunc _tmp16_;
		gpointer _tmp16__target;
		_tmp16_ = _data3_->callback;
		_tmp16__target = _data3_->callback_target;
		_tmp16_ (_tmp16__target);
	}
}

static void
____lambda65__gchild_watch_func (GPid pid,
                                 gint wait_status,
                                 gpointer self)
{
	___lambda65_ (self, pid, wait_status);
}

static gboolean
_ft_command_execution_real_run_co_gsource_func (gpointer self)
{
	gboolean result;
	result = ft_command_execution_real_run_co (self);
	return result;
}

static gboolean
____lambda66_ (Block4Data* _data4_)
{
	Block3Data* _data3_;
	FtCommandExecution* self;
	GError* _tmp0_;
	GError* _tmp1_;
	GCancellable* _tmp2_;
	gboolean result;
	_data3_ = _data4_->_data3_;
	self = _data3_->self;
	_data3_->timeout_id = (guint) 0;
	_tmp0_ = g_error_new_literal (FT_COMMAND_ERROR, FT_COMMAND_ERROR_FAILED, _ ("Reached timeout"));
	_tmp1_ = _tmp0_;
	ft_job_set_error ((FtJob*) self, _tmp1_);
	_g_error_free0 (_tmp1_);
	_tmp2_ = self->priv->cancellable;
	g_cancellable_cancel (_tmp2_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
_____lambda66__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda66_ (self);
	return result;
}

static void
___lambda67_ (Block4Data* _data4_)
{
	Block3Data* _data3_;
	FtCommandExecution* self;
	gint _tmp0_;
	_data3_ = _data4_->_data3_;
	self = _data3_->self;
	_tmp0_ = self->priv->_exit_code;
	if (_tmp0_ < 0) {
		gchar* command_line = NULL;
		gchar** _tmp1_;
		gint _tmp1__length1;
		gint _tmp2_ = 0;
		gchar** _tmp3_;
		gint _tmp3__length1;
		gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp1_ = ft_command_execution_get_args (self, &_tmp2_);
		_tmp1__length1 = _tmp2_;
		_tmp3_ = _tmp1_;
		_tmp3__length1 = _tmp1__length1;
		_tmp4_ = _vala_g_strjoinv (" ", _tmp3_, (gint) _tmp3__length1);
		command_line = _tmp4_;
		_tmp5_ = command_line;
		g_debug ("command.vala:392: Cancel command `%s` with pid=%d", _tmp5_, (gint) _data3_->child_pid);
		kill ((pid_t) _data3_->child_pid, (gint) SIGTERM);
		_g_free0 (command_line);
	}
}

static void
____lambda67__g_cancellable_cancelled (GCancellable* _sender,
                                       gpointer self)
{
	___lambda67_ (self);
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

static gboolean
ft_command_execution_real_run_co (FtCommandExecutionRunData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->cancellable;
	_vala_return_val_if_fail (_data_->_tmp0_ == NULL, "this.cancellable == null", FALSE);
	_data_->_data3_ = g_slice_new0 (Block3Data);
	_data_->_data3_->_ref_count_ = 1;
	_data_->_data3_->self = g_object_ref (_data_->self);
	_data_->_data3_->_async_data_ = _data_;
	_data_->_tmp1_ = _data_->self->priv->_error;
	if (_data_->_tmp1_ != NULL) {
		_data_->_tmp2_ = _data_->self->priv->_error;
		_data_->_tmp3_ = g_error_copy (_data_->_tmp2_);
		_data_->_inner_error0_ = _data_->_tmp3_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		block3_data_unref (_data_->_data3_);
		_data_->_data3_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_data3_->callback = NULL;
	_data_->_data3_->callback_target = NULL;
	_data_->_data3_->callback_target_destroy_notify = NULL;
	_data_->_data3_->timeout_id = (guint) 0;
	_data_->args_length1 = 0;
	_data_->_args_size_ = 0;
	_data_->_tmp4_ = _data_->self->priv->_timeout;
	_data_->timeout = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->self->priv->_working_directory;
	_data_->_tmp6_ = g_strdup (_data_->_tmp5_);
	_data_->working_directory = _data_->_tmp6_;
	_data_->_tmp7_ = g_string_new ("");
	_data_->_data3_->output_builder = _data_->_tmp7_;
	_data_->_tmp8_ = g_cancellable_new ();
	_g_object_unref0 (_data_->self->priv->cancellable);
	_data_->self->priv->cancellable = _data_->_tmp8_;
	{
		_data_->_data4_ = g_slice_new0 (Block4Data);
		_data_->_data4_->_ref_count_ = 1;
		_data_->_data4_->_data3_ = block3_data_ref (_data_->_data3_);
		if (ft_is_flatpak ()) {
			_data_->_tmp9_ = g_strdup ("flatpak-spawn");
			_data_->_tmp10_ = g_strdup ("--host");
			_data_->_tmp11_ = g_new0 (gchar*, 2 + 1);
			_data_->_tmp11_[0] = _data_->_tmp9_;
			_data_->_tmp11_[1] = _data_->_tmp10_;
			_data_->flatpak_spawn_args = _data_->_tmp11_;
			_data_->flatpak_spawn_args_length1 = 2;
			_data_->_flatpak_spawn_args_size_ = _data_->flatpak_spawn_args_length1;
			_data_->_tmp12_ = _data_->working_directory;
			if (_data_->_tmp12_ != NULL) {
				_data_->_tmp13_ = _data_->working_directory;
				_data_->_tmp14_ = string_to_string (_data_->_tmp13_);
				_data_->_tmp15_ = g_strconcat ("--directory=", _data_->_tmp14_, NULL);
				_vala_array_add5 (&_data_->flatpak_spawn_args, &_data_->flatpak_spawn_args_length1, &_data_->_flatpak_spawn_args_size_, _data_->_tmp15_);
				_g_free0 (_data_->working_directory);
				_data_->working_directory = NULL;
			}
			_data_->_tmp17_ = 0;
			_data_->_tmp16_ = ft_command_execution_get_args (_data_->self, &_data_->_tmp17_);
			_data_->_tmp16__length1 = _data_->_tmp17_;
			_data_->_tmp18_ = _data_->_tmp16_;
			_data_->_tmp18__length1 = _data_->_tmp16__length1;
			{
				_data_->arg_collection_length1 = 0;
				_data_->_arg_collection_size_ = 0;
				_data_->arg_collection = _data_->_tmp18_;
				_data_->arg_collection_length1 = _data_->_tmp18__length1;
				for (_data_->arg_it = 0; _data_->arg_it < _data_->arg_collection_length1; _data_->arg_it = _data_->arg_it + 1) {
					_data_->_tmp19_ = g_strdup (_data_->arg_collection[_data_->arg_it]);
					_data_->arg = _data_->_tmp19_;
					{
						_data_->_tmp20_ = _data_->arg;
						_data_->_tmp21_ = g_strdup (_data_->_tmp20_);
						_vala_array_add6 (&_data_->flatpak_spawn_args, &_data_->flatpak_spawn_args_length1, &_data_->_flatpak_spawn_args_size_, _data_->_tmp21_);
						_g_free0 (_data_->arg);
					}
				}
			}
			_data_->_tmp22_ = _data_->flatpak_spawn_args;
			_data_->_tmp22__length1 = _data_->flatpak_spawn_args_length1;
			_data_->_tmp23_ = (_data_->_tmp22_ != NULL) ? _vala_array_dup3 (_data_->_tmp22_, _data_->_tmp22__length1) : _data_->_tmp22_;
			_data_->_tmp23__length1 = _data_->_tmp22__length1;
			_data_->args = (_vala_array_free (_data_->args, _data_->args_length1, (GDestroyNotify) g_free), NULL);
			_data_->args = _data_->_tmp23_;
			_data_->args_length1 = _data_->_tmp23__length1;
			_data_->_args_size_ = _data_->args_length1;
			_data_->flatpak_spawn_args = (_vala_array_free (_data_->flatpak_spawn_args, _data_->flatpak_spawn_args_length1, (GDestroyNotify) g_free), NULL);
		} else {
			_data_->_tmp25_ = 0;
			_data_->_tmp24_ = ft_command_execution_get_args (_data_->self, &_data_->_tmp25_);
			_data_->_tmp24__length1 = _data_->_tmp25_;
			_data_->_tmp26_ = _data_->_tmp24_;
			_data_->_tmp26__length1 = _data_->_tmp24__length1;
			_data_->_tmp27_ = (_data_->_tmp26_ != NULL) ? _vala_array_dup4 (_data_->_tmp26_, _data_->_tmp26__length1) : _data_->_tmp26_;
			_data_->_tmp27__length1 = _data_->_tmp26__length1;
			_data_->args = (_vala_array_free (_data_->args, _data_->args_length1, (GDestroyNotify) g_free), NULL);
			_data_->args = _data_->_tmp27_;
			_data_->args_length1 = _data_->_tmp27__length1;
			_data_->_args_size_ = _data_->args_length1;
		}
		_data_->_data4_->start_time = g_get_monotonic_time ();
		_data_->_tmp28_ = _data_->working_directory;
		_data_->_tmp29_ = _data_->args;
		_data_->_tmp29__length1 = _data_->args_length1;
		_data_->_tmp30_ = 0;
		_data_->_tmp31_ = 0;
		_data_->_tmp32_ = 0;
		_data_->_tmp33_ = 0;
		g_spawn_async_with_pipes (_data_->_tmp28_, _data_->_tmp29_, NULL, FT_COMMAND_EXECUTION_SPAWN_FLAGS, _ft_setup_child_gspawn_child_setup_func, NULL, &_data_->_tmp30_, &_data_->_tmp31_, &_data_->_tmp32_, &_data_->_tmp33_, &_data_->_inner_error0_);
		_data_->_data3_->child_pid = _data_->_tmp30_;
		_data_->standard_input = _data_->_tmp31_;
		_data_->standard_output = _data_->_tmp32_;
		_data_->standard_error = _data_->_tmp33_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block4_data_unref (_data_->_data4_);
			_data_->_data4_ = NULL;
			if (_data_->_inner_error0_->domain == G_SPAWN_ERROR) {
				goto __catch0_g_spawn_error;
			}
			_g_free0 (_data_->working_directory);
			_data_->args = (_vala_array_free (_data_->args, _data_->args_length1, (GDestroyNotify) g_free), NULL);
			block3_data_unref (_data_->_data3_);
			_data_->_data3_ = NULL;
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp34_ = _data_->self->priv->_input;
		if (g_strcmp0 (_data_->_tmp34_, "") != 0) {
			_data_->_tmp35_ = g_io_channel_unix_new (_data_->standard_input);
			_data_->input_channel = _data_->_tmp35_;
			{
				_data_->_tmp36_ = _data_->input_channel;
				_data_->_tmp37_ = _data_->self->priv->_input;
				_data_->_tmp38_ = 0;
				_data_->_tmp39_ = string_to_utf8 (_data_->_tmp37_, &_data_->_tmp38_);
				_data_->_tmp40_ = _data_->_tmp39_;
				_data_->_tmp40__length1 = _data_->_tmp38_;
				g_io_channel_write_chars (_data_->_tmp36_, _data_->_tmp40_, (gint) _data_->_tmp38_, NULL, &_data_->_inner_error0_);
				_data_->_tmp40_ = (g_free (_data_->_tmp40_), NULL);
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					goto __catch1_g_error;
				}
			}
			goto __finally1;
			__catch1_g_error:
			{
				_data_->_error_ = _data_->_inner_error0_;
				_data_->_inner_error0_ = NULL;
				_data_->_tmp41_ = _data_->_error_;
				_data_->_tmp42_ = _data_->_tmp41_->message;
				g_warning ("command.vala:320: Failed to pass JSON data: %s", _data_->_tmp42_);
				_g_error_free0 (_data_->_error_);
			}
			__finally1:
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_io_channel_unref0 (_data_->input_channel);
				block4_data_unref (_data_->_data4_);
				_data_->_data4_ = NULL;
				if (_data_->_inner_error0_->domain == G_SPAWN_ERROR) {
					goto __catch0_g_spawn_error;
				}
				_g_free0 (_data_->working_directory);
				_data_->args = (_vala_array_free (_data_->args, _data_->args_length1, (GDestroyNotify) g_free), NULL);
				block3_data_unref (_data_->_data3_);
				_data_->_data3_ = NULL;
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_data_->_tmp43_ = _data_->input_channel;
			g_io_channel_shutdown (_data_->_tmp43_, TRUE, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_io_channel_unref0 (_data_->input_channel);
				block4_data_unref (_data_->_data4_);
				_data_->_data4_ = NULL;
				if (_data_->_inner_error0_->domain == G_SPAWN_ERROR) {
					goto __catch0_g_spawn_error;
				}
				goto __finally0;
			}
			_g_io_channel_unref0 (_data_->input_channel);
		}
		_data_->_tmp44_ = g_io_channel_unix_new (_data_->standard_output);
		_data_->output_channel = _data_->_tmp44_;
		_data_->_tmp45_ = _data_->output_channel;
		g_io_add_watch (_data_->_tmp45_, G_IO_IN | G_IO_HUP, ____lambda63__gio_func, _data_->_data4_);
		_data_->_tmp46_ = g_io_channel_unix_new (_data_->standard_error);
		_data_->error_channel = _data_->_tmp46_;
		_data_->_tmp47_ = _data_->error_channel;
		g_io_add_watch (_data_->_tmp47_, G_IO_IN | G_IO_HUP, ____lambda64__gio_func, _data_->_data4_);
		g_child_watch_add_full (G_PRIORITY_DEFAULT_IDLE, _data_->_data3_->child_pid, ____lambda65__gchild_watch_func, block4_data_ref (_data_->_data4_), block4_data_unref);
		(_data_->_data3_->callback_target_destroy_notify == NULL) ? NULL : (_data_->_data3_->callback_target_destroy_notify (_data_->_data3_->callback_target), NULL);
		_data_->_data3_->callback = NULL;
		_data_->_data3_->callback_target = NULL;
		_data_->_data3_->callback_target_destroy_notify = NULL;
		_data_->_data3_->callback = _ft_command_execution_real_run_co_gsource_func;
		_data_->_data3_->callback_target = _data_;
		_data_->_data3_->callback_target_destroy_notify = NULL;
		if (_data_->timeout > 0) {
			_data_->_data3_->timeout_id = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) _data_->timeout, _____lambda66__gsource_func, block4_data_ref (_data_->_data4_), block4_data_unref);
			g_source_set_name_by_id (_data_->_data3_->timeout_id, "Ft.CommandExecution.run");
		}
		_data_->_tmp48_ = _data_->self->priv->cancellable;
		g_signal_connect_data (_data_->_tmp48_, "cancelled", (GCallback) ____lambda67__g_cancellable_cancelled, block4_data_ref (_data_->_data4_), (GClosureNotify) block4_data_unref, 0);
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
		g_spawn_close_pid (_data_->_data3_->child_pid);
		_g_io_channel_unref0 (_data_->error_channel);
		_g_io_channel_unref0 (_data_->output_channel);
		block4_data_unref (_data_->_data4_);
		_data_->_data4_ = NULL;
	}
	goto __finally0;
	__catch0_g_spawn_error:
	{
		_data_->_vala1__error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp50_ = 0;
		_data_->_tmp49_ = ft_command_execution_get_args (_data_->self, &_data_->_tmp50_);
		_data_->_tmp49__length1 = _data_->_tmp50_;
		_data_->_tmp51_ = _data_->_tmp49_;
		_data_->_tmp51__length1 = _data_->_tmp49__length1;
		_data_->_tmp52_ = _vala_g_strjoinv (" ", _data_->_tmp51_, (gint) _data_->_tmp51__length1);
		_data_->command_line = _data_->_tmp52_;
		_data_->_tmp53_ = _data_->command_line;
		_data_->_tmp54_ = _data_->_vala1__error_;
		_data_->_tmp55_ = _data_->_tmp54_->message;
		g_warning ("command.vala:406: Error while spawning command `%s`: %s", _data_->_tmp53_, _data_->_tmp55_);
		_data_->_tmp56_ = g_error_new_literal (FT_COMMAND_ERROR, FT_COMMAND_ERROR_FAILED, _ ("Failed to execute command"));
		_data_->_tmp57_ = _data_->_tmp56_;
		ft_job_set_error ((FtJob*) _data_->self, _data_->_tmp57_);
		_g_error_free0 (_data_->_tmp57_);
		_data_->_tmp58_ = ft_job_get_error ((FtJob*) _data_->self);
		_data_->_tmp59_ = _data_->_tmp58_;
		_data_->_tmp60_ = _g_error_copy0 (_data_->_tmp59_);
		_data_->_inner_error0_ = _data_->_tmp60_;
		_g_free0 (_data_->command_line);
		_g_error_free0 (_data_->_vala1__error_);
		goto __finally0;
	}
	__finally0:
	{
		if (_data_->_data3_->timeout_id != ((guint) 0)) {
			g_source_remove (_data_->_data3_->timeout_id);
			_data_->_data3_->timeout_id = (guint) 0;
		}
		ft_job_set_completed ((FtJob*) _data_->self, TRUE);
	}
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_free0 (_data_->working_directory);
		_data_->args = (_vala_array_free (_data_->args, _data_->args_length1, (GDestroyNotify) g_free), NULL);
		block3_data_unref (_data_->_data3_);
		_data_->_data3_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp62_ = ft_job_get_error ((FtJob*) _data_->self);
	_data_->_tmp63_ = _data_->_tmp62_;
	if (_data_->_tmp63_ == NULL) {
		_data_->_tmp64_ = _data_->self->priv->_exit_code;
		_data_->_tmp61_ = _data_->_tmp64_ == 0;
	} else {
		_data_->_tmp61_ = FALSE;
	}
	_data_->result = _data_->_tmp61_;
	_g_free0 (_data_->working_directory);
	_data_->args = (_vala_array_free (_data_->args, _data_->args_length1, (GDestroyNotify) g_free), NULL);
	block3_data_unref (_data_->_data3_);
	_data_->_data3_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

gchar*
ft_command_execution_get_line (FtCommandExecution* self)
{
	GString* line = NULL;
	GString* _tmp0_;
	gint index = 0;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gint _tmp2_ = 0;
	gchar** _tmp3_;
	gint _tmp3__length1;
	GString* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_string_new ("");
	line = _tmp0_;
	index = 0;
	_tmp1_ = ft_command_execution_get_args (self, &_tmp2_);
	_tmp1__length1 = _tmp2_;
	_tmp3_ = _tmp1_;
	_tmp3__length1 = _tmp1__length1;
	{
		gchar** arg_collection = NULL;
		gint arg_collection_length1 = 0;
		gint _arg_collection_size_ = 0;
		gint arg_it = 0;
		arg_collection = _tmp3_;
		arg_collection_length1 = _tmp3__length1;
		for (arg_it = 0; arg_it < arg_collection_length1; arg_it = arg_it + 1) {
			gchar* _tmp4_;
			gchar* arg = NULL;
			_tmp4_ = g_strdup (arg_collection[arg_it]);
			arg = _tmp4_;
			{
				GString* _tmp6_;
				const gchar* _tmp7_;
				gint _tmp8_;
				if (index > 0) {
					GString* _tmp5_;
					_tmp5_ = line;
					g_string_append_c (_tmp5_, ' ');
				}
				_tmp6_ = line;
				_tmp7_ = arg;
				g_string_append (_tmp6_, _tmp7_);
				_tmp8_ = index;
				index = _tmp8_ + 1;
				_g_free0 (arg);
			}
		}
	}
	_tmp9_ = line;
	_tmp10_ = _tmp9_->str;
	_tmp11_ = g_strdup (_tmp10_);
	result = _tmp11_;
	_g_string_free0 (line);
	return result;
}

gchar**
ft_command_execution_get_args (FtCommandExecution* self,
                               gint* result_length1)
{
	gchar** result;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_args;
	_tmp0__length1 = self->priv->_args_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}

static gchar**
_vala_array_dup5 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
ft_command_execution_set_args (FtCommandExecution* self,
                               gchar** value,
                               gint value_length1)
{
	gchar** old_value;
	gint old_value_length;
	g_return_if_fail (self != NULL);
	old_value = ft_command_execution_get_args (self, &old_value_length);
	if (old_value != value) {
		gchar** _tmp0_;
		gint _tmp0__length1;
		_tmp0_ = (value != NULL) ? _vala_array_dup5 (value, value_length1) : value;
		_tmp0__length1 = value_length1;
		self->priv->_args = (_vala_array_free (self->priv->_args, self->priv->_args_length1, (GDestroyNotify) g_free), NULL);
		self->priv->_args = _tmp0_;
		self->priv->_args_length1 = _tmp0__length1;
		self->priv->__args_size_ = self->priv->_args_length1;
		g_object_notify_by_pspec ((GObject *) self, ft_command_execution_properties[FT_COMMAND_EXECUTION_ARGS_PROPERTY]);
	}
}

const gchar*
ft_command_execution_get_working_directory (FtCommandExecution* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_working_directory;
	result = _tmp0_;
	return result;
}

static void
ft_command_execution_set_working_directory (FtCommandExecution* self,
                                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_command_execution_get_working_directory (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_working_directory);
		self->priv->_working_directory = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, ft_command_execution_properties[FT_COMMAND_EXECUTION_WORKING_DIRECTORY_PROPERTY]);
	}
}

const gchar*
ft_command_execution_get_input (FtCommandExecution* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_input;
	result = _tmp0_;
	return result;
}

void
ft_command_execution_set_input (FtCommandExecution* self,
                                const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_command_execution_get_input (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_input);
		self->priv->_input = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, ft_command_execution_properties[FT_COMMAND_EXECUTION_INPUT_PROPERTY]);
	}
}

gint
ft_command_execution_get_timeout (FtCommandExecution* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_timeout;
	return result;
}

void
ft_command_execution_set_timeout (FtCommandExecution* self,
                                  gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_command_execution_get_timeout (self);
	if (old_value != value) {
		self->priv->_timeout = value;
		g_object_notify_by_pspec ((GObject *) self, ft_command_execution_properties[FT_COMMAND_EXECUTION_TIMEOUT_PROPERTY]);
	}
}

gint
ft_command_execution_get_exit_code (FtCommandExecution* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_exit_code;
	return result;
}

static void
ft_command_execution_set_exit_code (FtCommandExecution* self,
                                    gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_command_execution_get_exit_code (self);
	if (old_value != value) {
		self->priv->_exit_code = value;
		g_object_notify_by_pspec ((GObject *) self, ft_command_execution_properties[FT_COMMAND_EXECUTION_EXIT_CODE_PROPERTY]);
	}
}

const gchar*
ft_command_execution_get_output (FtCommandExecution* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_output;
	result = _tmp0_;
	return result;
}

static void
ft_command_execution_set_output (FtCommandExecution* self,
                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_command_execution_get_output (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_output);
		self->priv->_output = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, ft_command_execution_properties[FT_COMMAND_EXECUTION_OUTPUT_PROPERTY]);
	}
}

gint64
ft_command_execution_get_execution_time (FtCommandExecution* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_execution_time;
	return result;
}

static void
ft_command_execution_set_execution_time (FtCommandExecution* self,
                                         gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_command_execution_get_execution_time (self);
	if (old_value != value) {
		self->priv->_execution_time = value;
		g_object_notify_by_pspec ((GObject *) self, ft_command_execution_properties[FT_COMMAND_EXECUTION_EXECUTION_TIME_PROPERTY]);
	}
}

static gboolean
ft_command_execution_real_get_completed (FtJob* base)
{
	gboolean result;
	FtCommandExecution* self;
	self = (FtCommandExecution*) base;
	result = self->priv->_completed;
	return result;
}

static void
ft_command_execution_real_set_completed (FtJob* base,
                                         gboolean value)
{
	FtCommandExecution* self;
	self = (FtCommandExecution*) base;
	if (self->priv->_completed != value) {
		self->priv->_completed = value;
		g_object_notify ((GObject*) self, "completed");
	}
}

static GError*
ft_command_execution_real_get_error (FtJob* base)
{
	GError* result;
	FtCommandExecution* self;
	GError* _tmp0_;
	self = (FtCommandExecution*) base;
	_tmp0_ = self->priv->_error;
	result = _tmp0_;
	return result;
}

static void
ft_command_execution_real_set_error (FtJob* base,
                                     GError* value)
{
	FtCommandExecution* self;
	GError* _tmp0_;
	self = (FtCommandExecution*) base;
	_tmp0_ = _g_error_copy0 (value);
	_g_error_free0 (self->priv->_error);
	self->priv->_error = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, ft_command_execution_properties[FT_COMMAND_EXECUTION_ERROR_PROPERTY]);
}

static void
ft_command_execution_class_init (FtCommandExecutionClass * klass,
                                 gpointer klass_data)
{
	ft_command_execution_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtCommandExecution_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_command_execution_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_ft_command_execution_set_property;
	G_OBJECT_CLASS (klass)->finalize = ft_command_execution_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_COMMAND_EXECUTION_ARGS_PROPERTY, ft_command_execution_properties[FT_COMMAND_EXECUTION_ARGS_PROPERTY] = g_param_spec_boxed ("args", "args", "args", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_COMMAND_EXECUTION_WORKING_DIRECTORY_PROPERTY, ft_command_execution_properties[FT_COMMAND_EXECUTION_WORKING_DIRECTORY_PROPERTY] = g_param_spec_string ("working-directory", "working-directory", "working-directory", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_COMMAND_EXECUTION_INPUT_PROPERTY, ft_command_execution_properties[FT_COMMAND_EXECUTION_INPUT_PROPERTY] = g_param_spec_string ("input", "input", "input", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_COMMAND_EXECUTION_TIMEOUT_PROPERTY, ft_command_execution_properties[FT_COMMAND_EXECUTION_TIMEOUT_PROPERTY] = g_param_spec_int ("timeout", "timeout", "timeout", G_MININT, G_MAXINT, -1, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_COMMAND_EXECUTION_EXIT_CODE_PROPERTY, ft_command_execution_properties[FT_COMMAND_EXECUTION_EXIT_CODE_PROPERTY] = g_param_spec_int ("exit-code", "exit-code", "exit-code", G_MININT, G_MAXINT, -1, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_COMMAND_EXECUTION_OUTPUT_PROPERTY, ft_command_execution_properties[FT_COMMAND_EXECUTION_OUTPUT_PROPERTY] = g_param_spec_string ("output", "output", "output", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_COMMAND_EXECUTION_EXECUTION_TIME_PROPERTY, ft_command_execution_properties[FT_COMMAND_EXECUTION_EXECUTION_TIME_PROPERTY] = g_param_spec_int64 ("execution-time", "execution-time", "execution-time", G_MININT64, G_MAXINT64, (gint64) 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_COMMAND_EXECUTION_COMPLETED_PROPERTY, ft_command_execution_properties[FT_COMMAND_EXECUTION_COMPLETED_PROPERTY] = g_param_spec_boolean ("completed", "completed", "completed", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_COMMAND_EXECUTION_ERROR_PROPERTY, ft_command_execution_properties[FT_COMMAND_EXECUTION_ERROR_PROPERTY] = g_param_spec_boxed ("error", "error", "error", G_TYPE_ERROR, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
ft_command_execution_ft_job_interface_init (FtJobIface * iface,
                                            gpointer iface_data)
{
	ft_command_execution_ft_job_parent_iface = g_type_interface_peek_parent (iface);
	iface->run = (void (*) (FtJob*, GAsyncReadyCallback, gpointer)) ft_command_execution_real_run;
	iface->run_finish = (gboolean (*) (FtJob*, GAsyncResult*, GError**)) ft_command_execution_run_finish;
	iface->get_completed = ft_command_execution_real_get_completed;
	iface->set_completed = ft_command_execution_real_set_completed;
	iface->get_error = ft_command_execution_real_get_error;
	iface->set_error = ft_command_execution_real_set_error;
}

static void
ft_command_execution_instance_init (FtCommandExecution * self,
                                    gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	self->priv = ft_command_execution_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_input = _tmp0_;
	self->priv->_timeout = -1;
	self->priv->_exit_code = -1;
	_tmp1_ = g_strdup ("");
	self->priv->_output = _tmp1_;
	self->priv->_execution_time = (gint64) 0;
	self->priv->cancellable = NULL;
	self->priv->_error = NULL;
	self->priv->_completed = FALSE;
}

static void
ft_command_execution_finalize (GObject * obj)
{
	FtCommandExecution * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_COMMAND_EXECUTION, FtCommandExecution);
	self->priv->_args = (_vala_array_free (self->priv->_args, self->priv->_args_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (self->priv->_working_directory);
	_g_free0 (self->priv->_input);
	_g_free0 (self->priv->_output);
	_g_object_unref0 (self->priv->cancellable);
	_g_error_free0 (self->priv->_error);
	G_OBJECT_CLASS (ft_command_execution_parent_class)->finalize (obj);
}

/**
     * Object representing a single execution of a command - its arguments and output.
     *
     * It's an object because we may display it in the Log UI and updates are applied on its own.
     */
static GType
ft_command_execution_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtCommandExecutionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_command_execution_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtCommandExecution), 0, (GInstanceInitFunc) ft_command_execution_instance_init, NULL };
	static const GInterfaceInfo ft_job_info = { (GInterfaceInitFunc) ft_command_execution_ft_job_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType ft_command_execution_type_id;
	ft_command_execution_type_id = g_type_register_static (G_TYPE_OBJECT, "FtCommandExecution", &g_define_type_info, 0);
	g_type_add_interface_static (ft_command_execution_type_id, FT_TYPE_JOB, &ft_job_info);
	FtCommandExecution_private_offset = g_type_add_instance_private (ft_command_execution_type_id, sizeof (FtCommandExecutionPrivate));
	return ft_command_execution_type_id;
}

GType
ft_command_execution_get_type (void)
{
	static volatile gsize ft_command_execution_type_id__once = 0;
	if (g_once_init_enter (&ft_command_execution_type_id__once)) {
		GType ft_command_execution_type_id;
		ft_command_execution_type_id = ft_command_execution_get_type_once ();
		g_once_init_leave (&ft_command_execution_type_id__once, ft_command_execution_type_id);
	}
	return ft_command_execution_type_id__once;
}

static void
_vala_ft_command_execution_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	FtCommandExecution * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_COMMAND_EXECUTION, FtCommandExecution);
	switch (property_id) {
		case FT_COMMAND_EXECUTION_ARGS_PROPERTY:
		{
			int length;
			g_value_set_boxed (value, ft_command_execution_get_args (self, &length));
		}
		break;
		case FT_COMMAND_EXECUTION_WORKING_DIRECTORY_PROPERTY:
		g_value_set_string (value, ft_command_execution_get_working_directory (self));
		break;
		case FT_COMMAND_EXECUTION_INPUT_PROPERTY:
		g_value_set_string (value, ft_command_execution_get_input (self));
		break;
		case FT_COMMAND_EXECUTION_TIMEOUT_PROPERTY:
		g_value_set_int (value, ft_command_execution_get_timeout (self));
		break;
		case FT_COMMAND_EXECUTION_EXIT_CODE_PROPERTY:
		g_value_set_int (value, ft_command_execution_get_exit_code (self));
		break;
		case FT_COMMAND_EXECUTION_OUTPUT_PROPERTY:
		g_value_set_string (value, ft_command_execution_get_output (self));
		break;
		case FT_COMMAND_EXECUTION_EXECUTION_TIME_PROPERTY:
		g_value_set_int64 (value, ft_command_execution_get_execution_time (self));
		break;
		case FT_COMMAND_EXECUTION_COMPLETED_PROPERTY:
		g_value_set_boolean (value, ft_job_get_completed ((FtJob*) self));
		break;
		case FT_COMMAND_EXECUTION_ERROR_PROPERTY:
		g_value_set_boxed (value, ft_job_get_error ((FtJob*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_ft_command_execution_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec)
{
	FtCommandExecution * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_COMMAND_EXECUTION, FtCommandExecution);
	switch (property_id) {
		case FT_COMMAND_EXECUTION_ARGS_PROPERTY:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			ft_command_execution_set_args (self, boxed, (boxed == NULL) ? 0 : g_strv_length (boxed));
		}
		break;
		case FT_COMMAND_EXECUTION_WORKING_DIRECTORY_PROPERTY:
		ft_command_execution_set_working_directory (self, g_value_get_string (value));
		break;
		case FT_COMMAND_EXECUTION_INPUT_PROPERTY:
		ft_command_execution_set_input (self, g_value_get_string (value));
		break;
		case FT_COMMAND_EXECUTION_TIMEOUT_PROPERTY:
		ft_command_execution_set_timeout (self, g_value_get_int (value));
		break;
		case FT_COMMAND_EXECUTION_EXIT_CODE_PROPERTY:
		ft_command_execution_set_exit_code (self, g_value_get_int (value));
		break;
		case FT_COMMAND_EXECUTION_OUTPUT_PROPERTY:
		ft_command_execution_set_output (self, g_value_get_string (value));
		break;
		case FT_COMMAND_EXECUTION_EXECUTION_TIME_PROPERTY:
		ft_command_execution_set_execution_time (self, g_value_get_int64 (value));
		break;
		case FT_COMMAND_EXECUTION_COMPLETED_PROPERTY:
		ft_job_set_completed ((FtJob*) self, g_value_get_boolean (value));
		break;
		case FT_COMMAND_EXECUTION_ERROR_PROPERTY:
		ft_job_set_error ((FtJob*) self, g_value_get_boxed (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
ft_command_get_instance_private (FtCommand* self)
{
	return G_STRUCT_MEMBER_P (self, FtCommand_private_offset);
}

static void
_vala_FtCommandVariable_array_free (FtCommandVariable * array,
                                    gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			ft_command_variable_destroy (&array[i]);
		}
	}
	g_free (array);
}

FtCommand*
ft_command_construct (GType object_type,
                      const gchar* line)
{
	FtCommand * self = NULL;
	g_return_val_if_fail (line != NULL, NULL);
	self = (FtCommand*) g_object_new (object_type, "line", line, NULL);
	return self;
}

FtCommand*
ft_command_new (const gchar* line)
{
	return ft_command_construct (FT_TYPE_COMMAND, line);
}

static void
ft_command_prepare_args (FtCommand* self,
                         GError** error)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	if (self->priv->_use_subshell) {
		gchar* line = NULL;
		const gchar* _tmp0_;
		gchar* _tmp1_;
		const gchar* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		const gchar* _tmp8_;
		gchar* _tmp9_;
		gchar** _tmp10_;
		_tmp0_ = self->priv->_line;
		_tmp1_ = string_strip (_tmp0_);
		line = _tmp1_;
		_tmp2_ = line;
		_tmp3_ = strlen (_tmp2_);
		_tmp4_ = _tmp3_;
		if (_tmp4_ == 0) {
			GError* _tmp5_;
			_tmp5_ = g_error_new_literal (FT_COMMAND_ERROR, FT_COMMAND_ERROR_EMPTY_LINE, _ ("Command is empty"));
			_inner_error0_ = _tmp5_;
			if (_inner_error0_->domain == FT_COMMAND_ERROR) {
				g_propagate_error (error, _inner_error0_);
				_g_free0 (line);
				return;
			} else {
				_g_free0 (line);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
		}
		_tmp6_ = g_strdup ("sh");
		_tmp7_ = g_strdup ("-c");
		_tmp8_ = line;
		_tmp9_ = g_strdup (_tmp8_);
		_tmp10_ = g_new0 (gchar*, 3 + 1);
		_tmp10_[0] = _tmp6_;
		_tmp10_[1] = _tmp7_;
		_tmp10_[2] = _tmp9_;
		self->priv->args = (_vala_array_free (self->priv->args, self->priv->args_length1, (GDestroyNotify) g_free), NULL);
		self->priv->args = _tmp10_;
		self->priv->args_length1 = 3;
		self->priv->_args_size_ = self->priv->args_length1;
		_g_free0 (line);
	} else {
		{
			const gchar* _tmp11_;
			gchar** _tmp12_ = NULL;
			gint _tmp13_ = 0;
			_tmp11_ = self->priv->_line;
			g_shell_parse_argv (_tmp11_, &_tmp13_, &_tmp12_, &_inner_error0_);
			self->priv->args = (_vala_array_free (self->priv->args, self->priv->args_length1, (GDestroyNotify) g_free), NULL);
			self->priv->args = _tmp12_;
			self->priv->args_length1 = _tmp13_;
			self->priv->_args_size_ = self->priv->args_length1;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == G_SHELL_ERROR) {
					goto __catch0_g_shell_error;
				}
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
		}
		goto __finally0;
		__catch0_g_shell_error:
		{
			GError* _error_ = NULL;
			const gchar* _tmp14_;
			const gchar* _tmp15_;
			gchar* _tmp16_;
			gchar** _tmp17_;
			GError* _tmp18_;
			GError* _tmp20_;
			const gchar* _tmp22_;
			GError* _tmp23_;
			const gchar* _tmp24_;
			GError* _tmp25_;
			_error_ = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp14_ = ft_command_get_line (self);
			_tmp15_ = _tmp14_;
			_tmp16_ = g_strdup (_tmp15_);
			_tmp17_ = g_new0 (gchar*, 1 + 1);
			_tmp17_[0] = _tmp16_;
			self->priv->args = (_vala_array_free (self->priv->args, self->priv->args_length1, (GDestroyNotify) g_free), NULL);
			self->priv->args = _tmp17_;
			self->priv->args_length1 = 1;
			self->priv->_args_size_ = self->priv->args_length1;
			_tmp18_ = _error_;
			if (g_error_matches (_tmp18_, G_SHELL_ERROR, G_SHELL_ERROR_EMPTY_STRING)) {
				GError* _tmp19_;
				_tmp19_ = g_error_new_literal (FT_COMMAND_ERROR, FT_COMMAND_ERROR_EMPTY_LINE, _ ("Command is empty"));
				_inner_error0_ = _tmp19_;
				_g_error_free0 (_error_);
				goto __finally0;
			}
			_tmp20_ = _error_;
			if (g_error_matches (_tmp20_, G_SHELL_ERROR, G_SHELL_ERROR_BAD_QUOTING)) {
				GError* _tmp21_;
				_tmp21_ = g_error_new_literal (FT_COMMAND_ERROR, FT_COMMAND_ERROR_SYNTAX_ERROR, _ ("Unclosed quotation mark"));
				_inner_error0_ = _tmp21_;
				_g_error_free0 (_error_);
				goto __finally0;
			}
			_tmp22_ = self->priv->_line;
			_tmp23_ = _error_;
			_tmp24_ = _tmp23_->message;
			g_warning ("command.vala:513: Unexpected error while parsing command '%s': %s", _tmp22_, _tmp24_);
			_tmp25_ = g_error_new_literal (FT_COMMAND_ERROR, FT_COMMAND_ERROR_SYNTAX_ERROR, _ ("Invalid command"));
			_inner_error0_ = _tmp25_;
			_g_error_free0 (_error_);
			goto __finally0;
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == FT_COMMAND_ERROR) {
				g_propagate_error (error, _inner_error0_);
				return;
			} else {
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
		}
	}
}

static Block5Data*
block5_data_ref (Block5Data* _data5_)
{
	g_atomic_int_inc (&_data5_->_ref_count_);
	return _data5_;
}

static void
block5_data_unref (void * _userdata_)
{
	Block5Data* _data5_;
	_data5_ = (Block5Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
		FtCommand* self;
		self = _data5_->self;
		_data5_->variables = (_vala_FtCommandVariable_array_free (_data5_->variables, _data5_->variables_length1), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block5Data, _data5_);
	}
}

static Block6Data*
block6_data_ref (Block6Data* _data6_)
{
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}

static void
block6_data_unref (void * _userdata_)
{
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		FtCommand* self;
		self = _data6_->_data5_->self;
		block5_data_unref (_data6_->_data5_);
		_data6_->_data5_ = NULL;
		g_slice_free (Block6Data, _data6_);
	}
}

static Block7Data*
block7_data_ref (Block7Data* _data7_)
{
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}

static void
block7_data_unref (void * _userdata_)
{
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		FtCommand* self;
		self = _data7_->_data6_->_data5_->self;
		_g_error_free0 (_data7_->_error_);
		block6_data_unref (_data7_->_data6_);
		_data7_->_data6_ = NULL;
		g_slice_free (Block7Data, _data7_);
	}
}

static void
_vala_array_add7 (FtCommandVariable* * array,
                  gint* length,
                  gint* size,
                  const FtCommandVariable* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (FtCommandVariable, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_____lambda62_ (Block7Data* _data7_,
                FtCommandVariable* variable)
{
	Block6Data* _data6_;
	Block5Data* _data5_;
	FtCommand* self;
	GError* _tmp0_;
	const gchar* _tmp1_;
	FtCommandVariable _tmp10_;
	FtCommandVariable _tmp11_ = {0};
	_data6_ = _data7_->_data6_;
	_data5_ = _data6_->_data5_;
	self = _data5_->self;
	_tmp0_ = _data7_->_error_;
	if (_tmp0_ != NULL) {
		return;
	}
	_tmp1_ = (*variable).name;
	if (g_strcmp0 (_tmp1_, "") != 0) {
		const gchar* _tmp2_;
		FtVariableSpec* _tmp3_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		_tmp2_ = (*variable).name;
		_tmp3_ = ft_find_variable (_tmp2_);
		if (_tmp3_ == NULL) {
			const gchar* _tmp4_;
			GError* _tmp5_;
			_tmp4_ = (*variable).name_raw;
			_tmp5_ = g_error_new (FT_COMMAND_ERROR, FT_COMMAND_ERROR_UNKNOWN_VARIABLE, _ ("Unknown variable \"%s\""), _tmp4_);
			_g_error_free0 (_data7_->_error_);
			_data7_->_error_ = _tmp5_;
			return;
		}
		_tmp6_ = (*variable).name;
		_tmp7_ = (*variable).format;
		if (!ft_find_variable_format (_tmp6_, _tmp7_)) {
			const gchar* _tmp8_;
			GError* _tmp9_;
			_tmp8_ = (*variable).format_raw;
			_tmp9_ = g_error_new (FT_COMMAND_ERROR, FT_COMMAND_ERROR_UNKNOWN_VARIABLE_FORMAT, _ ("Unknown format \"%s\""), _tmp8_);
			_g_error_free0 (_data7_->_error_);
			_data7_->_error_ = _tmp9_;
			return;
		}
	}
	(*variable).arg_index = _data6_->index;
	_tmp10_ = *variable;
	ft_command_variable_copy (&_tmp10_, &_tmp11_);
	_vala_array_add7 (&_data5_->variables, &_data5_->variables_length1, &_data5_->_variables_size_, &_tmp11_);
}

static void
______lambda62__gfunc (gconstpointer data,
                       gpointer self)
{
	_____lambda62_ (self, (FtCommandVariable*) data);
}

static FtCommandVariable*
_vala_array_dup6 (FtCommandVariable* self,
                  gssize length)
{
	if (length > 0) {
		FtCommandVariable* result;
		gssize i;
		result = g_new0 (FtCommandVariable, length);
		for (i = 0; i < length; i++) {
			FtCommandVariable _tmp0_;
			FtCommandVariable _tmp1_ = {0};
			_tmp0_ = self[i];
			ft_command_variable_copy (&_tmp0_, &_tmp1_);
			result[i] = _tmp1_;
		}
		return result;
	}
	return NULL;
}

static void
ft_command_prepare_variables (FtCommand* self,
                              GError** error)
{
	gchar** _tmp0_;
	gint _tmp0__length1;
	Block5Data* _data5_;
	FtCommandVariable* _tmp1_;
	FtCommandVariable* _tmp10_;
	gint _tmp10__length1;
	FtCommandVariable* _tmp11_;
	gint _tmp11__length1;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->args;
	_tmp0__length1 = self->priv->args_length1;
	_vala_return_if_fail (_tmp0_ != NULL, "this.args != null");
	_data5_ = g_slice_new0 (Block5Data);
	_data5_->_ref_count_ = 1;
	_data5_->self = g_object_ref (self);
	_tmp1_ = g_new0 (FtCommandVariable, 0);
	_data5_->variables = _tmp1_;
	_data5_->variables_length1 = 0;
	_data5_->_variables_size_ = _data5_->variables_length1;
	{
		Block6Data* _data6_;
		_data6_ = g_slice_new0 (Block6Data);
		_data6_->_ref_count_ = 1;
		_data6_->_data5_ = block5_data_ref (_data5_);
		_data6_->index = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				Block7Data* _data7_;
				gchar** _tmp4_;
				gint _tmp4__length1;
				gchar** _tmp5_;
				gint _tmp5__length1;
				const gchar* _tmp6_;
				GError* _tmp7_;
				_data7_ = g_slice_new0 (Block7Data);
				_data7_->_ref_count_ = 1;
				_data7_->_data6_ = block6_data_ref (_data6_);
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = _data6_->index;
					_data6_->index = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = self->priv->args;
				_tmp4__length1 = self->priv->args_length1;
				if (!(_data6_->index < _tmp4__length1)) {
					block7_data_unref (_data7_);
					_data7_ = NULL;
					break;
				}
				_data7_->_error_ = NULL;
				_tmp5_ = self->priv->args;
				_tmp5__length1 = self->priv->args_length1;
				_tmp6_ = _tmp5_[_data6_->index];
				ft_find_variables (_tmp6_, ______lambda62__gfunc, _data7_);
				_tmp7_ = _data7_->_error_;
				if (_tmp7_ != NULL) {
					GError* _tmp8_;
					GError* _tmp9_;
					_tmp8_ = _data7_->_error_;
					_tmp9_ = _g_error_copy0 (_tmp8_);
					_inner_error0_ = _tmp9_;
					if (_inner_error0_->domain == FT_COMMAND_ERROR) {
						g_propagate_error (error, _inner_error0_);
						block7_data_unref (_data7_);
						_data7_ = NULL;
						block6_data_unref (_data6_);
						_data6_ = NULL;
						block5_data_unref (_data5_);
						_data5_ = NULL;
						return;
					} else {
						block7_data_unref (_data7_);
						_data7_ = NULL;
						block6_data_unref (_data6_);
						_data6_ = NULL;
						block5_data_unref (_data5_);
						_data5_ = NULL;
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return;
					}
				}
				block7_data_unref (_data7_);
				_data7_ = NULL;
			}
		}
		block6_data_unref (_data6_);
		_data6_ = NULL;
	}
	_tmp10_ = _data5_->variables;
	_tmp10__length1 = _data5_->variables_length1;
	_tmp11_ = (_tmp10_ != NULL) ? _vala_array_dup6 (_tmp10_, _tmp10__length1) : _tmp10_;
	_tmp11__length1 = _tmp10__length1;
	self->priv->variables = (_vala_FtCommandVariable_array_free (self->priv->variables, self->priv->variables_length1), NULL);
	self->priv->variables = _tmp11_;
	self->priv->variables_length1 = _tmp11__length1;
	self->priv->_variables_size_ = self->priv->variables_length1;
	block5_data_unref (_data5_);
	_data5_ = NULL;
}

static gchar**
_vala_array_dup7 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static gchar*
string_splice (const gchar* self,
               glong start,
               glong end,
               const gchar* str)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gsize str_size = 0UL;
	const gchar* _result_ = NULL;
	void* _tmp6_;
	gchar* dest = NULL;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp12_;
	const gchar* _tmp13_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	if (str == NULL) {
		str_size = (gsize) 0;
	} else {
		gint _tmp4_;
		gint _tmp5_;
		_tmp4_ = strlen ((const gchar*) str);
		_tmp5_ = _tmp4_;
		str_size = (gsize) _tmp5_;
	}
	_tmp6_ = g_malloc0 (((string_length - (end - start)) + str_size) + 1);
	_result_ = _tmp6_;
	_tmp7_ = _result_;
	dest = (gchar*) _tmp7_;
	_tmp8_ = dest;
	memcpy (_tmp8_, self, (gsize) start);
	_tmp9_ = dest;
	dest = _tmp9_ + start;
	if (str != NULL) {
		gchar* _tmp10_;
		gchar* _tmp11_;
		_tmp10_ = dest;
		memcpy (_tmp10_, str, str_size);
		_tmp11_ = dest;
		dest = _tmp11_ + str_size;
	}
	_tmp12_ = dest;
	memcpy (_tmp12_, ((gchar*) self) + end, (gsize) (string_length - end));
	_tmp13_ = _result_;
	_result_ = NULL;
	result = (gchar*) _tmp13_;
	return result;
}

static gchar**
ft_command_interpolate_args (FtCommand* self,
                             FtContext* context,
                             gint* result_length1)
{
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** args = NULL;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gint args_length1;
	gint _args_size_;
	gchar** _tmp36_;
	gint _tmp36__length1;
	GError* _inner_error0_ = NULL;
	gchar** result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (context != NULL, NULL);
	_tmp0_ = self->priv->args;
	_tmp0__length1 = self->priv->args_length1;
	_vala_return_val_if_fail (_tmp0_ != NULL, "this.args != null", NULL);
	_tmp1_ = (self->priv->args != NULL) ? _vala_array_dup7 (self->priv->args, self->priv->args_length1) : self->priv->args;
	_tmp1__length1 = self->priv->args_length1;
	args = _tmp1_;
	args_length1 = _tmp1__length1;
	_args_size_ = args_length1;
	{
		gint index = 0;
		FtCommandVariable* _tmp2_;
		gint _tmp2__length1;
		_tmp2_ = self->priv->variables;
		_tmp2__length1 = self->priv->variables_length1;
		index = _tmp2__length1 - 1;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				FtCommandVariable variable = {0};
				FtCommandVariable* _tmp5_;
				gint _tmp5__length1;
				FtCommandVariable _tmp6_;
				FtCommandVariable _tmp7_;
				FtCommandVariable _tmp8_ = {0};
				FtValue* variable_value = NULL;
				FtCommandVariable _tmp9_;
				const gchar* _tmp10_;
				FtValue* _tmp11_;
				gchar* variable_string = NULL;
				gchar* _tmp12_;
				FtValue* _tmp13_;
				gchar** _tmp27_;
				gint _tmp27__length1;
				FtCommandVariable _tmp28_;
				gchar** _tmp29_;
				gint _tmp29__length1;
				FtCommandVariable _tmp30_;
				const gchar* _tmp31_;
				FtCommandVariable _tmp32_;
				FtCommandVariable _tmp33_;
				const gchar* _tmp34_;
				gchar* _tmp35_;
				if (!_tmp3_) {
					gint _tmp4_;
					_tmp4_ = index;
					index = _tmp4_ - 1;
				}
				_tmp3_ = FALSE;
				if (!(index >= 0)) {
					break;
				}
				_tmp5_ = self->priv->variables;
				_tmp5__length1 = self->priv->variables_length1;
				_tmp6_ = _tmp5_[index];
				_tmp7_ = _tmp6_;
				ft_command_variable_copy (&_tmp7_, &_tmp8_);
				variable = _tmp8_;
				_tmp9_ = variable;
				_tmp10_ = _tmp9_.name;
				_tmp11_ = ft_context_evaluate_variable (context, _tmp10_);
				variable_value = _tmp11_;
				_tmp12_ = g_strdup ("");
				variable_string = _tmp12_;
				_tmp13_ = variable_value;
				if (_tmp13_ != NULL) {
					{
						GVariant* variable_variant = NULL;
						FtValue* _tmp14_;
						FtCommandVariable _tmp15_;
						const gchar* _tmp16_;
						GVariant* _tmp17_;
						gchar* _tmp18_ = NULL;
						GVariant* _tmp19_;
						const GVariantType* _tmp20_;
						gchar* _tmp26_;
						_tmp14_ = variable_value;
						_tmp15_ = variable;
						_tmp16_ = _tmp15_.format;
						_tmp17_ = ft_value_format (_tmp14_, _tmp16_, &_inner_error0_);
						variable_variant = _tmp17_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
								goto __catch0_ft_expression_error;
							}
							_g_free0 (variable_string);
							_ft_value_unref0 (variable_value);
							ft_command_variable_destroy (&variable);
							args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
							g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
							g_clear_error (&_inner_error0_);
							return NULL;
						}
						_tmp19_ = variable_variant;
						_tmp20_ = G_VARIANT_TYPE_STRING;
						if (g_variant_is_of_type (_tmp19_, _tmp20_)) {
							GVariant* _tmp21_;
							const gchar* _tmp22_;
							gchar* _tmp23_;
							_tmp21_ = variable_variant;
							_tmp22_ = g_variant_get_string (_tmp21_, NULL);
							_tmp23_ = g_strdup (_tmp22_);
							_g_free0 (_tmp18_);
							_tmp18_ = _tmp23_;
						} else {
							GVariant* _tmp24_;
							gchar* _tmp25_;
							_tmp24_ = variable_variant;
							_tmp25_ = g_variant_print (_tmp24_, FALSE);
							_g_free0 (_tmp18_);
							_tmp18_ = _tmp25_;
						}
						_tmp26_ = _tmp18_;
						_tmp18_ = NULL;
						_g_free0 (variable_string);
						variable_string = _tmp26_;
						_g_free0 (_tmp18_);
						_g_variant_unref0 (variable_variant);
					}
					goto __finally0;
					__catch0_ft_expression_error:
					{
						g_clear_error (&_inner_error0_);
					}
					__finally0:
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_free0 (variable_string);
						_ft_value_unref0 (variable_value);
						ft_command_variable_destroy (&variable);
						args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return NULL;
					}
				}
				_tmp27_ = args;
				_tmp27__length1 = args_length1;
				_tmp28_ = variable;
				_tmp29_ = args;
				_tmp29__length1 = args_length1;
				_tmp30_ = variable;
				_tmp31_ = _tmp29_[_tmp30_.arg_index];
				_tmp32_ = variable;
				_tmp33_ = variable;
				_tmp34_ = variable_string;
				_tmp35_ = string_splice (_tmp31_, (glong) _tmp32_.span_start, (glong) _tmp33_.span_end, _tmp34_);
				_g_free0 (_tmp27_[_tmp28_.arg_index]);
				_tmp27_[_tmp28_.arg_index] = _tmp35_;
				_g_free0 (variable_string);
				_ft_value_unref0 (variable_value);
				ft_command_variable_destroy (&variable);
			}
		}
	}
	_tmp36_ = args;
	_tmp36__length1 = args_length1;
	if (result_length1) {
		*result_length1 = _tmp36__length1;
	}
	result = _tmp36_;
	return result;
}

static void
ft_command_prepare_internal (FtCommand* self,
                             GError** error)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	if (!self->priv->prepared) {
		ft_command_prepare_args (self, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == FT_COMMAND_ERROR) {
				g_propagate_error (error, _inner_error0_);
				return;
			} else {
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
		}
		ft_command_prepare_variables (self, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == FT_COMMAND_ERROR) {
				g_propagate_error (error, _inner_error0_);
				return;
			} else {
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
		}
		self->priv->prepared = TRUE;
	} else {
		gchar** _tmp0_;
		gint _tmp0__length1;
		_tmp0_ = self->priv->args;
		_tmp0__length1 = self->priv->args_length1;
		_vala_assert (_tmp0_ != NULL, "this.args != null");
	}
}

void
ft_command_validate (FtCommand* self,
                     GError** error)
{
	gboolean _tmp0_ = FALSE;
	gchar** _tmp1_;
	gint _tmp1__length1;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	ft_command_prepare_internal (self, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_COMMAND_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_tmp1_ = self->priv->args;
	_tmp1__length1 = self->priv->args_length1;
	if (_tmp1__length1 != 0) {
		_tmp0_ = !self->priv->_use_subshell;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gchar* program_path = NULL;
		gchar** _tmp2_;
		gint _tmp2__length1;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp2_ = self->priv->args;
		_tmp2__length1 = self->priv->args_length1;
		_tmp3_ = _tmp2_[0];
		_tmp4_ = ft_find_program_in_host_path (_tmp3_);
		program_path = _tmp4_;
		_tmp5_ = program_path;
		if (_tmp5_ == NULL) {
			gchar** _tmp6_;
			gint _tmp6__length1;
			const gchar* _tmp7_;
			GError* _tmp8_;
			_tmp6_ = self->priv->args;
			_tmp6__length1 = self->priv->args_length1;
			_tmp7_ = _tmp6_[0];
			_tmp8_ = g_error_new (FT_COMMAND_ERROR, FT_COMMAND_ERROR_NOT_FOUND, _ ("Program \"%s\" not found"), _tmp7_);
			_inner_error0_ = _tmp8_;
			if (_inner_error0_->domain == FT_COMMAND_ERROR) {
				g_propagate_error (error, _inner_error0_);
				_g_free0 (program_path);
				return;
			} else {
				_g_free0 (program_path);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
		}
		_g_free0 (program_path);
	}
}

FtCommandExecution*
ft_command_prepare (FtCommand* self,
                    FtContext* context)
{
	FtCommandExecution* execution = NULL;
	GError* _inner_error0_ = NULL;
	FtCommandExecution* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (context != NULL, NULL);
	execution = NULL;
	{
		gint _tmp0_ = 0;
		gchar** _tmp1_;
		gchar** _tmp2_;
		gint _tmp2__length1;
		const gchar* _tmp3_;
		FtCommandExecution* _tmp4_;
		gboolean _tmp5_;
		ft_command_prepare_internal (self, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == FT_COMMAND_ERROR) {
				goto __catch0_ft_command_error;
			}
			_g_object_unref0 (execution);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp1_ = ft_command_interpolate_args (self, context, &_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp2__length1 = _tmp0_;
		_tmp3_ = self->priv->_working_directory;
		_tmp4_ = ft_command_execution_new (_tmp2_, _tmp0_, _tmp3_);
		_g_object_unref0 (execution);
		execution = _tmp4_;
		_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
		_tmp5_ = self->priv->_pass_input;
		if (_tmp5_) {
			FtCommandExecution* _tmp6_;
			gchar* _tmp7_;
			gchar* _tmp8_;
			_tmp6_ = execution;
			_tmp7_ = ft_context_to_json (context);
			_tmp8_ = _tmp7_;
			ft_command_execution_set_input (_tmp6_, _tmp8_);
			_g_free0 (_tmp8_);
		}
	}
	goto __finally0;
	__catch0_ft_command_error:
	{
		GError* _error_ = NULL;
		GError* _tmp9_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp9_ = _error_;
		if (!g_error_matches (_tmp9_, FT_COMMAND_ERROR, FT_COMMAND_ERROR_EMPTY_LINE)) {
			gchar** _tmp10_;
			gint _tmp10__length1;
			const gchar* _tmp11_;
			FtCommandExecution* _tmp12_;
			FtCommandExecution* _tmp13_;
			GError* _tmp14_;
			FtCommandExecution* _tmp15_;
			_tmp10_ = self->priv->args;
			_tmp10__length1 = self->priv->args_length1;
			_tmp11_ = self->priv->_working_directory;
			_tmp12_ = ft_command_execution_new (_tmp10_, _tmp10__length1, _tmp11_);
			_g_object_unref0 (execution);
			execution = _tmp12_;
			_tmp13_ = execution;
			_tmp14_ = _error_;
			ft_job_set_error ((FtJob*) _tmp13_, _tmp14_);
			_tmp15_ = execution;
			ft_job_set_completed ((FtJob*) _tmp15_, TRUE);
		}
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (execution);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	result = execution;
	return result;
}

static Block8Data*
block8_data_ref (Block8Data* _data8_)
{
	g_atomic_int_inc (&_data8_->_ref_count_);
	return _data8_;
}

static void
block8_data_unref (void * _userdata_)
{
	Block8Data* _data8_;
	_data8_ = (Block8Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
		FtCommand* self;
		self = _data8_->self;
		_g_object_unref0 (_data8_->execution);
		_g_object_unref0 (self);
		g_slice_free (Block8Data, _data8_);
	}
}

static void
___lambda68_ (Block8Data* _data8_,
              GObject* obj,
              GAsyncResult* res)
{
	FtCommand* self;
	GError* _inner_error0_ = NULL;
	self = _data8_->self;
	g_return_if_fail (res != NULL);
	{
		FtCommandExecution* _tmp0_;
		_tmp0_ = _data8_->execution;
		ft_job_run_finish ((FtJob*) _tmp0_, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		FtCommandExecution* _tmp1_;
		GError* _tmp2_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = _data8_->execution;
		_tmp2_ = _error_;
		ft_job_set_error ((FtJob*) _tmp1_, _tmp2_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
____lambda68__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	___lambda68_ (self, source_object, res);
	block8_data_unref (self);
}

FtCommandExecution*
ft_command_execute (FtCommand* self,
                    FtContext* context)
{
	Block8Data* _data8_;
	FtCommandExecution* _tmp0_;
	gboolean _tmp1_ = FALSE;
	FtCommandExecution* _tmp2_;
	FtCommandExecution* _tmp7_;
	FtCommandExecution* _tmp8_;
	FtCommandExecution* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (context != NULL, NULL);
	_data8_ = g_slice_new0 (Block8Data);
	_data8_->_ref_count_ = 1;
	_data8_->self = g_object_ref (self);
	_tmp0_ = ft_command_prepare (self, context);
	_data8_->execution = _tmp0_;
	_tmp2_ = _data8_->execution;
	if (_tmp2_ != NULL) {
		FtCommandExecution* _tmp3_;
		gboolean _tmp4_;
		gboolean _tmp5_;
		_tmp3_ = _data8_->execution;
		_tmp4_ = ft_job_get_completed ((FtJob*) _tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = !_tmp5_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		FtCommandExecution* _tmp6_;
		_tmp6_ = _data8_->execution;
		ft_job_run ((FtJob*) _tmp6_, ____lambda68__gasync_ready_callback, block8_data_ref (_data8_));
	}
	_tmp7_ = _data8_->execution;
	_tmp8_ = _g_object_ref0 (_tmp7_);
	result = _tmp8_;
	block8_data_unref (_data8_);
	_data8_ = NULL;
	return result;
}

static void
ft_command_execute_async_data_free (gpointer _data)
{
	FtCommandExecuteAsyncData* _data_;
	_data_ = _data;
	_ft_context_unref0 (_data_->context);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (FtCommandExecuteAsyncData, _data_);
}

static gpointer
_ft_context_ref0 (gpointer self)
{
	return self ? ft_context_ref (self) : NULL;
}

void
ft_command_execute_async (FtCommand* self,
                          FtContext* context,
                          GAsyncReadyCallback _callback_,
                          gpointer _user_data_)
{
	FtCommandExecuteAsyncData* _data_;
	FtCommand* _tmp0_;
	FtContext* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (context != NULL);
	_data_ = g_slice_new0 (FtCommandExecuteAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, ft_command_execute_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _ft_context_ref0 (context);
	_ft_context_unref0 (_data_->context);
	_data_->context = _tmp1_;
	ft_command_execute_async_co (_data_);
}

FtCommandExecution*
ft_command_execute_finish (FtCommand* self,
                           GAsyncResult* _res_)
{
	FtCommandExecution* result;
	FtCommandExecuteAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
ft_command_execute_async_ready (GObject* source_object,
                                GAsyncResult* _res_,
                                gpointer _user_data_)
{
	FtCommandExecuteAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	ft_command_execute_async_co (_data_);
}

static gboolean
ft_command_execute_async_co (FtCommandExecuteAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = ft_command_prepare (_data_->self, _data_->context);
	_data_->execution = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->execution;
	if (_data_->_tmp2_ != NULL) {
		_data_->_tmp3_ = _data_->execution;
		_data_->_tmp4_ = ft_job_get_error ((FtJob*) _data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp1_ = _data_->_tmp5_ == NULL;
	} else {
		_data_->_tmp1_ = FALSE;
	}
	if (_data_->_tmp1_) {
		{
			_data_->_tmp6_ = _data_->execution;
			_data_->_state_ = 1;
			ft_job_run ((FtJob*) _data_->_tmp6_, ft_command_execute_async_ready, _data_);
			return FALSE;
			_state_1:
			ft_job_run_finish ((FtJob*) _data_->_tmp6_, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->_error_ = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp7_ = _data_->execution;
			_data_->_tmp8_ = _data_->_error_;
			ft_job_set_error ((FtJob*) _data_->_tmp7_, _data_->_tmp8_);
			_g_error_free0 (_data_->_error_);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->execution);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->result = _data_->execution;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

const gchar*
ft_command_get_line (FtCommand* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_line;
	result = _tmp0_;
	return result;
}

void
ft_command_set_line (FtCommand* self,
                     const gchar* value)
{
	const gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_line;
	if (g_strcmp0 (_tmp0_, value) != 0) {
		gchar* _tmp1_;
		_tmp1_ = g_strdup (value);
		_g_free0 (self->priv->_line);
		self->priv->_line = _tmp1_;
		self->priv->prepared = FALSE;
	}
	g_object_notify_by_pspec ((GObject *) self, ft_command_properties[FT_COMMAND_LINE_PROPERTY]);
}

gboolean
ft_command_get_use_subshell (FtCommand* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_use_subshell;
	return result;
}

void
ft_command_set_use_subshell (FtCommand* self,
                             gboolean value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_use_subshell != value) {
		self->priv->_use_subshell = value;
		self->priv->prepared = FALSE;
	}
	g_object_notify_by_pspec ((GObject *) self, ft_command_properties[FT_COMMAND_USE_SUBSHELL_PROPERTY]);
}

const gchar*
ft_command_get_working_directory (FtCommand* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_working_directory;
	result = _tmp0_;
	return result;
}

void
ft_command_set_working_directory (FtCommand* self,
                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_command_get_working_directory (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_working_directory);
		self->priv->_working_directory = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, ft_command_properties[FT_COMMAND_WORKING_DIRECTORY_PROPERTY]);
	}
}

gboolean
ft_command_get_pass_input (FtCommand* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_pass_input;
	return result;
}

void
ft_command_set_pass_input (FtCommand* self,
                           gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_command_get_pass_input (self);
	if (old_value != value) {
		self->priv->_pass_input = value;
		g_object_notify_by_pspec ((GObject *) self, ft_command_properties[FT_COMMAND_PASS_INPUT_PROPERTY]);
	}
}

static void
ft_command_class_init (FtCommandClass * klass,
                       gpointer klass_data)
{
	ft_command_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtCommand_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_command_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_ft_command_set_property;
	G_OBJECT_CLASS (klass)->finalize = ft_command_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_COMMAND_LINE_PROPERTY, ft_command_properties[FT_COMMAND_LINE_PROPERTY] = g_param_spec_string ("line", "line", "line", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_COMMAND_USE_SUBSHELL_PROPERTY, ft_command_properties[FT_COMMAND_USE_SUBSHELL_PROPERTY] = g_param_spec_boolean ("use-subshell", "use-subshell", "use-subshell", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_COMMAND_WORKING_DIRECTORY_PROPERTY, ft_command_properties[FT_COMMAND_WORKING_DIRECTORY_PROPERTY] = g_param_spec_string ("working-directory", "working-directory", "working-directory", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_COMMAND_PASS_INPUT_PROPERTY, ft_command_properties[FT_COMMAND_PASS_INPUT_PROPERTY] = g_param_spec_boolean ("pass-input", "pass-input", "pass-input", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
ft_command_instance_init (FtCommand * self,
                          gpointer klass)
{
	self->priv = ft_command_get_instance_private (self);
	self->priv->_pass_input = FALSE;
	self->priv->_use_subshell = FALSE;
	self->priv->prepared = FALSE;
}

static void
ft_command_finalize (GObject * obj)
{
	FtCommand * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_COMMAND, FtCommand);
	_g_free0 (self->priv->_working_directory);
	_g_free0 (self->priv->_line);
	self->priv->args = (_vala_array_free (self->priv->args, self->priv->args_length1, (GDestroyNotify) g_free), NULL);
	self->priv->variables = (_vala_FtCommandVariable_array_free (self->priv->variables, self->priv->variables_length1), NULL);
	G_OBJECT_CLASS (ft_command_parent_class)->finalize (obj);
}

static GType
ft_command_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtCommandClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_command_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtCommand), 0, (GInstanceInitFunc) ft_command_instance_init, NULL };
	GType ft_command_type_id;
	ft_command_type_id = g_type_register_static (G_TYPE_OBJECT, "FtCommand", &g_define_type_info, 0);
	FtCommand_private_offset = g_type_add_instance_private (ft_command_type_id, sizeof (FtCommandPrivate));
	return ft_command_type_id;
}

GType
ft_command_get_type (void)
{
	static volatile gsize ft_command_type_id__once = 0;
	if (g_once_init_enter (&ft_command_type_id__once)) {
		GType ft_command_type_id;
		ft_command_type_id = ft_command_get_type_once ();
		g_once_init_leave (&ft_command_type_id__once, ft_command_type_id);
	}
	return ft_command_type_id__once;
}

static void
_vala_ft_command_get_property (GObject * object,
                               guint property_id,
                               GValue * value,
                               GParamSpec * pspec)
{
	FtCommand * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_COMMAND, FtCommand);
	switch (property_id) {
		case FT_COMMAND_LINE_PROPERTY:
		g_value_set_string (value, ft_command_get_line (self));
		break;
		case FT_COMMAND_USE_SUBSHELL_PROPERTY:
		g_value_set_boolean (value, ft_command_get_use_subshell (self));
		break;
		case FT_COMMAND_WORKING_DIRECTORY_PROPERTY:
		g_value_set_string (value, ft_command_get_working_directory (self));
		break;
		case FT_COMMAND_PASS_INPUT_PROPERTY:
		g_value_set_boolean (value, ft_command_get_pass_input (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_ft_command_set_property (GObject * object,
                               guint property_id,
                               const GValue * value,
                               GParamSpec * pspec)
{
	FtCommand * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_COMMAND, FtCommand);
	switch (property_id) {
		case FT_COMMAND_LINE_PROPERTY:
		ft_command_set_line (self, g_value_get_string (value));
		break;
		case FT_COMMAND_USE_SUBSHELL_PROPERTY:
		ft_command_set_use_subshell (self, g_value_get_boolean (value));
		break;
		case FT_COMMAND_WORKING_DIRECTORY_PROPERTY:
		ft_command_set_working_directory (self, g_value_get_string (value));
		break;
		case FT_COMMAND_PASS_INPUT_PROPERTY:
		ft_command_set_pass_input (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

