Location | Tool | Test ID | Function | Issue |
---|---|---|---|---|
tracker-array-cursor.c:230:7 | gcc | unused-but-set-variable | tracker_bus_array_cursor_real_get_value_type | variable '_tmp1__length1' set but not used |
tracker-array-cursor.c:242:2 | clang-analyzer | Value stored to '_tmp1__length1' is never read | ||
tracker-array-cursor.c:260:7 | gcc | unused-but-set-variable | tracker_bus_array_cursor_real_get_variable_name | variable '_tmp1__length1' set but not used |
tracker-array-cursor.c:272:2 | clang-analyzer | Value stored to '_tmp1__length1' is never read | ||
tracker-array-cursor.c:292:7 | gcc | unused-but-set-variable | tracker_bus_array_cursor_real_get_string | variable '_tmp1__length1' set but not used |
tracker-array-cursor.c:308:2 | clang-analyzer | Value stored to '_tmp1__length1' is never read |
1 /* tracker-array-cursor.c generated by valac 0.18.1, the Vala compiler
2 * generated from tracker-array-cursor.vala, do not modify */
3
4 /*
5 * Copyright (C) 2010, Nokia <ivan.frade@nokia.com>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (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 GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 */
22
23 #include <glib.h>
24 #include <glib-object.h>
25 #include "libtracker-sparql/tracker-sparql.h"
26 #include <stdlib.h>
27 #include <string.h>
28 #include <gio/gio.h>
29
30
31 #define TRACKER_BUS_TYPE_ARRAY_CURSOR (tracker_bus_array_cursor_get_type ())
32 #define TRACKER_BUS_ARRAY_CURSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRACKER_BUS_TYPE_ARRAY_CURSOR, TrackerBusArrayCursor))
33 #define TRACKER_BUS_ARRAY_CURSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRACKER_BUS_TYPE_ARRAY_CURSOR, TrackerBusArrayCursorClass))
34 #define TRACKER_BUS_IS_ARRAY_CURSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRACKER_BUS_TYPE_ARRAY_CURSOR))
35 #define TRACKER_BUS_IS_ARRAY_CURSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRACKER_BUS_TYPE_ARRAY_CURSOR))
36 #define TRACKER_BUS_ARRAY_CURSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRACKER_BUS_TYPE_ARRAY_CURSOR, TrackerBusArrayCursorClass))
37
38 typedef struct _TrackerBusArrayCursor TrackerBusArrayCursor;
39 typedef struct _TrackerBusArrayCursorClass TrackerBusArrayCursorClass;
40 typedef struct _TrackerBusArrayCursorPrivate TrackerBusArrayCursorPrivate;
41 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
42 typedef struct _TrackerBusArrayCursorNextAsyncData TrackerBusArrayCursorNextAsyncData;
43
44 struct _TrackerBusArrayCursor {
45 TrackerSparqlCursor parent_instance;
46 TrackerBusArrayCursorPrivate * priv;
47 };
48
49 struct _TrackerBusArrayCursorClass {
50 TrackerSparqlCursorClass parent_class;
51 };
52
53 struct _TrackerBusArrayCursorPrivate {
54 gint rows;
55 gint current_row;
56 gchar** results;
57 gint results_length1;
58 gint results_length2;
59 gchar** var_names;
60 gint var_names_length1;
61 gint _var_names_size_;
62 TrackerSparqlValueType* types;
63 gint types_length1;
64 gint _types_size_;
65 gint cols;
66 };
67
68 struct _TrackerBusArrayCursorNextAsyncData {
69 int _state_;
70 GObject* _source_object_;
71 GAsyncResult* _res_;
72 GSimpleAsyncResult* _async_result;
73 TrackerBusArrayCursor* self;
74 GCancellable* cancellable;
75 gboolean result;
76 GCancellable* _tmp0_;
77 gboolean _tmp1_;
78 gboolean _tmp2_;
79 GError * _inner_error_;
80 };
81
82
83 static gpointer tracker_bus_array_cursor_parent_class = NULL;
84
85 GType tracker_bus_array_cursor_get_type (void) G_GNUC_CONST;
86 #define TRACKER_BUS_ARRAY_CURSOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_BUS_TYPE_ARRAY_CURSOR, TrackerBusArrayCursorPrivate))
87 enum {
88 TRACKER_BUS_ARRAY_CURSOR_DUMMY_PROPERTY,
89 TRACKER_BUS_ARRAY_CURSOR_N_COLUMNS
90 };
91 TrackerBusArrayCursor* tracker_bus_array_cursor_new (gchar** results, int results_length1, int results_length2, gint rows, gint cols, gchar** var_names, int var_names_length1, TrackerSparqlValueType* types, int types_length1);
92 TrackerBusArrayCursor* tracker_bus_array_cursor_construct (GType object_type, gchar** results, int results_length1, int results_length2, gint rows, gint cols, gchar** var_names, int var_names_length1, TrackerSparqlValueType* types, int types_length1);
93 static TrackerSparqlValueType* _vala_array_dup1 (TrackerSparqlValueType* self, int length);
94 static gchar** _vala_array_dup2 (gchar** self, int length);
95 static TrackerSparqlValueType tracker_bus_array_cursor_real_get_value_type (TrackerSparqlCursor* base, gint column);
96 static const gchar* tracker_bus_array_cursor_real_get_variable_name (TrackerSparqlCursor* base, gint column);
97 static const gchar* tracker_bus_array_cursor_real_get_string (TrackerSparqlCursor* base, gint column, glong* length);
98 static gboolean tracker_bus_array_cursor_real_next (TrackerSparqlCursor* base, GCancellable* cancellable, GError** error);
99 static void tracker_bus_array_cursor_real_next_async_data_free (gpointer _data);
100 static void tracker_bus_array_cursor_real_next_async (TrackerSparqlCursor* base, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
101 static gboolean tracker_bus_array_cursor_real_next_async_co (TrackerBusArrayCursorNextAsyncData* _data_);
102 static void tracker_bus_array_cursor_real_rewind (TrackerSparqlCursor* base);
103 static void tracker_bus_array_cursor_finalize (GObject* obj);
104 static void _vala_tracker_bus_array_cursor_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
105 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
106 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
107
108
109 static TrackerSparqlValueType* _vala_array_dup1 (TrackerSparqlValueType* self, int length) {
110 #line 32 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
111 return g_memdup (self, length * sizeof (TrackerSparqlValueType));
112 #line 113 "tracker-array-cursor.c"
113 }
114
115
116 static gchar** _vala_array_dup2 (gchar** self, int length) {
117 gchar** result;
118 int i;
119 #line 33 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
120 result = g_new0 (gchar*, length + 1);
121 #line 33 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
122 for (i = 0; i < length; i++) {
123 #line 124 "tracker-array-cursor.c"
124 gchar* _tmp0_;
125 #line 33 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
126 _tmp0_ = g_strdup (self[i]);
127 #line 33 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
128 result[i] = _tmp0_;
129 #line 130 "tracker-array-cursor.c"
130 }
131 #line 33 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
132 return result;
133 #line 134 "tracker-array-cursor.c"
134 }
135
136
137 TrackerBusArrayCursor* tracker_bus_array_cursor_construct (GType object_type, gchar** results, int results_length1, int results_length2, gint rows, gint cols, gchar** var_names, int var_names_length1, TrackerSparqlValueType* types, int types_length1) {
138 TrackerBusArrayCursor * self = NULL;
139 gint _tmp0_;
140 gint _tmp1_;
141 gchar** _tmp2_;
142 gint _tmp2__length1;
143 gint _tmp2__length2;
144 TrackerSparqlValueType* _tmp3_;
145 gint _tmp3__length1;
146 TrackerSparqlValueType* _tmp4_;
147 gint _tmp4__length1;
148 gchar** _tmp5_;
149 gint _tmp5__length1;
150 gchar** _tmp6_;
151 gint _tmp6__length1;
152 #line 28 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
153 self = (TrackerBusArrayCursor*) tracker_sparql_cursor_construct (object_type);
154 #line 29 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
155 _tmp0_ = rows;
156 #line 29 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
157 self->priv->rows = _tmp0_;
158 #line 30 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
159 _tmp1_ = cols;
160 #line 30 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
161 self->priv->cols = _tmp1_;
162 #line 31 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
163 _tmp2_ = results;
164 #line 31 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
165 _tmp2__length1 = results_length1;
166 #line 31 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
167 _tmp2__length2 = results_length2;
168 #line 31 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
169 results = NULL;
170 #line 31 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
171 self->priv->results = (_vala_array_free (self->priv->results, self->priv->results_length1 * self->priv->results_length2, (GDestroyNotify) g_free), NULL);
172 #line 31 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
173 self->priv->results = _tmp2_;
174 #line 31 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
175 self->priv->results_length1 = _tmp2__length1;
176 #line 31 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
177 self->priv->results_length2 = _tmp2__length2;
178 #line 32 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
179 _tmp3_ = types;
180 #line 32 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
181 _tmp3__length1 = types_length1;
182 #line 32 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
183 _tmp4_ = (_tmp3_ != NULL) ? _vala_array_dup1 (_tmp3_, _tmp3__length1) : ((gpointer) _tmp3_);
184 #line 32 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
185 _tmp4__length1 = _tmp3__length1;
186 #line 32 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
187 self->priv->types = (g_free (self->priv->types), NULL);
188 #line 32 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
189 self->priv->types = _tmp4_;
190 #line 32 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
191 self->priv->types_length1 = _tmp4__length1;
192 #line 32 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
193 self->priv->_types_size_ = self->priv->types_length1;
194 #line 33 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
195 _tmp5_ = var_names;
196 #line 33 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
197 _tmp5__length1 = var_names_length1;
198 #line 33 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
199 _tmp6_ = (_tmp5_ != NULL) ? _vala_array_dup2 (_tmp5_, _tmp5__length1) : ((gpointer) _tmp5_);
200 #line 33 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
201 _tmp6__length1 = _tmp5__length1;
202 #line 33 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
203 self->priv->var_names = (_vala_array_free (self->priv->var_names, self->priv->var_names_length1, (GDestroyNotify) g_free), NULL);
204 #line 33 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
205 self->priv->var_names = _tmp6_;
206 #line 33 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
207 self->priv->var_names_length1 = _tmp6__length1;
208 #line 33 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
209 self->priv->_var_names_size_ = self->priv->var_names_length1;
210 #line 28 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
211 results = (_vala_array_free (results, results_length1 * results_length2, (GDestroyNotify) g_free), NULL);
212 #line 28 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
213 return self;
214 #line 215 "tracker-array-cursor.c"
215 }
216
217
218 TrackerBusArrayCursor* tracker_bus_array_cursor_new (gchar** results, int results_length1, int results_length2, gint rows, gint cols, gchar** var_names, int var_names_length1, TrackerSparqlValueType* types, int types_length1) {
219 #line 28 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
220 return tracker_bus_array_cursor_construct (TRACKER_BUS_TYPE_ARRAY_CURSOR, results, results_length1, results_length2, rows, cols, var_names, var_names_length1, types, types_length1);
221 #line 222 "tracker-array-cursor.c"
222 }
223
224
225 static TrackerSparqlValueType tracker_bus_array_cursor_real_get_value_type (TrackerSparqlCursor* base, gint column) {
226 TrackerBusArrayCursor * self;
227 TrackerSparqlValueType result = 0;
228 gint _tmp0_;
229 TrackerSparqlValueType* _tmp1_;
230 gint _tmp1__length1;
(emitted by gcc) 231 gint _tmp2_;
232 TrackerSparqlValueType _tmp3_;
233 #line 38 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
234 self = (TrackerBusArrayCursor*) base;
235 #line 38 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
236 _tmp0_ = self->priv->current_row;
237 #line 38 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
238 g_return_val_if_fail (_tmp0_ >= 0, 0);
239 #line 40 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
240 _tmp1_ = self->priv->types;
241 #line 40 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
242 _tmp1__length1 = self->priv->types_length1;
(emitted by clang-analyzer)TODO: a detailed trace is available in the data model (not yet rendered in this report)
243 #line 40 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
244 _tmp2_ = column;
245 #line 40 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
246 _tmp3_ = _tmp1_[_tmp2_];
247 #line 40 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
248 result = _tmp3_;
249 #line 40 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
250 return result;
251 #line 252 "tracker-array-cursor.c"
252 }
253
254
255 static const gchar* tracker_bus_array_cursor_real_get_variable_name (TrackerSparqlCursor* base, gint column) {
256 TrackerBusArrayCursor * self;
257 const gchar* result = NULL;
258 gint _tmp0_;
259 gchar** _tmp1_;
260 gint _tmp1__length1;
(emitted by gcc) 261 gint _tmp2_;
262 const gchar* _tmp3_;
263 #line 43 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
264 self = (TrackerBusArrayCursor*) base;
265 #line 43 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
266 _tmp0_ = self->priv->current_row;
267 #line 43 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
268 g_return_val_if_fail (_tmp0_ >= 0, NULL);
269 #line 45 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
270 _tmp1_ = self->priv->var_names;
271 #line 45 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
272 _tmp1__length1 = self->priv->var_names_length1;
(emitted by clang-analyzer)TODO: a detailed trace is available in the data model (not yet rendered in this report)
273 #line 45 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
274 _tmp2_ = column;
275 #line 45 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
276 _tmp3_ = _tmp1_[_tmp2_];
277 #line 45 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
278 result = _tmp3_;
279 #line 45 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
280 return result;
281 #line 282 "tracker-array-cursor.c"
282 }
283
284
285 static const gchar* tracker_bus_array_cursor_real_get_string (TrackerSparqlCursor* base, gint column, glong* length) {
286 TrackerBusArrayCursor * self;
287 glong _vala_length = 0L;
288 const gchar* result = NULL;
289 gint _tmp0_;
290 const gchar* str = NULL;
291 gchar** _tmp1_;
292 gint _tmp1__length1;
(emitted by gcc) 293 gint _tmp1__length2;
294 gint _tmp2_;
295 gint _tmp3_;
296 const gchar* _tmp4_;
297 gint _tmp5_;
298 gint _tmp6_;
299 #line 48 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
300 self = (TrackerBusArrayCursor*) base;
301 #line 48 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
302 _tmp0_ = self->priv->current_row;
303 #line 48 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
304 g_return_val_if_fail (_tmp0_ >= 0, NULL);
305 #line 52 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
306 _tmp1_ = self->priv->results;
307 #line 52 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
308 _tmp1__length1 = self->priv->results_length1;
(emitted by clang-analyzer)TODO: a detailed trace is available in the data model (not yet rendered in this report)
309 #line 52 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
310 _tmp1__length2 = self->priv->results_length2;
311 #line 52 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
312 _tmp2_ = self->priv->current_row;
313 #line 52 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
314 _tmp3_ = column;
315 #line 52 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
316 _tmp4_ = _tmp1_[(_tmp2_ * _tmp1__length2) + _tmp3_];
317 #line 52 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
318 str = _tmp4_;
319 #line 54 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
320 _tmp5_ = strlen (str);
321 #line 54 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
322 _tmp6_ = _tmp5_;
323 #line 54 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
324 _vala_length = (glong) _tmp6_;
325 #line 56 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
326 result = str;
327 #line 56 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
328 if (length) {
329 #line 56 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
330 *length = _vala_length;
331 #line 332 "tracker-array-cursor.c"
332 }
333 #line 56 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
334 return result;
335 #line 336 "tracker-array-cursor.c"
336 }
337
338
339 static gboolean tracker_bus_array_cursor_real_next (TrackerSparqlCursor* base, GCancellable* cancellable, GError** error) {
340 TrackerBusArrayCursor * self;
341 gboolean result = FALSE;
342 gint _tmp0_;
343 gint _tmp1_;
344 gint _tmp2_;
345 #line 59 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
346 self = (TrackerBusArrayCursor*) base;
347 #line 60 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
348 _tmp0_ = self->priv->current_row;
349 #line 60 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
350 _tmp1_ = self->priv->rows;
351 #line 60 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
352 if (_tmp0_ >= (_tmp1_ - 1)) {
353 #line 61 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
354 result = FALSE;
355 #line 61 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
356 return result;
357 #line 358 "tracker-array-cursor.c"
358 }
359 #line 63 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
360 _tmp2_ = self->priv->current_row;
361 #line 63 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
362 self->priv->current_row = _tmp2_ + 1;
363 #line 64 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
364 result = TRUE;
365 #line 64 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
366 return result;
367 #line 368 "tracker-array-cursor.c"
368 }
369
370
371 static void tracker_bus_array_cursor_real_next_async_data_free (gpointer _data) {
372 TrackerBusArrayCursorNextAsyncData* _data_;
373 _data_ = _data;
374 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
375 _g_object_unref0 (_data_->cancellable);
376 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
377 _g_object_unref0 (_data_->self);
378 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
379 g_slice_free (TrackerBusArrayCursorNextAsyncData, _data_);
380 #line 381 "tracker-array-cursor.c"
381 }
382
383
384 static gpointer _g_object_ref0 (gpointer self) {
385 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
386 return self ? g_object_ref (self) : NULL;
387 #line 388 "tracker-array-cursor.c"
388 }
389
390
391 static void tracker_bus_array_cursor_real_next_async (TrackerSparqlCursor* base, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
392 TrackerBusArrayCursor * self;
393 TrackerBusArrayCursorNextAsyncData* _data_;
394 TrackerBusArrayCursor* _tmp0_;
395 GCancellable* _tmp1_;
396 GCancellable* _tmp2_;
397 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
398 self = (TrackerBusArrayCursor*) base;
399 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
400 _data_ = g_slice_new0 (TrackerBusArrayCursorNextAsyncData);
401 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
402 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_bus_array_cursor_real_next_async);
403 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
404 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_bus_array_cursor_real_next_async_data_free);
405 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
406 _tmp0_ = _g_object_ref0 (self);
407 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
408 _data_->self = _tmp0_;
409 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
410 _tmp1_ = cancellable;
411 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
412 _tmp2_ = _g_object_ref0 (_tmp1_);
413 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
414 _g_object_unref0 (_data_->cancellable);
415 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
416 _data_->cancellable = _tmp2_;
417 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
418 tracker_bus_array_cursor_real_next_async_co (_data_);
419 #line 420 "tracker-array-cursor.c"
420 }
421
422
423 static gboolean tracker_bus_array_cursor_real_next_finish (TrackerSparqlCursor* base, GAsyncResult* _res_, GError** error) {
424 gboolean result;
425 TrackerBusArrayCursorNextAsyncData* _data_;
426 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
427 if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
428 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
429 return FALSE;
430 #line 431 "tracker-array-cursor.c"
431 }
432 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
433 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
434 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
435 result = _data_->result;
436 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
437 return result;
438 #line 439 "tracker-array-cursor.c"
439 }
440
441
442 static gboolean tracker_bus_array_cursor_real_next_async_co (TrackerBusArrayCursorNextAsyncData* _data_) {
443 #line 67 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
444 switch (_data_->_state_) {
445 #line 67 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
446 case 0:
447 #line 448 "tracker-array-cursor.c"
448 goto _state_0;
449 default:
450 #line 67 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
451 g_assert_not_reached ();
452 #line 453 "tracker-array-cursor.c"
453 }
454 _state_0:
455 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
456 _data_->_tmp0_ = _data_->cancellable;
457 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
458 _data_->_tmp1_ = FALSE;
459 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
460 _data_->_tmp1_ = tracker_sparql_cursor_next ((TrackerSparqlCursor*) _data_->self, _data_->_tmp0_, &_data_->_inner_error_);
461 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
462 _data_->_tmp2_ = _data_->_tmp1_;
463 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
464 if (_data_->_inner_error_ != NULL) {
465 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
466 g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
467 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
468 g_error_free (_data_->_inner_error_);
469 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
470 if (_data_->_state_ == 0) {
471 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
472 g_simple_async_result_complete_in_idle (_data_->_async_result);
473 #line 474 "tracker-array-cursor.c"
474 } else {
475 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
476 g_simple_async_result_complete (_data_->_async_result);
477 #line 478 "tracker-array-cursor.c"
478 }
479 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
480 g_object_unref (_data_->_async_result);
481 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
482 return FALSE;
483 #line 484 "tracker-array-cursor.c"
484 }
485 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
486 _data_->result = _data_->_tmp2_;
487 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
488 if (_data_->_state_ == 0) {
489 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
490 g_simple_async_result_complete_in_idle (_data_->_async_result);
491 #line 492 "tracker-array-cursor.c"
492 } else {
493 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
494 g_simple_async_result_complete (_data_->_async_result);
495 #line 496 "tracker-array-cursor.c"
496 }
497 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
498 g_object_unref (_data_->_async_result);
499 #line 69 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
500 return FALSE;
501 #line 67 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
502 if (_data_->_state_ == 0) {
503 #line 67 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
504 g_simple_async_result_complete_in_idle (_data_->_async_result);
505 #line 506 "tracker-array-cursor.c"
506 } else {
507 #line 67 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
508 g_simple_async_result_complete (_data_->_async_result);
509 #line 510 "tracker-array-cursor.c"
510 }
511 #line 67 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
512 g_object_unref (_data_->_async_result);
513 #line 67 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
514 return FALSE;
515 #line 516 "tracker-array-cursor.c"
516 }
517
518
519 static void tracker_bus_array_cursor_real_rewind (TrackerSparqlCursor* base) {
520 TrackerBusArrayCursor * self;
521 #line 72 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
522 self = (TrackerBusArrayCursor*) base;
523 #line 73 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
524 self->priv->current_row = 0;
525 #line 526 "tracker-array-cursor.c"
526 }
527
528
529 static gint tracker_bus_array_cursor_real_get_n_columns (TrackerSparqlCursor* base) {
530 gint result;
531 TrackerBusArrayCursor* self;
532 gint _tmp0_;
533 #line 36 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
534 self = (TrackerBusArrayCursor*) base;
535 #line 36 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
536 _tmp0_ = self->priv->cols;
537 #line 36 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
538 result = _tmp0_;
539 #line 36 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
540 return result;
541 #line 542 "tracker-array-cursor.c"
542 }
543
544
545 static void tracker_bus_array_cursor_class_init (TrackerBusArrayCursorClass * klass) {
546 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
547 tracker_bus_array_cursor_parent_class = g_type_class_peek_parent (klass);
548 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
549 g_type_class_add_private (klass, sizeof (TrackerBusArrayCursorPrivate));
550 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
551 TRACKER_SPARQL_CURSOR_CLASS (klass)->get_value_type = tracker_bus_array_cursor_real_get_value_type;
552 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
553 TRACKER_SPARQL_CURSOR_CLASS (klass)->get_variable_name = tracker_bus_array_cursor_real_get_variable_name;
554 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
555 TRACKER_SPARQL_CURSOR_CLASS (klass)->get_string = tracker_bus_array_cursor_real_get_string;
556 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
557 TRACKER_SPARQL_CURSOR_CLASS (klass)->next = tracker_bus_array_cursor_real_next;
558 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
559 TRACKER_SPARQL_CURSOR_CLASS (klass)->next_async = tracker_bus_array_cursor_real_next_async;
560 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
561 TRACKER_SPARQL_CURSOR_CLASS (klass)->next_finish = tracker_bus_array_cursor_real_next_finish;
562 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
563 TRACKER_SPARQL_CURSOR_CLASS (klass)->rewind = tracker_bus_array_cursor_real_rewind;
564 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
565 TRACKER_SPARQL_CURSOR_CLASS (klass)->get_n_columns = tracker_bus_array_cursor_real_get_n_columns;
566 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
567 G_OBJECT_CLASS (klass)->get_property = _vala_tracker_bus_array_cursor_get_property;
568 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
569 G_OBJECT_CLASS (klass)->finalize = tracker_bus_array_cursor_finalize;
570 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
571 g_object_class_install_property (G_OBJECT_CLASS (klass), TRACKER_BUS_ARRAY_CURSOR_N_COLUMNS, g_param_spec_int ("n-columns", "n-columns", "n-columns", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
572 #line 573 "tracker-array-cursor.c"
573 }
574
575
576 static void tracker_bus_array_cursor_instance_init (TrackerBusArrayCursor * self) {
577 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
578 self->priv = TRACKER_BUS_ARRAY_CURSOR_GET_PRIVATE (self);
579 #line 22 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
580 self->priv->current_row = -1;
581 #line 582 "tracker-array-cursor.c"
582 }
583
584
585 static void tracker_bus_array_cursor_finalize (GObject* obj) {
586 TrackerBusArrayCursor * self;
587 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
588 self = G_TYPE_CHECK_INSTANCE_CAST (obj, TRACKER_BUS_TYPE_ARRAY_CURSOR, TrackerBusArrayCursor);
589 #line 23 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
590 self->priv->results = (_vala_array_free (self->priv->results, self->priv->results_length1 * self->priv->results_length2, (GDestroyNotify) g_free), NULL);
591 #line 24 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
592 self->priv->var_names = (_vala_array_free (self->priv->var_names, self->priv->var_names_length1, (GDestroyNotify) g_free), NULL);
593 #line 25 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
594 self->priv->types = (g_free (self->priv->types), NULL);
595 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
596 G_OBJECT_CLASS (tracker_bus_array_cursor_parent_class)->finalize (obj);
597 #line 598 "tracker-array-cursor.c"
598 }
599
600
601 GType tracker_bus_array_cursor_get_type (void) {
602 static volatile gsize tracker_bus_array_cursor_type_id__volatile = 0;
603 if (g_once_init_enter (&tracker_bus_array_cursor_type_id__volatile)) {
604 static const GTypeInfo g_define_type_info = { sizeof (TrackerBusArrayCursorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tracker_bus_array_cursor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrackerBusArrayCursor), 0, (GInstanceInitFunc) tracker_bus_array_cursor_instance_init, NULL };
605 GType tracker_bus_array_cursor_type_id;
606 tracker_bus_array_cursor_type_id = g_type_register_static (TRACKER_SPARQL_TYPE_CURSOR, "TrackerBusArrayCursor", &g_define_type_info, 0);
607 g_once_init_leave (&tracker_bus_array_cursor_type_id__volatile, tracker_bus_array_cursor_type_id);
608 }
609 return tracker_bus_array_cursor_type_id__volatile;
610 }
611
612
613 static void _vala_tracker_bus_array_cursor_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
614 TrackerBusArrayCursor * self;
615 self = G_TYPE_CHECK_INSTANCE_CAST (object, TRACKER_BUS_TYPE_ARRAY_CURSOR, TrackerBusArrayCursor);
616 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
617 switch (property_id) {
618 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
619 case TRACKER_BUS_ARRAY_CURSOR_N_COLUMNS:
620 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
621 g_value_set_int (value, tracker_sparql_cursor_get_n_columns ((TrackerSparqlCursor*) self));
622 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
623 break;
624 #line 625 "tracker-array-cursor.c"
625 default:
626 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
627 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
628 #line 20 "/home/martyn/Source/tracker/src/libtracker-bus/tracker-array-cursor.vala"
629 break;
630 #line 631 "tracker-array-cursor.c"
631 }
632 }
633
634
635 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
636 if ((array != NULL) && (destroy_func != NULL)) {
637 int i;
638 for (i = 0; i < array_length; i = i + 1) {
639 if (((gpointer*) array)[i] != NULL) {
640 destroy_func (((gpointer*) array)[i]);
641 }
642 }
643 }
644 }
645
646
647 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
648 _vala_array_destroy (array, array_length, destroy_func);
649 g_free (array);
650 }