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

/*
    OptionParser.vala
    Copyright (C) 2010 Maia Kozheva <sikon@ubuntu.com>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

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

#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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define STEADYFLOW_CORE_TYPE_OPTION_PARSER (steadyflow_core_option_parser_get_type ())
#define STEADYFLOW_CORE_OPTION_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STEADYFLOW_CORE_TYPE_OPTION_PARSER, SteadyflowCoreOptionParser))
#define STEADYFLOW_CORE_OPTION_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STEADYFLOW_CORE_TYPE_OPTION_PARSER, SteadyflowCoreOptionParserClass))
#define STEADYFLOW_CORE_IS_OPTION_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STEADYFLOW_CORE_TYPE_OPTION_PARSER))
#define STEADYFLOW_CORE_IS_OPTION_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STEADYFLOW_CORE_TYPE_OPTION_PARSER))
#define STEADYFLOW_CORE_OPTION_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STEADYFLOW_CORE_TYPE_OPTION_PARSER, SteadyflowCoreOptionParserClass))

typedef struct _SteadyflowCoreOptionParser SteadyflowCoreOptionParser;
typedef struct _SteadyflowCoreOptionParserClass SteadyflowCoreOptionParserClass;
typedef struct _SteadyflowCoreOptionParserPrivate SteadyflowCoreOptionParserPrivate;
enum  {
	STEADYFLOW_CORE_OPTION_PARSER_0_PROPERTY,
	STEADYFLOW_CORE_OPTION_PARSER_NUM_PROPERTIES
};
static GParamSpec* steadyflow_core_option_parser_properties[STEADYFLOW_CORE_OPTION_PARSER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef void (*SteadyflowCoreOptionParserOptionCommand) (gchar** args, gint args_length1, GeeMap* kwargs, gpointer user_data);
typedef struct _Block1Data Block1Data;
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	STEADYFLOW_CORE_OPTION_PARSER_COMMAND_SIGNAL,
	STEADYFLOW_CORE_OPTION_PARSER_UNHANDLED_COMMAND_SIGNAL,
	STEADYFLOW_CORE_OPTION_PARSER_NUM_SIGNALS
};
static guint steadyflow_core_option_parser_signals[STEADYFLOW_CORE_OPTION_PARSER_NUM_SIGNALS] = {0};

struct _SteadyflowCoreOptionParser {
	GObject parent_instance;
	SteadyflowCoreOptionParserPrivate * priv;
};

struct _SteadyflowCoreOptionParserClass {
	GObjectClass parent_class;
};

struct _SteadyflowCoreOptionParserPrivate {
	gchar** args;
	gint args_length1;
	gint _args_size_;
	GeeSet* commands;
};

struct _Block1Data {
	int _ref_count_;
	SteadyflowCoreOptionParser* self;
	SteadyflowCoreOptionParserOptionCommand handler;
	gpointer handler_target;
};

static gint SteadyflowCoreOptionParser_private_offset;
static gpointer steadyflow_core_option_parser_parent_class = NULL;

VALA_EXTERN GType steadyflow_core_option_parser_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SteadyflowCoreOptionParser, g_object_unref)
VALA_EXTERN SteadyflowCoreOptionParser* steadyflow_core_option_parser_new (gchar** args,
                                                               gint args_length1,
                                                               gboolean remove_arg0);
VALA_EXTERN SteadyflowCoreOptionParser* steadyflow_core_option_parser_construct (GType object_type,
                                                                     gchar** args,
                                                                     gint args_length1,
                                                                     gboolean remove_arg0);
static gchar** _vala_array_dup1 (gchar** self,
                          gssize length);
VALA_EXTERN void steadyflow_core_option_parser_register_command (SteadyflowCoreOptionParser* self,
                                                     const gchar* cmd,
                                                     SteadyflowCoreOptionParserOptionCommand handler,
                                                     gpointer handler_target);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void __lambda7_ (Block1Data* _data1_,
                 gchar** args,
                 gint args_length1,
                 GeeMap* kwargs);
static void ___lambda7__steadyflow_core_option_parser_command (SteadyflowCoreOptionParser* _sender,
                                                        gchar** args,
                                                        gint args_length1,
                                                        GeeMap* kwargs,
                                                        gpointer self);
VALA_EXTERN void steadyflow_core_option_parser_run (SteadyflowCoreOptionParser* self);
static gchar** _vala_array_dup2 (gchar** self,
                          gssize length);
static gchar** _vala_array_dup3 (gchar** self,
                          gssize length);
static void g_cclosure_user_marshal_VOID__BOXED_INT_OBJECT (GClosure * closure,
                                                     GValue * return_value,
                                                     guint n_param_values,
                                                     const GValue * param_values,
                                                     gpointer invocation_hint,
                                                     gpointer marshal_data);
static void steadyflow_core_option_parser_finalize (GObject * obj);
static GType steadyflow_core_option_parser_get_type_once (void);
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);

static inline gpointer
steadyflow_core_option_parser_get_instance_private (SteadyflowCoreOptionParser* self)
{
	return G_STRUCT_MEMBER_P (self, SteadyflowCoreOptionParser_private_offset);
}

static gchar**
_vala_array_dup1 (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;
}

SteadyflowCoreOptionParser*
steadyflow_core_option_parser_construct (GType object_type,
                                         gchar** args,
                                         gint args_length1,
                                         gboolean remove_arg0)
{
	SteadyflowCoreOptionParser * self = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gint __tmp0__size_ = 0;
	gchar** _tmp1_;
	gint _tmp1__length1;
	GeeHashSet* _tmp2_;
	self = (SteadyflowCoreOptionParser*) g_object_new (object_type, NULL);
	if (remove_arg0) {
		_tmp0_ = args + 1;
		_tmp0__length1 = args_length1 - 1;
		__tmp0__size_ = _tmp0__length1;
	} else {
		_tmp0_ = args;
		_tmp0__length1 = args_length1;
		__tmp0__size_ = _tmp0__length1;
	}
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup1 (_tmp0_, _tmp0__length1) : _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	self->priv->args = (_vala_array_free (self->priv->args, self->priv->args_length1, (GDestroyNotify) g_free), NULL);
	self->priv->args = _tmp1_;
	self->priv->args_length1 = _tmp1__length1;
	self->priv->_args_size_ = self->priv->args_length1;
	_tmp2_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->commands);
	self->priv->commands = (GeeSet*) _tmp2_;
	return self;
}

SteadyflowCoreOptionParser*
steadyflow_core_option_parser_new (gchar** args,
                                   gint args_length1,
                                   gboolean remove_arg0)
{
	return steadyflow_core_option_parser_construct (STEADYFLOW_CORE_TYPE_OPTION_PARSER, args, args_length1, remove_arg0);
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		SteadyflowCoreOptionParser* self;
		self = _data1_->self;
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static void
__lambda7_ (Block1Data* _data1_,
            gchar** args,
            gint args_length1,
            GeeMap* kwargs)
{
	SteadyflowCoreOptionParser* self;
	self = _data1_->self;
	g_return_if_fail (kwargs != NULL);
	_data1_->handler (args, (gint) args_length1, kwargs, _data1_->handler_target);
}

static void
___lambda7__steadyflow_core_option_parser_command (SteadyflowCoreOptionParser* _sender,
                                                   gchar** args,
                                                   gint args_length1,
                                                   GeeMap* kwargs,
                                                   gpointer self)
{
	__lambda7_ (self, args, args_length1, kwargs);
}

void
steadyflow_core_option_parser_register_command (SteadyflowCoreOptionParser* self,
                                                const gchar* cmd,
                                                SteadyflowCoreOptionParserOptionCommand handler,
                                                gpointer handler_target)
{
	Block1Data* _data1_;
	GeeSet* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (cmd != NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_data1_->handler = handler;
	_data1_->handler_target = handler_target;
	_tmp0_ = self->priv->commands;
	gee_collection_add ((GeeCollection*) _tmp0_, cmd);
	_tmp1_ = g_strconcat ("command::", cmd, NULL);
	g_signal_connect_data (self, _tmp1_, (GCallback) ___lambda7__steadyflow_core_option_parser_command, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_g_free0 (_tmp1_);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}

static gchar**
_vala_array_dup2 (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_get (const gchar* self,
            glong index)
{
	gchar _tmp0_;
	gchar result;
	g_return_val_if_fail (self != NULL, '\0');
	_tmp0_ = ((gchar*) self)[index];
	result = _tmp0_;
	return result;
}

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

void
steadyflow_core_option_parser_run (SteadyflowCoreOptionParser* self)
{
	GeeList* arglist = NULL;
	GeeArrayList* _tmp0_;
	GeeMap* kwargs = NULL;
	GeeHashMap* _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gchar* cmd = NULL;
	gchar* _tmp5_;
	gchar** arguments = NULL;
	gchar** _tmp6_;
	gint _tmp6__length1;
	gchar** _tmp7_;
	gint _tmp7__length1;
	gint arguments_length1;
	gint _arguments_size_;
	gchar** _tmp8_;
	gint _tmp8__length1;
	const gchar* _tmp9_;
	gchar** _tmp16_;
	gint _tmp16__length1;
	gboolean _tmp31_ = FALSE;
	const gchar* _tmp32_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	arglist = (GeeList*) _tmp0_;
	_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	kwargs = (GeeMap*) _tmp1_;
	_tmp2_ = self->priv->args;
	_tmp2__length1 = self->priv->args_length1;
	if (_tmp2__length1 == 0) {
		gchar** _tmp3_;
		gint _tmp3__length1;
		GeeMap* _tmp4_;
		_tmp3_ = self->priv->args;
		_tmp3__length1 = self->priv->args_length1;
		_tmp4_ = kwargs;
		g_signal_emit (self, steadyflow_core_option_parser_signals[STEADYFLOW_CORE_OPTION_PARSER_COMMAND_SIGNAL], g_quark_from_static_string ("@default"), _tmp3_, (gint) _tmp3__length1, _tmp4_);
		_g_object_unref0 (kwargs);
		_g_object_unref0 (arglist);
		return;
	}
	_tmp5_ = g_strdup ("@default");
	cmd = _tmp5_;
	_tmp6_ = self->priv->args;
	_tmp6__length1 = self->priv->args_length1;
	_tmp7_ = (_tmp6_ != NULL) ? _vala_array_dup2 (_tmp6_, _tmp6__length1) : _tmp6_;
	_tmp7__length1 = _tmp6__length1;
	arguments = _tmp7_;
	arguments_length1 = _tmp7__length1;
	_arguments_size_ = arguments_length1;
	_tmp8_ = self->priv->args;
	_tmp8__length1 = self->priv->args_length1;
	_tmp9_ = _tmp8_[0];
	if (string_get (_tmp9_, (glong) 0) != '-') {
		gchar** _tmp10_;
		gint _tmp10__length1;
		const gchar* _tmp11_;
		gchar* _tmp12_;
		gchar** _tmp13_;
		gint _tmp13__length1;
		gchar** _tmp14_;
		gint _tmp14__length1;
		gchar** _tmp15_;
		gint _tmp15__length1;
		_tmp10_ = arguments;
		_tmp10__length1 = arguments_length1;
		_tmp11_ = _tmp10_[0];
		_tmp12_ = g_strdup (_tmp11_);
		_g_free0 (cmd);
		cmd = _tmp12_;
		_tmp13_ = arguments;
		_tmp13__length1 = arguments_length1;
		_tmp14_ = arguments;
		_tmp14__length1 = arguments_length1;
		_tmp15_ = (_tmp13_ != NULL) ? _vala_array_dup3 (_tmp13_ + 1, _tmp14__length1 - 1) : _tmp13_;
		_tmp15__length1 = _tmp14__length1 - 1;
		arguments = (_vala_array_free (arguments, arguments_length1, (GDestroyNotify) g_free), NULL);
		arguments = _tmp15_;
		arguments_length1 = _tmp15__length1;
		_arguments_size_ = arguments_length1;
	}
	_tmp16_ = arguments;
	_tmp16__length1 = arguments_length1;
	{
		gchar** arg_collection = NULL;
		gint arg_collection_length1 = 0;
		gint _arg_collection_size_ = 0;
		gint arg_it = 0;
		arg_collection = _tmp16_;
		arg_collection_length1 = _tmp16__length1;
		for (arg_it = 0; arg_it < arg_collection_length1; arg_it = arg_it + 1) {
			gchar* _tmp17_;
			gchar* arg = NULL;
			_tmp17_ = g_strdup (arg_collection[arg_it]);
			arg = _tmp17_;
			{
				const gchar* _tmp18_;
				_tmp18_ = arg;
				if (string_get (_tmp18_, (glong) 0) != '-') {
					GeeList* _tmp19_;
					const gchar* _tmp20_;
					_tmp19_ = arglist;
					_tmp20_ = arg;
					gee_collection_add ((GeeCollection*) _tmp19_, _tmp20_);
				} else {
					gchar** keyvalue = NULL;
					const gchar* _tmp21_;
					gchar** _tmp22_;
					gchar** _tmp23_;
					gint keyvalue_length1;
					gint _keyvalue_size_;
					const gchar* _tmp24_ = NULL;
					gchar** _tmp25_;
					gint _tmp25__length1;
					GeeMap* _tmp28_;
					gchar** _tmp29_;
					gint _tmp29__length1;
					const gchar* _tmp30_;
					_tmp21_ = arg;
					_tmp23_ = _tmp22_ = g_strsplit (_tmp21_, "=", 2);
					keyvalue = _tmp23_;
					keyvalue_length1 = _vala_array_length (_tmp22_);
					_keyvalue_size_ = keyvalue_length1;
					_tmp25_ = keyvalue;
					_tmp25__length1 = keyvalue_length1;
					if (_tmp25__length1 > 1) {
						gchar** _tmp26_;
						gint _tmp26__length1;
						const gchar* _tmp27_;
						_tmp26_ = keyvalue;
						_tmp26__length1 = keyvalue_length1;
						_tmp27_ = _tmp26_[1];
						_tmp24_ = _tmp27_;
					} else {
						_tmp24_ = NULL;
					}
					_tmp28_ = kwargs;
					_tmp29_ = keyvalue;
					_tmp29__length1 = keyvalue_length1;
					_tmp30_ = _tmp29_[0];
					gee_map_set (_tmp28_, _tmp30_, _tmp24_);
					keyvalue = (_vala_array_free (keyvalue, keyvalue_length1, (GDestroyNotify) g_free), NULL);
				}
				_g_free0 (arg);
			}
		}
	}
	_tmp32_ = cmd;
	if (g_strcmp0 (_tmp32_, "@default") == 0) {
		_tmp31_ = TRUE;
	} else {
		GeeSet* _tmp33_;
		const gchar* _tmp34_;
		_tmp33_ = self->priv->commands;
		_tmp34_ = cmd;
		_tmp31_ = gee_collection_contains ((GeeCollection*) _tmp33_, _tmp34_);
	}
	if (_tmp31_) {
		const gchar* _tmp35_;
		GeeList* _tmp36_;
		gint _tmp37_ = 0;
		gpointer* _tmp38_;
		gchar** _tmp39_;
		gint _tmp39__length1;
		GeeMap* _tmp40_;
		_tmp35_ = cmd;
		_tmp36_ = arglist;
		_tmp38_ = gee_collection_to_array ((GeeCollection*) _tmp36_, &_tmp37_);
		_tmp39_ = _tmp38_;
		_tmp39__length1 = _tmp37_;
		_tmp40_ = kwargs;
		g_signal_emit (self, steadyflow_core_option_parser_signals[STEADYFLOW_CORE_OPTION_PARSER_COMMAND_SIGNAL], g_quark_from_string (_tmp35_), _tmp39_, (gint) _tmp37_, _tmp40_);
		_tmp39_ = (_vala_array_free (_tmp39_, _tmp39__length1, (GDestroyNotify) g_free), NULL);
	} else {
		g_signal_emit (self, steadyflow_core_option_parser_signals[STEADYFLOW_CORE_OPTION_PARSER_UNHANDLED_COMMAND_SIGNAL], 0);
	}
	arguments = (_vala_array_free (arguments, arguments_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (cmd);
	_g_object_unref0 (kwargs);
	_g_object_unref0 (arglist);
}

static void
g_cclosure_user_marshal_VOID__BOXED_INT_OBJECT (GClosure * closure,
                                                GValue * return_value,
                                                guint n_param_values,
                                                const GValue * param_values,
                                                gpointer invocation_hint,
                                                gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__BOXED_INT_OBJECT) (gpointer data1, gpointer arg_1, gint arg_2, gpointer arg_3, gpointer data2);
	register GMarshalFunc_VOID__BOXED_INT_OBJECT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 4);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__BOXED_INT_OBJECT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_boxed (param_values + 1), g_value_get_int (param_values + 2), g_value_get_object (param_values + 3), data2);
}

static void
steadyflow_core_option_parser_class_init (SteadyflowCoreOptionParserClass * klass,
                                          gpointer klass_data)
{
	steadyflow_core_option_parser_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SteadyflowCoreOptionParser_private_offset);
	G_OBJECT_CLASS (klass)->finalize = steadyflow_core_option_parser_finalize;
	steadyflow_core_option_parser_signals[STEADYFLOW_CORE_OPTION_PARSER_COMMAND_SIGNAL] = g_signal_new ("command", STEADYFLOW_CORE_TYPE_OPTION_PARSER, G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_user_marshal_VOID__BOXED_INT_OBJECT, G_TYPE_NONE, 3, G_TYPE_STRV, G_TYPE_INT, GEE_TYPE_MAP);
	steadyflow_core_option_parser_signals[STEADYFLOW_CORE_OPTION_PARSER_UNHANDLED_COMMAND_SIGNAL] = g_signal_new ("unhandled-command", STEADYFLOW_CORE_TYPE_OPTION_PARSER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
steadyflow_core_option_parser_instance_init (SteadyflowCoreOptionParser * self,
                                             gpointer klass)
{
	self->priv = steadyflow_core_option_parser_get_instance_private (self);
}

static void
steadyflow_core_option_parser_finalize (GObject * obj)
{
	SteadyflowCoreOptionParser * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, STEADYFLOW_CORE_TYPE_OPTION_PARSER, SteadyflowCoreOptionParser);
	self->priv->args = (_vala_array_free (self->priv->args, self->priv->args_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (self->priv->commands);
	G_OBJECT_CLASS (steadyflow_core_option_parser_parent_class)->finalize (obj);
}

static GType
steadyflow_core_option_parser_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SteadyflowCoreOptionParserClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) steadyflow_core_option_parser_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SteadyflowCoreOptionParser), 0, (GInstanceInitFunc) steadyflow_core_option_parser_instance_init, NULL };
	GType steadyflow_core_option_parser_type_id;
	steadyflow_core_option_parser_type_id = g_type_register_static (G_TYPE_OBJECT, "SteadyflowCoreOptionParser", &g_define_type_info, 0);
	SteadyflowCoreOptionParser_private_offset = g_type_add_instance_private (steadyflow_core_option_parser_type_id, sizeof (SteadyflowCoreOptionParserPrivate));
	return steadyflow_core_option_parser_type_id;
}

GType
steadyflow_core_option_parser_get_type (void)
{
	static volatile gsize steadyflow_core_option_parser_type_id__once = 0;
	if (g_once_init_enter (&steadyflow_core_option_parser_type_id__once)) {
		GType steadyflow_core_option_parser_type_id;
		steadyflow_core_option_parser_type_id = steadyflow_core_option_parser_get_type_once ();
		g_once_init_leave (&steadyflow_core_option_parser_type_id__once, steadyflow_core_option_parser_type_id);
	}
	return steadyflow_core_option_parser_type_id__once;
}

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

