tracker-0.16.2/src/libtracker-sparql/tracker-connection.c

Location Tool Test ID Function Issue
tracker-connection.c:538:42 gcc unused-but-set-variable tracker_sparql_connection_real_update_finish variable '_data_' set but not used
tracker-connection.c:546:2 clang-analyzer Value stored to '_data_' is never read
tracker-connection.c:1077:40 gcc unused-but-set-variable tracker_sparql_connection_real_load_finish variable '_data_' set but not used
tracker-connection.c:1087:2 clang-analyzer Value stored to '_data_' is never read
   1 /* tracker-connection.c generated by valac 0.18.1, the Vala compiler
   2  * generated from tracker-connection.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  * tracker_sparql_connection_get_finish:
  24  * @_res_: The #GAsyncResult from the callback used to return the #TrackerSparqlConnection
  25  * @error: The error which occurred or %NULL
  26  *
  27  * This function is called from the callback provided for
  28  * tracker_sparql_connection_get_async() to return the connection requested
  29  * or an error in cases of failure.
  30  *
  31  * Returns: a new #TrackerSparqlConnection. Call g_object_unref() on the
  32  * object when no longer used.
  33  *
  34  * Since: 0.10
  35  */
  36 /**
  37  * tracker_sparql_connection_get_direct_finish:
  38  * @_res_: The #GAsyncResult from the callback used to return the #TrackerSparqlConnection
  39  * @error: The error which occurred or %NULL
  40  *
  41  * This function is called from the callback provided for
  42  * tracker_sparql_connection_get_direct_async() to return the connection
  43  * requested or an error in cases of failure.
  44  *
  45  * Returns: a new #TrackerSparqlConnection. Call g_object_unref() on the
  46  * object when no longer used.
  47  *
  48  * Since: 0.10
  49  *
  50  * Deprecated: 0.12: Use tracker_sparql_connection_get_finish instead.
  51  */
  52 /**
  53  * tracker_sparql_connection_query_finish:
  54  * @self: a #TrackerSparqlConnection
  55  * @_res_: a #GAsyncResult with the result of the operation
  56  * @error: #GError for error reporting.
  57  *
  58  * Finishes the asynchronous SPARQL query operation.
  59  *
  60  * Returns: a #TrackerSparqlCursor if results were found, #NULL otherwise.
  61  * On error, #NULL is returned and the @error is set accordingly.
  62  * Call g_object_unref() on the returned cursor when no longer needed.
  63  *
  64  * Since: 0.10
  65  */
  66 /**
  67  * tracker_sparql_connection_update_async:
  68  * @self: a #TrackerSparqlConnection
  69  * @sparql: string containing the SPARQL update query
  70  * @priority: the priority for the asynchronous operation
  71  * @cancellable: a #GCancellable used to cancel the operation
  72  * @_callback_: user-defined #GAsyncReadyCallback to be called when
  73  *              asynchronous operation is finished.
  74  * @_user_data_: user-defined data to be passed to @_callback_
  75  *
  76  * Executes asynchronously a SPARQL update.
  77  *
  78  * Since: 0.10
  79  */
  80 /**
  81  * tracker_sparql_connection_update_array_async:
  82  * @self: a #TrackerSparqlConnection
  83  * @sparql: an array of strings containing the SPARQL update queries
  84  * @sparql_length1: the amount of strings you pass as @sparql
  85  * @priority: the priority for the asynchronous operation
  86  * @cancellable: a #GCancellable used to cancel the operation
  87  * @_callback_: user-defined #GAsyncReadyCallback to be called when
  88  *              asynchronous operation is finished.
  89  * @_user_data_: user-defined data to be passed to @_callback_
  90  *
  91  * Executes asynchronously an array of SPARQL updates. Each update in the
  92  * array is its own transaction. This means that update n+1 is not halted
  93  * due to an error in update n.
  94  *
  95  * Since: 0.10
  96  */
  97 /**
  98  * tracker_sparql_connection_update_blank_async:
  99  * @self: a #TrackerSparqlConnection
 100  * @sparql: string containing the SPARQL update query
 101  * @priority: the priority for the asynchronous operation
 102  * @cancellable: a #GCancellable used to cancel the operation
 103  * @_callback_: user-defined #GAsyncReadyCallback to be called when
 104  *              asynchronous operation is finished.
 105  * @_user_data_: user-defined data to be passed to @_callback_
 106  *
 107  * Executes asynchronously a SPARQL update.
 108  *
 109  * Since: 0.10
 110  */
 111 /**
 112  * tracker_sparql_connection_load_async:
 113  * @self: a #TrackerSparqlConnection
 114  * @file: a #GFile
 115  * @cancellable: a #GCancellable used to cancel the operation
 116  * @_callback_: user-defined #GAsyncReadyCallback to be called when
 117  *              asynchronous operation is finished.
 118  * @_user_data_: user-defined data to be passed to @_callback_
 119  *
 120  * Loads, asynchronously, a Turtle file (TTL) into the store.
 121  *
 122  * Since: 0.10
 123  */
 124 /**
 125  * tracker_sparql_connection_statistics_async:
 126  * @self: a #TrackerSparqlConnection
 127  * @cancellable: a #GCancellable used to cancel the operation
 128  * @_callback_: user-defined #GAsyncReadyCallback to be called when
 129  *              asynchronous operation is finished.
 130  * @_user_data_: user-defined data to be passed to @_callback_
 131  *
 132  * Retrieves, asynchronously, the statistics from the Store.
 133  *
 134  * Since: 0.10
 135  */
 136 
 137 #include <glib.h>
 138 #include <glib-object.h>
 139 #include <stdlib.h>
 140 #include <string.h>
 141 #include <gio/gio.h>
 142 
 143 
 144 #define TRACKER_SPARQL_TYPE_CONNECTION (tracker_sparql_connection_get_type ())
 145 #define TRACKER_SPARQL_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRACKER_SPARQL_TYPE_CONNECTION, TrackerSparqlConnection))
 146 #define TRACKER_SPARQL_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRACKER_SPARQL_TYPE_CONNECTION, TrackerSparqlConnectionClass))
 147 #define TRACKER_SPARQL_IS_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRACKER_SPARQL_TYPE_CONNECTION))
 148 #define TRACKER_SPARQL_IS_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRACKER_SPARQL_TYPE_CONNECTION))
 149 #define TRACKER_SPARQL_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRACKER_SPARQL_TYPE_CONNECTION, TrackerSparqlConnectionClass))
 150 
 151 typedef struct _TrackerSparqlConnection TrackerSparqlConnection;
 152 typedef struct _TrackerSparqlConnectionClass TrackerSparqlConnectionClass;
 153 typedef struct _TrackerSparqlConnectionPrivate TrackerSparqlConnectionPrivate;
 154 
 155 #define TRACKER_SPARQL_TYPE_CURSOR (tracker_sparql_cursor_get_type ())
 156 #define TRACKER_SPARQL_CURSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRACKER_SPARQL_TYPE_CURSOR, TrackerSparqlCursor))
 157 #define TRACKER_SPARQL_CURSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRACKER_SPARQL_TYPE_CURSOR, TrackerSparqlCursorClass))
 158 #define TRACKER_SPARQL_IS_CURSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRACKER_SPARQL_TYPE_CURSOR))
 159 #define TRACKER_SPARQL_IS_CURSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRACKER_SPARQL_TYPE_CURSOR))
 160 #define TRACKER_SPARQL_CURSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRACKER_SPARQL_TYPE_CURSOR, TrackerSparqlCursorClass))
 161 
 162 typedef struct _TrackerSparqlCursor TrackerSparqlCursor;
 163 typedef struct _TrackerSparqlCursorClass TrackerSparqlCursorClass;
 164 #define _g_free0(var) (var = (g_free (var), NULL))
 165 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
 166 typedef struct _TrackerSparqlConnectionUpdateAsyncData TrackerSparqlConnectionUpdateAsyncData;
 167 #define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
 168 typedef struct _TrackerSparqlConnectionUpdateArrayAsyncData TrackerSparqlConnectionUpdateArrayAsyncData;
 169 #define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
 170 typedef struct _TrackerSparqlConnectionUpdateBlankAsyncData TrackerSparqlConnectionUpdateBlankAsyncData;
 171 typedef struct _TrackerSparqlConnectionLoadAsyncData TrackerSparqlConnectionLoadAsyncData;
 172 typedef struct _TrackerSparqlConnectionStatisticsAsyncData TrackerSparqlConnectionStatisticsAsyncData;
 173 
 174 typedef enum  {
 175 	TRACKER_SPARQL_ERROR_PARSE,
 176 	TRACKER_SPARQL_ERROR_UNKNOWN_CLASS,
 177 	TRACKER_SPARQL_ERROR_UNKNOWN_PROPERTY,
 178 	TRACKER_SPARQL_ERROR_TYPE,
 179 	TRACKER_SPARQL_ERROR_CONSTRAINT,
 180 	TRACKER_SPARQL_ERROR_NO_SPACE,
 181 	TRACKER_SPARQL_ERROR_INTERNAL,
 182 	TRACKER_SPARQL_ERROR_UNSUPPORTED
 183 } TrackerSparqlError;
 184 #define TRACKER_SPARQL_ERROR tracker_sparql_error_quark ()
 185 struct _TrackerSparqlConnection {
 186 	GObject parent_instance;
 187 	TrackerSparqlConnectionPrivate * priv;
 188 };
 189 
 190 struct _TrackerSparqlConnectionClass {
 191 	GObjectClass parent_class;
 192 	TrackerSparqlCursor* (*query) (TrackerSparqlConnection* self, const gchar* sparql, GCancellable* cancellable, GError** error);
 193 	void (*query_async) (TrackerSparqlConnection* self, const gchar* sparql, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 194 	TrackerSparqlCursor* (*query_finish) (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error);
 195 	void (*update) (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GError** error);
 196 	void (*update_async) (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 197 	void (*update_finish) (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error);
 198 	void (*update_array_async) (TrackerSparqlConnection* self, gchar** sparql, int sparql_length1, gint priority, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 199 	GPtrArray* (*update_array_finish) (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error);
 200 	GVariant* (*update_blank) (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GError** error);
 201 	void (*update_blank_async) (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 202 	GVariant* (*update_blank_finish) (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error);
 203 	void (*load) (TrackerSparqlConnection* self, GFile* file, GCancellable* cancellable, GError** error);
 204 	void (*load_async) (TrackerSparqlConnection* self, GFile* file, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 205 	void (*load_finish) (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error);
 206 	TrackerSparqlCursor* (*statistics) (TrackerSparqlConnection* self, GCancellable* cancellable, GError** error);
 207 	void (*statistics_async) (TrackerSparqlConnection* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 208 	TrackerSparqlCursor* (*statistics_finish) (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error);
 209 };
 210 
 211 struct _TrackerSparqlConnectionUpdateAsyncData {
 212 	int _state_;
 213 	GObject* _source_object_;
 214 	GAsyncResult* _res_;
 215 	GSimpleAsyncResult* _async_result;
 216 	TrackerSparqlConnection* self;
 217 	gchar* sparql;
 218 	gint priority;
 219 	GCancellable* cancellable;
 220 };
 221 
 222 struct _TrackerSparqlConnectionUpdateArrayAsyncData {
 223 	int _state_;
 224 	GObject* _source_object_;
 225 	GAsyncResult* _res_;
 226 	GSimpleAsyncResult* _async_result;
 227 	TrackerSparqlConnection* self;
 228 	gchar** sparql;
 229 	gint sparql_length1;
 230 	gint priority;
 231 	GCancellable* cancellable;
 232 	GPtrArray* result;
 233 };
 234 
 235 struct _TrackerSparqlConnectionUpdateBlankAsyncData {
 236 	int _state_;
 237 	GObject* _source_object_;
 238 	GAsyncResult* _res_;
 239 	GSimpleAsyncResult* _async_result;
 240 	TrackerSparqlConnection* self;
 241 	gchar* sparql;
 242 	gint priority;
 243 	GCancellable* cancellable;
 244 	GVariant* result;
 245 };
 246 
 247 struct _TrackerSparqlConnectionLoadAsyncData {
 248 	int _state_;
 249 	GObject* _source_object_;
 250 	GAsyncResult* _res_;
 251 	GSimpleAsyncResult* _async_result;
 252 	TrackerSparqlConnection* self;
 253 	GFile* file;
 254 	GCancellable* cancellable;
 255 };
 256 
 257 struct _TrackerSparqlConnectionStatisticsAsyncData {
 258 	int _state_;
 259 	GObject* _source_object_;
 260 	GAsyncResult* _res_;
 261 	GSimpleAsyncResult* _async_result;
 262 	TrackerSparqlConnection* self;
 263 	GCancellable* cancellable;
 264 	TrackerSparqlCursor* result;
 265 };
 266 
 267 
 268 static gpointer tracker_sparql_connection_parent_class = NULL;
 269 
 270 #define TRACKER_DBUS_SERVICE "org.freedesktop.Tracker1"
 271 #define TRACKER_DBUS_INTERFACE_RESOURCES TRACKER_DBUS_SERVICE ".Resources"
 272 #define TRACKER_DBUS_OBJECT_RESOURCES "/org/freedesktop/Tracker1/Resources"
 273 #define TRACKER_DBUS_INTERFACE_STATISTICS TRACKER_DBUS_SERVICE ".Statistics"
 274 #define TRACKER_DBUS_OBJECT_STATISTICS "/org/freedesktop/Tracker1/Statistics"
 275 #define TRACKER_DBUS_INTERFACE_STATUS TRACKER_DBUS_SERVICE ".Status"
 276 #define TRACKER_DBUS_OBJECT_STATUS "/org/freedesktop/Tracker1/Status"
 277 #define TRACKER_DBUS_INTERFACE_STEROIDS TRACKER_DBUS_SERVICE ".Steroids"
 278 #define TRACKER_DBUS_OBJECT_STEROIDS "/org/freedesktop/Tracker1/Steroids"
 279 GQuark tracker_sparql_error_quark (void);
 280 GType tracker_sparql_connection_get_type (void) G_GNUC_CONST;
 281 GType tracker_sparql_cursor_get_type (void) G_GNUC_CONST;
 282 enum  {
 283 	TRACKER_SPARQL_CONNECTION_DUMMY_PROPERTY
 284 };
 285 void tracker_sparql_connection_get_async (GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 286 TrackerSparqlConnection* tracker_sparql_connection_get_finish (GAsyncResult* _res_, GError** error);
 287 TrackerSparqlConnection* tracker_sparql_connection_get (GCancellable* cancellable, GError** error);
 288 void tracker_sparql_connection_get_direct_async (GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 289 TrackerSparqlConnection* tracker_sparql_connection_get_direct_finish (GAsyncResult* _res_, GError** error);
 290 TrackerSparqlConnection* tracker_sparql_connection_get_direct (GCancellable* cancellable, GError** error) G_GNUC_DEPRECATED;
 291 TrackerSparqlCursor* tracker_sparql_connection_query (TrackerSparqlConnection* self, const gchar* sparql, GCancellable* cancellable, GError** error);
 292 static TrackerSparqlCursor* tracker_sparql_connection_real_query (TrackerSparqlConnection* self, const gchar* sparql, GCancellable* cancellable, GError** error);
 293 void tracker_sparql_connection_query_async (TrackerSparqlConnection* self, const gchar* sparql, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 294 TrackerSparqlCursor* tracker_sparql_connection_query_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error);
 295 void tracker_sparql_connection_update (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GError** error);
 296 static void tracker_sparql_connection_real_update (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GError** error);
 297 static void tracker_sparql_connection_real_update_async_data_free (gpointer _data);
 298 static void tracker_sparql_connection_real_update_async (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 299 void tracker_sparql_connection_update_async (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 300 void tracker_sparql_connection_update_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error);
 301 static gboolean tracker_sparql_connection_real_update_async_co (TrackerSparqlConnectionUpdateAsyncData* _data_);
 302 static void tracker_sparql_connection_real_update_array_async_data_free (gpointer _data);
 303 static void tracker_sparql_connection_real_update_array_async (TrackerSparqlConnection* self, gchar** sparql, int sparql_length1, gint priority, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 304 void tracker_sparql_connection_update_array_async (TrackerSparqlConnection* self, gchar** sparql, int sparql_length1, gint priority, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 305 GPtrArray* tracker_sparql_connection_update_array_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error);
 306 static gboolean tracker_sparql_connection_real_update_array_async_co (TrackerSparqlConnectionUpdateArrayAsyncData* _data_);
 307 GVariant* tracker_sparql_connection_update_blank (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GError** error);
 308 static GVariant* tracker_sparql_connection_real_update_blank (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GError** error);
 309 static void tracker_sparql_connection_real_update_blank_async_data_free (gpointer _data);
 310 static void tracker_sparql_connection_real_update_blank_async (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 311 void tracker_sparql_connection_update_blank_async (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 312 GVariant* tracker_sparql_connection_update_blank_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error);
 313 static gboolean tracker_sparql_connection_real_update_blank_async_co (TrackerSparqlConnectionUpdateBlankAsyncData* _data_);
 314 void tracker_sparql_connection_load (TrackerSparqlConnection* self, GFile* file, GCancellable* cancellable, GError** error);
 315 static void tracker_sparql_connection_real_load (TrackerSparqlConnection* self, GFile* file, GCancellable* cancellable, GError** error);
 316 static void tracker_sparql_connection_real_load_async_data_free (gpointer _data);
 317 static void tracker_sparql_connection_real_load_async (TrackerSparqlConnection* self, GFile* file, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 318 void tracker_sparql_connection_load_async (TrackerSparqlConnection* self, GFile* file, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 319 void tracker_sparql_connection_load_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error);
 320 static gboolean tracker_sparql_connection_real_load_async_co (TrackerSparqlConnectionLoadAsyncData* _data_);
 321 TrackerSparqlCursor* tracker_sparql_connection_statistics (TrackerSparqlConnection* self, GCancellable* cancellable, GError** error);
 322 static TrackerSparqlCursor* tracker_sparql_connection_real_statistics (TrackerSparqlConnection* self, GCancellable* cancellable, GError** error);
 323 static void tracker_sparql_connection_real_statistics_async_data_free (gpointer _data);
 324 static void tracker_sparql_connection_real_statistics_async (TrackerSparqlConnection* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 325 void tracker_sparql_connection_statistics_async (TrackerSparqlConnection* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
 326 TrackerSparqlCursor* tracker_sparql_connection_statistics_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error);
 327 static gboolean tracker_sparql_connection_real_statistics_async_co (TrackerSparqlConnectionStatisticsAsyncData* _data_);
 328 TrackerSparqlConnection* tracker_sparql_connection_construct (GType object_type);
 329 
 330 static const GDBusErrorEntry tracker_sparql_error_entries[] = {{TRACKER_SPARQL_ERROR_PARSE, "org.freedesktop.Tracker1.SparqlError.Parse"}, {TRACKER_SPARQL_ERROR_UNKNOWN_CLASS, "org.freedesktop.Tracker1.SparqlError.UnknownClass"}, {TRACKER_SPARQL_ERROR_UNKNOWN_PROPERTY, "org.freedesktop.Tracker1.SparqlError.UnknownProperty"}, {TRACKER_SPARQL_ERROR_TYPE, "org.freedesktop.Tracker1.SparqlError.Type"}, {TRACKER_SPARQL_ERROR_CONSTRAINT, "org.freedesktop.Tracker1.SparqlError.Constraint"}, {TRACKER_SPARQL_ERROR_NO_SPACE, "org.freedesktop.Tracker1.SparqlError.NoSpace"}, {TRACKER_SPARQL_ERROR_INTERNAL, "org.freedesktop.Tracker1.SparqlError.Internal"}, {TRACKER_SPARQL_ERROR_UNSUPPORTED, "org.freedesktop.Tracker1.SparqlError.Unsupported"}};
 331 
 332 GQuark tracker_sparql_error_quark (void) {
 333 	static volatile gsize tracker_sparql_error_quark_volatile = 0;
 334 	g_dbus_error_register_error_domain ("tracker_sparql_error-quark", &tracker_sparql_error_quark_volatile, tracker_sparql_error_entries, G_N_ELEMENTS (tracker_sparql_error_entries));
 335 	return (GQuark) tracker_sparql_error_quark_volatile;
 336 }
 337 
 338 
 339 /**
 340  * tracker_sparql_connection_get:
 341  * @cancellable: a #GCancellable used to cancel the operation
 342  * @error: #GError for error reporting.
 343  *
 344  * This function is used to give the caller a connection to Tracker they can
 345  * use for future requests. The best backend available to connect to
 346  * Tracker is returned. These backends include direct-access (for read-only
 347  * queries) and D-Bus (for both read and write queries).
 348  *
 349  * You can use <link linkend="tracker-overview-environment-variables">
 350  * environment variables</link> to influence how backends are used. If
 351  * no environment variables are provided, both backends are loaded and
 352  * chosen based on their merits. If you try to force a backend for a query
 353  * which it won't support (i.e. an update for a read-only backend), you will
 354  * see critical warnings.
 355  *
 356  * When calling either tracker_sparql_connection_get(),
 357  * tracker_sparql_connection_get_direct() or the asynchronous variants of
 358  * these functions, a mutex is used to protect the loading of backends
 359  * against potential race conditions. For synchronous calls, this function
 360  * will always block if a previous connection get method has been called.
 361  *
 362  * All backends will call the D-Bus tracker-store API Wait() to make sure
 363  * the store and databases are in the right state before any user based
 364  * requests can proceed. There may be a small delay during this call if the
 365  * databases weren't shutdown cleanly and need to be checked on start up. If
 366  * the journal needs to be replayed in such an event, the delay may be
 367  * substantial while data is restored as best as possible.
 368  *
 369  * Returns: a new #TrackerSparqlConnection. Call g_object_unref() on the
 370  * object when no longer used.
 371  *
 372  * Since: 0.10
 373  */
 374 /**
 375  * tracker_sparql_connection_get_direct:
 376  * @cancellable: a #GCancellable used to cancel the operation
 377  * @error: #GError for error reporting.
 378  *
 379  * This behaves the same way tracker_sparql_connection_get() does, however,
 380  * the #TrackerSparqlConnection can only be used for read-only requests.
 381  * The advantage to this API over the tracker_sparql_connection_get()
 382  * function is that it will use direct-access. This is faster than using
 383  * D-Bus which may be the case with tracker_sparql_connection_get().
 384  *
 385  * Returns: a new #TrackerSparqlConnection. Call g_object_unref() on the
 386  * object when no longer used.
 387  *
 388  * Since: 0.10
 389  *
 390  * Deprecated: 0.12: Use tracker_sparql_connection_get instead.
 391  */
 392 /**
 393  * tracker_sparql_connection_query:
 394  * @self: a #TrackerSparqlConnection
 395  * @sparql: string containing the SPARQL query
 396  * @cancellable: a #GCancellable used to cancel the operation
 397  * @error: #GError for error reporting.
 398  *
 399  * Executes a SPARQL query on. The API call is completely synchronous, so
 400  * it may block.
 401  *
 402  * Returns: a #TrackerSparqlCursor if results were found, #NULL otherwise.
 403  * On error, #NULL is returned and the @error is set accordingly.
 404  * Call g_object_unref() on the returned cursor when no longer needed.
 405  *
 406  * Since: 0.10
 407  */
 408 static TrackerSparqlCursor* tracker_sparql_connection_real_query (TrackerSparqlConnection* self, const gchar* sparql, GCancellable* cancellable, GError** error) {
 409 #line 227 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 410 	g_critical ("Type `%s' does not implement abstract method `tracker_sparql_connection_query'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
 411 #line 227 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 412 	return NULL;
 413 #line 414 "tracker-connection.c"
 414 }
 415 
 416 
 417 TrackerSparqlCursor* tracker_sparql_connection_query (TrackerSparqlConnection* self, const gchar* sparql, GCancellable* cancellable, GError** error) {
 418 #line 227 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 419 	g_return_val_if_fail (self != NULL, NULL);
 420 #line 227 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 421 	return TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->query (self, sparql, cancellable, error);
 422 #line 423 "tracker-connection.c"
 423 }
 424 
 425 
 426 void tracker_sparql_connection_query_async (TrackerSparqlConnection* self, const gchar* sparql, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 427 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 428 	TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->query_async (self, sparql, cancellable, _callback_, _user_data_);
 429 #line 430 "tracker-connection.c"
 430 }
 431 
 432 
 433 TrackerSparqlCursor* tracker_sparql_connection_query_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error) {
 434 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 435 	return TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->query_finish (self, _res_, error);
 436 #line 437 "tracker-connection.c"
 437 }
 438 
 439 
 440 /**
 441  * tracker_sparql_connection_update:
 442  * @self: a #TrackerSparqlConnection
 443  * @sparql: string containing the SPARQL update query
 444  * @priority: the priority for the operation
 445  * @cancellable: a #GCancellable used to cancel the operation
 446  * @error: #GError for error reporting.
 447  *
 448  * Executes a SPARQL update. The API call is completely
 449  * synchronous, so it may block.
 450  *
 451  * Since: 0.10
 452  */
 453 static void tracker_sparql_connection_real_update (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GError** error) {
 454 #line 272 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 455 	g_return_if_fail (sparql != NULL);
 456 #line 273 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 457 	g_warning ("tracker-connection.vala:273: Interface 'update' not implemented");
 458 #line 459 "tracker-connection.c"
 459 }
 460 
 461 
 462 void tracker_sparql_connection_update (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GError** error) {
 463 #line 272 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 464 	g_return_if_fail (self != NULL);
 465 #line 272 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 466 	TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->update (self, sparql, priority, cancellable, error);
 467 #line 468 "tracker-connection.c"
 468 }
 469 
 470 
 471 static void tracker_sparql_connection_real_update_async_data_free (gpointer _data) {
 472 	TrackerSparqlConnectionUpdateAsyncData* _data_;
 473 	_data_ = _data;
 474 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 475 	_g_free0 (_data_->sparql);
 476 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 477 	_g_object_unref0 (_data_->cancellable);
 478 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 479 	_g_object_unref0 (_data_->self);
 480 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 481 	g_slice_free (TrackerSparqlConnectionUpdateAsyncData, _data_);
 482 #line 483 "tracker-connection.c"
 483 }
 484 
 485 
 486 static gpointer _g_object_ref0 (gpointer self) {
 487 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 488 	return self ? g_object_ref (self) : NULL;
 489 #line 490 "tracker-connection.c"
 490 }
 491 
 492 
 493 static void tracker_sparql_connection_real_update_async (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 494 	TrackerSparqlConnectionUpdateAsyncData* _data_;
 495 	TrackerSparqlConnection* _tmp0_;
 496 	const gchar* _tmp1_;
 497 	gchar* _tmp2_;
 498 	gint _tmp3_;
 499 	GCancellable* _tmp4_;
 500 	GCancellable* _tmp5_;
 501 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 502 	_data_ = g_slice_new0 (TrackerSparqlConnectionUpdateAsyncData);
 503 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 504 	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_sparql_connection_real_update_async);
 505 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 506 	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_sparql_connection_real_update_async_data_free);
 507 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 508 	_tmp0_ = _g_object_ref0 (self);
 509 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 510 	_data_->self = _tmp0_;
 511 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 512 	_tmp1_ = sparql;
 513 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 514 	_tmp2_ = g_strdup (_tmp1_);
 515 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 516 	_g_free0 (_data_->sparql);
 517 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 518 	_data_->sparql = _tmp2_;
 519 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 520 	_tmp3_ = priority;
 521 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 522 	_data_->priority = _tmp3_;
 523 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 524 	_tmp4_ = cancellable;
 525 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 526 	_tmp5_ = _g_object_ref0 (_tmp4_);
 527 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 528 	_g_object_unref0 (_data_->cancellable);
 529 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 530 	_data_->cancellable = _tmp5_;
 531 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala"
 532 	tracker_sparql_connection_real_update_async_co (_data_);
 533 #line 534 "tracker-connection.c"
 534 }
 535 
 536 
 537 static void tracker_sparql_connection_real_update_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error) {
 538 	TrackerSparqlConnectionUpdateAsyncData* _data_;
variable '_data_' set but not used
(emitted by gcc)
539 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 540 if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) { 541 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 542 return; 543 #line 544 "tracker-connection.c" 544 } 545 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 546 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
Value stored to '_data_' is never read
(emitted by clang-analyzer)

TODO: a detailed trace is available in the data model (not yet rendered in this report)

547 #line 548 "tracker-connection.c" 548 } 549 550 551 /** 552 * tracker_sparql_connection_update_finish: 553 * @self: a #TrackerSparqlConnection 554 * @_res_: a #GAsyncResult with the result of the operation 555 * @error: #GError for error reporting. 556 * 557 * Finishes the asynchronous SPARQL update operation. 558 * 559 * Since: 0.10 560 */ 561 static gboolean tracker_sparql_connection_real_update_async_co (TrackerSparqlConnectionUpdateAsyncData* _data_) { 562 #line 301 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 563 switch (_data_->_state_) { 564 #line 301 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 565 case 0: 566 #line 567 "tracker-connection.c" 567 goto _state_0; 568 default: 569 #line 301 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 570 g_assert_not_reached (); 571 #line 572 "tracker-connection.c" 572 } 573 _state_0: 574 #line 302 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 575 g_warning ("tracker-connection.vala:302: Interface 'update_async' not implemented"); 576 #line 301 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 577 if (_data_->_state_ == 0) { 578 #line 301 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 579 g_simple_async_result_complete_in_idle (_data_->_async_result); 580 #line 581 "tracker-connection.c" 581 } else { 582 #line 301 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 583 g_simple_async_result_complete (_data_->_async_result); 584 #line 585 "tracker-connection.c" 585 } 586 #line 301 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 587 g_object_unref (_data_->_async_result); 588 #line 301 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 589 return FALSE; 590 #line 591 "tracker-connection.c" 591 } 592 593 594 void tracker_sparql_connection_update_async (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) { 595 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 596 TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->update_async (self, sparql, priority, cancellable, _callback_, _user_data_); 597 #line 598 "tracker-connection.c" 598 } 599 600 601 void tracker_sparql_connection_update_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error) { 602 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 603 TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->update_finish (self, _res_, error); 604 #line 605 "tracker-connection.c" 605 } 606 607 608 static void tracker_sparql_connection_real_update_array_async_data_free (gpointer _data) { 609 TrackerSparqlConnectionUpdateArrayAsyncData* _data_; 610 _data_ = _data; 611 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 612 _g_object_unref0 (_data_->cancellable); 613 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 614 _g_ptr_array_unref0 (_data_->result); 615 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 616 _g_object_unref0 (_data_->self); 617 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 618 g_slice_free (TrackerSparqlConnectionUpdateArrayAsyncData, _data_); 619 #line 620 "tracker-connection.c" 620 } 621 622 623 static void tracker_sparql_connection_real_update_array_async (TrackerSparqlConnection* self, gchar** sparql, int sparql_length1, gint priority, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) { 624 TrackerSparqlConnectionUpdateArrayAsyncData* _data_; 625 TrackerSparqlConnection* _tmp0_; 626 gchar** _tmp1_; 627 gint _tmp1__length1; 628 gint _tmp2_; 629 GCancellable* _tmp3_; 630 GCancellable* _tmp4_; 631 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 632 _data_ = g_slice_new0 (TrackerSparqlConnectionUpdateArrayAsyncData); 633 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 634 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_sparql_connection_real_update_array_async); 635 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 636 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_sparql_connection_real_update_array_async_data_free); 637 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 638 _tmp0_ = _g_object_ref0 (self); 639 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 640 _data_->self = _tmp0_; 641 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 642 _tmp1_ = sparql; 643 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 644 _tmp1__length1 = sparql_length1; 645 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 646 _data_->sparql = _tmp1_; 647 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 648 _data_->sparql_length1 = _tmp1__length1; 649 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 650 _tmp2_ = priority; 651 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 652 _data_->priority = _tmp2_; 653 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 654 _tmp3_ = cancellable; 655 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 656 _tmp4_ = _g_object_ref0 (_tmp3_); 657 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 658 _g_object_unref0 (_data_->cancellable); 659 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 660 _data_->cancellable = _tmp4_; 661 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 662 tracker_sparql_connection_real_update_array_async_co (_data_); 663 #line 664 "tracker-connection.c" 664 } 665 666 667 static GPtrArray* tracker_sparql_connection_real_update_array_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error) { 668 GPtrArray* result; 669 TrackerSparqlConnectionUpdateArrayAsyncData* _data_; 670 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 671 if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) { 672 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 673 return NULL; 674 #line 675 "tracker-connection.c" 675 } 676 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 677 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_)); 678 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 679 result = _data_->result; 680 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 681 _data_->result = NULL; 682 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 683 return result; 684 #line 685 "tracker-connection.c" 685 } 686 687 688 /** 689 * tracker_sparql_connection_update_array_finish: 690 * @self: a #TrackerSparqlConnection 691 * @_res_: a #GAsyncResult with the result of the operation 692 * @error: #GError for error reporting. 693 * 694 * Finishes the asynchronous SPARQL update_array operation. 695 * 696 * <example> 697 * <programlisting> 698 * static void 699 * async_update_array_callback (GObject *source_object, 700 * GAsyncResult *result, 701 * gpointer user_data) 702 * { 703 * GError *error = NULL; 704 * GPtrArray *errors; 705 * guint i; 706 * 707 * errors = tracker_sparql_connection_update_array_finish (connection, result, &error); 708 * g_assert_no_error (error); 709 * 710 * for (i = 0; i < errors->len; i++) { 711 * const GError *e = g_ptr_array_index (errors, i); 712 * 713 * ... 714 * } 715 * 716 * g_ptr_array_unref (errors); 717 * } 718 * </programlisting> 719 * </example> 720 * 721 * Returns: a #GPtrArray of size @sparql_length1 with elements that are 722 * either NULL or a GError instance. The returned array should be freed with 723 * g_ptr_array_unref when no longer used, not with g_ptr_array_free. When 724 * you use errors of the array, you must g_error_copy them. Errors inside of 725 * the array must be considered as const data and not freed. The index of 726 * the error corresponds to the index of the update query in the array that 727 * you passed to tracker_sparql_connection_update_array_async. 728 * 729 * Since: 0.10 730 */ 731 static gboolean tracker_sparql_connection_real_update_array_async_co (TrackerSparqlConnectionUpdateArrayAsyncData* _data_) { 732 #line 366 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 733 switch (_data_->_state_) { 734 #line 366 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 735 case 0: 736 #line 737 "tracker-connection.c" 737 goto _state_0; 738 default: 739 #line 366 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 740 g_assert_not_reached (); 741 #line 742 "tracker-connection.c" 742 } 743 _state_0: 744 #line 367 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 745 g_warning ("tracker-connection.vala:367: Interface 'update_array_async' not implem" \ 746 "ented"); 747 #line 368 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 748 _data_->result = NULL; 749 #line 368 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 750 if (_data_->_state_ == 0) { 751 #line 368 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 752 g_simple_async_result_complete_in_idle (_data_->_async_result); 753 #line 753 "tracker-connection.c" 754 } else { 755 #line 368 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 756 g_simple_async_result_complete (_data_->_async_result); 757 #line 757 "tracker-connection.c" 758 } 759 #line 368 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 760 g_object_unref (_data_->_async_result); 761 #line 368 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 762 return FALSE; 763 #line 366 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 764 if (_data_->_state_ == 0) { 765 #line 366 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 766 g_simple_async_result_complete_in_idle (_data_->_async_result); 767 #line 767 "tracker-connection.c" 768 } else { 769 #line 366 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 770 g_simple_async_result_complete (_data_->_async_result); 771 #line 771 "tracker-connection.c" 772 } 773 #line 366 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 774 g_object_unref (_data_->_async_result); 775 #line 366 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 776 return FALSE; 777 #line 777 "tracker-connection.c" 778 } 779 780 781 void tracker_sparql_connection_update_array_async (TrackerSparqlConnection* self, gchar** sparql, int sparql_length1, gint priority, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) { 782 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 783 TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->update_array_async (self, sparql, sparql_length1, priority, cancellable, _callback_, _user_data_); 784 #line 784 "tracker-connection.c" 785 } 786 787 788 GPtrArray* tracker_sparql_connection_update_array_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error) { 789 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 790 return TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->update_array_finish (self, _res_, error); 791 #line 791 "tracker-connection.c" 792 } 793 794 795 /** 796 * tracker_sparql_connection_update_blank: 797 * @self: a #TrackerSparqlConnection 798 * @sparql: string containing the SPARQL update query 799 * @priority: the priority for the operation 800 * @cancellable: a #GCancellable used to cancel the operation 801 * @error: #GError for error reporting. 802 * 803 * Executes a SPARQL update and returns the URNs of the generated nodes, 804 * if any. The API call is completely synchronous, so it may block. 805 * 806 * Returns: a #GVariant with the generated URNs, which should be freed with 807 * g_variant_unref() when no longer used. 808 * 809 * Since: 0.10 810 */ 811 static GVariant* tracker_sparql_connection_real_update_blank (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GError** error) { 812 GVariant* result = NULL; 813 #line 387 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 814 g_return_val_if_fail (sparql != NULL, NULL); 815 #line 388 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 816 g_warning ("tracker-connection.vala:388: Interface 'update_blank' not implemented"); 817 #line 389 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 818 result = NULL; 819 #line 389 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 820 return result; 821 #line 821 "tracker-connection.c" 822 } 823 824 825 GVariant* tracker_sparql_connection_update_blank (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GError** error) { 826 #line 387 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 827 g_return_val_if_fail (self != NULL, NULL); 828 #line 387 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 829 return TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->update_blank (self, sparql, priority, cancellable, error); 830 #line 830 "tracker-connection.c" 831 } 832 833 834 static void tracker_sparql_connection_real_update_blank_async_data_free (gpointer _data) { 835 TrackerSparqlConnectionUpdateBlankAsyncData* _data_; 836 _data_ = _data; 837 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 838 _g_free0 (_data_->sparql); 839 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 840 _g_object_unref0 (_data_->cancellable); 841 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 842 _g_variant_unref0 (_data_->result); 843 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 844 _g_object_unref0 (_data_->self); 845 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 846 g_slice_free (TrackerSparqlConnectionUpdateBlankAsyncData, _data_); 847 #line 847 "tracker-connection.c" 848 } 849 850 851 static void tracker_sparql_connection_real_update_blank_async (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) { 852 TrackerSparqlConnectionUpdateBlankAsyncData* _data_; 853 TrackerSparqlConnection* _tmp0_; 854 const gchar* _tmp1_; 855 gchar* _tmp2_; 856 gint _tmp3_; 857 GCancellable* _tmp4_; 858 GCancellable* _tmp5_; 859 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 860 _data_ = g_slice_new0 (TrackerSparqlConnectionUpdateBlankAsyncData); 861 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 862 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_sparql_connection_real_update_blank_async); 863 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 864 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_sparql_connection_real_update_blank_async_data_free); 865 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 866 _tmp0_ = _g_object_ref0 (self); 867 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 868 _data_->self = _tmp0_; 869 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 870 _tmp1_ = sparql; 871 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 872 _tmp2_ = g_strdup (_tmp1_); 873 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 874 _g_free0 (_data_->sparql); 875 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 876 _data_->sparql = _tmp2_; 877 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 878 _tmp3_ = priority; 879 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 880 _data_->priority = _tmp3_; 881 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 882 _tmp4_ = cancellable; 883 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 884 _tmp5_ = _g_object_ref0 (_tmp4_); 885 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 886 _g_object_unref0 (_data_->cancellable); 887 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 888 _data_->cancellable = _tmp5_; 889 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 890 tracker_sparql_connection_real_update_blank_async_co (_data_); 891 #line 891 "tracker-connection.c" 892 } 893 894 895 static GVariant* tracker_sparql_connection_real_update_blank_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error) { 896 GVariant* result; 897 TrackerSparqlConnectionUpdateBlankAsyncData* _data_; 898 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 899 if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) { 900 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 901 return NULL; 902 #line 902 "tracker-connection.c" 903 } 904 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 905 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_)); 906 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 907 result = _data_->result; 908 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 909 _data_->result = NULL; 910 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 911 return result; 912 #line 912 "tracker-connection.c" 913 } 914 915 916 /** 917 * tracker_sparql_connection_update_blank_finish: 918 * @self: a #TrackerSparqlConnection 919 * @_res_: a #GAsyncResult with the result of the operation 920 * @error: #GError for error reporting. 921 * 922 * Finishes the asynchronous SPARQL update operation, and returns 923 * the URNs of the generated nodes, if any. 924 * 925 * Returns: a #GVariant with the generated URNs, which should be freed with 926 * g_variant_unref() when no longer used. 927 * 928 * Since: 0.10 929 */ 930 static gboolean tracker_sparql_connection_real_update_blank_async_co (TrackerSparqlConnectionUpdateBlankAsyncData* _data_) { 931 #line 421 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 932 switch (_data_->_state_) { 933 #line 421 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 934 case 0: 935 #line 935 "tracker-connection.c" 936 goto _state_0; 937 default: 938 #line 421 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 939 g_assert_not_reached (); 940 #line 940 "tracker-connection.c" 941 } 942 _state_0: 943 #line 422 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 944 g_warning ("tracker-connection.vala:422: Interface 'update_blank_async' not implem" \ 945 "ented"); 946 #line 423 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 947 _data_->result = NULL; 948 #line 423 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 949 if (_data_->_state_ == 0) { 950 #line 423 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 951 g_simple_async_result_complete_in_idle (_data_->_async_result); 952 #line 951 "tracker-connection.c" 953 } else { 954 #line 423 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 955 g_simple_async_result_complete (_data_->_async_result); 956 #line 955 "tracker-connection.c" 957 } 958 #line 423 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 959 g_object_unref (_data_->_async_result); 960 #line 423 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 961 return FALSE; 962 #line 421 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 963 if (_data_->_state_ == 0) { 964 #line 421 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 965 g_simple_async_result_complete_in_idle (_data_->_async_result); 966 #line 965 "tracker-connection.c" 967 } else { 968 #line 421 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 969 g_simple_async_result_complete (_data_->_async_result); 970 #line 969 "tracker-connection.c" 971 } 972 #line 421 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 973 g_object_unref (_data_->_async_result); 974 #line 421 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 975 return FALSE; 976 #line 975 "tracker-connection.c" 977 } 978 979 980 void tracker_sparql_connection_update_blank_async (TrackerSparqlConnection* self, const gchar* sparql, gint priority, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) { 981 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 982 TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->update_blank_async (self, sparql, priority, cancellable, _callback_, _user_data_); 983 #line 982 "tracker-connection.c" 984 } 985 986 987 GVariant* tracker_sparql_connection_update_blank_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error) { 988 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 989 return TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->update_blank_finish (self, _res_, error); 990 #line 989 "tracker-connection.c" 991 } 992 993 994 /** 995 * tracker_sparql_connection_load: 996 * @self: a #TrackerSparqlConnection 997 * @file: a #GFile 998 * @cancellable: a #GCancellable used to cancel the operation 999 * @error: #GError for error reporting. 1000 * 1001 * Loads a Turtle file (TTL) into the store. The API call is completely 1002 * synchronous, so it may block. 1003 * 1004 * Since: 0.10 1005 */ 1006 static void tracker_sparql_connection_real_load (TrackerSparqlConnection* self, GFile* file, GCancellable* cancellable, GError** error) { 1007 #line 438 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1008 g_return_if_fail (file != NULL); 1009 #line 439 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1010 g_warning ("tracker-connection.vala:439: Interface 'load' not implemented"); 1011 #line 1010 "tracker-connection.c" 1012 } 1013 1014 1015 void tracker_sparql_connection_load (TrackerSparqlConnection* self, GFile* file, GCancellable* cancellable, GError** error) { 1016 #line 438 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1017 g_return_if_fail (self != NULL); 1018 #line 438 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1019 TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->load (self, file, cancellable, error); 1020 #line 1019 "tracker-connection.c" 1021 } 1022 1023 1024 static void tracker_sparql_connection_real_load_async_data_free (gpointer _data) { 1025 TrackerSparqlConnectionLoadAsyncData* _data_; 1026 _data_ = _data; 1027 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1028 _g_object_unref0 (_data_->file); 1029 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1030 _g_object_unref0 (_data_->cancellable); 1031 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1032 _g_object_unref0 (_data_->self); 1033 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1034 g_slice_free (TrackerSparqlConnectionLoadAsyncData, _data_); 1035 #line 1034 "tracker-connection.c" 1036 } 1037 1038 1039 static void tracker_sparql_connection_real_load_async (TrackerSparqlConnection* self, GFile* file, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) { 1040 TrackerSparqlConnectionLoadAsyncData* _data_; 1041 TrackerSparqlConnection* _tmp0_; 1042 GFile* _tmp1_; 1043 GFile* _tmp2_; 1044 GCancellable* _tmp3_; 1045 GCancellable* _tmp4_; 1046 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1047 _data_ = g_slice_new0 (TrackerSparqlConnectionLoadAsyncData); 1048 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1049 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_sparql_connection_real_load_async); 1050 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1051 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_sparql_connection_real_load_async_data_free); 1052 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1053 _tmp0_ = _g_object_ref0 (self); 1054 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1055 _data_->self = _tmp0_; 1056 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1057 _tmp1_ = file; 1058 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1059 _tmp2_ = _g_object_ref0 (_tmp1_); 1060 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1061 _g_object_unref0 (_data_->file); 1062 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1063 _data_->file = _tmp2_; 1064 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1065 _tmp3_ = cancellable; 1066 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1067 _tmp4_ = _g_object_ref0 (_tmp3_); 1068 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1069 _g_object_unref0 (_data_->cancellable); 1070 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1071 _data_->cancellable = _tmp4_; 1072 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1073 tracker_sparql_connection_real_load_async_co (_data_); 1074 #line 1073 "tracker-connection.c" 1075 } 1076 1077
variable '_data_' set but not used
(emitted by gcc)
1078 static void tracker_sparql_connection_real_load_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error) { 1079 TrackerSparqlConnectionLoadAsyncData* _data_; 1080 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1081 if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) { 1082 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1083 return; 1084 #line 1083 "tracker-connection.c" 1085 } 1086 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1087 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
Value stored to '_data_' is never read
(emitted by clang-analyzer)

TODO: a detailed trace is available in the data model (not yet rendered in this report)

1088 #line 1087 "tracker-connection.c" 1089 } 1090 1091 1092 /** 1093 * tracker_sparql_connection_load_finish: 1094 * @self: a #TrackerSparqlConnection 1095 * @_res_: a #GAsyncResult with the result of the operation 1096 * @error: #GError for error reporting. 1097 * 1098 * Finishes the asynchronous load of the Turtle file. 1099 * 1100 * Since: 0.10 1101 */ 1102 static gboolean tracker_sparql_connection_real_load_async_co (TrackerSparqlConnectionLoadAsyncData* _data_) { 1103 #line 466 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1104 switch (_data_->_state_) { 1105 #line 466 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1106 case 0: 1107 #line 1106 "tracker-connection.c" 1108 goto _state_0; 1109 default: 1110 #line 466 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1111 g_assert_not_reached (); 1112 #line 1111 "tracker-connection.c" 1113 } 1114 _state_0: 1115 #line 467 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1116 g_warning ("tracker-connection.vala:467: Interface 'load_async' not implemented"); 1117 #line 466 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1118 if (_data_->_state_ == 0) { 1119 #line 466 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1120 g_simple_async_result_complete_in_idle (_data_->_async_result); 1121 #line 1120 "tracker-connection.c" 1122 } else { 1123 #line 466 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1124 g_simple_async_result_complete (_data_->_async_result); 1125 #line 1124 "tracker-connection.c" 1126 } 1127 #line 466 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1128 g_object_unref (_data_->_async_result); 1129 #line 466 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1130 return FALSE; 1131 #line 1130 "tracker-connection.c" 1132 } 1133 1134 1135 void tracker_sparql_connection_load_async (TrackerSparqlConnection* self, GFile* file, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) { 1136 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1137 TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->load_async (self, file, cancellable, _callback_, _user_data_); 1138 #line 1137 "tracker-connection.c" 1139 } 1140 1141 1142 void tracker_sparql_connection_load_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error) { 1143 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1144 TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->load_finish (self, _res_, error); 1145 #line 1144 "tracker-connection.c" 1146 } 1147 1148 1149 /** 1150 * tracker_sparql_connection_statistics: 1151 * @self: a #TrackerSparqlConnection 1152 * @cancellable: a #GCancellable used to cancel the operation 1153 * @error: #GError for error reporting. 1154 * 1155 * Retrieves the statistics from the Store. The API call is completely 1156 * synchronous, so it may block. 1157 * 1158 * Returns: a #TrackerSparqlCursor to iterate the reply if successful, #NULL 1159 * on error. Call g_object_unref() on the returned cursor when no longer 1160 * needed. 1161 * 1162 * Since: 0.10 1163 */ 1164 static TrackerSparqlCursor* tracker_sparql_connection_real_statistics (TrackerSparqlConnection* self, GCancellable* cancellable, GError** error) { 1165 TrackerSparqlCursor* result = NULL; 1166 #line 486 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1167 g_warning ("tracker-connection.vala:486: Interface 'statistics' not implemented"); 1168 #line 487 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1169 result = NULL; 1170 #line 487 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1171 return result; 1172 #line 1171 "tracker-connection.c" 1173 } 1174 1175 1176 TrackerSparqlCursor* tracker_sparql_connection_statistics (TrackerSparqlConnection* self, GCancellable* cancellable, GError** error) { 1177 #line 485 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1178 g_return_val_if_fail (self != NULL, NULL); 1179 #line 485 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1180 return TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->statistics (self, cancellable, error); 1181 #line 1180 "tracker-connection.c" 1182 } 1183 1184 1185 static void tracker_sparql_connection_real_statistics_async_data_free (gpointer _data) { 1186 TrackerSparqlConnectionStatisticsAsyncData* _data_; 1187 _data_ = _data; 1188 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1189 _g_object_unref0 (_data_->cancellable); 1190 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1191 _g_object_unref0 (_data_->result); 1192 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1193 _g_object_unref0 (_data_->self); 1194 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1195 g_slice_free (TrackerSparqlConnectionStatisticsAsyncData, _data_); 1196 #line 1195 "tracker-connection.c" 1197 } 1198 1199 1200 static void tracker_sparql_connection_real_statistics_async (TrackerSparqlConnection* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) { 1201 TrackerSparqlConnectionStatisticsAsyncData* _data_; 1202 TrackerSparqlConnection* _tmp0_; 1203 GCancellable* _tmp1_; 1204 GCancellable* _tmp2_; 1205 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1206 _data_ = g_slice_new0 (TrackerSparqlConnectionStatisticsAsyncData); 1207 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1208 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_sparql_connection_real_statistics_async); 1209 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1210 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_sparql_connection_real_statistics_async_data_free); 1211 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1212 _tmp0_ = _g_object_ref0 (self); 1213 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1214 _data_->self = _tmp0_; 1215 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1216 _tmp1_ = cancellable; 1217 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1218 _tmp2_ = _g_object_ref0 (_tmp1_); 1219 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1220 _g_object_unref0 (_data_->cancellable); 1221 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1222 _data_->cancellable = _tmp2_; 1223 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1224 tracker_sparql_connection_real_statistics_async_co (_data_); 1225 #line 1224 "tracker-connection.c" 1226 } 1227 1228 1229 static TrackerSparqlCursor* tracker_sparql_connection_real_statistics_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error) { 1230 TrackerSparqlCursor* result; 1231 TrackerSparqlConnectionStatisticsAsyncData* _data_; 1232 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1233 if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) { 1234 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1235 return NULL; 1236 #line 1235 "tracker-connection.c" 1237 } 1238 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1239 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_)); 1240 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1241 result = _data_->result; 1242 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1243 _data_->result = NULL; 1244 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1245 return result; 1246 #line 1245 "tracker-connection.c" 1247 } 1248 1249 1250 /** 1251 * tracker_sparql_connection_statistics_finish: 1252 * @self: a #TrackerSparqlConnection 1253 * @_res_: a #GAsyncResult with the result of the operation 1254 * @error: #GError for error reporting. 1255 * 1256 * Finishes the asynchronous retrieval of statistics from the Store. 1257 * 1258 * Returns: a #TrackerSparqlCursor to iterate the reply if successful, #NULL 1259 * on error. Call g_object_unref() on the returned cursor when no longer 1260 * needed. 1261 * 1262 * Since: 0.10 1263 */ 1264 static gboolean tracker_sparql_connection_real_statistics_async_co (TrackerSparqlConnectionStatisticsAsyncData* _data_) { 1265 #line 517 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1266 switch (_data_->_state_) { 1267 #line 517 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1268 case 0: 1269 #line 1268 "tracker-connection.c" 1270 goto _state_0; 1271 default: 1272 #line 517 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1273 g_assert_not_reached (); 1274 #line 1273 "tracker-connection.c" 1275 } 1276 _state_0: 1277 #line 518 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1278 g_warning ("tracker-connection.vala:518: Interface 'statistics_async' not implemen" \ 1279 "ted"); 1280 #line 519 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1281 _data_->result = NULL; 1282 #line 519 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1283 if (_data_->_state_ == 0) { 1284 #line 519 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1285 g_simple_async_result_complete_in_idle (_data_->_async_result); 1286 #line 1284 "tracker-connection.c" 1287 } else { 1288 #line 519 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1289 g_simple_async_result_complete (_data_->_async_result); 1290 #line 1288 "tracker-connection.c" 1291 } 1292 #line 519 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1293 g_object_unref (_data_->_async_result); 1294 #line 519 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1295 return FALSE; 1296 #line 517 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1297 if (_data_->_state_ == 0) { 1298 #line 517 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1299 g_simple_async_result_complete_in_idle (_data_->_async_result); 1300 #line 1298 "tracker-connection.c" 1301 } else { 1302 #line 517 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1303 g_simple_async_result_complete (_data_->_async_result); 1304 #line 1302 "tracker-connection.c" 1305 } 1306 #line 517 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1307 g_object_unref (_data_->_async_result); 1308 #line 517 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1309 return FALSE; 1310 #line 1308 "tracker-connection.c" 1311 } 1312 1313 1314 void tracker_sparql_connection_statistics_async (TrackerSparqlConnection* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) { 1315 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1316 TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->statistics_async (self, cancellable, _callback_, _user_data_); 1317 #line 1315 "tracker-connection.c" 1318 } 1319 1320 1321 TrackerSparqlCursor* tracker_sparql_connection_statistics_finish (TrackerSparqlConnection* self, GAsyncResult* _res_, GError** error) { 1322 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1323 return TRACKER_SPARQL_CONNECTION_GET_CLASS (self)->statistics_finish (self, _res_, error); 1324 #line 1322 "tracker-connection.c" 1325 } 1326 1327 1328 TrackerSparqlConnection* tracker_sparql_connection_construct (GType object_type) { 1329 TrackerSparqlConnection * self = NULL; 1330 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1331 self = (TrackerSparqlConnection*) g_object_new (object_type, NULL); 1332 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1333 return self; 1334 #line 1332 "tracker-connection.c" 1335 } 1336 1337 1338 static void tracker_sparql_connection_class_init (TrackerSparqlConnectionClass * klass) { 1339 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1340 tracker_sparql_connection_parent_class = g_type_class_peek_parent (klass); 1341 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1342 TRACKER_SPARQL_CONNECTION_CLASS (klass)->query = tracker_sparql_connection_real_query; 1343 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1344 TRACKER_SPARQL_CONNECTION_CLASS (klass)->update = tracker_sparql_connection_real_update; 1345 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1346 TRACKER_SPARQL_CONNECTION_CLASS (klass)->update_async = tracker_sparql_connection_real_update_async; 1347 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1348 TRACKER_SPARQL_CONNECTION_CLASS (klass)->update_finish = tracker_sparql_connection_real_update_finish; 1349 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1350 TRACKER_SPARQL_CONNECTION_CLASS (klass)->update_array_async = tracker_sparql_connection_real_update_array_async; 1351 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1352 TRACKER_SPARQL_CONNECTION_CLASS (klass)->update_array_finish = tracker_sparql_connection_real_update_array_finish; 1353 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1354 TRACKER_SPARQL_CONNECTION_CLASS (klass)->update_blank = tracker_sparql_connection_real_update_blank; 1355 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1356 TRACKER_SPARQL_CONNECTION_CLASS (klass)->update_blank_async = tracker_sparql_connection_real_update_blank_async; 1357 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1358 TRACKER_SPARQL_CONNECTION_CLASS (klass)->update_blank_finish = tracker_sparql_connection_real_update_blank_finish; 1359 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1360 TRACKER_SPARQL_CONNECTION_CLASS (klass)->load = tracker_sparql_connection_real_load; 1361 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1362 TRACKER_SPARQL_CONNECTION_CLASS (klass)->load_async = tracker_sparql_connection_real_load_async; 1363 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1364 TRACKER_SPARQL_CONNECTION_CLASS (klass)->load_finish = tracker_sparql_connection_real_load_finish; 1365 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1366 TRACKER_SPARQL_CONNECTION_CLASS (klass)->statistics = tracker_sparql_connection_real_statistics; 1367 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1368 TRACKER_SPARQL_CONNECTION_CLASS (klass)->statistics_async = tracker_sparql_connection_real_statistics_async; 1369 #line 82 "/home/martyn/Source/tracker/src/libtracker-sparql/tracker-connection.vala" 1370 TRACKER_SPARQL_CONNECTION_CLASS (klass)->statistics_finish = tracker_sparql_connection_real_statistics_finish; 1371 #line 1369 "tracker-connection.c" 1372 } 1373 1374 1375 static void tracker_sparql_connection_instance_init (TrackerSparqlConnection * self) { 1376 } 1377 1378 1379 /** 1380 * TrackerSparqlConnection: 1381 * 1382 * The <structname>TrackerSparqlConnection</structname> object represents a 1383 * connection with the Tracker store or databases depending on direct or 1384 * non-direct requests. 1385 */ 1386 GType tracker_sparql_connection_get_type (void) { 1387 static volatile gsize tracker_sparql_connection_type_id__volatile = 0; 1388 if (g_once_init_enter (&tracker_sparql_connection_type_id__volatile)) { 1389 static const GTypeInfo g_define_type_info = { sizeof (TrackerSparqlConnectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tracker_sparql_connection_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrackerSparqlConnection), 0, (GInstanceInitFunc) tracker_sparql_connection_instance_init, NULL }; 1390 GType tracker_sparql_connection_type_id; 1391 tracker_sparql_connection_type_id = g_type_register_static (G_TYPE_OBJECT, "TrackerSparqlConnection", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); 1392 g_once_init_leave (&tracker_sparql_connection_type_id__volatile, tracker_sparql_connection_type_id); 1393 } 1394 return tracker_sparql_connection_type_id__volatile; 1395 }