~ubuntu-branches/ubuntu/quantal/folks/quantal

« back to all changes in this revision

Viewing changes to tools/inspect/command-set.c

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2012-09-12 09:48:10 UTC
  • mfrom: (1.6.2)
  • Revision ID: package-import@ubuntu.com-20120912094810-6zlx8889hcovxj7p
Tags: 0.7.4.1-0ubuntu1
* New upstream bugfix release
* debian/control:
  - Bump build-depends on libglib2.0-dev, valac-0.18, libvala-0.18-dev
* debian/libfolks-eds25.symbols:
* debian/libfolks25.symbols:
  - Updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* command-set.c generated by valac 0.17.6.5-65f99, the Vala compiler
 
2
 * generated from command-set.vala, do not modify */
 
3
 
 
4
/*
 
5
 * Copyright (C) 2012 Jeremy Whiting <jeremy.whiting@collabora.com>
 
6
 *
 
7
 * This library is free software: you can redistribute it and/or modify
 
8
 * it under the terms of the GNU Lesser General Public License as published by
 
9
 * the Free Software Foundation, either version 2.1 of the License, or
 
10
 * (at your option) any later version.
 
11
 *
 
12
 * This library is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU Lesser General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU Lesser General Public License
 
18
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
19
 *
 
20
 * Authors:
 
21
 *       Jeremy Whiting <jeremy.whiting@collabora.com>
 
22
 */
 
23
 
 
24
#include <glib.h>
 
25
#include <glib-object.h>
 
26
#include <gio/gio.h>
 
27
#include <stdlib.h>
 
28
#include <string.h>
 
29
#include <folks/folks.h>
 
30
#include <gee.h>
 
31
#include <stdio.h>
 
32
#include <readline/readline.h>
 
33
 
 
34
 
 
35
#define FOLKS_INSPECT_TYPE_COMMAND (folks_inspect_command_get_type ())
 
36
#define FOLKS_INSPECT_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_INSPECT_TYPE_COMMAND, FolksInspectCommand))
 
37
#define FOLKS_INSPECT_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_INSPECT_TYPE_COMMAND, FolksInspectCommandClass))
 
38
#define FOLKS_INSPECT_IS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_INSPECT_TYPE_COMMAND))
 
39
#define FOLKS_INSPECT_IS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_INSPECT_TYPE_COMMAND))
 
40
#define FOLKS_INSPECT_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_INSPECT_TYPE_COMMAND, FolksInspectCommandClass))
 
41
 
 
42
typedef struct _FolksInspectCommand FolksInspectCommand;
 
43
typedef struct _FolksInspectCommandClass FolksInspectCommandClass;
 
44
typedef struct _FolksInspectCommandPrivate FolksInspectCommandPrivate;
 
45
 
 
46
#define FOLKS_INSPECT_TYPE_CLIENT (folks_inspect_client_get_type ())
 
47
#define FOLKS_INSPECT_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_INSPECT_TYPE_CLIENT, FolksInspectClient))
 
48
#define FOLKS_INSPECT_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_INSPECT_TYPE_CLIENT, FolksInspectClientClass))
 
49
#define FOLKS_INSPECT_IS_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_INSPECT_TYPE_CLIENT))
 
50
#define FOLKS_INSPECT_IS_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_INSPECT_TYPE_CLIENT))
 
51
#define FOLKS_INSPECT_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_INSPECT_TYPE_CLIENT, FolksInspectClientClass))
 
52
 
 
53
typedef struct _FolksInspectClient FolksInspectClient;
 
54
typedef struct _FolksInspectClientClass FolksInspectClientClass;
 
55
 
 
56
#define FOLKS_INSPECT_COMMANDS_TYPE_SET (folks_inspect_commands_set_get_type ())
 
57
#define FOLKS_INSPECT_COMMANDS_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_INSPECT_COMMANDS_TYPE_SET, FolksInspectCommandsSet))
 
58
#define FOLKS_INSPECT_COMMANDS_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_INSPECT_COMMANDS_TYPE_SET, FolksInspectCommandsSetClass))
 
59
#define FOLKS_INSPECT_COMMANDS_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_INSPECT_COMMANDS_TYPE_SET))
 
60
#define FOLKS_INSPECT_COMMANDS_IS_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_INSPECT_COMMANDS_TYPE_SET))
 
61
#define FOLKS_INSPECT_COMMANDS_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_INSPECT_COMMANDS_TYPE_SET, FolksInspectCommandsSetClass))
 
62
 
 
63
typedef struct _FolksInspectCommandsSet FolksInspectCommandsSet;
 
64
typedef struct _FolksInspectCommandsSetClass FolksInspectCommandsSetClass;
 
65
typedef struct _FolksInspectCommandsSetPrivate FolksInspectCommandsSetPrivate;
 
66
#define _g_free0(var) (var = (g_free (var), NULL))
 
67
#define _folks_inspect_command_unref0(var) ((var == NULL) ? NULL : (var = (folks_inspect_command_unref (var), NULL)))
 
68
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
 
69
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
 
70
typedef struct _FolksInspectCommandsSetRunData FolksInspectCommandsSetRunData;
 
71
 
 
72
struct _FolksInspectCommand {
 
73
        GTypeInstance parent_instance;
 
74
        volatile int ref_count;
 
75
        FolksInspectCommandPrivate * priv;
 
76
        FolksInspectClient* client;
 
77
};
 
78
 
 
79
struct _FolksInspectCommandClass {
 
80
        GTypeClass parent_class;
 
81
        void (*finalize) (FolksInspectCommand *self);
 
82
        void (*run) (FolksInspectCommand* self, const gchar* command_string, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
83
        void (*run_finish) (FolksInspectCommand* self, GAsyncResult* _res_);
 
84
        gchar** (*complete_subcommand) (FolksInspectCommand* self, const gchar* subcommand, int* result_length1);
 
85
        const gchar* (*get_name) (FolksInspectCommand* self);
 
86
        const gchar* (*get_description) (FolksInspectCommand* self);
 
87
        const gchar* (*get_help) (FolksInspectCommand* self);
 
88
};
 
89
 
 
90
struct _FolksInspectCommandsSet {
 
91
        FolksInspectCommand parent_instance;
 
92
        FolksInspectCommandsSetPrivate * priv;
 
93
};
 
94
 
 
95
struct _FolksInspectCommandsSetClass {
 
96
        FolksInspectCommandClass parent_class;
 
97
};
 
98
 
 
99
struct _FolksInspectCommandsSetRunData {
 
100
        int _state_;
 
101
        GObject* _source_object_;
 
102
        GAsyncResult* _res_;
 
103
        GSimpleAsyncResult* _async_result;
 
104
        FolksInspectCommandsSet* self;
 
105
        gchar* command_string;
 
106
        gchar** _tmp0_;
 
107
        gchar** parts;
 
108
        gint parts_length1;
 
109
        gint _parts_size_;
 
110
        const gchar* _tmp1_;
 
111
        const gchar* _tmp2_;
 
112
        gchar** _tmp3_;
 
113
        gchar** _tmp4_;
 
114
        gboolean _tmp5_;
 
115
        gchar** _tmp6_;
 
116
        gint _tmp6__length1;
 
117
        gchar** _tmp7_;
 
118
        gint _tmp7__length1;
 
119
        const gchar* _tmp8_;
 
120
        gboolean _tmp9_;
 
121
        const gchar* _tmp10_;
 
122
        gchar** _tmp11_;
 
123
        gint _tmp11__length1;
 
124
        const gchar* _tmp12_;
 
125
        gchar** _tmp13_;
 
126
        gint _tmp13__length1;
 
127
        gboolean _tmp14_;
 
128
        gchar** _tmp15_;
 
129
        gint _tmp15__length1;
 
130
        const gchar* _tmp16_;
 
131
        gchar** _tmp17_;
 
132
        gint _tmp17__length1;
 
133
        const gchar* _tmp18_;
 
134
        gchar* _tmp19_;
 
135
        gchar* _tmp20_;
 
136
        gboolean _tmp21_;
 
137
        gchar** _tmp22_;
 
138
        gint _tmp22__length1;
 
139
        const gchar* _tmp23_;
 
140
        gchar** _tmp24_;
 
141
        gint _tmp24__length1;
 
142
        const gchar* _tmp25_;
 
143
        gchar* _tmp26_;
 
144
        gchar* id;
 
145
        FolksInspectClient* _tmp27_;
 
146
        FolksIndividualAggregator* _tmp28_;
 
147
        FolksIndividualAggregator* _tmp29_;
 
148
        GeeMap* _tmp30_;
 
149
        GeeMap* _tmp31_;
 
150
        const gchar* _tmp32_;
 
151
        gpointer _tmp33_;
 
152
        FolksIndividual* individual;
 
153
        FolksIndividual* _tmp34_;
 
154
        const gchar* _tmp35_;
 
155
        FolksInspectClient* _tmp36_;
 
156
        FolksIndividualAggregator* _tmp37_;
 
157
        FolksIndividualAggregator* _tmp38_;
 
158
        FolksIndividual* _tmp39_;
 
159
        FolksPersona* _tmp40_;
 
160
        FolksPersona* persona;
 
161
        FolksPersona* _tmp41_;
 
162
        FolksIndividual* _tmp42_;
 
163
        FolksIndividual* _tmp43_;
 
164
        gchar** _tmp44_;
 
165
        gint _tmp44__length1;
 
166
        const gchar* _tmp45_;
 
167
        gchar** _tmp46_;
 
168
        gint _tmp46__length1;
 
169
        const gchar* _tmp47_;
 
170
        GError* e;
 
171
        gchar** _tmp48_;
 
172
        gint _tmp48__length1;
 
173
        const gchar* _tmp49_;
 
174
        GError * _inner_error_;
 
175
};
 
176
 
 
177
 
 
178
static gpointer folks_inspect_commands_set_parent_class = NULL;
 
179
static gchar** folks_inspect_commands_set_subcommand_completions;
 
180
static gchar** folks_inspect_commands_set_subcommand_completions = NULL;
 
181
static guint folks_inspect_commands_set_completion_count;
 
182
static guint folks_inspect_commands_set_completion_count = 0U;
 
183
static gchar* folks_inspect_commands_set_prefix;
 
184
static gchar* folks_inspect_commands_set_prefix = NULL;
 
185
 
 
186
gpointer folks_inspect_command_ref (gpointer instance);
 
187
void folks_inspect_command_unref (gpointer instance);
 
188
GParamSpec* folks_inspect_param_spec_command (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
 
189
void folks_inspect_value_set_command (GValue* value, gpointer v_object);
 
190
void folks_inspect_value_take_command (GValue* value, gpointer v_object);
 
191
gpointer folks_inspect_value_get_command (const GValue* value);
 
192
GType folks_inspect_command_get_type (void) G_GNUC_CONST;
 
193
GType folks_inspect_client_get_type (void) G_GNUC_CONST;
 
194
GType folks_inspect_commands_set_get_type (void) G_GNUC_CONST;
 
195
enum  {
 
196
        FOLKS_INSPECT_COMMANDS_SET_DUMMY_PROPERTY
 
197
};
 
198
FolksInspectCommandsSet* folks_inspect_commands_set_new (FolksInspectClient* client);
 
199
FolksInspectCommandsSet* folks_inspect_commands_set_construct (GType object_type, FolksInspectClient* client);
 
200
FolksInspectCommand* folks_inspect_command_construct (GType object_type, FolksInspectClient* client);
 
201
static void folks_inspect_commands_set_real_run_data_free (gpointer _data);
 
202
static void folks_inspect_commands_set_real_run (FolksInspectCommand* base, const gchar* command_string, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
203
static gboolean folks_inspect_commands_set_real_run_co (FolksInspectCommandsSetRunData* _data_);
 
204
void folks_inspect_utils_print_line (const gchar* format, ...);
 
205
FolksIndividualAggregator* folks_inspect_client_get_aggregator (FolksInspectClient* self);
 
206
static void folks_inspect_commands_set_run_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
207
gchar* folks_inspect_commands_set_subcommand_name_completion_cb (const gchar* word, gint state);
 
208
gchar* folks_inspect_utils_individual_id_completion_cb (const gchar* word, gint state);
 
209
static gchar* _folks_inspect_utils_individual_id_completion_cb_rl_compentry_func_t (const gchar* str, gint a);
 
210
static gchar** _vala_array_dup10 (gchar** self, int length);
 
211
static gchar** folks_inspect_commands_set_real_complete_subcommand (FolksInspectCommand* base, const gchar* subcommand, int* result_length1);
 
212
static gchar* _folks_inspect_commands_set_subcommand_name_completion_cb_rl_compentry_func_t (const gchar* str, gint a);
 
213
static gchar** _vala_array_dup11 (gchar** self, int length);
 
214
static void folks_inspect_commands_set_finalize (FolksInspectCommand* obj);
 
215
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
 
216
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
 
217
static gint _vala_array_length (gpointer array);
 
218
 
 
219
 
 
220
FolksInspectCommandsSet* folks_inspect_commands_set_construct (GType object_type, FolksInspectClient* client) {
 
221
        FolksInspectCommandsSet* self = NULL;
 
222
        FolksInspectClient* _tmp0_;
 
223
        g_return_val_if_fail (client != NULL, NULL);
 
224
        _tmp0_ = client;
 
225
        self = (FolksInspectCommandsSet*) folks_inspect_command_construct (object_type, _tmp0_);
 
226
        return self;
 
227
}
 
228
 
 
229
 
 
230
FolksInspectCommandsSet* folks_inspect_commands_set_new (FolksInspectClient* client) {
 
231
        return folks_inspect_commands_set_construct (FOLKS_INSPECT_COMMANDS_TYPE_SET, client);
 
232
}
 
233
 
 
234
 
 
235
static void folks_inspect_commands_set_real_run_data_free (gpointer _data) {
 
236
        FolksInspectCommandsSetRunData* _data_;
 
237
        _data_ = _data;
 
238
        _g_free0 (_data_->command_string);
 
239
        _folks_inspect_command_unref0 (_data_->self);
 
240
        g_slice_free (FolksInspectCommandsSetRunData, _data_);
 
241
}
 
242
 
 
243
 
 
244
static gpointer _folks_inspect_command_ref0 (gpointer self) {
 
245
        return self ? folks_inspect_command_ref (self) : NULL;
 
246
}
 
247
 
 
248
 
 
249
static void folks_inspect_commands_set_real_run (FolksInspectCommand* base, const gchar* command_string, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
250
        FolksInspectCommandsSet * self;
 
251
        FolksInspectCommandsSetRunData* _data_;
 
252
        FolksInspectCommandsSet* _tmp0_;
 
253
        const gchar* _tmp1_;
 
254
        gchar* _tmp2_;
 
255
        self = (FolksInspectCommandsSet*) base;
 
256
        _data_ = g_slice_new0 (FolksInspectCommandsSetRunData);
 
257
        _data_->_async_result = g_simple_async_result_new (g_object_newv (G_TYPE_OBJECT, 0, NULL), _callback_, _user_data_, folks_inspect_commands_set_real_run);
 
258
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, folks_inspect_commands_set_real_run_data_free);
 
259
        _tmp0_ = _folks_inspect_command_ref0 (self);
 
260
        _data_->self = _tmp0_;
 
261
        _tmp1_ = command_string;
 
262
        _tmp2_ = g_strdup (_tmp1_);
 
263
        _g_free0 (_data_->command_string);
 
264
        _data_->command_string = _tmp2_;
 
265
        folks_inspect_commands_set_real_run_co (_data_);
 
266
}
 
267
 
 
268
 
 
269
static void folks_inspect_commands_set_real_run_finish (FolksInspectCommand* base, GAsyncResult* _res_) {
 
270
        FolksInspectCommandsSetRunData* _data_;
 
271
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
272
}
 
273
 
 
274
 
 
275
static gchar* string_strip (const gchar* self) {
 
276
        gchar* result = NULL;
 
277
        gchar* _tmp0_ = NULL;
 
278
        gchar* _result_;
 
279
        const gchar* _tmp1_;
 
280
        g_return_val_if_fail (self != NULL, NULL);
 
281
        _tmp0_ = g_strdup (self);
 
282
        _result_ = _tmp0_;
 
283
        _tmp1_ = _result_;
 
284
        g_strstrip (_tmp1_);
 
285
        result = _result_;
 
286
        return result;
 
287
}
 
288
 
 
289
 
 
290
static void folks_inspect_commands_set_run_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
291
        FolksInspectCommandsSetRunData* _data_;
 
292
        _data_ = _user_data_;
 
293
        _data_->_source_object_ = source_object;
 
294
        _data_->_res_ = _res_;
 
295
        folks_inspect_commands_set_real_run_co (_data_);
 
296
}
 
297
 
 
298
 
 
299
static gboolean folks_inspect_commands_set_real_run_co (FolksInspectCommandsSetRunData* _data_) {
 
300
        switch (_data_->_state_) {
 
301
                case 0:
 
302
                goto _state_0;
 
303
                case 1:
 
304
                goto _state_1;
 
305
                default:
 
306
                g_assert_not_reached ();
 
307
        }
 
308
        _state_0:
 
309
        _data_->_tmp0_ = NULL;
 
310
        _data_->_tmp0_ = g_new0 (gchar*, 0 + 1);
 
311
        _data_->parts = _data_->_tmp0_;
 
312
        _data_->parts_length1 = 0;
 
313
        _data_->_parts_size_ = _data_->parts_length1;
 
314
        _data_->_tmp1_ = _data_->command_string;
 
315
        if (_data_->_tmp1_ != NULL) {
 
316
                _data_->_tmp2_ = _data_->command_string;
 
317
                _data_->_tmp4_ = NULL;
 
318
                _data_->_tmp4_ = _data_->_tmp3_ = g_strsplit (_data_->_tmp2_, " ", 0);
 
319
                _data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
 
320
                _data_->parts = _data_->_tmp4_;
 
321
                _data_->parts_length1 = _vala_array_length (_data_->_tmp3_);
 
322
                _data_->_parts_size_ = _data_->parts_length1;
 
323
        }
 
324
        _data_->_tmp6_ = _data_->parts;
 
325
        _data_->_tmp6__length1 = _data_->parts_length1;
 
326
        if (_data_->_tmp6__length1 < 1) {
 
327
                _data_->_tmp5_ = TRUE;
 
328
        } else {
 
329
                _data_->_tmp7_ = _data_->parts;
 
330
                _data_->_tmp7__length1 = _data_->parts_length1;
 
331
                _data_->_tmp8_ = _data_->_tmp7_[0];
 
332
                _data_->_tmp5_ = g_strcmp0 (_data_->_tmp8_, "alias") != 0;
 
333
        }
 
334
        _data_->_tmp9_ = _data_->_tmp5_;
 
335
        if (_data_->_tmp9_) {
 
336
                _data_->_tmp10_ = _data_->command_string;
 
337
                folks_inspect_utils_print_line ("Unrecognised 'set' command '%s'.", _data_->_tmp10_);
 
338
                _data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
 
339
                if (_data_->_state_ == 0) {
 
340
                        g_simple_async_result_complete_in_idle (_data_->_async_result);
 
341
                } else {
 
342
                        g_simple_async_result_complete (_data_->_async_result);
 
343
                }
 
344
                g_object_unref (_data_->_async_result);
 
345
                return FALSE;
 
346
        }
 
347
        _data_->_tmp11_ = _data_->parts;
 
348
        _data_->_tmp11__length1 = _data_->parts_length1;
 
349
        _data_->_tmp12_ = _data_->_tmp11_[0];
 
350
        if (g_strcmp0 (_data_->_tmp12_, "alias") == 0) {
 
351
                _data_->_tmp13_ = _data_->parts;
 
352
                _data_->_tmp13__length1 = _data_->parts_length1;
 
353
                if (_data_->_tmp13__length1 < 3) {
 
354
                        folks_inspect_utils_print_line ("%s", "Must pass at least one individual ID and a new alias to an " "'alias' subcommand.");
 
355
                        _data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
 
356
                        if (_data_->_state_ == 0) {
 
357
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
358
                        } else {
 
359
                                g_simple_async_result_complete (_data_->_async_result);
 
360
                        }
 
361
                        g_object_unref (_data_->_async_result);
 
362
                        return FALSE;
 
363
                }
 
364
                _data_->_tmp15_ = _data_->parts;
 
365
                _data_->_tmp15__length1 = _data_->parts_length1;
 
366
                _data_->_tmp16_ = _data_->_tmp15_[1];
 
367
                if (_data_->_tmp16_ == NULL) {
 
368
                        _data_->_tmp14_ = TRUE;
 
369
                } else {
 
370
                        _data_->_tmp17_ = _data_->parts;
 
371
                        _data_->_tmp17__length1 = _data_->parts_length1;
 
372
                        _data_->_tmp18_ = _data_->_tmp17_[1];
 
373
                        _data_->_tmp19_ = NULL;
 
374
                        _data_->_tmp19_ = string_strip (_data_->_tmp18_);
 
375
                        _data_->_tmp20_ = _data_->_tmp19_;
 
376
                        _data_->_tmp14_ = g_strcmp0 (_data_->_tmp20_, "") == 0;
 
377
                        _g_free0 (_data_->_tmp20_);
 
378
                }
 
379
                _data_->_tmp21_ = _data_->_tmp14_;
 
380
                if (_data_->_tmp21_) {
 
381
                        _data_->_tmp22_ = _data_->parts;
 
382
                        _data_->_tmp22__length1 = _data_->parts_length1;
 
383
                        _data_->_tmp23_ = _data_->_tmp22_[1];
 
384
                        folks_inspect_utils_print_line ("Unrecognised individual ID '%s'.", _data_->_tmp23_);
 
385
                        _data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
 
386
                        if (_data_->_state_ == 0) {
 
387
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
388
                        } else {
 
389
                                g_simple_async_result_complete (_data_->_async_result);
 
390
                        }
 
391
                        g_object_unref (_data_->_async_result);
 
392
                        return FALSE;
 
393
                }
 
394
                _data_->_tmp24_ = _data_->parts;
 
395
                _data_->_tmp24__length1 = _data_->parts_length1;
 
396
                _data_->_tmp25_ = _data_->_tmp24_[1];
 
397
                _data_->_tmp26_ = NULL;
 
398
                _data_->_tmp26_ = string_strip (_data_->_tmp25_);
 
399
                _data_->id = _data_->_tmp26_;
 
400
                _data_->_tmp27_ = ((FolksInspectCommand*) _data_->self)->client;
 
401
                _data_->_tmp28_ = folks_inspect_client_get_aggregator (_data_->_tmp27_);
 
402
                _data_->_tmp29_ = _data_->_tmp28_;
 
403
                _data_->_tmp30_ = folks_individual_aggregator_get_individuals (_data_->_tmp29_);
 
404
                _data_->_tmp31_ = _data_->_tmp30_;
 
405
                _data_->_tmp32_ = _data_->id;
 
406
                _data_->_tmp33_ = NULL;
 
407
                _data_->_tmp33_ = gee_map_get (_data_->_tmp31_, _data_->_tmp32_);
 
408
                _data_->individual = (FolksIndividual*) _data_->_tmp33_;
 
409
                _data_->_tmp34_ = _data_->individual;
 
410
                if (_data_->_tmp34_ == NULL) {
 
411
                        _data_->_tmp35_ = _data_->id;
 
412
                        folks_inspect_utils_print_line ("Unrecognized individual ID '%s'.", _data_->_tmp35_);
 
413
                        _g_object_unref0 (_data_->individual);
 
414
                        _g_free0 (_data_->id);
 
415
                        _data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
 
416
                        if (_data_->_state_ == 0) {
 
417
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
418
                        } else {
 
419
                                g_simple_async_result_complete (_data_->_async_result);
 
420
                        }
 
421
                        g_object_unref (_data_->_async_result);
 
422
                        return FALSE;
 
423
                }
 
424
                {
 
425
                        _data_->_tmp36_ = ((FolksInspectCommand*) _data_->self)->client;
 
426
                        _data_->_tmp37_ = folks_inspect_client_get_aggregator (_data_->_tmp36_);
 
427
                        _data_->_tmp38_ = _data_->_tmp37_;
 
428
                        _data_->_tmp39_ = _data_->individual;
 
429
                        _data_->_state_ = 1;
 
430
                        folks_individual_aggregator_ensure_individual_property_writeable (_data_->_tmp38_, _data_->_tmp39_, "alias", folks_inspect_commands_set_run_ready, _data_);
 
431
                        return FALSE;
 
432
                        _state_1:
 
433
                        _data_->_tmp40_ = NULL;
 
434
                        _data_->_tmp40_ = folks_individual_aggregator_ensure_individual_property_writeable_finish (_data_->_tmp38_, _data_->_res_, &_data_->_inner_error_);
 
435
                        _data_->persona = _data_->_tmp40_;
 
436
                        if (_data_->_inner_error_ != NULL) {
 
437
                                if (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR) {
 
438
                                        goto __catch2_folks_individual_aggregator_error;
 
439
                                }
 
440
                                _g_object_unref0 (_data_->individual);
 
441
                                _g_free0 (_data_->id);
 
442
                                _data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
 
443
                                g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
444
                                g_clear_error (&_data_->_inner_error_);
 
445
                                return FALSE;
 
446
                        }
 
447
                        _data_->_tmp41_ = _data_->persona;
 
448
                        _data_->_tmp42_ = folks_persona_get_individual (_data_->_tmp41_);
 
449
                        _data_->_tmp43_ = _data_->_tmp42_;
 
450
                        _data_->_tmp44_ = _data_->parts;
 
451
                        _data_->_tmp44__length1 = _data_->parts_length1;
 
452
                        _data_->_tmp45_ = _data_->_tmp44_[2];
 
453
                        folks_alias_details_set_alias ((FolksAliasDetails*) _data_->_tmp43_, _data_->_tmp45_);
 
454
                        _data_->_tmp46_ = _data_->parts;
 
455
                        _data_->_tmp46__length1 = _data_->parts_length1;
 
456
                        _data_->_tmp47_ = _data_->_tmp46_[2];
 
457
                        folks_inspect_utils_print_line ("Setting of individual's alias to '%s' was successful.", _data_->_tmp47_);
 
458
                        _g_object_unref0 (_data_->persona);
 
459
                }
 
460
                goto __finally2;
 
461
                __catch2_folks_individual_aggregator_error:
 
462
                {
 
463
                        _data_->e = _data_->_inner_error_;
 
464
                        _data_->_inner_error_ = NULL;
 
465
                        _data_->_tmp48_ = _data_->parts;
 
466
                        _data_->_tmp48__length1 = _data_->parts_length1;
 
467
                        _data_->_tmp49_ = _data_->_tmp48_[2];
 
468
                        folks_inspect_utils_print_line ("Setting of individual's alias to '%s' failed.", _data_->_tmp49_);
 
469
                        _g_error_free0 (_data_->e);
 
470
                }
 
471
                __finally2:
 
472
                if (_data_->_inner_error_ != NULL) {
 
473
                        _g_object_unref0 (_data_->individual);
 
474
                        _g_free0 (_data_->id);
 
475
                        _data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
 
476
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
477
                        g_clear_error (&_data_->_inner_error_);
 
478
                        return FALSE;
 
479
                }
 
480
                _g_object_unref0 (_data_->individual);
 
481
                _g_free0 (_data_->id);
 
482
                _data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
 
483
                if (_data_->_state_ == 0) {
 
484
                        g_simple_async_result_complete_in_idle (_data_->_async_result);
 
485
                } else {
 
486
                        g_simple_async_result_complete (_data_->_async_result);
 
487
                }
 
488
                g_object_unref (_data_->_async_result);
 
489
                return FALSE;
 
490
        } else {
 
491
                g_assert_not_reached ();
 
492
        }
 
493
        _data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
 
494
        if (_data_->_state_ == 0) {
 
495
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
496
        } else {
 
497
                g_simple_async_result_complete (_data_->_async_result);
 
498
        }
 
499
        g_object_unref (_data_->_async_result);
 
500
        return FALSE;
 
501
}
 
502
 
 
503
 
 
504
static gchar* _folks_inspect_utils_individual_id_completion_cb_rl_compentry_func_t (const gchar* str, gint a) {
 
505
        gchar* result;
 
506
        result = folks_inspect_utils_individual_id_completion_cb (str, a);
 
507
        return result;
 
508
}
 
509
 
 
510
 
 
511
static gchar** _vala_array_dup10 (gchar** self, int length) {
 
512
        gchar** result;
 
513
        int i;
 
514
        result = g_new0 (gchar*, length + 1);
 
515
        for (i = 0; i < length; i++) {
 
516
                gchar* _tmp0_;
 
517
                _tmp0_ = g_strdup (self[i]);
 
518
                result[i] = _tmp0_;
 
519
        }
 
520
        return result;
 
521
}
 
522
 
 
523
 
 
524
static gchar* string_slice (const gchar* self, glong start, glong end) {
 
525
        gchar* result = NULL;
 
526
        gint _tmp0_;
 
527
        gint _tmp1_;
 
528
        glong string_length;
 
529
        glong _tmp2_;
 
530
        glong _tmp5_;
 
531
        gboolean _tmp8_ = FALSE;
 
532
        glong _tmp9_;
 
533
        gboolean _tmp12_;
 
534
        gboolean _tmp13_ = FALSE;
 
535
        glong _tmp14_;
 
536
        gboolean _tmp17_;
 
537
        glong _tmp18_;
 
538
        glong _tmp19_;
 
539
        glong _tmp20_;
 
540
        glong _tmp21_;
 
541
        glong _tmp22_;
 
542
        gchar* _tmp23_ = NULL;
 
543
        g_return_val_if_fail (self != NULL, NULL);
 
544
        _tmp0_ = strlen (self);
 
545
        _tmp1_ = _tmp0_;
 
546
        string_length = (glong) _tmp1_;
 
547
        _tmp2_ = start;
 
548
        if (_tmp2_ < ((glong) 0)) {
 
549
                glong _tmp3_;
 
550
                glong _tmp4_;
 
551
                _tmp3_ = string_length;
 
552
                _tmp4_ = start;
 
553
                start = _tmp3_ + _tmp4_;
 
554
        }
 
555
        _tmp5_ = end;
 
556
        if (_tmp5_ < ((glong) 0)) {
 
557
                glong _tmp6_;
 
558
                glong _tmp7_;
 
559
                _tmp6_ = string_length;
 
560
                _tmp7_ = end;
 
561
                end = _tmp6_ + _tmp7_;
 
562
        }
 
563
        _tmp9_ = start;
 
564
        if (_tmp9_ >= ((glong) 0)) {
 
565
                glong _tmp10_;
 
566
                glong _tmp11_;
 
567
                _tmp10_ = start;
 
568
                _tmp11_ = string_length;
 
569
                _tmp8_ = _tmp10_ <= _tmp11_;
 
570
        } else {
 
571
                _tmp8_ = FALSE;
 
572
        }
 
573
        _tmp12_ = _tmp8_;
 
574
        g_return_val_if_fail (_tmp12_, NULL);
 
575
        _tmp14_ = end;
 
576
        if (_tmp14_ >= ((glong) 0)) {
 
577
                glong _tmp15_;
 
578
                glong _tmp16_;
 
579
                _tmp15_ = end;
 
580
                _tmp16_ = string_length;
 
581
                _tmp13_ = _tmp15_ <= _tmp16_;
 
582
        } else {
 
583
                _tmp13_ = FALSE;
 
584
        }
 
585
        _tmp17_ = _tmp13_;
 
586
        g_return_val_if_fail (_tmp17_, NULL);
 
587
        _tmp18_ = start;
 
588
        _tmp19_ = end;
 
589
        g_return_val_if_fail (_tmp18_ <= _tmp19_, NULL);
 
590
        _tmp20_ = start;
 
591
        _tmp21_ = end;
 
592
        _tmp22_ = start;
 
593
        _tmp23_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) (_tmp21_ - _tmp22_));
 
594
        result = _tmp23_;
 
595
        return result;
 
596
}
 
597
 
 
598
 
 
599
gchar* folks_inspect_commands_set_subcommand_name_completion_cb (const gchar* word, gint state) {
 
600
        gchar* result = NULL;
 
601
        gint _tmp0_;
 
602
        gchar* _tmp49_;
 
603
        g_return_val_if_fail (word != NULL, NULL);
 
604
        _tmp0_ = state;
 
605
        if (_tmp0_ == 0) {
 
606
                const gchar* _tmp1_;
 
607
                gchar** _tmp2_;
 
608
                gchar** _tmp3_ = NULL;
 
609
                gchar** parts;
 
610
                gint parts_length1;
 
611
                gint _parts_size_;
 
612
                gboolean _tmp4_ = FALSE;
 
613
                gchar** _tmp5_;
 
614
                gint _tmp5__length1;
 
615
                gboolean _tmp8_;
 
616
                _tmp1_ = word;
 
617
                _tmp3_ = _tmp2_ = g_strsplit (_tmp1_, " ", 0);
 
618
                parts = _tmp3_;
 
619
                parts_length1 = _vala_array_length (_tmp2_);
 
620
                _parts_size_ = parts_length1;
 
621
                _tmp5_ = parts;
 
622
                _tmp5__length1 = parts_length1;
 
623
                if (_tmp5__length1 > 0) {
 
624
                        gchar** _tmp6_;
 
625
                        gint _tmp6__length1;
 
626
                        const gchar* _tmp7_;
 
627
                        _tmp6_ = parts;
 
628
                        _tmp6__length1 = parts_length1;
 
629
                        _tmp7_ = _tmp6_[0];
 
630
                        _tmp4_ = g_strcmp0 (_tmp7_, "alias") == 0;
 
631
                } else {
 
632
                        _tmp4_ = FALSE;
 
633
                }
 
634
                _tmp8_ = _tmp4_;
 
635
                if (_tmp8_) {
 
636
                        gchar** _tmp9_;
 
637
                        gint _tmp9__length1;
 
638
                        gchar** _tmp10_;
 
639
                        gint _tmp10__length1;
 
640
                        const gchar* _tmp11_;
 
641
                        gchar* _tmp12_;
 
642
                        gchar* last_part;
 
643
                        gchar** _tmp13_;
 
644
                        gint _tmp13__length1;
 
645
                        const gchar* _tmp14_;
 
646
                        const gchar* _tmp19_;
 
647
                        _tmp9_ = parts;
 
648
                        _tmp9__length1 = parts_length1;
 
649
                        _tmp10_ = parts;
 
650
                        _tmp10__length1 = parts_length1;
 
651
                        _tmp11_ = _tmp9_[_tmp10__length1 - 1];
 
652
                        _tmp12_ = g_strdup (_tmp11_);
 
653
                        last_part = _tmp12_;
 
654
                        _tmp13_ = parts;
 
655
                        _tmp13__length1 = parts_length1;
 
656
                        _tmp14_ = _tmp13_[0];
 
657
                        if (g_strcmp0 (_tmp14_, "alias") == 0) {
 
658
                                const gchar* _tmp15_;
 
659
                                gchar** _tmp16_;
 
660
                                gchar** _tmp17_ = NULL;
 
661
                                gchar** _tmp18_;
 
662
                                gint _tmp18__length1;
 
663
                                _tmp15_ = last_part;
 
664
                                _tmp17_ = _tmp16_ = rl_completion_matches (_tmp15_, _folks_inspect_utils_individual_id_completion_cb_rl_compentry_func_t);
 
665
                                _tmp18_ = (_tmp17_ != NULL) ? _vala_array_dup10 (_tmp17_, _vala_array_length (_tmp16_)) : ((gpointer) _tmp17_);
 
666
                                _tmp18__length1 = _vala_array_length (_tmp16_);
 
667
                                folks_inspect_commands_set_subcommand_completions = (_vala_array_free (folks_inspect_commands_set_subcommand_completions, _vala_array_length (folks_inspect_commands_set_subcommand_completions), (GDestroyNotify) g_free), NULL);
 
668
                                folks_inspect_commands_set_subcommand_completions = _tmp18_;
 
669
                        }
 
670
                        _tmp19_ = last_part;
 
671
                        if (g_strcmp0 (_tmp19_, "") == 0) {
 
672
                                const gchar* _tmp20_;
 
673
                                gchar* _tmp21_;
 
674
                                _tmp20_ = word;
 
675
                                _tmp21_ = g_strdup (_tmp20_);
 
676
                                _g_free0 (folks_inspect_commands_set_prefix);
 
677
                                folks_inspect_commands_set_prefix = _tmp21_;
 
678
                        } else {
 
679
                                const gchar* _tmp22_;
 
680
                                const gchar* _tmp23_;
 
681
                                gint _tmp24_;
 
682
                                gint _tmp25_;
 
683
                                gchar* _tmp26_ = NULL;
 
684
                                _tmp22_ = word;
 
685
                                _tmp23_ = last_part;
 
686
                                _tmp24_ = strlen (_tmp23_);
 
687
                                _tmp25_ = _tmp24_;
 
688
                                _tmp26_ = string_slice (_tmp22_, (glong) 0, (glong) (-_tmp25_));
 
689
                                _g_free0 (folks_inspect_commands_set_prefix);
 
690
                                folks_inspect_commands_set_prefix = _tmp26_;
 
691
                        }
 
692
                        _g_free0 (last_part);
 
693
                } else {
 
694
                        gchar* _tmp27_;
 
695
                        gchar** _tmp28_ = NULL;
 
696
                        gchar* _tmp29_;
 
697
                        _tmp27_ = g_strdup ("alias");
 
698
                        _tmp28_ = g_new0 (gchar*, 2 + 1);
 
699
                        _tmp28_[0] = _tmp27_;
 
700
                        _tmp28_[1] = NULL;
 
701
                        folks_inspect_commands_set_subcommand_completions = (_vala_array_free (folks_inspect_commands_set_subcommand_completions, _vala_array_length (folks_inspect_commands_set_subcommand_completions), (GDestroyNotify) g_free), NULL);
 
702
                        folks_inspect_commands_set_subcommand_completions = _tmp28_;
 
703
                        _tmp29_ = g_strdup ("");
 
704
                        _g_free0 (folks_inspect_commands_set_prefix);
 
705
                        folks_inspect_commands_set_prefix = _tmp29_;
 
706
                }
 
707
                folks_inspect_commands_set_completion_count = (guint) 0;
 
708
                parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
 
709
        }
 
710
        while (TRUE) {
 
711
                guint _tmp30_;
 
712
                gchar** _tmp31_;
 
713
                gint _tmp31__length1;
 
714
                gchar** _tmp32_;
 
715
                gint _tmp32__length1;
 
716
                guint _tmp33_;
 
717
                const gchar* _tmp34_;
 
718
                gchar* _tmp35_;
 
719
                gchar* completion;
 
720
                const gchar* _tmp36_;
 
721
                const gchar* _tmp37_;
 
722
                gchar* _tmp38_;
 
723
                gchar* candidate;
 
724
                guint _tmp39_;
 
725
                gboolean _tmp40_ = FALSE;
 
726
                gboolean _tmp41_ = FALSE;
 
727
                const gchar* _tmp42_;
 
728
                gboolean _tmp44_;
 
729
                gboolean _tmp48_;
 
730
                _tmp30_ = folks_inspect_commands_set_completion_count;
 
731
                _tmp31_ = folks_inspect_commands_set_subcommand_completions;
 
732
                _tmp31__length1 = _vala_array_length (folks_inspect_commands_set_subcommand_completions);
 
733
                if (!(_tmp30_ < ((guint) _tmp31__length1))) {
 
734
                        break;
 
735
                }
 
736
                _tmp32_ = folks_inspect_commands_set_subcommand_completions;
 
737
                _tmp32__length1 = _vala_array_length (folks_inspect_commands_set_subcommand_completions);
 
738
                _tmp33_ = folks_inspect_commands_set_completion_count;
 
739
                _tmp34_ = _tmp32_[_tmp33_];
 
740
                _tmp35_ = g_strdup (_tmp34_);
 
741
                completion = _tmp35_;
 
742
                _tmp36_ = folks_inspect_commands_set_prefix;
 
743
                _tmp37_ = completion;
 
744
                _tmp38_ = g_strconcat (_tmp36_, _tmp37_, NULL);
 
745
                candidate = _tmp38_;
 
746
                _tmp39_ = folks_inspect_commands_set_completion_count;
 
747
                folks_inspect_commands_set_completion_count = _tmp39_ + 1;
 
748
                _tmp42_ = completion;
 
749
                if (_tmp42_ != NULL) {
 
750
                        const gchar* _tmp43_;
 
751
                        _tmp43_ = completion;
 
752
                        _tmp41_ = g_strcmp0 (_tmp43_, "") != 0;
 
753
                } else {
 
754
                        _tmp41_ = FALSE;
 
755
                }
 
756
                _tmp44_ = _tmp41_;
 
757
                if (_tmp44_) {
 
758
                        const gchar* _tmp45_;
 
759
                        const gchar* _tmp46_;
 
760
                        gboolean _tmp47_ = FALSE;
 
761
                        _tmp45_ = candidate;
 
762
                        _tmp46_ = word;
 
763
                        _tmp47_ = g_str_has_prefix (_tmp45_, _tmp46_);
 
764
                        _tmp40_ = _tmp47_;
 
765
                } else {
 
766
                        _tmp40_ = FALSE;
 
767
                }
 
768
                _tmp48_ = _tmp40_;
 
769
                if (_tmp48_) {
 
770
                        result = completion;
 
771
                        _g_free0 (candidate);
 
772
                        return result;
 
773
                }
 
774
                _g_free0 (candidate);
 
775
                _g_free0 (completion);
 
776
        }
 
777
        folks_inspect_commands_set_subcommand_completions = (_vala_array_free (folks_inspect_commands_set_subcommand_completions, _vala_array_length (folks_inspect_commands_set_subcommand_completions), (GDestroyNotify) g_free), NULL);
 
778
        folks_inspect_commands_set_subcommand_completions = NULL;
 
779
        folks_inspect_commands_set_completion_count = (guint) 0;
 
780
        _tmp49_ = g_strdup ("");
 
781
        _g_free0 (folks_inspect_commands_set_prefix);
 
782
        folks_inspect_commands_set_prefix = _tmp49_;
 
783
        result = NULL;
 
784
        return result;
 
785
}
 
786
 
 
787
 
 
788
static gchar* _folks_inspect_commands_set_subcommand_name_completion_cb_rl_compentry_func_t (const gchar* str, gint a) {
 
789
        gchar* result;
 
790
        result = folks_inspect_commands_set_subcommand_name_completion_cb (str, a);
 
791
        return result;
 
792
}
 
793
 
 
794
 
 
795
static gchar** _vala_array_dup11 (gchar** self, int length) {
 
796
        gchar** result;
 
797
        int i;
 
798
        result = g_new0 (gchar*, length + 1);
 
799
        for (i = 0; i < length; i++) {
 
800
                gchar* _tmp0_;
 
801
                _tmp0_ = g_strdup (self[i]);
 
802
                result[i] = _tmp0_;
 
803
        }
 
804
        return result;
 
805
}
 
806
 
 
807
 
 
808
static gchar** folks_inspect_commands_set_real_complete_subcommand (FolksInspectCommand* base, const gchar* subcommand, int* result_length1) {
 
809
        FolksInspectCommandsSet * self;
 
810
        gchar** result = NULL;
 
811
        const gchar* _tmp0_;
 
812
        gchar** _tmp1_;
 
813
        gchar** _tmp2_ = NULL;
 
814
        gchar** _tmp3_;
 
815
        gint _tmp3__length1;
 
816
        gchar** _tmp4_;
 
817
        gint _tmp4__length1;
 
818
        self = (FolksInspectCommandsSet*) base;
 
819
        g_return_val_if_fail (subcommand != NULL, NULL);
 
820
        _tmp0_ = subcommand;
 
821
        _tmp2_ = _tmp1_ = rl_completion_matches (_tmp0_, _folks_inspect_commands_set_subcommand_name_completion_cb_rl_compentry_func_t);
 
822
        _tmp3_ = (_tmp2_ != NULL) ? _vala_array_dup11 (_tmp2_, _vala_array_length (_tmp1_)) : ((gpointer) _tmp2_);
 
823
        _tmp3__length1 = _vala_array_length (_tmp1_);
 
824
        _tmp4_ = _tmp3_;
 
825
        _tmp4__length1 = _tmp3__length1;
 
826
        if (result_length1) {
 
827
                *result_length1 = _tmp4__length1;
 
828
        }
 
829
        result = _tmp4_;
 
830
        return result;
 
831
}
 
832
 
 
833
 
 
834
static const gchar* folks_inspect_commands_set_real_get_name (FolksInspectCommand* base) {
 
835
        const gchar* result;
 
836
        FolksInspectCommandsSet* self;
 
837
        self = (FolksInspectCommandsSet*) base;
 
838
        result = "set";
 
839
        return result;
 
840
}
 
841
 
 
842
 
 
843
static const gchar* folks_inspect_commands_set_real_get_description (FolksInspectCommand* base) {
 
844
        const gchar* result;
 
845
        FolksInspectCommandsSet* self;
 
846
        self = (FolksInspectCommandsSet*) base;
 
847
        result = "set an individual's attributes";
 
848
        return result;
 
849
}
 
850
 
 
851
 
 
852
static const gchar* folks_inspect_commands_set_real_get_help (FolksInspectCommand* base) {
 
853
        const gchar* result;
 
854
        FolksInspectCommandsSet* self;
 
855
        self = (FolksInspectCommandsSet*) base;
 
856
        result = "set alias [individual UID] [new alias]" "   Set the alias of the given individual.";
 
857
        return result;
 
858
}
 
859
 
 
860
 
 
861
static void folks_inspect_commands_set_class_init (FolksInspectCommandsSetClass * klass) {
 
862
        folks_inspect_commands_set_parent_class = g_type_class_peek_parent (klass);
 
863
        FOLKS_INSPECT_COMMAND_CLASS (klass)->finalize = folks_inspect_commands_set_finalize;
 
864
        FOLKS_INSPECT_COMMAND_CLASS (klass)->run = folks_inspect_commands_set_real_run;
 
865
        FOLKS_INSPECT_COMMAND_CLASS (klass)->run_finish = folks_inspect_commands_set_real_run_finish;
 
866
        FOLKS_INSPECT_COMMAND_CLASS (klass)->complete_subcommand = folks_inspect_commands_set_real_complete_subcommand;
 
867
        FOLKS_INSPECT_COMMAND_CLASS (klass)->get_name = folks_inspect_commands_set_real_get_name;
 
868
        FOLKS_INSPECT_COMMAND_CLASS (klass)->get_description = folks_inspect_commands_set_real_get_description;
 
869
        FOLKS_INSPECT_COMMAND_CLASS (klass)->get_help = folks_inspect_commands_set_real_get_help;
 
870
}
 
871
 
 
872
 
 
873
static void folks_inspect_commands_set_instance_init (FolksInspectCommandsSet * self) {
 
874
}
 
875
 
 
876
 
 
877
static void folks_inspect_commands_set_finalize (FolksInspectCommand* obj) {
 
878
        FolksInspectCommandsSet * self;
 
879
        self = G_TYPE_CHECK_INSTANCE_CAST (obj, FOLKS_INSPECT_COMMANDS_TYPE_SET, FolksInspectCommandsSet);
 
880
        FOLKS_INSPECT_COMMAND_CLASS (folks_inspect_commands_set_parent_class)->finalize (obj);
 
881
}
 
882
 
 
883
 
 
884
GType folks_inspect_commands_set_get_type (void) {
 
885
        static volatile gsize folks_inspect_commands_set_type_id__volatile = 0;
 
886
        if (g_once_init_enter (&folks_inspect_commands_set_type_id__volatile)) {
 
887
                static const GTypeInfo g_define_type_info = { sizeof (FolksInspectCommandsSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) folks_inspect_commands_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FolksInspectCommandsSet), 0, (GInstanceInitFunc) folks_inspect_commands_set_instance_init, NULL };
 
888
                GType folks_inspect_commands_set_type_id;
 
889
                folks_inspect_commands_set_type_id = g_type_register_static (FOLKS_INSPECT_TYPE_COMMAND, "FolksInspectCommandsSet", &g_define_type_info, 0);
 
890
                g_once_init_leave (&folks_inspect_commands_set_type_id__volatile, folks_inspect_commands_set_type_id);
 
891
        }
 
892
        return folks_inspect_commands_set_type_id__volatile;
 
893
}
 
894
 
 
895
 
 
896
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
 
897
        if ((array != NULL) && (destroy_func != NULL)) {
 
898
                int i;
 
899
                for (i = 0; i < array_length; i = i + 1) {
 
900
                        if (((gpointer*) array)[i] != NULL) {
 
901
                                destroy_func (((gpointer*) array)[i]);
 
902
                        }
 
903
                }
 
904
        }
 
905
}
 
906
 
 
907
 
 
908
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
 
909
        _vala_array_destroy (array, array_length, destroy_func);
 
910
        g_free (array);
 
911
}
 
912
 
 
913
 
 
914
static gint _vala_array_length (gpointer array) {
 
915
        int length;
 
916
        length = 0;
 
917
        if (array) {
 
918
                while (((gpointer*) array)[length]) {
 
919
                        length++;
 
920
                }
 
921
        }
 
922
        return length;
 
923
}
 
924
 
 
925
 
 
926