[tracker] libtracker-db: Remove tracker-db-action and tracker-db-file-info



commit 980af794dc25f467d9afa2b9a75e77abb512377d
Author: Jürg Billeter <j bitron ch>
Date:   Wed Apr 22 12:11:26 2009 +0200

    libtracker-db: Remove tracker-db-action and tracker-db-file-info
    
    The files were not used anywhere.
---
 src/libtracker-data/tracker-data-manager.h |    1 -
 src/libtracker-data/tracker-data-query.h   |    1 -
 src/libtracker-db/Makefile.am              |    4 -
 src/libtracker-db/tracker-db-action.c      |  149 ------------
 src/libtracker-db/tracker-db-action.h      |   63 -----
 src/libtracker-db/tracker-db-file-info.c   |  353 ----------------------------
 src/libtracker-db/tracker-db-file-info.h   |  108 ---------
 7 files changed, 0 insertions(+), 679 deletions(-)

diff --git a/src/libtracker-data/tracker-data-manager.h b/src/libtracker-data/tracker-data-manager.h
index 4f9183d..3071e97 100644
--- a/src/libtracker-data/tracker-data-manager.h
+++ b/src/libtracker-data/tracker-data-manager.h
@@ -31,7 +31,6 @@
 #include <libtracker-common/tracker-ontology.h>
 
 #include <libtracker-db/tracker-db-interface.h>
-#include <libtracker-db/tracker-db-file-info.h>
 #include <libtracker-db/tracker-db-manager.h>
 
 G_BEGIN_DECLS
diff --git a/src/libtracker-data/tracker-data-query.h b/src/libtracker-data/tracker-data-query.h
index ba5a1b3..ab29e83 100644
--- a/src/libtracker-data/tracker-data-query.h
+++ b/src/libtracker-data/tracker-data-query.h
@@ -32,7 +32,6 @@
 #include <libtracker-common/tracker-property.h>
 
 #include <libtracker-db/tracker-db-interface.h>
-#include <libtracker-db/tracker-db-file-info.h>
 
 G_BEGIN_DECLS
 
diff --git a/src/libtracker-db/Makefile.am b/src/libtracker-db/Makefile.am
index 22e133f..d3de40c 100644
--- a/src/libtracker-db/Makefile.am
+++ b/src/libtracker-db/Makefile.am
@@ -16,17 +16,13 @@ libtracker_dbdir = $(libdir)/tracker-$(TRACKER_API_VERSION)
 libtracker_db_LTLIBRARIES = libtracker-db.la
 
 libtracker_db_la_SOURCES = 						\
-	tracker-db-action.c						\
 	tracker-db-dbus.c						\
-	tracker-db-file-info.c						\
 	tracker-db-interface.c						\
 	tracker-db-interface-sqlite.c					\
 	tracker-db-manager.c
 
 noinst_HEADERS =							\
-	tracker-db-action.h						\
 	tracker-db-dbus.h						\
-	tracker-db-file-info.h						\
 	tracker-db-interface.h						\
 	tracker-db-interface-sqlite.h					\
 	tracker-db-manager.h 
diff --git a/src/libtracker-db/tracker-db-action.c b/src/libtracker-db/tracker-db-action.c
deleted file mode 100644
index 80a724d..0000000
--- a/src/libtracker-db/tracker-db-action.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2008, Mr Jamie McCracken (jamiemcc gnome org)
- * Copyright (C) 2008, Nokia
- *
- * 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 "config.h"
-
-#include "tracker-db-action.h"
-
-GType
-tracker_db_action_get_type (void)
-{
-	static GType etype = 0;
-
-	if (etype == 0) {
-		static const GEnumValue values[] = {
-			{ TRACKER_DB_ACTION_IGNORE,
-			  "TRACKER_DB_ACTION_IGNORE",
-			  "Ignoring" },
-			{ TRACKER_DB_ACTION_CHECK,
-			  "TRACKER_DB_ACTION_CHECK",
-			  "Checking" },
-			{ TRACKER_DB_ACTION_DELETE,
-			  "TRACKER_DB_ACTION_DELETE",
-			  "Deleting" },
-			{ TRACKER_DB_ACTION_DELETE_SELF,
-			  "TRACKER_DB_ACTION_DELETE_SELF",
-			  "Deleting Self" },
-			{ TRACKER_DB_ACTION_CREATE,
-			  "TRACKER_DB_ACTION_CREATE",
-			  "Creating" },
-			{ TRACKER_DB_ACTION_MOVED_FROM,
-			  "TRACKER_DB_ACTION_MOVED_FROM",
-			  "Moved From" },
-			{ TRACKER_DB_ACTION_MOVED_TO,
-			  "TRACKER_DB_ACTION_MOVED_TO",
-			  "Moved To" },
-			{ TRACKER_DB_ACTION_FILE_CHECK,
-			  "TRACKER_DB_ACTION_FILE_CHECK",
-			  "File Check" },
-			{ TRACKER_DB_ACTION_FILE_CHANGED,
-			  "TRACKER_DB_ACTION_FILE_CHANGED",
-			  "File Changed" },
-			{ TRACKER_DB_ACTION_FILE_DELETED,
-			  "TRACKER_DB_ACTION_FILE_DELETED",
-			  "File Deleted" },
-			{ TRACKER_DB_ACTION_FILE_CREATED,
-			  "TRACKER_DB_ACTION_FILE_CREATED",
-			  "File Created" },
-			{ TRACKER_DB_ACTION_FILE_MOVED_FROM,
-			  "TRACKER_DB_ACTION_FILE_MOVED_FROM",
-			  "File Moved From" },
-			{ TRACKER_DB_ACTION_FILE_MOVED_TO,
-			  "TRACKER_DB_ACTION_FILE_MOVED_TO",
-			  "File Moved To" },
-			{ TRACKER_DB_ACTION_WRITABLE_FILE_CLOSED,
-			  "TRACKER_DB_ACTION_WRITABLE_FILE_CLOSED",
-			  "Writable File Closed" },
-			{ TRACKER_DB_ACTION_DIRECTORY_CHECK,
-			  "TRACKER_DB_ACTION_DIRECTORY_CHECK",
-			  "Directory Check" },
-			{ TRACKER_DB_ACTION_DIRECTORY_CREATED,
-			  "TRACKER_DB_ACTION_DIRECTORY_CREATED",
-			  "Directory Created" },
-			{ TRACKER_DB_ACTION_DIRECTORY_UNMOUNTED,
-			  "TRACKER_DB_ACTION_DIRECTORY_UNMOUNTED",
-			  "Directory Unmounted" },
-			{ TRACKER_DB_ACTION_DIRECTORY_DELETED,
-			  "TRACKER_DB_ACTION_DIRECTORY_DELETED",
-			  "Directory Deleted" },
-			{ TRACKER_DB_ACTION_DIRECTORY_MOVED_FROM,
-			  "TRACKER_DB_ACTION_DIRECTORY_MOVED_FROM",
-			  "Directory Moved From" },
-			{ TRACKER_DB_ACTION_DIRECTORY_MOVED_TO,
-			  "TRACKER_DB_ACTION_DIRECTORY_MOVED_TO",
-			  "Directory Moved To" },
-			{ TRACKER_DB_ACTION_DIRECTORY_REFRESH,
-			  "TRACKER_DB_ACTION_DIRECTORY_REFRESH",
-			  "Directory Refresh" },
-			{ TRACKER_DB_ACTION_EXTRACT_METADATA,
-			  "TRACKER_DB_ACTION_EXTRACT_METADATA",
-			  "Extract Metadata" },
-			{ TRACKER_DB_ACTION_FORCE_REFRESH,
-			  "TRACKER_DB_ACTION_FORCE_REFRESH",
-			  "Forcing Refresh" },
-			{ 0, NULL, NULL }
-		};
-
-		etype = g_enum_register_static ("TrackerDBAction", values);
-
-		/* Since we don't reference this enum anywhere, we do
-		 * it here to make sure it exists when we call
-		 * g_type_class_peek(). This wouldn't be necessary if
-		 * it was a param in a GObject for example.
-		 *
-		 * This does mean that we are leaking by 1 reference
-		 * here and should clean it up, but it doesn't grow so
-		 * this is acceptable.
-		 */
-
-		g_type_class_ref (etype);
-	}
-
-	return etype;
-}
-
-const gchar *
-tracker_db_action_to_string (TrackerDBAction action)
-{
-	GType	    type;
-	GEnumClass *enum_class;
-	GEnumValue *enum_value;
-
-	type = tracker_db_action_get_type ();
-	enum_class = G_ENUM_CLASS (g_type_class_peek (type));
-	enum_value = g_enum_get_value (enum_class, action);
-
-	if (!enum_value) {
-		enum_value = g_enum_get_value (enum_class, TRACKER_DB_ACTION_IGNORE);
-	}
-
-	return enum_value->value_nick;
-}
-
-gboolean
-tracker_db_action_is_delete (TrackerDBAction action)
-{
-	return
-		action == TRACKER_DB_ACTION_DELETE ||
-		action == TRACKER_DB_ACTION_DELETE_SELF ||
-		action == TRACKER_DB_ACTION_FILE_DELETED ||
-		action == TRACKER_DB_ACTION_DIRECTORY_DELETED;
-}
diff --git a/src/libtracker-db/tracker-db-action.h b/src/libtracker-db/tracker-db-action.h
deleted file mode 100644
index 024da99..0000000
--- a/src/libtracker-db/tracker-db-action.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2008, Mr Jamie McCracken (jamiemcc gnome org)
- * Copyright (C) 2008, Nokia
- *
- * 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.
- */
-
-#ifndef __TRACKERD_DB_ACTION_H__
-#define __TRACKERD_DB_ACTION_H__
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define TRACKER_TYPE_ACTION (tracker_db_action_get_type ())
-
-typedef enum {
-	TRACKER_DB_ACTION_IGNORE,
-	TRACKER_DB_ACTION_CHECK,
-	TRACKER_DB_ACTION_DELETE,
-	TRACKER_DB_ACTION_DELETE_SELF,
-	TRACKER_DB_ACTION_CREATE,
-	TRACKER_DB_ACTION_MOVED_FROM,
-	TRACKER_DB_ACTION_MOVED_TO,
-	TRACKER_DB_ACTION_FILE_CHECK,
-	TRACKER_DB_ACTION_FILE_CHANGED,
-	TRACKER_DB_ACTION_FILE_DELETED,
-	TRACKER_DB_ACTION_FILE_CREATED,
-	TRACKER_DB_ACTION_FILE_MOVED_FROM,
-	TRACKER_DB_ACTION_FILE_MOVED_TO,
-	TRACKER_DB_ACTION_WRITABLE_FILE_CLOSED,
-	TRACKER_DB_ACTION_DIRECTORY_CHECK,
-	TRACKER_DB_ACTION_DIRECTORY_CREATED,
-	TRACKER_DB_ACTION_DIRECTORY_UNMOUNTED,
-	TRACKER_DB_ACTION_DIRECTORY_DELETED,
-	TRACKER_DB_ACTION_DIRECTORY_MOVED_FROM,
-	TRACKER_DB_ACTION_DIRECTORY_MOVED_TO,
-	TRACKER_DB_ACTION_DIRECTORY_REFRESH,
-	TRACKER_DB_ACTION_EXTRACT_METADATA,
-	TRACKER_DB_ACTION_FORCE_REFRESH
-} TrackerDBAction;
-
-GType	     tracker_db_action_get_type  (void) G_GNUC_CONST;
-const gchar *tracker_db_action_to_string (TrackerDBAction action);
-gboolean     tracker_db_action_is_delete (TrackerDBAction action);
-
-G_END_DECLS
-
-#endif /* __TRACKERD_DB_ACTION_H__ */
diff --git a/src/libtracker-db/tracker-db-file-info.c b/src/libtracker-db/tracker-db-file-info.c
deleted file mode 100644
index 37d335c..0000000
--- a/src/libtracker-db/tracker-db-file-info.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2008, Mr Jamie McCracken (jamiemcc gnome org)
- * Copyright (C) 2008, Nokia
- *
- * 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 "config.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <glib.h>
-#include <glib/gstdio.h>
-
-#include <libtracker-common/tracker-log.h>
-#include <libtracker-common/tracker-os-dependant.h>
-
-#include "tracker-db-file-info.h"
-
-static gint allocated;
-static gint deallocated;
-
-/*
- * TrackerDBWatch
- */
-GType
-tracker_db_watch_get_type (void)
-{
-	static GType etype = 0;
-
-	if (etype == 0) {
-		static const GEnumValue values[] = {
-			{ TRACKER_DB_WATCH_ROOT,
-			  "TRACKER_DB_WATCH_ROOT",
-			  "Watching Root" },
-			{ TRACKER_DB_WATCH_SUBFOLDER,
-			  "TRACKER_DB_WATCH_SUBFOLDER",
-			  "Watching Subfolder" },
-			{ TRACKER_DB_WATCH_SPECIAL_FOLDER,
-			  "TRACKER_DB_WATCH_SPECIAL_FOLDER",
-			  "Watching Special Folder" },
-			{ TRACKER_DB_WATCH_SPECIAL_FILE,
-			  "TRACKER_DB_WATCH_SPECIAL_FILE",
-			  "Watching Special File" },
-			{ TRACKER_DB_WATCH_NO_INDEX,
-			  "TRACKER_DB_WATCH_NO_INDEX",
-			  "Watching No Index" },
-			{ TRACKER_DB_WATCH_OTHER,
-			  "TRACKER_DB_WATCH_OTHER",
-			  "Watching Other" },
-			{ 0, NULL, NULL }
-		};
-
-		etype = g_enum_register_static ("TrackerDBWatch", values);
-
-		/* Since we don't reference this enum anywhere, we do
-		 * it here to make sure it exists when we call
-		 * g_type_class_peek(). This wouldn't be necessary if
-		 * it was a param in a GObject for example.
-		 *
-		 * This does mean that we are leaking by 1 reference
-		 * here and should clean it up, but it doesn't grow so
-		 * this is acceptable.
-		 */
-
-		g_type_class_ref (etype);
-	}
-
-	return etype;
-}
-
-const gchar *
-tracker_db_watch_to_string (TrackerDBWatch watch)
-{
-	GType	    type;
-	GEnumClass *enum_class;
-	GEnumValue *enum_value;
-
-	type = tracker_db_action_get_type ();
-	enum_class = G_ENUM_CLASS (g_type_class_peek (type));
-	enum_value = g_enum_get_value (enum_class, watch);
-
-	if (!enum_value) {
-		enum_value = g_enum_get_value (enum_class, TRACKER_DB_WATCH_OTHER);
-	}
-
-	return enum_value->value_nick;
-}
-
-/*
- * TrackerDBFileInfo
- */
-TrackerDBFileInfo *
-tracker_db_file_info_new (const char	  *uri,
-			  TrackerDBAction  action,
-			  gint		   counter,
-			  TrackerDBWatch   watch)
-{
-	TrackerDBFileInfo *info;
-
-	info = g_slice_new0 (TrackerDBFileInfo);
-
-	info->action = action;
-	info->uri = g_strdup (uri);
-
-	info->counter = counter;
-	info->file_id = 0;
-
-	info->watch_type = watch;
-	info->is_directory = FALSE;
-
-	info->is_link = FALSE;
-	info->link_id = 0;
-	info->link_path = NULL;
-	info->link_name = NULL;
-
-	info->mime = NULL;
-	info->file_size = 0;
-	info->permissions = g_strdup ("-r--r--r--");
-	info->mtime = 0;
-	info->atime = 0;
-	info->indextime = 0;
-	info->offset = 0;
-	info->aux_id = -1;
-
-	info->is_hidden = FALSE;
-
-	info->is_new = TRUE;
-	info->service_type_id = -1;
-
-	info->ref_count = 1;
-
-	/* Keep a tally of how many we have created */
-	allocated++;
-
-	return info;
-}
-
-void
-tracker_db_file_info_free (TrackerDBFileInfo *info)
-{
-	if (!info) {
-		return;
-	}
-
-	if (info->uri) {
-		g_free (info->uri);
-	}
-
-	if (info->moved_to_uri) {
-		g_free (info->moved_to_uri);
-	}
-
-	if (info->link_path) {
-		g_free (info->link_path);
-	}
-
-	if (info->link_name) {
-		g_free (info->link_name);
-	}
-
-	if (info->mime) {
-		g_free (info->mime);
-	}
-
-	if (info->permissions) {
-		g_free (info->permissions);
-	}
-
-	g_slice_free (TrackerDBFileInfo, info);
-
-	/* Keep a tally of how many we have removed */
-	deallocated++;
-}
-
-/* Ref count TrackerDBFileInfo instances */
-TrackerDBFileInfo *
-tracker_db_file_info_ref (TrackerDBFileInfo *info)
-{
-	if (info) {
-		g_atomic_int_inc (&info->ref_count);
-	}
-
-	return info;
-}
-
-TrackerDBFileInfo *
-tracker_db_file_info_unref (TrackerDBFileInfo *info)
-{
-	if (!info) {
-		return NULL;
-	}
-
-	if g_atomic_int_dec_and_test (&info->ref_count) {
-		tracker_db_file_info_free (info);
-		return NULL;
-	}
-
-	return info;
-}
-
-#if 0
-static TrackerDBFileInfo *
-db_file_info_get_pending (guint32	   file_id,
-			  const gchar	  *uri,
-			  const gchar	  *mime,
-			  gint		   counter,
-			  TrackerDBAction  action,
-			  gboolean	   is_directory)
-{
-	TrackerDBFileInfo *info;
-
-	info = g_slice_new0 (TrackerDBFileInfo);
-
-	info->action = action;
-	info->uri = g_strdup (uri);
-
-	info->counter = counter;
-	info->file_id = file_id;
-
-	info->is_directory = is_directory;
-
-	info->is_link = FALSE;
-	info->link_id = 0;
-	info->link_path = NULL;
-	info->link_name = NULL;
-
-	if (mime) {
-		info->mime = g_strdup (mime);
-	} else {
-		info->mime = NULL;
-	}
-
-	info->file_size = 0;
-	info->permissions = g_strdup ("-r--r--r--");
-	info->mtime = 0;
-	info->atime = 0;
-	info->indextime = 0;
-	info->offset = 0;
-
-	info->service_type_id = -1;
-	info->is_new = TRUE;
-
-	info->ref_count = 1;
-
-	allocated++;
-
-	return info;
-}
-#endif
-
-TrackerDBFileInfo *
-tracker_db_file_info_get (TrackerDBFileInfo *info)
-{
-	GError      *error = NULL;
-	gchar	    *str, *uri_in_locale;
-	struct stat  finfo;
-
-	if (!info || !info->uri) {
-		return info;
-	}
-
-	uri_in_locale = g_filename_from_utf8 (info->uri, 
-					      -1, 
-					      NULL, 
-					      NULL, 
-					      &error);
-
-	if (G_LIKELY (!error)) {
-		if (g_lstat (uri_in_locale, &finfo) == -1) {
-			g_free (uri_in_locale);
-
-			return info;
-		}
-	} else {
-		g_message ("Could not convert URI:'%s' to locale format, %s",
-			   info->uri,
-			   error->message);
-		g_error_free (error);
-
-		return NULL;
-	}
-
-	info->is_directory = S_ISDIR (finfo.st_mode);
-	info->is_link = S_ISLNK (finfo.st_mode);
-
-	if (info->is_link && !info->link_name) {
-		str = g_file_read_link (uri_in_locale, NULL);
-
-		if (str) {
-			gchar *link_uri;
-
-			link_uri = g_filename_to_utf8 (str, -1, NULL, NULL, NULL);
-			info->link_name = g_path_get_basename (link_uri);
-			info->link_path = g_path_get_dirname (link_uri);
-			g_free (link_uri);
-			g_free (str);
-		}
-	}
-
-	g_free (uri_in_locale);
-
-	if (!info->is_directory) {
-		info->file_size = (guint32) finfo.st_size;
-	} else {
-		if (info->watch_type == TRACKER_DB_WATCH_OTHER) {
-			info->watch_type = TRACKER_DB_WATCH_SUBFOLDER;
-		}
-	}
-
-	g_free (info->permissions);
-	info->permissions = tracker_create_permission_string (finfo);
-
-	info->mtime = finfo.st_mtime;
-	info->atime = finfo.st_atime;
-
-	return info;
-}
-
-gboolean
-tracker_db_file_info_is_valid (TrackerDBFileInfo *info)
-{
-	g_return_val_if_fail (info != NULL, FALSE);
-	g_return_val_if_fail (info->uri != NULL, FALSE);
-
-	if (!g_utf8_validate (info->uri, -1, NULL)) {
-		g_warning ("Expected UTF-8 validation of TrackerDBFileInfo URI");
-		return FALSE;
-	}
-
-	if (info->action == TRACKER_DB_ACTION_IGNORE) {
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
diff --git a/src/libtracker-db/tracker-db-file-info.h b/src/libtracker-db/tracker-db-file-info.h
deleted file mode 100644
index e21e315..0000000
--- a/src/libtracker-db/tracker-db-file-info.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2008, Mr Jamie McCracken (jamiemcc gnome org)
- * Copyright (C) 2008, Nokia
- *
- * 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.
- */
-
-#ifndef __TRACKER_DB_FILE_INFO_H__
-#define __TRACKER_DB_FILE_INFO_H__
-
-#include <glib-object.h>
-
-#include "tracker-db-action.h"
-
-/*
- * Watch types
- */
-#define TRACKER_TYPE_DB_WATCH (tracker_db_watch_get_type ())
-
-typedef enum {
-	TRACKER_DB_WATCH_ROOT,
-	TRACKER_DB_WATCH_SUBFOLDER,
-	TRACKER_DB_WATCH_SPECIAL_FOLDER,
-	TRACKER_DB_WATCH_SPECIAL_FILE,
-	TRACKER_DB_WATCH_NO_INDEX,
-	TRACKER_DB_WATCH_OTHER
-} TrackerDBWatch;
-
-GType		   tracker_db_watch_get_type  (void) G_GNUC_CONST;
-const gchar *	   tracker_db_watch_to_string (TrackerDBWatch	  watch);
-
-/*
- * File Information
- */
-typedef struct _TrackerDBFileInfo TrackerDBFileInfo;
-
-struct _TrackerDBFileInfo {
-	/* File name/path related info */
-	gchar		*uri;
-	guint32		 file_id;
-
-	TrackerDBAction  action;
-	guint32		 cookie;
-	gint		 counter;
-	TrackerDBWatch	 watch_type;
-
-	/* Symlink info - File ID of link might not be in DB so need
-	 * to store path/filename too.
-	 */
-	gint32		 link_id;
-	gchar		*link_path;
-	gchar		*link_name;
-
-	gchar		*mime;
-	gint		 service_type_id;
-	guint32		 file_size;
-	gchar		*permissions;
-	gint32		 mtime;
-	gint32		 atime;
-	gint32		 indextime;
-	gint32		 offset;
-
-	/* Options */
-	gchar		*moved_to_uri;
-
-	gint		 aux_id;
-
-	guint		 is_new : 1;
-	guint		 is_directory : 1;
-	guint		 is_link : 1;
-	guint		 extract_embedded : 1;
-	guint		 extract_contents : 1;
-	guint		 extract_thumbs : 1;
-	guint		 is_hidden : 1;
-
-	/* We ref count FileInfo as it has a complex lifespan and is
-	 * tossed between various threads, lists, queues and hash
-	 * tables.
-	 */
-	gint		 ref_count;
-};
-
-TrackerDBFileInfo *tracker_db_file_info_new	 (const gchar	    *uri,
-						  TrackerDBAction    action,
-						  gint		     counter,
-						  TrackerDBWatch     watch);
-void		   tracker_db_file_info_free	 (TrackerDBFileInfo *info);
-TrackerDBFileInfo *tracker_db_file_info_ref	 (TrackerDBFileInfo *info);
-TrackerDBFileInfo *tracker_db_file_info_unref	 (TrackerDBFileInfo *info);
-TrackerDBFileInfo *tracker_db_file_info_get	 (TrackerDBFileInfo *info);
-gboolean	   tracker_db_file_info_is_valid (TrackerDBFileInfo *info);
-
-
-#endif /* __TRACKER_DB_FILE_INFO_H__ */



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