[tracker] libtracker-db: Cleaned up headers, and add tracker-db.h.
- From: Martyn James Russell <mr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-db: Cleaned up headers, and add tracker-db.h.
- Date: Fri, 2 Oct 2009 11:52:26 +0000 (UTC)
commit 93d8034448872c988f83393f876d5f83374ec14a
Author: Martyn Russell <martyn lanedo com>
Date: Fri Oct 2 12:16:39 2009 +0100
libtracker-db: Cleaned up headers, and add tracker-db.h.
Did the same thing as libtracker-common here for external use.
src/libtracker-common/tracker-common.h | 3 +
src/libtracker-db/tracker-db-backup.c | 7 +-
src/libtracker-db/tracker-db-backup.h | 33 ++--
src/libtracker-db/tracker-db-dbus.h | 8 +-
src/libtracker-db/tracker-db-interface-sqlite.h | 54 +++---
src/libtracker-db/tracker-db-interface.h | 178 ++++++++++----------
src/libtracker-db/tracker-db-journal.h | 32 ++--
src/libtracker-db/tracker-db-manager.h | 40 ++---
src/libtracker-db/tracker-db.h | 43 +++++
src/tracker-fts/Makefile.am | 2 +
tests/libtracker-data/tracker-ontology-test.c | 4 +-
tests/libtracker-data/tracker-sparql-test.c | 6 +-
tests/libtracker-db/tracker-db-dbus-test.c | 7 +-
tests/libtracker-db/tracker-db-manager-common.h | 4 +-
.../libtracker-db/tracker-db-manager-test-attach.c | 7 +-
.../libtracker-db/tracker-db-manager-test-custom.c | 6 +-
.../tracker-db-manager-test-unattach.c | 6 +-
tests/tracker-fts/tracker-fts-test.c | 4 +-
utils/services/Makefile.am | 79 +++++----
19 files changed, 302 insertions(+), 221 deletions(-)
---
diff --git a/src/libtracker-common/tracker-common.h b/src/libtracker-common/tracker-common.h
index a5014f3..3aa86b7 100644
--- a/src/libtracker-common/tracker-common.h
+++ b/src/libtracker-common/tracker-common.h
@@ -32,8 +32,11 @@ G_BEGIN_DECLS
#define __LIBTRACKER_COMMON_INSIDE__
+#include "tracker-dbus.h"
#include "tracker-class.h"
#include "tracker-file-utils.h"
+#include "tracker-ioprio.h"
+#include "tracker-log.h"
#include "tracker-language.h"
#include "tracker-namespace.h"
#include "tracker-ontology.h"
diff --git a/src/libtracker-db/tracker-db-backup.c b/src/libtracker-db/tracker-db-backup.c
index a3890af..613e417 100644
--- a/src/libtracker-db/tracker-db-backup.c
+++ b/src/libtracker-db/tracker-db-backup.c
@@ -23,15 +23,14 @@
#include "config.h"
#include <string.h>
+
#include <glib.h>
#include <glib/gstdio.h>
#include <sqlite3.h>
-#include <libtracker-common/tracker-ontology.h>
-#include <libtracker-db/tracker-db-manager.h>
-#include <libtracker-db/tracker-db-interface-sqlite.h>
-
+#include <libtracker-common/tracker-common.h>
+#include <libtracker-db/tracker-db.h>
#include <tracker-fts/tracker-fts.h>
#include "tracker-db-backup.h"
diff --git a/src/libtracker-db/tracker-db-backup.h b/src/libtracker-db/tracker-db-backup.h
index 72bd6ce..b4a966c 100644
--- a/src/libtracker-db/tracker-db-backup.h
+++ b/src/libtracker-db/tracker-db-backup.h
@@ -20,33 +20,36 @@
* Author: Philip Van Hoof <philip codeminded be>
*/
-#ifndef __TRACKER_DB_BACKUP_H__
-#define __TRACKER_DB_BACKUP_H__
+#ifndef __LIBTRACKER_DB_BACKUP_H__
+#define __LIBTRACKER_DB_BACKUP_H__
#include <glib.h>
#include <gio/gio.h>
-#define TRACKER_DB_BACKUP_META_FILENAME "meta-backup.db"
-
G_BEGIN_DECLS
-#define TRACKER_DB_BACKUP_ERROR (tracker_db_backup_error_quark ())
+#if !defined (__LIBTRACKER_DB_INSIDE__) && !defined (TRACKER_COMPILATION)
+#error "only <libtracker-db/tracker-db.h> must be included directly."
+#endif
+
+#define TRACKER_DB_BACKUP_META_FILENAME "meta-backup.db"
+#define TRACKER_DB_BACKUP_ERROR (tracker_db_backup_error_quark ())
typedef enum {
TRACKER_DB_BACKUP_ERROR_UNKNOWN,
} TrackerDBBackupError;
-typedef void (*TrackerDBBackupFinished) (GError *error, gpointer user_data);
-
-GQuark tracker_db_backup_error_quark (void);
+typedef void (*TrackerDBBackupFinished) (GError *error,
+ gpointer user_data);
-void tracker_db_backup_save (TrackerDBBackupFinished callback,
- gpointer user_data,
- GDestroyNotify destroy);
-GFile * tracker_db_backup_file (GFile **parent_out,
- const gchar *type);
-void tracker_db_backup_sync_fts (void);
+GQuark tracker_db_backup_error_quark (void);
+void tracker_db_backup_save (TrackerDBBackupFinished callback,
+ gpointer user_data,
+ GDestroyNotify destroy);
+GFile *tracker_db_backup_file (GFile **parent_out,
+ const gchar *type);
+void tracker_db_backup_sync_fts (void);
G_END_DECLS
-#endif /* __TRACKER_DB_BACKUP_H__ */
+#endif /* __LIBTRACKER_DB_BACKUP_H__ */
diff --git a/src/libtracker-db/tracker-db-dbus.h b/src/libtracker-db/tracker-db-dbus.h
index 329f803..fd739c9 100644
--- a/src/libtracker-db/tracker-db-dbus.h
+++ b/src/libtracker-db/tracker-db-dbus.h
@@ -22,12 +22,16 @@
#ifndef __LIBTRACKER_DB_DBUS_H__
#define __LIBTRACKER_DB_DBUS_H__
-G_BEGIN_DECLS
-
#include <glib.h>
#include "tracker-db-interface.h"
+G_BEGIN_DECLS
+
+#if !defined (__LIBTRACKER_DB_INSIDE__) && !defined (TRACKER_COMPILATION)
+#error "only <libtracker-db/tracker-db.h> must be included directly."
+#endif
+
gchar ** tracker_dbus_query_result_to_strv (TrackerDBResultSet *result_set,
gint column,
gint *count);
diff --git a/src/libtracker-db/tracker-db-interface-sqlite.h b/src/libtracker-db/tracker-db-interface-sqlite.h
index 357ee01..d8c5efc 100644
--- a/src/libtracker-db/tracker-db-interface-sqlite.h
+++ b/src/libtracker-db/tracker-db-interface-sqlite.h
@@ -1,4 +1,5 @@
-/* Tracker - Sqlite implementation
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
* Copyright (C) 2008 Nokia
*
* This library is free software; you can redistribute it and/or
@@ -17,13 +18,17 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef __TRACKER_DB_INTERFACE_SQLITE_H__
-#define __TRACKER_DB_INTERFACE_SQLITE_H__
+#ifndef __LIBTRACKER_DB_INTERFACE_SQLITE_H__
+#define __LIBTRACKER_DB_INTERFACE_SQLITE_H__
#include "tracker-db-interface.h"
G_BEGIN_DECLS
+#if !defined (__LIBTRACKER_DB_INSIDE__) && !defined (TRACKER_COMPILATION)
+#error "only <libtracker-db/tracker-db.h> must be included directly."
+#endif
+
#define TRACKER_TYPE_DB_INTERFACE_SQLITE (tracker_db_interface_sqlite_get_type ())
#define TRACKER_DB_INTERFACE_SQLITE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TRACKER_TYPE_DB_INTERFACE_SQLITE, TrackerDBInterfaceSqlite))
#define TRACKER_DB_INTERFACE_SQLITE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), TRACKER_TYPE_DB_INTERFACE_SQLITE, TrackerDBInterfaceSqliteClass))
@@ -58,29 +63,26 @@ struct TrackerDBInterfaceSqliteClass {
GObjectClass parent_class;
};
-GType tracker_db_interface_sqlite_get_type (void);
-
-TrackerDBInterface * tracker_db_interface_sqlite_new (const gchar *filename);
-TrackerDBInterface * tracker_db_interface_sqlite_new_ro (const gchar *filename);
-
-void tracker_db_interface_sqlite_create_function (TrackerDBInterface *interface,
- const gchar *name,
- TrackerDBFunc func,
- gint n_args);
-void tracker_db_interface_sqlite_create_aggregate (TrackerDBInterface *interface,
- const gchar *name,
- TrackerDBFuncStep step,
- gint n_args,
- TrackerDBFuncFinal final,
- guint context_size);
-gboolean tracker_db_interface_sqlite_set_collation_function (TrackerDBInterfaceSqlite *interface,
- const gchar *name,
- TrackerDBCollationFunc func);
-
-gint64 tracker_db_interface_sqlite_get_last_insert_id (TrackerDBInterfaceSqlite *interface);
-
-void tracker_db_interface_sqlite_enable_shared_cache (void);
+GType tracker_db_interface_sqlite_get_type (void);
+
+TrackerDBInterface *tracker_db_interface_sqlite_new (const gchar *filename);
+TrackerDBInterface *tracker_db_interface_sqlite_new_ro (const gchar *filename);
+void tracker_db_interface_sqlite_create_function (TrackerDBInterface *interface,
+ const gchar *name,
+ TrackerDBFunc func,
+ gint n_args);
+void tracker_db_interface_sqlite_create_aggregate (TrackerDBInterface *interface,
+ const gchar *name,
+ TrackerDBFuncStep step,
+ gint n_args,
+ TrackerDBFuncFinal final,
+ guint context_size);
+gboolean tracker_db_interface_sqlite_set_collation_function (TrackerDBInterfaceSqlite *interface,
+ const gchar *name,
+ TrackerDBCollationFunc func);
+gint64 tracker_db_interface_sqlite_get_last_insert_id (TrackerDBInterfaceSqlite *interface);
+void tracker_db_interface_sqlite_enable_shared_cache (void);
G_END_DECLS
-#endif /* __TRACKER_DB_INTERFACE_SQLITE_H__ */
+#endif /* __LIBTRACKER_DB_INTERFACE_SQLITE_H__ */
diff --git a/src/libtracker-db/tracker-db-interface.h b/src/libtracker-db/tracker-db-interface.h
index cf59daf..3dc03d0 100644
--- a/src/libtracker-db/tracker-db-interface.h
+++ b/src/libtracker-db/tracker-db-interface.h
@@ -18,13 +18,17 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef __TRACKER_DB_INTERFACE_H__
-#define __TRACKER_DB_INTERFACE_H__
+#ifndef __LIBTRACKER_DB_INTERFACE_H__
+#define __LIBTRACKER_DB_INTERFACE_H__
#include <glib-object.h>
G_BEGIN_DECLS
+#if !defined (__LIBTRACKER_DB_INSIDE__) && !defined (TRACKER_COMPILATION)
+#error "only <libtracker-db/tracker-db.h> must be included directly."
+#endif
+
#define TRACKER_TYPE_DB_INTERFACE (tracker_db_interface_get_type ())
#define TRACKER_DB_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRACKER_TYPE_DB_INTERFACE, TrackerDBInterface))
#define TRACKER_IS_DB_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRACKER_TYPE_DB_INTERFACE))
@@ -75,7 +79,6 @@ struct TrackerDBInterfaceIface {
const gchar *query);
void (* disconnect) (TrackerDBInterface *interface);
void (* reconnect) (TrackerDBInterface *interface);
-
};
struct TrackerDBStatementIface {
@@ -107,105 +110,98 @@ struct TrackerDBResultSetClass {
GObjectClass parent_class;
};
+struct TrackerDBCursorIface {
+ GTypeInterface iface;
-GQuark tracker_db_interface_error_quark (void);
+ void (*rewind) (TrackerDBCursor *cursor);
+ gboolean (*iter_next) (TrackerDBCursor *cursor);
+ guint (*get_n_columns)(TrackerDBCursor *cursor);
+ void (*get_value) (TrackerDBCursor *cursor,
+ guint column,
+ GValue *value);
+
+ const gchar* (*get_string) (TrackerDBCursor *cursor,
+ guint column);
+ gint (*get_int) (TrackerDBCursor *cursor,
+ guint column);
+ gdouble (*get_double) (TrackerDBCursor *cursor,
+ guint column);
+};
-GType tracker_db_interface_get_type (void);
-GType tracker_db_statement_get_type (void);
-GType tracker_db_cursor_get_type (void);
-GType tracker_db_result_set_get_type (void);
-GType tracker_db_blob_get_type (void);
+GQuark tracker_db_interface_error_quark (void);
+GType tracker_db_interface_get_type (void);
+GType tracker_db_statement_get_type (void);
+GType tracker_db_cursor_get_type (void);
+GType tracker_db_result_set_get_type (void);
+GType tracker_db_blob_get_type (void);
/* Functions to create queries/procedures */
-TrackerDBStatement * tracker_db_interface_create_statement (TrackerDBInterface *interface,
- const gchar *query,
- ...) G_GNUC_PRINTF (2, 3);
-TrackerDBResultSet * tracker_db_interface_execute_vquery (TrackerDBInterface *interface,
- GError **error,
- const gchar *query,
- va_list args);
-TrackerDBResultSet * tracker_db_interface_execute_query (TrackerDBInterface *interface,
- GError **error,
- const gchar *query,
- ...) G_GNUC_PRINTF (3, 4);
-
-gboolean tracker_db_interface_start_transaction (TrackerDBInterface *interface);
-gboolean tracker_db_interface_end_transaction (TrackerDBInterface *interface);
-void tracker_db_interface_disconnect (TrackerDBInterface *interface);
-void tracker_db_interface_reconnect (TrackerDBInterface *interface);
-
-void tracker_db_statement_bind_double (TrackerDBStatement *stmt,
- int index,
- double value);
-void tracker_db_statement_bind_int (TrackerDBStatement *stmt,
- int index,
- int value);
-void tracker_db_statement_bind_int64 (TrackerDBStatement *stmt,
- int index,
- gint64 value);
-void tracker_db_statement_bind_text (TrackerDBStatement *stmt,
- int index,
- const gchar *value);
-TrackerDBResultSet * tracker_db_statement_execute (TrackerDBStatement *stmt,
- GError **error);
-
-TrackerDBCursor * tracker_db_statement_start_cursor (TrackerDBStatement *stmt,
- GError **error);
+TrackerDBStatement *tracker_db_interface_create_statement (TrackerDBInterface *interface,
+ const gchar *query,
+ ...) G_GNUC_PRINTF (2, 3);
+TrackerDBResultSet *tracker_db_interface_execute_vquery (TrackerDBInterface *interface,
+ GError **error,
+ const gchar *query,
+ va_list args);
+TrackerDBResultSet *tracker_db_interface_execute_query (TrackerDBInterface *interface,
+ GError **error,
+ const gchar *query,
+ ...) G_GNUC_PRINTF (3, 4);
+
+gboolean tracker_db_interface_start_transaction (TrackerDBInterface *interface);
+gboolean tracker_db_interface_end_transaction (TrackerDBInterface *interface);
+void tracker_db_interface_disconnect (TrackerDBInterface *interface);
+void tracker_db_interface_reconnect (TrackerDBInterface *interface);
+void tracker_db_statement_bind_double (TrackerDBStatement *stmt,
+ int index,
+ double value);
+void tracker_db_statement_bind_int (TrackerDBStatement *stmt,
+ int index,
+ int value);
+void tracker_db_statement_bind_int64 (TrackerDBStatement *stmt,
+ int index,
+ gint64 value);
+void tracker_db_statement_bind_text (TrackerDBStatement *stmt,
+ int index,
+ const gchar *value);
+TrackerDBResultSet *tracker_db_statement_execute (TrackerDBStatement *stmt,
+ GError **error);
+TrackerDBCursor * tracker_db_statement_start_cursor (TrackerDBStatement *stmt,
+ GError **error);
/* Semi private TrackerDBResultSet functions */
-TrackerDBResultSet * _tracker_db_result_set_new (guint cols);
-void _tracker_db_result_set_append (TrackerDBResultSet *result_set);
-void _tracker_db_result_set_set_value (TrackerDBResultSet *result_set,
- guint column,
- const GValue *value);
-void _tracker_db_result_set_get_value (TrackerDBResultSet *result_set,
- guint column,
- GValue *value);
+TrackerDBResultSet *_tracker_db_result_set_new (guint cols);
+void _tracker_db_result_set_append (TrackerDBResultSet *result_set);
+void _tracker_db_result_set_set_value (TrackerDBResultSet *result_set,
+ guint column,
+ const GValue *value);
+void _tracker_db_result_set_get_value (TrackerDBResultSet *result_set,
+ guint column,
+ GValue *value);
/* Functions to deal with the resultset */
-void tracker_db_result_set_get (TrackerDBResultSet *result_set,
- ...);
-void tracker_db_result_set_rewind (TrackerDBResultSet *result_set);
-gboolean tracker_db_result_set_iter_next (TrackerDBResultSet *result_set);
-guint tracker_db_result_set_get_n_columns (TrackerDBResultSet *result_set);
-guint tracker_db_result_set_get_n_rows (TrackerDBResultSet *result_set);
-
-
-struct TrackerDBCursorIface {
- GTypeInterface iface;
-
- void (*rewind) (TrackerDBCursor *cursor);
- gboolean (*iter_next) (TrackerDBCursor *cursor);
- guint (*get_n_columns) (TrackerDBCursor *cursor);
- void (*get_value) (TrackerDBCursor *cursor,
- guint column,
- GValue *value);
-
- const gchar* (*get_string) (TrackerDBCursor *cursor,
- guint column);
- gint (*get_int) (TrackerDBCursor *cursor,
- guint column);
- gdouble (*get_double) (TrackerDBCursor *cursor,
- guint column);
-
-};
+void tracker_db_result_set_get (TrackerDBResultSet *result_set,
+ ...);
+void tracker_db_result_set_rewind (TrackerDBResultSet *result_set);
+gboolean tracker_db_result_set_iter_next (TrackerDBResultSet *result_set);
+guint tracker_db_result_set_get_n_columns (TrackerDBResultSet *result_set);
+guint tracker_db_result_set_get_n_rows (TrackerDBResultSet *result_set);
/* Functions to deal with a cursor */
-void tracker_db_cursor_rewind (TrackerDBCursor *cursor);
-gboolean tracker_db_cursor_iter_next (TrackerDBCursor *cursor);
-guint tracker_db_cursor_get_n_columns (TrackerDBCursor *cursor);
-void tracker_db_cursor_get_value (TrackerDBCursor *cursor,
- guint column,
- GValue *value);
-const gchar* tracker_db_cursor_get_string (TrackerDBCursor *cursor,
- guint column);
-gint tracker_db_cursor_get_int (TrackerDBCursor *cursor,
- guint column);
-gdouble tracker_db_cursor_get_double (TrackerDBCursor *cursor,
- guint column);
-
+void tracker_db_cursor_rewind (TrackerDBCursor *cursor);
+gboolean tracker_db_cursor_iter_next (TrackerDBCursor *cursor);
+guint tracker_db_cursor_get_n_columns (TrackerDBCursor *cursor);
+void tracker_db_cursor_get_value (TrackerDBCursor *cursor,
+ guint column,
+ GValue *value);
+const gchar* tracker_db_cursor_get_string (TrackerDBCursor *cursor,
+ guint column);
+gint tracker_db_cursor_get_int (TrackerDBCursor *cursor,
+ guint column);
+gdouble tracker_db_cursor_get_double (TrackerDBCursor *cursor,
+ guint column);
G_END_DECLS
-#endif /* __TRACKER_DB_INTERFACE_H__ */
+#endif /* __LIBTRACKER_DB_INTERFACE_H__ */
diff --git a/src/libtracker-db/tracker-db-journal.h b/src/libtracker-db/tracker-db-journal.h
index 424c2bb..23d5797 100644
--- a/src/libtracker-db/tracker-db-journal.h
+++ b/src/libtracker-db/tracker-db-journal.h
@@ -20,28 +20,32 @@
* Author: Philip Van Hoof <philip codeminded be>
*/
-#ifndef __TRACKER_DB_JOURNAL_H__
-#define __TRACKER_DB_JOURNAL_H__
+#ifndef __LIBTRACKER_DB_JOURNAL_H__
+#define __LIBTRACKER_DB_JOURNAL_H__
#include <glib.h>
#include <gio/gio.h>
-#define TRACKER_DB_JOURNAL_MAX_SIZE 52428800
-
G_BEGIN_DECLS
+#if !defined (__LIBTRACKER_DB_INSIDE__) && !defined (TRACKER_COMPILATION)
+#error "only <libtracker-db/tracker-db.h> must be included directly."
+#endif
+
+#define TRACKER_DB_JOURNAL_MAX_SIZE 52428800
+
typedef GPtrArray TrackerJournalContents;
-const gchar* tracker_db_journal_filename (void);
-void tracker_db_journal_open (void);
-void tracker_db_journal_log (const gchar *query);
-void tracker_db_journal_truncate (void);
-void tracker_db_journal_close (void);
-TrackerJournalContents* tracker_db_journal_get_contents (guint transaction_size);
-void tracker_db_journal_free_contents (TrackerJournalContents *contents);
-void tracker_db_journal_fsync (void);
-gsize tracker_db_journal_get_size (void);
+const gchar* tracker_db_journal_filename (void);
+void tracker_db_journal_open (void);
+void tracker_db_journal_log (const gchar *query);
+void tracker_db_journal_truncate (void);
+void tracker_db_journal_close (void);
+TrackerJournalContents* tracker_db_journal_get_contents (guint transaction_size);
+void tracker_db_journal_free_contents (TrackerJournalContents *contents);
+void tracker_db_journal_fsync (void);
+gsize tracker_db_journal_get_size (void);
G_END_DECLS
-#endif /* __TRACKER_DB_JOURNAL_H__ */
+#endif /* __LIBTRACKER_DB_JOURNAL_H__ */
diff --git a/src/libtracker-db/tracker-db-manager.h b/src/libtracker-db/tracker-db-manager.h
index be45632..60e92d8 100644
--- a/src/libtracker-db/tracker-db-manager.h
+++ b/src/libtracker-db/tracker-db-manager.h
@@ -18,8 +18,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef __TRACKER_DB_MANAGER_H__
-#define __TRACKER_DB_MANAGER_H__
+#ifndef __LIBTRACKER_DB_MANAGER_H__
+#define __LIBTRACKER_DB_MANAGER_H__
#include <glib-object.h>
@@ -27,6 +27,10 @@
G_BEGIN_DECLS
+#if !defined (__LIBTRACKER_DB_INSIDE__) && !defined (TRACKER_COMPILATION)
+#error "only <libtracker-db/tracker-db.h> must be included directly."
+#endif
+
#define TRACKER_TYPE_DB (tracker_db_get_type ())
typedef enum {
@@ -44,25 +48,19 @@ typedef enum {
TRACKER_DB_MANAGER_READONLY = 1 << 5
} TrackerDBManagerFlags;
-GType tracker_db_get_type (void) G_GNUC_CONST;
-
-gboolean tracker_db_manager_init (TrackerDBManagerFlags flags,
- gboolean *first_time,
- gboolean shared_cache,
- gboolean *need_journal);
-void tracker_db_manager_shutdown (void);
-
-void tracker_db_manager_remove_all (gboolean rm_backup_and_log);
-void tracker_db_manager_optimize (void);
-
-const gchar *tracker_db_manager_get_file (TrackerDB db);
-
-TrackerDBInterface *
- tracker_db_manager_get_db_interface (void);
-
-void tracker_db_manager_disconnect (void);
-void tracker_db_manager_reconnect (void);
+GType tracker_db_get_type (void) G_GNUC_CONST;
+gboolean tracker_db_manager_init (TrackerDBManagerFlags flags,
+ gboolean *first_time,
+ gboolean shared_cache,
+ gboolean *need_journal);
+void tracker_db_manager_shutdown (void);
+void tracker_db_manager_remove_all (gboolean rm_backup_and_log);
+void tracker_db_manager_optimize (void);
+const gchar * tracker_db_manager_get_file (TrackerDB db);
+TrackerDBInterface *tracker_db_manager_get_db_interface (void);
+void tracker_db_manager_disconnect (void);
+void tracker_db_manager_reconnect (void);
G_END_DECLS
-#endif /* __TRACKER_DB_MANAGER_H__ */
+#endif /* __LIBTRACKER_DB_MANAGER_H__ */
diff --git a/src/libtracker-db/tracker-db.h b/src/libtracker-db/tracker-db.h
new file mode 100644
index 0000000..21c98c6
--- /dev/null
+++ b/src/libtracker-db/tracker-db.h
@@ -0,0 +1,43 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2009, Nokia (urho konttori 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_DB_H__
+#define __LIBTRACKER_DB_H__
+
+G_BEGIN_DECLS
+
+#if !defined (TRACKER_ENABLE_INTERNALS) && !defined (TRACKER_COMPILATION)
+#error "TRACKER_ENABLE_INTERNALS not defined, this must be defined to use tracker's internal functions"
+#endif
+
+#define __LIBTRACKER_DB_INSIDE__
+
+#include "tracker-db-backup.h"
+#include "tracker-db-dbus.h"
+#include "tracker-db-interface.h"
+#include "tracker-db-interface-sqlite.h"
+#include "tracker-db-journal.h"
+#include "tracker-db-manager.h"
+
+#undef __LIBTRACKER_DB_INSIDE__
+
+G_END_DECLS
+
+#endif /* __LIBTRACKER_DB_H__ */
diff --git a/src/tracker-fts/Makefile.am b/src/tracker-fts/Makefile.am
index 9837c9b..efe5757 100644
--- a/src/tracker-fts/Makefile.am
+++ b/src/tracker-fts/Makefile.am
@@ -8,6 +8,7 @@ INCLUDES = \
$(GLIB2_CFLAGS) \
$(GCOV_CFLAGS) \
$(PANGO_CFLAGS) \
+ $(DBUS_CFLAGS) \
$(SQLITE3_CFLAGS)
noinst_LTLIBRARIES = libtracker-fts.la
@@ -25,6 +26,7 @@ libtracker_fts_la_SOURCES = \
libtracker_fts_la_LIBADD = \
$(top_builddir)/src/libtracker-common/libtracker-common.la \
$(SQLITE3_LIBS) \
+ $(DBUS_LIBS) \
$(GTHREAD_LIBS) \
$(GCOV_LIBS) \
$(PANGO_LIBS) \
diff --git a/tests/libtracker-data/tracker-ontology-test.c b/tests/libtracker-data/tracker-ontology-test.c
index a75f352..fbd5f58 100644
--- a/tests/libtracker-data/tracker-ontology-test.c
+++ b/tests/libtracker-data/tracker-ontology-test.c
@@ -18,12 +18,14 @@
* Boston, MA 02110-1301, USA.
*/
+#include "config.h"
+
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
-#include <libtracker-db/tracker-db-manager.h>
+#include <libtracker-db/tracker-db.h>
#include <libtracker-data/tracker-data-manager.h>
#include <libtracker-data/tracker-data-query.h>
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index d9635ee..c51899d 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -18,18 +18,20 @@
* Boston, MA 02110-1301, USA.
*/
+#include "config.h"
+
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
-#include <libtracker-db/tracker-db-manager.h>
+#include <libtracker-common/tracker-common.h>
+#include <libtracker-db/tracker-db.h>
#include <libtracker-data/tracker-data-manager.h>
#include <libtracker-data/tracker-data-query.h>
#include <libtracker-data/tracker-data-update.h>
#include <libtracker-data/tracker-sparql-query.h>
-#include <libtracker-common/tracker-ontology.h>
typedef struct _TestInfo TestInfo;
diff --git a/tests/libtracker-db/tracker-db-dbus-test.c b/tests/libtracker-db/tracker-db-dbus-test.c
index be8689e..4a5a1ac 100644
--- a/tests/libtracker-db/tracker-db-dbus-test.c
+++ b/tests/libtracker-db/tracker-db-dbus-test.c
@@ -17,10 +17,13 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+
+#include "config.h"
+
#include <glib.h>
-#include <libtracker-db/tracker-db-dbus.h>
-#include <libtracker-db/tracker-db-interface.h>
+#include <libtracker-db/tracker-db.h>
+
#include "tracker-test-helpers.h"
static TrackerDBResultSet *
diff --git a/tests/libtracker-db/tracker-db-manager-common.h b/tests/libtracker-db/tracker-db-manager-common.h
index 8df1542..4c82ac7 100644
--- a/tests/libtracker-db/tracker-db-manager-common.h
+++ b/tests/libtracker-db/tracker-db-manager-common.h
@@ -17,11 +17,13 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+
#ifndef __TRACKER_DB_MANAGER_TEST_COMMON__
#define __TRACKER_DB_MANAGER_TEST_COMMON__
#include <glib.h>
-#include <libtracker-db/tracker-db-manager.h>
+
+#include <libtracker-db/tracker-db.h>
gboolean test_assert_query_run (TrackerDB db, const gchar *query);
gboolean test_assert_query_run_on_iface (TrackerDBInterface *iface, const gchar *query);
diff --git a/tests/libtracker-db/tracker-db-manager-test-attach.c b/tests/libtracker-db/tracker-db-manager-test-attach.c
index b7ee257..843885b 100644
--- a/tests/libtracker-db/tracker-db-manager-test-attach.c
+++ b/tests/libtracker-db/tracker-db-manager-test-attach.c
@@ -17,11 +17,14 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+
+#include "config.h"
+
#include <glib.h>
-#include <libtracker-db/tracker-db-manager.h>
-#include "tracker-db-manager-common.h"
+#include <libtracker-db/tracker-db.h>
+#include "tracker-db-manager-common.h"
typedef enum {
NO_INIT,
diff --git a/tests/libtracker-db/tracker-db-manager-test-custom.c b/tests/libtracker-db/tracker-db-manager-test-custom.c
index 6fa8f2d..a74626d 100644
--- a/tests/libtracker-db/tracker-db-manager-test-custom.c
+++ b/tests/libtracker-db/tracker-db-manager-test-custom.c
@@ -17,9 +17,13 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+
+#include "config.h"
+
#include <glib.h>
-#include <libtracker-db/tracker-db-manager.h>
+#include <libtracker-db/tracker-db.h>
+
#include "tracker-db-manager-common.h"
void
diff --git a/tests/libtracker-db/tracker-db-manager-test-unattach.c b/tests/libtracker-db/tracker-db-manager-test-unattach.c
index 9123040..08ff5dc 100644
--- a/tests/libtracker-db/tracker-db-manager-test-unattach.c
+++ b/tests/libtracker-db/tracker-db-manager-test-unattach.c
@@ -17,9 +17,13 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+
+#include "config.h"
+
#include <glib.h>
-#include <libtracker-db/tracker-db-manager.h>
+#include <libtracker-db/tracker-db.h>
+
#include "tracker-db-manager-common.h"
void
diff --git a/tests/tracker-fts/tracker-fts-test.c b/tests/tracker-fts/tracker-fts-test.c
index 8405367..cbc9c7a 100644
--- a/tests/tracker-fts/tracker-fts-test.c
+++ b/tests/tracker-fts/tracker-fts-test.c
@@ -18,12 +18,14 @@
* Boston, MA 02110-1301, USA.
*/
+#include "config.h"
+
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
-#include <libtracker-db/tracker-db-manager.h>
+#include <libtracker-db/tracker-db.h>
#include <libtracker-data/tracker-data-manager.h>
#include <libtracker-data/tracker-data-query.h>
diff --git a/utils/services/Makefile.am b/utils/services/Makefile.am
index fdf72d3..f622559 100644
--- a/utils/services/Makefile.am
+++ b/utils/services/Makefile.am
@@ -2,62 +2,67 @@ include $(top_srcdir)/Makefile.decl
noinst_PROGRAMS = ontology-validator ttl2html data-validator ttl2graphviz
-INCLUDES = \
- -DG_LOG_DOMAIN=\"Tracker\" \
- -DTRACKER_COMPILATION \
- -I$(top_srcdir)/src \
- $(WARN_CFLAGS) \
- $(GLIB2_CFLAGS) \
- $(GIO_CFLAGS)
-
-ontology_validator_SOURCES = \
+INCLUDES = \
+ -DG_LOG_DOMAIN=\"Tracker\" \
+ -DTRACKER_COMPILATION \
+ -I$(top_srcdir)/src \
+ $(WARN_CFLAGS) \
+ $(GLIB2_CFLAGS) \
+ $(GIO_CFLAGS) \
+ $(DBUS_CFLAGS)
+
+ontology_validator_SOURCES = \
ontology-validator.c
-ontology_validator_LDADD = \
+ontology_validator_LDADD = \
$(top_builddir)/src/libtracker-data/libtracker-data.la \
$(top_builddir)/src/libtracker-common/libtracker-common.la \
- $(GLIB2_LIBS) \
- $(GIO_LIBS)
+ $(DBUS_LIBS) \
+ $(GIO_LIBS) \
+ $(GLIB2_LIBS)
-data_validator_SOURCES = \
+data_validator_SOURCES = \
data-validator.c
-data_validator_LDADD = \
+data_validator_LDADD = \
$(top_builddir)/src/libtracker-data/libtracker-data.la \
$(top_builddir)/src/libtracker-common/libtracker-common.la \
- $(GLIB2_LIBS) \
+ $(DBUS_LIBS) \
+ $(GLIB2_LIBS) \
$(GIO_LIBS)
-ttl2html_SOURCES = \
- ttl2html.c \
- ttl_loader.h \
- ttl_loader.c \
- ttl_model.h \
- ttl_model.c \
- qname.h \
- qname.c \
- ttl_html.h \
+ttl2html_SOURCES = \
+ ttl2html.c \
+ ttl_loader.h \
+ ttl_loader.c \
+ ttl_model.h \
+ ttl_model.c \
+ qname.h \
+ qname.c \
+ ttl_html.h \
ttl_html.c
-ttl2html_LDADD = \
+ttl2html_LDADD = \
$(top_builddir)/src/libtracker-data/libtracker-data.la \
$(top_builddir)/src/libtracker-common/libtracker-common.la \
- $(GLIB2_LIBS) \
+ $(DBUS_LIBS) \
+ $(GLIB2_LIBS) \
$(GIO_LIBS)
-ttl2graphviz_SOURCES = \
- ttl2graphviz.c \
- ttl_loader.h \
- ttl_loader.c \
- ttl_model.h \
- ttl_model.c \
- qname.h \
- qname.c \
- ttl_graphviz.h \
+ttl2graphviz_SOURCES = \
+ ttl2graphviz.c \
+ ttl_loader.h \
+ ttl_loader.c \
+ ttl_model.h \
+ ttl_model.c \
+ qname.h \
+ qname.c \
+ ttl_graphviz.h \
ttl_graphviz.c
-ttl2graphviz_LDADD = \
+ttl2graphviz_LDADD = \
$(top_builddir)/src/libtracker-data/libtracker-data.la \
$(top_builddir)/src/libtracker-common/libtracker-common.la \
- $(GLIB2_LIBS) \
+ $(DBUS_LIBS) \
+ $(GLIB2_LIBS) \
$(GIO_LIBS)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]