[tracker/dbus-fd-experiment: 29/49] Steroids-client: Code cleanup, phase 1 - examples/ and libtracker-client/



commit edf44bff0de59b42df920b2612ab310c5e6f3ff9
Author: Martyn Russell <martyn lanedo com>
Date:   Wed Jun 16 17:32:17 2010 +0100

    Steroids-client: Code cleanup, phase 1 - examples/ and libtracker-client/

 configure.ac                                       |   14 ++--
 examples/tracker-steroids/Makefile.am              |   16 ++--
 ...hmark_tracker_ipc.c => benchmark-tracker-ipc.c} |   31 ++++---
 examples/tracker-steroids/benchmark-update.c       |   29 +++---
 examples/tracker-steroids/benchmark.c              |   29 +++---
 examples/tracker-steroids/steroids-sparql-async.c  |   27 +++---
 .../steroids-sparql-update-async.c                 |   27 +++---
 examples/tracker-steroids/steroids-sparql.c        |   25 +++---
 src/libtracker-client/tracker.c                    |   95 ++++++++++---------
 9 files changed, 151 insertions(+), 142 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index aa0b352..f15f727 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1672,15 +1672,15 @@ AC_ARG_ENABLE(dbus-fd-passing,
 	      [enable_dbus_fd_passing=auto])
 
 if test "x$enable_dbus_fd_passing" != "xno" ; then
-    PKG_CHECK_EXISTS([dbus-1 >= 1.3],
-                     [have_dbus_fd_passing=yes],
-                     [have_dbus_fd_passing=no])
+   PKG_CHECK_EXISTS([dbus-1 >= 1.3],
+                    [have_dbus_fd_passing=yes],
+                    [have_dbus_fd_passing=no])
 
-    if test "x$have_dbus_fd_passing" = "xyes"; then
-       AC_DEFINE(HAVE_DBUS_FD_PASSING, [], [Define if we have DBus >= 1.3 and want DBus FD passing])
-    fi
+   if test "x$have_dbus_fd_passing" = "xyes"; then
+      AC_DEFINE(HAVE_DBUS_FD_PASSING, [], [Define if we have DBus >= 1.3 and want DBus FD passing])
+   fi
 else
-    have_dbus_fd_passing="no  (disabled)"
+   have_dbus_fd_passing="no  (disabled)"
 fi
 
 if test "x$enable_dbus_fd_passing" = "xyes"; then
diff --git a/examples/tracker-steroids/Makefile.am b/examples/tracker-steroids/Makefile.am
index 5b87d30..024e493 100644
--- a/examples/tracker-steroids/Makefile.am
+++ b/examples/tracker-steroids/Makefile.am
@@ -13,7 +13,7 @@ INCLUDES =							\
 	$(GIO_CFLAGS)						\
 	$(DBUS_CFLAGS)
 
-noinst_PROGRAMS = \
+noinst_PROGRAMS = 						\
 	steroids-sparql						\
 	steroids-sparql-async					\
 	steroids-sparql-update-async				\
@@ -23,11 +23,11 @@ noinst_PROGRAMS = \
 steroids_sparql_SOURCES =					\
 	steroids-sparql.c
 
-steroids_sparql_update_async_SOURCES=steroids-sparql-update-async.c
+steroids_sparql_update_async_SOURCES = steroids-sparql-update-async.c
 
-benchmark_SOURCES= benchmark.c
+benchmark_SOURCES = benchmark.c
 
-benchmark_update_SOURCES=benchmark-update.c
+benchmark_update_SOURCES = benchmark-update.c
 
 steroids_sparql_LDADD =						\
        $(top_builddir)/src/libtracker-client/libtracker-client- TRACKER_API_VERSION@.la \
@@ -41,10 +41,10 @@ steroids_sparql_LDADD =						\
        -lz							\
        -lm
 
-steroids_sparql_async_LDADD= $(steroids_sparql_LDADD)
+steroids_sparql_async_LDADD = $(steroids_sparql_LDADD)
 
-steroids_sparql_update_async_LDADD= $(steroids_sparql_LDADD)
+steroids_sparql_update_async_LDADD = $(steroids_sparql_LDADD)
 
-benchmark_LDADD= $(steroids_sparql_LDADD)
+benchmark_LDADD = $(steroids_sparql_LDADD)
 
-benchmark_update_LDADD= $(steroids_sparql_LDADD)
+benchmark_update_LDADD = $(steroids_sparql_LDADD)
diff --git a/examples/tracker-steroids/benchmark_tracker_ipc.c b/examples/tracker-steroids/benchmark-tracker-ipc.c
similarity index 79%
rename from examples/tracker-steroids/benchmark_tracker_ipc.c
rename to examples/tracker-steroids/benchmark-tracker-ipc.c
index a866f20..e39045e 100644
--- a/examples/tracker-steroids/benchmark_tracker_ipc.c
+++ b/examples/tracker-steroids/benchmark-tracker-ipc.c
@@ -20,24 +20,25 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <libtracker-client/tracker.h>
+
+#include <libtracker-client/tracker-client.h>
 
 int
 main (int argc, char **argv)
 {
-	const char *query;
+	const gchar *query;
 	TrackerClient *client;
 	GError *error = NULL;
 	GPtrArray *results;
 	TrackerResultIterator *iterator;
-	char buffer[1024*1024];
+	gchar buffer[1024 * 1024];
 	GTimer *timer;
-	int i, j;
-	double time_normal, time_steroids;
+	gint i, j;
+	gdouble time_normal, time_steroids;
 
 	if (argc != 2) {
-		fprintf (stderr, "Usage: %s query\n", argv[0]);
-		exit (1);
+		g_printerr ("Usage: %s query\n", argv[0]);
+		return EXIT_FAILURE;
 	}
 
 	query = argv[1];
@@ -52,7 +53,7 @@ main (int argc, char **argv)
 		g_critical ("Query error: %s", error->message);
 		g_error_free (error);
 		g_timer_destroy (timer);
-		exit (1);
+		return EXIT_FAILURE;
 	}
 
 	for (i = 0; i < results->len; i++) {
@@ -67,15 +68,15 @@ main (int argc, char **argv)
 
 	g_ptr_array_free (results, TRUE);
 
-	g_timer_start (timer);
-
 	iterator = tracker_resources_sparql_query_iterate (client, query, &error);
 
 	while (tracker_result_iterator_has_next (iterator)) {
 		tracker_result_iterator_next (iterator);
 
 		for (i = 0; i < tracker_result_iterator_n_columns (iterator); i++) {
-			const char *data = tracker_result_iterator_value (iterator, i);
+			const char *data;
+
+			data = tracker_result_iterator_value (iterator, i);
 			memcpy (buffer, data, g_utf8_strlen (data, -1));
 		}
 	}
@@ -84,9 +85,9 @@ main (int argc, char **argv)
 
 	tracker_result_iterator_free (iterator);
 
-	printf ("Normal:   %f seconds\n", time_normal);
-	printf ("Steroids: %f seconds\n", time_steroids);
-	printf ("Speedup:  %f %%\n", 100 * (time_normal/time_steroids - 1));
+	g_print ("Normal:   %f seconds\n", time_normal);
+	g_print ("Steroids: %f seconds\n", time_steroids);
+	g_print ("Speedup:  %f %%\n", 100 * (time_normal / time_steroids - 1));
 
-	return 0;
+	return EXIT_SUCCESS;
 }
diff --git a/examples/tracker-steroids/benchmark-update.c b/examples/tracker-steroids/benchmark-update.c
index f8d84ff..70a2992 100644
--- a/examples/tracker-steroids/benchmark-update.c
+++ b/examples/tracker-steroids/benchmark-update.c
@@ -20,23 +20,24 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <libtracker-client/tracker.h>
+
+#include <libtracker-client/tracker-client.h>
 
 #define N_TRIES 500
 
 int
 main (int argc, char **argv)
 {
-	const char *query;
+	const gchar *query;
 	TrackerClient *client;
 	GError *error = NULL;
 	GTimer *timer;
-	int i;
-	double time_normal, time_steroids;
+	gint i;
+	gdouble time_normal, time_steroids;
 
 	if (argc != 2) {
-		fprintf (stderr, "Usage: %s query\n", argv[0]);
-		exit (1);
+		g_printerr ("Usage: %s query\n", argv[0]);
+		return EXIT_FAILURE;
 	}
 
 	query = argv[1];
@@ -50,7 +51,7 @@ main (int argc, char **argv)
 		if (error) {
 			g_critical ("Query error: %s", error->message);
 			g_error_free (error);
-			exit (1);
+			return EXIT_FAILURE;
 		}
 	}
 
@@ -64,14 +65,12 @@ main (int argc, char **argv)
 			g_critical ("Query error: %s", error->message);
 			g_error_free (error);
 			g_timer_destroy (timer);
-			exit (1);
+			return EXIT_FAILURE;
 		}
 	}
 
 	time_normal = g_timer_elapsed (timer, NULL);
 
-	g_timer_start (timer);
-
 	for (i = 0; i < N_TRIES; i++) {
 		tracker_resources_sparql_update (client, query, &error);
 
@@ -79,15 +78,15 @@ main (int argc, char **argv)
 			g_critical ("Query error: %s", error->message);
 			g_error_free (error);
 			g_timer_destroy (timer);
-			exit (1);
+			return EXIT_FAILURE;
 		}
 	}
 
 	time_steroids = g_timer_elapsed (timer, NULL);
 
-	printf ("Normal:   %f seconds\n", time_normal/N_TRIES);
-	printf ("Steroids: %f seconds\n", time_steroids/N_TRIES);
-	printf ("Speedup:  %f %%\n", 100 * (time_normal/time_steroids - 1));
+	g_print ("Normal:   %f seconds\n", time_normal/N_TRIES);
+	g_print ("Steroids: %f seconds\n", time_steroids/N_TRIES);
+	g_print ("Speedup:  %f %%\n", 100 * (time_normal / time_steroids - 1));
 
-	return 0;
+	return EXIT_SUCCESS;
 }
diff --git a/examples/tracker-steroids/benchmark.c b/examples/tracker-steroids/benchmark.c
index a866f20..f74c9f3 100644
--- a/examples/tracker-steroids/benchmark.c
+++ b/examples/tracker-steroids/benchmark.c
@@ -20,24 +20,25 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <libtracker-client/tracker.h>
+
+#include <libtracker-client/tracker-client.h>
 
 int
 main (int argc, char **argv)
 {
-	const char *query;
+	const gchar *query;
 	TrackerClient *client;
 	GError *error = NULL;
 	GPtrArray *results;
 	TrackerResultIterator *iterator;
-	char buffer[1024*1024];
+	gchar buffer[1024 * 1024];
 	GTimer *timer;
-	int i, j;
-	double time_normal, time_steroids;
+	gint i, j;
+	gdouble time_normal, time_steroids;
 
 	if (argc != 2) {
 		fprintf (stderr, "Usage: %s query\n", argv[0]);
-		exit (1);
+		return EXIT_FAILURE;
 	}
 
 	query = argv[1];
@@ -52,7 +53,7 @@ main (int argc, char **argv)
 		g_critical ("Query error: %s", error->message);
 		g_error_free (error);
 		g_timer_destroy (timer);
-		exit (1);
+		return EXIT_FAILURE;
 	}
 
 	for (i = 0; i < results->len; i++) {
@@ -67,15 +68,15 @@ main (int argc, char **argv)
 
 	g_ptr_array_free (results, TRUE);
 
-	g_timer_start (timer);
-
 	iterator = tracker_resources_sparql_query_iterate (client, query, &error);
 
 	while (tracker_result_iterator_has_next (iterator)) {
 		tracker_result_iterator_next (iterator);
 
 		for (i = 0; i < tracker_result_iterator_n_columns (iterator); i++) {
-			const char *data = tracker_result_iterator_value (iterator, i);
+			const char *data;
+
+			data = tracker_result_iterator_value (iterator, i);
 			memcpy (buffer, data, g_utf8_strlen (data, -1));
 		}
 	}
@@ -84,9 +85,9 @@ main (int argc, char **argv)
 
 	tracker_result_iterator_free (iterator);
 
-	printf ("Normal:   %f seconds\n", time_normal);
-	printf ("Steroids: %f seconds\n", time_steroids);
-	printf ("Speedup:  %f %%\n", 100 * (time_normal/time_steroids - 1));
+	g_print ("Normal:   %f seconds\n", time_normal);
+	g_print ("Steroids: %f seconds\n", time_steroids);
+	g_print ("Speedup:  %f %%\n", 100 * (time_normal / time_steroids - 1));
 
-	return 0;
+	return EXIT_SUCCESS;
 }
diff --git a/examples/tracker-steroids/steroids-sparql-async.c b/examples/tracker-steroids/steroids-sparql-async.c
index ee2d04a..24b24e2 100644
--- a/examples/tracker-steroids/steroids-sparql-async.c
+++ b/examples/tracker-steroids/steroids-sparql-async.c
@@ -20,20 +20,20 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <libtracker-client/tracker.h>
+#include <libtracker-client/tracker-client.h>
 
 static TrackerClient *client;
 static GMainLoop *main_loop;
 
 static void
 query_cb (TrackerResultIterator *iterator,
-          GError          *error,
-          gpointer         user_data)
+          GError                *error,
+          gpointer               user_data)
 {
 	if (!iterator) {
-		fprintf (stderr, "Query preparation failed, %s\n", error->message);
+		g_printerr ("Query preparation failed, %s\n", error->message);
 		g_error_free (error);
-		exit (1);
+		exit (EXIT_FAILURE);
 	}
 
 	while (tracker_result_iterator_has_next (iterator)) {
@@ -42,14 +42,14 @@ query_cb (TrackerResultIterator *iterator,
 		tracker_result_iterator_next (iterator);
 
 		for (i = 0; i < tracker_result_iterator_n_columns (iterator); i++) {
-			printf ("%s", tracker_result_iterator_value (iterator, i));
+			g_print ("%s", tracker_result_iterator_value (iterator, i));
 
 			if (i != tracker_result_iterator_n_columns (iterator) - 1) {
-				printf (", ");
+				g_print (", ");
 			}
 		}
 
-		printf ("\n");
+		g_print ("\n");
 	}
 
 	tracker_result_iterator_free (iterator);
@@ -59,12 +59,13 @@ query_cb (TrackerResultIterator *iterator,
 }
 
 int
-main (int argc, char **argv) {
-	const char *query;
+main (int argc, char **argv) 
+{
+	const gchar *query;
 
 	if (argc != 2) {
-		fprintf (stderr, "Usage: %s query\n", argv[0]);
-		exit (1);
+		g_printerr ("Usage: %s query\n", argv[0]);
+		return EXIT_FAILURE;
 	}
 
 	query = argv[1];
@@ -77,5 +78,5 @@ main (int argc, char **argv) {
 
 	g_main_loop_run (main_loop);
 
-	return 0;
+	return EXIT_SUCCESS;
 }
diff --git a/examples/tracker-steroids/steroids-sparql-update-async.c b/examples/tracker-steroids/steroids-sparql-update-async.c
index 2c1994f..4f68a61 100644
--- a/examples/tracker-steroids/steroids-sparql-update-async.c
+++ b/examples/tracker-steroids/steroids-sparql-update-async.c
@@ -20,7 +20,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <libtracker-client/tracker.h>
+#include <libtracker-client/tracker-client.h>
 
 #include <glib.h>
 
@@ -28,11 +28,11 @@ static TrackerClient *client;
 static GMainLoop *main_loop;
 
 static void
-query_cb (GPtrArray       *results,
-          GError          *error,
-          gpointer         user_data)
+query_cb (GPtrArray *results,
+          GError    *error,
+          gpointer   user_data)
 {
-	int i, j;
+	gint i, j;
 
 	if (error) {
 		g_critical ("Update failed: %s", error->message);
@@ -57,7 +57,7 @@ query_cb (GPtrArray       *results,
 			g_hash_table_iter_init (&iter, hash);
 
 			while (g_hash_table_iter_next (&iter, &key, &value)) {
-				g_printf ("%s -> %s\n", (char *)key, (char *)value);
+				g_print ("%s -> %s\n", (gchar*) key, (gchar*) value);
 			}
 
 			g_hash_table_unref (hash);
@@ -72,12 +72,13 @@ query_cb (GPtrArray       *results,
 }
 
 int
-main (int argc, char **argv) {
-	const char *query;
-
+main (int argc, char **argv) 
+{
+	const gchar *query;
+	
 	if (argc != 2) {
-		fprintf (stderr, "Usage: %s query\n", argv[0]);
-		exit (1);
+		g_printerr ("Usage: %s query\n", argv[0]);
+		return EXIT_FAILURE;
 	}
 
 	query = argv[1];
@@ -88,10 +89,10 @@ main (int argc, char **argv) {
 
 	if (tracker_resources_sparql_update_blank_async (client, query, query_cb, NULL) == 0) {
 		g_critical ("error running update");
-		return 1;
+		return EXIT_FAILURE;
 	}
 
 	g_main_loop_run (main_loop);
 
-	return 0;
+	return EXIT_SUCCESS;
 }
diff --git a/examples/tracker-steroids/steroids-sparql.c b/examples/tracker-steroids/steroids-sparql.c
index ba2fc71..ecf2a2c 100644
--- a/examples/tracker-steroids/steroids-sparql.c
+++ b/examples/tracker-steroids/steroids-sparql.c
@@ -20,18 +20,19 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <libtracker-client/tracker.h>
+#include <libtracker-client/tracker-client.h>
 
 int
-main (int argc, char **argv) {
-	const char *query;
+main (int argc, char **argv) 
+{
+	const gchar *query;
 	TrackerClient *client;
 	GError *error = NULL;
 	TrackerResultIterator *iterator;
 
 	if (argc != 2) {
-		fprintf (stderr, "Usage: %s query\n", argv[0]);
-		exit (1);
+		g_printerr ( "Usage: %s query\n", argv[0]);
+		return EXIT_FAILURE;
 	}
 
 	query = argv[1];
@@ -41,29 +42,29 @@ main (int argc, char **argv) {
 	iterator = tracker_resources_sparql_query_iterate (client, query, &error);
 
 	if (!iterator) {
-		fprintf (stderr, "Query preparation failed, %s\n", error->message);
+		g_printerr ("Query preparation failed, %s\n", error->message);
 		g_error_free (error);
-		exit (1);
+		return EXIT_FAILURE;
 	}
 
 	while (tracker_result_iterator_has_next (iterator)) {
-		int i;
+		gint i;
 
 		tracker_result_iterator_next (iterator);
 
 		for (i = 0; i < tracker_result_iterator_n_columns (iterator); i++) {
-			printf ("%s", tracker_result_iterator_value (iterator, i));
+			g_print ("%s", tracker_result_iterator_value (iterator, i));
 
 			if (i != tracker_result_iterator_n_columns (iterator) - 1) {
-				printf (", ");
+				g_print (", ");
 			}
 		}
 
-		printf ("\n");
+		g_print ("\n");
 	}
 
 	tracker_result_iterator_free (iterator);
 	g_object_unref (client);
 
-	return 0;
+	return EXIT_SUCCESS;
 }
diff --git a/src/libtracker-client/tracker.c b/src/libtracker-client/tracker.c
index d88cfa8..999e71e 100644
--- a/src/libtracker-client/tracker.c
+++ b/src/libtracker-client/tracker.c
@@ -1,8 +1,7 @@
 /* 
  * Copyright (C) 2006, Jamie McCracken <jamiemcc gnome org>
  * Copyright (C) 2008-2010, Nokia <ivan frade nokia com>
- * Copyright (C) 2010, Codeminded BVBA
- *                     FD passing by Adrien Bustany <abustany gnome org>
+ * Copyright (C) 2010, Codeminded BVBA <abustany gnome org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -23,6 +22,9 @@
 #include "config.h"
 
 #include <string.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <unistd.h>
 
 #include <dbus/dbus.h>
 #include <dbus/dbus-glib-lowlevel.h>
@@ -33,14 +35,8 @@
 #include <gio/gunixoutputstream.h>
 
 #include <libtracker-common/tracker-dbus.h>
-#include <tracker-store/tracker-steroids.h>
-
-#include <errno.h>
-#include <sys/types.h>
-#include <unistd.h>
 
 #include "tracker.h"
-
 #include "tracker-resources-glue.h"
 #include "tracker-statistics-glue.h"
 
@@ -174,13 +170,14 @@ struct TrackerResultIterator {
 	guint  n_columns;
 	int   *offsets;
 	char  *data;
-#else
+#else  /* HAVE_DBUS_FD_PASSING */
 	GPtrArray *results;
 	gint current_row;
-#endif
+#endif /* HAVE_DBUS_FD_PASSING */
 };
 
 #ifdef HAVE_DBUS_FD_PASSING
+
 typedef enum {
 	FAST_QUERY,
 	FAST_UPDATE,
@@ -214,12 +211,15 @@ typedef struct {
 	GCancellable  *cancellable;
 	FastAsyncData *data;
 } FastPendingCallData;
-#else
+
+#else  /* HAVE_DBUS_FD_PASSING */
+
 typedef struct {
 	TrackerReplyIterator callback;
 	gpointer user_data;
 } FastQueryAsyncCompatData;
-#endif
+
+#endif /* HAVE_DBUS_FD_PASSING */
 
 static gboolean is_service_available (void);
 static void     client_finalize      (GObject      *object);
@@ -255,7 +255,7 @@ pending_call_free (PendingCallData *data)
 		g_slice_free (FastPendingCallData, fast_data);
 		return;
 	}
-#endif
+#endif /* HAVE_DBUS_FD_PASSING */
 	g_slice_free (PendingCallData, data);
 }
 
@@ -275,7 +275,7 @@ pending_call_new (TrackerClient  *client,
 	data = g_slice_new (PendingCallData);
 #ifdef HAVE_DBUS_FD_PASSING
 	data->fast = 0;
-#endif
+#endif /* HAVE_DBUS_FD_PASSING */
 	data->proxy = proxy;
 	data->pending_call = pending_call;
 
@@ -289,10 +289,11 @@ pending_call_new (TrackerClient  *client,
 }
 
 #ifdef HAVE_DBUS_FD_PASSING
+
 static guint
-pending_call_new_fast (TrackerClient   *client,
-                      GCancellable    *cancellable,
-                      FastAsyncData   *data)
+pending_call_new_fast (TrackerClient *client,
+		       GCancellable  *cancellable,
+		       FastAsyncData *data)
 {
 	TrackerClientPrivate *private;
 	FastPendingCallData *call_data;
@@ -549,6 +550,7 @@ callback_with_void (DBusGProxy *proxy,
 }
 
 #ifdef HAVE_DBUS_FD_PASSING
+
 static int
 iterator_buffer_read_int (TrackerResultIterator *iterator)
 {
@@ -633,7 +635,9 @@ fast_async_callback_iterator (GObject      *source_object,
 
 	(* data->iterator_callback) (iterator, NULL, data->user_data);
 }
-#else
+
+#else  /* HAVE_DBUS_FD_PASSING */
+
 static void
 fast_async_callback_iterator_compat (GPtrArray *results,
                                      GError *error,
@@ -659,6 +663,7 @@ fast_async_callback_iterator_compat (GPtrArray *results,
 
 	g_slice_free (FastQueryAsyncCompatData, data);
 }
+
 #endif /* HAVE_DBUS_FD_PASSING */
 
 /* Deprecated and only used for 0.6 API */
@@ -1420,7 +1425,7 @@ tracker_cancel_call (TrackerClient *client,
 		                     GUINT_TO_POINTER (call_id));
 		return TRUE;
 	}
-#endif
+#endif  /* HAVE_DBUS_FD_PASSING */
 
 	dbus_g_proxy_cancel_call (data->proxy, data->pending_call);
 	g_hash_table_remove (private->pending_calls,
@@ -1768,7 +1773,7 @@ tracker_resources_sparql_query_iterate (TrackerClient  *client,
 	dbus_pending_call_unref (call);
 
 	return iterator;
-#else
+#else  /* HAVE_DBUS_FD_PASSING */
 	TrackerResultIterator *iterator;
 	GError *inner_error = NULL;
 
@@ -1787,7 +1792,7 @@ tracker_resources_sparql_query_iterate (TrackerClient  *client,
 	}
 
 	return iterator;
-#endif
+#endif /* HAVE_DBUS_FD_PASSING */
 }
 
 /**
@@ -1804,12 +1809,12 @@ tracker_result_iterator_free (TrackerResultIterator *iterator)
 #ifndef HAVE_DBUS_FD_PASSING
 	g_ptr_array_foreach (iterator->results, (GFunc) g_free, NULL);
 	g_ptr_array_free (iterator->results, TRUE);
-#else
+#else  /* HAVE_DBUS_FD_PASSING */
 	if (iterator->buffer) {
 		g_free (iterator->buffer);
 	}
 	g_slice_free (TrackerResultIterator, iterator);
-#endif
+#endif /* HAVE_DBUS_FD_PASSING */
 }
 
 /**
@@ -1827,7 +1832,7 @@ tracker_result_iterator_n_columns (TrackerResultIterator *iterator)
 	g_return_val_if_fail (iterator, 0);
 
 	return iterator->n_columns;
-#else
+#else  /* HAVE_DBUS_FD_PASSING */
 	GStrv row;
 	guint i = 0;
 
@@ -1843,7 +1848,7 @@ tracker_result_iterator_n_columns (TrackerResultIterator *iterator)
 	}
 
 	return i - 1;
-#endif
+#endif /* HAVE_DBUS_FD_PASSING */
 }
 
 /**
@@ -1863,7 +1868,7 @@ tracker_result_iterator_has_next (TrackerResultIterator *iterator)
 	g_return_val_if_fail (iterator, FALSE);
 
 	return iterator->buffer_index < iterator->buffer_size;
-#else
+#else  /* HAVE_DBUS_FD_PASSING */
 	g_return_val_if_fail (iterator, FALSE);
 
 	if (!iterator->results->len) {
@@ -1871,7 +1876,7 @@ tracker_result_iterator_has_next (TrackerResultIterator *iterator)
 	}
 
 	return (iterator->current_row < (gint)(iterator->results->len - 1));
-#endif
+#endif /* HAVE_DBUS_FD_PASSING */
 }
 
 /**
@@ -1898,7 +1903,7 @@ tracker_result_iterator_next (TrackerResultIterator  *iterator)
 	last_offset = iterator_buffer_read_int (iterator);
 	iterator->data = iterator->buffer + iterator->buffer_index;
 	iterator->buffer_index += last_offset + 1;
-#else
+#else  /* HAVE_DBUS_FD_PASSING */
 	g_return_if_fail (iterator);
 
 	if (!iterator->results->len) {
@@ -1908,7 +1913,7 @@ tracker_result_iterator_next (TrackerResultIterator  *iterator)
 	if (iterator->current_row < (gint)iterator->results->len) {
 		iterator->current_row++;
 	}
-#endif
+#endif /* HAVE_DBUS_FD_PASSING */
 }
 
 /**
@@ -1935,7 +1940,7 @@ tracker_result_iterator_value (TrackerResultIterator *iterator,
 	} else {
 		return iterator->data + iterator->offsets[column-1] + 1;
 	}
-#else
+#else  /* HAVE_DBUS_FD_PASSING */
 	GStrv row;
 
 	g_return_val_if_fail (iterator, NULL);
@@ -1950,7 +1955,7 @@ tracker_result_iterator_value (TrackerResultIterator *iterator,
 	row = g_ptr_array_index (iterator->results, iterator->current_row);
 
 	return row[column];
-#endif
+#endif /* HAVE_DBUS_FD_PASSING */
 }
 
 static void
@@ -2001,9 +2006,9 @@ tracker_resources_sparql_update (TrackerClient  *client,
 	}
 
 	dbus_message_unref (reply);
-#else
+#else  /* HAVE_DBUS_FD_PASSING */
 	tracker_resources_sparql_update_compat (client, query, error);
-#endif
+#endif /* HAVE_DBUS_FD_PASSING */
 }
 
 static GPtrArray*
@@ -2076,9 +2081,9 @@ tracker_resources_sparql_update_blank (TrackerClient  *client,
 	dbus_message_unref (reply);
 
 	return result;
-#else
+#else  /* HAVE_DBUS_FD_PASSING */
 	return tracker_resources_sparql_update_blank_compat (client, query, error);
-#endif
+#endif /* HAVE_DBUS_FD_PASSING */
 }
 
 static void
@@ -2126,9 +2131,9 @@ tracker_resources_batch_sparql_update (TrackerClient  *client,
 	}
 
 	dbus_message_unref (reply);
-#else
+#else  /* HAVE_DBUS_FD_PASSING */
 	tracker_resources_batch_sparql_update_compat (client, query, error);
-#endif
+#endif /* HAVE_DBUS_FD_PASSING */
 }
 
 /**
@@ -2353,7 +2358,7 @@ tracker_resources_sparql_query_iterate_async (TrackerClient         *client,
 	                              fast_async_callback_iterator,
 	                              async_data);
 	return async_data->request_id;
-#else
+#else  /* HAVE_DBUS_FD_PASSING */
 	FastQueryAsyncCompatData *data;
 
 	data = g_slice_new0 (FastQueryAsyncCompatData);
@@ -2361,7 +2366,7 @@ tracker_resources_sparql_query_iterate_async (TrackerClient         *client,
 	data->user_data = user_data;
 
 	return tracker_resources_sparql_query_async (client, query, fast_async_callback_iterator_compat, user_data);
-#endif
+#endif /* HAVE_DBUS_FD_PASSING */
 }
 
 /**
@@ -2442,9 +2447,9 @@ tracker_resources_sparql_update_async (TrackerClient    *client,
 	}
 
 	return data->request_id;
-#else
+#else  /* HAVE_DBUS_FD_PASSING */
 	return tracker_resources_sparql_update_compat_async (client, query, callback, user_data);
-#endif
+#endif /* HAVE_DBUS_FD_PASSING */
 }
 
 static guint
@@ -2511,9 +2516,9 @@ tracker_resources_sparql_update_blank_async (TrackerClient         *client,
 	}
 
 	return data->request_id;
-#else
+#else  /* HAVE_DBUS_FD_PASSING */
 	return tracker_resources_sparql_update_blank_compat_async (client, query, callback, user_data);
-#endif
+#endif /* HAVE_DBUS_FD_PASSING */
 }
 
 static guint
@@ -2594,9 +2599,9 @@ tracker_resources_batch_sparql_update_async (TrackerClient    *client,
 	}
 
 	return data->request_id;
-#else
+#else  /* HAVE_DBUS_FD_PASSING */
 	return tracker_resources_batch_sparql_update_compat_async (client, query, callback, user_data);
-#endif
+#endif /* HAVE_DBUS_FD_PASSING */
 }
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]