/* command-persona-stores.c generated by valac 0.28.0.16-b1323, the Vala compiler
 * generated from command-persona-stores.vala, do not modify */

/*
 * Copyright (C) 2010 Collabora Ltd.
 *
 * This library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This library 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *       Philip Withnall <philip.withnall@collabora.co.uk>
 */

#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <folks/folks.h>
#include <stdio.h>
#include <readline/readline.h>


#define FOLKS_INSPECT_TYPE_COMMAND (folks_inspect_command_get_type ())
#define FOLKS_INSPECT_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_INSPECT_TYPE_COMMAND, FolksInspectCommand))
#define FOLKS_INSPECT_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_INSPECT_TYPE_COMMAND, FolksInspectCommandClass))
#define FOLKS_INSPECT_IS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_INSPECT_TYPE_COMMAND))
#define FOLKS_INSPECT_IS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_INSPECT_TYPE_COMMAND))
#define FOLKS_INSPECT_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_INSPECT_TYPE_COMMAND, FolksInspectCommandClass))

typedef struct _FolksInspectCommand FolksInspectCommand;
typedef struct _FolksInspectCommandClass FolksInspectCommandClass;
typedef struct _FolksInspectCommandPrivate FolksInspectCommandPrivate;

#define FOLKS_INSPECT_TYPE_CLIENT (folks_inspect_client_get_type ())
#define FOLKS_INSPECT_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_INSPECT_TYPE_CLIENT, FolksInspectClient))
#define FOLKS_INSPECT_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_INSPECT_TYPE_CLIENT, FolksInspectClientClass))
#define FOLKS_INSPECT_IS_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_INSPECT_TYPE_CLIENT))
#define FOLKS_INSPECT_IS_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_INSPECT_TYPE_CLIENT))
#define FOLKS_INSPECT_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_INSPECT_TYPE_CLIENT, FolksInspectClientClass))

typedef struct _FolksInspectClient FolksInspectClient;
typedef struct _FolksInspectClientClass FolksInspectClientClass;

#define FOLKS_INSPECT_COMMANDS_TYPE_PERSONA_STORES (folks_inspect_commands_persona_stores_get_type ())
#define FOLKS_INSPECT_COMMANDS_PERSONA_STORES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_INSPECT_COMMANDS_TYPE_PERSONA_STORES, FolksInspectCommandsPersonaStores))
#define FOLKS_INSPECT_COMMANDS_PERSONA_STORES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_INSPECT_COMMANDS_TYPE_PERSONA_STORES, FolksInspectCommandsPersonaStoresClass))
#define FOLKS_INSPECT_COMMANDS_IS_PERSONA_STORES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_INSPECT_COMMANDS_TYPE_PERSONA_STORES))
#define FOLKS_INSPECT_COMMANDS_IS_PERSONA_STORES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_INSPECT_COMMANDS_TYPE_PERSONA_STORES))
#define FOLKS_INSPECT_COMMANDS_PERSONA_STORES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_INSPECT_COMMANDS_TYPE_PERSONA_STORES, FolksInspectCommandsPersonaStoresClass))

typedef struct _FolksInspectCommandsPersonaStores FolksInspectCommandsPersonaStores;
typedef struct _FolksInspectCommandsPersonaStoresClass FolksInspectCommandsPersonaStoresClass;
typedef struct _FolksInspectCommandsPersonaStoresPrivate FolksInspectCommandsPersonaStoresPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _folks_inspect_command_unref0(var) ((var == NULL) ? NULL : (var = (folks_inspect_command_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _FolksInspectCommandsPersonaStoresRunData FolksInspectCommandsPersonaStoresRunData;

struct _FolksInspectCommand {
	GTypeInstance parent_instance;
	volatile int ref_count;
	FolksInspectCommandPrivate * priv;
	FolksInspectClient* client;
};

struct _FolksInspectCommandClass {
	GTypeClass parent_class;
	void (*finalize) (FolksInspectCommand *self);
	void (*run) (FolksInspectCommand* self, const gchar* command_string, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gint (*run_finish) (FolksInspectCommand* self, GAsyncResult* _res_);
	gchar** (*complete_subcommand) (FolksInspectCommand* self, const gchar* subcommand, int* result_length1);
	const gchar* (*get_name) (FolksInspectCommand* self);
	const gchar* (*get_description) (FolksInspectCommand* self);
	const gchar* (*get_help) (FolksInspectCommand* self);
};

struct _FolksInspectCommandsPersonaStores {
	FolksInspectCommand parent_instance;
	FolksInspectCommandsPersonaStoresPrivate * priv;
};

struct _FolksInspectCommandsPersonaStoresClass {
	FolksInspectCommandClass parent_class;
};

struct _FolksInspectCommandsPersonaStoresRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FolksInspectCommandsPersonaStores* self;
	gchar* command_string;
	gint result;
	const gchar* _tmp0_;
	GeeCollection* backends;
	FolksInspectClient* _tmp1_;
	FolksBackendStore* _tmp2_;
	FolksBackendStore* _tmp3_;
	GeeCollection* _tmp4_;
	GeeIterator* _backend_it;
	GeeCollection* _tmp5_;
	GeeIterator* _tmp6_;
	GeeIterator* _tmp7_;
	gboolean _tmp8_;
	FolksBackend* backend;
	GeeIterator* _tmp9_;
	gpointer _tmp10_;
	GeeMap* stores;
	FolksBackend* _tmp11_;
	GeeMap* _tmp12_;
	GeeMap* _tmp13_;
	GeeMap* _tmp14_;
	GeeIterator* _persona_store_it;
	GeeMap* _tmp15_;
	GeeCollection* _tmp16_;
	GeeCollection* _tmp17_;
	GeeCollection* _tmp18_;
	GeeIterator* _tmp19_;
	GeeIterator* _tmp20_;
	GeeIterator* _tmp21_;
	gboolean _tmp22_;
	FolksPersonaStore* persona_store;
	GeeIterator* _tmp23_;
	gpointer _tmp24_;
	FolksPersonaStore* _tmp25_;
	GeeCollection* _vala1_backends;
	FolksInspectClient* _tmp26_;
	FolksBackendStore* _tmp27_;
	FolksBackendStore* _tmp28_;
	GeeCollection* _tmp29_;
	FolksPersonaStore* store;
	GeeIterator* _vala1__backend_it;
	GeeCollection* _tmp30_;
	GeeIterator* _tmp31_;
	GeeIterator* _tmp32_;
	gboolean _tmp33_;
	FolksBackend* _vala1_backend;
	GeeIterator* _tmp34_;
	gpointer _tmp35_;
	GeeMap* _vala1_stores;
	FolksBackend* _tmp36_;
	GeeMap* _tmp37_;
	GeeMap* _tmp38_;
	GeeMap* _tmp39_;
	GeeMap* _tmp40_;
	const gchar* _tmp41_;
	gpointer _tmp42_;
	FolksPersonaStore* _tmp43_;
	FolksPersonaStore* _tmp44_;
	const gchar* _tmp45_;
	FolksPersonaStore* _tmp46_;
};


static gpointer folks_inspect_commands_persona_stores_parent_class = NULL;

gpointer folks_inspect_command_ref (gpointer instance);
void folks_inspect_command_unref (gpointer instance);
GParamSpec* folks_inspect_param_spec_command (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void folks_inspect_value_set_command (GValue* value, gpointer v_object);
void folks_inspect_value_take_command (GValue* value, gpointer v_object);
gpointer folks_inspect_value_get_command (const GValue* value);
GType folks_inspect_command_get_type (void) G_GNUC_CONST;
GType folks_inspect_client_get_type (void) G_GNUC_CONST;
GType folks_inspect_commands_persona_stores_get_type (void) G_GNUC_CONST;
enum  {
	FOLKS_INSPECT_COMMANDS_PERSONA_STORES_DUMMY_PROPERTY
};
FolksInspectCommandsPersonaStores* folks_inspect_commands_persona_stores_new (FolksInspectClient* client);
FolksInspectCommandsPersonaStores* folks_inspect_commands_persona_stores_construct (GType object_type, FolksInspectClient* client);
FolksInspectCommand* folks_inspect_command_construct (GType object_type, FolksInspectClient* client);
static void folks_inspect_commands_persona_stores_real_run_data_free (gpointer _data);
static void folks_inspect_commands_persona_stores_real_run (FolksInspectCommand* base, const gchar* command_string, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean folks_inspect_commands_persona_stores_real_run_co (FolksInspectCommandsPersonaStoresRunData* _data_);
FolksBackendStore* folks_inspect_client_get_backend_store (FolksInspectClient* self);
void folks_inspect_utils_print_persona_store (FolksPersonaStore* store, gboolean show_personas);
void folks_inspect_utils_print_line (const gchar* format, ...);
static gchar** folks_inspect_commands_persona_stores_real_complete_subcommand (FolksInspectCommand* base, const gchar* subcommand, int* result_length1);
gchar* folks_inspect_utils_persona_store_id_completion_cb (const gchar* word, gint state);
static gchar* _folks_inspect_utils_persona_store_id_completion_cb_rl_compentry_func_t (const gchar* str, gint a);
static gchar** _vala_array_dup9 (gchar** self, int length);
static gint _vala_array_length (gpointer array);


FolksInspectCommandsPersonaStores* folks_inspect_commands_persona_stores_construct (GType object_type, FolksInspectClient* client) {
	FolksInspectCommandsPersonaStores* self = NULL;
	FolksInspectClient* _tmp0_ = NULL;
	g_return_val_if_fail (client != NULL, NULL);
	_tmp0_ = client;
	self = (FolksInspectCommandsPersonaStores*) folks_inspect_command_construct (object_type, _tmp0_);
	return self;
}


FolksInspectCommandsPersonaStores* folks_inspect_commands_persona_stores_new (FolksInspectClient* client) {
	return folks_inspect_commands_persona_stores_construct (FOLKS_INSPECT_COMMANDS_TYPE_PERSONA_STORES, client);
}


static void folks_inspect_commands_persona_stores_real_run_data_free (gpointer _data) {
	FolksInspectCommandsPersonaStoresRunData* _data_;
	_data_ = _data;
	_g_free0 (_data_->command_string);
	_folks_inspect_command_unref0 (_data_->self);
	g_slice_free (FolksInspectCommandsPersonaStoresRunData, _data_);
}


static gpointer _folks_inspect_command_ref0 (gpointer self) {
	return self ? folks_inspect_command_ref (self) : NULL;
}


static void folks_inspect_commands_persona_stores_real_run (FolksInspectCommand* base, const gchar* command_string, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FolksInspectCommandsPersonaStores * self;
	FolksInspectCommandsPersonaStoresRunData* _data_;
	FolksInspectCommandsPersonaStores* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	self = (FolksInspectCommandsPersonaStores*) base;
	_data_ = g_slice_new0 (FolksInspectCommandsPersonaStoresRunData);
	_data_->_async_result = g_simple_async_result_new (NULL, _callback_, _user_data_, folks_inspect_commands_persona_stores_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, folks_inspect_commands_persona_stores_real_run_data_free);
	_tmp0_ = _folks_inspect_command_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = command_string;
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (_data_->command_string);
	_data_->command_string = _tmp2_;
	folks_inspect_commands_persona_stores_real_run_co (_data_);
}


static gint folks_inspect_commands_persona_stores_real_run_finish (FolksInspectCommand* base, GAsyncResult* _res_) {
	gint result;
	FolksInspectCommandsPersonaStoresRunData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	return result;
}


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


static gboolean folks_inspect_commands_persona_stores_real_run_co (FolksInspectCommandsPersonaStoresRunData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = _data_->command_string;
	if (_data_->_tmp0_ == NULL) {
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = ((FolksInspectCommand*) _data_->self)->client;
		_data_->_tmp2_ = NULL;
		_data_->_tmp2_ = folks_inspect_client_get_backend_store (_data_->_tmp1_);
		_data_->_tmp3_ = NULL;
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp4_ = NULL;
		_data_->_tmp4_ = folks_backend_store_list_backends (_data_->_tmp3_);
		_data_->backends = _data_->_tmp4_;
		{
			_data_->_tmp5_ = NULL;
			_data_->_tmp5_ = _data_->backends;
			_data_->_tmp6_ = NULL;
			_data_->_tmp6_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp5_);
			_data_->_backend_it = _data_->_tmp6_;
			while (TRUE) {
				_data_->_tmp7_ = NULL;
				_data_->_tmp7_ = _data_->_backend_it;
				_data_->_tmp8_ = FALSE;
				_data_->_tmp8_ = gee_iterator_next (_data_->_tmp7_);
				if (!_data_->_tmp8_) {
					break;
				}
				_data_->_tmp9_ = NULL;
				_data_->_tmp9_ = _data_->_backend_it;
				_data_->_tmp10_ = NULL;
				_data_->_tmp10_ = gee_iterator_get (_data_->_tmp9_);
				_data_->backend = (FolksBackend*) _data_->_tmp10_;
				_data_->_tmp11_ = NULL;
				_data_->_tmp11_ = _data_->backend;
				_data_->_tmp12_ = NULL;
				_data_->_tmp12_ = folks_backend_get_persona_stores (_data_->_tmp11_);
				_data_->_tmp13_ = NULL;
				_data_->_tmp13_ = _data_->_tmp12_;
				_data_->_tmp14_ = NULL;
				_data_->_tmp14_ = _g_object_ref0 (_data_->_tmp13_);
				_data_->stores = _data_->_tmp14_;
				{
					_data_->_tmp15_ = NULL;
					_data_->_tmp15_ = _data_->stores;
					_data_->_tmp16_ = NULL;
					_data_->_tmp16_ = gee_map_get_values (_data_->_tmp15_);
					_data_->_tmp17_ = NULL;
					_data_->_tmp17_ = _data_->_tmp16_;
					_data_->_tmp18_ = NULL;
					_data_->_tmp18_ = _data_->_tmp17_;
					_data_->_tmp19_ = NULL;
					_data_->_tmp19_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp18_);
					_data_->_tmp20_ = NULL;
					_data_->_tmp20_ = _data_->_tmp19_;
					_g_object_unref0 (_data_->_tmp18_);
					_data_->_persona_store_it = _data_->_tmp20_;
					while (TRUE) {
						_data_->_tmp21_ = NULL;
						_data_->_tmp21_ = _data_->_persona_store_it;
						_data_->_tmp22_ = FALSE;
						_data_->_tmp22_ = gee_iterator_next (_data_->_tmp21_);
						if (!_data_->_tmp22_) {
							break;
						}
						_data_->_tmp23_ = NULL;
						_data_->_tmp23_ = _data_->_persona_store_it;
						_data_->_tmp24_ = NULL;
						_data_->_tmp24_ = gee_iterator_get (_data_->_tmp23_);
						_data_->persona_store = (FolksPersonaStore*) _data_->_tmp24_;
						_data_->_tmp25_ = NULL;
						_data_->_tmp25_ = _data_->persona_store;
						folks_inspect_utils_print_persona_store (_data_->_tmp25_, FALSE);
						folks_inspect_utils_print_line ("");
						_g_object_unref0 (_data_->persona_store);
					}
					_g_object_unref0 (_data_->_persona_store_it);
				}
				_g_object_unref0 (_data_->stores);
				_g_object_unref0 (_data_->backend);
			}
			_g_object_unref0 (_data_->_backend_it);
		}
		_g_object_unref0 (_data_->backends);
	} else {
		_data_->_tmp26_ = NULL;
		_data_->_tmp26_ = ((FolksInspectCommand*) _data_->self)->client;
		_data_->_tmp27_ = NULL;
		_data_->_tmp27_ = folks_inspect_client_get_backend_store (_data_->_tmp26_);
		_data_->_tmp28_ = NULL;
		_data_->_tmp28_ = _data_->_tmp27_;
		_data_->_tmp29_ = NULL;
		_data_->_tmp29_ = folks_backend_store_list_backends (_data_->_tmp28_);
		_data_->_vala1_backends = _data_->_tmp29_;
		_data_->store = NULL;
		{
			_data_->_tmp30_ = NULL;
			_data_->_tmp30_ = _data_->_vala1_backends;
			_data_->_tmp31_ = NULL;
			_data_->_tmp31_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp30_);
			_data_->_vala1__backend_it = _data_->_tmp31_;
			while (TRUE) {
				_data_->_tmp32_ = NULL;
				_data_->_tmp32_ = _data_->_vala1__backend_it;
				_data_->_tmp33_ = FALSE;
				_data_->_tmp33_ = gee_iterator_next (_data_->_tmp32_);
				if (!_data_->_tmp33_) {
					break;
				}
				_data_->_tmp34_ = NULL;
				_data_->_tmp34_ = _data_->_vala1__backend_it;
				_data_->_tmp35_ = NULL;
				_data_->_tmp35_ = gee_iterator_get (_data_->_tmp34_);
				_data_->_vala1_backend = (FolksBackend*) _data_->_tmp35_;
				_data_->_tmp36_ = NULL;
				_data_->_tmp36_ = _data_->_vala1_backend;
				_data_->_tmp37_ = NULL;
				_data_->_tmp37_ = folks_backend_get_persona_stores (_data_->_tmp36_);
				_data_->_tmp38_ = NULL;
				_data_->_tmp38_ = _data_->_tmp37_;
				_data_->_tmp39_ = NULL;
				_data_->_tmp39_ = _g_object_ref0 (_data_->_tmp38_);
				_data_->_vala1_stores = _data_->_tmp39_;
				_data_->_tmp40_ = NULL;
				_data_->_tmp40_ = _data_->_vala1_stores;
				_data_->_tmp41_ = NULL;
				_data_->_tmp41_ = _data_->command_string;
				_data_->_tmp42_ = NULL;
				_data_->_tmp42_ = gee_map_get (_data_->_tmp40_, _data_->_tmp41_);
				_g_object_unref0 (_data_->store);
				_data_->store = (FolksPersonaStore*) _data_->_tmp42_;
				_data_->_tmp43_ = NULL;
				_data_->_tmp43_ = _data_->store;
				if (_data_->_tmp43_ != NULL) {
					_g_object_unref0 (_data_->_vala1_stores);
					_g_object_unref0 (_data_->_vala1_backend);
					break;
				}
				_g_object_unref0 (_data_->_vala1_stores);
				_g_object_unref0 (_data_->_vala1_backend);
			}
			_g_object_unref0 (_data_->_vala1__backend_it);
		}
		_data_->_tmp44_ = NULL;
		_data_->_tmp44_ = _data_->store;
		if (_data_->_tmp44_ == NULL) {
			_data_->_tmp45_ = NULL;
			_data_->_tmp45_ = _data_->command_string;
			folks_inspect_utils_print_line ("Unrecognised persona store ID '%s'.", _data_->_tmp45_);
			_data_->result = 1;
			_g_object_unref0 (_data_->store);
			_g_object_unref0 (_data_->_vala1_backends);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp46_ = NULL;
		_data_->_tmp46_ = _data_->store;
		folks_inspect_utils_print_persona_store (_data_->_tmp46_, TRUE);
		_g_object_unref0 (_data_->store);
		_g_object_unref0 (_data_->_vala1_backends);
	}
	_data_->result = 0;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static gchar* _folks_inspect_utils_persona_store_id_completion_cb_rl_compentry_func_t (const gchar* str, gint a) {
	gchar* result;
	result = folks_inspect_utils_persona_store_id_completion_cb (str, a);
	return result;
}


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


static gchar** folks_inspect_commands_persona_stores_real_complete_subcommand (FolksInspectCommand* base, const gchar* subcommand, int* result_length1) {
	FolksInspectCommandsPersonaStores * self;
	gchar** result = NULL;
	const gchar* _tmp0_ = NULL;
	gchar** _tmp1_ = NULL;
	gchar** _tmp2_ = NULL;
	gchar** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	gchar** _tmp4_ = NULL;
	gint _tmp4__length1 = 0;
	self = (FolksInspectCommandsPersonaStores*) base;
	g_return_val_if_fail (subcommand != NULL, NULL);
	_tmp0_ = subcommand;
	_tmp2_ = _tmp1_ = rl_completion_matches (_tmp0_, _folks_inspect_utils_persona_store_id_completion_cb_rl_compentry_func_t);
	_tmp3_ = (_tmp2_ != NULL) ? _vala_array_dup9 (_tmp2_, _vala_array_length (_tmp1_)) : ((gpointer) _tmp2_);
	_tmp3__length1 = _vala_array_length (_tmp1_);
	_tmp4_ = _tmp3_;
	_tmp4__length1 = _tmp3__length1;
	if (result_length1) {
		*result_length1 = _tmp4__length1;
	}
	result = _tmp4_;
	return result;
}


static const gchar* folks_inspect_commands_persona_stores_real_get_name (FolksInspectCommand* base) {
	const gchar* result;
	FolksInspectCommandsPersonaStores* self;
	self = (FolksInspectCommandsPersonaStores*) base;
	result = "persona-stores";
	return result;
}


static const gchar* folks_inspect_commands_persona_stores_real_get_description (FolksInspectCommand* base) {
	const gchar* result;
	FolksInspectCommandsPersonaStores* self;
	self = (FolksInspectCommandsPersonaStores*) base;
	result = "Inspect the persona stores loaded by the aggregator";
	return result;
}


static const gchar* folks_inspect_commands_persona_stores_real_get_help (FolksInspectCommand* base) {
	const gchar* result;
	FolksInspectCommandsPersonaStores* self;
	self = (FolksInspectCommandsPersonaStores*) base;
	result = "persona-stores                       List all known " "persona stores.\n" "persona-stores [persona store ID]    Display the details of " "the specified persona store and list its personas.";
	return result;
}


static void folks_inspect_commands_persona_stores_class_init (FolksInspectCommandsPersonaStoresClass * klass) {
	folks_inspect_commands_persona_stores_parent_class = g_type_class_peek_parent (klass);
	((FolksInspectCommandClass *) klass)->run = folks_inspect_commands_persona_stores_real_run;
	((FolksInspectCommandClass *) klass)->run_finish = folks_inspect_commands_persona_stores_real_run_finish;
	((FolksInspectCommandClass *) klass)->complete_subcommand = folks_inspect_commands_persona_stores_real_complete_subcommand;
	FOLKS_INSPECT_COMMAND_CLASS (klass)->get_name = folks_inspect_commands_persona_stores_real_get_name;
	FOLKS_INSPECT_COMMAND_CLASS (klass)->get_description = folks_inspect_commands_persona_stores_real_get_description;
	FOLKS_INSPECT_COMMAND_CLASS (klass)->get_help = folks_inspect_commands_persona_stores_real_get_help;
}


static void folks_inspect_commands_persona_stores_instance_init (FolksInspectCommandsPersonaStores * self) {
}


GType folks_inspect_commands_persona_stores_get_type (void) {
	static volatile gsize folks_inspect_commands_persona_stores_type_id__volatile = 0;
	if (g_once_init_enter (&folks_inspect_commands_persona_stores_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (FolksInspectCommandsPersonaStoresClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) folks_inspect_commands_persona_stores_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FolksInspectCommandsPersonaStores), 0, (GInstanceInitFunc) folks_inspect_commands_persona_stores_instance_init, NULL };
		GType folks_inspect_commands_persona_stores_type_id;
		folks_inspect_commands_persona_stores_type_id = g_type_register_static (FOLKS_INSPECT_TYPE_COMMAND, "FolksInspectCommandsPersonaStores", &g_define_type_info, 0);
		g_once_init_leave (&folks_inspect_commands_persona_stores_type_id__volatile, folks_inspect_commands_persona_stores_type_id);
	}
	return folks_inspect_commands_persona_stores_type_id__volatile;
}


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



