tracker r2086 - in branches/indexer-split: . src/libtracker-common src/libtracker-db src/libtracker-gtk src/tracker-applet src/tracker-extract src/tracker-indexer src/tracker-indexer/modules src/tracker-search-tool src/tracker-thumbnailer src/trackerd tests/common tests/libtracker-common tests/libtracker-db utils/qdbm
- From: mr svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2086 - in branches/indexer-split: . src/libtracker-common src/libtracker-db src/libtracker-gtk src/tracker-applet src/tracker-extract src/tracker-indexer src/tracker-indexer/modules src/tracker-search-tool src/tracker-thumbnailer src/trackerd tests/common tests/libtracker-common tests/libtracker-db utils/qdbm
- Date: Mon, 18 Aug 2008 11:37:01 +0000 (UTC)
Author: mr
Date: Mon Aug 18 11:37:01 2008
New Revision: 2086
URL: http://svn.gnome.org/viewvc/tracker?rev=2086&view=rev
Log:
* src/libtracker-common/tracker-ontology.c:
* src/libtracker-common/tracker-type-utils.c:
* src/libtracker-db/tracker-db-file-info.c:
* src/libtracker-db/tracker-db-manager.c:
* src/libtracker-gtk/tracker-metadata-tile.c:
* src/tracker-extract/tracker-extract-html.c:
* src/tracker-extract/tracker-extract-jpeg.c:
* src/tracker-extract/tracker-extract-mp3.c:
* src/tracker-extract/tracker-extract.[ch]:
* src/tracker-indexer/modules/evolution.c:
* src/tracker-indexer/modules/files.c:
* src/tracker-indexer/modules/gaim-conversations.c:
* src/tracker-indexer/tracker-indexer-db.c:
* src/tracker-search-tool/tracker-search-tool-callbacks.c:
* src/tracker-search-tool/tracker-search-tool-support.c:
* src/tracker-search-tool/tracker-search-tool.c:
* src/tracker-thumbnailer/tracker-thumbnailer.c:
* src/trackerd/tracker-db.c:
* src/trackerd/tracker-monitor.c:
* src/trackerd/tracker-search.c:
* tests/common/Makefile.am:
* tests/common/tracker-test-helpers.[ch]:
* tests/libtracker-common/tracker-file-utils-test.c:
* tests/libtracker-common/tracker-ontology-test.c:
* tests/libtracker-common/tracker-parser-test.c:
* tests/libtracker-db/tracker-index-writer-test.c:
* utils/qdbm/print-words.c:
* utils/qdbm/search-word.c: Added -Wmissing-declarations
-Wmissing-prototypes -Wunused warnings to the CFLAGS when using
--enable-warnings. These files all had incorrect declarations or
unused code which has been removed.
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/libtracker-common/tracker-ontology.c
branches/indexer-split/src/libtracker-common/tracker-type-utils.c
branches/indexer-split/src/libtracker-db/tracker-db-action.h
branches/indexer-split/src/libtracker-db/tracker-db-file-info.c
branches/indexer-split/src/libtracker-db/tracker-db-manager.c
branches/indexer-split/src/libtracker-gtk/tracker-metadata-tile.c
branches/indexer-split/src/tracker-applet/tracker-applet-marshallers.c
branches/indexer-split/src/tracker-extract/tracker-extract-html.c
branches/indexer-split/src/tracker-extract/tracker-extract-jpeg.c
branches/indexer-split/src/tracker-extract/tracker-extract-mp3.c
branches/indexer-split/src/tracker-extract/tracker-extract.c
branches/indexer-split/src/tracker-extract/tracker-extract.h
branches/indexer-split/src/tracker-indexer/modules/evolution.c
branches/indexer-split/src/tracker-indexer/modules/files.c
branches/indexer-split/src/tracker-indexer/modules/gaim-conversations.c
branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c
branches/indexer-split/src/tracker-search-tool/tracker-search-tool-callbacks.c
branches/indexer-split/src/tracker-search-tool/tracker-search-tool-support.c
branches/indexer-split/src/tracker-search-tool/tracker-search-tool.c
branches/indexer-split/src/tracker-thumbnailer/tracker-thumbnailer.c
branches/indexer-split/src/trackerd/tracker-db.c
branches/indexer-split/src/trackerd/tracker-monitor.c
branches/indexer-split/src/trackerd/tracker-search.c
branches/indexer-split/tests/common/Makefile.am
branches/indexer-split/tests/common/tracker-test-helpers.c
branches/indexer-split/tests/common/tracker-test-helpers.h
branches/indexer-split/tests/libtracker-common/tracker-file-utils-test.c
branches/indexer-split/tests/libtracker-common/tracker-ontology-test.c
branches/indexer-split/tests/libtracker-common/tracker-parser-test.c
branches/indexer-split/tests/libtracker-db/tracker-index-writer-test.c
branches/indexer-split/utils/qdbm/print-words.c
branches/indexer-split/utils/qdbm/search-word.c
Modified: branches/indexer-split/src/libtracker-common/tracker-ontology.c
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-ontology.c (original)
+++ branches/indexer-split/src/libtracker-common/tracker-ontology.c Mon Aug 18 11:37:01 2008
@@ -70,7 +70,7 @@
g_free (mime_prefix);
}
-gpointer
+static gpointer
ontology_hash_lookup_by_str (GHashTable *hash_table,
const gchar *str)
{
@@ -84,7 +84,7 @@
return data;
}
-gpointer
+static gpointer
ontology_hash_lookup_by_id (GHashTable *hash_table,
gint id)
{
Modified: branches/indexer-split/src/libtracker-common/tracker-type-utils.c
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-type-utils.c (original)
+++ branches/indexer-split/src/libtracker-common/tracker-type-utils.c Mon Aug 18 11:37:01 2008
@@ -26,13 +26,13 @@
#include "tracker-log.h"
#include "tracker-utils.h"
+#include "tracker-type-utils.h"
static const char *months[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
-
static const char imonths[] = {
'1', '2', '3', '4', '5',
'6', '7', '8', '9', '0', '1', '2'
Modified: branches/indexer-split/src/libtracker-db/tracker-db-action.h
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-action.h (original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-action.h Mon Aug 18 11:37:01 2008
@@ -55,10 +55,9 @@
} TrackerDBAction;
GType tracker_db_action_get_type (void) G_GNUC_CONST;
-const gchar *tracker_db_action_to_string (TrackerDBAction action);
+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__ */
Modified: branches/indexer-split/src/libtracker-db/tracker-db-file-info.c
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-file-info.c (original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-file-info.c Mon Aug 18 11:37:01 2008
@@ -40,7 +40,7 @@
* TrackerDBWatch
*/
GType
-tracker_action_get_type (void)
+tracker_db_watch_get_type (void)
{
static GType etype = 0;
@@ -92,7 +92,7 @@
GEnumClass *enum_class;
GEnumValue *enum_value;
- type = tracker_action_get_type ();
+ 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);
Modified: branches/indexer-split/src/libtracker-db/tracker-db-manager.c
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-manager.c (original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-manager.c Mon Aug 18 11:37:01 2008
@@ -168,23 +168,6 @@
return NULL;
}
-void
-set_up_databases (void)
-{
- const gchar *dir;
- guint i;
-
- g_message ("Setting up all databases");
-
- for (i = 0; i < G_N_ELEMENTS (dbs); i++) {
- /* Fill absolute path for the database */
- dir = location_to_directory (dbs[i].location);
- dbs[i].abs_filename = g_build_filename (dir, dbs[i].file, NULL);
- }
-
- g_message ("Setting up all databases completed");
-}
-
static void
load_sql_file (TrackerDBInterface *iface,
const gchar *file,
Modified: branches/indexer-split/src/libtracker-gtk/tracker-metadata-tile.c
==============================================================================
--- branches/indexer-split/src/libtracker-gtk/tracker-metadata-tile.c (original)
+++ branches/indexer-split/src/libtracker-gtk/tracker-metadata-tile.c Mon Aug 18 11:37:01 2008
@@ -763,8 +763,8 @@
}
/* taken from gnome_vfs, formats a file size to something normal */
-gchar*
-tracker_vfs_format_file_size_for_display (gulong size)
+static gchar *
+format_file_size_for_display (gulong size)
{
if (size < KILOBYTE_FACTOR) {
//return g_strdup_printf (dngettext(GETTEXT_PACKAGE, "%u byte", "%u bytes",(guint) size), (guint) size);
@@ -797,7 +797,7 @@
char *temp;
size = atol (prop);
- format = tracker_vfs_format_file_size_for_display (size);
+ format = format_file_size_for_display (size);
temp = g_strdup_printf (string, format);
gtk_label_set_markup (GTK_LABEL (label), temp);
Modified: branches/indexer-split/src/tracker-applet/tracker-applet-marshallers.c
==============================================================================
--- branches/indexer-split/src/tracker-applet/tracker-applet-marshallers.c (original)
+++ branches/indexer-split/src/tracker-applet/tracker-applet-marshallers.c Mon Aug 18 11:37:01 2008
@@ -1,5 +1,5 @@
-
#include <glib-object.h>
+#include "tracker-applet-marshallers.h"
#ifdef G_ENABLE_DEBUG
Modified: branches/indexer-split/src/tracker-extract/tracker-extract-html.c
==============================================================================
--- branches/indexer-split/src/tracker-extract/tracker-extract-html.c (original)
+++ branches/indexer-split/src/tracker-extract/tracker-extract-html.c Mon Aug 18 11:37:01 2008
@@ -34,8 +34,7 @@
tag_type current;
} HTMLParseInfo;
-
-gboolean
+static gboolean
has_attribute (const xmlChar **atts, const char *attr, const char *val)
{
if (!(atts && attr && val)) {
@@ -55,7 +54,7 @@
}
-const xmlChar *
+static const xmlChar *
lookup_attribute (const xmlChar **atts, const char *attr)
{
if (!atts || !attr) {
@@ -128,7 +127,6 @@
}
}
-
void
characters (void *info, const xmlChar *ch, int len)
{
Modified: branches/indexer-split/src/tracker-extract/tracker-extract-jpeg.c
==============================================================================
--- branches/indexer-split/src/tracker-extract/tracker-extract-jpeg.c (original)
+++ branches/indexer-split/src/tracker-extract/tracker-extract-jpeg.c Mon Aug 18 11:37:01 2008
@@ -37,6 +37,7 @@
#define XMP_NAMESPACE_LENGTH 29
#ifdef HAVE_LIBEXIF
+
#include <libexif/exif-data.h>
#define EXIF_DATE_FORMAT "%Y:%m:%d %H:%M:%S"
@@ -51,14 +52,12 @@
return tracker_generic_date_to_iso8601 (exif_date, EXIF_DATE_FORMAT);
}
-
static gchar *
fix_focal_length (gchar *fl)
{
return g_strndup (fl, (strstr (fl, "mm") - fl));
}
-
static gchar *
fix_flash (gchar *flash)
{
@@ -69,7 +68,6 @@
}
}
-
static gchar *
fix_fnumber (gchar *fn)
{
@@ -86,7 +84,6 @@
return fn;
}
-
static gchar *
fix_exposure_time (gchar *et)
{
@@ -115,7 +112,6 @@
PostProcessor post;
} TagType;
-
TagType tags[] = {
{ EXIF_TAG_PIXEL_Y_DIMENSION, "Image:Height", NULL },
{ EXIF_TAG_PIXEL_X_DIMENSION, "Image:Width", NULL },
@@ -143,14 +139,12 @@
{ -1, NULL, NULL }
};
+#endif /* HAVE_LIBEXIF */
-#endif
-
-void
+static void
tracker_read_exif (const unsigned char *buffer, size_t len, GHashTable *metadata)
{
#ifdef HAVE_LIBEXIF
-
ExifData *exif;
TagType *p;
@@ -173,10 +167,9 @@
}
}
}
-#endif
+#endif /* HAVE_LIBEXIF */
}
-
static void
tracker_extract_jpeg (const gchar *filename, GHashTable *metadata)
{
@@ -230,19 +223,19 @@
break;
case JPEG_APP0+1:
- #if defined(HAVE_LIBEXIF)
+#if defined(HAVE_LIBEXIF)
if (strncmp ("Exif", (gchar *)(marker->data),5) == 0) {
tracker_read_exif ((unsigned char *)marker->data, marker->data_length, metadata);
}
- #endif /* HAVE_LIBEXIF */
+#endif /* HAVE_LIBEXIF */
- #if defined(HAVE_EXEMPI)
+#if defined(HAVE_EXEMPI)
if (strncmp ("http://ns.adobe.com/xap/1.0/\x00", (char *)(marker->data),XMP_NAMESPACE_LENGTH) == 0) {
tracker_read_xmp ((char *)marker->data+XMP_NAMESPACE_LENGTH,
marker->data_length-XMP_NAMESPACE_LENGTH,
metadata);
}
- #endif /* HAVE_EXEMPI */
+#endif /* HAVE_EXEMPI */
break;
@@ -256,8 +249,6 @@
marker = marker->next;
}
-
-
jpeg_destroy_decompress(&cinfo);
fclose (jpeg);
@@ -266,13 +257,11 @@
}
}
-
TrackerExtractorData data[] = {
{ "image/jpeg", tracker_extract_jpeg },
{ NULL, NULL }
};
-
TrackerExtractorData *
tracker_get_extractor_data (void)
{
Modified: branches/indexer-split/src/tracker-extract/tracker-extract-mp3.c
==============================================================================
--- branches/indexer-split/src/tracker-extract/tracker-extract-mp3.c (original)
+++ branches/indexer-split/src/tracker-extract/tracker-extract-mp3.c Mon Aug 18 11:37:01 2008
@@ -45,6 +45,7 @@
char * type;
} Matches;
+#if 0 /* Unused */
static struct {
char * name;
@@ -83,6 +84,7 @@
{NULL, NULL, FALSE},
};
+#endif /* Unused */
typedef struct {
char * title;
@@ -349,8 +351,9 @@
return OK;
}
+#if 0 /* Unused */
-gboolean
+static gboolean
tracker_metadata_mp3_is_writable (const char *meta)
{
int i;
@@ -369,15 +372,14 @@
}
-
-gboolean
+static gboolean
tracker_metadata_mp3_write (const char *meta_name, const char *value)
{
/* to do */
return FALSE;
}
-
+#endif /* Unused */
static void
mp3_parse (const char *data, size_t size, GHashTable *metadata)
Modified: branches/indexer-split/src/tracker-extract/tracker-extract.c
==============================================================================
--- branches/indexer-split/src/tracker-extract/tracker-extract.c (original)
+++ branches/indexer-split/src/tracker-extract/tracker-extract.c Mon Aug 18 11:37:01 2008
@@ -20,22 +20,25 @@
#include "config.h"
+#define _XOPEN_SOURCE
+#include <time.h>
+
+#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <locale.h>
-#include <string.h>
#include <sys/types.h>
+
#ifndef OS_WIN32
#include <sys/resource.h>
#endif
+
#include <sys/time.h>
#include <unistd.h>
+
#include <glib.h>
#include <gmodule.h>
-#define _XOPEN_SOURCE
-#include <time.h>
-
#include "tracker-extract.h"
#define MAX_MEM 128
@@ -45,7 +48,6 @@
GArray *extractors = NULL;
-
gchar *
tracker_generic_date_to_iso8601 (const gchar *date, const gchar *format)
{
@@ -57,7 +59,6 @@
memset (&date_tm, 0, sizeof (struct tm));
processed = strptime (date, format, &date_tm);
-
if (processed == NULL) {
// Unable to parse the input
return NULL;
@@ -70,7 +71,6 @@
return result;
}
-
gboolean
tracker_is_empty_string (const gchar *s)
{
@@ -111,9 +111,8 @@
#endif
}
-
-void
-tracker_child_cb (gpointer user_data)
+static void
+child_cb (gpointer user_data)
{
#ifndef OS_WIN32
struct rlimit cpu_limit;
@@ -152,7 +151,7 @@
argv,
NULL,
G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL,
- tracker_child_cb,
+ child_cb,
GINT_TO_POINTER (timeout),
tmp_stdout,
NULL,
Modified: branches/indexer-split/src/tracker-extract/tracker-extract.h
==============================================================================
--- branches/indexer-split/src/tracker-extract/tracker-extract.h (original)
+++ branches/indexer-split/src/tracker-extract/tracker-extract.h Mon Aug 18 11:37:01 2008
@@ -17,11 +17,13 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef _TRACKER_EXTRACT_H_
-#define _TRACKER_EXTRACT_H_
+#ifndef __TRACKER_EXTRACT_H__
+#define __TRACKER_EXTRACT_H__
#include <glib.h>
+G_BEGIN_DECLS
+
typedef struct TrackerExtractorData TrackerExtractorData;
typedef TrackerExtractorData * (* TrackerExtractorDataFunc) (void);
@@ -32,11 +34,15 @@
GHashTable *metadata);
};
+gchar * tracker_generic_date_to_iso8601 (const gchar *date,
+ const gchar *format);
+gboolean tracker_is_empty_string (const gchar *s);
+gboolean tracker_spawn (gchar **argv,
+ int timeout,
+ gchar **tmp_stdout,
+ gint *exit_status);
+TrackerExtractorData *tracker_get_extractor_data (void);
-gchar * tracker_generic_date_to_iso8601 (const gchar *date, const gchar *format);
-
-gboolean tracker_is_empty_string (const gchar *s);
-
-gboolean tracker_spawn (gchar **argv, int timeout, gchar **tmp_stdout, gint *exit_status);
+G_END_DECLS
-#endif
+#endif /* __TRACKER_EXTRACT_H__ */
Modified: branches/indexer-split/src/tracker-indexer/modules/evolution.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/modules/evolution.c (original)
+++ branches/indexer-split/src/tracker-indexer/modules/evolution.c Mon Aug 18 11:37:01 2008
@@ -671,7 +671,7 @@
return g_list_reverse (list);
}
-TrackerMetadata *
+static TrackerMetadata *
get_metadata_for_data_wrapper (GMimeDataWrapper *wrapper)
{
TrackerMetadata *metadata;
@@ -699,7 +699,7 @@
return metadata;
}
-TrackerMetadata *
+static TrackerMetadata *
get_metadata_for_mbox_attachment (TrackerFile *file,
GMimeMessage *message,
GMimePart *part)
@@ -730,7 +730,7 @@
return metadata;
}
-TrackerMetadata *
+static TrackerMetadata *
get_metadata_for_mbox (TrackerFile *file)
{
EvolutionLocalData *data;
@@ -788,7 +788,7 @@
return metadata;
}
-void
+static void
skip_content_info (FILE *summary)
{
guint32 count, i;
@@ -826,7 +826,7 @@
}
}
-gboolean
+static gboolean
get_imap_attachment_info (const gchar *mime_file,
gchar **name,
GMimePartEncodingType *encoding)
@@ -930,7 +930,7 @@
return TRUE;
}
-void
+static void
get_imap_uri (TrackerFile *file,
const gchar *uid,
gchar **uri_base,
@@ -1042,7 +1042,7 @@
return body;
}
-TrackerMetadata *
+static TrackerMetadata *
get_metadata_for_imap_attachment (TrackerFile *file,
const gchar *mime_file)
{
@@ -1100,7 +1100,7 @@
return metadata;
}
-TrackerMetadata *
+static TrackerMetadata *
get_metadata_for_imap (TrackerFile *file)
{
EvolutionImapData *data;
Modified: branches/indexer-split/src/tracker-indexer/modules/files.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/modules/files.c (original)
+++ branches/indexer-split/src/tracker-indexer/modules/files.c Mon Aug 18 11:37:01 2008
@@ -182,7 +182,7 @@
return text;
}
-gchar *
+static gchar *
get_file_content (const gchar *path)
{
GFile *file;
Modified: branches/indexer-split/src/tracker-indexer/modules/gaim-conversations.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/modules/gaim-conversations.c (original)
+++ branches/indexer-split/src/tracker-indexer/modules/gaim-conversations.c Mon Aug 18 11:37:01 2008
@@ -26,10 +26,3 @@
/* Return module name here */
return "GaimConversations";
}
-
-TrackerMetadata *
-tracker_module_get_file_metadata (const gchar *file)
-{
- /* Return a hashtable filled with metadata for the file */
- return NULL;
-}
Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c (original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c Mon Aug 18 11:37:01 2008
@@ -24,6 +24,8 @@
#include <stdlib.h>
#include <libtracker-common/tracker-type-utils.h>
+#include <libtracker-common/tracker-file-utils.h>
+
#include <libtracker-db/tracker-db-manager.h>
#include <libtracker-db/tracker-db-dbus.h>
Modified: branches/indexer-split/src/tracker-search-tool/tracker-search-tool-callbacks.c
==============================================================================
--- branches/indexer-split/src/tracker-search-tool/tracker-search-tool-callbacks.c (original)
+++ branches/indexer-split/src/tracker-search-tool/tracker-search-tool-callbacks.c Mon Aug 18 11:37:01 2008
@@ -455,10 +455,10 @@
#endif
}
-GdkPixbuf *
-tracker_get_large_icon (const gchar * local_uri,
- gboolean is_local_file,
- GSearchWindow * gsearch)
+static GdkPixbuf *
+get_large_icon (const gchar * local_uri,
+ gboolean is_local_file,
+ GSearchWindow * gsearch)
{
gchar * thumb_name = NULL;
GdkPixbuf * temp = NULL;
@@ -535,7 +535,7 @@
/* get large icon for documents, images and videos only */
GdkPixbuf *large_icon = NULL;
if (type == SERVICE_DOCUMENTS || type == SERVICE_IMAGES || type == SERVICE_VIDEOS) {
- large_icon = tracker_get_large_icon (uri, (gsearch->type < 10), gsearch);
+ large_icon = get_large_icon (uri, (gsearch->type < 10), gsearch);
}
Modified: branches/indexer-split/src/tracker-search-tool/tracker-search-tool-support.c
==============================================================================
--- branches/indexer-split/src/tracker-search-tool/tracker-search-tool-support.c (original)
+++ branches/indexer-split/src/tracker-search-tool/tracker-search-tool-support.c Mon Aug 18 11:37:01 2008
@@ -1466,9 +1466,9 @@
return order;
}
-GtkTreeViewColumn *
-tracker_search_gtk_tree_view_get_column_with_sort_column_id (GtkTreeView * treeview,
- gint id)
+static GtkTreeViewColumn *
+get_column_with_sort_column_id (GtkTreeView * treeview,
+ gint id)
{
GtkTreeViewColumn * col = NULL;
GList * columns;
@@ -1504,7 +1504,7 @@
if (id >= 0 && id < NUM_COLUMNS) {
- cur = tracker_search_gtk_tree_view_get_column_with_sort_column_id (treeview, id);
+ cur = get_column_with_sort_column_id (treeview, id);
if (cur && cur != last) {
gtk_tree_view_move_column_after (treeview, cur, last);
Modified: branches/indexer-split/src/tracker-search-tool/tracker-search-tool.c
==============================================================================
--- branches/indexer-split/src/tracker-search-tool/tracker-search-tool.c (original)
+++ branches/indexer-split/src/tracker-search-tool/tracker-search-tool.c Mon Aug 18 11:37:01 2008
@@ -1785,8 +1785,7 @@
tracker_search_text_get_hit_count_all_async (tracker_client, query, (TrackerGPtrArrayReply) get_hit_count, gsearch);
}
-
-void
+static void
end_refresh_count (int count, GError * error, gpointer user_data)
{
GSearchWindow *gsearch = user_data;
@@ -1803,7 +1802,6 @@
}
-
void
end_search (GPtrArray * out_array,
GError * error,
Modified: branches/indexer-split/src/tracker-thumbnailer/tracker-thumbnailer.c
==============================================================================
--- branches/indexer-split/src/tracker-thumbnailer/tracker-thumbnailer.c (original)
+++ branches/indexer-split/src/tracker-thumbnailer/tracker-thumbnailer.c Mon Aug 18 11:37:01 2008
@@ -43,7 +43,7 @@
#define LIBDIR "/usr/lib"
#endif
-guint
+static guint
create_thumbnails_dir (const gchar * const subdir)
{
gchar *thumbnails_dir = NULL;
Modified: branches/indexer-split/src/trackerd/tracker-db.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db.c (original)
+++ branches/indexer-split/src/trackerd/tracker-db.c Mon Aug 18 11:37:01 2008
@@ -2837,60 +2837,6 @@
NULL);
}
-GSList *
-tracker_db_mime_query (TrackerDBInterface *iface,
- const gchar *stored_proc,
- gint service_id)
-{
- TrackerDBResultSet *result_set;
- GSList *result = NULL;
- gchar *service_id_str;
-
- g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
- g_return_val_if_fail (stored_proc != NULL, NULL);
-
- service_id_str = g_strdup_printf ("%d", service_id);
- result_set = tracker_db_exec_proc (iface, stored_proc, service_id_str, NULL);
- g_free (service_id_str);
-
- if (result_set) {
- gchar *str;
- gboolean valid = TRUE;
-
- while (valid) {
- tracker_db_result_set_get (result_set, 0, &str, -1);
- result = g_slist_prepend (result, str);
- valid = tracker_db_result_set_iter_next (result_set);
- }
-
- g_object_unref (result_set);
- }
-
- return result;
-}
-
-GSList *
-tracker_db_get_mimes_for_service_id (TrackerDBInterface *iface,
- gint service_id)
-{
- g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
-
- return tracker_db_mime_query (iface,
- "GetMimeForServiceId",
- service_id);
-}
-
-GSList *
-tracker_db_get_mime_prefixes_for_service_id (TrackerDBInterface *iface,
- gint service_id)
-{
- g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
-
- return tracker_db_mime_query (iface,
- "GetMimePrefixForServiceId",
- service_id);
-}
-
TrackerFieldData *
tracker_db_get_metadata_field (TrackerDBInterface *iface,
const gchar *service,
Modified: branches/indexer-split/src/trackerd/tracker-monitor.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-monitor.c (original)
+++ branches/indexer-split/src/trackerd/tracker-monitor.c Mon Aug 18 11:37:01 2008
@@ -425,7 +425,7 @@
return module_name;
}
-const gchar *
+static const gchar *
get_module_name_from_gfile (TrackerMonitor *monitor,
GFile *file,
gboolean *is_directory)
Modified: branches/indexer-split/src/trackerd/tracker-search.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-search.c (original)
+++ branches/indexer-split/src/trackerd/tracker-search.c Mon Aug 18 11:37:01 2008
@@ -301,7 +301,7 @@
return text_copy;
}
-gchar *
+static gchar *
search_get_snippet (const gchar *text,
gchar **terms,
gint length)
Modified: branches/indexer-split/tests/common/Makefile.am
==============================================================================
--- branches/indexer-split/tests/common/Makefile.am (original)
+++ branches/indexer-split/tests/common/Makefile.am Mon Aug 18 11:37:01 2008
@@ -1,5 +1,7 @@
include $(top_srcdir)/Makefile.decl
+CFLAGS = "-I."
+
noinst_LTLIBRARIES = libtracker-testcommon.la
INCLUDES = $(GLIB2_CFLAGS)
Modified: branches/indexer-split/tests/common/tracker-test-helpers.c
==============================================================================
--- branches/indexer-split/tests/common/tracker-test-helpers.c (original)
+++ branches/indexer-split/tests/common/tracker-test-helpers.c Mon Aug 18 11:37:01 2008
@@ -19,17 +19,19 @@
*/
#include "tracker-test-helpers.h"
+static gchar *nonutf8_str = NULL;
+
gboolean
-tracker_test_helpers_cmpstr_equal (const gchar *obtained, const gchar *expected)
+tracker_test_helpers_cmpstr_equal (const gchar *obtained,
+ const gchar *expected)
{
gboolean result;
- // NULL pointers are equals at the eyes of Godpiler
- if ( expected == obtained ) {
+ if (expected == obtained) {
return TRUE;
}
- if ( expected && obtained ) {
+ if (expected && obtained) {
result = !g_utf8_collate (expected, obtained);
if (!result) {
g_warning ("Expected %s - obtained %s", expected, obtained);
@@ -41,10 +43,8 @@
}
}
-static gchar *nonutf8_str = NULL;
-
const gchar *
-tracker_test_helpers_get_nonutf8 ()
+tracker_test_helpers_get_nonutf8 (void)
{
GMappedFile *file = NULL;
@@ -59,7 +59,7 @@
}
void
-tracker_test_helpers_free_nonutf8 ()
+tracker_test_helpers_free_nonutf8 (void)
{
if (nonutf8_str) {
g_free (nonutf8_str);
Modified: branches/indexer-split/tests/common/tracker-test-helpers.h
==============================================================================
--- branches/indexer-split/tests/common/tracker-test-helpers.h (original)
+++ branches/indexer-split/tests/common/tracker-test-helpers.h Mon Aug 18 11:37:01 2008
@@ -22,10 +22,13 @@
#include <glib.h>
+G_BEGIN_DECLS
+
gboolean tracker_test_helpers_cmpstr_equal (const gchar *obtained,
const gchar *expected);
-const gchar *tracker_test_helpers_get_nonutf8 ();
-void tracker_test_helpers_free_nonutf8 ();
+const gchar *tracker_test_helpers_get_nonutf8 (void);
+void tracker_test_helpers_free_nonutf8 (void);
+G_END_DECLS
-#endif
+#endif /* __TRACKER_TEST_HELPERS_H__ */
Modified: branches/indexer-split/tests/libtracker-common/tracker-file-utils-test.c
==============================================================================
--- branches/indexer-split/tests/libtracker-common/tracker-file-utils-test.c (original)
+++ branches/indexer-split/tests/libtracker-common/tracker-file-utils-test.c Mon Aug 18 11:37:01 2008
@@ -1,12 +1,34 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008, Nokia (urho konttori 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 <string.h>
+
#include <glib.h>
#include <glib/gtestutils.h>
#include <gio/gio.h>
#include <libtracker-common/tracker-file-utils.h>
+
#include <tracker-test-helpers.h>
-#include <string.h>
-GSList *
+static GSList *
array_as_list (gchar **array)
{
gint i;
@@ -20,9 +42,9 @@
return result;
}
-gboolean
-string_in_list (GSList *list, const gchar *string) {
-
+static gboolean
+string_in_list (GSList *list, const gchar *string)
+{
GSList *it;
for ( it = list; it != NULL; it = it->next) {
if (strcmp (it->data, string) == 0) {
@@ -33,29 +55,28 @@
}
static void
-test_path_list_filter_duplicates ()
+test_path_list_filter_duplicates (void)
{
gchar *input_roots [] = {"/home", "/home/ivan", "/tmp", "/usr/", "/usr/share/local", NULL};
GSList *input_as_list = NULL;
GSList *result;
+
input_as_list = array_as_list (input_roots);
result = tracker_path_list_filter_duplicates (input_as_list);
- // Expected /home /tmp /usr
g_assert_cmpint (3, ==, g_slist_length (result));
g_assert (string_in_list (result, "/home/"));
g_assert (string_in_list (result, "/tmp/"));
g_assert (string_in_list (result, "/usr/"));
-
g_slist_foreach (input_as_list, (GFunc) g_free, NULL);
}
static void
-test_path_evaluate_name ()
+test_path_evaluate_name (void)
{
gchar *result;
@@ -72,9 +93,8 @@
tracker_test_helpers_cmpstr_equal (result, "/home/user/all/ok");
g_free (result);
- /*
- The result of this test and the next one are not consistent!
- Must it remove the end '/' or not?
+ /* The result of this test and the next one are not consistent!
+ * Must it remove the end '/' or not?
*/
result = tracker_path_evaluate_name ("/home/user/all/dir/");
tracker_test_helpers_cmpstr_equal (result, "/home/user/all/dir");
@@ -113,7 +133,6 @@
g_free (result);
g_free (parent_dir);
-
result = tracker_path_evaluate_name ("");
g_assert (!result);
@@ -130,7 +149,6 @@
static void
test_file_get_mime_type (void)
{
-
gchar *dir_name, *result;
GFile *dir;
@@ -150,8 +168,8 @@
}
int
-main (int argc, char **argv) {
-
+main (int argc, char **argv)
+{
int result;
g_type_init ();
Modified: branches/indexer-split/tests/libtracker-common/tracker-ontology-test.c
==============================================================================
--- branches/indexer-split/tests/libtracker-common/tracker-ontology-test.c (original)
+++ branches/indexer-split/tests/libtracker-common/tracker-ontology-test.c Mon Aug 18 11:37:01 2008
@@ -17,48 +17,49 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+
+#include <string.h>
+
+#include <glib.h>
+#include <glib/gtestutils.h>
+
#include <libtracker-common/tracker-service.h>
#include <libtracker-common/tracker-field.h>
#include <libtracker-common/tracker-ontology.h>
-#include <glib.h>
-#include <glib/gtestutils.h>
+
#include <tracker-test-helpers.h>
-#include <string.h>
-gboolean
+static gboolean
test_cmp_servicedef_equals (TrackerService *one,
TrackerService *two)
{
-
- if ( one && !two) {
- return FALSE; // one is null and two not
+ if (one && !two) {
+ return FALSE;
}
- if ( !one && two ) {
+ if (!one && two) {
return FALSE;
}
- if ( !one && one == two ) {
- return TRUE; // Both null
+ if (!one && one == two) {
+ return TRUE;
}
- return ( tracker_service_get_id (one) == tracker_service_get_id (two)
- && tracker_test_helpers_cmpstr_equal ( tracker_service_get_name (one),
- tracker_service_get_name (two))
- && tracker_test_helpers_cmpstr_equal ( tracker_service_get_parent (one),
- tracker_service_get_parent (two))
- && tracker_service_get_db_type (one) == tracker_service_get_db_type (two)
- && tracker_service_get_embedded (one) == tracker_service_get_embedded (two));
-
+ return (tracker_service_get_id (one) == tracker_service_get_id (two) &&
+ tracker_test_helpers_cmpstr_equal (tracker_service_get_name (one),
+ tracker_service_get_name (two)) &&
+ tracker_test_helpers_cmpstr_equal (tracker_service_get_parent (one),
+ tracker_service_get_parent (two)) &&
+ tracker_service_get_db_type (one) == tracker_service_get_db_type (two) &&
+ tracker_service_get_embedded (one) == tracker_service_get_embedded (two));
}
static gboolean
element_in_list (GSList *list, gchar *element)
{
- return (g_slist_find_custom (list, element, (GCompareFunc)strcmp) != NULL);
+ return (g_slist_find_custom (list, element, (GCompareFunc) strcmp) != NULL);
}
-
static GSList *
array_to_list (char **array)
{
@@ -67,12 +68,12 @@
for (i = 0; array[i] != NULL; i++) {
list = g_slist_prepend (list, g_strdup (array[i]));
- }
+ }
+
return list;
}
-
-TrackerField *
+static TrackerField *
create_field_definition (const gchar *id,
const gchar *name,
TrackerFieldType data_type,
@@ -94,13 +95,19 @@
return field;
}
-TrackerService *
-create_service_definition (int id, const char *name, const char *parent, gboolean embedded) {
-
+static TrackerService *
+create_service_definition (gint id,
+ const char *name,
+ const char *parent,
+ gboolean embedded)
+{
TrackerService *def;
/* array_to_list use prepend, so use reverse order here */
- gchar * key_metadata [] = {"Key:Metadata2", "Key:MetaData1", NULL};
-
+ gchar *key_metadata [] = {
+ "Key:Metadata2",
+ "Key:MetaData1",
+ NULL
+ };
def = tracker_service_new ();
tracker_service_set_id (def, id);
@@ -131,7 +138,7 @@
TrackerService *conv_def, *gaim_def, *gossip_def, *new_gaim_def;
TrackerField *field_title;
- GSList *mimes, *mime_prefixes; //, *app_dirs_list, *app_extension_list;
+ GSList *mimes, *mime_prefixes;
def = create_service_definition (0, "Test service", "Parent service", TRUE);
parent_def = create_service_definition (1, "Parent service", NULL, FALSE);
@@ -175,7 +182,7 @@
}
static void
-test_get_id_for_service ()
+test_get_id_for_service (void)
{
gint result_int;
@@ -187,7 +194,7 @@
static void
-test_get_service_by_id ()
+test_get_service_by_id (void)
{
gchar *result_string;
@@ -200,7 +207,7 @@
static void
-test_get_parent_service_by_id ()
+test_get_parent_service_by_id (void)
{
gchar *result_string;
@@ -212,7 +219,7 @@
}
static void
-test_get_parent_id_for_service_id ()
+test_get_parent_id_for_service_id (void)
{
gint result_int;
@@ -223,7 +230,7 @@
}
static void
-test_get_parent_service ()
+test_get_parent_service (void)
{
gchar *result_string;
@@ -234,9 +241,8 @@
g_assert (!result_string);
}
-
static void
-test_get_service_type_for_mime ()
+test_get_service_type_for_mime (void)
{
gchar *value;
@@ -253,11 +259,8 @@
g_free (value);
}
-
-
-
static void
-test_get_service ()
+test_get_service (void)
{
TrackerService *result_def;
@@ -269,9 +272,8 @@
g_assert (test_cmp_servicedef_equals (result_def, expected_results->parent_def));
}
-
static void
-test_get_db_for_service ()
+test_get_db_for_service (void)
{
TrackerDBType result_db;
@@ -281,9 +283,8 @@
g_assert (result_db == TRACKER_DB_TYPE_FILES);
}
-
static void
-test_is_service_embedded ()
+test_is_service_embedded (void)
{
g_assert (tracker_ontology_service_type_has_embedded ("Test service"));
g_assert (!tracker_ontology_service_type_has_embedded ("Parent service"));
@@ -291,29 +292,28 @@
}
static void
-test_has_thumbnails (
- )
+test_has_thumbnails (void)
{
g_assert (tracker_ontology_service_type_has_thumbnails ("Test service"));
g_assert (!tracker_ontology_service_type_has_thumbnails ("trash"));
}
static void
-test_has_text ()
+test_has_text (void)
{
g_assert (tracker_ontology_service_type_has_text ("Test service"));
g_assert (!tracker_ontology_service_type_has_text ("trash"));
}
static void
-test_has_metadata ()
+test_has_metadata (void)
{
g_assert (!tracker_ontology_service_type_has_metadata ("Test service"));
g_assert (!tracker_ontology_service_type_has_metadata ("trash"));
}
static void
-test_field_in_ontology ()
+test_field_in_ontology (void)
{
TrackerField *field;
@@ -335,7 +335,6 @@
g_slist_foreach (service_types, (GFunc)g_free, NULL);
g_slist_free (service_types);
-
}
static void
@@ -358,7 +357,6 @@
g_assert (!field_types);
-
/* App field types */
field_types = tracker_ontology_registered_field_types ("App");
@@ -368,10 +366,8 @@
g_slist_foreach (field_types, (GFunc)g_free, NULL);
g_slist_free (field_types);
-
}
-
static void
test_metadata_key_in_service (void)
{
@@ -384,14 +380,11 @@
key = tracker_ontology_metadata_key_in_service ("Applications",
"Key:MetaDataUnknown");
g_assert_cmpint (key, ==, 0);
-
-
}
-
int
-main (int argc, char **argv) {
-
+main (int argc, char **argv)
+{
int result;
g_type_init ();
@@ -437,5 +430,6 @@
result = g_test_run ();
tracker_ontology_shutdown ();
+
return result;
}
Modified: branches/indexer-split/tests/libtracker-common/tracker-parser-test.c
==============================================================================
--- branches/indexer-split/tests/libtracker-common/tracker-parser-test.c (original)
+++ branches/indexer-split/tests/libtracker-common/tracker-parser-test.c Mon Aug 18 11:37:01 2008
@@ -13,18 +13,10 @@
*/
#define SAMPLE_TEXT "Here a good collection of various words to parse 12345678 after"
-TrackerConfig *config;
-TrackerLanguage *language;
+static TrackerConfig *config;
+static TrackerLanguage *language;
-const gchar *text = "";
-
-void
-print_key (gpointer key, gpointer value, gpointer user_data)
-{
- g_print ("word: %s\n", (gchar *)key);
-}
-
-void
+static void
assert_key_length (gpointer key, gpointer value, gpointer user_data)
{
gint max_length = GPOINTER_TO_INT (user_data);
Modified: branches/indexer-split/tests/libtracker-db/tracker-index-writer-test.c
==============================================================================
--- branches/indexer-split/tests/libtracker-db/tracker-index-writer-test.c (original)
+++ branches/indexer-split/tests/libtracker-db/tracker-index-writer-test.c Mon Aug 18 11:37:01 2008
@@ -1,3 +1,23 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008, Nokia (urho konttori 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 <qdbm/depot.h>
#include <glib.h>
@@ -12,7 +32,7 @@
#define MAX_BUCKET_COUNT 100
/* Helper functions to read the index */
-gint
+static gint
get_number_words_in_index (const gchar *index_file)
{
DEPOT *index;
@@ -27,7 +47,7 @@
return words;
}
-gint
+static gint
get_results_for_word (const gchar *index_file, const gchar *word)
{
DEPOT *index;
@@ -42,7 +62,7 @@
return result / sizeof (TrackerDBIndexItem);
}
-gint
+static gint
get_score_for_word (const gchar *index_file, const gchar *word)
{
DEPOT *index;
@@ -65,45 +85,8 @@
return score;
}
-void
-debug_print_index (const gchar *index_file) {
-
- DEPOT *index;
- gint rsiz, elements, i;
- gchar *iter;
- TrackerDBIndexItem *results;
-
- g_print ("Contents of %s\n", index_file);
-
- index = dpopen (index_file, DP_OREADER, MAX_BUCKET_COUNT);
-
- dpiterinit (index);
-
- while ((iter = dpiternext (index, NULL)) != NULL) {
- g_print ("word: %s doc_ids:", iter);
- results = (TrackerDBIndexItem *)dpget (index, iter, -1, 0, -1, &rsiz);
-
- if (!results) {
- g_print ("[No results]\n");
- continue;
- } else {
- elements = rsiz / sizeof (TrackerDBIndexItem);
- for (i = 0; i < elements; i++) {
- g_print ("%d ", results[i].id);
- }
- g_print ("\n");
- }
- g_free (results);
- g_free (iter);
- }
-
- dpclose (index);
-}
-
-/* Actual tests */
-
static void
-test_add_one_word ()
+test_add_one_word (void)
{
TrackerDBIndex *index;
const gchar *indexname = "test-add-one-word.index";
@@ -199,7 +182,7 @@
}
-gint
+static gint
insert_in_index (TrackerDBIndex *index, const gchar *text)
{
gchar **pieces;
@@ -248,7 +231,7 @@
}
-void
+static void
remove_in_index (TrackerDBIndex *index, const gchar *text, gint docid)
{
gchar **pieces;
@@ -264,9 +247,8 @@
doc += 1;
}
-
static void
-test_remove_document ()
+test_remove_document (void)
{
TrackerDBIndex *index;
const gchar *indexname = "test-remove-document.index";
@@ -333,8 +315,8 @@
}
int
-main (int argc, char **argv) {
-
+main (int argc, char **argv)
+{
int result;
g_type_init ();
Modified: branches/indexer-split/utils/qdbm/print-words.c
==============================================================================
--- branches/indexer-split/utils/qdbm/print-words.c (original)
+++ branches/indexer-split/utils/qdbm/print-words.c Mon Aug 18 11:37:01 2008
@@ -41,7 +41,7 @@
{ NULL }
};
-TrackerDBIndexItem *
+static TrackerDBIndexItem *
get_word_hits (DEPOT *index,
const gchar *word,
guint *count)
@@ -71,7 +71,7 @@
return details;
}
-void
+static void
load_terms_from_index (gchar *filename)
{
DEPOT *depot;
Modified: branches/indexer-split/utils/qdbm/search-word.c
==============================================================================
--- branches/indexer-split/utils/qdbm/search-word.c (original)
+++ branches/indexer-split/utils/qdbm/search-word.c Mon Aug 18 11:37:01 2008
@@ -39,7 +39,7 @@
{ NULL }
};
-TrackerDBIndexItem *
+static TrackerDBIndexItem *
get_word_hits (DEPOT *index,
const gchar *word,
guint *count)
@@ -69,7 +69,7 @@
return items;
}
-void
+static void
show_term_in_index (const gchar *filename,
const gchar *word)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]