summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac16
-rw-r--r--data/Makefile.am5
-rw-r--r--data/tracker-client.pc.in12
-rw-r--r--docs/reference/Makefile.am1
-rw-r--r--docs/reference/libtracker-client/Makefile.am61
-rw-r--r--docs/reference/libtracker-client/libtracker-client-docs.sgml53
-rw-r--r--docs/reference/libtracker-client/libtracker-client-sections.txt128
-rw-r--r--docs/reference/libtracker-client/libtracker-client.types1
-rw-r--r--docs/reference/libtracker-client/tmpl/tracker-sparql-builder.sgml474
-rw-r--r--docs/reference/libtracker-client/version.xml.in1
-rw-r--r--examples/libtracker-miner/Makefile.am1
-rw-r--r--src/Makefile.am1
-rw-r--r--src/libtracker-client/.gitignore3
-rw-r--r--src/libtracker-client/COPYING.LIB510
-rw-r--r--src/libtracker-client/Makefile.am70
-rw-r--r--src/libtracker-client/tracker-client.h32
-rw-r--r--src/libtracker-client/tracker-client.vapi143
-rw-r--r--src/libtracker-client/tracker-sparql-builder.vala310
-rw-r--r--src/libtracker-client/tracker.c3202
-rw-r--r--src/libtracker-client/tracker.h261
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/libtracker-client/.gitignore1
-rw-r--r--tests/libtracker-client/Makefile.am20
-rw-r--r--tests/libtracker-client/tracker-test.c82
24 files changed, 0 insertions, 5389 deletions
diff --git a/configure.ac b/configure.ac
index 4712359a6..a5bfbeeb4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -226,17 +226,6 @@ LIBTRACKER_BUS_REQUIRED="glib-2.0 >= $GLIB_REQUIRED
PKG_CHECK_MODULES(LIBTRACKER_BUS, [$LIBTRACKER_BUS_REQUIRED])
-# Check requirements for libtracker-client
-LIBTRACKER_CLIENT_REQUIRED="glib-2.0 >= $GLIB_REQUIRED
- gobject-2.0 >= $GLIB_REQUIRED
- gio-unix-2.0 >= $GLIB_REQUIRED
- dbus-1 >= $DBUS_REQUIRED
- dbus-glib-1 >= $DBUS_GLIB_REQUIRED"
-
-PKG_CHECK_MODULES(LIBTRACKER_CLIENT, [$LIBTRACKER_CLIENT_REQUIRED])
-
-LIBTRACKER_CLIENT_CFLAGS="$LIBTRACKER_CLIENT_CFLAGS -Wno-deprecated-declarations"
-
# Check requirements for libtracker-common
LIBTRACKER_COMMON_REQUIRED="glib-2.0 >= $GLIB_REQUIRED
gio-unix-2.0 >= $GLIB_REQUIRED"
@@ -1981,15 +1970,12 @@ AC_CONFIG_FILES([
data/miners/Makefile
data/ontologies/Makefile
data/tracker-sparql.pc
- data/tracker-client.pc
data/tracker-extract.pc
data/tracker-miner.pc
docs/Makefile
docs/design/Makefile
docs/manpages/Makefile
docs/reference/Makefile
- docs/reference/libtracker-client/Makefile
- docs/reference/libtracker-client/version.xml
docs/reference/libtracker-sparql/Makefile
docs/reference/libtracker-sparql/version.xml
docs/reference/libtracker-extract/Makefile
@@ -2010,7 +1996,6 @@ AC_CONFIG_FILES([
src/libtracker-data/Makefile
src/libtracker-fts/Makefile
src/libtracker-extract/Makefile
- src/libtracker-client/Makefile
src/libtracker-miner/Makefile
src/Makefile
src/miners/Makefile
@@ -2033,7 +2018,6 @@ AC_CONFIG_FILES([
src/plugins/nautilus/Makefile
src/vapi/Makefile
tests/common/Makefile
- tests/libtracker-client/Makefile
tests/libtracker-common/Makefile
tests/libtracker-extract/Makefile
tests/libtracker-data/Makefile
diff --git a/data/Makefile.am b/data/Makefile.am
index c2587cb82..549e6cd69 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -52,16 +52,12 @@ endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = \
tracker-sparql-$(TRACKER_API_VERSION).pc \
- tracker-client-$(TRACKER_API_VERSION).pc \
tracker-extract-$(TRACKER_API_VERSION).pc \
tracker-miner-$(TRACKER_API_VERSION).pc
tracker-sparql-$(TRACKER_API_VERSION).pc: tracker-sparql.pc
cp $< $@
-tracker-client-$(TRACKER_API_VERSION).pc: tracker-client.pc
- cp $< $@
-
tracker-extract-$(TRACKER_API_VERSION).pc: tracker-extract.pc
cp $< $@
@@ -72,7 +68,6 @@ CLEANFILES = \
$(autostart_DATA) \
$(desktop_in_files) \
tracker-sparql-$(TRACKER_API_VERSION).pc \
- tracker-client-$(TRACKER_API_VERSION).pc \
tracker-extract-$(TRACKER_API_VERSION).pc \
tracker-miner-$(TRACKER_API_VERSION).pc
diff --git a/data/tracker-client.pc.in b/data/tracker-client.pc.in
deleted file mode 100644
index 1c48eb7d6..000000000
--- a/data/tracker-client.pc.in
+++ /dev/null
@@ -1,12 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: tracker-client
-Description: Tracker : Indexer, metadata harvester and metadata database
-Version: @VERSION@
-Requires: glib-2.0
-Libs: -L${libdir} -ltracker-client-@TRACKER_API_VERSION@
-Cflags: -I${includedir}/tracker-@TRACKER_API_VERSION@
-
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index f10d7cd9b..98f076306 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -2,7 +2,6 @@ include $(top_srcdir)/Makefile.decl
SUBDIRS = \
libtracker-sparql \
- libtracker-client \
libtracker-extract \
libtracker-miner \
ontology
diff --git a/docs/reference/libtracker-client/Makefile.am b/docs/reference/libtracker-client/Makefile.am
deleted file mode 100644
index 0c3488ec8..000000000
--- a/docs/reference/libtracker-client/Makefile.am
+++ /dev/null
@@ -1,61 +0,0 @@
-include $(top_srcdir)/Makefile.decl
-
-AUTOMAKE_OPTIONS = 1.6
-
-# The name of the module.
-DOC_MODULE = libtracker-client
-
-# The top-level SGML file.
-DOC_MAIN_SGML_FILE = libtracker-client-docs.sgml
-
-# Extra options to supply to gtkdoc-scan
-SCAN_OPTIONS=--deprecated-guards="TRACKER_DISABLE_DEPRECATED"
-
-# Extra options to pass to gtkdoc-scangobj
-# SCANGOBJ_OPTIONS=--type-init-func="gtk_type_init(0)"
-
-# The directory containing the source code. Relative to $(srcdir)
-DOC_SOURCE_DIR = ../../../src/libtracker-client
-
-# Used for dependencies
-HFILE_GLOB = $(top_srcdir)/src/libtracker-client/*.h
-CFILE_GLOB = $(top_srcdir)/src/libtracker-client/*.c
-
-# Header files to ignore when scanning
-IGNORE_HFILES = \
- tracker-resources-glue.h \
- tracker-statistics-glue.h
-
-# CFLAGS and LDFLAGS for compiling scan program. Only needed
-# if $(DOC_MODULE).types is non-empty.
-AM_CPPFLAGS = \
- -DTRACKER_COMPILATION \
- -I$(top_srcdir)/src \
- $(LIBTRACKER_CLIENT_CFLAGS)
-
-GTKDOC_LIBS = \
- $(top_builddir)/src/libtracker-client/libtracker-client-@TRACKER_API_VERSION@.la \
- $(top_builddir)/src/libtracker-common/libtracker-common.la \
- $(LIBTRACKER_CLIENT_LIBS)
-
-# Extra options to supply to gtkdoc-mkdb
-MKDB_OPTIONS = --sgml-mode --output-format=xml
-
-# Extra options to supply to gtkdoc-mkhtml
-MKHTML_OPTIONS=--path="$(abs_builddir)"
-
-# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE)
-content_files = version.xml
-
-expand_content_files =
-
-# Images to copy into HTML directory
-HTML_IMAGES =
-
-# Extra options to supply to gtkdoc-fixref
-FIXXREF_OPTIONS =
-
-include $(top_srcdir)/gtk-doc.make
-
-# Other files to distribute
-EXTRA_DIST += version.xml.in
diff --git a/docs/reference/libtracker-client/libtracker-client-docs.sgml b/docs/reference/libtracker-client/libtracker-client-docs.sgml
deleted file mode 100644
index b869ed10b..000000000
--- a/docs/reference/libtracker-client/libtracker-client-docs.sgml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
- "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
-<!ENTITY tracker SYSTEM "xml/tracker.xml">
-<!ENTITY tracker-cancel SYSTEM "xml/tracker_cancel.xml">
-<!ENTITY tracker-misc SYSTEM "xml/tracker_misc.xml">
-<!ENTITY tracker-statistics SYSTEM "xml/tracker_statistics.xml">
-<!ENTITY tracker-resources SYSTEM "xml/tracker_resources.xml">
-<!ENTITY tracker-search SYSTEM "xml/tracker_search.xml">
-<!ENTITY tracker-sparql-builder SYSTEM "xml/tracker-sparql-builder.xml">
-<!ENTITY version SYSTEM "version.xml">
-]>
-<book id="index">
- <bookinfo>
- <title>Tracker Client Library Reference Manual</title>
- <releaseinfo>for libtracker-client &version;.
- This library is fully <remark>DEPRECATED</remark> since Tracker 0.10, and
- shouldn't be used in newly written code. Use the Tracker SPARQL library
- instead.
- </releaseinfo>
- </bookinfo>
-
- <part id="libtracker-client">
- <title>Overview</title>
- <partintro>
- <para>
- The libtracker-client library is the foundation for Tracker
- querying and inserting into the data store. The data store
- allows both querying and inserting using SPARQL based on the
- Nepomuk ontology.
- </para>
- <para>
- </para>
- </partintro>
- </part>
-
- <chapter>
- <title>General</title>
- &tracker;
- &tracker-cancel;
- &tracker-misc;
- </chapter>
- <chapter>
- <title>Querying</title>
- &tracker-statistics;
- &tracker-resources;
- &tracker-search;
- </chapter>
- <chapter>
- <title>Building Queries</title>
- &tracker-sparql-builder;
- </chapter>
-</book>
diff --git a/docs/reference/libtracker-client/libtracker-client-sections.txt b/docs/reference/libtracker-client/libtracker-client-sections.txt
deleted file mode 100644
index be881a43b..000000000
--- a/docs/reference/libtracker-client/libtracker-client-sections.txt
+++ /dev/null
@@ -1,128 +0,0 @@
-<SECTION>
-<FILE>tracker</FILE>
-TRACKER_DBUS_SERVICE
-TRACKER_DBUS_OBJECT
-TRACKER_DBUS_INTERFACE_RESOURCES
-TRACKER_DBUS_INTERFACE_STATISTICS
-<TITLE>TrackerClient</TITLE>
-TrackerClient
-TrackerClientClass
-TrackerClientFlags
-tracker_client_new
-<SUBSECTION Standard>
-TRACKER_CLIENT
-TRACKER_IS_CLIENT
-TRACKER_TYPE_CLIENT
-tracker_client_get_type
-TRACKER_CLIENT_CLASS
-TRACKER_IS_CLIENT_CLASS
-TRACKER_CLIENT_GET_CLASS
-</SECTION>
-
-<SECTION>
-<FILE>tracker_cancel</FILE>
-<TITLE>Cancellations</TITLE>
-tracker_cancel_call
-tracker_cancel_last_call
-</SECTION>
-
-<SECTION>
-<FILE>tracker_misc</FILE>
-<TITLE>Utilities</TITLE>
-tracker_sparql_escape
-tracker_uri_printf_escaped
-tracker_uri_vprintf_escaped
-</SECTION>
-
-<SECTION>
-<FILE>tracker_statistics</FILE>
-<TITLE>Statistics</TITLE>
-TrackerReplyGPtrArray
-tracker_statistics_get
-tracker_statistics_get_async
-</SECTION>
-
-<SECTION>
-<FILE>tracker_resources</FILE>
-<TITLE>Resources</TITLE>
-TrackerReplyGPtrArray
-TrackerReplyVoid
-tracker_resources_sparql_query
-tracker_resources_sparql_query_async
-tracker_resources_sparql_update
-tracker_resources_sparql_update_async
-tracker_resources_sparql_update_blank
-tracker_resources_sparql_update_blank_async
-tracker_resources_batch_sparql_update
-tracker_resources_batch_sparql_update_async
-tracker_resources_batch_commit
-tracker_resources_batch_commit_async
-tracker_resources_load
-tracker_resources_load_async
-</SECTION>
-
-<SECTION>
-<FILE>tracker_search</FILE>
-<TITLE>Search</TITLE>
-TrackerReplyArray
-tracker_connect
-tracker_disconnect
-tracker_search_metadata_by_text_async
-tracker_search_metadata_by_text_and_location_async
-tracker_search_metadata_by_text_and_mime_async
-tracker_search_metadata_by_text_and_mime_and_location_async
-</SECTION>
-
-<SECTION>
-<FILE>tracker-sparql-builder</FILE>
-<TITLE>TrackerSparqlBuilder</TITLE>
-TrackerSparqlBuilder
-TrackerSparqlBuilderClass
-TrackerSparqlBuilderPrivate
-TrackerSparqlBuilderState
-tracker_sparql_builder_new
-tracker_sparql_builder_new_embedded_insert
-tracker_sparql_builder_new_update
-tracker_sparql_builder_construct
-tracker_sparql_builder_construct_embedded_insert
-tracker_sparql_builder_construct_update
-tracker_sparql_builder_get_state
-tracker_sparql_builder_get_result
-tracker_sparql_builder_get_length
-tracker_sparql_builder_append
-tracker_sparql_builder_prepend
-tracker_sparql_builder_insert_open
-tracker_sparql_builder_insert_close
-tracker_sparql_builder_where_open
-tracker_sparql_builder_where_close
-tracker_sparql_builder_delete_open
-tracker_sparql_builder_delete_close
-tracker_sparql_builder_drop_graph
-tracker_sparql_builder_subject_variable
-tracker_sparql_builder_subject_iri
-tracker_sparql_builder_subject
-tracker_sparql_builder_predicate_iri
-tracker_sparql_builder_predicate
-tracker_sparql_builder_object_iri
-tracker_sparql_builder_object
-tracker_sparql_builder_object_string
-tracker_sparql_builder_object_boolean
-tracker_sparql_builder_object_int64
-tracker_sparql_builder_object_date
-tracker_sparql_builder_object_double
-tracker_sparql_builder_object_variable
-tracker_sparql_builder_object_blank_open
-tracker_sparql_builder_object_blank_close
-tracker_sparql_builder_object_unvalidated
-<SUBSECTION Standard>
-TRACKER_SPARQL_BUILDER
-TRACKER_IS_SPARQL_BUILDER
-TRACKER_TYPE_SPARQL_BUILDER
-tracker_sparql_builder_get_type
-TRACKER_SPARQL_BUILDER_CLASS
-TRACKER_IS_SPARQL_BUILDER_CLASS
-TRACKER_SPARQL_BUILDER_GET_CLASS
-TRACKER_SPARQL_BUILDER_TYPE_STATE
-tracker_sparql_builder_state_get_type
-</SECTION>
-
diff --git a/docs/reference/libtracker-client/libtracker-client.types b/docs/reference/libtracker-client/libtracker-client.types
deleted file mode 100644
index cac95ce80..000000000
--- a/docs/reference/libtracker-client/libtracker-client.types
+++ /dev/null
@@ -1 +0,0 @@
-tracker_client_get_type
diff --git a/docs/reference/libtracker-client/tmpl/tracker-sparql-builder.sgml b/docs/reference/libtracker-client/tmpl/tracker-sparql-builder.sgml
deleted file mode 100644
index 22cce3e0d..000000000
--- a/docs/reference/libtracker-client/tmpl/tracker-sparql-builder.sgml
+++ /dev/null
@@ -1,474 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-Sparql builder
-
-<!-- ##### SECTION Short_Description ##### -->
-Creating insertion/update SparQL queries.
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-#TrackerSparqlBuilder is an object what will gather a set of
-subject/predicate/object triples, together with an optional WHERE clause,
-in order to create a query that may be issued to tracker-store.
-</para>
-
-<para>
-When using #TrackerSparqlBuilder, note that you may append several predicates
-for the same subject, and several objects for the same predicate.
-</para>
-
-<example id="example-sparql-builder">
- <title>Using TrackerSparqlBuilder</title>
- <programlisting>
- TrackerSparqlBuilder *builder;
- const gchar *iri = "urn:example:0001";
- gchar *query_str;
-&nbsp;&nbsp;
- /* Create builder */
- builder = tracker_sparql_builder_new_update ();
-&nbsp;&nbsp;
- /* Drop previous data */
- tracker_sparql_builder_drop_graph (builder, iri);
-&nbsp;&nbsp;
- /* Insert new data */
- tracker_sparql_builder_insert_open (builder, iri);
-&nbsp;&nbsp;
- tracker_sparql_builder_subject_iri (builder, iri);
-&nbsp;&nbsp;
- tracker_sparql_builder_predicate (builder, "a");
- tracker_sparql_builder_object (builder, "nie:DataObject");
- tracker_sparql_builder_object (builder, "nfo:FileDataObject");
-&nbsp;&nbsp;
- tracker_sparql_builder_predicate (builder, "nfo:fileLastModified");
- tracker_sparql_builder_object_date (builder, time (NULL));
-&nbsp;&nbsp;
- tracker_sparql_builder_insert_close (builder);
-&nbsp;&nbsp;
- /* Get query as string */
- query_str = tracker_sparql_builder_get_result (builder);
- </programlisting>
-</example>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### STRUCT TrackerSparqlBuilder ##### -->
-<para>
-The <structname>TrackerSparqlBuilder</structname> object represents an
-insertion/update SparQL query.
-</para>
-
-@parent_instance:
-@priv:
-
-<!-- ##### STRUCT TrackerSparqlBuilderClass ##### -->
-<para>
-
-</para>
-
-@parent_class:
-
-<!-- ##### STRUCT TrackerSparqlBuilderPrivate ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### ENUM TrackerSparqlBuilderState ##### -->
-<para>
-
-</para>
-
-@TRACKER_SPARQL_BUILDER_STATE_UPDATE:
-@TRACKER_SPARQL_BUILDER_STATE_INSERT:
-@TRACKER_SPARQL_BUILDER_STATE_DELETE:
-@TRACKER_SPARQL_BUILDER_STATE_SUBJECT:
-@TRACKER_SPARQL_BUILDER_STATE_PREDICATE:
-@TRACKER_SPARQL_BUILDER_STATE_OBJECT:
-@TRACKER_SPARQL_BUILDER_STATE_BLANK:
-@TRACKER_SPARQL_BUILDER_STATE_WHERE:
-@TRACKER_SPARQL_BUILDER_STATE_EMBEDDED_INSERT:
-
-<!-- ##### FUNCTION tracker_sparql_builder_new ##### -->
-<para>
-Creates a stateless #TrackerSparqlBuilder.
-</para>
-
-@void:
-@Returns: a newly created #TrackerSparqlBuilder. Free with g_object_unref() when done
-@Deprecated: 0.10: Use tracker_sparql_builder_new() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_new_embedded_insert ##### -->
-<para>
-Creates a #TrackerSparqlBuilder ready to be embedded in another query. In embedded
-inserts, the subject is implied (responsibility of the embedder), so only calls to
-append predicates and objects for the given subject are allowed.
-</para>
-
-@void:
-@Returns: a newly created #TrackerSparqlBuilder. Free with g_object_unref() when done
-@Deprecated: 0.10: Use tracker_sparql_builder_new_embedded_insert() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_new_update ##### -->
-<para>
-Creates an empty #TrackerSparqlBuilder for an update query.
-</para>
-
-@void:
-@Returns: a newly created #TrackerSparqlBuilder. Free with g_object_unref() when done
-@Deprecated: 0.10: Use tracker_sparql_builder_new_update() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_construct ##### -->
-<para>
-
-</para>
-
-@object_type:
-@Returns:
-@Deprecated: 0.10: Use tracker_sparql_builder_construct() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_construct_embedded_insert ##### -->
-<para>
-
-</para>
-
-@object_type:
-@Returns:
-@Deprecated: 0.10: Use tracker_sparql_builder_construct_embedded_insert() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_construct_update ##### -->
-<para>
-
-</para>
-
-@object_type:
-@Returns:
-@Deprecated: 0.10: Use tracker_sparql_builder_construct_update() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_get_state ##### -->
-<para>
-
-</para>
-
-@self:
-@Returns:
-@Deprecated: 0.10: Use tracker_sparql_builder_get_state() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_get_result ##### -->
-<para>
-Returns the constructed SparQL query as a string.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@Returns: The created SparQL query.
-@Deprecated: 0.10: Use tracker_sparql_builder_get_result() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_get_length ##### -->
-<para>
-Returns the number of objects added to @self.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@Returns: The number of objects contained.
-@Deprecated: 0.10: Use tracker_sparql_builder_get_length() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_append ##### -->
-<para>
-Appends raw, unvalidated content to @self.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@raw: raw content to append.
-@Deprecated: 0.10: Use tracker_sparql_builder_append() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_prepend ##### -->
-<para>
-Prepends raw, unvalidated content to @self.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@raw: raw content to prepend.
-@Deprecated: 0.10: Use tracker_sparql_builder_prepend() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_insert_open ##### -->
-<para>
-Opens an insertion statement.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@graph: Graph name, or %NULL.
-@Deprecated: 0.10: Use tracker_sparql_builder_insert_open() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_insert_close ##### -->
-<para>
-Closes an insertion statement opened with tracker_sparql_builder_insert_open ().
-</para>
-
-@self: a #TrackerSparqlBuilder
-@Deprecated: 0.10: Use tracker_sparql_builder_insert_close() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_where_open ##### -->
-<para>
-Opens a WHERE clause. Data triples may be appended then to narrow the scope
-to which the update query applies.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@Deprecated: 0.10: Use tracker_sparql_builder_where_open() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_where_close ##### -->
-<para>
-Closes a WHERE clause opened through tracker_sparql_builder_where_open().
-</para>
-
-@self: a #TrackerSparqlBuilder
-@Deprecated: 0.10: Use tracker_sparql_builder_where_close() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_delete_open ##### -->
-<para>
-Opens a DELETE clause. Data triples may be appended in order to prepare
-a query to delete them.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@graph: Graph name, or %NULL.
-@Deprecated: 0.10: Use tracker_sparql_builder_delete_open() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_delete_close ##### -->
-<para>
-Closes a DELETE clause opened through tracker_sparql_builder_delete_close().
-</para>
-
-@self: a #TrackerSparqlBuilder
-@Deprecated: 0.10: Use tracker_sparql_builder_delete_close() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_drop_graph ##### -->
-<para>
-Appends a DROP GRAPH clause.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@iri: a graph name.
-@Deprecated: 0.10: Use tracker_sparql_builder_drop_graph() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_subject_variable ##### -->
-<para>
-Appends a subject as a SparQL variable, such as "?urn".
-</para>
-
-@self: a #TrackerSparqlBuilder
-@var_name: Variable name, without leading '?'
-@Deprecated: 0.10: Use tracker_sparql_builder_subject_variable() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_subject_iri ##### -->
-<para>
-Appends a subject as an IRI, such as "&lt;urn:file:1234-5678&gt;". IRIs
-univocally identify a resource in tracker-store.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@iri: IRI name, without leading and trailing greater/less than symbols.
-@Deprecated: 0.10: Use tracker_sparql_builder_subject_iri() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_subject ##### -->
-<para>
-Appends a subject.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@s: subject string
-@Deprecated: 0.10: Use tracker_sparql_builder_subject() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_predicate_iri ##### -->
-<para>
-Appends a predicate as an IRI.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@iri: IRI name, without leading and trailing greater/less than symbols.
-@Deprecated: 0.10: Use tracker_sparql_builder_predicate_iri() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_predicate ##### -->
-<para>
-Appends a predicate for the previously appended subject.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@s: predicate string
-@Deprecated: 0.10: Use tracker_sparql_builder_predicate() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_object_iri ##### -->
-<para>
-Appends an object as an IRI.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@iri: IRI name, without leading and trailing greater/less than symbols.
-@Deprecated: 0.10: Use tracker_sparql_builder_object_iri() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_object ##### -->
-<para>
-Appends a free-form object for the previously appended subject and predicate.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@s: object string
-@Deprecated: 0.10: Use tracker_sparql_builder_object() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_object_string ##### -->
-<para>
-Appends an object formatted as an string. @literal will be escaped and surrounded
-by double quotes.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@literal: string object
-@Deprecated: 0.10: Use tracker_sparql_builder_object_string() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_object_boolean ##### -->
-<para>
-Appends a #gboolean value as an object.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@literal: boolean object
-@Deprecated: 0.10: Use tracker_sparql_builder_object_boolean() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_object_int64 ##### -->
-<para>
-Appends a #gint64 as an object.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@literal: object as gint64
-@Deprecated: 0.10: Use tracker_sparql_builder_object_int64() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_object_date ##### -->
-<para>
-Appends a time_t as an object. @literal will be converted to a
-string in the date format used by tracker-store.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@literal: object as time_t
-@Deprecated: 0.10: Use tracker_sparql_builder_object_date() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_object_double ##### -->
-<para>
-Appends a #gdouble as an object.
-</para>
-
-@self: a TrackerSparqlBuilder
-@literal: object as #gdouble
-@Deprecated: 0.10: Use tracker_sparql_builder_object_double() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_object_variable ##### -->
-<para>
-Appends an object as a SparQL variable, such as "?urn".
-</para>
-
-@self: a #TrackerSparqlBuilder
-@var_name: variable name, without leading '?'
-@Deprecated: 0.10: Use tracker_sparql_builder_object_variable() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_object_blank_open ##### -->
-<para>
-Opens an anonymous blank node. In insertions this can be used to create
-anonymous nodes for not previously known data without the need of a
-separate insertion.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@Deprecated: 0.10: Use tracker_sparql_builder_object_blank_open() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_object_blank_close ##### -->
-<para>
-Closes an anomymous blank node opened with tracker_sparql_builder_object_blank_open()
-</para>
-
-@self: a #TrackerSparqlBuilder
-@Deprecated: 0.10: Use tracker_sparql_builder_object_blank_close() in libtracker-sparql instead.
-@Since: 0.8
-
-
-<!-- ##### FUNCTION tracker_sparql_builder_object_unvalidated ##### -->
-<para>
-Appends a string not validated as UTF-8 as an object.
-</para>
-
-@self: a #TrackerSparqlBuilder
-@value: possibly UTF-8 invalid string.
-@Deprecated: 0.10: Use tracker_sparql_builder_object_unvalidated() in libtracker-sparql instead.
-@Since: 0.8
-
-
diff --git a/docs/reference/libtracker-client/version.xml.in b/docs/reference/libtracker-client/version.xml.in
deleted file mode 100644
index c7e1225e2..000000000
--- a/docs/reference/libtracker-client/version.xml.in
+++ /dev/null
@@ -1 +0,0 @@
-@TRACKER_VERSION@
diff --git a/examples/libtracker-miner/Makefile.am b/examples/libtracker-miner/Makefile.am
index 0681c8a21..46ba1a268 100644
--- a/examples/libtracker-miner/Makefile.am
+++ b/examples/libtracker-miner/Makefile.am
@@ -11,7 +11,6 @@ AM_CPPFLAGS = \
LDADD = \
$(top_builddir)/src/libtracker-miner/libtracker-miner-@TRACKER_API_VERSION@.la \
- $(top_builddir)/src/libtracker-client/libtracker-client-@TRACKER_API_VERSION@.la \
$(top_builddir)/src/libtracker-sparql/libtracker-sparql-@TRACKER_API_VERSION@.la \
$(top_builddir)/src/libtracker-common/libtracker-common.la \
$(BUILD_LIBS) \
diff --git a/src/Makefile.am b/src/Makefile.am
index f7f8b3cad..3145d58e9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,7 +13,6 @@ SUBDIRS = \
$(libstemmer_dir) \
libtracker-common \
libtracker-sparql \
- libtracker-client \
$(libtrackerfts_dir) \
libtracker-bus \
libtracker-data \
diff --git a/src/libtracker-client/.gitignore b/src/libtracker-client/.gitignore
deleted file mode 100644
index 78bcf7022..000000000
--- a/src/libtracker-client/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-tracker-client-*.vapi
-tracker-sparql-builder.c
-tracker-sparql-builder.h
diff --git a/src/libtracker-client/COPYING.LIB b/src/libtracker-client/COPYING.LIB
deleted file mode 100644
index 2d2d780e6..000000000
--- a/src/libtracker-client/COPYING.LIB
+++ /dev/null
@@ -1,510 +0,0 @@
-
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations
-below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it
-becomes a de-facto standard. To achieve this, non-free programs must
-be allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control
-compilation and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at least
- three years, to give the same user the materials specified in
- Subsection 6a, above, for a charge no more than the cost of
- performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply, and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License
-may add an explicit geographical distribution limitation excluding those
-countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms
-of the ordinary General Public License).
-
- To apply these terms, attach the following notices to the library.
-It is safest to attach them to the start of each source file to most
-effectively convey the exclusion of warranty; and each file should
-have at least the "copyright" line and a pointer to where the full
-notice is found.
-
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or
-your school, if any, to sign a "copyright disclaimer" for the library,
-if necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James
- Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/src/libtracker-client/Makefile.am b/src/libtracker-client/Makefile.am
deleted file mode 100644
index 012f1222d..000000000
--- a/src/libtracker-client/Makefile.am
+++ /dev/null
@@ -1,70 +0,0 @@
-include $(top_srcdir)/Makefile.decl
-
-AM_VALAFLAGS = \
- --includedir=libtracker-client \
- --header tracker-sparql-builder.h \
- --pkg gio-2.0 \
- $(BUILD_VALAFLAGS) \
- $(top_srcdir)/src/vapi/posix.vapi \
- $(top_srcdir)/src/vapi/glib-2.0-fixes.vapi \
- $(top_srcdir)/src/libtracker-common/libtracker-common.vapi
-
-AM_CPPFLAGS = \
- $(BUILD_CFLAGS) \
- -DLOCALEDIR=\""$(localedir)"\" \
- -I$(top_srcdir)/src \
- -I$(top_builddir)/src \
- $(LIBTRACKER_CLIENT_CFLAGS)
-
-lib_LTLIBRARIES = libtracker-client-@TRACKER_API_VERSION@.la
-
-libtracker_clientincludedir = $(includedir)/tracker-$(TRACKER_API_VERSION)/libtracker-client
-
-libtracker_client_@TRACKER_API_VERSION@_la_SOURCES = \
- tracker-sparql-builder.vala \
- tracker.c
-
-libtracker_client_@TRACKER_API_VERSION@_la_LIBADD = \
- $(top_builddir)/src/libtracker-common/libtracker-common.la \
- $(BUILD_LIBS) \
- $(LIBTRACKER_CLIENT_LIBS)
-
-libtracker_client_@TRACKER_API_VERSION@_la_LDFLAGS = \
- -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
- -export-symbols-regex '^tracker_.*'
-
-tracker-sparql-builder.h: libtracker-client-@TRACKER_API_VERSION@.la
-
-libtracker_clientinclude_HEADERS = \
- tracker.h \
- tracker-client.h \
- tracker-sparql-builder.h
-
-# Vala bindings
-vapidir = $(datadir)/vala/vapi
-vapi_DATA = tracker-client-$(TRACKER_API_VERSION).vapi
-
-tracker-client-$(TRACKER_API_VERSION).vapi: tracker-client.vapi
- cp $< $@
-
-# Generate DBus files from XML data.
-dbus_sources = \
- tracker-resources-glue.h \
- tracker-statistics-glue.h
-
-%-glue.h: $(top_srcdir)/data/dbus/%.xml
- $(AM_V_GEN)$(DBUSBINDINGTOOL) --mode=glib-client --output=$@ --prefix=$(subst -,_,$*) $^
-
-BUILT_SOURCES = \
- libtracker_client_$(TRACKER_API_VERSION)_la_vala.stamp \
- $(dbus_sources)
-
-CLEANFILES = \
- $(vapi_DATA) \
- $(dbus_sources)
-
-MAINTAINERCLEANFILES = \
- tracker-sparql-builder.h
-
-EXTRA_DIST = \
- tracker-client.vapi
diff --git a/src/libtracker-client/tracker-client.h b/src/libtracker-client/tracker-client.h
deleted file mode 100644
index 52e21fd6c..000000000
--- a/src/libtracker-client/tracker-client.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2010, Nokia <ivan.frade@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef __LIBTRACKER_CLIENT_H__
-#define __LIBTRACKER_CLIENT_H__
-
-#include <glib.h>
-
-#define __LIBTRACKER_CLIENT_INSIDE__
-
-#include "tracker.h"
-#include "tracker-sparql-builder.h"
-
-#undef __LIBTRACKER_CLIENT_INSIDE__
-
-#endif /* __LIBTRACKER_CLIENT_H__ */
diff --git a/src/libtracker-client/tracker-client.vapi b/src/libtracker-client/tracker-client.vapi
deleted file mode 100644
index b8865d0d6..000000000
--- a/src/libtracker-client/tracker-client.vapi
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (C) 2010, Adrien Bustany <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
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-[CCode (cprefix = "Tracker", lower_case_cprefix = "tracker_")]
-namespace Tracker {
- [CCode (cheader_filename = "libtracker-client/tracker-client.h")]
- public class Client : GLib.Object {
- [CCode (has_construct_function = false)]
- public Client (Tracker.ClientFlags flags, int timeout);
-
- [CCode (cname = "tracker_cancel_call")]
- public bool cancel_call (uint call_id);
- [CCode (cname = "tracker_cancel_last_call")]
- public bool cancel_last_call ();
- [CCode (cname = "tracker_resources_batch_commit")]
- public void batch_commit () throws GLib.Error;
- [CCode (cname = "tracker_resources_batch_commit_async")]
- public void batch_commit_async (Tracker.ReplyVoid callback);
- [CCode (cname = "tracker_resources_batch_sparql_update")]
- public void batch_sparql_update (string query) throws GLib.Error;
- [CCode (cname = "tracker_resources_batch_sparql_update_async")]
- public void batch_sparql_update_async (string query, Tracker.ReplyVoid callback);
- [CCode (cname = "tracker_resources_load")]
- public void load (string uri) throws GLib.Error;
- [CCode (cname = "tracker_resources_load_async")]
- public void load_async (string uri, Tracker.ReplyVoid callback);
- [CCode (cname = "tracker_resources_sparql_query")]
- public GLib.PtrArray sparql_query (string query) throws GLib.Error;
- [CCode (cname = "tracker_resources_sparql_query_iterate")]
- public Tracker.ResultIterator sparql_query_iterate (string query) throws GLib.Error;
- [CCode (cname = "tracker_resources_sparql_query_async")]
- public void sparql_query_async (string query, Tracker.ReplyGPtrArray callback);
- [CCode (cname = "tracker_resources_sparql_query_iterate_async")]
- public void sparql_query_iterate_async (string query, Tracker.ReplyIterator callback);
- [CCode (cname = "tracker_resources_sparql_update")]
- public void sparql_update (string query) throws GLib.Error;
- [CCode (cname = "tracker_resources_sparql_update_async")]
- public void sparql_update_async (string query, Tracker.ReplyVoid callback);
- [CCode (cname = "tracker_resources_sparql_update_blank")]
- public GLib.PtrArray sparql_update_blank (string query) throws GLib.Error;
- [CCode (cname = "tracker_resources_sparql_update_blank_async")]
- public void sparql_update_blank_async (string query, Tracker.ReplyGPtrArray callback);
- [CCode (cname = "tracker_statistics_get")]
- public GLib.PtrArray statistics_get () throws GLib.Error;
- [CCode (cname = "tracker_statistics_get_async")]
- public void statistics_get_async (Tracker.ReplyGPtrArray callback);
- [CCode (cname = "tracker_resources_writeback_connect")]
- public void writeback_connect (Tracker.WritebackCallback callback);
- [CCode (cname = "tracker_resources_writeback_disconnect")]
- public void writeback_disconnect ();
- }
- [Compact]
- [CCode (free_function = "g_object_unref", cheader_filename = "libtracker-client/tracker-sparql-builder.h")]
- public class SparqlBuilder {
- [CCode (has_construct_function = false)]
- public SparqlBuilder ();
- public void append (string raw);
- public static unowned Tracker.SparqlBuilder @construct (GLib.Type object_type);
- public static unowned Tracker.SparqlBuilder construct_embedded_insert (GLib.Type object_type);
- public static unowned Tracker.SparqlBuilder construct_update (GLib.Type object_type);
- public void delete_close ();
- public void delete_open (string? graph);
- public void drop_graph (string iri);
- [CCode (has_construct_function = false)]
- public SparqlBuilder.embedded_insert ();
- public int get_length ();
- public unowned string get_result ();
- public void insert_close ();
- public void insert_open (string? graph);
- public void object (string s);
- public void object_blank_close ();
- public void object_blank_open ();
- public void object_boolean (bool literal);
- public void object_date (ref time_t literal);
- public void object_double (double literal);
- public void object_int64 (int64 literal);
- public void object_iri (string iri);
- public void object_string (string literal);
- public void object_unvalidated (string value);
- public void object_variable (string var_name);
- public void predicate (string s);
- public void predicate_iri (string iri);
- public void prepend (string raw);
- public void subject (string s);
- public void subject_iri (string iri);
- public void subject_variable (string var_name);
- [CCode (has_construct_function = false)]
- public SparqlBuilder.update ();
- public void where_close ();
- public void where_open ();
- }
- [CCode (cprefix = "TRACKER_CLIENT_ENABLE_", has_type_id = false, cheader_filename = "libtracker-client/tracker-client.h")]
- public enum ClientFlags {
- WARNINGS
- }
-
- [Compact]
- [CCode (cheader_filename = "libtracker-client/tracker-client.h")]
- public class ResultIterator {
- public int n_columns ();
- public bool next ();
- public unowned string value (uint column);
- }
-
- [CCode (cheader_filename = "libtracker-client/tracker-client.h", instance_pos = -2)]
- public delegate void ReplyArray (string result, GLib.Error error);
- [CCode (cheader_filename = "libtracker-client/tracker-client.h", instance_pos = -2)]
- public delegate void ReplyGPtrArray (GLib.PtrArray result, GLib.Error error);
- [CCode (cheader_filename = "libtracker-client/tracker-client.h", instance_pos = -2)]
- public delegate void ReplyIterator (Tracker.ResultIterator iterator, GLib.Error error);
- [CCode (cheader_filename = "libtracker-client/tracker-client.h", instance_pos = -2)]
- public delegate void ReplyVoid (GLib.Error error);
- [CCode (cheader_filename = "libtracker-client/tracker.h", instance_pos = -2)]
- public delegate void WritebackCallback (GLib.HashTable resources);
-
- [CCode (cheader_filename = "libtracker-client/tracker-client.h")]
- public const string DBUS_INTERFACE_RESOURCES;
- [CCode (cheader_filename = "libtracker-client/tracker-client.h")]
- public const string DBUS_INTERFACE_STATISTICS;
- [CCode (cheader_filename = "libtracker-client/tracker-client.h")]
- public const string DBUS_OBJECT;
- [CCode (cheader_filename = "libtracker-client/tracker-client.h")]
- public const string DBUS_SERVICE;
-
- [CCode (cheader_filename = "libtracker-client/tracker-client.h")]
- public static string sparql_escape (string str);
-}
diff --git a/src/libtracker-client/tracker-sparql-builder.vala b/src/libtracker-client/tracker-sparql-builder.vala
deleted file mode 100644
index 3a7444beb..000000000
--- a/src/libtracker-client/tracker-sparql-builder.vala
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Copyright (C) 2009, Nokia
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-public class Tracker.SparqlBuilder : Object {
- public enum State {
- UPDATE,
- INSERT,
- DELETE,
- SUBJECT,
- PREDICATE,
- OBJECT,
- BLANK,
- WHERE,
- EMBEDDED_INSERT
- }
-
- public string result {
- get {
- warn_if_fail (states.length == 1);
- return str.str;
- }
- }
-
- public int length { get; private set; }
-
- public State state {
- get { return states[states.length - 1]; }
- }
-
- State[] states;
- StringBuilder str = new StringBuilder ();
-
- public SparqlBuilder.update () {
- states += State.UPDATE;
- }
-
- public SparqlBuilder.embedded_insert () {
- states += State.EMBEDDED_INSERT;
- states += State.INSERT;
- states += State.SUBJECT;
- }
-
- public void drop_graph (string iri)
- requires (state == State.UPDATE)
- {
- str.append ("DROP GRAPH <%s>\n".printf (iri));
- }
-
- public void insert_open (string? graph)
- requires (state == State.UPDATE)
- {
- states += State.INSERT;
- if (graph != null)
- str.append ("INSERT INTO <%s> {\n".printf (graph));
- else
- str.append ("INSERT {\n");
- }
-
- public void insert_silent_open (string? graph)
- requires (state == State.UPDATE)
- {
- states += State.INSERT;
- if (graph != null)
- str.append ("INSERT SILENT INTO <%s> {\n".printf (graph));
- else
- str.append ("INSERT SILENT {\n");
- }
-
- public void insert_close ()
- requires (state == State.INSERT || state == State.OBJECT)
- {
- if (state == State.OBJECT) {
- str.append (" .\n");
- states.length -= 3;
- }
- states.length--;
-
- if (state != State.EMBEDDED_INSERT) {
- str.append ("}\n");
- }
- }
-
- public void delete_open (string? graph)
- requires (state == State.UPDATE)
- {
- states += State.DELETE;
- if (graph != null)
- str.append ("DELETE FROM <%s> {\n".printf (graph));
- else
- str.append ("DELETE {\n");
- }
-
- public void delete_close ()
- requires (state == State.DELETE || state == State.OBJECT)
- {
- if (state == State.OBJECT) {
- str.append (" .\n");
- states.length -= 3;
- }
- states.length--;
-
- str.append ("}\n");
- }
-
- public void where_open ()
- requires (state == State.UPDATE)
- {
- states += State.WHERE;
- str.append ("WHERE {\n");
- }
-
- public void where_close ()
- requires (state == State.WHERE || state == State.OBJECT)
- {
- if (state == State.OBJECT) {
- str.append (" .\n");
- states.length -= 3;
- }
- states.length--;
- str.append ("}\n");
- }
-
- public void subject_variable (string var_name) {
- subject ("?%s".printf (var_name));
- }
-
- public void object_variable (string var_name) {
- object ("?%s".printf (var_name));
- }
-
- public void subject_iri (string iri) {
- subject ("<%s>".printf (iri));
- }
-
- public void subject (string s)
- requires (state == State.INSERT || state == State.OBJECT || state == State.EMBEDDED_INSERT || state == State.DELETE || state == State.WHERE)
- {
- if (state == State.OBJECT) {
- str.append (" .\n");
- states.length -= 3;
- }
- str.append (s);
- states += State.SUBJECT;
- }
-
- public void predicate_iri (string iri) {
- predicate ("<%s>".printf (iri));
- }
-
- public void predicate (string s)
- requires (state == State.SUBJECT || state == State.OBJECT || state == State.BLANK)
- {
- if (state == State.OBJECT) {
- str.append (" ;\n\t");
- states.length -= 2;
- }
- str.append (" ");
- str.append (s);
- states += State.PREDICATE;
- }
-
- public void object_iri (string iri) {
- object ("<%s>".printf (iri));
- }
-
- public void object (string s)
- requires (state == State.PREDICATE || state == State.OBJECT)
- {
- if (state == State.OBJECT) {
- str.append (" ,");
- states.length--;
- }
- str.append (" ");
- str.append (s);
- states += State.OBJECT;
-
- length++;
- }
-
- public void object_string (string literal)
- requires (state == State.PREDICATE || state == State.OBJECT)
- {
- if (state == State.OBJECT) {
- str.append (" ,");
- states.length--;
- }
-
- str.append (" \"");
-
- char* p = literal;
- while (*p != '\0') {
- size_t len = Posix.strcspn ((string) p, "\t\n\r\"\\");
- str.append_len ((string) p, (long) len);
- p += len;
- switch (*p) {
- case '\t':
- str.append ("\\t");
- break;
- case '\n':
- str.append ("\\n");
- break;
- case '\r':
- str.append ("\\r");
- break;
- case '"':
- str.append ("\\\"");
- break;
- case '\\':
- str.append ("\\\\");
- break;
- default:
- continue;
- }
- p++;
- }
-
- str.append ("\"");
-
- states += State.OBJECT;
-
- length++;
- }
-
- public void object_unvalidated (string value) {
- char* end;
-
- if (!utf8_validate (value, -1, out end)) {
- if (value != end) {
- object_string (value.substring (0, (long) (end - (char*) value)));
- } else {
- object_string ("(invalid data)");
- }
-
- return;
- }
-
- object_string (value);
- }
-
- public void object_boolean (bool literal) {
- object (literal ? "true" : "false");
- }
-
- public void object_int64 (int64 literal) {
- object (literal.to_string ());
- }
-
- public void object_date (ref time_t literal) {
- var tm = Time.gm (literal);
-
- object_string ("%04d-%02d-%02dT%02d:%02d:%02dZ".printf (tm.year + 1900, tm.month + 1, tm.day, tm.hour, tm.minute, tm.second));
- }
-
- public void object_double (double literal) {
- object (literal.to_string ());
- }
-
- public void object_blank_open ()
- requires (state == State.PREDICATE || state == State.OBJECT)
- {
- if (state == State.OBJECT) {
- str.append (" ,");
- states.length--;
- }
- str.append (" [");
- states += State.BLANK;
- }
-
- public void object_blank_close ()
- requires (state == State.OBJECT && states[states.length - 3] == state.BLANK)
- {
- str.append ("]");
- states.length -= 3;
- states += State.OBJECT;
-
- length++;
- }
-
- public void prepend (string raw)
- {
- str.prepend ("%s\n".printf (raw));
- }
-
- public void append (string raw)
- {
- if (state == State.OBJECT) {
- str.append (" .\n");
- states.length -= 3;
- }
-
- str.append (raw);
- }
-}
-
diff --git a/src/libtracker-client/tracker.c b/src/libtracker-client/tracker.c
deleted file mode 100644
index 02e80314c..000000000
--- a/src/libtracker-client/tracker.c
+++ /dev/null
@@ -1,3202 +0,0 @@
-/*
- * Copyright (C) 2006, Jamie McCracken <jamiemcc@gnome.org>
- * Copyright (C) 2008-2010, Nokia <ivan.frade@nokia.com>
- * 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
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#ifndef TRACKER_DISABLE_DEPRECATED
-
-#include <string.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-glib-lowlevel.h>
-#include <dbus/dbus-glib-bindings.h>
-
-#include <gio/gio.h>
-#include <gio/gunixinputstream.h>
-#include <gio/gunixoutputstream.h>
-
-#include <dbus/dbus-glib-bindings.h>
-
-#include <libtracker-common/tracker-dbus.h>
-
-#include "tracker.h"
-#include "tracker-resources-glue.h"
-#include "tracker-statistics-glue.h"
-
-/* Size of buffers used when sending data over a pipe, using DBus FD passing */
-/* NOTE: This was copied here from libtracker-common/tracker-dbus.h
- * because it is only needed in one place now, tracker-miner-fs and
- * libtracker-client is going to be deprecated fairly soon, -mr.
- */
-#define TRACKER_DBUS_PIPE_BUFFER_SIZE 65536
-
-/* Are defined in src/tracker-store/tracker-steroids.h */
-#define TRACKER_STEROIDS_BUFFER_SIZE 65536
-
-#define TRACKER_DBUS_OBJECT_STEROIDS "/org/freedesktop/Tracker1/Steroids"
-#define TRACKER_DBUS_INTERFACE_STEROIDS "org.freedesktop.Tracker1.Steroids"
-
-
-#define TRACKER_TYPE_INT_ARRAY_MAP \
- dbus_g_type_get_map ("GHashTable", G_TYPE_INT, DBUS_TYPE_G_INT_ARRAY)
-
-/**
- * SECTION:tracker
- * @short_description: A client library for querying and inserting
- * data in Tracker.
- * @include: libtracker-client/tracker-client.h
- *
- * This API is for applications which want to integrate with Tracker
- * either by storing their data or by querying it. They are also not
- * limited to their application's data. Other data mined by other
- * applications is also available in some cases.
- *
- * Deprecated: 0.10: This whole library has been replaced by libtracker-sparql
- * in its entirity to provide a cleaner and much more usable API using GLib's
- * asynchronous and cancellable APIS and a foundation Cursor API shared by both
- * a direct and d-bus approach. Additionally all escaping and SPARQL building
- * functionality has moved to this new library and is shared across the Tracker
- * platform.
- **/
-
-/**
- * SECTION:tracker_cancel
- * @short_description: Cancelling requests.
- * @include: libtracker-client/tracker-client.h
- *
- * Tracker allows you to cancel any request that has not been processed
- * yet. Aditionally, for fully synchronous requests, there is helper
- * API to cancel the last request.
- **/
-
-/**
- * SECTION:tracker_resources
- * @short_description: Doing SPARQL queries to tracker-store.
- * @include: libtracker-client/tracker-client.h
- *
- * Tracker uses the SPARQL query language
- * <footnote><para><ulink url="http://www.w3.org/TR/rdf-sparql-query/">SPARQL</ulink> query language for RDF (W3C)</para></footnote>
- * to retrieve data from tracker-store, and the stored information applies to the Nepomuk
- * ontology
- * <footnote><para><ulink url="http://nepomuk.semanticdesktop.org/">Nepomuk</ulink> - The social semantic desktop</para></footnote>.
- **/
-
-/**
- * SECTION:tracker_statistics
- * @short_description: Data statistics.
- * @include: libtracker-client/tracker-client.h
- *
- * This API is meant to get statistics about the stored data.
- **/
-
-/**
- * SECTION:tracker_misc
- * @short_description: Utility and miscellaneous functions.
- * @include: libtracker-client/tracker-client.h
- *
- * This is miscellaneous API that may be useful to users.
- **/
-
-/**
- * SECTION:tracker_search
- * @short_description: Simple search functions.
- * @include: libtracker-client/tracker-client.h
- *
- * Simple search API.
- **/
-
-typedef void (*TrackerClientSendAndSpliceCallback) (void *buffer,
- gssize buffer_size,
- GStrv variable_names,
- GError *error,
- gpointer user_data);
-
-typedef struct {
- GInputStream *unix_input_stream;
- GInputStream *buffered_input_stream;
- GOutputStream *output_stream;
- DBusPendingCall *call;
- TrackerClientSendAndSpliceCallback callback;
- gpointer user_data;
- gboolean expect_variable_names;
-} SendAndSpliceData;
-
-typedef struct {
- DBusGConnection *connection;
- DBusGProxy *proxy_statistics;
- DBusGProxy *proxy_resources;
-
- GHashTable *slow_pending_calls;
- GHashTable *fast_pending_calls;
-
- guint last_call;
-
- gint timeout;
- gboolean enable_warnings;
-
- GList *writeback_callbacks;
-
- gboolean is_constructed;
-} TrackerClientPrivate;
-
-typedef struct {
- DBusGProxy *proxy;
- DBusGProxyCall *pending_call;
-} SlowPendingCallData;
-
-typedef struct {
- TrackerReplyGPtrArray func;
- gpointer data;
- TrackerClient *client;
- guint id;
-} CallbackGPtrArray;
-
-typedef struct {
- TrackerReplyVoid func;
- gpointer data;
- TrackerClient *client;
- guint id;
-} CallbackVoid;
-
-typedef struct {
- guint id;
- TrackerWritebackCallback func;
- gpointer data;
-} WritebackCallback;
-
-#ifndef TRACKER_DISABLE_DEPRECATED
-
-/* Deprecated and only used for 0.6 API */
-typedef struct {
- TrackerReplyArray func;
- gpointer data;
- TrackerClient *client;
- guint id;
-} CallbackArray;
-
-#endif /* TRACKER_DISABLE_DEPRECATED */
-
-struct TrackerResultIterator {
- gchar *buffer;
- gint buffer_index;
- gssize buffer_size;
-
- guint n_columns;
- gint *offsets;
- gint *types;
- gchar *data;
-};
-
-typedef enum {
- FAST_QUERY,
- FAST_UPDATE,
- FAST_UPDATE_BLANK,
- FAST_UPDATE_BATCH
-} FastOperationType;
-
-typedef struct {
- TrackerClient *client;
- guint request_id;
- FastOperationType operation_type;
-
- GCancellable *cancellable;
-
- DBusPendingCall *dbus_call;
-
- union {
- TrackerReplyGPtrArray gptrarray_callback;
- TrackerReplyVoid void_callback;
- TrackerReplyArray array_callback;
- TrackerReplyIterator iterator_callback;
- };
-
- gpointer user_data;
-} FastAsyncData;
-
-typedef struct {
- GCancellable *cancellable;
- FastAsyncData *data;
-} FastPendingCallData;
-
-static gboolean is_service_available (void);
-static void client_finalize (GObject *object);
-static void client_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
-static void client_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec);
-static void client_constructed (GObject *object);
-
-enum {
- PROP_0,
- PROP_ENABLE_WARNINGS,
- PROP_TIMEOUT,
-};
-
-static guint writeback_callback_id = 0;
-
-G_DEFINE_TYPE(TrackerClient, tracker_client, G_TYPE_OBJECT)
-
-#define TRACKER_CLIENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_CLIENT, TrackerClientPrivate))
-
-
-static GStrv
-dbus_send_and_splice_get_variable_names (DBusMessage *message,
- gboolean copy_strings)
-{
- GPtrArray *found;
- DBusMessageIter iter, arr;
-
- dbus_message_iter_init (message, &iter);
- dbus_message_iter_recurse (&iter, &arr);
-
- found = g_ptr_array_new ();
-
- while (dbus_message_iter_get_arg_type (&arr) != DBUS_TYPE_INVALID) {
- gchar *str;
-
- dbus_message_iter_get_basic (&arr, &str);
- g_ptr_array_add (found, copy_strings ? g_strdup (str) : str);
- dbus_message_iter_next (&arr);
- }
-
- g_ptr_array_add (found, NULL);
-
- return (GStrv) g_ptr_array_free (found, FALSE);
-}
-
-/*
- * /!\ BIG FAT WARNING /!\
- * The message must be destroyed for this function to succeed, so pass a
- * message with a refcount of 1 (and say goodbye to it, 'cause you'll never
- * see it again
- */
-static gboolean
-tracker_client_dbus_send_and_splice (DBusConnection *connection,
- DBusMessage *message,
- int fd,
- GCancellable *cancellable,
- void **dest_buffer,
- gssize *dest_buffer_size,
- GStrv *variable_names,
- GError **error)
-{
- DBusPendingCall *call;
- DBusMessage *reply = NULL;
- GInputStream *unix_input_stream;
- GInputStream *buffered_input_stream;
- GOutputStream *output_stream;
- GError *inner_error = NULL;
- gboolean ret_value = FALSE;
-
- g_return_val_if_fail (connection != NULL, FALSE);
- g_return_val_if_fail (message != NULL, FALSE);
- g_return_val_if_fail (fd > 0, FALSE);
- g_return_val_if_fail (dest_buffer != NULL, FALSE);
-
- dbus_connection_send_with_reply (connection,
- message,
- &call,
- -1);
- dbus_message_unref (message);
-
- if (!call) {
- g_set_error (error,
- TRACKER_DBUS_ERROR,
- TRACKER_DBUS_ERROR_UNSUPPORTED,
- "FD passing unsupported or connection disconnected");
- return FALSE;
- }
-
- unix_input_stream = g_unix_input_stream_new (fd, TRUE);
- buffered_input_stream = g_buffered_input_stream_new_sized (unix_input_stream,
- TRACKER_DBUS_PIPE_BUFFER_SIZE);
- output_stream = g_memory_output_stream_new (NULL, 0, g_realloc, NULL);
-
- g_output_stream_splice (output_stream,
- buffered_input_stream,
- G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE |
- G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
- cancellable,
- &inner_error);
-
- if (G_LIKELY (!inner_error)) {
- /* Wait for any current d-bus call to finish */
- dbus_pending_call_block (call);
-
- /* Check we didn't get an error */
- reply = dbus_pending_call_steal_reply (call);
-
- if (G_UNLIKELY (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR)) {
- DBusError dbus_error;
-
- dbus_error_init (&dbus_error);
- dbus_set_error_from_message (&dbus_error, reply);
- dbus_set_g_error (error, &dbus_error);
- dbus_error_free (&dbus_error);
-
- /* If any error happened, we're not passing any received data, so we
- * need to free it */
- g_free (g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (output_stream)));
- } else {
- *dest_buffer = g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (output_stream));
-
- if (dest_buffer_size) {
- *dest_buffer_size = g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (output_stream));
- }
-
- if (variable_names) {
- *variable_names = dbus_send_and_splice_get_variable_names (reply, TRUE);
- }
-
- ret_value = TRUE;
- }
- } else {
- g_set_error (error,
- TRACKER_DBUS_ERROR,
- TRACKER_DBUS_ERROR_BROKEN_PIPE,
- "Couldn't get results from server");
- g_error_free (inner_error);
- /* If any error happened, we're not passing any received data, so we
- * need to free it */
- g_free (g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (output_stream)));
- }
-
- g_object_unref (output_stream);
- g_object_unref (buffered_input_stream);
- g_object_unref (unix_input_stream);
-
- if (reply) {
- dbus_message_unref (reply);
- }
-
- dbus_pending_call_unref (call);
-
- return ret_value;
-}
-
-static SendAndSpliceData *
-send_and_splice_data_new (GInputStream *unix_input_stream,
- GInputStream *buffered_input_stream,
- GOutputStream *output_stream,
- gboolean expect_variable_names,
- DBusPendingCall *call,
- TrackerClientSendAndSpliceCallback callback,
- gpointer user_data)
-{
- SendAndSpliceData *data;
-
- data = g_slice_new0 (SendAndSpliceData);
- data->unix_input_stream = unix_input_stream;
- data->buffered_input_stream = buffered_input_stream;
- data->output_stream = output_stream;
- data->call = call;
- data->callback = callback;
- data->user_data = user_data;
- data->expect_variable_names = expect_variable_names;
-
- return data;
-}
-
-static void
-send_and_splice_data_free (SendAndSpliceData *data)
-{
- g_object_unref (data->unix_input_stream);
- g_object_unref (data->buffered_input_stream);
- g_object_unref (data->output_stream);
- dbus_pending_call_unref (data->call);
- g_slice_free (SendAndSpliceData, data);
-}
-
-static void
-send_and_splice_async_callback (GObject *source,
- GAsyncResult *result,
- gpointer user_data)
-{
- SendAndSpliceData *data = user_data;
- DBusMessage *reply = NULL;
- GError *error = NULL;
-
- g_output_stream_splice_finish (data->output_stream,
- result,
- &error);
-
- if (G_LIKELY (!error)) {
- dbus_pending_call_block (data->call);
- reply = dbus_pending_call_steal_reply (data->call);
-
- if (G_UNLIKELY (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR)) {
- DBusError dbus_error;
-
- /* If any error happened, we're not passing any received data, so we
- * need to free it */
- g_free (g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (data->output_stream)));
-
- dbus_error_init (&dbus_error);
- dbus_set_error_from_message (&dbus_error, reply);
- dbus_set_g_error (&error, &dbus_error);
- dbus_error_free (&dbus_error);
-
- (* data->callback) (NULL, -1, NULL, error, data->user_data);
-
- /* Note: GError should be freed by callback. We do this to be aligned
- * with the behavior of dbus-glib, where if an error happens, the
- * GError passed to the callback is supposed to be disposed by the
- * callback itself. */
- } else {
- GStrv v_names = NULL;
-
- if (data->expect_variable_names) {
- v_names = dbus_send_and_splice_get_variable_names (reply, FALSE);
- }
-
- dbus_pending_call_cancel (data->call);
-
- (* data->callback) (g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (data->output_stream)),
- g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (data->output_stream)),
- v_names,
- NULL,
- data->user_data);
-
- /* Don't use g_strfreev here, see above */
- g_free (v_names);
- }
- } else {
- /* If any error happened, we're not passing any received data, so we
- * need to free it */
- g_free (g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (data->output_stream)));
-
- (* data->callback) (NULL, -1, NULL, error, data->user_data);
-
- /* Note: GError should be freed by callback. We do this to be aligned
- * with the behavior of dbus-glib, where if an error happens, the
- * GError passed to the callback is supposed to be disposed by the
- * callback itself. */
- }
-
- if (reply) {
- dbus_message_unref (reply);
- }
-
- send_and_splice_data_free (data);
-}
-
-static gboolean
-tracker_client_dbus_send_and_splice_async (DBusConnection *connection,
- DBusMessage *message,
- int fd,
- gboolean expect_variable_names,
- GCancellable *cancellable,
- TrackerClientSendAndSpliceCallback callback,
- gpointer user_data)
-{
- DBusPendingCall *call;
- GInputStream *unix_input_stream;
- GInputStream *buffered_input_stream;
- GOutputStream *output_stream;
- SendAndSpliceData *data;
-
- g_return_val_if_fail (connection != NULL, FALSE);
- g_return_val_if_fail (message != NULL, FALSE);
- g_return_val_if_fail (fd > 0, FALSE);
- g_return_val_if_fail (callback != NULL, FALSE);
-
- dbus_connection_send_with_reply (connection,
- message,
- &call,
- -1);
- dbus_message_unref (message);
-
- if (!call) {
- g_critical ("FD passing unsupported or connection disconnected");
- return FALSE;
- }
-
- unix_input_stream = g_unix_input_stream_new (fd, TRUE);
- buffered_input_stream = g_buffered_input_stream_new_sized (unix_input_stream,
- TRACKER_DBUS_PIPE_BUFFER_SIZE);
- output_stream = g_memory_output_stream_new (NULL, 0, g_realloc, NULL);
-
- data = send_and_splice_data_new (unix_input_stream,
- buffered_input_stream,
- output_stream,
- expect_variable_names,
- call,
- callback,
- user_data);
-
- g_output_stream_splice_async (output_stream,
- buffered_input_stream,
- G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE |
- G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
- 0,
- cancellable,
- send_and_splice_async_callback,
- data);
-
- return TRUE;
-}
-
-/* This ID is shared between both fast and slow pending call hash
- * tables and is guaranteed to be unique.
- */
-inline static guint
-pending_call_get_next_id (void)
-{
- static guint pending_call_id = 0;
-
- return ++pending_call_id;
-}
-
-static void
-slow_pending_call_destroy (gpointer data)
-{
- SlowPendingCallData *spcd = data;
-
- if (spcd) {
- if (spcd->proxy) {
- g_object_unref (spcd->proxy);
- }
-
- g_slice_free (SlowPendingCallData, spcd);
- }
-}
-
-static guint
-slow_pending_call_new (TrackerClient *client,
- DBusGProxy *proxy,
- DBusGProxyCall *pending_call)
-{
- TrackerClientPrivate *private;
- SlowPendingCallData *data;
- guint id;
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- id = pending_call_get_next_id ();
-
- data = g_slice_new0 (SlowPendingCallData);
- data->proxy = g_object_ref (proxy);
- data->pending_call = pending_call;
-
- g_hash_table_insert (private->slow_pending_calls,
- GUINT_TO_POINTER (id),
- data);
-
- private->last_call = id;
-
- return id;
-}
-
-static void
-fast_pending_call_destroy (gpointer data)
-{
- FastPendingCallData *fpcd = data;
-
- if (fpcd) {
- g_slice_free (FastPendingCallData, fpcd);
- }
-}
-
-static guint
-fast_pending_call_new (TrackerClient *client,
- GCancellable *cancellable,
- FastAsyncData *async_data)
-{
- TrackerClientPrivate *private;
- FastPendingCallData *data;
- guint id;
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- id = pending_call_get_next_id ();
-
- data = g_slice_new0 (FastPendingCallData);
- data->cancellable = cancellable;
- data->data = async_data;
-
- g_hash_table_insert (private->fast_pending_calls,
- GUINT_TO_POINTER (id),
- data);
-
- private->last_call = id;
-
- return id;
-}
-
-static void
-fast_async_data_free (gpointer data)
-{
- FastAsyncData *fad = data;
-
- if (fad) {
- if (fad->cancellable) {
- g_object_unref (fad->cancellable);
- }
-
- if (fad->client) {
- g_object_unref (fad->client);
- }
-
- g_slice_free (FastAsyncData, fad);
- }
-}
-
-static FastAsyncData *
-fast_async_data_new (TrackerClient *client,
- FastOperationType operation_type,
- GCancellable *cancellable,
- gpointer user_data)
-{
- FastAsyncData *data;
-
- data = g_slice_new0 (FastAsyncData);
-
- data->client = g_object_ref (client);
- data->request_id = fast_pending_call_new (client, cancellable, data);
- data->operation_type = operation_type;
- data->cancellable = cancellable;
- data->user_data = user_data;
-
- return data;
-}
-
-static void
-writeback_cb (DBusGProxy *proxy,
- const GHashTable *resources,
- gpointer user_data)
-{
- TrackerClientPrivate *private;
- WritebackCallback *cb;
- GList *current_callback;
-
- g_return_if_fail (resources != NULL);
- g_return_if_fail (user_data != NULL);
-
- private = user_data;
-
- for (current_callback = private->writeback_callbacks;
- current_callback;
- current_callback = g_list_next (current_callback)) {
- cb = current_callback->data;
- cb->func (resources, cb->data);
- }
-}
-
-static void
-tracker_client_class_init (TrackerClientClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS (klass);
-
- object_class->finalize = client_finalize;
- object_class->set_property = client_set_property;
- object_class->get_property = client_get_property;
- object_class->constructed = client_constructed;
-
- g_object_class_install_property (object_class,
- PROP_ENABLE_WARNINGS,
- g_param_spec_boolean ("enable-warnings",
- "Enable warnings",
- "Enable warnings",
- TRUE,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
- g_object_class_install_property (object_class,
- PROP_TIMEOUT,
- g_param_spec_int ("timeout",
- "Timeout",
- "Timeout",
- -1,
- G_MAXINT,
- -1,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (object_class, sizeof (TrackerClientPrivate));
-}
-
-static void
-tracker_client_init (TrackerClient *client)
-{
- TrackerClientPrivate *private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- private->timeout = -1;
- private->slow_pending_calls = g_hash_table_new_full (NULL,
- NULL,
- NULL,
- (GDestroyNotify) slow_pending_call_destroy);
-
- private->fast_pending_calls = g_hash_table_new_full (NULL,
- NULL,
- NULL,
- (GDestroyNotify) fast_pending_call_destroy);
-}
-
-static void
-client_finalize (GObject *object)
-{
- TrackerClientPrivate *private = TRACKER_CLIENT_GET_PRIVATE (object);
-
- if (private->proxy_statistics) {
- g_object_unref (private->proxy_statistics);
- }
-
- if (private->proxy_resources) {
- g_object_unref (private->proxy_resources);
- }
-
- if (private->slow_pending_calls) {
- g_hash_table_unref (private->slow_pending_calls);
- }
-
- if (private->fast_pending_calls) {
- g_hash_table_unref (private->fast_pending_calls);
- }
-}
-
-static void
-client_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- TrackerClientPrivate *private = TRACKER_CLIENT_GET_PRIVATE (object);
-
- switch (prop_id) {
- case PROP_ENABLE_WARNINGS:
- private->enable_warnings = g_value_get_boolean (value);
- g_object_notify (object, "enable_warnings");
- break;
- case PROP_TIMEOUT:
- private->timeout = g_value_get_int (value);
-
- /* Sanity check timeout */
- if (private->timeout == 0) {
- /* Can't use 0, no D-Bus calls are ever quick
- * enough :) which is quite funny.
- */
- private->timeout = -1;
- }
-
- if (private->is_constructed) {
- dbus_g_proxy_set_default_timeout (private->proxy_resources,
- private->timeout);
- }
-
- g_object_notify (object, "timeout");
-
- break;
- default:
-
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- }
-}
-
-static void
-client_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- TrackerClientPrivate *private = TRACKER_CLIENT_GET_PRIVATE (object);
-
- switch (prop_id) {
- case PROP_ENABLE_WARNINGS:
- g_value_set_boolean (value, private->enable_warnings);
- break;
- case PROP_TIMEOUT:
- g_value_set_int (value, private->timeout);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- }
-}
-
-static void
-client_constructed (GObject *object)
-{
- TrackerClientPrivate *private;
- DBusGConnection *connection;
- GError *error = NULL;
-
- private = TRACKER_CLIENT_GET_PRIVATE (object);
- connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
-
- if (!connection || error) {
- if (private->enable_warnings) {
- g_warning ("Could not connect to D-Bus session bus, %s\n",
- error ? error->message : "no error given");
- }
-
- g_clear_error (&error);
- return;
- }
-
- private->connection = connection;
-
- private->proxy_statistics =
- dbus_g_proxy_new_for_name (connection,
- TRACKER_DBUS_SERVICE,
- TRACKER_DBUS_OBJECT "/Statistics",
- TRACKER_DBUS_INTERFACE_STATISTICS);
-
- private->proxy_resources =
- dbus_g_proxy_new_for_name (connection,
- TRACKER_DBUS_SERVICE,
- TRACKER_DBUS_OBJECT "/Resources",
- TRACKER_DBUS_INTERFACE_RESOURCES);
-
- /* NOTE: We don't need to set this for the stats proxy, the
- * query takes no arguments and is generally really fast.
- */
- dbus_g_proxy_set_default_timeout (private->proxy_resources,
- private->timeout);
-
- dbus_g_proxy_add_signal (private->proxy_resources,
- "Writeback",
- TRACKER_TYPE_INT_ARRAY_MAP,
- G_TYPE_INVALID);
-
- private->is_constructed = TRUE;
-}
-
-GQuark
-tracker_client_error_quark (void)
-{
- return g_quark_from_static_string (TRACKER_CLIENT_ERROR_DOMAIN);
-}
-
-static void
-callback_with_gptrarray (DBusGProxy *proxy,
- GPtrArray *OUT_result,
- GError *error,
- gpointer user_data)
-{
- TrackerClientPrivate *private;
- CallbackGPtrArray *cb = user_data;
-
- private = TRACKER_CLIENT_GET_PRIVATE (cb->client);
- g_hash_table_remove (private->slow_pending_calls,
- GUINT_TO_POINTER (cb->id));
-
- (*(TrackerReplyGPtrArray) cb->func) (OUT_result, error, cb->data);
-
- g_object_unref (cb->client);
- g_slice_free (CallbackGPtrArray, cb);
-}
-
-static void
-callback_with_void (DBusGProxy *proxy,
- GError *error,
- gpointer user_data)
-{
- TrackerClientPrivate *private;
- CallbackVoid *cb = user_data;
-
- private = TRACKER_CLIENT_GET_PRIVATE (cb->client);
- g_hash_table_remove (private->slow_pending_calls,
- GUINT_TO_POINTER (cb->id));
-
- (*(TrackerReplyVoid) cb->func) (error, cb->data);
-
- g_object_unref (cb->client);
- g_slice_free (CallbackVoid, cb);
-}
-
-static inline int
-iterator_buffer_read_int (TrackerResultIterator *iterator)
-{
- int v = *((int *)(iterator->buffer + iterator->buffer_index));
-
- iterator->buffer_index += 4;
-
- return v;
-}
-
-static void
-callback_iterator (void *buffer,
- gssize buffer_size,
- GStrv variable_names,
- GError *error,
- gpointer user_data)
-{
- TrackerClientPrivate *private;
- FastAsyncData *fad;
- TrackerResultIterator *iterator;
-
- fad = user_data;
-
- private = TRACKER_CLIENT_GET_PRIVATE (fad->client);
- g_hash_table_remove (private->fast_pending_calls,
- GUINT_TO_POINTER (fad->request_id));
-
-
- /* Check for errors */
- if (G_LIKELY (!error)) {
- iterator = g_slice_new0 (TrackerResultIterator);
-
- iterator->buffer = buffer;
- iterator->buffer_size = buffer_size;
- iterator->buffer_index = 0;
-
- (* fad->iterator_callback) (iterator, NULL, fad->user_data);
-
- tracker_result_iterator_free (iterator);
- } else {
- if (error->code != G_IO_ERROR_CANCELLED) {
- GError *iterator_error;
-
- iterator_error = g_error_new (TRACKER_CLIENT_ERROR,
- TRACKER_CLIENT_ERROR_BROKEN_PIPE,
- "Couldn't get results from server");
-
- (* fad->iterator_callback) (NULL, iterator_error, fad->user_data);
-
- /* iterator_error was passed to the callback and should be
- * disposed there */
- }
-
- /* Always free input GError. We want to behave exactly as if this
- * callback were one used in an async dbus-glib query. */
- g_error_free (error);
- }
-
- fast_async_data_free (fad);
-}
-
-/* Deprecated and only used for 0.6 API */
-static void
-callback_with_array (DBusGProxy *proxy,
- GPtrArray *OUT_result,
- GError *error,
- gpointer user_data)
-{
- TrackerClientPrivate *private;
- CallbackArray *cb = user_data;
- gchar **uris;
- gint i;
-
- private = TRACKER_CLIENT_GET_PRIVATE (cb->client);
- g_hash_table_remove (private->slow_pending_calls,
- GUINT_TO_POINTER (cb->id));
-
- uris = g_new0 (gchar *, OUT_result->len + 1);
- for (i = 0; i < OUT_result->len; i++) {
- uris[i] = ((gchar **) OUT_result->pdata[i])[0];
- }
-
- (*(TrackerReplyArray) cb->func) (uris, error, cb->data);
-
- g_ptr_array_foreach (OUT_result, (GFunc) g_free, NULL);
- g_ptr_array_free (OUT_result, TRUE);
-
- g_object_unref (cb->client);
- g_slice_free (CallbackArray, cb);
-}
-
-static gboolean
-is_service_available (void)
-{
- GError *error = NULL;
- DBusGConnection *conn;
- DBusGProxy *proxy;
- GStrv result, p;
- gboolean found = FALSE;
-
- conn = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
-
- if (!conn) {
- g_critical ("Could not connect to the D-Bus session bus, %s",
- error ? error->message : "no error given.");
- g_error_free (error);
- return FALSE;
- }
-
- proxy = dbus_g_proxy_new_for_name (conn,
- DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS);
-
- if (!proxy) {
- g_critical ("Could not create a proxy for the Freedesktop service, %s",
- error ? error->message : "no error given.");
- g_error_free (error);
- return FALSE;
- }
-
- org_freedesktop_DBus_list_activatable_names (proxy, &result, &error);
- g_object_unref (proxy);
-
- if (error) {
- g_critical ("Could not start Tracker service '%s', %s",
- TRACKER_DBUS_SERVICE,
- error ? error->message : "no error given");
- g_clear_error (&error);
-
- return FALSE;
- }
-
- if (!result) {
- return FALSE;
- }
-
- for (p = result; *p && !found; p++) {
- if (strcmp (*p, TRACKER_DBUS_SERVICE) == 0) {
- found = TRUE;
- }
- }
-
- g_strfreev (result);
-
- return found;
-}
-
-/**
- * tracker_sparql_escape:
- * @str: a string to escape.
- *
- * Escapes a string so it can be passed as a SPARQL parameter in
- * any query/update.
- *
- * Deprecated: 0.10: Use tracker_sparql_escape_string() in libtracker-sparql
- * instead.
- *
- * Returns: the newly allocated escaped string which must be freed
- * using g_free().
- *
- * Since: 0.8
- *
- **/
-gchar *
-tracker_sparql_escape (const gchar *str)
-{
- gchar *escaped_string;
- const gchar *p;
- gchar *q;
-
- g_return_val_if_fail (str != NULL, NULL);
-
- escaped_string = g_malloc (2 * strlen (str) + 1);
-
- p = str;
- q = escaped_string;
-
- while (*p != '\0') {
- switch (*p) {
- case '\t':
- *q++ = '\\';
- *q++ = 't';
- break;
- case '\n':
- *q++ = '\\';
- *q++ = 'n';
- break;
- case '\r':
- *q++ = '\\';
- *q++ = 'r';
- break;
- case '\b':
- *q++ = '\\';
- *q++ = 'b';
- break;
- case '\f':
- *q++ = '\\';
- *q++ = 'f';
- break;
- case '"':
- *q++ = '\\';
- *q++ = '"';
- break;
- case '\\':
- *q++ = '\\';
- *q++ = '\\';
- break;
- default:
- *q++ = *p;
- break;
- }
- p++;
- }
- *q = '\0';
-
- return escaped_string;
-}
-
-static const char *
-find_conversion (const char *format,
- const char **after)
-{
- const char *start = format;
- const char *cp;
-
- while (*start != '\0' && *start != '%')
- start++;
-
- if (*start == '\0') {
- *after = start;
- return NULL;
- }
-
- cp = start + 1;
-
- if (*cp == '\0') {
- *after = cp;
- return NULL;
- }
-
- /* Test for positional argument. */
- if (*cp >= '0' && *cp <= '9') {
- const char *np;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- ;
- if (*np == '$')
- cp = np + 1;
- }
-
- /* Skip the flags. */
- for (;;) {
- if (*cp == '\'' ||
- *cp == '-' ||
- *cp == '+' ||
- *cp == ' ' ||
- *cp == '#' ||
- *cp == '0')
- cp++;
- else
- break;
- }
-
- /* Skip the field width. */
- if (*cp == '*') {
- cp++;
-
- /* Test for positional argument. */
- if (*cp >= '0' && *cp <= '9') {
- const char *np;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- ;
- if (*np == '$')
- cp = np + 1;
- }
- } else {
- for (; *cp >= '0' && *cp <= '9'; cp++)
- ;
- }
-
- /* Skip the precision. */
- if (*cp == '.') {
- cp++;
- if (*cp == '*') {
- /* Test for positional argument. */
- if (*cp >= '0' && *cp <= '9') {
- const char *np;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- ;
- if (*np == '$')
- cp = np + 1;
- }
- } else {
- for (; *cp >= '0' && *cp <= '9'; cp++)
- ;
- }
- }
-
- /* Skip argument type/size specifiers. */
- while (*cp == 'h' ||
- *cp == 'L' ||
- *cp == 'l' ||
- *cp == 'j' ||
- *cp == 'z' ||
- *cp == 'Z' ||
- *cp == 't')
- cp++;
-
- /* Skip the conversion character. */
- cp++;
-
- *after = cp;
- return start;
-}
-
-static GHashTable *
-unmarshal_hash_table (DBusMessageIter *iter)
-{
- GHashTable *result;
- DBusMessageIter subiter, subsubiter;
-
- result = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- (GDestroyNotify) g_free,
- (GDestroyNotify) g_free);
-
- dbus_message_iter_recurse (iter, &subiter);
-
- while (dbus_message_iter_get_arg_type (&subiter) != DBUS_TYPE_INVALID) {
- const gchar *key, *value;
-
- dbus_message_iter_recurse (&subiter, &subsubiter);
- dbus_message_iter_get_basic (&subsubiter, &key);
- dbus_message_iter_next (&subsubiter);
- dbus_message_iter_get_basic (&subsubiter, &value);
- g_hash_table_insert (result, g_strdup (key), g_strdup (value));
-
- dbus_message_iter_next (&subiter);
- }
-
- return result;
-}
-
-static void
-sparql_update_fast_callback (DBusPendingCall *call,
- void *user_data)
-{
- TrackerClientPrivate *private;
- FastAsyncData *fad = user_data;
- DBusMessage *reply;
- GError *error = NULL;
- DBusMessageIter iter, subiter, subsubiter;
- GPtrArray *result;
-
- /* Clean up pending calls */
- private = TRACKER_CLIENT_GET_PRIVATE (fad->client);
- g_hash_table_remove (private->fast_pending_calls,
- GUINT_TO_POINTER (fad->request_id));
-
- /* Check for errors */
- reply = dbus_pending_call_steal_reply (call);
-
- if (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR) {
- DBusError dbus_error;
-
- dbus_error_init (&dbus_error);
- dbus_set_error_from_message (&dbus_error, reply);
- dbus_set_g_error (&error, &dbus_error);
- dbus_error_free (&dbus_error);
-
- switch (fad->operation_type) {
- case FAST_UPDATE:
- case FAST_UPDATE_BATCH:
- (* fad->void_callback) (error, fad->user_data);
- break;
- case FAST_UPDATE_BLANK:
- (* fad->gptrarray_callback) (NULL, error, fad->user_data);
- break;
- default:
- g_assert_not_reached ();
- break;
- }
-
- dbus_message_unref (reply);
-
- fast_async_data_free (fad);
-
- dbus_pending_call_unref (call);
- return;
- }
-
- /* Call iterator callback */
- switch (fad->operation_type) {
- case FAST_UPDATE:
- case FAST_UPDATE_BATCH:
- (* fad->void_callback) (NULL, fad->user_data);
- break;
- case FAST_UPDATE_BLANK:
- result = g_ptr_array_new ();
- dbus_message_iter_init (reply, &iter);
- dbus_message_iter_recurse (&iter, &subiter);
-
- while (dbus_message_iter_get_arg_type (&subiter) != DBUS_TYPE_INVALID) {
- GPtrArray *inner_array;
-
- inner_array = g_ptr_array_new ();
- g_ptr_array_add (result, inner_array);
- dbus_message_iter_recurse (&subiter, &subsubiter);
-
- while (dbus_message_iter_get_arg_type (&subsubiter) != DBUS_TYPE_INVALID) {
- g_ptr_array_add (inner_array, unmarshal_hash_table (&subsubiter));
- dbus_message_iter_next (&subsubiter);
- }
-
- dbus_message_iter_next (&subiter);
- }
-
- (* fad->gptrarray_callback) (result, error, fad->user_data);
-
- break;
- default:
- g_assert_not_reached ();
- break;
- }
-
- /* Clean up */
- dbus_message_unref (reply);
-
- fast_async_data_free (fad);
-
- dbus_pending_call_unref (call);
-}
-
-static DBusPendingCall *
-sparql_update_fast_send (TrackerClient *client,
- const gchar *query,
- FastOperationType type,
- GError **error)
-{
- TrackerClientPrivate *private;
- DBusConnection *connection;
- const gchar *dbus_method;
- DBusMessage *message;
- DBusMessageIter iter;
- DBusPendingCall *call;
- int pipefd[2];
- GOutputStream *output_stream;
- GOutputStream *buffered_output_stream;
- GDataOutputStream *data_output_stream;
- GError *inner_error = NULL;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), NULL);
- g_return_val_if_fail (query != NULL, NULL);
-
- if (pipe (pipefd) < 0) {
- g_set_error (error,
- TRACKER_CLIENT_ERROR,
- TRACKER_CLIENT_ERROR_UNSUPPORTED,
- "Cannot open pipe");
- return NULL;
- }
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
- connection = dbus_g_connection_get_connection (private->connection);
-
- switch (type) {
- case FAST_UPDATE:
- dbus_method = "Update";
- break;
- case FAST_UPDATE_BLANK:
- dbus_method = "UpdateBlank";
- break;
- case FAST_UPDATE_BATCH:
- dbus_method = "BatchUpdate";
- break;
- default:
- g_assert_not_reached ();
- }
-
- message = dbus_message_new_method_call (TRACKER_DBUS_SERVICE,
- TRACKER_DBUS_OBJECT_STEROIDS,
- TRACKER_DBUS_INTERFACE_STEROIDS,
- dbus_method);
- dbus_message_iter_init_append (message, &iter);
- dbus_message_iter_append_basic (&iter, DBUS_TYPE_UNIX_FD, &pipefd[0]);
- dbus_connection_send_with_reply (connection,
- message,
- &call,
- -1);
- dbus_message_unref (message);
- close (pipefd[0]);
-
- if (!call) {
- g_set_error (error,
- TRACKER_CLIENT_ERROR,
- TRACKER_CLIENT_ERROR_UNSUPPORTED,
- "FD passing unsupported or connection disconnected");
- return NULL;
- }
-
- output_stream = g_unix_output_stream_new (pipefd[1], TRUE);
- buffered_output_stream = g_buffered_output_stream_new_sized (output_stream,
- TRACKER_STEROIDS_BUFFER_SIZE);
- data_output_stream = g_data_output_stream_new (buffered_output_stream);
- g_data_output_stream_set_byte_order (data_output_stream, G_DATA_STREAM_BYTE_ORDER_HOST_ENDIAN);
-
- g_data_output_stream_put_int32 (data_output_stream,
- strlen (query),
- NULL,
- &inner_error);
-
- if (inner_error) {
- g_propagate_error (error, inner_error);
- g_object_unref (data_output_stream);
- g_object_unref (buffered_output_stream);
- g_object_unref (output_stream);
- return NULL;
- }
-
- g_data_output_stream_put_string (data_output_stream,
- query,
- NULL,
- &inner_error);
-
- if (inner_error) {
- g_propagate_error (error, inner_error);
- g_object_unref (data_output_stream);
- g_object_unref (buffered_output_stream);
- g_object_unref (output_stream);
- return NULL;
- }
-
- g_object_unref (data_output_stream);
- g_object_unref (buffered_output_stream);
- g_object_unref (output_stream);
-
- return call;
-}
-
-static DBusMessage *
-sparql_update_fast (TrackerClient *client,
- const gchar *query,
- FastOperationType type,
- GError **error)
-{
- DBusPendingCall *call;
- DBusMessage *reply;
-
- call = sparql_update_fast_send (client, query, type, error);
- if (!call) {
- return NULL;
- }
-
- dbus_pending_call_block (call);
-
- reply = dbus_pending_call_steal_reply (call);
-
- if (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR) {
- DBusError dbus_error;
-
- dbus_error_init (&dbus_error);
- dbus_set_error_from_message (&dbus_error, reply);
- dbus_set_g_error (error, &dbus_error);
- dbus_pending_call_unref (call);
- dbus_error_free (&dbus_error);
-
- return NULL;
- }
-
- dbus_pending_call_unref (call);
-
- return reply;
-}
-
-static void
-sparql_update_fast_async (TrackerClient *client,
- const gchar *query,
- FastAsyncData *fad,
- GError **error)
-{
- DBusPendingCall *call;
-
- call = sparql_update_fast_send (client, query, fad->operation_type, error);
- if (!call) {
- /* Do some clean up ?*/
- return;
- }
-
- fad->dbus_call = call;
-
- dbus_pending_call_set_notify (call, sparql_update_fast_callback, fad, NULL);
-}
-
-/**
- * tracker_uri_vprintf_escaped:
- * @format: a standard printf() format string, but notice
- * <link linkend="string-precision">string precision pitfalls</link>
- * @args: the list of parameters to insert into the format string
- *
- * Similar to the standard C vsprintf() function but safer, since it
- * calculates the maximum space required and allocates memory to hold
- * the result.
- *
- * The result is escaped using g_uri_escape_string().
- *
- * Deprecated: 0.10: Use tracker_sparql_escape_uri_vprintf() in libtracker-sparql
- * instead.
- *
- * Returns: a newly-allocated string holding the result which should
- * be freed with g_free() when finished with.
- *
- * Since: 0.8
- */
-gchar *
-tracker_uri_vprintf_escaped (const gchar *format,
- va_list args)
-{
- GString *format1;
- GString *format2;
- GString *result = NULL;
- gchar *output1 = NULL;
- gchar *output2 = NULL;
- const char *p;
- gchar *op1, *op2;
- va_list args2;
-
- format1 = g_string_new (NULL);
- format2 = g_string_new (NULL);
- p = format;
- while (TRUE) {
- const char *after;
- const char *conv = find_conversion (p, &after);
- if (!conv)
- break;
-
- g_string_append_len (format1, conv, after - conv);
- g_string_append_c (format1, 'X');
- g_string_append_len (format2, conv, after - conv);
- g_string_append_c (format2, 'Y');
-
- p = after;
- }
-
- /* Use them to format the arguments
- */
- G_VA_COPY (args2, args);
-
- output1 = g_strdup_vprintf (format1->str, args);
- va_end (args);
- if (!output1) {
- va_end (args2);
- goto cleanup;
- }
-
- output2 = g_strdup_vprintf (format2->str, args2);
- va_end (args2);
- if (!output2)
- goto cleanup;
-
- result = g_string_new (NULL);
-
- op1 = output1;
- op2 = output2;
- p = format;
- while (TRUE) {
- const char *after;
- const char *output_start;
- const char *conv = find_conversion (p, &after);
- char *escaped;
-
- if (!conv) {
- g_string_append_len (result, p, after - p);
- break;
- }
-
- g_string_append_len (result, p, conv - p);
- output_start = op1;
- while (*op1 == *op2) {
- op1++;
- op2++;
- }
-
- *op1 = '\0';
- escaped = g_uri_escape_string (output_start, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT, FALSE);
- g_string_append (result, escaped);
- g_free (escaped);
-
- p = after;
- op1++;
- op2++;
- }
-
-cleanup:
- g_string_free (format1, TRUE);
- g_string_free (format2, TRUE);
- g_free (output1);
- g_free (output2);
-
- if (result)
- return g_string_free (result, FALSE);
- else
- return NULL;
-}
-
-/**
- * tracker_uri_printf_escaped:
- * @format: a standard printf() format string, but notice
- * <link linkend="string-precision">string precision pitfalls</link>
- * @Varargs: the parameters to insert into the format string
- *
- * Calls tracker_uri_vprintf_escaped() with the @Varargs supplied.
- *
- * Deprecated: 0.10: Use tracker_sparql_escape_uri_printf() in libtracker-sparql
- * instead.
- *
- * Returns: a newly-allocated string holding the result which should
- * be freed with g_free() when finished with.
- *
- * Since: 0.8
- **/
-gchar *
-tracker_uri_printf_escaped (const gchar *format, ...)
-{
- gchar *result;
- va_list args;
-
- va_start (args, format);
- result = tracker_uri_vprintf_escaped (format, args);
- va_end (args);
-
- return result;
-}
-
-/**
- * tracker_client_new:
- * @flags: This can be one or more combinations of #TrackerClientFlags
- * @timeout: a #gint used for D-Bus call timeouts.
- *
- * Creates a connection over D-Bus to the Tracker store for doing data
- * querying and inserting.
- *
- * The @timeout is only used if it is > 0. If it is, then it is used
- * with dbus_g_proxy_set_default_timeout().
- *
- * Deprecated: 0.10: Use tracker_bus_connection_new() or
- * tracker_direct_connection_new() in libtracker-sparql instead
- *
- * Returns: the #TrackerClient which should be freed with
- * g_object_unref() when finished with.
- **/
-TrackerClient *
-tracker_client_new (TrackerClientFlags flags,
- gint timeout)
-{
- gboolean enable_warnings;
-
- g_type_init ();
-
- if (!is_service_available ()) {
- return NULL;
- }
-
- enable_warnings = (flags & TRACKER_CLIENT_ENABLE_WARNINGS);
-
- return g_object_new (TRACKER_TYPE_CLIENT,
- "enable-warnings", enable_warnings,
- "timeout", timeout,
- NULL);
-}
-
-/**
- * tracker_cancel_call:
- * @client: a #TrackerClient.
- * @call_id: a #guint id for the API call you want to cancel.
- *
- * The @call_id is a #guint which increments with each asynchronous
- * API call made using libtracker-client. For synchronous API calls,
- * see tracker_cancel_last_call() which is more useful.
- *
- * Deprecated: 0.10: There is no replacement for this in libtracker-sparql
- *
- * Returns: A @gboolean indicating if the call was cancelled or not.
- **/
-gboolean
-tracker_cancel_call (TrackerClient *client,
- guint call_id)
-{
- TrackerClientPrivate *private;
- gpointer data;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), FALSE);
- g_return_val_if_fail (call_id >= 1, FALSE);
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- /* Check slow pending data first */
- data = g_hash_table_lookup (private->slow_pending_calls,
- GUINT_TO_POINTER (call_id));
- if (data) {
- SlowPendingCallData *slow_data = data;
-
- dbus_g_proxy_cancel_call (slow_data->proxy, slow_data->pending_call);
- g_hash_table_remove (private->slow_pending_calls,
- GUINT_TO_POINTER (call_id));
- return TRUE;
- }
-
- /* Check fast pending data last */
- data = g_hash_table_lookup (private->fast_pending_calls,
- GUINT_TO_POINTER (call_id));
-
- if (data) {
- FastPendingCallData *fast_data = data;
- FastAsyncData *fad = fast_data->data;
-
- if (fad->dbus_call) {
- dbus_pending_call_cancel (fad->dbus_call);
- dbus_pending_call_unref (fad->dbus_call);
- fad->dbus_call = NULL;
- }
-
- switch (fad->operation_type) {
- case FAST_QUERY:
- /* When cancelling a GIO call, the callback is called with an
- * error, so we do the cleanup there
- */
- if (fad->cancellable) {
- g_cancellable_cancel (fad->cancellable);
- g_object_unref (fad->cancellable);
- fad->cancellable = NULL;
- }
- break;
-
- case FAST_UPDATE:
- case FAST_UPDATE_BLANK:
- case FAST_UPDATE_BATCH:
- /* dbus_pending_call_cancel does unref the call, so no need to
- * unref it here
- */
- fast_async_data_free (fad);
- break;
-
- default:
- g_assert_not_reached ();
- }
-
- g_hash_table_remove (private->fast_pending_calls,
- GUINT_TO_POINTER (call_id));
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- * tracker_cancel_last_call:
- * @client: a #TrackerClient.
- *
- * Cancels the last API call made using tracker_cancel_call(). the
- * last API call ID is always tracked so you don't have to provide it
- * with this API.
- *
- * Deprecated: 0.10: There is no replacement for this in libtracker-sparql
- *
- * Returns: A #gboolean indicating if the call was cancelled or not.
- **/
-gboolean
-tracker_cancel_last_call (TrackerClient *client)
-{
- TrackerClientPrivate *private;
- gboolean cancelled;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), FALSE);
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- g_return_val_if_fail (private->last_call != 0, FALSE);
-
- cancelled = tracker_cancel_call (client, private->last_call);
- private->last_call = 0;
-
- return cancelled;
-}
-
-/**
- * tracker_statistics_get:
- * @client: a #TrackerClient.
- * @error: a #GError.
- *
- * Requests statistics about each class in the ontology (for example,
- * nfo:Image and nmm:Photo which indicate the number of images and the
- * number of photos).
- *
- * The returned #GPtrArray contains an array of #GStrv which have 2
- * strings. The first is the class (e.g. nfo:Image), the second is the
- * count for that class.
- *
- * This API call is completely synchronous so it may block.
- *
- * Deprecated: 0.10: Use tracker_sparql_stats() in libtracker-sparql
- * instead.
- *
- * Returns: A #GPtrArray with the statistics which must be freed using
- * g_ptr_array_free().
- *
- * Since: 0.8
- **/
-GPtrArray *
-tracker_statistics_get (TrackerClient *client,
- GError **error)
-{
- TrackerClientPrivate *private;
- GPtrArray *table;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), NULL);
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- if (!org_freedesktop_Tracker1_Statistics_get (private->proxy_statistics,
- &table,
- error)) {
- return NULL;
- }
-
- return table;
-}
-
-/**
- * tracker_resources_load:
- * @client: a #TrackerClient.
- * @uri: a string representing a Turtle file
- * @error: a #GError.
- *
- * Imports SPARQL into the database from a file specified by @uri
- *
- * Deprecated: 0.10: Use tracker_sparql_import() in libtracker-sparql
- * instead.
- *
- * Since: 0.8
- **/
-void
-tracker_resources_load (TrackerClient *client,
- const gchar *uri,
- GError **error)
-{
- TrackerClientPrivate *private;
-
- g_return_if_fail (TRACKER_IS_CLIENT (client));
- g_return_if_fail (uri != NULL);
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- org_freedesktop_Tracker1_Resources_load (private->proxy_resources,
- uri,
- error);
-}
-
-/**
- * tracker_resources_sparql_query:
- * @client: a #TrackerClient.
- * @query: a string representing SPARQL.
- * @error: a #GError.
- *
- * Queries the database using SPARQL. An example query would be:
- *
- * <example>
- * <title>Using tracker_resource_sparql_query(<!-- -->)</title>
- * An example of using tracker_resource_sparql_query() to list all
- * albums by title and include their song count and song total length.
- * <programlisting>
- * TrackerClient *client;
- * GPtrArray *array;
- * GError *error = NULL;
- * const gchar *query;
- *
- * /&ast; Create D-Bus connection with no warnings and maximum timeout. &ast;/
- * client = tracker_client_new (0, G_MAXINT);
- * query = "SELECT {"
- * " ?album"
- * " ?title"
- * " COUNT(?song) AS songs"
- * " SUM(?length) AS totallength"
- * "} WHERE {"
- * " ?album a nmm:MusicAlbum ;"
- * " nie:title ?title ."
- * " ?song nmm:musicAlbum ?album ;"
- * " nfo:duration ?length"
- * "} "
- * "GROUP BY (?album");
- *
- * array = tracker_resources_sparql_query (client, query, &error);
- *
- * if (error) {
- * g_warning ("Could not query Tracker, %s", error->message);
- * g_error_free (error);
- * g_object_unref (client);
- * return;
- * }
- *
- * /&ast; Do something with the array &ast;/
- *
- * g_ptr_array_free (array, TRUE);
- * </programlisting>
- * </example>
- *
- * This API call is completely synchronous so it may block.
- *
- * Deprecated: 0.10: Use tracker_sparql_query() in libtracker-sparql
- * instead.
- *
- * Returns: A #GPtrArray with the query results which must be freed
- * using g_ptr_array_free().
- *
- * Since: 0.8
- **/
-GPtrArray *
-tracker_resources_sparql_query (TrackerClient *client,
- const gchar *query,
- GError **error)
-{
- TrackerClientPrivate *private;
- GPtrArray *table;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), FALSE);
- g_return_val_if_fail (query != NULL, FALSE);
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- if (!org_freedesktop_Tracker1_Resources_sparql_query (private->proxy_resources,
- query,
- &table,
- error)) {
- return NULL;
- }
-
- return table;
-}
-
-/**
- * tracker_resources_sparql_query_iterate:
- * @client: a #TrackerClient.
- * @query: a string representing SPARQL.
- * @error: a #GError.
- *
- * Queries the database using SPARQL, and returns an iterator instead of an
- * array with all the results inside.
- *
- * Using an iterator will lower the memory usage. Additionally, this function
- * uses a pipe when available get the results from Tracker store, which is
- * roughly two times faster than using DBus.
- *
- * This API call is completely synchronous so it may block.
- *
- * <example>
- * <title>Using tracker_resources_sparql_query_iterate(<!-- -->)</title>
- * An example of using tracker_resources_sparql_query_iterate() to list all
- * albums by title and include their song count and song total length.
- * <programlisting>
- * TrackerClient *client;
- * TrackerResultIterator *iterator;
- * GError *error = NULL;
- * const gchar *query;
- *
- * /&ast; Create D-Bus connection with no warnings and maximum timeout. &ast;/
- * client = tracker_client_new (0, G_MAXINT);
- * query = "SELECT {"
- * " ?album"
- * " ?title"
- * " COUNT(?song) AS songs"
- * " SUM(?length) AS totallength"
- * "} WHERE {"
- * " ?album a nmm:MusicAlbum ;"
- * " nie:title ?title ."
- * " ?song nmm:musicAlbum ?album ;"
- * " nfo:duration ?length"
- * "} "
- * "GROUP BY (?album");
- *
- * iterator = tracker_resources_sparql_query_iterate (client, query, &error);
- *
- * if (error) {
- * g_warning ("Could not query Tracker, %s", error->message);
- * g_error_free (error);
- * g_object_unref (client);
- * return;
- * }
- *
- * while (tracker_result_iterator_next (iterator)) {
- * g_message ("Album: %s, Title: %s",
- * tracker_result_iterator_value (iterator, 0),
- * tracker_result_iterator_value (iterator, 1));
- * }
- *
- * tracker_result_iterator_free (iterator);
- *
- * </programlisting>
- * </example>
- *
- * Deprecated: 0.10: Use tracker_sparql_query() in libtracker-sparql
- * instead.
- *
- * Returns: A #TrackerResultIterator pointing before the first result row. This
- * iterator must be disposed when done using tracker_result_iterator_free().
- *
- * Since: 0.10
- **/
-TrackerResultIterator *
-tracker_resources_sparql_query_iterate (TrackerClient *client,
- const gchar *query,
- GError **error)
-{
- TrackerClientPrivate *private;
- TrackerResultIterator *iterator;
- DBusConnection *connection;
- DBusMessage *message;
- DBusMessageIter iter;
- int pipefd[2];
- GError *inner_error = NULL;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), NULL);
- g_return_val_if_fail (query, NULL);
-
- if (pipe (pipefd) < 0) {
- g_set_error (error,
- TRACKER_CLIENT_ERROR,
- TRACKER_CLIENT_ERROR_UNSUPPORTED,
- "Cannot open pipe");
- return NULL;
- }
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- connection = dbus_g_connection_get_connection (private->connection);
-
- message = dbus_message_new_method_call (TRACKER_DBUS_SERVICE,
- TRACKER_DBUS_OBJECT_STEROIDS,
- TRACKER_DBUS_INTERFACE_STEROIDS,
- "Query");
-
- dbus_message_iter_init_append (message, &iter);
- dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &query);
- dbus_message_iter_append_basic (&iter, DBUS_TYPE_UNIX_FD, &pipefd[1]);
- close (pipefd[1]);
-
-
- iterator = g_slice_new0 (TrackerResultIterator);
-
- tracker_client_dbus_send_and_splice (connection,
- message,
- pipefd[0],
- NULL,
- (void **) &iterator->buffer,
- &iterator->buffer_size,
- NULL /* Not interested in variable_names */,
- &inner_error);
- /* message is destroyed by tracker_dbus_send_and_splice */
-
- if (G_UNLIKELY (inner_error)) {
- g_propagate_error (error, inner_error);
- tracker_result_iterator_free (iterator);
- iterator = NULL;
- }
-
- return iterator;
-}
-
-/**
- * tracker_result_iterator_free:
- * @iterator: A TrackerResultIterator
- *
- * Frees a TrackerResultIterator and its associated resources
- *
- * Deprecated: 0.10: Use g_object_unref() instead.
- *
- * Since: 0.10
- **/
-void
-tracker_result_iterator_free (TrackerResultIterator *iterator)
-{
- g_return_if_fail (iterator != NULL);
-
- g_free (iterator->buffer);
- g_slice_free (TrackerResultIterator, iterator);
-}
-
-/**
- * tracker_result_iterator_n_columns:
- * @iterator: A TrackerResultIterator
- *
- * Deprecated: 0.10: Use tracker_cursor_n_columns() in libtracker-sparql
- * instead.
- *
- * Returns: the number of columns in the row pointed by @iterator
- *
- * Since: 0.10
- **/
-guint
-tracker_result_iterator_n_columns (TrackerResultIterator *iterator)
-{
- g_return_val_if_fail (iterator != NULL, 0);
-
- return iterator->n_columns;
-}
-
-/**
- * tracker_result_iterator_next:
- * @iterator: A TrackerResultIterator
- *
- * Fetches the next row for the results.
- *
- * Deprecated: 0.10: Use tracker_cursor_next() in libtracker-sparql
- * instead.
- *
- * Returns: %TRUE if a rows was fetched, otherwise %FALSE.
- *
- * Since: 0.10
- **/
-gboolean
-tracker_result_iterator_next (TrackerResultIterator *iterator)
-{
- int last_offset;
-
- g_return_val_if_fail (iterator != NULL, FALSE);
-
- if (iterator->buffer_index >= iterator->buffer_size) {
- return FALSE;
- }
-
- /* So, the make up on each iterator segment is:
- *
- * iteration = [4 bytes for number of columns,
- * columns x 4 bytes for types
- * columns x 4 bytes for offsets]
- */
- iterator->n_columns = iterator_buffer_read_int (iterator);
-
- iterator->types = (int*) (iterator->buffer + iterator->buffer_index);
- iterator->buffer_index += sizeof (int) * (iterator->n_columns);
-
- iterator->offsets = (int*) (iterator->buffer + iterator->buffer_index);
- iterator->buffer_index += sizeof (int) * (iterator->n_columns - 1);
-
- last_offset = iterator_buffer_read_int (iterator);
- iterator->data = iterator->buffer + iterator->buffer_index;
- iterator->buffer_index += last_offset + 1;
-
- return TRUE;
-}
-
-/**
- * tracker_result_iterator_value:
- * @iterator: A TrackerResultIterator
- * @column: the column with the data
- *
- * Get a column's value as a string
- *
- * Returns: the value of the column as a string. The returned string belongs to
- * the iterator and should not be freed.
- *
- * Deprecated: 0.10: Use tracker_cursor_get_string() in libtracker-sparql
- * instead.
- *
- * Since: 0.10
- **/
-const gchar *
-tracker_result_iterator_value (TrackerResultIterator *iterator,
- guint column)
-{
- g_return_val_if_fail (iterator != NULL, NULL);
- g_return_val_if_fail (column < tracker_result_iterator_n_columns (iterator), NULL);
-
- if (column == 0) {
- return iterator->data;
- } else {
- return iterator->data + iterator->offsets[column - 1] + 1;
- }
-}
-
-/**
- * tracker_resources_sparql_update:
- * @client: a #TrackerClient.
- * @query: a string representing SPARQL.
- * @error: a #GError.
- *
- * Updates the database using SPARQL.
- *
- * This API behaves the same way tracker_resources_sparql_query() does
- * but with the difference that it is intended to be used for data
- * updates.
- *
- * This API call is completely synchronous so it may block.
- *
- * Deprecated: 0.10: Use tracker_sparql_update() in libtracker-sparql
- * instead.
- *
- * Since: 0.8
- **/
-void
-tracker_resources_sparql_update (TrackerClient *client,
- const gchar *query,
- GError **error)
-{
- DBusMessage *reply;
-
- g_return_if_fail (TRACKER_IS_CLIENT (client));
- g_return_if_fail (query != NULL);
-
- reply = sparql_update_fast (client, query, FAST_UPDATE, error);
-
- if (!reply) {
- return;
- }
-
- dbus_message_unref (reply);
-}
-
-/**
- * tracker_resources_sparql_update_blank:
- * @client: a #TrackerClient.
- * @query: a string representing SPARQL.
- * @error: return location for errors.
- *
- * Deprecated: 0.10: There is no replacement for this in libtracker-sparql
- *
- * Since: 0.8
- **/
-GPtrArray *
-tracker_resources_sparql_update_blank (TrackerClient *client,
- const gchar *query,
- GError **error)
-{
- DBusMessage *reply;
- DBusMessageIter iter, subiter, subsubiter;
- GPtrArray *result;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), NULL);
- g_return_val_if_fail (query != NULL, NULL);
-
- reply = sparql_update_fast (client, query, FAST_UPDATE_BLANK, error);
-
- if (!reply) {
- return NULL;
- }
-
- if (g_strcmp0 (dbus_message_get_signature (reply), "aaa{ss}")) {
- g_set_error (error,
- TRACKER_CLIENT_ERROR,
- TRACKER_CLIENT_ERROR_UNSUPPORTED,
- "Server returned invalid results");
- dbus_message_unref (reply);
- return NULL;
- }
-
- result = g_ptr_array_new ();
- dbus_message_iter_init (reply, &iter);
- dbus_message_iter_recurse (&iter, &subiter);
-
- while (dbus_message_iter_get_arg_type (&subiter) != DBUS_TYPE_INVALID) {
- GPtrArray *inner_array;
-
- inner_array = g_ptr_array_new ();
- g_ptr_array_add (result, inner_array);
- dbus_message_iter_recurse (&subiter, &subsubiter);
-
- while (dbus_message_iter_get_arg_type (&subsubiter) != DBUS_TYPE_INVALID) {
- g_ptr_array_add (inner_array, unmarshal_hash_table (&subsubiter));
- dbus_message_iter_next (&subsubiter);
- }
-
- dbus_message_iter_next (&subiter);
- }
-
- dbus_message_unref (reply);
-
- return result;
-}
-
-/**
- * tracker_resources_batch_sparql_update:
- * @client: a #TrackerClient.
- * @query: a string representing SPARQL.
- * @error: return location for errors.
- *
- * Updates the database using SPARQL. Updates done this way have to be committed
- * explicitly through tracker_resources_batch_commit() or
- * tracker_resources_batch_commit_async(). This API call is synchronous so it may
- * block.
- *
- * Deprecated: 0.10: Use tracker_sparql_update() in libtracker-sparql
- * instead.
- *
- * Since: 0.8
- **/
-void
-tracker_resources_batch_sparql_update (TrackerClient *client,
- const gchar *query,
- GError **error)
-{
- DBusMessage *reply;
-
- reply = sparql_update_fast (client, query, FAST_UPDATE_BATCH, error);
-
- if (!reply) {
- return;
- }
-
- dbus_message_unref (reply);
-}
-
-/**
- * tracker_resources_batch_commit:
- * @client: a #TrackerClient.
- * @error: return location for errors.
- *
- * Commits a batch of already issued SPARQL updates. This API call is
- * synchronous so it may block.
- *
- * Deprecated: 0.10: Use tracker_sparql_update_commit() in libtracker-sparql
- * instead.
- *
- * Since: 0.8
- **/
-void
-tracker_resources_batch_commit (TrackerClient *client,
- GError **error)
-{
- TrackerClientPrivate *private;
-
- g_return_if_fail (TRACKER_IS_CLIENT (client));
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- org_freedesktop_Tracker1_Resources_batch_commit (private->proxy_resources,
- error);
-}
-
-/**
- * tracker_statistics_get_async:
- * @client: a #TrackerClient.
- * @callback: a #TrackerReplyGPtrArray to be used when the data is
- * available.
- * @user_data: user data to pass to @callback.
- *
- * This behaves exactly as tracker_statistics_get() but asynchronously.
- *
- * Deprecated: 0.10: Use tracker_sparql_stats_async() in libtracker-sparql
- * instead.
- *
- * Returns: A #guint representing the operation ID. See
- * tracker_cancel_call(). In the event of failure, 0 is returned.
- *
- * Since: 0.8
- **/
-guint
-tracker_statistics_get_async (TrackerClient *client,
- TrackerReplyGPtrArray callback,
- gpointer user_data)
-{
- TrackerClientPrivate *private;
- CallbackGPtrArray *cb;
- DBusGProxyCall *call;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
- g_return_val_if_fail (callback != NULL, 0);
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- cb = g_slice_new0 (CallbackGPtrArray);
- cb->func = callback;
- cb->data = user_data;
- cb->client = g_object_ref (client);
-
- call = org_freedesktop_Tracker1_Statistics_get_async (private->proxy_statistics,
- callback_with_gptrarray,
- cb);
-
- cb->id = slow_pending_call_new (client, private->proxy_statistics, call);
-
- return cb->id;
-}
-
-guint
-tracker_resources_load_async (TrackerClient *client,
- const gchar *uri,
- TrackerReplyVoid callback,
- gpointer user_data)
-{
- TrackerClientPrivate *private;
- CallbackVoid *cb;
- DBusGProxyCall *call;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
- g_return_val_if_fail (uri != NULL, 0);
- g_return_val_if_fail (callback != NULL, 0);
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- cb = g_slice_new0 (CallbackVoid);
- cb->func = callback;
- cb->data = user_data;
- cb->client = g_object_ref (client);
-
- call = org_freedesktop_Tracker1_Resources_load_async (private->proxy_resources,
- uri,
- callback_with_void,
- cb);
-
- cb->id = slow_pending_call_new (client, private->proxy_resources, call);
-
- return cb->id;
-}
-
-/**
- * tracker_resources_sparql_query_async:
- * @client: a #TrackerClient
- * @query: a string representing SPARQL.
- * @callback: callback function to be called when the data is ready.
- * @user_data: user data to pass to @callback
- *
- * Does an asynchronous SPARQL query. See tracker_resources_sparql_query()
- * to see how an SPARLQL query should be like.
- *
- * Deprecated: 0.10: Use tracker_sparql_query_async() in libtracker-sparql
- * instead.
- *
- * Returns: A #guint representing the operation ID. See
- * tracker_cancel_call(). In the event of failure, 0 is returned.
- *
- * Since: 0.8
- **/
-guint
-tracker_resources_sparql_query_async (TrackerClient *client,
- const gchar *query,
- TrackerReplyGPtrArray callback,
- gpointer user_data)
-{
- TrackerClientPrivate *private;
- CallbackGPtrArray *cb;
- DBusGProxyCall *call;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
- g_return_val_if_fail (query != NULL, 0);
- g_return_val_if_fail (callback != NULL, 0);
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- cb = g_slice_new0 (CallbackGPtrArray);
- cb->func = callback;
- cb->data = user_data;
- cb->client = g_object_ref (client);
-
- call = org_freedesktop_Tracker1_Resources_sparql_query_async (private->proxy_resources,
- query,
- callback_with_gptrarray,
- cb);
-
- cb->id = slow_pending_call_new (client, private->proxy_resources, call);
-
- return cb->id;
-}
-
-/**
- * tracker_resources_sparql_query_iterate_async
- * @client: a #TrackerClient.
- * @query: a string representing SPARQL.
- * @callback: function to be called when the blank update has been performed.
- * @user_data: user data to pass to @callback.
- *
- * Deprecated: 0.10: Use tracker_sparql_query_async() in libtracker-sparql
- * instead.
- *
- * Returns: A #guint representing the operation ID. See
- * tracker_cancel_call(). In the event of failure, 0 is returned.
- *
- * Since: 0.10
- **/
-guint
-tracker_resources_sparql_query_iterate_async (TrackerClient *client,
- const gchar *query,
- TrackerReplyIterator callback,
- gpointer user_data)
-{
- TrackerClientPrivate *private;
- DBusConnection *connection;
- DBusMessage *message;
- DBusMessageIter iter;
- int pipefd[2];
- GCancellable *cancellable;
- FastAsyncData *fad;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
- g_return_val_if_fail (query, 0);
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- if (pipe (pipefd) < 0) {
- g_critical ("Cannot open pipe");
- return 0;
- }
-
- connection = dbus_g_connection_get_connection (private->connection);
-
- message = dbus_message_new_method_call (TRACKER_DBUS_SERVICE,
- TRACKER_DBUS_OBJECT_STEROIDS,
- TRACKER_DBUS_INTERFACE_STEROIDS,
- "Query");
-
- /* FIXME: This at least returns FALSE where append_basic()
- * silently fails when actually sending the message and
- * DBUS_TYPE_UNIX_FD is not supported.
- *
- * No error handling though :(
- */
- /* if (!dbus_message_append_args (message, */
- /* DBUS_TYPE_STRING, &query, */
- /* DBUS_TYPE_UNIX_FD, &pipefd[1], */
- /* DBUS_TYPE_INVALID)) { */
- /* g_critical ("Could not append arguments to DBusMessage"); */
- /* return 0; */
- /* } */
-
- dbus_message_iter_init_append (message, &iter);
- dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &query);
- dbus_message_iter_append_basic (&iter, DBUS_TYPE_UNIX_FD, &pipefd[1]);
-
- close (pipefd[1]);
-
- cancellable = g_cancellable_new ();
-
- fad = fast_async_data_new (client,
- FAST_QUERY,
- cancellable,
- user_data);
- fad->iterator_callback = callback;
-
- tracker_client_dbus_send_and_splice_async (connection,
- message,
- pipefd[0],
- TRUE,
- cancellable,
- callback_iterator,
- fad);
-
- return fad->request_id;
-}
-
-/**
- * tracker_resources_sparql_update_async
- * @client: a #TrackerClient.
- * @query: a string representing SPARQL.
- * @callback: function to be called when the blank update has been performed.
- * @user_data: user data to pass to @callback.
- *
- * Deprecated: 0.10: Use tracker_sparql_update_async() in libtracker-sparql
- * instead.
- *
- * Returns: A #guint representing the operation ID. See
- * tracker_cancel_call(). In the event of failure, 0 is returned.
- *
- * Since: 0.8
- **/
-guint
-tracker_resources_sparql_update_async (TrackerClient *client,
- const gchar *query,
- TrackerReplyVoid callback,
- gpointer user_data)
-{
- FastAsyncData *fad;
- GError *error = NULL;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
- g_return_val_if_fail (query != NULL, 0);
- g_return_val_if_fail (callback != NULL, 0);
-
- fad = fast_async_data_new (client,
- FAST_UPDATE,
- NULL,
- user_data);
- fad->void_callback = callback;
-
- sparql_update_fast_async (client, query, fad, &error);
-
- if (error) {
- g_critical ("Could not initiate update: %s", error->message);
- g_error_free (error);
-
- fast_async_data_free (fad);
-
- return 0;
- }
-
- return fad->request_id;
-}
-
-/**
- * tracker_resources_sparql_update_blank_async
- * @client: a #TrackerClient.
- * @query: a string representing SPARQL.
- * @callback: function to be called when the blank update has been performed.
- * @user_data: user data to pass to @callback.
- *
- * Deprecated: 0.10: There is no replacement for this in libtracker-sparql
- *
- * Returns: A #guint representing the operation ID. See
- * tracker_cancel_call(). In the event of failure, 0 is returned.
- *
- * Since: 0.8
- **/
-guint
-tracker_resources_sparql_update_blank_async (TrackerClient *client,
- const gchar *query,
- TrackerReplyGPtrArray callback,
- gpointer user_data)
-{
- FastAsyncData *fad;
- GError *error = NULL;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
- g_return_val_if_fail (query != NULL, 0);
- g_return_val_if_fail (callback != NULL, 0);
-
- fad = fast_async_data_new (client,
- FAST_UPDATE_BLANK,
- NULL,
- user_data);
- fad->gptrarray_callback = callback;
-
- sparql_update_fast_async (client, query, fad, &error);
-
- if (error) {
- g_critical ("Could not initiate update: %s", error->message);
- g_error_free (error);
-
- fast_async_data_free (fad);
-
- return 0;
- }
-
- return fad->request_id;
-}
-
-/**
- * tracker_resources_batch_sparql_update_async:
- * @client: a #TrackerClient.
- * @query: a string representing SPARQL.
- * @callback: function to be called when the batch update has been performed.
- * @user_data: user data to pass to @callback.
- *
- * Updates the database using SPARQL. see tracker_resources_batch_sparql_update().
- *
- * Deprecated: 0.10: Use tracker_sparql_update_async() in libtracker-sparql
- * instead.
- *
- * Returns: A #guint representing the operation ID. See
- * tracker_cancel_call(). In the event of failure, 0 is returned.
- *
- * Since: 0.8
- **/
-guint
-tracker_resources_batch_sparql_update_async (TrackerClient *client,
- const gchar *query,
- TrackerReplyVoid callback,
- gpointer user_data)
-{
- FastAsyncData *fad;
- GError *error = NULL;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
- g_return_val_if_fail (query != NULL, 0);
- g_return_val_if_fail (callback != NULL, 0);
-
- fad = fast_async_data_new (client,
- FAST_UPDATE_BATCH,
- NULL,
- user_data);
- fad->void_callback = callback;
-
- sparql_update_fast_async (client, query, fad, &error);
-
- if (error) {
- g_critical ("Could not initiate update: %s", error->message);
- g_error_free (error);
-
- fast_async_data_free (fad);
-
- return 0;
- }
-
- return fad->request_id;
-}
-
-/**
- * tracker_resources_batch_commit_async:
- * @client: a #TrackerClient.
- * @callback: callback to be called when the operation is finished.
- * @user_data: user data to pass to @callback.
- *
- * Commits a batch of already issued SPARQL updates.
- *
- * Deprecated: 0.10: Use tracker_sparql_update_commit_async() in libtracker-sparql
- * instead.
- *
- * Returns: A #guint representing the operation ID. See
- * tracker_cancel_call(). In the event of failure, 0 is returned.
- *
- * Since: 0.8
- **/
-guint
-tracker_resources_batch_commit_async (TrackerClient *client,
- TrackerReplyVoid callback,
- gpointer user_data)
-{
- TrackerClientPrivate *private;
- CallbackVoid *cb;
- DBusGProxyCall *call;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
- g_return_val_if_fail (callback != NULL, 0);
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- cb = g_slice_new0 (CallbackVoid);
- cb->func = callback;
- cb->data = user_data;
- cb->client = g_object_ref (client);
-
- call = org_freedesktop_Tracker1_Resources_batch_commit_async (private->proxy_resources,
- callback_with_void,
- cb);
-
- cb->id = slow_pending_call_new (client, private->proxy_resources, call);
-
- return cb->id;
-}
-
-/**
- * tracker_resources_writeback_connect:
- * @client: a #TrackerClient
- * @callback: a #TrackerWritebackCallback to call when the writeback signal is
- * emitted
- * @user_data: user data to pass to @callback
- *
- * Registers a callback to be called when the writeback signal is emitted by
- * the store.
- *
- * The writeback signal is emitted by the store everytime a property annotated
- * with tracker:writeback is changed. This annotation means that whenever
- * possible the changes in the RDF store should be reflected in the metadata of
- * the original file.
- *
- * Deprecated: 0.10: There is no replacement for this in libtracker-sparql
- *
- * Returns: a handle that can be used to disconnect the signal later using
- * tracker_resources_writeback_disconnect. The handle will always be
- * greater than 0 on success.
- */
-guint
-tracker_resources_writeback_connect (TrackerClient *client,
- TrackerWritebackCallback callback,
- gpointer user_data)
-{
- TrackerClientPrivate *private;
- WritebackCallback *cb;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
- g_return_val_if_fail (callback != NULL, 0);
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- /* Connect the DBus signal if needed */
- if (!private->writeback_callbacks) {
- dbus_g_proxy_connect_signal (private->proxy_resources,
- "Writeback",
- G_CALLBACK (writeback_cb),
- private,
- NULL);
- }
-
- cb = g_slice_new0 (WritebackCallback);
- cb->id = ++writeback_callback_id;
- cb->func = callback;
- cb->data = user_data;
-
- private->writeback_callbacks = g_list_prepend (private->writeback_callbacks,
- cb);
-
- return cb->id;
-}
-
-/**
- * tracker_resources_writeback_disconnect:
- * @client: a #TrackerClient
- * @handle: a handle identifying a callback
- *
- * Deprecated: 0.10: There is no replacement for this in libtracker-sparql
- *
- * Removes the callback identified by @handle from the writeback callbacks.
- **/
-void
-tracker_resources_writeback_disconnect (TrackerClient *client,
- guint handle)
-{
- TrackerClientPrivate *private;
- GList *current_callback;
-
- g_return_if_fail (TRACKER_IS_CLIENT (client));
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- for (current_callback = private->writeback_callbacks;
- current_callback;
- current_callback = g_list_next (current_callback)) {
- if (((WritebackCallback*) current_callback->data)->id == handle) {
- g_slice_free (WritebackCallback, current_callback->data);
- private->writeback_callbacks = g_list_remove (private->writeback_callbacks,
- current_callback);
- break;
- }
- }
-
- /* Disconnect the DBus signal if not needed anymore */
- if (!private->writeback_callbacks) {
- dbus_g_proxy_disconnect_signal (private->proxy_resources,
- "Writeback",
- G_CALLBACK (writeback_cb),
- private);
- }
-}
-
-/* tracker_search_metadata_by_text_async is used by GTK+ */
-
-static void
-sparql_append_string_literal (GString *sparql,
- const gchar *str)
-{
- g_string_append_c (sparql, '"');
-
- while (*str != '\0') {
- gsize len = strcspn (str, "\t\n\r\"\\");
- g_string_append_len (sparql, str, len);
- str += len;
- switch (*str) {
- case '\t':
- g_string_append (sparql, "\\t");
- break;
- case '\n':
- g_string_append (sparql, "\\n");
- break;
- case '\r':
- g_string_append (sparql, "\\r");
- break;
- case '"':
- g_string_append (sparql, "\\\"");
- break;
- case '\\':
- g_string_append (sparql, "\\\\");
- break;
- default:
- continue;
- }
- str++;
- }
-
- g_string_append_c (sparql, '"');
-}
-
-/**
- * tracker_connect:
- * @enable_warnings: a #gboolean to determine if warnings are issued in
- * cases where they are found.
- * @timeout: a #gint used for D-Bus call timeouts.
- *
- * This function calls tracker_client_new().
- *
- * Deprecated: 0.8: Use tracker_client_new() instead.
- *
- * Returns: a #TrackerClient #GObject which must be freed with
- * g_object_unref().
- **/
-TrackerClient *
-tracker_connect (gboolean enable_warnings,
- gint timeout)
-{
- TrackerClientFlags flags = 0;
-
- if (enable_warnings) {
- flags |= TRACKER_CLIENT_ENABLE_WARNINGS;
- }
-
- return tracker_client_new (flags, timeout);
-}
-
-/**
- * tracker_disconnect:
- * @client: a #TrackerClient.
- *
- * This will disconnect the D-Bus connections to Tracker services and
- * free the allocated #TrackerClient by tracker_connect().
- *
- * Deprecated: 0.8: Use g_object_unref() instead.
- **/
-void
-tracker_disconnect (TrackerClient *client)
-{
- g_return_if_fail (TRACKER_IS_CLIENT (client));
-
- g_object_unref (client);
-}
-
-/**
- * tracker_search_metadata_by_text_async:
- * @client: a #TrackerClient.
- * @query: a string representing what to search for.
- * @callback: callback function to be called when the update has been processed.
- * @user_data: user data to pass to @callback.
- *
- * Searches for @query in all URIs with the prefix @location.
- *
- * NOTE: @query is found using FTS (Full Text Search).
- *
- * Returns: A #guint representing the operation ID. See
- * tracker_cancel_call(). In the event of failure, 0 is returned.
- *
- * Deprecated: 0.8: Use tracker_resources_sparql_query() instead.
- **/
-guint
-tracker_search_metadata_by_text_async (TrackerClient *client,
- const gchar *query,
- TrackerReplyArray callback,
- gpointer user_data)
-{
- TrackerClientPrivate *private;
- CallbackArray *cb;
- GString *sparql;
- DBusGProxyCall *call;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
- g_return_val_if_fail (query != NULL, 0);
- g_return_val_if_fail (callback != NULL, 0);
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- cb = g_slice_new0 (CallbackArray);
- cb->func = callback;
- cb->data = user_data;
- cb->client = g_object_ref (client);
-
- sparql = g_string_new ("SELECT nie:url (?file) WHERE { ?file a nfo:FileDataObject ; fts:match ");
- sparql_append_string_literal (sparql, query);
- g_string_append (sparql, " }");
-
- call = org_freedesktop_Tracker1_Resources_sparql_query_async (private->proxy_resources,
- sparql->str,
- callback_with_array,
- cb);
- cb->id = slow_pending_call_new (client, private->proxy_resources, call);
-
- g_string_free (sparql, TRUE);
-
- return cb->id;
-}
-
-/**
- * tracker_search_metadata_by_text_and_location_async:
- * @client: a #TrackerClient.
- * @query: a string representing what to search for.
- * @location: a string representing a path.
- * @callback: callback function to be called when the update has been processed.
- * @user_data: user data to pass to @callback.
- *
- * Searches for @query in all URIs with the prefix @location.
- *
- * NOTE: @query is found using FTS (Full Text Search).
- *
- * Returns: A #guint representing the operation ID. See
- * tracker_cancel_call(). In the event of failure, 0 is returned.
- *
- * Deprecated: 0.8: Use tracker_resources_sparql_query() instead.
- **/
-guint
-tracker_search_metadata_by_text_and_location_async (TrackerClient *client,
- const gchar *query,
- const gchar *location,
- TrackerReplyArray callback,
- gpointer user_data)
-{
- TrackerClientPrivate *private;
- CallbackArray *cb;
- GString *sparql;
- DBusGProxyCall *call;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
- g_return_val_if_fail (query != NULL, 0);
- g_return_val_if_fail (location != NULL, 0);
- g_return_val_if_fail (callback != NULL, 0);
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- cb = g_slice_new0 (CallbackArray);
- cb->func = callback;
- cb->data = user_data;
- cb->client = g_object_ref (client);
-
- sparql = g_string_new ("SELECT nie:url (?file) WHERE { ?file a nfo:FileDataObject ; fts:match ");
- sparql_append_string_literal (sparql, query);
- g_string_append (sparql, " . FILTER (fn:starts-with(nie:url (?file),");
- sparql_append_string_literal (sparql, location);
- g_string_append (sparql, ")) }");
-
- call = org_freedesktop_Tracker1_Resources_sparql_query_async (private->proxy_resources,
- sparql->str,
- callback_with_array,
- cb);
-
- cb->id = slow_pending_call_new (client, private->proxy_resources, call);
-
- g_string_free (sparql, TRUE);
-
- return cb->id;
-}
-
-/**
- * tracker_search_metadata_by_text_and_mime_async:
- * @client: a #TrackerClient.
- * @query: a string representing what to search for.
- * @mimes: a #GStrv representing mime types.
- * @callback: callback function to be called when the update has been processed.
- * @user_data: user data to pass to @callback.
- *
- * Searches for @query in all URIs with a mime type matching any of
- * the values in @mime.
- *
- * NOTE: @query is found using FTS (Full Text Search).
- *
- * Returns: A #guint representing the operation ID. See
- * tracker_cancel_call(). In the event of failure, 0 is returned.
- *
- * Deprecated: 0.8: Use tracker_resources_sparql_query() instead.
- **/
-guint
-tracker_search_metadata_by_text_and_mime_async (TrackerClient *client,
- const gchar *query,
- const gchar **mimes,
- TrackerReplyArray callback,
- gpointer user_data)
-{
- TrackerClientPrivate *private;
- CallbackArray *cb;
- GString *sparql;
- DBusGProxyCall *call;
- gint i;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
- g_return_val_if_fail (query != NULL, 0);
- g_return_val_if_fail (mimes != NULL, 0);
- g_return_val_if_fail (callback != NULL, 0);
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- cb = g_slice_new0 (CallbackArray);
- cb->func = callback;
- cb->data = user_data;
- cb->client = g_object_ref (client);
-
- sparql = g_string_new ("SELECT nie:url (?file) WHERE { ?file a nfo:FileDataObject ; nie:mimeType ?mime ; fts:match ");
- sparql_append_string_literal (sparql, query);
- g_string_append (sparql, " . FILTER (");
-
- for (i = 0; mimes[i]; i++) {
- if (i > 0) {
- g_string_append (sparql, " || ");
- }
-
- g_string_append (sparql, "?mime = ");
- sparql_append_string_literal (sparql, mimes[i]);
- }
- g_string_append (sparql, ") }");
-
- call = org_freedesktop_Tracker1_Resources_sparql_query_async (private->proxy_resources,
- sparql->str,
- callback_with_array,
- cb);
-
- cb->id = slow_pending_call_new (client, private->proxy_resources, call);
-
- g_string_free (sparql, TRUE);
-
- return cb->id;
-}
-
-/**
- * tracker_search_metadata_by_text_and_mime_and_location_async:
- * @client: a #TrackerClient.
- * @query: a string representing what to search for.
- * @mimes: a #GStrv representing mime types.
- * @location: a string representing a path.
- * @callback: callback function to be called when the update has been processed.
- * @user_data: user data to pass to @callback.
- *
- * Searches for @query in all URIs with the prefix @location and with
- * a mime type matching any of the values in @mime.
- *
- * NOTE: @query is found using FTS (Full Text Search).
- *
- * Returns: A #guint representing the operation ID. See
- * tracker_cancel_call(). In the event of failure, 0 is returned.
- *
- * Deprecated: 0.8: Use tracker_resources_sparql_query() instead.
- **/
-guint
-tracker_search_metadata_by_text_and_mime_and_location_async (TrackerClient *client,
- const gchar *query,
- const gchar **mimes,
- const gchar *location,
- TrackerReplyArray callback,
- gpointer user_data)
-{
- TrackerClientPrivate *private;
- CallbackArray *cb;
- GString *sparql;
- DBusGProxyCall *call;
- gint i;
-
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
- g_return_val_if_fail (query != NULL, 0);
- g_return_val_if_fail (mimes != NULL, 0);
- g_return_val_if_fail (location != NULL, 0);
- g_return_val_if_fail (callback != NULL, 0);
-
- private = TRACKER_CLIENT_GET_PRIVATE (client);
-
- cb = g_slice_new0 (CallbackArray);
- cb->func = callback;
- cb->data = user_data;
- cb->client = g_object_ref (client);
-
- sparql = g_string_new ("SELECT nie:url (?file) WHERE { ?file a nfo:FileDataObject ; nie:mimeType ?mime ; fts:match ");
- sparql_append_string_literal (sparql, query);
-
- g_string_append (sparql, " . FILTER (fn:starts-with(nie:url (?file),");
- sparql_append_string_literal (sparql, location);
-
- g_string_append (sparql, ")");
- g_string_append (sparql, " && (");
-
- for (i = 0; mimes[i]; i++) {
- if (i > 0) {
- g_string_append (sparql, " || ");
- }
-
- g_string_append (sparql, "?mime = ");
- sparql_append_string_literal (sparql, mimes[i]);
- }
-
- g_string_append (sparql, ")");
- g_string_append (sparql, ") }");
-
- call = org_freedesktop_Tracker1_Resources_sparql_query_async (private->proxy_resources,
- sparql->str,
- callback_with_array,
- cb);
-
- cb->id = slow_pending_call_new (client, private->proxy_resources, call);
-
- g_string_free (sparql, TRUE);
-
- return cb->id;
-}
-
-#endif /* TRACKER_DISABLE_DEPRECATED */
diff --git a/src/libtracker-client/tracker.h b/src/libtracker-client/tracker.h
deleted file mode 100644
index 9ea31f85a..000000000
--- a/src/libtracker-client/tracker.h
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * 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>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef __TRACKER_CLIENT_H__
-#define __TRACKER_CLIENT_H__
-
-#if !defined (__LIBTRACKER_CLIENT_INSIDE__) && !defined (TRACKER_COMPILATION)
-#error "only <libtracker-client/tracker-client.h> must be included directly."
-#endif
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#ifndef TRACKER_DISABLE_DEPRECATED
-
-/*
- * Now, libtracker-sparql is to be used instead of libtracker-client. All these
- * APIS are now marked as deprecated.
- */
-
-#define TRACKER_DBUS_SERVICE "org.freedesktop.Tracker1"
-#define TRACKER_DBUS_OBJECT "/org/freedesktop/Tracker1"
-#define TRACKER_DBUS_INTERFACE_RESOURCES "org.freedesktop.Tracker1.Resources"
-#define TRACKER_DBUS_INTERFACE_STATISTICS "org.freedesktop.Tracker1.Statistics"
-
-#define TRACKER_TYPE_CLIENT (tracker_client_get_type())
-#define TRACKER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TRACKER_TYPE_CLIENT, TrackerClient))
-#define TRACKER_CLIENT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), TRACKER_TYPE_CLIENT, TrackerClientClass))
-#define TRACKER_IS_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TRACKER_TYPE_CLIENT))
-#define TRACKER_IS_CLIENT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), TRACKER_TYPE_CLIENT))
-#define TRACKER_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TRACKER_TYPE_CLIENT, TrackerClientClass))
-
-typedef struct {
- GObject parent;
-} TrackerClient;
-
-typedef struct {
- GObjectClass parent;
-} TrackerClientClass;
-
-typedef struct TrackerResultIterator TrackerResultIterator;
-
-/**
- * TrackerClientFlags:
- * @TRACKER_CLIENT_ENABLE_WARNINGS: If supplied warnings will be
- * produced upon erronous situations. This is usually turned off for
- * applications that want to provide their own error reporting.
- */
-typedef enum {
- TRACKER_CLIENT_ENABLE_WARNINGS = 1 << 0
-} TrackerClientFlags;
-
-#define TRACKER_CLIENT_ERROR tracker_client_error_quark ()
-#define TRACKER_CLIENT_ERROR_DOMAIN "TrackerClient"
-
-typedef enum {
- TRACKER_CLIENT_ERROR_UNSUPPORTED,
- TRACKER_CLIENT_ERROR_BROKEN_PIPE
-} TrackerClientError;
-
-/**
- * TrackerReplyGPtrArray:
- * @result: a #GPtrArray with the results of the query.
- * @error: a #GError.
- * @user_data: a #gpointer for user data.
- *
- * The @result is returned as a #GPtrArray containing an array of
- * #GStrv with the results from the query unless there is an error. If
- * there is an error the @error is populated with the details. The
- * @user_data is provided in the callback.
- **/
-typedef void (*TrackerReplyGPtrArray) (GPtrArray *result,
- GError *error,
- gpointer user_data) G_GNUC_DEPRECATED;
-
-/**
- * TrackerReplyVoid:
- * @error: a GError.
- * @user_data: a gpointer for user data.
- *
- * The @user_data is returned when the query has completed. If there
- * is an error the @error is populated with the details.
- **/
-typedef void (*TrackerReplyVoid) (GError *error,
- gpointer user_data) G_GNUC_DEPRECATED;
-
-typedef void (*TrackerReplyIterator) (TrackerResultIterator *iterator,
- GError *error,
- gpointer user_data) G_GNUC_DEPRECATED;
-
-/**
- * TrackerWritebackCallback:
- * @resources: a hash table where each key is the uri of a resources which
- * was modified. To each key is associated an array of strings,
- * which are the various RDF classes the uri belongs to.
- *
- * The callback is called everytime a property annotated with tracker:writeback
- * is modified in the store.
- */
-typedef void (*TrackerWritebackCallback) (const GHashTable *resources,
- gpointer user_data) G_GNUC_DEPRECATED;
-
-GType tracker_client_get_type (void) G_GNUC_CONST G_GNUC_DEPRECATED;
-GQuark tracker_client_error_quark (void) G_GNUC_DEPRECATED;
-TrackerClient *tracker_client_new (TrackerClientFlags flags,
- gint timeout) G_GNUC_DEPRECATED;
-
-gboolean tracker_cancel_call (TrackerClient *client,
- guint call_id) G_GNUC_DEPRECATED;
-gboolean tracker_cancel_last_call (TrackerClient *client) G_GNUC_DEPRECATED;
-
-/* Utilities */
-gchar * tracker_sparql_escape (const gchar *str) G_GNUC_DEPRECATED;
-
-gchar * tracker_uri_vprintf_escaped (const gchar *format,
- va_list args) G_GNUC_DEPRECATED;
-gchar * tracker_uri_printf_escaped (const gchar *format,
- ...) G_GNUC_DEPRECATED;
-
-/* Synchronous API */
-GPtrArray * tracker_statistics_get (TrackerClient *client,
- GError **error) G_GNUC_DEPRECATED;
-void tracker_resources_load (TrackerClient *client,
- const gchar *uri,
- GError **error) G_GNUC_DEPRECATED;
-GPtrArray * tracker_resources_sparql_query (TrackerClient *client,
- const gchar *query,
- GError **error) G_GNUC_DEPRECATED;
-TrackerResultIterator *
- tracker_resources_sparql_query_iterate (TrackerClient *client,
- const gchar *query,
- GError **error) G_GNUC_DEPRECATED;
-void tracker_result_iterator_free (TrackerResultIterator *iterator) G_GNUC_DEPRECATED;
-guint tracker_result_iterator_n_columns (TrackerResultIterator *iterator) G_GNUC_DEPRECATED;
-gboolean tracker_result_iterator_next (TrackerResultIterator *iterator) G_GNUC_DEPRECATED;
-const gchar * tracker_result_iterator_value (TrackerResultIterator *iterator,
- guint column) G_GNUC_DEPRECATED;
-void tracker_resources_sparql_update (TrackerClient *client,
- const gchar *query,
- GError **error) G_GNUC_DEPRECATED;
-GPtrArray * tracker_resources_sparql_update_blank (TrackerClient *client,
- const gchar *query,
- GError **error) G_GNUC_DEPRECATED;
-void tracker_resources_batch_sparql_update (TrackerClient *client,
- const gchar *query,
- GError **error) G_GNUC_DEPRECATED;
-void tracker_resources_batch_commit (TrackerClient *client,
- GError **error) G_GNUC_DEPRECATED;
-/* Asynchronous API */
-guint tracker_statistics_get_async (TrackerClient *client,
- TrackerReplyGPtrArray callback,
- gpointer user_data) G_GNUC_DEPRECATED;
-guint tracker_resources_load_async (TrackerClient *client,
- const gchar *uri,
- TrackerReplyVoid callback,
- gpointer user_data) G_GNUC_DEPRECATED;
-guint tracker_resources_sparql_query_async (TrackerClient *client,
- const gchar *query,
- TrackerReplyGPtrArray callback,
- gpointer user_data) G_GNUC_DEPRECATED;
-guint tracker_resources_sparql_query_iterate_async (TrackerClient *client,
- const gchar *query,
- TrackerReplyIterator callback,
- gpointer user_data) G_GNUC_DEPRECATED;
-guint tracker_resources_sparql_update_async (TrackerClient *client,
- const gchar *query,
- TrackerReplyVoid callback,
- gpointer user_data) G_GNUC_DEPRECATED;
-guint tracker_resources_sparql_update_blank_async (TrackerClient *client,
- const gchar *query,
- TrackerReplyGPtrArray callback,
- gpointer user_data) G_GNUC_DEPRECATED;
-guint tracker_resources_batch_sparql_update_async (TrackerClient *client,
- const gchar *query,
- TrackerReplyVoid callback,
- gpointer user_data) G_GNUC_DEPRECATED;
-guint tracker_resources_batch_commit_async (TrackerClient *client,
- TrackerReplyVoid callback,
- gpointer user_data) G_GNUC_DEPRECATED;
-
-/* Store signals */
-guint tracker_resources_writeback_connect (TrackerClient *client,
- TrackerWritebackCallback callback,
- gpointer user_data) G_GNUC_DEPRECATED;
-void tracker_resources_writeback_disconnect (TrackerClient *client,
- guint handle) G_GNUC_DEPRECATED;
-
-/*
- * REALLY OLD and Deprecated APIs, since 0.6.x APIs
- */
-
-/**
- * TrackerReplyArray:
- * @result: a gchar ** with the results of the query.
- * @error: a GError.
- * @user_data: a gpointer for user data.
- *
- * This is used by the 0.6 Tracker APIs:
- * tracker_search_metadata_by_text_async()
- * tracker_search_metadata_by_text_and_location_async()
- * tracker_search_metadata_by_text_and_mime_async()
- * tracker_search_metadata_by_text_and_mime_and_location_async()
- *
- * Deprecated: 0.8: Use #TrackerReplyVoid and #TrackerReplyGPtrArray
- * with tracker_resources_sparql_query() instead.
- */
-typedef void (*TrackerReplyArray) (gchar **result,
- GError *error,
- gpointer user_data);
-
-TrackerClient *
- tracker_connect (gboolean enable_warnings,
- gint timeout) G_GNUC_DEPRECATED;
-void tracker_disconnect (TrackerClient *client) G_GNUC_DEPRECATED;
-
-guint tracker_search_metadata_by_text_async (TrackerClient *client,
- const gchar *query,
- TrackerReplyArray callback,
- gpointer user_data) G_GNUC_DEPRECATED;
-guint tracker_search_metadata_by_text_and_location_async (TrackerClient *client,
- const gchar *query,
- const gchar *location,
- TrackerReplyArray callback,
- gpointer user_data) G_GNUC_DEPRECATED;
-guint tracker_search_metadata_by_text_and_mime_async (TrackerClient *client,
- const gchar *query,
- const gchar **mimes,
- TrackerReplyArray callback,
- gpointer user_data) G_GNUC_DEPRECATED;
-guint tracker_search_metadata_by_text_and_mime_and_location_async (TrackerClient *client,
- const gchar *query,
- const gchar **mimes,
- const gchar *location,
- TrackerReplyArray callback,
- gpointer user_data) G_GNUC_DEPRECATED;
-
-#endif /* TRACKER_DISABLE_DEPRECATED */
-
-G_END_DECLS
-
-#endif /* __TRACKER_CLIENT_H__ */
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9785b5e39..a753358c8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -3,7 +3,6 @@ include $(top_srcdir)/Makefile.decl
SUBDIRS = \
common \
libtracker-common \
- libtracker-client \
libtracker-extract \
libtracker-miner \
libtracker-data \
diff --git a/tests/libtracker-client/.gitignore b/tests/libtracker-client/.gitignore
deleted file mode 100644
index 951d386fa..000000000
--- a/tests/libtracker-client/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-tracker-test
diff --git a/tests/libtracker-client/Makefile.am b/tests/libtracker-client/Makefile.am
deleted file mode 100644
index f45dba17c..000000000
--- a/tests/libtracker-client/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-include $(top_srcdir)/Makefile.decl
-
-noinst_PROGRAMS = $(TEST_PROGS)
-
-TEST_PROGS += \
- tracker-test
-
-AM_CPPFLAGS = \
- $(BUILD_CFLAGS) \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/tests/common \
- $(LIBTRACKER_CLIENT_CFLAGS)
-
-LDADD = \
- $(top_builddir)/src/libtracker-client/libtracker-client-@TRACKER_API_VERSION@.la \
- $(top_builddir)/src/libtracker-common/libtracker-common.la \
- $(BUILD_LIBS) \
- $(LIBTRACKER_CLIENT_LIBS)
-
-tracker_test_SOURCES = tracker-test.c
diff --git a/tests/libtracker-client/tracker-test.c b/tests/libtracker-client/tracker-test.c
deleted file mode 100644
index 84d858bc5..000000000
--- a/tests/libtracker-client/tracker-test.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2008, Nokia <ivan.frade@nokia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include <glib.h>
-
-#include <libtracker-client/tracker-client.h>
-
-static void
-test_tracker_client ()
-{
- TrackerClient *client;
-
- client = tracker_client_new (0, -1);
- g_assert (client);
-
- g_object_unref (client);
-}
-
-typedef struct {
- const gchar *input ;
- const gchar *output;
-} ESCAPE_TEST_DATA;
-
-ESCAPE_TEST_DATA test_data [] = {
- {"SELECT \"a\"", "SELECT \\\"a\\\""},
- {"SELECT ?u \t \n \r \b \f", "SELECT ?u \\t \\n \\r \\b \\f"},
- {NULL, NULL }
-};
-
-static void
-test_tracker_sparql_escape ()
-{
- gint i;
- gchar *result;
-
- for (i = 0; test_data[i].input != NULL; i++) {
- result = tracker_sparql_escape (test_data[i].input);
- g_assert_cmpstr (result, ==, test_data[i].output);
- g_free (result);
- }
-}
-
-static void
-test_tracker_uri_vprintf_escaped ()
-{
- gchar *result;
-
- result = tracker_uri_printf_escaped ("test:uri:contact-%d", 14, NULL);
- g_assert_cmpstr (result, ==, "test:uri:contact-14");
- g_free (result);
-
-}
-
-gint
-main (gint argc, gchar **argv)
-{
- g_type_init ();
- g_test_init (&argc, &argv, NULL);
-
- g_test_add_func ("/libtracker-client/tracker/tracker_client", test_tracker_client);
- g_test_add_func ("/libtracker-client/tracker/tracker_sparql_escape", test_tracker_sparql_escape);
- g_test_add_func ("/libtracker-client/tracker/tracker_uri_vprintf_escaped",
- test_tracker_uri_vprintf_escaped);
-
- return g_test_run ();
-}