[tracker/binary-log] Made it possible to pass the filename of the journal to the internal API



commit 73e7e52532b632459bb61fa6c4974eb9ead20bbd
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Dec 30 10:32:04 2009 +0100

    Made it possible to pass the filename of the journal to the internal API

 src/libtracker-data/tracker-data-manager.c |    3 ++-
 src/libtracker-db/tracker-db-journal.c     |    8 ++++++--
 src/libtracker-db/tracker-db-journal.h     |    2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 8f6d25b..504fa4c 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -36,6 +36,7 @@
 
 #include <libtracker-db/tracker-db-interface-sqlite.h>
 #include <libtracker-db/tracker-db-manager.h>
+#include <libtracker-db/tracker-db-journal.h>
 
 #include "tracker-data-manager.h"
 #include "tracker-data-update.h"
@@ -822,7 +823,7 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 
 	iface = tracker_db_manager_get_db_interface ();
 
-	tracker_db_journal_open ();
+	tracker_db_journal_open (NULL);
 
 	if (is_first_time_index) {
 		TrackerClass **classes;
diff --git a/src/libtracker-db/tracker-db-journal.c b/src/libtracker-db/tracker-db-journal.c
index d5f6812..e498e8e 100644
--- a/src/libtracker-db/tracker-db-journal.c
+++ b/src/libtracker-db/tracker-db-journal.c
@@ -105,11 +105,15 @@ cur_block_maybe_expand (guint len)
 }
 
 void
-tracker_db_journal_open (void)
+tracker_db_journal_open (const gchar *filen)
 {
 	struct stat st;
 
-	get_filename ();
+	if (!filen) {
+		get_filename ();
+	} else {
+		filename = g_strdup (filen);
+	}
 
 	journal = fopen (filename, "a");
 
diff --git a/src/libtracker-db/tracker-db-journal.h b/src/libtracker-db/tracker-db-journal.h
index 0356fb4..b28bd08 100644
--- a/src/libtracker-db/tracker-db-journal.h
+++ b/src/libtracker-db/tracker-db-journal.h
@@ -28,7 +28,7 @@
 G_BEGIN_DECLS
 
 const gchar* tracker_db_journal_filename                     (void);
-void         tracker_db_journal_open                         (void);
+void         tracker_db_journal_open                         (const gchar *filen);
 
 void         tracker_db_journal_start_transaction            (void);
 void         tracker_db_journal_append_delete_statement      (guint32      s_code,



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