tracker r1319 - in branches/indexer-split: . src/libtracker-common src/trackerd



Author: mr
Date: Mon Apr 28 13:25:28 2008
New Revision: 1319
URL: http://svn.gnome.org/viewvc/tracker?rev=1319&view=rev

Log:
	* src/libtracker-common/Makefile.am:
	* src/libtracker-common/tracker-type-utils.[ch]:
	* src/trackerd/tracker-db-email.c:
	* src/trackerd/tracker-db-sqlite.c:
	* src/trackerd/tracker-db.c:
	* src/trackerd/tracker-dbus-files.c:
	* src/trackerd/tracker-email-evolution.c:
	* src/trackerd/tracker-email-kmail.c:
	* src/trackerd/tracker-email-utils.c:
	* src/trackerd/tracker-process-files.c:
	* src/trackerd/tracker-rdf-query.c:
	* src/trackerd/tracker-utils.[ch]: Created tracker-type-utils.[ch]
	to handle type a to type b conversions (e.g. GSList* to gchar **).


Added:
   branches/indexer-split/src/libtracker-common/tracker-type-utils.c
   branches/indexer-split/src/libtracker-common/tracker-type-utils.h
Modified:
   branches/indexer-split/ChangeLog
   branches/indexer-split/src/libtracker-common/Makefile.am
   branches/indexer-split/src/trackerd/tracker-db-email.c
   branches/indexer-split/src/trackerd/tracker-db-sqlite.c
   branches/indexer-split/src/trackerd/tracker-db.c
   branches/indexer-split/src/trackerd/tracker-dbus-files.c
   branches/indexer-split/src/trackerd/tracker-email-evolution.c
   branches/indexer-split/src/trackerd/tracker-email-kmail.c
   branches/indexer-split/src/trackerd/tracker-email-utils.c
   branches/indexer-split/src/trackerd/tracker-process-files.c
   branches/indexer-split/src/trackerd/tracker-rdf-query.c
   branches/indexer-split/src/trackerd/tracker-utils.c
   branches/indexer-split/src/trackerd/tracker-utils.h

Modified: branches/indexer-split/src/libtracker-common/Makefile.am
==============================================================================
--- branches/indexer-split/src/libtracker-common/Makefile.am	(original)
+++ branches/indexer-split/src/libtracker-common/Makefile.am	Mon Apr 28 13:25:28 2008
@@ -13,6 +13,8 @@
 	tracker-language.h		\
 	tracker-log.c	 		\
 	tracker-log.h			\
+	tracker-type-utils.c		\
+	tracker-type-utils.h		\
 	tracker-utils.c			\
 	tracker-utils.h
 

Added: branches/indexer-split/src/libtracker-common/tracker-type-utils.c
==============================================================================
--- (empty file)
+++ branches/indexer-split/src/libtracker-common/tracker-type-utils.c	Mon Apr 28 13:25:28 2008
@@ -0,0 +1,684 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2006, 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 <string.h>
+#include <stdlib.h>
+
+#include <glib.h>
+
+#include "tracker-log.h"
+#include "tracker-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'
+};
+
+static gboolean
+is_int (const gchar *str)
+{
+	gboolean valid;
+	gint     i;
+
+	if (!str || str[0] == '\0') {
+		return FALSE;
+	}
+
+	valid = TRUE;
+	i = 0;
+
+	while (valid) {
+		valid = g_ascii_isdigit (str[i++]);
+	}
+
+	return valid;
+}
+
+static gint
+parse_month (const gchar *month)
+{
+	gint i;
+
+	for (i = 0; i < 12; i++) {
+		if (!strncmp (month, months[i], 3)) {
+			return i;
+		}
+	}
+
+	return -1;
+}
+
+/* Determine date format and convert to ISO 8601 format */
+gchar *
+tracker_format_date (const gchar *timestamp)
+{
+	gchar buf[30];
+	gint  len;
+
+	if (!timestamp) {
+		return NULL;
+	}
+
+	len = strlen (timestamp);
+
+	/* We cannot format a date without at least a four digit
+	 * year.
+	 */
+	if (len < 4) {
+		return NULL;
+	}
+
+	/* Check for year only dates (EG ID3 music tags might have
+	 * Audio.ReleaseDate as 4 digit year)
+	 */
+	if (len == 4) {
+		if (is_int (timestamp)) {
+			buf[0] = timestamp[0];
+			buf[1] = timestamp[1];
+			buf[2] = timestamp[2];
+			buf[3] = timestamp[3];
+			buf[4] = '-';
+			buf[5] = '0';
+			buf[6] = '1';
+			buf[7] = '-';
+			buf[8] = '0';
+			buf[9] = '1';
+			buf[10] = 'T';
+			buf[11] = '0';
+			buf[12] = '0';
+			buf[13] = ':';
+			buf[14] = '0';
+			buf[15] = '0';
+			buf[16] = ':';
+			buf[17] = '0';
+			buf[18] = '0';
+			buf[19] = '\0';
+
+			return g_strdup (buf);
+		} else {
+			return NULL;
+		}
+	} else if (len == 10)  {
+		/* Check for date part only YYYY-MM-DD*/
+		buf[0] = timestamp[0];
+		buf[1] = timestamp[1];
+		buf[2] = timestamp[2];
+		buf[3] = timestamp[3];
+		buf[4] = '-';
+		buf[5] = timestamp[5];
+		buf[6] = timestamp[6];
+		buf[7] = '-';
+		buf[8] = timestamp[8];
+		buf[9] = timestamp[9];
+		buf[10] = 'T';
+		buf[11] = '0';
+		buf[12] = '0';
+		buf[13] = ':';
+		buf[14] = '0';
+		buf[15] = '0';
+		buf[16] = ':';
+		buf[17] = '0';
+		buf[18] = '0';
+		buf[19] = '\0';
+
+		return g_strdup (buf);
+	} else if (len == 14) {
+		/* Check for pdf format EG 20050315113224-08'00' or
+		 * 20050216111533Z 
+		 */
+		buf[0] = timestamp[0];
+		buf[1] = timestamp[1];
+		buf[2] = timestamp[2];
+		buf[3] = timestamp[3];
+		buf[4] = '-';
+		buf[5] = timestamp[4];
+		buf[6] = timestamp[5];
+		buf[7] = '-';
+		buf[8] = timestamp[6];
+		buf[9] = timestamp[7];
+		buf[10] = 'T';
+		buf[11] = timestamp[8];
+		buf[12] = timestamp[9];
+		buf[13] = ':';
+		buf[14] = timestamp[10];
+		buf[15] = timestamp[11];
+		buf[16] = ':';
+		buf[17] = timestamp[12];
+		buf[18] = timestamp[13];
+		buf[19] = '\0';
+
+		return g_strdup (buf);
+	} else if (len == 15 && timestamp[14] == 'Z') {
+		buf[0] = timestamp[0];
+		buf[1] = timestamp[1];
+		buf[2] = timestamp[2];
+		buf[3] = timestamp[3];
+		buf[4] = '-';
+		buf[5] = timestamp[4];
+		buf[6] = timestamp[5];
+		buf[7] = '-';
+		buf[8] = timestamp[6];
+		buf[9] = timestamp[7];
+		buf[10] = 'T';
+		buf[11] = timestamp[8];
+		buf[12] = timestamp[9];
+		buf[13] = ':';
+		buf[14] = timestamp[10];
+		buf[15] = timestamp[11];
+		buf[16] = ':';
+		buf[17] = timestamp[12];
+		buf[18] = timestamp[13];
+		buf[19] = 'Z';
+		buf[20] = '\0';
+
+		return g_strdup (buf);
+	} else if (len == 21 && (timestamp[14] == '-' || timestamp[14] == '+' )) {
+		buf[0] = timestamp[0];
+		buf[1] = timestamp[1];
+		buf[2] = timestamp[2];
+		buf[3] = timestamp[3];
+		buf[4] = '-';
+		buf[5] = timestamp[4];
+		buf[6] = timestamp[5];
+		buf[7] = '-';
+		buf[8] = timestamp[6];
+		buf[9] = timestamp[7];
+		buf[10] = 'T';
+		buf[11] = timestamp[8];
+		buf[12] = timestamp[9];
+		buf[13] = ':';
+		buf[14] = timestamp[10];
+		buf[15] = timestamp[11];
+		buf[16] = ':';
+		buf[17] = timestamp[12];
+		buf[18] = timestamp[13];
+		buf[19] = timestamp[14];
+		buf[20] = timestamp[15];
+		buf[21] =  timestamp[16];
+		buf[22] =  ':';
+		buf[23] =  timestamp[18];
+		buf[24] = timestamp[19];
+		buf[25] = '\0';
+
+		return g_strdup (buf);
+	} else if ((len == 24) && (timestamp[3] == ' ')) {
+		/* Check for msoffice date format "Mon Feb  9 10:10:00 2004" */
+		gint  num_month;
+		gchar mon1;
+		gchar day1;
+
+		num_month = parse_month (timestamp + 4);
+
+		mon1 = imonths[num_month];
+
+		if (timestamp[8] == ' ') {
+			day1 = '0';
+		} else {
+			day1 = timestamp[8];
+		}
+
+		buf[0] = timestamp[20];
+		buf[1] = timestamp[21];
+		buf[2] = timestamp[22];
+		buf[3] = timestamp[23];
+		buf[4] = '-';
+
+		if (num_month < 10) {
+			buf[5] = '0';
+			buf[6] = mon1;
+		} else {
+			buf[5] = '1';
+			buf[6] = mon1;
+		}
+
+		buf[7] = '-';
+		buf[8] = day1;
+		buf[9] = timestamp[9];
+		buf[10] = 'T';
+		buf[11] = timestamp[11];
+		buf[12] = timestamp[12];
+		buf[13] = ':';
+		buf[14] = timestamp[14];
+		buf[15] = timestamp[15];
+		buf[16] = ':';
+		buf[17] = timestamp[17];
+		buf[18] = timestamp[18];
+		buf[19] = '\0';
+
+		return g_strdup (buf);
+	} else if ((len == 19) && (timestamp[4] == ':') && (timestamp[7] == ':')) {
+		/* Check for Exif date format "2005:04:29 14:56:54" */
+		buf[0] = timestamp[0];
+		buf[1] = timestamp[1];
+		buf[2] = timestamp[2];
+		buf[3] = timestamp[3];
+		buf[4] = '-';
+		buf[5] = timestamp[5];
+		buf[6] = timestamp[6];
+		buf[7] = '-';
+		buf[8] = timestamp[8];
+		buf[9] = timestamp[9];
+		buf[10] = 'T';
+		buf[11] = timestamp[11];
+		buf[12] = timestamp[12];
+		buf[13] = ':';
+		buf[14] = timestamp[14];
+		buf[15] = timestamp[15];
+		buf[16] = ':';
+		buf[17] = timestamp[17];
+		buf[18] = timestamp[18];
+		buf[19] = '\0';
+
+		return g_strdup (buf);
+	}
+
+	return g_strdup (timestamp);
+}
+
+static gboolean
+is_valid_8601_datetime (const gchar *timestamp)
+{
+	gint len;
+
+	len = strlen (timestamp);
+
+	if (len < 19) {
+		return FALSE;
+	}
+
+	if (!g_ascii_isdigit (timestamp[0]) ||
+	    !g_ascii_isdigit (timestamp[1]) ||
+	    !g_ascii_isdigit (timestamp[2]) ||
+	    !g_ascii_isdigit (timestamp[3])) {
+		return FALSE;
+	}
+
+	if (timestamp[4] != '-') {
+		return FALSE;
+	}
+
+	if (!g_ascii_isdigit (timestamp[5]) ||
+	    !g_ascii_isdigit (timestamp[6])) {
+		return FALSE;
+	}
+
+	if (timestamp[7] != '-') {
+		return FALSE;
+	}
+
+	if (!g_ascii_isdigit (timestamp[8]) ||
+	    !g_ascii_isdigit (timestamp[9])) {
+		return FALSE;
+	}
+
+	if ((timestamp[10] != 'T')) {
+		return FALSE;
+	}
+
+	if (!g_ascii_isdigit (timestamp[11]) ||
+	    !g_ascii_isdigit (timestamp[12])) {
+		return FALSE;
+	}
+
+	if (timestamp[13] != ':') {
+		return FALSE;
+	}
+
+	if (!g_ascii_isdigit (timestamp[14]) ||
+	    !g_ascii_isdigit (timestamp[15])) {
+		return FALSE;
+	}
+
+	if (timestamp[16] != ':'){
+		return FALSE;
+	}
+
+	if (!g_ascii_isdigit (timestamp[17]) ||
+	    !g_ascii_isdigit (timestamp[18])) {
+		return FALSE;
+	}
+
+	if (len == 20) {
+		if (timestamp[19] != 'Z') {
+			return FALSE;
+		}
+	} else {
+		if (len > 20) {
+			/* Format must be YYYY-MM-DDThh:mm:ss+xx  or
+			 * YYYY-MM-DDThh:mm:ss+xx:yy 
+			 */ 
+			if (len < 22 || len > 25) {
+				return FALSE;
+			}
+
+			if (timestamp[19] != '+' && 
+			    timestamp[19] != '-') {
+				return FALSE;
+			}
+
+			if (!g_ascii_isdigit (timestamp[20]) ||
+			    !g_ascii_isdigit (timestamp[21])) {
+				return FALSE;
+			}
+		}
+	}
+
+	return TRUE;
+}
+
+time_t
+tracker_str_to_date (const gchar *timestamp)
+{
+	struct tm tm;
+	long	  val;
+	time_t	  t;
+
+        g_return_val_if_fail (timestamp, -1);
+
+	/* We should have a valid iso 8601 date in format
+	 * YYYY-MM-DDThh:mm:ss with optional TZ 
+	 */ 
+        if (!is_valid_8601_datetime (timestamp)) {
+		return -1;
+	}
+
+        memset (&tm, 0, sizeof (struct tm));
+	val = strtoul (timestamp, (gchar**) &timestamp, 10);
+
+	if (*timestamp == '-') {
+		/* YYYY-MM-DD */
+		tm.tm_year = val - 1900;
+		timestamp++;
+		tm.tm_mon = strtoul (timestamp, (gchar **) &timestamp, 10) - 1;
+
+		if (*timestamp++ != '-') {
+			return -1;
+		}
+
+		tm.tm_mday = strtoul (timestamp, (gchar **) &timestamp, 10);
+	}
+
+	if (*timestamp++ != 'T') {
+		tracker_error ("ERROR: date validation failed for %s st %c", 
+			       timestamp, 
+			       *timestamp);
+		return -1;
+	}
+
+	val = strtoul (timestamp, (gchar**) &timestamp, 10);
+
+	if (*timestamp == ':') {
+		/* hh:mm:ss */
+		tm.tm_hour = val;
+		timestamp++;
+		tm.tm_min = strtoul (timestamp, (gchar**) &timestamp, 10);
+
+		if (*timestamp++ != ':') {
+			return -1;
+		}
+
+		tm.tm_sec = strtoul (timestamp, (gchar**) &timestamp, 10);
+	}
+
+        /* mktime() always assumes that "tm" is in locale time but we
+	 * want to keep control on time, so we go to UTC
+	 */
+	t  = mktime (&tm);
+        t -= timezone;
+
+	if (*timestamp == '+' || 
+	    *timestamp == '-') {
+		gint sign;
+
+		sign = *timestamp++ == '+' ? -1 : 1;
+
+                /* We have format hh:mm or hhmm */
+                /* Now, we are reading hours */
+                if (timestamp[0] && 
+		    timestamp[1]) {
+                        if (g_ascii_isdigit (timestamp[0]) && 
+			    g_ascii_isdigit (timestamp[1])) {
+                                gchar buff[3];
+
+                                buff[0] = timestamp[0];
+                                buff[1] = timestamp[1];
+                                buff[2] = '\0';
+
+                                val = strtoul (buff, NULL, 10);
+                                t += sign * (3600 * val);
+                                timestamp += 2;
+                        }
+
+                        if (*timestamp == ':' || *timestamp == '\'') {
+                                timestamp++;
+                        }
+                }
+
+                /* Now, we are reading minutes */
+                if (timestamp[0] && 
+		    timestamp[1]) {
+                        if (g_ascii_isdigit (timestamp[0]) && 
+			    g_ascii_isdigit (timestamp[1])) {
+                                gchar buff[3];
+
+                                buff[0] = timestamp[0];
+                                buff[1] = timestamp[1];
+                                buff[2] = '\0';
+
+                                val = strtoul (buff, NULL, 10);
+                                t += sign * (60 * val);
+                                timestamp += 2;
+                        }
+                }
+	}
+
+	return t;
+}
+
+gchar *
+tracker_date_to_str (time_t date_time)
+{
+	gchar  	  buffer[30];
+	struct tm local_time;
+	size_t	  count;
+
+	memset (buffer, '\0', sizeof (buffer));
+	memset (&local_time, 0, sizeof (struct tm));
+
+	localtime_r (&date_time, &local_time);
+
+	/* Output is ISO 8160 format : "YYYY-MM-DDThh:mm:ss+zz:zz" */
+	count = strftime (buffer, sizeof (buffer), "%FT%T%z", &local_time);
+
+        return count > 0 ? g_strdup (buffer) : NULL;
+}
+
+gchar *
+tracker_long_to_str (glong i)
+{
+        return g_strdup_printf ("%ld", i);
+}
+
+gchar *
+tracker_int_to_str (gint i)
+{
+	return g_strdup_printf ("%d", i);
+}
+
+gchar *
+tracker_uint_to_str (guint i)
+{
+	return g_strdup_printf ("%u", i);
+}
+
+gchar *
+tracker_gint32_to_str (gint32 i)
+{
+        return g_strdup_printf ("%" G_GINT32_FORMAT, i);
+}
+
+gchar *
+tracker_guint32_to_str (guint32 i)
+{
+        return g_strdup_printf ("%" G_GUINT32_FORMAT, i);
+}
+
+gboolean
+tracker_str_to_uint (const gchar *s, 
+		     guint       *value)
+{
+	unsigned long int n;
+
+	g_return_val_if_fail (s, FALSE);
+
+	n = strtoul (s, NULL, 10);
+
+	if (n > G_MAXUINT) {
+		*value = 0;
+		return FALSE;
+
+	} else {
+		*value = (guint) n;
+		return TRUE;
+	}
+}
+
+gint
+tracker_str_in_array (const gchar  *str, 
+		      gchar       **strv)
+{
+	gchar **p;
+	gint    i = 0;
+
+	for (p = strv; *p; p++, i++) {
+		if (strcasecmp (*p, str) == 0) {
+			return i;
+		}
+	}
+
+	return -1;
+}
+
+GSList *
+tracker_string_list_to_gslist (const gchar **strv)
+{
+	GSList       *l = NULL;
+	const gchar **p;
+
+	for (p = strv; *p; p++) {
+		if (tracker_is_empty_string (*p)) {
+			continue;
+		}
+
+		l = g_slist_prepend (l, g_strdup (*p));
+	}
+
+	return g_slist_reverse (l);
+}
+
+gchar **
+tracker_gslist_to_string_list (GSList *list)
+{
+	GSList  *l;
+	gchar  **strv;
+	gint     i = 0;
+
+	strv = g_new0 (gchar*, g_slist_length (list) + 1);
+
+	for (l = list; l; l = l->next) {
+ 		if (!l->data) {
+			continue;
+  		}
+
+		strv[i++] = g_strdup (l->data);
+	}
+
+	strv[i] = NULL;
+
+	return strv;
+}
+
+gchar *
+tracker_array_to_str (gchar **strv, 
+		      gint    length, 
+		      gchar   sep)
+{
+	GString *string;
+	gint     i;
+
+	string = g_string_new ("");
+
+	for (i = 0; i < length; i++) {
+		if (strv[i]) {
+			if (i > 0) {
+				g_string_append_c (string, sep);
+			}
+
+			string = g_string_append (string, strv[i]);
+		} else {
+			break;
+		}
+	}
+
+	return g_string_free (string, FALSE);
+}
+
+gchar **
+tracker_make_array_null_terminated (gchar **strv, 
+				    gint    length)
+{
+	gchar **values = NULL;
+	gint    i;
+
+	values = g_new (gchar*, length + 1);
+
+	for (i = 0; i < length; i++) {
+		values[i] = strv[i];
+	}
+
+	values[length] = NULL;
+
+	return values;
+}
+
+void
+tracker_free_array (gchar **strv, 
+		    gint    length)
+{
+	if (strv && length > 0) {
+		gint i;
+
+		for (i = 0; i < length; i++) {
+			if (strv[i]) {
+	        		g_free (strv[i]);
+			}
+		}
+
+		g_free (strv);
+	}
+}
+

Added: branches/indexer-split/src/libtracker-common/tracker-type-utils.h
==============================================================================
--- (empty file)
+++ branches/indexer-split/src/libtracker-common/tracker-type-utils.h	Mon Apr 28 13:25:28 2008
@@ -0,0 +1,47 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2006, 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_TYPE_UTILS_H__
+#define __TRACKER_TYPE_UTILS_H__
+
+gchar *  tracker_format_date                (const gchar  *time_string);
+time_t   tracker_str_to_date                (const gchar  *time_string);
+gchar *  tracker_date_to_str                (time_t        date_time);
+gchar *  tracker_long_to_str                (glong         i);
+gchar *  tracker_int_to_str                 (gint          i);
+gchar *  tracker_uint_to_str                (guint         i);
+gchar *  tracker_gint32_to_str              (gint32        i);
+gchar *  tracker_guint32_to_str             (guint32       i);
+gboolean tracker_str_to_uint                (const gchar  *s,
+					     guint        *ret);
+gint     tracker_str_in_array               (const gchar  *str,
+					     gchar       **strv);
+GSList * tracker_string_list_to_gslist      (const gchar **strv);
+gchar ** tracker_gslist_to_string_list      (GSList       *list);
+gchar *  tracker_array_to_str               (gchar       **strv,
+					     gint          length,
+					     gchar         sep);
+gchar ** tracker_make_array_null_terminated (gchar       **strv,
+					     gint          length);
+void     tracker_free_array                 (gchar       **strv,
+					     gint          row_count);
+
+#endif /* __TRACKER_TYPE_UTILS_H__ */

Modified: branches/indexer-split/src/trackerd/tracker-db-email.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db-email.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-db-email.c	Mon Apr 28 13:25:28 2008
@@ -25,6 +25,7 @@
 #include <glib/gstdio.h>
 
 #include <libtracker-common/tracker-log.h>
+#include <libtracker-common/tracker-type-utils.h>
 
 #include "tracker-db-email.h"
 

Modified: branches/indexer-split/src/trackerd/tracker-db-sqlite.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db-sqlite.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-db-sqlite.c	Mon Apr 28 13:25:28 2008
@@ -45,6 +45,7 @@
 
 #include <libtracker-common/tracker-log.h>
 #include <libtracker-common/tracker-config.h>
+#include <libtracker-common/tracker-type-utils.h>
 #include <libtracker-common/tracker-utils.h>
 
 #include <libtracker-db/tracker-db-interface-sqlite.h>

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 Apr 28 13:25:28 2008
@@ -27,6 +27,7 @@
 
 #include <libtracker-common/tracker-log.h>
 #include <libtracker-common/tracker-config.h>
+#include <libtracker-common/tracker-type-utils.h>
 
 #include "tracker-db.h"
 #include "tracker-email.h"

Modified: branches/indexer-split/src/trackerd/tracker-dbus-files.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-dbus-files.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-dbus-files.c	Mon Apr 28 13:25:28 2008
@@ -26,6 +26,7 @@
 
 #include <libtracker-common/tracker-log.h>
 #include <libtracker-common/tracker-utils.h>
+#include <libtracker-common/tracker-type-utils.h>
 
 #include "tracker-dbus.h"
 #include "tracker-dbus-files.h"

Modified: branches/indexer-split/src/trackerd/tracker-email-evolution.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-email-evolution.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-email-evolution.c	Mon Apr 28 13:25:28 2008
@@ -33,6 +33,7 @@
 
 #include <libtracker-common/tracker-log.h>
 #include <libtracker-common/tracker-config.h>
+#include <libtracker-common/tracker-type-utils.h>
 
 #include "tracker-email-utils.h"
 #include "tracker-db-email.h"

Modified: branches/indexer-split/src/trackerd/tracker-email-kmail.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-email-kmail.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-email-kmail.c	Mon Apr 28 13:25:28 2008
@@ -27,6 +27,7 @@
 
 #include <libtracker-common/tracker-log.h>
 #include <libtracker-common/tracker-utils.h>
+#include <libtracker-common/tracker-type-utils.h>
 
 #include "tracker-email-utils.h"
 #include "tracker-db-email.h"

Modified: branches/indexer-split/src/trackerd/tracker-email-utils.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-email-utils.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-email-utils.c	Mon Apr 28 13:25:28 2008
@@ -32,6 +32,7 @@
 
 #include <libtracker-common/tracker-log.h>
 #include <libtracker-common/tracker-config.h>
+#include <libtracker-common/tracker-type-utils.h>
 #include <libtracker-common/tracker-utils.h>
 
 #include "tracker-cache.h"

Modified: branches/indexer-split/src/trackerd/tracker-process-files.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-process-files.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-process-files.c	Mon Apr 28 13:25:28 2008
@@ -32,6 +32,7 @@
 
 #include <libtracker-common/tracker-config.h>
 #include <libtracker-common/tracker-log.h>
+#include <libtracker-common/tracker-type-utils.h>
 #include <libtracker-common/tracker-utils.h>
 
 #include "../xdgmime/xdgmime.h"

Modified: branches/indexer-split/src/trackerd/tracker-rdf-query.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-rdf-query.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-rdf-query.c	Mon Apr 28 13:25:28 2008
@@ -20,6 +20,7 @@
 #include <string.h>
 
 #include <libtracker-common/tracker-log.h>
+#include <libtracker-common/tracker-type-utils.h>
 #include <libtracker-common/tracker-utils.h>
 
 #include "tracker-rdf-query.h"

Modified: branches/indexer-split/src/trackerd/tracker-utils.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-utils.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-utils.c	Mon Apr 28 13:25:28 2008
@@ -80,632 +80,8 @@
 static int info_deallocated = 0;
 
 
-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'
-};
-
-
-char **
-tracker_make_array_null_terminated (char **array, int length)
-{
-	char **res = NULL;
-	int  i;
-
-	res = g_new (char *, length +1);
-
-	for (i = 0; i < length; i++) {
-		res[i] = array[i];
-	}
-
-	res[length] = NULL;
-
-	return res;
-}
-
-
-static gboolean
-is_int (const char *in)
-{
-	int i, len;
-
-	if (!in) {
-		return FALSE;
-	}
-
-	len = strlen (in);
-
-	if (len < 1) {
-		return FALSE;
-	}
-
-	for (i = 0; i < len; i++) {
-
-		if ( !g_ascii_isdigit (in[i]) ) {
-			return FALSE;
-		}
-	}
-
-	return TRUE;
-}
-
-
-static int
-parse_month (const char *month)
-{
-	int i;
-
-	for (i = 0; i < 12; i++) {
-		if (!strncmp (month, months[i], 3))
-			return i;
-	}
-
-	return -1;
-}
-
-
-/* determine date format and convert to ISO 8601 format*/
-
-char *
-tracker_format_date (const char *timestamp)
-{
-	char tmp_buf[30];
-	int  len;
-
-	if (!timestamp) {
-		return NULL;
-	}
-
-	len = strlen (timestamp);
-
-	/* we cannot format a date without at least a four digit year */
-	if (len < 4) {
-		return NULL;
-	}
-
-	/* check for year only dates (EG ID3 music tags might have Audio.ReleaseDate as 4 digit year) */
-
-	if (len == 4) {
-		if (is_int (timestamp)) {
-
-			tmp_buf[0] = timestamp[0];
-			tmp_buf[1] = timestamp[1];
-			tmp_buf[2] = timestamp[2];
-			tmp_buf[3] = timestamp[3];
-			tmp_buf[4] = '-';
-			tmp_buf[5] = '0';
-			tmp_buf[6] = '1';
-			tmp_buf[7] = '-';
-			tmp_buf[8] = '0';
-			tmp_buf[9] = '1';
-			tmp_buf[10] = 'T';
-			tmp_buf[11] = '0';
-			tmp_buf[12] = '0';
-			tmp_buf[13] = ':';
-			tmp_buf[14] = '0';
-			tmp_buf[15] = '0';
-			tmp_buf[16] = ':';
-			tmp_buf[17] = '0';
-			tmp_buf[18] = '0';
-			tmp_buf[19] = '\0';
-
-			return g_strdup (tmp_buf);
-
-		} else {
-			return NULL;
-		}
-
-	/* check for date part only YYYY-MM-DD*/
-
-	} else if (len == 10)  {
-
-			tmp_buf[0] = timestamp[0];
-			tmp_buf[1] = timestamp[1];
-			tmp_buf[2] = timestamp[2];
-			tmp_buf[3] = timestamp[3];
-			tmp_buf[4] = '-';
-			tmp_buf[5] = timestamp[5];
-			tmp_buf[6] = timestamp[6];
-			tmp_buf[7] = '-';
-			tmp_buf[8] = timestamp[8];
-			tmp_buf[9] = timestamp[9];
-			tmp_buf[10] = 'T';
-			tmp_buf[11] = '0';
-			tmp_buf[12] = '0';
-			tmp_buf[13] = ':';
-			tmp_buf[14] = '0';
-			tmp_buf[15] = '0';
-			tmp_buf[16] = ':';
-			tmp_buf[17] = '0';
-			tmp_buf[18] = '0';
-			tmp_buf[19] = '\0';
-
-			return g_strdup (tmp_buf);
-
-	/* check for pdf format EG 20050315113224-08'00' or 20050216111533Z  */
-
-	} else if (len == 14) {
-
-			tmp_buf[0] = timestamp[0];
-			tmp_buf[1] = timestamp[1];
-			tmp_buf[2] = timestamp[2];
-			tmp_buf[3] = timestamp[3];
-			tmp_buf[4] = '-';
-			tmp_buf[5] = timestamp[4];
-			tmp_buf[6] = timestamp[5];
-			tmp_buf[7] = '-';
-			tmp_buf[8] = timestamp[6];
-			tmp_buf[9] = timestamp[7];
-			tmp_buf[10] = 'T';
-			tmp_buf[11] = timestamp[8];
-			tmp_buf[12] = timestamp[9];
-			tmp_buf[13] = ':';
-			tmp_buf[14] = timestamp[10];
-			tmp_buf[15] = timestamp[11];
-			tmp_buf[16] = ':';
-			tmp_buf[17] = timestamp[12];
-			tmp_buf[18] = timestamp[13];
-			tmp_buf[19] = '\0';
-
-			return g_strdup (tmp_buf);
-
-
-	} else if (len == 15 && timestamp[14] == 'Z') {
-
-			tmp_buf[0] = timestamp[0];
-			tmp_buf[1] = timestamp[1];
-			tmp_buf[2] = timestamp[2];
-			tmp_buf[3] = timestamp[3];
-			tmp_buf[4] = '-';
-			tmp_buf[5] = timestamp[4];
-			tmp_buf[6] = timestamp[5];
-			tmp_buf[7] = '-';
-			tmp_buf[8] = timestamp[6];
-			tmp_buf[9] = timestamp[7];
-			tmp_buf[10] = 'T';
-			tmp_buf[11] = timestamp[8];
-			tmp_buf[12] = timestamp[9];
-			tmp_buf[13] = ':';
-			tmp_buf[14] = timestamp[10];
-			tmp_buf[15] = timestamp[11];
-			tmp_buf[16] = ':';
-			tmp_buf[17] = timestamp[12];
-			tmp_buf[18] = timestamp[13];
-			tmp_buf[19] = 'Z';
-			tmp_buf[20] = '\0';
-
-			return g_strdup (tmp_buf);
-
-
-	} else if (len == 21 && (timestamp[14] == '-' || timestamp[14] == '+' )) {
-
-			tmp_buf[0] = timestamp[0];
-			tmp_buf[1] = timestamp[1];
-			tmp_buf[2] = timestamp[2];
-			tmp_buf[3] = timestamp[3];
-			tmp_buf[4] = '-';
-			tmp_buf[5] = timestamp[4];
-			tmp_buf[6] = timestamp[5];
-			tmp_buf[7] = '-';
-			tmp_buf[8] = timestamp[6];
-			tmp_buf[9] = timestamp[7];
-			tmp_buf[10] = 'T';
-			tmp_buf[11] = timestamp[8];
-			tmp_buf[12] = timestamp[9];
-			tmp_buf[13] = ':';
-			tmp_buf[14] = timestamp[10];
-			tmp_buf[15] = timestamp[11];
-			tmp_buf[16] = ':';
-			tmp_buf[17] = timestamp[12];
-			tmp_buf[18] = timestamp[13];
-			tmp_buf[19] = timestamp[14];
-			tmp_buf[20] = timestamp[15];
-			tmp_buf[21] =  timestamp[16];
-			tmp_buf[22] =  ':';
-			tmp_buf[23] =  timestamp[18];
-			tmp_buf[24] = timestamp[19];
-			tmp_buf[25] = '\0';
-
-			return g_strdup (tmp_buf);
-
-	/* check for msoffice date format "Mon Feb  9 10:10:00 2004" */
-
-	} else if ((len == 24) && (timestamp[3] == ' ')) {
-			int  num_month;
-			char mon1;
-			char day1;
-
-			num_month = parse_month (timestamp + 4);
-
-			mon1 = imonths[num_month];
-
-			if (timestamp[8] == ' ') {
-				day1 = '0';
-			} else {
-				day1 = timestamp[8];
-			}
-
-			tmp_buf[0] = timestamp[20];
-			tmp_buf[1] = timestamp[21];
-			tmp_buf[2] = timestamp[22];
-			tmp_buf[3] = timestamp[23];
-			tmp_buf[4] = '-';
-
-			if (num_month < 10) {
-				tmp_buf[5] = '0';
-				tmp_buf[6] = mon1;
-			} else {
-				tmp_buf[5] = '1';
-				tmp_buf[6] = mon1;
-			}
-
-			tmp_buf[7] = '-';
-			tmp_buf[8] = day1;
-			tmp_buf[9] = timestamp[9];
-			tmp_buf[10] = 'T';
-			tmp_buf[11] = timestamp[11];
-			tmp_buf[12] = timestamp[12];
-			tmp_buf[13] = ':';
-			tmp_buf[14] = timestamp[14];
-			tmp_buf[15] = timestamp[15];
-			tmp_buf[16] = ':';
-			tmp_buf[17] = timestamp[17];
-			tmp_buf[18] = timestamp[18];
-			tmp_buf[19] = '\0';
-
-			return g_strdup (tmp_buf);
-
-	/* check for Exif date format "2005:04:29 14:56:54" */
-
-	} else if ((len == 19) && (timestamp[4] == ':') && (timestamp[7] == ':')) {
-
-			tmp_buf[0] = timestamp[0];
-			tmp_buf[1] = timestamp[1];
-			tmp_buf[2] = timestamp[2];
-			tmp_buf[3] = timestamp[3];
-			tmp_buf[4] = '-';
-			tmp_buf[5] = timestamp[5];
-			tmp_buf[6] = timestamp[6];
-			tmp_buf[7] = '-';
-			tmp_buf[8] = timestamp[8];
-			tmp_buf[9] = timestamp[9];
-			tmp_buf[10] = 'T';
-			tmp_buf[11] = timestamp[11];
-			tmp_buf[12] = timestamp[12];
-			tmp_buf[13] = ':';
-			tmp_buf[14] = timestamp[14];
-			tmp_buf[15] = timestamp[15];
-			tmp_buf[16] = ':';
-			tmp_buf[17] = timestamp[17];
-			tmp_buf[18] = timestamp[18];
-			tmp_buf[19] = '\0';
-
-			return g_strdup (tmp_buf);
-	}
-
-	return g_strdup (timestamp);
-}
-
-
-static gboolean
-is_valid_8601_datetime (const char *timestamp)
-{
-	int len;
-
-	len = strlen (timestamp);
-
-	if (len < 19) {
-		return FALSE;
-	}
-
-	if ( !g_ascii_isdigit (timestamp[0]) ) {
-		return FALSE;
-	}
-
-	if ( !g_ascii_isdigit (timestamp[1]) ) {
-		return FALSE;
-	}
-
-	if ( !g_ascii_isdigit (timestamp[2]) ) {
-		return FALSE;
-	}
-
-	if ( !g_ascii_isdigit (timestamp[3]) ) {
-		return FALSE;
-	}
-
-	if (timestamp[4] != '-') {
-		return FALSE;
-	}
-
-	if ( !g_ascii_isdigit (timestamp[5]) ) {
-		return FALSE;
-	}
-
-	if ( !g_ascii_isdigit (timestamp[6]) ) {
-		return FALSE;
-	}
-
-	if (timestamp[7] != '-') {
-		return FALSE;
-	}
-
-	if ( !g_ascii_isdigit (timestamp[8]) ) {
-		return FALSE;
-	}
-
-	if ( !g_ascii_isdigit (timestamp[9]) ) {
-		return FALSE;
-	}
-
-	if ( (timestamp[10] != 'T') ) {
-		return FALSE;
-	}
-
-	if ( !g_ascii_isdigit (timestamp[11]) ) {
-		return FALSE;
-	}
-
-	if ( !g_ascii_isdigit (timestamp[12]) ) {
-		return FALSE;
-	}
-
-	if (timestamp[13] != ':') {
-		return FALSE;
-	}
-
-	if ( !g_ascii_isdigit (timestamp[14]) ) {
-		return FALSE;
-	}
-
-	if ( !g_ascii_isdigit (timestamp[15]) ) {
-		return FALSE;
-	}
-
-	if (timestamp[16] != ':'){
-		return FALSE;
-	}
-
-	if ( !g_ascii_isdigit (timestamp[17]) ) {
-		return FALSE;
-	}
-
-	if ( !g_ascii_isdigit (timestamp[18]) ){
-		return FALSE;
-	}
-
-	if (len == 20) {
-		if (timestamp[19] != 'Z') {
-			return FALSE;
-		}
-	} else {
-
-		if (len > 20) {
-
-			/* format must be YYYY-MM-DDThh:mm:ss+xx  or YYYY-MM-DDThh:mm:ss+xx:yy */
-
-			if (len < 22 || len > 25) {
-				return FALSE;
-			}
-
-			if ( (timestamp[19] != '+') && (timestamp[19] != '-') ) {
-				return FALSE;
-			}
-
-			if ( !g_ascii_isdigit (timestamp[20]) ) {
-				return FALSE;
-			}
-
-			if ( !g_ascii_isdigit (timestamp[21]) ) {
-				return FALSE;
-			}
-		}
-	}
-
-	return TRUE;
-}
-
-
-time_t
-tracker_str_to_date (const char *timestamp)
-{
-	struct tm	tm;
-	long		val;
-	time_t		tt;
-
-        g_return_val_if_fail (timestamp, -1);
-
-	/* we should have a valid iso 8601 date in format YYYY-MM-DDThh:mm:ss with optional TZ*/
-        if (!is_valid_8601_datetime (timestamp)) {
-		return  -1;
-	}
-
-        memset (&tm, 0, sizeof (struct tm));
-
-	val = strtoul (timestamp, (char **)&timestamp, 10);
-
-	if (*timestamp == '-') {
-		// YYYY-MM-DD
-		tm.tm_year = val - 1900;
-		timestamp++;
-		tm.tm_mon = strtoul (timestamp, (char **)&timestamp, 10) -1;
-		if (*timestamp++ != '-') {
-			return -1;
-		}
-		tm.tm_mday = strtoul (timestamp, (char **)&timestamp, 10);
-	}
-
-	if (*timestamp++ != 'T') {
-		tracker_error ("ERROR: date validation failed for %s st %c", timestamp, *timestamp);
-		return -1;
-	}
-
-	val = strtoul (timestamp, (char **)&timestamp, 10);
-
-	if (*timestamp == ':') {
-		// hh:mm:ss
-		tm.tm_hour = val;
-		timestamp++;
-		tm.tm_min = strtoul (timestamp, (char **)&timestamp, 10);
-		if (*timestamp++ != ':') {
-			return -1;
-		}
-		tm.tm_sec = strtoul (timestamp, (char **)&timestamp, 10);
-	}
-
-	tt = mktime (&tm);
-        /* mktime() always assumes that "tm" is in locale time but
-           we want to keep control on time, so we go to UTC */
-        tt -= timezone;
-
-	if (*timestamp == '+' || *timestamp == '-') {
-		int sign;
-
-		sign = (*timestamp++ == '+') ? -1 : 1;
-
-                /* we have format hh:mm or hhmm */
-
-                /* now, we are reading hours */
-                if (timestamp[0] && timestamp[1]) {
-                        if (g_ascii_isdigit (timestamp[0]) && g_ascii_isdigit (timestamp[1])) {
-                                gchar buff[3];
-
-                                buff[0] = timestamp[0];
-                                buff[1] = timestamp[1];
-                                buff[2] = '\0';
-
-                                val = strtoul (buff, NULL, 10);
-                                tt += sign * (3600 * val);
-                                timestamp += 2;
-                        }
-
-                        if (*timestamp == ':' || *timestamp == '\'') {
-                                timestamp++;
-                        }
-                }
-
-                /* now, we are reading minutes */
-                if (timestamp[0] && timestamp[1]) {
-                        if (g_ascii_isdigit (timestamp[0]) && g_ascii_isdigit (timestamp[1])) {
-                                gchar buff[3];
-
-                                buff[0] = timestamp[0];
-                                buff[1] = timestamp[1];
-                                buff[2] = '\0';
-
-                                val = strtoul (buff, NULL, 10);
-                                tt += sign * (60 * val);
-                                timestamp += 2;
-                        }
-                }
-	} else {
-                /*
-		if (*timestamp == 'Z') {
-			// no need to do anything if already utc
-		}
-                */
-	}
-
-	return tt;
-}
-
-
-char *
-tracker_date_to_str (time_t date_time)
-{
-	char  		buffer[30];
-	struct tm 	loctime;
-	size_t		count;
-
-	memset (buffer, '\0', sizeof (buffer));
-	memset (&loctime, 0, sizeof (struct tm));
-
-	localtime_r (&date_time, &loctime);
-
-	/* output is ISO 8160 format : "YYYY-MM-DDThh:mm:ss+zz:zz" */
-	count = strftime (buffer, sizeof (buffer), "%FT%T%z", &loctime);
-
-        return (count > 0) ? g_strdup (buffer) : NULL;
-}
-
-gchar *
-tracker_long_to_str (glong i)
-{
-        return g_strdup_printf ("%ld", i);
-}
-
-
-gchar *
-tracker_int_to_str (gint i)
-{
-	return g_strdup_printf ("%d", i);
-}
-
-
-gchar *
-tracker_uint_to_str (guint i)
-{
-	return g_strdup_printf ("%u", i);
-}
-
-
-gchar *
-tracker_gint32_to_str (gint32 i)
-{
-        return g_strdup_printf ("%" G_GINT32_FORMAT, i);
-}
-
-
-gchar *
-tracker_guint32_to_str (guint32 i)
-{
-        return g_strdup_printf ("%" G_GUINT32_FORMAT, i);
-}
-
-
-gboolean
-tracker_str_to_uint (const char *s, guint *ret)
-{
-	unsigned long int n;
-
-	g_return_val_if_fail (s, FALSE);
-
-	n = strtoul (s, NULL, 10);
-
-	if (n > G_MAXUINT) {
-		*ret = 0;
-		return FALSE;
-
-	} else {
-		*ret = (guint) n;
-		return TRUE;
-	}
-}
-
-
-int
-tracker_str_in_array (const char *str, char **array)
-{
-	int  i;
-	char **st;
-
-	i = 0;
-
-	for (st = array; *st; st++) {
-		if (strcasecmp (*st, str) == 0) {
-			return i;
-		}
-		i++;
-	}
-
-	return -1;
-}
 
 
 char *
@@ -890,21 +266,6 @@
 	tracker_log ("Total allocations = %d, total deallocations = %d", info_allocated, info_deallocated);
 }
 
-void
-tracker_free_array (char **array, int row_count)
-{
-	if (array && (row_count > 0)) {
-		int i;
-
-		for (i = 0; i < row_count; i++) {
-			if (array[i]) {
-	        		g_free (array[i]);
-			}
-		}
-
-		g_free (array);
-	}
-}
 
 
 FileInfo *
@@ -1536,91 +897,6 @@
 	return FALSE;
 }
 
-
-/*
-static int
-has_prefix (const char *str1, const char *str2)
-{
-	if (strcmp (str1, str2) == 0) {
-		return 0;
-	} else {
-		char *compare_str;
-
-		compare_str = g_strconcat (str1, G_DIR_SEPARATOR_S, NULL);
-
-		if (g_str_has_prefix (str2, compare_str)) {
-			return 0;
-		}
-		g_free (compare_str);
-		return 1;
-	}
-}
-*/
-
-
-GSList *
-tracker_string_list_to_gslist (const gchar **array)
-{
-	GSList *list = NULL;
- 	gint	i;
-
- 	for (i = 0; array[i]; i++) {
-		if (tracker_is_empty_string (array[i])) {
-			continue;
-		}
-
-		list = g_slist_prepend (list, g_strdup (array[i]));
-	}
-
-	return g_slist_reverse (list);
-}
-
-gchar **
-tracker_gslist_to_string_list (GSList *list)
-{
-	GSList  *l;
-	gchar  **string_list;
-	gint     i;
-
-	string_list = g_new0 (gchar *, g_slist_length (list) + 1);
-
-	for (l = list, i = 0; l; l = l->next) {
- 		if (!l->data) {
-			continue;
-  		}
-
-		string_list[i++] = g_strdup (l->data);
-	}
-
-	string_list[i] = NULL;
-
-	return string_list;
-}
-
-char *
-tracker_array_to_str (char **array, int length, char sep)
-{
-	GString *gstr = g_string_new ("");
-	int i;
-
-	for (i=0; i<length; i++) {
-
-		
-
-		if (array[i]) {
-			if (i > 0) g_string_append_c (gstr, sep);
-
-			gstr = g_string_append (gstr, array[i]);
-		} else {
-			break;
-		}
-	}
-
-	return g_string_free (gstr, FALSE);
-
-}
-
-
 void
 tracker_throttle (int multiplier)
 {

Modified: branches/indexer-split/src/trackerd/tracker-utils.h
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-utils.h	(original)
+++ branches/indexer-split/src/trackerd/tracker-utils.h	Mon Apr 28 13:25:28 2008
@@ -409,23 +409,6 @@
 
 } FileInfo;
 
-GSList *	tracker_filename_array_to_list		(gchar **array);
-GSList *	tracker_string_list_to_gslist   	(const gchar **array);
-gchar **	tracker_gslist_to_string_list 		(GSList *list);
-gchar **	tracker_make_array_null_terminated 	(gchar **array, gint length);
-
-void		tracker_free_array 		(char **array, int row_count);
-gchar *         tracker_long_to_str             (glong i);
-gchar *		tracker_int_to_str		(gint i);
-gchar *		tracker_uint_to_str		(guint i);
-gchar *		tracker_gint32_to_str		(gint32 i);
-gchar *		tracker_guint32_to_str		(guint32 i);
-gboolean	tracker_str_to_uint		(const char *s, guint *ret);
-char *		tracker_format_date 		(const char *time_string);
-time_t		tracker_str_to_date 		(const char *time_string);
-char *		tracker_date_to_str 		(time_t date_time);
-int		tracker_str_in_array 		(const char *str, char **array);
-
 char *		tracker_get_radix_by_suffix	(const char *str, const char *suffix);
 
 char *		tracker_escape_metadata 	(const char *in);



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