[tracker: 2/3] tracker-extract: Moved util functions from libtracker-common to libtracker-extract
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker: 2/3] tracker-extract: Moved util functions from libtracker-common to libtracker-extract
- Date: Fri, 12 Feb 2010 17:10:37 +0000 (UTC)
commit 0f3823d54cf568ee39d20b769c2d56bf65fe15f4
Author: Philip Van Hoof <philip codeminded be>
Date: Fri Feb 12 12:18:40 2010 +0100
tracker-extract: Moved util functions from libtracker-common to libtracker-extract
src/libtracker-common/tracker-utils.c | 109 ----------------
src/libtracker-common/tracker-utils.h | 8 --
src/libtracker-extract/Makefile.am | 6 +-
src/libtracker-extract/tracker-exif.c | 10 +-
src/libtracker-extract/tracker-exif.h | 8 +-
src/libtracker-extract/tracker-iptc.c | 10 +-
src/libtracker-extract/tracker-iptc.h | 8 +-
src/libtracker-extract/tracker-utils.c | 139 +++++++++++++++++++++
src/libtracker-extract/tracker-utils.h | 44 +++++++
src/libtracker-extract/tracker-xmp.c | 20 ++--
src/libtracker-extract/tracker-xmp.h | 14 +-
src/tracker-extract/tracker-extract-abw.c | 1 +
src/tracker-extract/tracker-extract-flac.c | 1 +
src/tracker-extract/tracker-extract-gstreamer.c | 1 +
src/tracker-extract/tracker-extract-html.c | 1 +
src/tracker-extract/tracker-extract-imagemagick.c | 1 +
src/tracker-extract/tracker-extract-jpeg.c | 25 ++--
src/tracker-extract/tracker-extract-libxine.c | 1 +
src/tracker-extract/tracker-extract-mockup.c | 1 +
src/tracker-extract/tracker-extract-mp3.c | 1 +
src/tracker-extract/tracker-extract-mplayer.c | 1 +
src/tracker-extract/tracker-extract-msoffice.c | 9 +-
src/tracker-extract/tracker-extract-oasis.c | 3 +-
src/tracker-extract/tracker-extract-pdf.c | 5 +-
src/tracker-extract/tracker-extract-playlist.c | 1 +
src/tracker-extract/tracker-extract-png.c | 15 ++-
src/tracker-extract/tracker-extract-ps.c | 1 +
src/tracker-extract/tracker-extract-text.c | 1 +
src/tracker-extract/tracker-extract-tiff.c | 17 ++--
src/tracker-extract/tracker-extract-totem.c | 1 +
src/tracker-extract/tracker-extract-vorbis.c | 1 +
src/tracker-extract/tracker-extract-xmp.c | 11 +-
src/tracker-extract/tracker-topanalyzer.cpp | 2 +
33 files changed, 285 insertions(+), 192 deletions(-)
---
diff --git a/src/libtracker-common/tracker-utils.c b/src/libtracker-common/tracker-utils.c
index b771cf6..365c342 100644
--- a/src/libtracker-common/tracker-utils.c
+++ b/src/libtracker-common/tracker-utils.c
@@ -418,112 +418,3 @@ tracker_uri_printf_escaped (const gchar *format, ...)
return result;
}
-
-
-gchar *
-tracker_coalesce (gint n_values,
- ...)
-{
- va_list args;
- gint i;
- gchar *result = NULL;
-
- va_start (args, n_values);
-
- for (i = 0; i < n_values; i++) {
- gchar *value;
-
- value = va_arg (args, gchar *);
- if (!result && !tracker_is_blank_string (value)) {
- result = g_strstrip (value);
- } else {
- g_free (value);
- }
- }
-
- va_end (args);
-
- return result;
-}
-
-gchar *
-tracker_merge (const gchar *delim, gint n_values,
- ...)
-{
- va_list args;
- gint i;
- GString *str = NULL;
-
- va_start (args, n_values);
-
- for (i = 0; i < n_values; i++) {
- gchar *value;
-
- value = va_arg (args, gchar *);
- if (value) {
- if (!str) {
- str = g_string_new (value);
- } else {
- if (delim) {
- g_string_append (str, delim);
- }
- g_string_append (str, value);
- }
- g_free (value);
- }
- }
-
- va_end (args);
-
- if (!str) {
- return NULL;
- }
-
- return g_string_free (str, FALSE);
-}
-
-gchar *
-tracker_text_normalize (const gchar *text,
- guint max_words,
- guint *n_words)
-{
- GString *string;
- gboolean in_break = TRUE;
- gunichar ch;
- gint words = 0;
-
- string = g_string_new (NULL);
-
- while ((ch = g_utf8_get_char_validated (text, -1)) > 0) {
- GUnicodeType type;
-
- type = g_unichar_type (ch);
-
- if (type == G_UNICODE_LOWERCASE_LETTER ||
- type == G_UNICODE_MODIFIER_LETTER ||
- type == G_UNICODE_OTHER_LETTER ||
- type == G_UNICODE_TITLECASE_LETTER ||
- type == G_UNICODE_UPPERCASE_LETTER) {
- /* Append regular chars */
- g_string_append_unichar (string, ch);
- in_break = FALSE;
- } else if (!in_break) {
- /* Non-regular char found, treat as word break */
- g_string_append_c (string, ' ');
- in_break = TRUE;
- words++;
-
- if (words > max_words) {
- break;
- }
- }
-
- text = g_utf8_find_next_char (text, NULL);
- }
-
- if (n_words) {
- *n_words = words;
- }
-
- return g_string_free (string, FALSE);
-}
diff --git a/src/libtracker-common/tracker-utils.h b/src/libtracker-common/tracker-utils.h
index 6371c94..60f4261 100644
--- a/src/libtracker-common/tracker-utils.h
+++ b/src/libtracker-common/tracker-utils.h
@@ -46,14 +46,6 @@ gchar* tracker_uri_vprintf_escaped (const gchar *format,
va_list args);
gchar* tracker_uri_printf_escaped (const gchar *format,
...);
-gchar * tracker_coalesce (gint n_values,
- ...);
-gchar * tracker_merge (const gchar *delim, gint n_values,
- ...);
-
-gchar * tracker_text_normalize (const gchar *text,
- guint max_words,
- guint *n_words);
G_END_DECLS
diff --git a/src/libtracker-extract/Makefile.am b/src/libtracker-extract/Makefile.am
index be3c239..b33dd86 100644
--- a/src/libtracker-extract/Makefile.am
+++ b/src/libtracker-extract/Makefile.am
@@ -25,7 +25,8 @@ libtracker_extract_ TRACKER_API_VERSION@_la_SOURCES = \
tracker-iptc.c \
tracker-iptc.h \
tracker-xmp.c \
- tracker-xmp.h
+ tracker-xmp.h \
+ tracker-utils.c
noinst_HEADERS =
@@ -33,7 +34,8 @@ libtracker_extractinc_HEADERS = \
tracker-extract.h \
tracker-exif.h \
tracker-iptc.h \
- tracker-xmp.h
+ tracker-xmp.h \
+ tracker-utils.h
libtracker_extract_ TRACKER_API_VERSION@_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
diff --git a/src/libtracker-extract/tracker-exif.c b/src/libtracker-extract/tracker-exif.c
index 450724d..5506ac8 100644
--- a/src/libtracker-extract/tracker-exif.c
+++ b/src/libtracker-extract/tracker-exif.c
@@ -316,7 +316,7 @@ get_value (ExifData *exif,
#endif /* HAVE_LIBEXIF */
/**
- * tracker_exif_read:
+ * tracker_extract_exif_read:
* @buffer: a chunk of data with exif data in it.
* @len: the size of @buffer.
* @uri: the URI this is related to.
@@ -332,10 +332,10 @@ get_value (ExifData *exif,
* Since: 0.8
**/
gboolean
-tracker_exif_read (const unsigned char *buffer,
- size_t len,
- const gchar *uri,
- TrackerExifData *data)
+tracker_extract_exif_read (const unsigned char *buffer,
+ size_t len,
+ const gchar *uri,
+ TrackerExifData *data)
{
#ifdef HAVE_LIBEXIF
ExifData *exif;
diff --git a/src/libtracker-extract/tracker-exif.h b/src/libtracker-extract/tracker-exif.h
index fe7b5bf..5df6de4 100644
--- a/src/libtracker-extract/tracker-exif.h
+++ b/src/libtracker-extract/tracker-exif.h
@@ -50,10 +50,10 @@ typedef struct {
gchar *software;
} TrackerExifData;
-gboolean tracker_exif_read (const unsigned char *buffer,
- size_t len,
- const gchar *uri,
- TrackerExifData *data);
+gboolean tracker_extract_exif_read (const unsigned char *buffer,
+ size_t len,
+ const gchar *uri,
+ TrackerExifData *data);
G_END_DECLS
diff --git a/src/libtracker-extract/tracker-iptc.c b/src/libtracker-extract/tracker-iptc.c
index 4bfe4e8..83a29be 100644
--- a/src/libtracker-extract/tracker-iptc.c
+++ b/src/libtracker-extract/tracker-iptc.c
@@ -183,7 +183,7 @@ foreach_dataset (IptcDataSet *dataset,
#endif /* HAVE_LIBIPTCDATA */
/**
- * tracker_iptc_read:
+ * tracker_extract_iptc_read:
* @buffer: a chunk of data with iptc data in it.
* @len: the size of @buffer.
* @uri: the URI this is related to.
@@ -199,10 +199,10 @@ foreach_dataset (IptcDataSet *dataset,
* Since: 0.8
**/
gboolean
-tracker_iptc_read (const unsigned char *buffer,
- size_t len,
- const gchar *uri,
- TrackerIptcData *data)
+tracker_extract_iptc_read (const unsigned char *buffer,
+ size_t len,
+ const gchar *uri,
+ TrackerIptcData *data)
{
#ifdef HAVE_LIBIPTCDATA
IptcData *iptc;
diff --git a/src/libtracker-extract/tracker-iptc.h b/src/libtracker-extract/tracker-iptc.h
index b2958fb..cdd9e7b 100644
--- a/src/libtracker-extract/tracker-iptc.h
+++ b/src/libtracker-extract/tracker-iptc.h
@@ -43,10 +43,10 @@ typedef struct {
gchar *contact;
} TrackerIptcData;
-gboolean tracker_iptc_read (const unsigned char *buffer,
- size_t len,
- const gchar *uri,
- TrackerIptcData *data);
+gboolean tracker_extract_iptc_read (const unsigned char *buffer,
+ size_t len,
+ const gchar *uri,
+ TrackerIptcData *data);
G_END_DECLS
diff --git a/src/libtracker-extract/tracker-utils.c b/src/libtracker-extract/tracker-utils.c
new file mode 100644
index 0000000..fb0671d
--- /dev/null
+++ b/src/libtracker-extract/tracker-utils.c
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2009, Nokia
+ *
+ * This program 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 program 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 program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * Authors: Philip Van Hoof <philip codeminded be>
+ */
+
+#include "config.h"
+
+#include <locale.h>
+#include <string.h>
+
+#include <glib.h>
+#include <glib/gi18n.h>
+
+#include <libtracker-extract/tracker-utils.h>
+#include <libtracker-common/tracker-utils.h>
+
+gchar *
+tracker_extract_coalesce (gint n_values,
+ ...)
+{
+ va_list args;
+ gint i;
+ gchar *result = NULL;
+
+ va_start (args, n_values);
+
+ for (i = 0; i < n_values; i++) {
+ gchar *value;
+
+ value = va_arg (args, gchar *);
+ if (!result && !tracker_is_blank_string (value)) {
+ result = g_strstrip (value);
+ } else {
+ g_free (value);
+ }
+ }
+
+ va_end (args);
+
+ return result;
+}
+
+gchar *
+tracker_extract_merge (const gchar *delim, gint n_values,
+ ...)
+{
+ va_list args;
+ gint i;
+ GString *str = NULL;
+
+ va_start (args, n_values);
+
+ for (i = 0; i < n_values; i++) {
+ gchar *value;
+
+ value = va_arg (args, gchar *);
+ if (value) {
+ if (!str) {
+ str = g_string_new (value);
+ } else {
+ if (delim) {
+ g_string_append (str, delim);
+ }
+ g_string_append (str, value);
+ }
+ g_free (value);
+ }
+ }
+
+ va_end (args);
+
+ if (!str) {
+ return NULL;
+ }
+
+ return g_string_free (str, FALSE);
+}
+
+gchar *
+tracker_extract_text_normalize (const gchar *text,
+ guint max_words,
+ guint *n_words)
+{
+ GString *string;
+ gboolean in_break = TRUE;
+ gunichar ch;
+ gint words = 0;
+
+ string = g_string_new (NULL);
+
+ while ((ch = g_utf8_get_char_validated (text, -1)) > 0) {
+ GUnicodeType type;
+
+ type = g_unichar_type (ch);
+
+ if (type == G_UNICODE_LOWERCASE_LETTER ||
+ type == G_UNICODE_MODIFIER_LETTER ||
+ type == G_UNICODE_OTHER_LETTER ||
+ type == G_UNICODE_TITLECASE_LETTER ||
+ type == G_UNICODE_UPPERCASE_LETTER) {
+ /* Append regular chars */
+ g_string_append_unichar (string, ch);
+ in_break = FALSE;
+ } else if (!in_break) {
+ /* Non-regular char found, treat as word break */
+ g_string_append_c (string, ' ');
+ in_break = TRUE;
+ words++;
+
+ if (words > max_words) {
+ break;
+ }
+ }
+
+ text = g_utf8_find_next_char (text, NULL);
+ }
+
+ if (n_words) {
+ *n_words = words;
+ }
+
+ return g_string_free (string, FALSE);
+}
diff --git a/src/libtracker-extract/tracker-utils.h b/src/libtracker-extract/tracker-utils.h
new file mode 100644
index 0000000..f247cba
--- /dev/null
+++ b/src/libtracker-extract/tracker-utils.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2009, Nokia
+ *
+ * This program 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 program 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 program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * Authors: Philip Van Hoof <philip codeminded be>
+ */
+
+#ifndef __LIBTRACKER_EXTRACT_UTILS_H__
+#define __LIBTRACKER_EXTRACT_UTILS_H__
+
+#include <glib.h>
+
+/* These are for convenience */
+#define tracker_coalesce tracker_extract_coalesce
+#define tracker_merge tracker_extract_merge
+
+G_BEGIN_DECLS
+
+gchar * tracker_extract_coalesce (gint n_values,
+ ...);
+gchar * tracker_extract_merge (const gchar *delim,
+ gint n_values,
+ ...);
+gchar * tracker_extract_text_normalize (const gchar *text,
+ guint max_words,
+ guint *n_words);
+
+G_END_DECLS
+
+#endif /* __LIBTRACKER_EXTRACT_UTILS_H__ */
diff --git a/src/libtracker-extract/tracker-xmp.c b/src/libtracker-extract/tracker-xmp.c
index b537238..36bdaa4 100644
--- a/src/libtracker-extract/tracker-xmp.c
+++ b/src/libtracker-extract/tracker-xmp.c
@@ -28,6 +28,8 @@
#include <libtracker-common/tracker-utils.h>
#include <libtracker-common/tracker-ontology.h>
+#include <libtracker-extract/tracker-utils.h>
+
#include "tracker-xmp.h"
#ifdef HAVE_EXEMPI
@@ -435,7 +437,7 @@ iterate (XmpPtr xmp,
#endif /* HAVE_EXEMPI */
/**
- * tracker_xmp_read:
+ * tracker_extract_xmp_read:
* @buffer: a chunk of data with xmp data in it.
* @len: the size of @buffer.
* @uri: the URI this is related to.
@@ -451,10 +453,10 @@ iterate (XmpPtr xmp,
* Since: 0.8
**/
gboolean
-tracker_xmp_read (const gchar *buffer,
- size_t len,
- const gchar *uri,
- TrackerXmpData *data)
+tracker_extract_xmp_read (const gchar *buffer,
+ size_t len,
+ const gchar *uri,
+ TrackerXmpData *data)
{
#ifdef HAVE_EXEMPI
XmpPtr xmp;
@@ -525,7 +527,7 @@ insert_keywords (TrackerSparqlBuilder *metadata,
}
/**
- * tracker_xmp_apply:
+ * tracker_extract_xmp_apply:
* @metadata: the metadata object to apply XMP data to.
* @uri: the URI this is related to.
* @data: the data to push into @metadata.
@@ -538,9 +540,9 @@ insert_keywords (TrackerSparqlBuilder *metadata,
* Since: 0.8
**/
gboolean
-tracker_xmp_apply (TrackerSparqlBuilder *metadata,
- const gchar *uri,
- TrackerXmpData *data)
+tracker_extract_xmp_apply (TrackerSparqlBuilder *metadata,
+ const gchar *uri,
+ TrackerXmpData *data)
{
g_return_val_if_fail (TRACKER_IS_SPARQL_BUILDER (metadata), FALSE);
g_return_val_if_fail (uri != NULL, FALSE);
diff --git a/src/libtracker-extract/tracker-xmp.h b/src/libtracker-extract/tracker-xmp.h
index b42e44b..6d8d7aa 100644
--- a/src/libtracker-extract/tracker-xmp.h
+++ b/src/libtracker-extract/tracker-xmp.h
@@ -82,13 +82,13 @@ typedef struct {
gchar *city;
} TrackerXmpData;
-gboolean tracker_xmp_read (const gchar *buffer,
- size_t len,
- const gchar *uri,
- TrackerXmpData *data);
-gboolean tracker_xmp_apply (TrackerSparqlBuilder *metadata,
- const gchar *uri,
- TrackerXmpData *data);
+gboolean tracker_extract_xmp_read (const gchar *buffer,
+ size_t len,
+ const gchar *uri,
+ TrackerXmpData *data);
+gboolean tracker_extract_xmp_apply (TrackerSparqlBuilder *metadata,
+ const gchar *uri,
+ TrackerXmpData *data);
G_END_DECLS
diff --git a/src/tracker-extract/tracker-extract-abw.c b/src/tracker-extract/tracker-extract-abw.c
index da95e51..af3780e 100644
--- a/src/tracker-extract/tracker-extract-abw.c
+++ b/src/tracker-extract/tracker-extract-abw.c
@@ -37,6 +37,7 @@
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-extract/tracker-extract.h>
+#include <libtracker-extract/tracker-utils.h>
#define NIE_PREFIX TRACKER_NIE_PREFIX
#define NFO_PREFIX TRACKER_NFO_PREFIX
diff --git a/src/tracker-extract/tracker-extract-flac.c b/src/tracker-extract/tracker-extract-flac.c
index dbe7b63..95eff4b 100644
--- a/src/tracker-extract/tracker-extract-flac.c
+++ b/src/tracker-extract/tracker-extract-flac.c
@@ -32,6 +32,7 @@
#include <libtracker-common/tracker-utils.h>
#include <libtracker-extract/tracker-extract.h>
+#include <libtracker-extract/tracker-utils.h>
typedef struct {
gchar *title;
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index 9cf57f3..405cb03 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -41,6 +41,7 @@ long long int llroundl(long double x);
#include <libtracker-common/tracker-utils.h>
#include <libtracker-extract/tracker-extract.h>
+#include <libtracker-extract/tracker-utils.h>
#include "tracker-albumart.h"
#include "tracker-dbus.h"
diff --git a/src/tracker-extract/tracker-extract-html.c b/src/tracker-extract/tracker-extract-html.c
index 10dbfed..15d1d25 100644
--- a/src/tracker-extract/tracker-extract-html.c
+++ b/src/tracker-extract/tracker-extract-html.c
@@ -29,6 +29,7 @@
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-extract/tracker-extract.h>
+#include <libtracker-extract/tracker-utils.h>
#define RDF_TYPE TRACKER_RDF_PREFIX "type"
diff --git a/src/tracker-extract/tracker-extract-imagemagick.c b/src/tracker-extract/tracker-extract-imagemagick.c
index 67d9182..881e62b 100644
--- a/src/tracker-extract/tracker-extract-imagemagick.c
+++ b/src/tracker-extract/tracker-extract-imagemagick.c
@@ -31,6 +31,7 @@
#include <libtracker-extract/tracker-extract.h>
#include <libtracker-extract/tracker-xmp.h>
+#include <libtracker-extract/tracker-utils.h>
#define NMM_PREFIX TRACKER_NMM_PREFIX
#define NFO_PREFIX TRACKER_NFO_PREFIX
diff --git a/src/tracker-extract/tracker-extract-jpeg.c b/src/tracker-extract/tracker-extract-jpeg.c
index b1432f5..f835004 100644
--- a/src/tracker-extract/tracker-extract-jpeg.c
+++ b/src/tracker-extract/tracker-extract-jpeg.c
@@ -50,6 +50,7 @@
#include <libtracker-extract/tracker-xmp.h>
#include <libtracker-extract/tracker-iptc.h>
#include <libtracker-extract/tracker-exif.h>
+#include <libtracker-extract/tracker-utils.h>
#include "tracker-main.h"
@@ -233,19 +234,19 @@ extract_jpeg (const gchar *uri,
#ifdef HAVE_LIBEXIF
if (strncmp (EXIF_NAMESPACE, str, EXIF_NAMESPACE_LENGTH) == 0) {
- tracker_exif_read ((unsigned char*) marker->data,
- len,
- uri,
- &ed);
+ tracker_extract_exif_read ((unsigned char*) marker->data,
+ len,
+ uri,
+ &ed);
}
#endif /* HAVE_LIBEXIF */
#ifdef HAVE_EXEMPI
if (strncmp (XMP_NAMESPACE, str, XMP_NAMESPACE_LENGTH) == 0) {
- tracker_xmp_read (str + XMP_NAMESPACE_LENGTH,
- len - XMP_NAMESPACE_LENGTH,
- uri,
- &xd);
+ tracker_extract_xmp_read (str + XMP_NAMESPACE_LENGTH,
+ len - XMP_NAMESPACE_LENGTH,
+ uri,
+ &xd);
}
#endif /* HAVE_EXEMPI */
@@ -258,10 +259,10 @@ extract_jpeg (const gchar *uri,
if (strncmp (PS3_NAMESPACE, str, PS3_NAMESPACE_LENGTH) == 0) {
offset = iptc_jpeg_ps3_find_iptc (str, len, &sublen);
if (offset > 0) {
- tracker_iptc_read (str + offset,
- sublen,
- uri,
- &id);
+ tracker_extract_iptc_read (str + offset,
+ sublen,
+ uri,
+ &id);
}
}
#endif /* HAVE_LIBIPTCDATA */
diff --git a/src/tracker-extract/tracker-extract-libxine.c b/src/tracker-extract/tracker-extract-libxine.c
index c2a7527..a04cc1c 100644
--- a/src/tracker-extract/tracker-extract-libxine.c
+++ b/src/tracker-extract/tracker-extract-libxine.c
@@ -27,6 +27,7 @@
#include <libtracker-common/tracker-utils.h>
#include <libtracker-extract/tracker-extract.h>
+#include <libtracker-extract/tracker-utils.h>
#define NMM_PREFIX TRACKER_NMM_PREFIX
#define NFO_PREFIX TRACKER_NFO_PREFIX
diff --git a/src/tracker-extract/tracker-extract-mockup.c b/src/tracker-extract/tracker-extract-mockup.c
index 57a1979..f2c4911 100644
--- a/src/tracker-extract/tracker-extract-mockup.c
+++ b/src/tracker-extract/tracker-extract-mockup.c
@@ -20,6 +20,7 @@
#include "config.h"
#include <libtracker-extract/tracker-extract.h>
+#include <libtracker-extract/tracker-utils.h>
static void extract_mockup (const gchar *uri,
TrackerSparqlBuilder *metadata);
diff --git a/src/tracker-extract/tracker-extract-mp3.c b/src/tracker-extract/tracker-extract-mp3.c
index 7e6fed7..aa3cad3 100644
--- a/src/tracker-extract/tracker-extract-mp3.c
+++ b/src/tracker-extract/tracker-extract-mp3.c
@@ -49,6 +49,7 @@
#include <libtracker-common/tracker-type-utils.h>
#include <libtracker-extract/tracker-extract.h>
+#include <libtracker-extract/tracker-utils.h>
#include "tracker-albumart.h"
#include "tracker-dbus.h"
diff --git a/src/tracker-extract/tracker-extract-mplayer.c b/src/tracker-extract/tracker-extract-mplayer.c
index 09675af..a73d815 100644
--- a/src/tracker-extract/tracker-extract-mplayer.c
+++ b/src/tracker-extract/tracker-extract-mplayer.c
@@ -30,6 +30,7 @@
#include <libtracker-common/tracker-utils.h>
#include <libtracker-extract/tracker-extract.h>
+#include <libtracker-extract/tracker-utils.h>
#define NMM_PREFIX TRACKER_NMM_PREFIX
#define NFO_PREFIX TRACKER_NFO_PREFIX
diff --git a/src/tracker-extract/tracker-extract-msoffice.c b/src/tracker-extract/tracker-extract-msoffice.c
index cbbd1fe..f970514 100644
--- a/src/tracker-extract/tracker-extract-msoffice.c
+++ b/src/tracker-extract/tracker-extract-msoffice.c
@@ -37,6 +37,7 @@
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-extract/tracker-extract.h>
+#include <libtracker-extract/tracker-utils.h>
#include "tracker-main.h"
@@ -539,9 +540,9 @@ append_text (gchar *text,
g_return_val_if_fail(text,-1);
g_return_val_if_fail(all_texts,-1);
- normalized_text = tracker_text_normalize(text,
- max_words - words,
- &count);
+ normalized_text = tracker_extract_text_normalize (text,
+ max_words - words,
+ &count);
if (normalized_text) {
/*
@@ -861,7 +862,7 @@ extract_msword_content (GsfInfile *infile,
g_free (clx);
if (content) {
- normalized = tracker_text_normalize (content->str, n_words, NULL);
+ normalized = tracker_extract_text_normalize (content->str, n_words, NULL);
g_string_free (content, TRUE);
}
diff --git a/src/tracker-extract/tracker-extract-oasis.c b/src/tracker-extract/tracker-extract-oasis.c
index 9318771..3573620 100644
--- a/src/tracker-extract/tracker-extract-oasis.c
+++ b/src/tracker-extract/tracker-extract-oasis.c
@@ -28,6 +28,7 @@
#include <libtracker-common/tracker-utils.h>
#include <libtracker-extract/tracker-extract.h>
+#include <libtracker-extract/tracker-utils.h>
#include "tracker-main.h"
@@ -96,7 +97,7 @@ extract_content (const gchar *path,
return NULL;
}
- text = tracker_text_normalize (output, n_words, NULL);
+ text = tracker_extract_text_normalize (output, n_words, NULL);
g_free (command);
g_free (output);
diff --git a/src/tracker-extract/tracker-extract-pdf.c b/src/tracker-extract/tracker-extract-pdf.c
index ff2c6a6..41eb6d7 100644
--- a/src/tracker-extract/tracker-extract-pdf.c
+++ b/src/tracker-extract/tracker-extract-pdf.c
@@ -32,6 +32,7 @@
#include <libtracker-extract/tracker-extract.h>
#include <libtracker-extract/tracker-xmp.h>
+#include <libtracker-extract/tracker-utils.h>
#include "tracker-main.h"
@@ -114,7 +115,7 @@ extract_content (PopplerDocument *document,
poppler_page_get_size (page, &rect.x2, &rect.y2);
text = poppler_page_get_text (page, POPPLER_SELECTION_WORD, &rect);
- t = tracker_text_normalize (text, n_words - words, &normalized_words);
+ t = tracker_extract_text_normalize (text, n_words - words, &normalized_words);
words += normalized_words;
g_string_append (string, t);
@@ -223,7 +224,7 @@ extract_pdf (const gchar *uri,
}
if (xml) {
- tracker_xmp_read (xml, strlen (xml), uri, &xd);
+ tracker_extract_xmp_read (xml, strlen (xml), uri, &xd);
g_free (xml);
xml = NULL;
diff --git a/src/tracker-extract/tracker-extract-playlist.c b/src/tracker-extract/tracker-extract-playlist.c
index 6f3df7b..175ad80 100644
--- a/src/tracker-extract/tracker-extract-playlist.c
+++ b/src/tracker-extract/tracker-extract-playlist.c
@@ -36,6 +36,7 @@
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-extract/tracker-extract.h>
+#include <libtracker-extract/tracker-utils.h>
#define PLAYLIST_PROPERTY_NO_TRACKS "entryCounter"
#define PLAYLIST_PROPERTY_DURATION "listDuration"
diff --git a/src/tracker-extract/tracker-extract-png.c b/src/tracker-extract/tracker-extract-png.c
index 4e0ec59..6cdcec7 100644
--- a/src/tracker-extract/tracker-extract-png.c
+++ b/src/tracker-extract/tracker-extract-png.c
@@ -44,6 +44,7 @@
#include <libtracker-extract/tracker-extract.h>
#include <libtracker-extract/tracker-xmp.h>
#include <libtracker-extract/tracker-exif.h>
+#include <libtracker-extract/tracker-utils.h>
#define RFC1123_DATE_FORMAT "%d %B %Y %H:%M:%S %z"
@@ -154,14 +155,14 @@ read_metadata (png_structp png_ptr, png_infop info_ptr, const gchar *uri, Tracke
if (g_strcmp0 ("XML:com.adobe.xmp", text_ptr[i].key) == 0) {
- /* ATM tracker_read_xmp supports setting xmp_data
+ /* ATM tracker_extract_xmp_read supports setting xmp_data
* multiple times, keep it that way as here it's
* theoretically possible that the function gets
* called multiple times */
- tracker_xmp_read (text_ptr[i].text,
- text_ptr[i].itxt_length,
- uri, &xmp_data);
+ tracker_extract_xmp_read (text_ptr[i].text,
+ text_ptr[i].itxt_length,
+ uri, &xmp_data);
continue;
}
@@ -174,9 +175,9 @@ read_metadata (png_structp png_ptr, png_infop info_ptr, const gchar *uri, Tracke
* http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/PNG.html#TextualData */
if (g_strcmp0 ("Raw profile type exif", text_ptr[i].key) == 0) {
- tracker_exif_read (text_ptr[i].text,
- text_ptr[i].itxt_length,
- uri, &exif_data);
+ tracker_extract_exif_read (text_ptr[i].text,
+ text_ptr[i].itxt_length,
+ uri, &exif_data);
continue;
}
#endif /* HAVE_LIBEXIF */
diff --git a/src/tracker-extract/tracker-extract-ps.c b/src/tracker-extract/tracker-extract-ps.c
index 41e8335..543de10 100644
--- a/src/tracker-extract/tracker-extract-ps.c
+++ b/src/tracker-extract/tracker-extract-ps.c
@@ -39,6 +39,7 @@
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-extract/tracker-extract.h>
+#include <libtracker-extract/tracker-utils.h>
#ifndef HAVE_GETLINE
diff --git a/src/tracker-extract/tracker-extract-text.c b/src/tracker-extract/tracker-extract-text.c
index 71ddeed..0fa89ed 100644
--- a/src/tracker-extract/tracker-extract-text.c
+++ b/src/tracker-extract/tracker-extract-text.c
@@ -25,6 +25,7 @@
#include <gio/gio.h>
#include <libtracker-extract/tracker-extract.h>
+#include <libtracker-extract/tracker-utils.h>
#undef TRY_LOCALE_TO_UTF8_CONVERSION
diff --git a/src/tracker-extract/tracker-extract-tiff.c b/src/tracker-extract/tracker-extract-tiff.c
index 837f8a7..272e7a8 100644
--- a/src/tracker-extract/tracker-extract-tiff.c
+++ b/src/tracker-extract/tracker-extract-tiff.c
@@ -41,6 +41,7 @@
#include <libtracker-extract/tracker-xmp.h>
#include <libtracker-extract/tracker-iptc.h>
#include <libtracker-extract/tracker-exif.h>
+#include <libtracker-extract/tracker-utils.h>
#define EXIF_DATE_FORMAT "%Y:%m:%d %H:%M:%S"
@@ -307,10 +308,10 @@ extract_tiff (const gchar *uri,
if (TIFFGetField (image, TIFFTAG_RICHTIFFIPTC, &iptcSize, &iptcOffset)) {
if (TIFFIsByteSwapped(image) != 0)
TIFFSwabArrayOfLong((uint32 *) iptcOffset, (unsigned long) iptcSize);
- tracker_iptc_read (iptcOffset,
- 4 * iptcSize,
- uri,
- &iptc_data);
+ tracker_extract_iptc_read (iptcOffset,
+ 4 * iptcSize,
+ uri,
+ &iptc_data);
}
#endif /* HAVE_LIBIPTCDATA */
@@ -318,10 +319,10 @@ extract_tiff (const gchar *uri,
due to bugs in the original spec (type) */
#ifdef HAVE_EXEMPI
if (TIFFGetField (image, TIFFTAG_XMLPACKET, &size, &xmpOffset)) {
- tracker_xmp_read (xmpOffset,
- size,
- uri,
- &xmp_data);
+ tracker_extract_xmp_read (xmpOffset,
+ size,
+ uri,
+ &xmp_data);
}
#endif /* HAVE_EXEMPI */
diff --git a/src/tracker-extract/tracker-extract-totem.c b/src/tracker-extract/tracker-extract-totem.c
index b685b60..b004333 100644
--- a/src/tracker-extract/tracker-extract-totem.c
+++ b/src/tracker-extract/tracker-extract-totem.c
@@ -27,6 +27,7 @@
#include <libtracker-common/tracker-utils.h>
#include <libtracker-extract/tracker-extract.h>
+#include <libtracker-extract/tracker-utils.h>
#define NMM_PREFIX TRACKER_NMM_PREFIX
#define NFO_PREFIX TRACKER_NFO_PREFIX
diff --git a/src/tracker-extract/tracker-extract-vorbis.c b/src/tracker-extract/tracker-extract-vorbis.c
index 0e6188d..e1c71a3 100644
--- a/src/tracker-extract/tracker-extract-vorbis.c
+++ b/src/tracker-extract/tracker-extract-vorbis.c
@@ -32,6 +32,7 @@
#include <libtracker-common/tracker-utils.h>
#include <libtracker-extract/tracker-extract.h>
+#include <libtracker-extract/tracker-utils.h>
#define NIE_PREFIX TRACKER_NIE_PREFIX
#define NFO_PREFIX TRACKER_NFO_PREFIX
diff --git a/src/tracker-extract/tracker-extract-xmp.c b/src/tracker-extract/tracker-extract-xmp.c
index c4ee88e..4da1651 100644
--- a/src/tracker-extract/tracker-extract-xmp.c
+++ b/src/tracker-extract/tracker-extract-xmp.c
@@ -29,6 +29,7 @@
#include <libtracker-extract/tracker-extract.h>
#include <libtracker-extract/tracker-xmp.h>
+#include <libtracker-extract/tracker-utils.h>
static void extract_xmp (const gchar *filename,
TrackerSparqlBuilder *preupdate,
@@ -152,12 +153,12 @@ extract_xmp (const gchar *uri,
/* If no orig file is found for the sidekick, we use the sidekick to
* describe itself instead, falling back to uri */
- tracker_xmp_read (contents,
- length,
- orig_uri ? orig_uri : uri,
- &xmp_data);
+ tracker_extract_xmp_read (contents,
+ length,
+ orig_uri ? orig_uri : uri,
+ &xmp_data);
- tracker_xmp_apply (metadata, uri, &xmp_data);
+ tracker_extract_xmp_apply (metadata, uri, &xmp_data);
g_free (orig_uri);
}
diff --git a/src/tracker-extract/tracker-topanalyzer.cpp b/src/tracker-extract/tracker-topanalyzer.cpp
index d8ef205..0f673c8 100644
--- a/src/tracker-extract/tracker-topanalyzer.cpp
+++ b/src/tracker-extract/tracker-topanalyzer.cpp
@@ -44,6 +44,8 @@
#include <libtracker-common/tracker-ontology.h>
+#include <libtracker-extract/tracker-utils.h>
+
#define NIE_PREFIX TRACKER_NIE_PREFIX
#include "tracker-main.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]