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

/*
 * Copyright (C) 2010 Collabora Ltd.
 * Copyright (C) 2012 Philip Withnall
 *
 * 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 <gee.h>
#include <stdlib.h>
#include <string.h>
#include <folks/folks.h>
#include <glib/gi18n-lib.h>
#include <config.h>
#include <stdio.h>
#include <glib-unix.h>
#include <signal.h>
#include <gio/gio.h>
#include <readline/readline.h>
#include <readline/history.h>
#include <gobject/gvaluecollector.h>


#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;
typedef struct _FolksInspectClientPrivate FolksInspectClientPrivate;

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

#define FOLKS_INSPECT_TYPE_SIGNAL_MANAGER (folks_inspect_signal_manager_get_type ())
#define FOLKS_INSPECT_SIGNAL_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_INSPECT_TYPE_SIGNAL_MANAGER, FolksInspectSignalManager))
#define FOLKS_INSPECT_SIGNAL_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_INSPECT_TYPE_SIGNAL_MANAGER, FolksInspectSignalManagerClass))
#define FOLKS_INSPECT_IS_SIGNAL_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_INSPECT_TYPE_SIGNAL_MANAGER))
#define FOLKS_INSPECT_IS_SIGNAL_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_INSPECT_TYPE_SIGNAL_MANAGER))
#define FOLKS_INSPECT_SIGNAL_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_INSPECT_TYPE_SIGNAL_MANAGER, FolksInspectSignalManagerClass))

typedef struct _FolksInspectSignalManager FolksInspectSignalManager;
typedef struct _FolksInspectSignalManagerClass FolksInspectSignalManagerClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define FOLKS_INSPECT_COMMANDS_TYPE_QUIT (folks_inspect_commands_quit_get_type ())
#define FOLKS_INSPECT_COMMANDS_QUIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_INSPECT_COMMANDS_TYPE_QUIT, FolksInspectCommandsQuit))
#define FOLKS_INSPECT_COMMANDS_QUIT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_INSPECT_COMMANDS_TYPE_QUIT, FolksInspectCommandsQuitClass))
#define FOLKS_INSPECT_COMMANDS_IS_QUIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_INSPECT_COMMANDS_TYPE_QUIT))
#define FOLKS_INSPECT_COMMANDS_IS_QUIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_INSPECT_COMMANDS_TYPE_QUIT))
#define FOLKS_INSPECT_COMMANDS_QUIT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_INSPECT_COMMANDS_TYPE_QUIT, FolksInspectCommandsQuitClass))

typedef struct _FolksInspectCommandsQuit FolksInspectCommandsQuit;
typedef struct _FolksInspectCommandsQuitClass FolksInspectCommandsQuitClass;
#define _folks_inspect_command_unref0(var) ((var == NULL) ? NULL : (var = (folks_inspect_command_unref (var), NULL)))

#define FOLKS_INSPECT_COMMANDS_TYPE_HELP (folks_inspect_commands_help_get_type ())
#define FOLKS_INSPECT_COMMANDS_HELP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_INSPECT_COMMANDS_TYPE_HELP, FolksInspectCommandsHelp))
#define FOLKS_INSPECT_COMMANDS_HELP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_INSPECT_COMMANDS_TYPE_HELP, FolksInspectCommandsHelpClass))
#define FOLKS_INSPECT_COMMANDS_IS_HELP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_INSPECT_COMMANDS_TYPE_HELP))
#define FOLKS_INSPECT_COMMANDS_IS_HELP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_INSPECT_COMMANDS_TYPE_HELP))
#define FOLKS_INSPECT_COMMANDS_HELP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_INSPECT_COMMANDS_TYPE_HELP, FolksInspectCommandsHelpClass))

typedef struct _FolksInspectCommandsHelp FolksInspectCommandsHelp;
typedef struct _FolksInspectCommandsHelpClass FolksInspectCommandsHelpClass;

#define FOLKS_INSPECT_COMMANDS_TYPE_INDIVIDUALS (folks_inspect_commands_individuals_get_type ())
#define FOLKS_INSPECT_COMMANDS_INDIVIDUALS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_INSPECT_COMMANDS_TYPE_INDIVIDUALS, FolksInspectCommandsIndividuals))
#define FOLKS_INSPECT_COMMANDS_INDIVIDUALS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_INSPECT_COMMANDS_TYPE_INDIVIDUALS, FolksInspectCommandsIndividualsClass))
#define FOLKS_INSPECT_COMMANDS_IS_INDIVIDUALS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_INSPECT_COMMANDS_TYPE_INDIVIDUALS))
#define FOLKS_INSPECT_COMMANDS_IS_INDIVIDUALS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_INSPECT_COMMANDS_TYPE_INDIVIDUALS))
#define FOLKS_INSPECT_COMMANDS_INDIVIDUALS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_INSPECT_COMMANDS_TYPE_INDIVIDUALS, FolksInspectCommandsIndividualsClass))

typedef struct _FolksInspectCommandsIndividuals FolksInspectCommandsIndividuals;
typedef struct _FolksInspectCommandsIndividualsClass FolksInspectCommandsIndividualsClass;

#define FOLKS_INSPECT_COMMANDS_TYPE_LINKING (folks_inspect_commands_linking_get_type ())
#define FOLKS_INSPECT_COMMANDS_LINKING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_INSPECT_COMMANDS_TYPE_LINKING, FolksInspectCommandsLinking))
#define FOLKS_INSPECT_COMMANDS_LINKING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_INSPECT_COMMANDS_TYPE_LINKING, FolksInspectCommandsLinkingClass))
#define FOLKS_INSPECT_COMMANDS_IS_LINKING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_INSPECT_COMMANDS_TYPE_LINKING))
#define FOLKS_INSPECT_COMMANDS_IS_LINKING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_INSPECT_COMMANDS_TYPE_LINKING))
#define FOLKS_INSPECT_COMMANDS_LINKING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_INSPECT_COMMANDS_TYPE_LINKING, FolksInspectCommandsLinkingClass))

typedef struct _FolksInspectCommandsLinking FolksInspectCommandsLinking;
typedef struct _FolksInspectCommandsLinkingClass FolksInspectCommandsLinkingClass;

#define FOLKS_INSPECT_COMMANDS_TYPE_PERSONAS (folks_inspect_commands_personas_get_type ())
#define FOLKS_INSPECT_COMMANDS_PERSONAS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_INSPECT_COMMANDS_TYPE_PERSONAS, FolksInspectCommandsPersonas))
#define FOLKS_INSPECT_COMMANDS_PERSONAS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_INSPECT_COMMANDS_TYPE_PERSONAS, FolksInspectCommandsPersonasClass))
#define FOLKS_INSPECT_COMMANDS_IS_PERSONAS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_INSPECT_COMMANDS_TYPE_PERSONAS))
#define FOLKS_INSPECT_COMMANDS_IS_PERSONAS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_INSPECT_COMMANDS_TYPE_PERSONAS))
#define FOLKS_INSPECT_COMMANDS_PERSONAS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_INSPECT_COMMANDS_TYPE_PERSONAS, FolksInspectCommandsPersonasClass))

typedef struct _FolksInspectCommandsPersonas FolksInspectCommandsPersonas;
typedef struct _FolksInspectCommandsPersonasClass FolksInspectCommandsPersonasClass;

#define FOLKS_INSPECT_COMMANDS_TYPE_BACKENDS (folks_inspect_commands_backends_get_type ())
#define FOLKS_INSPECT_COMMANDS_BACKENDS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_INSPECT_COMMANDS_TYPE_BACKENDS, FolksInspectCommandsBackends))
#define FOLKS_INSPECT_COMMANDS_BACKENDS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_INSPECT_COMMANDS_TYPE_BACKENDS, FolksInspectCommandsBackendsClass))
#define FOLKS_INSPECT_COMMANDS_IS_BACKENDS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_INSPECT_COMMANDS_TYPE_BACKENDS))
#define FOLKS_INSPECT_COMMANDS_IS_BACKENDS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_INSPECT_COMMANDS_TYPE_BACKENDS))
#define FOLKS_INSPECT_COMMANDS_BACKENDS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_INSPECT_COMMANDS_TYPE_BACKENDS, FolksInspectCommandsBackendsClass))

typedef struct _FolksInspectCommandsBackends FolksInspectCommandsBackends;
typedef struct _FolksInspectCommandsBackendsClass FolksInspectCommandsBackendsClass;

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

#define FOLKS_INSPECT_COMMANDS_TYPE_SIGNALS (folks_inspect_commands_signals_get_type ())
#define FOLKS_INSPECT_COMMANDS_SIGNALS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_INSPECT_COMMANDS_TYPE_SIGNALS, FolksInspectCommandsSignals))
#define FOLKS_INSPECT_COMMANDS_SIGNALS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_INSPECT_COMMANDS_TYPE_SIGNALS, FolksInspectCommandsSignalsClass))
#define FOLKS_INSPECT_COMMANDS_IS_SIGNALS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_INSPECT_COMMANDS_TYPE_SIGNALS))
#define FOLKS_INSPECT_COMMANDS_IS_SIGNALS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_INSPECT_COMMANDS_TYPE_SIGNALS))
#define FOLKS_INSPECT_COMMANDS_SIGNALS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_INSPECT_COMMANDS_TYPE_SIGNALS, FolksInspectCommandsSignalsClass))

typedef struct _FolksInspectCommandsSignals FolksInspectCommandsSignals;
typedef struct _FolksInspectCommandsSignalsClass FolksInspectCommandsSignalsClass;

#define FOLKS_INSPECT_COMMANDS_TYPE_DEBUG (folks_inspect_commands_debug_get_type ())
#define FOLKS_INSPECT_COMMANDS_DEBUG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_INSPECT_COMMANDS_TYPE_DEBUG, FolksInspectCommandsDebug))
#define FOLKS_INSPECT_COMMANDS_DEBUG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_INSPECT_COMMANDS_TYPE_DEBUG, FolksInspectCommandsDebugClass))
#define FOLKS_INSPECT_COMMANDS_IS_DEBUG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_INSPECT_COMMANDS_TYPE_DEBUG))
#define FOLKS_INSPECT_COMMANDS_IS_DEBUG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_INSPECT_COMMANDS_TYPE_DEBUG))
#define FOLKS_INSPECT_COMMANDS_DEBUG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_INSPECT_COMMANDS_TYPE_DEBUG, FolksInspectCommandsDebugClass))

typedef struct _FolksInspectCommandsDebug FolksInspectCommandsDebug;
typedef struct _FolksInspectCommandsDebugClass FolksInspectCommandsDebugClass;
typedef struct _Block3Data Block3Data;
typedef struct _FolksInspectClientWaitForQuiescenceData FolksInspectClientWaitForQuiescenceData;
typedef struct _Block4Data Block4Data;
#define _g_io_channel_unref0(var) ((var == NULL) ? NULL : (var = (g_io_channel_unref (var), NULL)))
typedef struct _FolksInspectCommandPrivate FolksInspectCommandPrivate;
typedef struct _FolksInspectParamSpecCommand FolksInspectParamSpecCommand;

struct _FolksInspectClient {
	GObject parent_instance;
	FolksInspectClientPrivate * priv;
	GeeHashMap* commands;
};

struct _FolksInspectClientClass {
	GObjectClass parent_class;
};

struct _FolksInspectClientPrivate {
	GMainLoop* main_loop;
	FolksIndividualAggregator* _aggregator;
	FolksBackendStore* _backend_store;
	FolksInspectSignalManager* _signal_manager;
};

struct _Block3Data {
	int _ref_count_;
	FolksInspectClient * self;
	gboolean has_yielded;
	gpointer _async_data_;
};

struct _FolksInspectClientWaitForQuiescenceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FolksInspectClient* self;
	Block3Data* _data3_;
	FolksIndividualAggregator* _tmp0_;
	gulong _tmp1_;
	gulong signal_id;
	FolksIndividualAggregator* _tmp2_;
	FolksIndividualAggregator* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	FolksIndividualAggregator* _tmp6_;
	gulong _tmp7_;
	FolksIndividualAggregator* _tmp8_;
	gboolean _tmp9_;
	gboolean _tmp10_;
	GError * _inner_error_;
};

struct _Block4Data {
	int _ref_count_;
	FolksInspectClient * self;
	gchar* subcommand;
	FolksInspectCommand* command;
};

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);
	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 _FolksInspectParamSpecCommand {
	GParamSpec parent_instance;
};


extern FolksInspectClient* main_client;
FolksInspectClient* main_client = NULL;
static gpointer folks_inspect_client_parent_class = NULL;
static gpointer folks_inspect_command_parent_class = NULL;

GType folks_inspect_client_get_type (void) G_GNUC_CONST;
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_signal_manager_get_type (void) G_GNUC_CONST;
#define FOLKS_INSPECT_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), FOLKS_INSPECT_TYPE_CLIENT, FolksInspectClientPrivate))
enum  {
	FOLKS_INSPECT_CLIENT_DUMMY_PROPERTY,
	FOLKS_INSPECT_CLIENT_AGGREGATOR,
	FOLKS_INSPECT_CLIENT_BACKEND_STORE,
	FOLKS_INSPECT_CLIENT_SIGNAL_MANAGER
};
gint folks_inspect_client_main (gchar** args, int args_length1);
FolksInspectClient* folks_inspect_client_new (void);
FolksInspectClient* folks_inspect_client_construct (GType object_type);
static gboolean __lambda2_ (void);
void folks_inspect_client_quit (FolksInspectClient* self);
static gboolean ___lambda2__gsource_func (gpointer self);
void folks_inspect_client_run_interactive (FolksInspectClient* self);
void folks_inspect_client_run_non_interactive (FolksInspectClient* self, const gchar* command_line);
void folks_inspect_utils_init (void);
FolksInspectCommandsQuit* folks_inspect_commands_quit_new (FolksInspectClient* client);
FolksInspectCommandsQuit* folks_inspect_commands_quit_construct (GType object_type, FolksInspectClient* client);
GType folks_inspect_commands_quit_get_type (void) G_GNUC_CONST;
FolksInspectCommandsHelp* folks_inspect_commands_help_new (FolksInspectClient* client);
FolksInspectCommandsHelp* folks_inspect_commands_help_construct (GType object_type, FolksInspectClient* client);
GType folks_inspect_commands_help_get_type (void) G_GNUC_CONST;
FolksInspectCommandsIndividuals* folks_inspect_commands_individuals_new (FolksInspectClient* client);
FolksInspectCommandsIndividuals* folks_inspect_commands_individuals_construct (GType object_type, FolksInspectClient* client);
GType folks_inspect_commands_individuals_get_type (void) G_GNUC_CONST;
FolksInspectCommandsLinking* folks_inspect_commands_linking_new (FolksInspectClient* client);
FolksInspectCommandsLinking* folks_inspect_commands_linking_construct (GType object_type, FolksInspectClient* client);
GType folks_inspect_commands_linking_get_type (void) G_GNUC_CONST;
FolksInspectCommandsPersonas* folks_inspect_commands_personas_new (FolksInspectClient* client);
FolksInspectCommandsPersonas* folks_inspect_commands_personas_construct (GType object_type, FolksInspectClient* client);
GType folks_inspect_commands_personas_get_type (void) G_GNUC_CONST;
FolksInspectCommandsBackends* folks_inspect_commands_backends_new (FolksInspectClient* client);
FolksInspectCommandsBackends* folks_inspect_commands_backends_construct (GType object_type, FolksInspectClient* client);
GType folks_inspect_commands_backends_get_type (void) G_GNUC_CONST;
FolksInspectCommandsPersonaStores* folks_inspect_commands_persona_stores_new (FolksInspectClient* client);
FolksInspectCommandsPersonaStores* folks_inspect_commands_persona_stores_construct (GType object_type, FolksInspectClient* client);
GType folks_inspect_commands_persona_stores_get_type (void) G_GNUC_CONST;
FolksInspectCommandsSignals* folks_inspect_commands_signals_new (FolksInspectClient* client);
FolksInspectCommandsSignals* folks_inspect_commands_signals_construct (GType object_type, FolksInspectClient* client);
GType folks_inspect_commands_signals_get_type (void) G_GNUC_CONST;
FolksInspectCommandsDebug* folks_inspect_commands_debug_new (FolksInspectClient* client);
FolksInspectCommandsDebug* folks_inspect_commands_debug_construct (GType object_type, FolksInspectClient* client);
GType folks_inspect_commands_debug_get_type (void) G_GNUC_CONST;
FolksInspectSignalManager* folks_inspect_signal_manager_new (void);
FolksInspectSignalManager* folks_inspect_signal_manager_construct (GType object_type);
static void folks_inspect_client_set_signal_manager (FolksInspectClient* self, FolksInspectSignalManager* value);
static void folks_inspect_client_set_backend_store (FolksInspectClient* self, FolksBackendStore* value);
static void folks_inspect_client_set_aggregator (FolksInspectClient* self, FolksIndividualAggregator* value);
static void _folks_inspect_client_wait_for_quiescence_data_free (gpointer _data);
static void _folks_inspect_client_wait_for_quiescence (FolksInspectClient* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _folks_inspect_client_wait_for_quiescence_finish (FolksInspectClient* self, GAsyncResult* _res_, GError** error);
static gboolean _folks_inspect_client_wait_for_quiescence_co (FolksInspectClientWaitForQuiescenceData* _data_);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
FolksIndividualAggregator* folks_inspect_client_get_aggregator (FolksInspectClient* self);
static void __lambda6_ (Block3Data* _data3_, GObject* obj, GParamSpec* pspec);
static void ___lambda6__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _folks_inspect_client_wait_for_quiescence_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static FolksInspectCommand* folks_inspect_client_parse_command_line (const gchar* command_line, gchar** command_name, gchar** subcommand);
static void __lambda7_ (Block4Data* _data4_, GObject* obj, GAsyncResult* res);
void folks_inspect_command_run (FolksInspectCommand* self, const gchar* command_string);
static void ___lambda7__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static gboolean __lambda3_ (FolksInspectClient* self, GIOChannel* source, GIOCondition cond);
static gboolean ___lambda3__gio_func (GIOChannel* source, GIOCondition condition, gpointer self);
static gboolean __lambda4_ (FolksInspectClient* self);
static gboolean ___lambda4__gsource_func (gpointer self);
static gchar** folks_inspect_client_completion_cb (const gchar* word, gint start, gint end);
static gchar** _folks_inspect_client_completion_cb_rl_completion_func_t (const gchar* str, gint a, gint b);
static void __lambda5_ (const gchar* _command_line);
static void ___lambda5__rl_vcpfunc_t (const gchar* s);
gchar* folks_inspect_utils_command_name_completion_cb (const gchar* word, gint state);
static gchar* _folks_inspect_utils_command_name_completion_cb_rl_compentry_func_t (const gchar* str, gint a);
static gchar** _vala_array_dup11 (gchar** self, int length);
gchar** folks_inspect_command_complete_subcommand (FolksInspectCommand* self, const gchar* subcommand, int* result_length1);
FolksBackendStore* folks_inspect_client_get_backend_store (FolksInspectClient* self);
FolksInspectSignalManager* folks_inspect_client_get_signal_manager (FolksInspectClient* self);
static void folks_inspect_client_finalize (GObject* obj);
static void _vala_folks_inspect_client_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_folks_inspect_client_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
enum  {
	FOLKS_INSPECT_COMMAND_DUMMY_PROPERTY
};
FolksInspectCommand* folks_inspect_command_construct (GType object_type, FolksInspectClient* client);
static void folks_inspect_command_real_run (FolksInspectCommand* self, const gchar* command_string);
static gchar** folks_inspect_command_real_complete_subcommand (FolksInspectCommand* self, const gchar* subcommand, int* result_length1);
const gchar* folks_inspect_command_get_name (FolksInspectCommand* self);
const gchar* folks_inspect_command_get_description (FolksInspectCommand* self);
const gchar* folks_inspect_command_get_help (FolksInspectCommand* self);
static void folks_inspect_command_finalize (FolksInspectCommand* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);


static gboolean __lambda2_ (void) {
	gboolean result = FALSE;
	FolksInspectClient* _tmp0_;
	_tmp0_ = main_client;
	folks_inspect_client_quit (_tmp0_);
	result = FALSE;
	return result;
}


static gboolean ___lambda2__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda2_ ();
	return result;
}


gint folks_inspect_client_main (gchar** args, int args_length1) {
	gint result = 0;
	GOptionContext* _tmp0_;
	GOptionContext* context;
	GOptionContext* _tmp1_;
	FolksInspectClient* _tmp6_;
	gchar** _tmp7_;
	gint _tmp7__length1;
	GError * _inner_error_ = NULL;
	bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR);
	textdomain (GETTEXT_PACKAGE);
	_tmp0_ = g_option_context_new ("[COMMAND]");
	context = _tmp0_;
	_tmp1_ = context;
	g_option_context_set_summary (_tmp1_, "Inspect meta-contact information in libfolks.");
	{
		GOptionContext* _tmp2_;
		_tmp2_ = context;
		g_option_context_parse (_tmp2_, &args_length1, &args, &_inner_error_);
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_OPTION_ERROR) {
				goto __catch2_g_option_error;
			}
			_g_option_context_free0 (context);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return 0;
		}
	}
	goto __finally2;
	__catch2_g_option_error:
	{
		GError* e1 = NULL;
		FILE* _tmp3_;
		GError* _tmp4_;
		const gchar* _tmp5_;
		e1 = _inner_error_;
		_inner_error_ = NULL;
		_tmp3_ = stderr;
		_tmp4_ = e1;
		_tmp5_ = _tmp4_->message;
		fprintf (_tmp3_, "Couldn’t parse command line options: %s\n", _tmp5_);
		result = 1;
		_g_error_free0 (e1);
		_g_option_context_free0 (context);
		return result;
	}
	__finally2:
	if (_inner_error_ != NULL) {
		_g_option_context_free0 (context);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return 0;
	}
	_tmp6_ = folks_inspect_client_new ();
	_g_object_unref0 (main_client);
	main_client = _tmp6_;
	g_unix_signal_add_full (G_PRIORITY_DEFAULT, SIGTERM, ___lambda2__gsource_func, NULL, NULL);
	_tmp7_ = args;
	_tmp7__length1 = args_length1;
	if (_tmp7__length1 == 1) {
		FolksInspectClient* _tmp8_;
		_tmp8_ = main_client;
		folks_inspect_client_run_interactive (_tmp8_);
	} else {
		gchar** _tmp9_;
		gint _tmp9__length1;
		gchar* command_line = NULL;
		gchar** _tmp10_;
		gint _tmp10__length1;
		const gchar* _tmp11_;
		FolksInspectClient* _tmp16_;
		const gchar* _tmp17_;
		_tmp9_ = args;
		_tmp9__length1 = args_length1;
		g_assert (_tmp9__length1 > 1);
		_tmp10_ = args;
		_tmp10__length1 = args_length1;
		_tmp11_ = _tmp10_[1];
		if (g_strcmp0 (_tmp11_, "--") == 0) {
			gchar** _tmp12_;
			gint _tmp12__length1;
			gchar* _tmp13_ = NULL;
			_tmp12_ = args;
			_tmp12__length1 = args_length1;
			_tmp13_ = g_strjoinv (" ", _tmp12_ + 2);
			_g_free0 (command_line);
			command_line = _tmp13_;
		} else {
			gchar** _tmp14_;
			gint _tmp14__length1;
			gchar* _tmp15_ = NULL;
			_tmp14_ = args;
			_tmp14__length1 = args_length1;
			_tmp15_ = g_strjoinv (" ", _tmp14_ + 1);
			_g_free0 (command_line);
			command_line = _tmp15_;
		}
		_tmp16_ = main_client;
		_tmp17_ = command_line;
		folks_inspect_client_run_non_interactive (_tmp16_, _tmp17_);
		_g_free0 (command_line);
	}
	result = 0;
	_g_option_context_free0 (context);
	return result;
}


int main (int argc, char ** argv) {
	g_type_init ();
	return folks_inspect_client_main (argv, argc);
}


FolksInspectClient* folks_inspect_client_construct (GType object_type) {
	FolksInspectClient * self = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GeeHashMap* _tmp2_;
	GeeHashMap* _tmp3_;
	FolksInspectCommandsQuit* _tmp4_;
	FolksInspectCommandsQuit* _tmp5_;
	GeeHashMap* _tmp6_;
	FolksInspectCommandsHelp* _tmp7_;
	FolksInspectCommandsHelp* _tmp8_;
	GeeHashMap* _tmp9_;
	FolksInspectCommandsIndividuals* _tmp10_;
	FolksInspectCommandsIndividuals* _tmp11_;
	GeeHashMap* _tmp12_;
	FolksInspectCommandsLinking* _tmp13_;
	FolksInspectCommandsLinking* _tmp14_;
	GeeHashMap* _tmp15_;
	FolksInspectCommandsPersonas* _tmp16_;
	FolksInspectCommandsPersonas* _tmp17_;
	GeeHashMap* _tmp18_;
	FolksInspectCommandsBackends* _tmp19_;
	FolksInspectCommandsBackends* _tmp20_;
	GeeHashMap* _tmp21_;
	FolksInspectCommandsPersonaStores* _tmp22_;
	FolksInspectCommandsPersonaStores* _tmp23_;
	GeeHashMap* _tmp24_;
	FolksInspectCommandsSignals* _tmp25_;
	FolksInspectCommandsSignals* _tmp26_;
	GeeHashMap* _tmp27_;
	FolksInspectCommandsDebug* _tmp28_;
	FolksInspectCommandsDebug* _tmp29_;
	GMainLoop* _tmp30_;
	FolksInspectSignalManager* _tmp31_;
	FolksInspectSignalManager* _tmp32_;
	FolksBackendStore* _tmp33_ = NULL;
	FolksBackendStore* _tmp34_;
	FolksIndividualAggregator* _tmp35_;
	FolksIndividualAggregator* _tmp36_;
	self = (FolksInspectClient*) g_object_new (object_type, NULL);
	folks_inspect_utils_init ();
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, FOLKS_INSPECT_TYPE_COMMAND, (GBoxedCopyFunc) folks_inspect_command_ref, folks_inspect_command_unref, _tmp0_, _tmp1_, NULL);
	_g_object_unref0 (self->commands);
	self->commands = _tmp2_;
	_tmp3_ = self->commands;
	_tmp4_ = folks_inspect_commands_quit_new (self);
	_tmp5_ = _tmp4_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp3_, "quit", (FolksInspectCommand*) _tmp5_);
	_folks_inspect_command_unref0 (_tmp5_);
	_tmp6_ = self->commands;
	_tmp7_ = folks_inspect_commands_help_new (self);
	_tmp8_ = _tmp7_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp6_, "help", (FolksInspectCommand*) _tmp8_);
	_folks_inspect_command_unref0 (_tmp8_);
	_tmp9_ = self->commands;
	_tmp10_ = folks_inspect_commands_individuals_new (self);
	_tmp11_ = _tmp10_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp9_, "individuals", (FolksInspectCommand*) _tmp11_);
	_folks_inspect_command_unref0 (_tmp11_);
	_tmp12_ = self->commands;
	_tmp13_ = folks_inspect_commands_linking_new (self);
	_tmp14_ = _tmp13_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp12_, "linking", (FolksInspectCommand*) _tmp14_);
	_folks_inspect_command_unref0 (_tmp14_);
	_tmp15_ = self->commands;
	_tmp16_ = folks_inspect_commands_personas_new (self);
	_tmp17_ = _tmp16_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp15_, "personas", (FolksInspectCommand*) _tmp17_);
	_folks_inspect_command_unref0 (_tmp17_);
	_tmp18_ = self->commands;
	_tmp19_ = folks_inspect_commands_backends_new (self);
	_tmp20_ = _tmp19_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp18_, "backends", (FolksInspectCommand*) _tmp20_);
	_folks_inspect_command_unref0 (_tmp20_);
	_tmp21_ = self->commands;
	_tmp22_ = folks_inspect_commands_persona_stores_new (self);
	_tmp23_ = _tmp22_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp21_, "persona-stores", (FolksInspectCommand*) _tmp23_);
	_folks_inspect_command_unref0 (_tmp23_);
	_tmp24_ = self->commands;
	_tmp25_ = folks_inspect_commands_signals_new (self);
	_tmp26_ = _tmp25_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp24_, "signals", (FolksInspectCommand*) _tmp26_);
	_folks_inspect_command_unref0 (_tmp26_);
	_tmp27_ = self->commands;
	_tmp28_ = folks_inspect_commands_debug_new (self);
	_tmp29_ = _tmp28_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp27_, "debug", (FolksInspectCommand*) _tmp29_);
	_folks_inspect_command_unref0 (_tmp29_);
	_tmp30_ = g_main_loop_new (NULL, FALSE);
	_g_main_loop_unref0 (self->priv->main_loop);
	self->priv->main_loop = _tmp30_;
	_tmp31_ = folks_inspect_signal_manager_new ();
	_tmp32_ = _tmp31_;
	folks_inspect_client_set_signal_manager (self, _tmp32_);
	_g_object_unref0 (_tmp32_);
	_tmp33_ = folks_backend_store_dup ();
	_tmp34_ = _tmp33_;
	folks_inspect_client_set_backend_store (self, _tmp34_);
	_g_object_unref0 (_tmp34_);
	_tmp35_ = folks_individual_aggregator_new ();
	_tmp36_ = _tmp35_;
	folks_inspect_client_set_aggregator (self, _tmp36_);
	_g_object_unref0 (_tmp36_);
	return self;
}


FolksInspectClient* folks_inspect_client_new (void) {
	return folks_inspect_client_construct (FOLKS_INSPECT_TYPE_CLIENT);
}


void folks_inspect_client_quit (FolksInspectClient* self) {
	GMainLoop* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->main_loop;
	g_main_loop_quit (_tmp0_);
}


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


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


static void _folks_inspect_client_wait_for_quiescence (FolksInspectClient* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FolksInspectClientWaitForQuiescenceData* _data_;
	FolksInspectClient* _tmp0_;
	_data_ = g_slice_new0 (FolksInspectClientWaitForQuiescenceData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _folks_inspect_client_wait_for_quiescence);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _folks_inspect_client_wait_for_quiescence_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_folks_inspect_client_wait_for_quiescence_co (_data_);
}


static void _folks_inspect_client_wait_for_quiescence_finish (FolksInspectClient* self, GAsyncResult* _res_, GError** error) {
	FolksInspectClientWaitForQuiescenceData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


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_)) {
		FolksInspectClient * self;
		self = _data3_->self;
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}


static void __lambda6_ (Block3Data* _data3_, GObject* obj, GParamSpec* pspec) {
	FolksInspectClient * self;
	gboolean _tmp0_;
	self = _data3_->self;
	g_return_if_fail (obj != NULL);
	g_return_if_fail (pspec != NULL);
	_tmp0_ = _data3_->has_yielded;
	if (_tmp0_ == TRUE) {
		_folks_inspect_client_wait_for_quiescence_co (_data3_->_async_data_);
	}
}


static void ___lambda6__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda6_ (self, _sender, pspec);
}


static void _folks_inspect_client_wait_for_quiescence_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	FolksInspectClientWaitForQuiescenceData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_folks_inspect_client_wait_for_quiescence_co (_data_);
}


static gboolean _folks_inspect_client_wait_for_quiescence_co (FolksInspectClientWaitForQuiescenceData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_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_->_data3_->has_yielded = FALSE;
	_data_->_tmp0_ = _data_->self->priv->_aggregator;
	_data_->_tmp1_ = 0UL;
	_data_->_tmp1_ = g_signal_connect_data ((GObject*) _data_->_tmp0_, "notify::is-quiescent", (GCallback) ___lambda6__g_object_notify, block3_data_ref (_data_->_data3_), (GClosureNotify) block3_data_unref, 0);
	_data_->signal_id = _data_->_tmp1_;
	{
		_data_->_tmp2_ = _data_->self->priv->_aggregator;
		_data_->_state_ = 1;
		folks_individual_aggregator_prepare (_data_->_tmp2_, _folks_inspect_client_wait_for_quiescence_ready, _data_);
		return FALSE;
		_state_1:
		folks_individual_aggregator_prepare_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			goto __finally3;
		}
		_data_->_tmp3_ = _data_->self->priv->_aggregator;
		_data_->_tmp4_ = folks_individual_aggregator_get_is_quiescent (_data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		if (_data_->_tmp5_ == FALSE) {
			_data_->_data3_->has_yielded = TRUE;
			_data_->_state_ = 2;
			return FALSE;
			_state_2:
			;
		}
	}
	__finally3:
	{
		_data_->_tmp6_ = _data_->self->priv->_aggregator;
		_data_->_tmp7_ = _data_->signal_id;
		g_signal_handler_disconnect ((GObject*) _data_->_tmp6_, _data_->_tmp7_);
		_data_->_tmp8_ = _data_->self->priv->_aggregator;
		_data_->_tmp9_ = folks_individual_aggregator_get_is_quiescent (_data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		g_assert (_data_->_tmp10_ == TRUE);
	}
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		block3_data_unref (_data_->_data3_);
		_data_->_data3_ = NULL;
		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;
	}
	block3_data_unref (_data_->_data3_);
	_data_->_data3_ = NULL;
	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 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_)) {
		FolksInspectClient * self;
		self = _data4_->self;
		_folks_inspect_command_unref0 (_data4_->command);
		_g_free0 (_data4_->subcommand);
		_g_object_unref0 (self);
		g_slice_free (Block4Data, _data4_);
	}
}


static void __lambda7_ (Block4Data* _data4_, GObject* obj, GAsyncResult* res) {
	FolksInspectClient * self;
	FolksInspectCommand* _tmp3_;
	const gchar* _tmp4_;
	GMainLoop* _tmp5_;
	GError * _inner_error_ = NULL;
	self = _data4_->self;
	g_return_if_fail (res != NULL);
	{
		GAsyncResult* _tmp0_;
		_tmp0_ = res;
		_folks_inspect_client_wait_for_quiescence_finish (self, _tmp0_, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch4_g_error;
		}
	}
	goto __finally4;
	__catch4_g_error:
	{
		GError* e1 = NULL;
		FILE* _tmp1_;
		const gchar* _tmp2_;
		e1 = _inner_error_;
		_inner_error_ = NULL;
		_tmp1_ = stderr;
		_tmp2_ = e1->message;
		fprintf (_tmp1_, "Error preparing aggregator: %s\n", _tmp2_);
		exit (1);
		_g_error_free0 (e1);
	}
	__finally4:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_tmp3_ = _data4_->command;
	_tmp4_ = _data4_->subcommand;
	folks_inspect_command_run (_tmp3_, _tmp4_);
	_tmp5_ = self->priv->main_loop;
	g_main_loop_quit (_tmp5_);
}


static void ___lambda7__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	__lambda7_ (self, source_object, res);
	block4_data_unref (self);
}


void folks_inspect_client_run_non_interactive (FolksInspectClient* self, const gchar* command_line) {
	Block4Data* _data4_;
	gchar* command_name = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	FolksInspectCommand* _tmp3_ = NULL;
	FolksInspectCommand* _tmp4_;
	GMainLoop* _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (command_line != NULL);
	_data4_ = g_slice_new0 (Block4Data);
	_data4_->_ref_count_ = 1;
	_data4_->self = g_object_ref (self);
	_tmp0_ = command_line;
	_tmp3_ = folks_inspect_client_parse_command_line (_tmp0_, &_tmp1_, &_tmp2_);
	_g_free0 (command_name);
	command_name = _tmp1_;
	_g_free0 (_data4_->subcommand);
	_data4_->subcommand = _tmp2_;
	_data4_->command = _tmp3_;
	_tmp4_ = _data4_->command;
	if (_tmp4_ == NULL) {
		FILE* _tmp5_;
		const gchar* _tmp6_;
		_tmp5_ = stdout;
		_tmp6_ = command_name;
		fprintf (_tmp5_, "Unrecognised command ‘%s’.\n", _tmp6_);
		_g_free0 (command_name);
		block4_data_unref (_data4_);
		_data4_ = NULL;
		return;
	}
	_folks_inspect_client_wait_for_quiescence (self, ___lambda7__gasync_ready_callback, block4_data_ref (_data4_));
	_tmp7_ = self->priv->main_loop;
	g_main_loop_run (_tmp7_);
	_g_free0 (command_name);
	block4_data_unref (_data4_);
	_data4_ = NULL;
}


static gboolean __lambda3_ (FolksInspectClient* self, GIOChannel* source, GIOCondition cond) {
	gboolean result = FALSE;
	GIOCondition _tmp0_;
	g_return_val_if_fail (source != NULL, FALSE);
	_tmp0_ = cond;
	if ((_tmp0_ & G_IO_IN) != 0) {
		rl_callback_read_char ();
		result = TRUE;
		return result;
	}
	g_assert_not_reached ();
}


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


static gboolean __lambda4_ (FolksInspectClient* self) {
	gboolean result = FALSE;
	FILE* _tmp0_;
	rl_free_line_state ();
	rl_cleanup_after_signal ();
	rl_reset_after_signal ();
	_tmp0_ = stdout;
	fprintf (_tmp0_, "^C");
	rl_crlf ();
	rl_reset_line_state ();
	rl_replace_line ("", 0);
	rl_redisplay ();
	result = TRUE;
	return result;
}


static gboolean ___lambda4__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda4_ (self);
	return result;
}


static gchar** _folks_inspect_client_completion_cb_rl_completion_func_t (const gchar* str, gint a, gint b) {
	gchar** result;
	result = folks_inspect_client_completion_cb (str, a, b);
	return result;
}


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


static void __lambda5_ (const gchar* _command_line) {
	const gchar* _tmp0_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* command_line;
	const gchar* _tmp5_;
	gchar* _tmp6_ = NULL;
	const gchar* _tmp7_;
	gchar* subcommand = NULL;
	gchar* command_name = NULL;
	FolksInspectClient* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	FolksInspectCommand* _tmp12_ = NULL;
	FolksInspectCommand* command;
	FolksInspectCommand* _tmp13_;
	const gchar* _tmp18_;
	_tmp0_ = _command_line;
	if (_tmp0_ == NULL) {
		const gchar* _tmp1_;
		FolksInspectClient* _tmp2_;
		_tmp1_ = rl_line_buffer;
		if (g_strcmp0 (_tmp1_, "") != 0) {
			rl_ding ();
			return;
		}
		rl_crlf ();
		rl_callback_handler_remove ();
		_tmp2_ = main_client;
		folks_inspect_client_quit (_tmp2_);
		return;
	}
	_tmp3_ = _command_line;
	_tmp4_ = g_strdup ((const gchar*) _tmp3_);
	command_line = _tmp4_;
	_tmp5_ = command_line;
	_tmp6_ = string_strip (_tmp5_);
	_g_free0 (command_line);
	command_line = _tmp6_;
	_tmp7_ = command_line;
	if (g_strcmp0 (_tmp7_, "") == 0) {
		_g_free0 (command_line);
		return;
	}
	_tmp8_ = main_client;
	_tmp9_ = command_line;
	_tmp12_ = folks_inspect_client_parse_command_line (_tmp9_, &_tmp10_, &_tmp11_);
	_g_free0 (command_name);
	command_name = _tmp10_;
	_g_free0 (subcommand);
	subcommand = _tmp11_;
	command = _tmp12_;
	_tmp13_ = command;
	if (_tmp13_ != NULL) {
		FolksInspectCommand* _tmp14_;
		const gchar* _tmp15_;
		_tmp14_ = command;
		_tmp15_ = subcommand;
		folks_inspect_command_run (_tmp14_, _tmp15_);
	} else {
		FILE* _tmp16_;
		const gchar* _tmp17_;
		_tmp16_ = stdout;
		_tmp17_ = command_name;
		fprintf (_tmp16_, "Unrecognised command ‘%s’.\n", _tmp17_);
	}
	_tmp18_ = command_line;
	add_history (_tmp18_);
	_folks_inspect_command_unref0 (command);
	_g_free0 (command_name);
	_g_free0 (subcommand);
	_g_free0 (command_line);
}


static void ___lambda5__rl_vcpfunc_t (const gchar* s) {
	__lambda5_ (s);
}


void folks_inspect_client_run_interactive (FolksInspectClient* self) {
	FILE* _tmp0_;
	gint _tmp1_ = 0;
	GIOChannel* _tmp2_;
	GIOChannel* stdin_channel;
	FolksIndividualAggregator* _tmp3_;
	GMainLoop* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = stdin;
	_tmp1_ = fileno (_tmp0_);
	_tmp2_ = g_io_channel_unix_new (_tmp1_);
	stdin_channel = _tmp2_;
	g_io_add_watch (stdin_channel, G_IO_IN, ___lambda3__gio_func, self);
	g_unix_signal_add_full (G_PRIORITY_DEFAULT, SIGINT, ___lambda4__gsource_func, g_object_ref (self), g_object_unref);
	rl_readline_name = "folks-inspect";
	rl_attempted_completion_function = _folks_inspect_client_completion_cb_rl_completion_func_t;
	rl_catch_signals = 0;
	rl_callback_handler_install ("> ", ___lambda5__rl_vcpfunc_t);
	_tmp3_ = self->priv->_aggregator;
	folks_individual_aggregator_prepare (_tmp3_, NULL, NULL);
	_tmp4_ = self->priv->main_loop;
	g_main_loop_run (_tmp4_);
	_g_io_channel_unref0 (stdin_channel);
}


static FolksInspectCommand* folks_inspect_client_parse_command_line (const gchar* command_line, gchar** command_name, gchar** subcommand) {
	gchar* _vala_command_name = NULL;
	gchar* _vala_subcommand = NULL;
	FolksInspectCommand* result = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar** _tmp2_;
	gchar** _tmp3_ = NULL;
	gchar** parts;
	gint parts_length1;
	gint _parts_size_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	gchar** _tmp5_;
	gint _tmp5__length1;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gboolean _tmp8_ = FALSE;
	gchar** _tmp9_;
	gint _tmp9__length1;
	gboolean _tmp12_;
	FolksInspectClient* _tmp16_;
	GeeHashMap* _tmp17_;
	gchar** _tmp18_;
	gint _tmp18__length1;
	const gchar* _tmp19_;
	gpointer _tmp20_ = NULL;
	g_return_val_if_fail (command_line != NULL, NULL);
	_tmp0_ = g_strdup ("");
	_g_free0 (_vala_command_name);
	_vala_command_name = _tmp0_;
	_g_free0 (_vala_subcommand);
	_vala_subcommand = NULL;
	_tmp1_ = command_line;
	_tmp3_ = _tmp2_ = g_strsplit (_tmp1_, " ", 2);
	parts = _tmp3_;
	parts_length1 = _vala_array_length (_tmp2_);
	_parts_size_ = parts_length1;
	_tmp4_ = parts;
	_tmp4__length1 = parts_length1;
	if (_tmp4__length1 < 1) {
		result = NULL;
		parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
		if (command_name) {
			*command_name = _vala_command_name;
		} else {
			_g_free0 (_vala_command_name);
		}
		if (subcommand) {
			*subcommand = _vala_subcommand;
		} else {
			_g_free0 (_vala_subcommand);
		}
		return result;
	}
	_tmp5_ = parts;
	_tmp5__length1 = parts_length1;
	_tmp6_ = _tmp5_[0];
	_tmp7_ = g_strdup (_tmp6_);
	_g_free0 (_vala_command_name);
	_vala_command_name = _tmp7_;
	_tmp9_ = parts;
	_tmp9__length1 = parts_length1;
	if (_tmp9__length1 == 2) {
		gchar** _tmp10_;
		gint _tmp10__length1;
		const gchar* _tmp11_;
		_tmp10_ = parts;
		_tmp10__length1 = parts_length1;
		_tmp11_ = _tmp10_[1];
		_tmp8_ = g_strcmp0 (_tmp11_, "") != 0;
	} else {
		_tmp8_ = FALSE;
	}
	_tmp12_ = _tmp8_;
	if (_tmp12_) {
		gchar** _tmp13_;
		gint _tmp13__length1;
		const gchar* _tmp14_;
		gchar* _tmp15_;
		_tmp13_ = parts;
		_tmp13__length1 = parts_length1;
		_tmp14_ = _tmp13_[1];
		_tmp15_ = g_strdup (_tmp14_);
		_g_free0 (_vala_subcommand);
		_vala_subcommand = _tmp15_;
	} else {
		_g_free0 (_vala_subcommand);
		_vala_subcommand = NULL;
	}
	_tmp16_ = main_client;
	_tmp17_ = _tmp16_->commands;
	_tmp18_ = parts;
	_tmp18__length1 = parts_length1;
	_tmp19_ = _tmp18_[0];
	_tmp20_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp17_, _tmp19_);
	result = (FolksInspectCommand*) _tmp20_;
	parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
	if (command_name) {
		*command_name = _vala_command_name;
	} else {
		_g_free0 (_vala_command_name);
	}
	if (subcommand) {
		*subcommand = _vala_subcommand;
	} else {
		_g_free0 (_vala_subcommand);
	}
	return result;
}


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


static gchar** _vala_array_dup11 (gchar** self, int length) {
	gchar** result;
	int 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;
}


static gchar** folks_inspect_client_completion_cb (const gchar* word, gint start, gint end) {
	gchar** result = NULL;
	gint _tmp0_;
	gchar* command_name = NULL;
	gchar* subcommand = NULL;
	const gchar* _tmp5_;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	FolksInspectCommand* _tmp8_ = NULL;
	FolksInspectCommand* command;
	FolksInspectCommand* _tmp9_;
	g_return_val_if_fail (word != NULL, NULL);
	_tmp0_ = start;
	if (_tmp0_ == 0) {
		const gchar* _tmp1_;
		gchar** _tmp2_;
		gchar** _tmp3_ = NULL;
		gchar** _tmp4_;
		gint _tmp4__length1;
		_tmp1_ = word;
		_tmp3_ = _tmp2_ = rl_completion_matches (_tmp1_, _folks_inspect_utils_command_name_completion_cb_rl_compentry_func_t);
		_tmp4_ = (_tmp3_ != NULL) ? _vala_array_dup11 (_tmp3_, _vala_array_length (_tmp2_)) : ((gpointer) _tmp3_);
		_tmp4__length1 = _vala_array_length (_tmp2_);
		result = _tmp4_;
		return result;
	}
	_tmp5_ = rl_line_buffer;
	_tmp8_ = folks_inspect_client_parse_command_line (_tmp5_, &_tmp6_, &_tmp7_);
	_g_free0 (command_name);
	command_name = _tmp6_;
	_g_free0 (subcommand);
	subcommand = _tmp7_;
	command = _tmp8_;
	_tmp9_ = command;
	if (_tmp9_ != NULL) {
		const gchar* _tmp10_;
		FolksInspectCommand* _tmp12_;
		const gchar* _tmp13_;
		gint _tmp14_ = 0;
		gchar** _tmp15_ = NULL;
		_tmp10_ = subcommand;
		if (_tmp10_ == NULL) {
			gchar* _tmp11_;
			_tmp11_ = g_strdup ("");
			_g_free0 (subcommand);
			subcommand = _tmp11_;
		}
		_tmp12_ = command;
		_tmp13_ = subcommand;
		_tmp15_ = folks_inspect_command_complete_subcommand (_tmp12_, _tmp13_, &_tmp14_);
		result = _tmp15_;
		_folks_inspect_command_unref0 (command);
		_g_free0 (subcommand);
		_g_free0 (command_name);
		return result;
	}
	result = NULL;
	_folks_inspect_command_unref0 (command);
	_g_free0 (subcommand);
	_g_free0 (command_name);
	return result;
}


FolksIndividualAggregator* folks_inspect_client_get_aggregator (FolksInspectClient* self) {
	FolksIndividualAggregator* result;
	FolksIndividualAggregator* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_aggregator;
	result = _tmp0_;
	return result;
}


static void folks_inspect_client_set_aggregator (FolksInspectClient* self, FolksIndividualAggregator* value) {
	FolksIndividualAggregator* _tmp0_;
	FolksIndividualAggregator* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_aggregator);
	self->priv->_aggregator = _tmp1_;
	g_object_notify ((GObject *) self, "aggregator");
}


FolksBackendStore* folks_inspect_client_get_backend_store (FolksInspectClient* self) {
	FolksBackendStore* result;
	FolksBackendStore* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_backend_store;
	result = _tmp0_;
	return result;
}


static void folks_inspect_client_set_backend_store (FolksInspectClient* self, FolksBackendStore* value) {
	FolksBackendStore* _tmp0_;
	FolksBackendStore* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_backend_store);
	self->priv->_backend_store = _tmp1_;
	g_object_notify ((GObject *) self, "backend-store");
}


FolksInspectSignalManager* folks_inspect_client_get_signal_manager (FolksInspectClient* self) {
	FolksInspectSignalManager* result;
	FolksInspectSignalManager* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_signal_manager;
	result = _tmp0_;
	return result;
}


static void folks_inspect_client_set_signal_manager (FolksInspectClient* self, FolksInspectSignalManager* value) {
	FolksInspectSignalManager* _tmp0_;
	FolksInspectSignalManager* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_signal_manager);
	self->priv->_signal_manager = _tmp1_;
	g_object_notify ((GObject *) self, "signal-manager");
}


static void folks_inspect_client_class_init (FolksInspectClientClass * klass) {
	folks_inspect_client_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (FolksInspectClientPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_folks_inspect_client_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_folks_inspect_client_set_property;
	G_OBJECT_CLASS (klass)->finalize = folks_inspect_client_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FOLKS_INSPECT_CLIENT_AGGREGATOR, g_param_spec_object ("aggregator", "aggregator", "aggregator", FOLKS_TYPE_INDIVIDUAL_AGGREGATOR, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FOLKS_INSPECT_CLIENT_BACKEND_STORE, g_param_spec_object ("backend-store", "backend-store", "backend-store", FOLKS_TYPE_BACKEND_STORE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FOLKS_INSPECT_CLIENT_SIGNAL_MANAGER, g_param_spec_object ("signal-manager", "signal-manager", "signal-manager", FOLKS_INSPECT_TYPE_SIGNAL_MANAGER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void folks_inspect_client_instance_init (FolksInspectClient * self) {
	self->priv = FOLKS_INSPECT_CLIENT_GET_PRIVATE (self);
}


static void folks_inspect_client_finalize (GObject* obj) {
	FolksInspectClient * self;
	self = FOLKS_INSPECT_CLIENT (obj);
	_g_object_unref0 (self->commands);
	_g_main_loop_unref0 (self->priv->main_loop);
	_g_object_unref0 (self->priv->_aggregator);
	_g_object_unref0 (self->priv->_backend_store);
	_g_object_unref0 (self->priv->_signal_manager);
	G_OBJECT_CLASS (folks_inspect_client_parent_class)->finalize (obj);
}


GType folks_inspect_client_get_type (void) {
	static volatile gsize folks_inspect_client_type_id__volatile = 0;
	if (g_once_init_enter (&folks_inspect_client_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (FolksInspectClientClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) folks_inspect_client_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FolksInspectClient), 0, (GInstanceInitFunc) folks_inspect_client_instance_init, NULL };
		GType folks_inspect_client_type_id;
		folks_inspect_client_type_id = g_type_register_static (G_TYPE_OBJECT, "FolksInspectClient", &g_define_type_info, 0);
		g_once_init_leave (&folks_inspect_client_type_id__volatile, folks_inspect_client_type_id);
	}
	return folks_inspect_client_type_id__volatile;
}


static void _vala_folks_inspect_client_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	FolksInspectClient * self;
	self = FOLKS_INSPECT_CLIENT (object);
	switch (property_id) {
		case FOLKS_INSPECT_CLIENT_AGGREGATOR:
		g_value_set_object (value, folks_inspect_client_get_aggregator (self));
		break;
		case FOLKS_INSPECT_CLIENT_BACKEND_STORE:
		g_value_set_object (value, folks_inspect_client_get_backend_store (self));
		break;
		case FOLKS_INSPECT_CLIENT_SIGNAL_MANAGER:
		g_value_set_object (value, folks_inspect_client_get_signal_manager (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_folks_inspect_client_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	FolksInspectClient * self;
	self = FOLKS_INSPECT_CLIENT (object);
	switch (property_id) {
		case FOLKS_INSPECT_CLIENT_AGGREGATOR:
		folks_inspect_client_set_aggregator (self, g_value_get_object (value));
		break;
		case FOLKS_INSPECT_CLIENT_BACKEND_STORE:
		folks_inspect_client_set_backend_store (self, g_value_get_object (value));
		break;
		case FOLKS_INSPECT_CLIENT_SIGNAL_MANAGER:
		folks_inspect_client_set_signal_manager (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


FolksInspectCommand* folks_inspect_command_construct (GType object_type, FolksInspectClient* client) {
	FolksInspectCommand* self = NULL;
	FolksInspectClient* _tmp0_;
	FolksInspectClient* _tmp1_;
	g_return_val_if_fail (client != NULL, NULL);
	self = (FolksInspectCommand*) g_type_create_instance (object_type);
	_tmp0_ = client;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->client);
	self->client = _tmp1_;
	return self;
}


static void folks_inspect_command_real_run (FolksInspectCommand* self, const gchar* command_string) {
	g_critical ("Type `%s' does not implement abstract method `folks_inspect_command_run'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}


void folks_inspect_command_run (FolksInspectCommand* self, const gchar* command_string) {
	g_return_if_fail (self != NULL);
	FOLKS_INSPECT_COMMAND_GET_CLASS (self)->run (self, command_string);
}


static gchar** folks_inspect_command_real_complete_subcommand (FolksInspectCommand* self, const gchar* subcommand, int* result_length1) {
	gchar** result = NULL;
	gchar** _tmp0_;
	gint _tmp0__length1;
	g_return_val_if_fail (subcommand != NULL, NULL);
	_tmp0_ = NULL;
	_tmp0__length1 = 0;
	if (result_length1) {
		*result_length1 = _tmp0__length1;
	}
	result = _tmp0_;
	return result;
}


gchar** folks_inspect_command_complete_subcommand (FolksInspectCommand* self, const gchar* subcommand, int* result_length1) {
	g_return_val_if_fail (self != NULL, NULL);
	return FOLKS_INSPECT_COMMAND_GET_CLASS (self)->complete_subcommand (self, subcommand, result_length1);
}


const gchar* folks_inspect_command_get_name (FolksInspectCommand* self) {
	g_return_val_if_fail (self != NULL, NULL);
	return FOLKS_INSPECT_COMMAND_GET_CLASS (self)->get_name (self);
}


const gchar* folks_inspect_command_get_description (FolksInspectCommand* self) {
	g_return_val_if_fail (self != NULL, NULL);
	return FOLKS_INSPECT_COMMAND_GET_CLASS (self)->get_description (self);
}


const gchar* folks_inspect_command_get_help (FolksInspectCommand* self) {
	g_return_val_if_fail (self != NULL, NULL);
	return FOLKS_INSPECT_COMMAND_GET_CLASS (self)->get_help (self);
}


static void folks_inspect_value_command_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void folks_inspect_value_command_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		folks_inspect_command_unref (value->data[0].v_pointer);
	}
}


static void folks_inspect_value_command_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = folks_inspect_command_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer folks_inspect_value_command_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* folks_inspect_value_command_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		FolksInspectCommand* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = folks_inspect_command_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* folks_inspect_value_command_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	FolksInspectCommand** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = folks_inspect_command_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* folks_inspect_param_spec_command (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	FolksInspectParamSpecCommand* spec;
	g_return_val_if_fail (g_type_is_a (object_type, FOLKS_INSPECT_TYPE_COMMAND), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer folks_inspect_value_get_command (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, FOLKS_INSPECT_TYPE_COMMAND), NULL);
	return value->data[0].v_pointer;
}


void folks_inspect_value_set_command (GValue* value, gpointer v_object) {
	FolksInspectCommand* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, FOLKS_INSPECT_TYPE_COMMAND));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, FOLKS_INSPECT_TYPE_COMMAND));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		folks_inspect_command_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		folks_inspect_command_unref (old);
	}
}


void folks_inspect_value_take_command (GValue* value, gpointer v_object) {
	FolksInspectCommand* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, FOLKS_INSPECT_TYPE_COMMAND));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, FOLKS_INSPECT_TYPE_COMMAND));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		folks_inspect_command_unref (old);
	}
}


static void folks_inspect_command_class_init (FolksInspectCommandClass * klass) {
	folks_inspect_command_parent_class = g_type_class_peek_parent (klass);
	FOLKS_INSPECT_COMMAND_CLASS (klass)->finalize = folks_inspect_command_finalize;
	FOLKS_INSPECT_COMMAND_CLASS (klass)->run = folks_inspect_command_real_run;
	FOLKS_INSPECT_COMMAND_CLASS (klass)->complete_subcommand = folks_inspect_command_real_complete_subcommand;
}


static void folks_inspect_command_instance_init (FolksInspectCommand * self) {
	self->ref_count = 1;
}


static void folks_inspect_command_finalize (FolksInspectCommand* obj) {
	FolksInspectCommand * self;
	self = FOLKS_INSPECT_COMMAND (obj);
	_g_object_unref0 (self->client);
}


GType folks_inspect_command_get_type (void) {
	static volatile gsize folks_inspect_command_type_id__volatile = 0;
	if (g_once_init_enter (&folks_inspect_command_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { folks_inspect_value_command_init, folks_inspect_value_command_free_value, folks_inspect_value_command_copy_value, folks_inspect_value_command_peek_pointer, "p", folks_inspect_value_command_collect_value, "p", folks_inspect_value_command_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (FolksInspectCommandClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) folks_inspect_command_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FolksInspectCommand), 0, (GInstanceInitFunc) folks_inspect_command_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType folks_inspect_command_type_id;
		folks_inspect_command_type_id = g_type_register_fundamental (g_type_fundamental_next (), "FolksInspectCommand", &g_define_type_info, &g_define_type_fundamental_info, G_TYPE_FLAG_ABSTRACT);
		g_once_init_leave (&folks_inspect_command_type_id__volatile, folks_inspect_command_type_id);
	}
	return folks_inspect_command_type_id__volatile;
}


gpointer folks_inspect_command_ref (gpointer instance) {
	FolksInspectCommand* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void folks_inspect_command_unref (gpointer instance) {
	FolksInspectCommand* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		FOLKS_INSPECT_COMMAND_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}


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



