[tracker/libtracker-extract] libtracker-extract: Move tracker_get_extract_data to tracker-extract.h
- From: Martyn James Russell <mr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/libtracker-extract] libtracker-extract: Move tracker_get_extract_data to tracker-extract.h
- Date: Tue, 19 Jan 2010 12:53:09 +0000 (UTC)
commit df6b7e8378db2805a63f105e52ee78fc47343ab9
Author: Martyn Russell <martyn lanedo com>
Date: Tue Jan 19 12:48:55 2010 +0000
libtracker-extract: Move tracker_get_extract_data to tracker-extract.h
Was in tracker-extract/tracker-main.h
src/libtracker-extract/tracker-extract.h | 45 ++++++++++++++++++++
src/tracker-extract/dummy.c | 36 +++++++++++----
src/tracker-extract/tracker-extract-abw.c | 13 +++---
.../tracker-extract-gstreamer-helix.c | 11 +++--
src/tracker-extract/tracker-extract-gstreamer.c | 17 +++++---
src/tracker-extract/tracker-extract-html.c | 8 ++--
src/tracker-extract/tracker-extract-imagemagick.c | 7 +--
src/tracker-extract/tracker-extract-jpeg.c | 4 +-
src/tracker-extract/tracker-extract-libxine.c | 7 +--
src/tracker-extract/tracker-extract-mockup.c | 6 +--
src/tracker-extract/tracker-extract-mp3.c | 8 ++--
src/tracker-extract/tracker-extract-mplayer.c | 8 ++--
src/tracker-extract/tracker-extract-msoffice.c | 11 ++---
src/tracker-extract/tracker-extract-oasis.c | 38 +++++++++--------
src/tracker-extract/tracker-extract-pdf.c | 4 +-
src/tracker-extract/tracker-extract-playlist.c | 17 ++++----
src/tracker-extract/tracker-extract-png.c | 11 ++---
src/tracker-extract/tracker-extract-ps.c | 11 ++---
src/tracker-extract/tracker-extract-text.c | 6 +--
src/tracker-extract/tracker-extract-tiff.c | 9 ++--
src/tracker-extract/tracker-extract-totem.c | 12 +++---
src/tracker-extract/tracker-extract-vorbis.c | 4 +-
src/tracker-extract/tracker-extract-xmp.c | 5 +-
src/tracker-extract/tracker-extract.c | 5 +-
src/tracker-extract/tracker-main.h | 23 +---------
25 files changed, 183 insertions(+), 143 deletions(-)
---
diff --git a/src/libtracker-extract/tracker-extract.h b/src/libtracker-extract/tracker-extract.h
new file mode 100644
index 0000000..49511b0
--- /dev/null
+++ b/src/libtracker-extract/tracker-extract.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2010, 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.
+ */
+
+#ifndef __LIBTRACKER_EXTRACT_EXTRACT_H__
+#define __LIBTRACKER_EXTRACT_EXTRACT_H__
+
+#include <glib.h>
+
+#include <libtracker-common/tracker-statement-list.h>
+
+G_BEGIN_DECLS
+
+typedef struct TrackerExtractData TrackerExtractData;
+
+typedef TrackerExtractData * (*TrackerExtractDataFunc)(void);
+
+struct TrackerExtractData {
+ const gchar *mime;
+
+ void (* extract) (const gchar *path,
+ TrackerSparqlBuilder *metadata);
+};
+
+/* This is defined in each extractor */
+TrackerExtractData *tracker_extract_get_data (void);
+
+G_END_DECLS
+
+#endif /* __LIBTRACKER_EXTRACT_EXTRACT_H__ */
diff --git a/src/tracker-extract/dummy.c b/src/tracker-extract/dummy.c
index 1841fb3..9d95099 100644
--- a/src/tracker-extract/dummy.c
+++ b/src/tracker-extract/dummy.c
@@ -1,5 +1,4 @@
/*
- * Copyright (C) 2007, Mr Jamie McCracken (jamiemcc gnome org)
* Copyright (C) 2008, Nokia
*
* This program is free software; you can redistribute it and/or
@@ -27,13 +26,13 @@
#include <glib.h>
#include <glib/gstdio.h>
-#include "tracker-main.h"
+#include <libtracker-extract/tracker-extract.h>
/*
* Prototype of the parsing function.
*/
-static void extract_dummy (const gchar *filename,
- GHashTable *metadata);
+static void extract_function (const gchar *uri,
+ TrackerSparqlBuilder *metadata);
/*
* Link between mimetype and parsing function
@@ -47,9 +46,10 @@ static TrackerExtractData data[] = {
* Implementation of the parsing function
*/
static void
-extract_function (const gchar *filename,
- GHashTable *metadata)
+extract_function (const gchar *uri,
+ TrackerSparqlBuilder *metadata)
{
+ gchar *name;
/*
* Open the file and do whatever you need to do with it.
@@ -57,9 +57,25 @@ extract_function (const gchar *filename,
* The extracted properties must be added to the metadata
* hash table.
*/
- g_hash_table_insert (metadata,
- g_strdup ("Dummy:DummyProp"),
- g_strdup ("Value"));
+
+ /* Example 1. Insert a picture with the creator */
+ name = g_strdup ("Martyn Russell");
+
+ tracker_sparql_builder_subject_iri (metadata, uri);
+ tracker_sparql_builder_predicate (metadata, "a");
+ tracker_sparql_builder_object (metadata, "nfo:Image");
+ tracker_sparql_builder_object (metadata, "nmm:Photo");
+
+ tracker_sparql_builder_predicate (metadata, "nco:creator");
+
+ tracker_sparql_builder_object_blank_open (metadata);
+ tracker_sparql_builder_predicate (metadata, "a");
+ tracker_sparql_builder_object (metadata, "nco:Contact");
+
+ tracker_sparql_builder_predicate (metadata, "nco:fullname");
+ tracker_sparql_builder_object_unvalidated (metadata, name);
+ tracker_sparql_builder_object_blank_close (metadata);
+ g_free (name);
}
/*
@@ -67,7 +83,7 @@ extract_function (const gchar *filename,
* It is the "public" function used to load the module.
*/
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return data;
}
diff --git a/src/tracker-extract/tracker-extract-abw.c b/src/tracker-extract/tracker-extract-abw.c
index 0594f26..90452dc 100644
--- a/src/tracker-extract/tracker-extract-abw.c
+++ b/src/tracker-extract/tracker-extract-abw.c
@@ -36,8 +36,7 @@
#include <libtracker-common/tracker-file-utils.h>
#include <libtracker-common/tracker-ontology.h>
-#include "tracker-main.h"
-
+#include <libtracker-extract/tracker-extract.h>
#define NIE_PREFIX TRACKER_NIE_PREFIX
#define NFO_PREFIX TRACKER_NFO_PREFIX
@@ -46,8 +45,8 @@
#define RDF_PREFIX TRACKER_RDF_PREFIX
#define RDF_TYPE RDF_PREFIX "type"
-static void extract_abw (const gchar *uri,
- TrackerSparqlBuilder *metadata);
+static void extract_abw (const gchar *uri,
+ TrackerSparqlBuilder *metadata);
static TrackerExtractData data[] = {
{ "application/x-abiword", extract_abw },
@@ -55,8 +54,8 @@ static TrackerExtractData data[] = {
};
static void
-extract_abw (const gchar *uri,
- TrackerSparqlBuilder *metadata)
+extract_abw (const gchar *uri,
+ TrackerSparqlBuilder *metadata)
{
FILE *f;
gchar *filename;
@@ -121,7 +120,7 @@ extract_abw (const gchar *uri,
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return data;
}
diff --git a/src/tracker-extract/tracker-extract-gstreamer-helix.c b/src/tracker-extract/tracker-extract-gstreamer-helix.c
index 4da8690..712036b 100644
--- a/src/tracker-extract/tracker-extract-gstreamer-helix.c
+++ b/src/tracker-extract/tracker-extract-gstreamer-helix.c
@@ -32,9 +32,8 @@
#include <gst/gst.h>
#include <gst/tag/tag.h>
-#include <libtracker-common/tracker-statement-list.h>
+#include <libtracker-extract/tracker-extract.h>
-#include "tracker-main.h"
#include "tracker-albumart.h"
typedef enum {
@@ -69,8 +68,10 @@ typedef struct {
} MetadataExtractor;
-static void extract_gstreamer_helix_audio (const gchar *uri, TrackerSparqlBuilder *metadata);
-static void extract_gstreamer_helix_video (const gchar *uri, TrackerSparqlBuilder *metadata);
+static void extract_gstreamer_helix_audio (const gchar *uri,
+ TrackerSparqlBuilder *metadata);
+static void extract_gstreamer_helix_video (const gchar *uri,
+ TrackerSparqlBuilder *metadata);
static TrackerExtractData data[] = {
{ "audio/vnd.rn-realaudio", extract_gstreamer_helix_audio },
@@ -856,7 +857,7 @@ extract_gstreamer_helix_video (const gchar *uri, TrackerSparqlBuilder *metadata)
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return data;
}
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index ea131ae..213d44f 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -40,8 +40,9 @@ long long int llroundl(long double x);
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-utils.h>
+#include <libtracker-extract/tracker-extract.h>
+
#include "tracker-albumart.h"
-#include "tracker-main.h"
#include "tracker-dbus.h"
/* We wait this long (seconds) for NULL state before freeing */
@@ -122,10 +123,14 @@ typedef struct {
} MetadataExtractor;
-static void extract_gstreamer_audio (const gchar *uri, TrackerSparqlBuilder *metadata);
-static void extract_gstreamer_video (const gchar *uri, TrackerSparqlBuilder *metadata);
-static void extract_gstreamer_image (const gchar *uri, TrackerSparqlBuilder *metadata);
-static void extract_gstreamer_3gpp (const gchar *uri, TrackerSparqlBuilder *metadata);
+static void extract_gstreamer_audio (const gchar *uri,
+ TrackerSparqlBuilder *metadata);
+static void extract_gstreamer_video (const gchar *uri,
+ TrackerSparqlBuilder *metadata);
+static void extract_gstreamer_image (const gchar *uri,
+ TrackerSparqlBuilder *metadata);
+static void extract_gstreamer_3gpp (const gchar *uri,
+ TrackerSparqlBuilder *metadata);
static TrackerExtractData data[] = {
{ "audio/*", extract_gstreamer_audio },
@@ -1008,7 +1013,7 @@ extract_gstreamer_3gpp (const gchar *uri, TrackerSparqlBuilder *metadata)
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return data;
}
diff --git a/src/tracker-extract/tracker-extract-html.c b/src/tracker-extract/tracker-extract-html.c
index 2111ec5..c8dceaf 100644
--- a/src/tracker-extract/tracker-extract-html.c
+++ b/src/tracker-extract/tracker-extract-html.c
@@ -21,15 +21,15 @@
#include "config.h"
#include <string.h>
+
#include <glib.h>
#include <libxml/HTMLparser.h>
-#include <libtracker-common/tracker-statement-list.h>
-
-#include "tracker-main.h"
#include <libtracker-common/tracker-ontology.h>
+#include <libtracker-extract/tracker-extract.h>
+
#define RDF_TYPE TRACKER_RDF_PREFIX "type"
typedef enum {
@@ -255,7 +255,7 @@ extract_html (const gchar *uri,
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return data;
}
diff --git a/src/tracker-extract/tracker-extract-imagemagick.c b/src/tracker-extract/tracker-extract-imagemagick.c
index a3c41bd..d065dec 100644
--- a/src/tracker-extract/tracker-extract-imagemagick.c
+++ b/src/tracker-extract/tracker-extract-imagemagick.c
@@ -28,10 +28,9 @@
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-os-dependant.h>
-#include <libtracker-common/tracker-statement-list.h>
-#include "tracker-main.h"
-#include "tracker-xmp.h"
+#include <libtracker-extract/tracker-extract.h>
+#include <libtracker-extract/tracker-xmp.h>
#define NMM_PREFIX TRACKER_NMM_PREFIX
#define NFO_PREFIX TRACKER_NFO_PREFIX
@@ -131,7 +130,7 @@ extract_imagemagick (const gchar *uri,
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return data;
}
diff --git a/src/tracker-extract/tracker-extract-jpeg.c b/src/tracker-extract/tracker-extract-jpeg.c
index daca15d..a2dc6a7 100644
--- a/src/tracker-extract/tracker-extract-jpeg.c
+++ b/src/tracker-extract/tracker-extract-jpeg.c
@@ -43,10 +43,10 @@
#include <libtracker-common/tracker-file-utils.h>
#include <libtracker-common/tracker-ontology.h>
-#include <libtracker-common/tracker-statement-list.h>
#include <libtracker-common/tracker-type-utils.h>
#include <libtracker-common/tracker-utils.h>
+#include <libtracker-extract/tracker-extract.h>
#include <libtracker-extract/tracker-xmp.h>
#include <libtracker-extract/tracker-iptc.h>
#include <libtracker-extract/tracker-exif.h>
@@ -592,7 +592,7 @@ extract_jpeg (const gchar *uri,
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return data;
}
diff --git a/src/tracker-extract/tracker-extract-libxine.c b/src/tracker-extract/tracker-extract-libxine.c
index bd274e0..47d5abc 100644
--- a/src/tracker-extract/tracker-extract-libxine.c
+++ b/src/tracker-extract/tracker-extract-libxine.c
@@ -20,12 +20,13 @@
#include "config.h"
#include <xine.h>
+
#include <glib.h>
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-utils.h>
-#include "tracker-main.h"
+#include <libtracker-extract/tracker-extract.h>
#define NMM_PREFIX TRACKER_NMM_PREFIX
#define NFO_PREFIX TRACKER_NFO_PREFIX
@@ -266,16 +267,14 @@ endofit:
xine_exit (xine_base);
}
-
TrackerExtractData data[] = {
{ "audio/*", tracker_extract_xine },
{ "video/*", tracker_extract_xine },
{ NULL, NULL }
};
-
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return data;
}
diff --git a/src/tracker-extract/tracker-extract-mockup.c b/src/tracker-extract/tracker-extract-mockup.c
index 0194107..57a1979 100644
--- a/src/tracker-extract/tracker-extract-mockup.c
+++ b/src/tracker-extract/tracker-extract-mockup.c
@@ -19,9 +19,7 @@
#include "config.h"
-#include <libtracker-common/tracker-statement-list.h>
-
-#include "tracker-main.h"
+#include <libtracker-extract/tracker-extract.h>
static void extract_mockup (const gchar *uri,
TrackerSparqlBuilder *metadata);
@@ -90,7 +88,7 @@ extract_mockup (const gchar *uri,
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return data;
}
diff --git a/src/tracker-extract/tracker-extract-mp3.c b/src/tracker-extract/tracker-extract-mp3.c
index cf16cfb..37f0654 100644
--- a/src/tracker-extract/tracker-extract-mp3.c
+++ b/src/tracker-extract/tracker-extract-mp3.c
@@ -44,13 +44,13 @@
#endif
#include <libtracker-common/tracker-file-utils.h>
-#include <libtracker-common/tracker-statement-list.h>
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-utils.h>
#include <libtracker-common/tracker-type-utils.h>
+#include <libtracker-extract/tracker-extract.h>
+
#include "tracker-albumart.h"
-#include "tracker-main.h"
#include "tracker-dbus.h"
/* We mmap the beginning of the file and read separately the last 128
@@ -172,7 +172,7 @@ typedef struct {
id3v2tag id3v24;
} MP3Data;
-static void extract_mp3 (const gchar *filename,
+static void extract_mp3 (const gchar *uri,
TrackerSparqlBuilder *metadata);
enum {
@@ -2101,7 +2101,7 @@ extract_mp3 (const gchar *uri,
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return extract_data;
}
diff --git a/src/tracker-extract/tracker-extract-mplayer.c b/src/tracker-extract/tracker-extract-mplayer.c
index daffaff..3290a35 100644
--- a/src/tracker-extract/tracker-extract-mplayer.c
+++ b/src/tracker-extract/tracker-extract-mplayer.c
@@ -29,7 +29,7 @@
#include <libtracker-common/tracker-os-dependant.h>
#include <libtracker-common/tracker-utils.h>
-#include "tracker-main.h"
+#include <libtracker-extract/tracker-extract.h>
#define NMM_PREFIX TRACKER_NMM_PREFIX
#define NFO_PREFIX TRACKER_NFO_PREFIX
@@ -40,8 +40,8 @@
#define RDF_PREFIX TRACKER_RDF_PREFIX
#define RDF_TYPE RDF_PREFIX "type"
-static void extract_mplayer (const gchar *uri,
- TrackerSparqlBuilder *metadata);
+static void extract_mplayer (const gchar *uri,
+ TrackerSparqlBuilder *metadata);
static TrackerExtractData extract_data[] = {
{ "audio/*", extract_mplayer },
@@ -300,7 +300,7 @@ extract_mplayer (const gchar *uri,
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return extract_data;
}
diff --git a/src/tracker-extract/tracker-extract-msoffice.c b/src/tracker-extract/tracker-extract-msoffice.c
index cb69b79..2d33eeb 100644
--- a/src/tracker-extract/tracker-extract-msoffice.c
+++ b/src/tracker-extract/tracker-extract-msoffice.c
@@ -34,9 +34,10 @@
#include <gsf/gsf-utils.h>
#include <libtracker-common/tracker-utils.h>
-
#include <libtracker-common/tracker-ontology.h>
+#include <libtracker-extract/tracker-extract.h>
+
#include "tracker-main.h"
#ifdef HAVE_LIBWV2
@@ -85,10 +86,8 @@
#define SLIDELISTWITHTEXT_RECORD_TYPE 0x0FF0
-
-static void extract_msoffice (const gchar *uri,
- TrackerSparqlBuilder *metadata);
-
+static void extract_msoffice (const gchar *uri,
+ TrackerSparqlBuilder *metadata);
static void extract_powerpoint (const gchar *uri,
TrackerSparqlBuilder *metadata);
@@ -850,7 +849,7 @@ extract_powerpoint (const gchar *uri,
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return data;
}
diff --git a/src/tracker-extract/tracker-extract-oasis.c b/src/tracker-extract/tracker-extract-oasis.c
index 363c1f3..1241912 100644
--- a/src/tracker-extract/tracker-extract-oasis.c
+++ b/src/tracker-extract/tracker-extract-oasis.c
@@ -27,6 +27,8 @@
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-utils.h>
+#include <libtracker-extract/tracker-extract.h>
+
#include "tracker-main.h"
#define NIE_PREFIX TRACKER_NIE_PREFIX
@@ -53,23 +55,23 @@ typedef struct {
const gchar *uri;
} ODTParseInfo;
-static void start_element_handler (GMarkupParseContext *context,
- const gchar *element_name,
- const gchar **attribute_names,
- const gchar **attribute_values,
- gpointer user_data,
- GError **error);
-static void end_element_handler (GMarkupParseContext *context,
- const gchar *element_name,
- gpointer user_data,
- GError **error);
-static void text_handler (GMarkupParseContext *context,
- const gchar *text,
- gsize text_len,
- gpointer user_data,
- GError **error);
-static void extract_oasis (const gchar *filename,
- TrackerSparqlBuilder *metadata);
+static void start_element_handler (GMarkupParseContext *context,
+ const gchar *element_name,
+ const gchar **attribute_names,
+ const gchar **attribute_values,
+ gpointer user_data,
+ GError **error);
+static void end_element_handler (GMarkupParseContext *context,
+ const gchar *element_name,
+ gpointer user_data,
+ GError **error);
+static void text_handler (GMarkupParseContext *context,
+ const gchar *text,
+ gsize text_len,
+ gpointer user_data,
+ GError **error);
+static void extract_oasis (const gchar *filename,
+ TrackerSparqlBuilder *metadata);
static TrackerExtractData extract_data[] = {
{ "application/vnd.oasis.opendocument.*", extract_oasis },
@@ -294,7 +296,7 @@ text_handler (GMarkupParseContext *context,
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return extract_data;
}
diff --git a/src/tracker-extract/tracker-extract-pdf.c b/src/tracker-extract/tracker-extract-pdf.c
index fbc60a6..3b9cfc5 100644
--- a/src/tracker-extract/tracker-extract-pdf.c
+++ b/src/tracker-extract/tracker-extract-pdf.c
@@ -25,12 +25,12 @@
#include <glib.h>
#include <poppler.h>
-#include <libtracker-common/tracker-statement-list.h>
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-type-utils.h>
#include <libtracker-common/tracker-utils.h>
#include <libtracker-common/tracker-type-utils.h>
+#include <libtracker-extract/tracker-extract.h>
#include <libtracker-extract/tracker-xmp.h>
#include "tracker-main.h"
@@ -463,7 +463,7 @@ extract_pdf (const gchar *uri,
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return data;
}
diff --git a/src/tracker-extract/tracker-extract-playlist.c b/src/tracker-extract/tracker-extract-playlist.c
index e7326aa..92ea002 100644
--- a/src/tracker-extract/tracker-extract-playlist.c
+++ b/src/tracker-extract/tracker-extract-playlist.c
@@ -26,14 +26,16 @@
#include <string.h>
#include <stdlib.h>
+
#include <glib.h>
#include <glib/gstdio.h>
#include <gio/gio.h>
#include <totem-pl-parser.h>
+
#include <libtracker-common/tracker-ontology.h>
-#include "tracker-main.h"
+#include <libtracker-extract/tracker-extract.h>
#define PLAYLIST_PROPERTY_NO_TRACKS "entryCounter"
#define PLAYLIST_PROPERTY_DURATION "listDuration"
@@ -51,15 +53,14 @@
#define RDF_TYPE RDF_PREFIX "type"
typedef struct {
- guint32 track_counter;
- gint64 total_time;
- TrackerSparqlBuilder *metadata;
+ guint32 track_counter;
+ gint64 total_time;
+ TrackerSparqlBuilder *metadata;
const gchar *uri;
} PlaylistMetadata;
-static void extract_playlist (const gchar *uri,
- TrackerSparqlBuilder *metadata);
-
+static void extract_playlist (const gchar *uri,
+ TrackerSparqlBuilder *metadata);
static TrackerExtractData playlist_data[] = {
{ "audio/x-mpegurl", extract_playlist },
@@ -174,7 +175,7 @@ extract_playlist (const gchar *uri,
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return playlist_data;
}
diff --git a/src/tracker-extract/tracker-extract-png.c b/src/tracker-extract/tracker-extract-png.c
index cde124b..54986e6 100644
--- a/src/tracker-extract/tracker-extract-png.c
+++ b/src/tracker-extract/tracker-extract-png.c
@@ -41,10 +41,9 @@
#include <libtracker-common/tracker-file-utils.h>
#include <libtracker-common/tracker-utils.h>
+#include <libtracker-extract/tracker-extract.h>
#include <libtracker-extract/tracker-xmp.h>
-#include "tracker-main.h"
-
#define RFC1123_DATE_FORMAT "%d %B %Y %H:%M:%S %z"
#define NMM_PREFIX TRACKER_NMM_PREFIX
@@ -64,9 +63,9 @@ typedef struct {
*creation_time, *title, *disclaimer;
} PngData;
-static gchar *rfc1123_to_iso8601_date (gchar *rfc_date);
-static void extract_png (const gchar *filename,
- TrackerSparqlBuilder *metadata);
+static gchar *rfc1123_to_iso8601_date (gchar *rfc_date);
+static void extract_png (const gchar *filename,
+ TrackerSparqlBuilder *metadata);
static TrackerExtractData data[] = {
{ "image/png", extract_png },
@@ -558,7 +557,7 @@ extract_png (const gchar *uri,
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return data;
}
diff --git a/src/tracker-extract/tracker-extract-ps.c b/src/tracker-extract/tracker-extract-ps.c
index 9690a27..1a8d2e5 100644
--- a/src/tracker-extract/tracker-extract-ps.c
+++ b/src/tracker-extract/tracker-extract-ps.c
@@ -36,10 +36,9 @@
#include <libtracker-common/tracker-file-utils.h>
#include <libtracker-common/tracker-type-utils.h>
#include <libtracker-common/tracker-os-dependant.h>
-#include <libtracker-common/tracker-statement-list.h>
#include <libtracker-common/tracker-ontology.h>
-#include "tracker-main.h"
+#include <libtracker-extract/tracker-extract.h>
#ifndef HAVE_GETLINE
@@ -56,15 +55,15 @@
#endif /* HAVE_GETLINE */
#ifdef USING_UNZIPPSFILES
-static void extract_ps_gz (const gchar *uri,
+static void extract_ps_gz (const gchar *uri,
TrackerSparqlBuilder *metadata);
#endif
-static void extract_ps (const gchar *uri,
+static void extract_ps (const gchar *uri,
TrackerSparqlBuilder *metadata);
static TrackerExtractData data[] = {
#ifdef USING_UNZIPPSFILES
- { "application/x-gzpostscript", extract_ps_gz },
+ { "application/x-gzpostscript", extract_ps_gz },
#endif /* USING_UNZIPPSFILES */
{ "application/postscript", extract_ps },
{ NULL, NULL }
@@ -389,7 +388,7 @@ extract_ps_gz (const gchar *uri,
#endif /* USING_UNZIPPSFILES */
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return data;
}
diff --git a/src/tracker-extract/tracker-extract-text.c b/src/tracker-extract/tracker-extract-text.c
index f1e3a7f..8e222ea 100644
--- a/src/tracker-extract/tracker-extract-text.c
+++ b/src/tracker-extract/tracker-extract-text.c
@@ -23,9 +23,7 @@
#include <glib.h>
-#include <libtracker-common/tracker-statement-list.h>
-
-#include "tracker-main.h"
+#include <libtracker-extract/tracker-extract.h>
#undef TRY_LOCALE_TO_UTF8_CONVERSION
@@ -296,7 +294,7 @@ extract_text (const gchar *uri,
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return data;
}
diff --git a/src/tracker-extract/tracker-extract-tiff.c b/src/tracker-extract/tracker-extract-tiff.c
index 12d1041..51a3fdd 100644
--- a/src/tracker-extract/tracker-extract-tiff.c
+++ b/src/tracker-extract/tracker-extract-tiff.c
@@ -37,12 +37,11 @@
#include <libtracker-common/tracker-file-utils.h>
#include <libtracker-common/tracker-utils.h>
+#include <libtracker-extract/tracker-extract.h>
#include <libtracker-extract/tracker-xmp.h>
#include <libtracker-extract/tracker-iptc.h>
#include <libtracker-extract/tracker-exif.h>
-#include "tracker-main.h"
-
#define EXIF_DATE_FORMAT "%Y:%m:%d %H:%M:%S"
#define NMM_PREFIX TRACKER_NMM_PREFIX
@@ -77,8 +76,8 @@ typedef struct {
*imagewidth, *imagelength, *make, *model, *orientation;
} TiffData;
-static void extract_tiff (const gchar *filename,
- TrackerSparqlBuilder *metadata);
+static void extract_tiff (const gchar *filename,
+ TrackerSparqlBuilder *metadata);
static TrackerExtractData extract_data[] = {
{ "image/tiff", extract_tiff },
@@ -715,7 +714,7 @@ extract_tiff (const gchar *uri, TrackerSparqlBuilder *metadata)
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return extract_data;
}
diff --git a/src/tracker-extract/tracker-extract-totem.c b/src/tracker-extract/tracker-extract-totem.c
index ae0c983..54207ca 100644
--- a/src/tracker-extract/tracker-extract-totem.c
+++ b/src/tracker-extract/tracker-extract-totem.c
@@ -26,7 +26,7 @@
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-utils.h>
-#include "tracker-main.h"
+#include <libtracker-extract/tracker-extract.h>
#define NMM_PREFIX TRACKER_NMM_PREFIX
#define NFO_PREFIX TRACKER_NFO_PREFIX
@@ -53,8 +53,8 @@ static const gchar *tags[][2] = {
{ NULL, NULL }
};
-static void extract_totem (const gchar *uri,
- TrackerSparqlBuilder *metadata);
+static void extract_totem (const gchar *uri,
+ TrackerSparqlBuilder *metadata);
static TrackerExtractData data[] = {
{ "audio/*", extract_totem },
@@ -74,8 +74,8 @@ metadata_write_foreach (gpointer key,
}
static void
-extract_totem (const gchar *uri,
- TrackerSparqlBuilder *metadata)
+extract_totem (const gchar *uri,
+ TrackerSparqlBuilder *metadata)
{
gchar *argv[3];
gchar *totem;
@@ -183,7 +183,7 @@ extract_totem (const gchar *uri,
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return data;
}
diff --git a/src/tracker-extract/tracker-extract-vorbis.c b/src/tracker-extract/tracker-extract-vorbis.c
index b737beb..c3b4b6f 100644
--- a/src/tracker-extract/tracker-extract-vorbis.c
+++ b/src/tracker-extract/tracker-extract-vorbis.c
@@ -31,7 +31,7 @@
#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-utils.h>
-#include "tracker-main.h"
+#include <libtracker-extract/tracker-extract.h>
#define NIE_PREFIX TRACKER_NIE_PREFIX
#define NFO_PREFIX TRACKER_NFO_PREFIX
@@ -358,7 +358,7 @@ extract_vorbis (const char *uri,
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return extract_data;
}
diff --git a/src/tracker-extract/tracker-extract-xmp.c b/src/tracker-extract/tracker-extract-xmp.c
index 7f5740e..3bb6870 100644
--- a/src/tracker-extract/tracker-extract-xmp.c
+++ b/src/tracker-extract/tracker-extract-xmp.c
@@ -27,10 +27,9 @@
#include <libtracker-common/tracker-file-utils.h>
#include <libtracker-common/tracker-utils.h>
+#include <libtracker-extract/tracker-extract.h>
#include <libtracker-extract/tracker-xmp.h>
-#include "tracker-main.h"
-
static void extract_xmp (const gchar *filename,
TrackerSparqlBuilder *metadata);
@@ -166,7 +165,7 @@ extract_xmp (const gchar *uri,
}
TrackerExtractData *
-tracker_get_extract_data (void)
+tracker_extract_get_data (void)
{
return data;
}
diff --git a/src/tracker-extract/tracker-extract.c b/src/tracker-extract/tracker-extract.c
index 113de4e..5a660dc 100644
--- a/src/tracker-extract/tracker-extract.c
+++ b/src/tracker-extract/tracker-extract.c
@@ -26,9 +26,10 @@
#include <gio/gio.h>
#include <libtracker-common/tracker-dbus.h>
-#include <libtracker-common/tracker-sparql-builder.h>
#include <libtracker-common/tracker-log.h>
+#include <libtracker-extract/tracker-extract.h>
+
#include "tracker-dbus.h"
#include "tracker-extract.h"
#include "tracker-main.h"
@@ -183,7 +184,7 @@ tracker_extract_new (gboolean disable_shutdown,
g_module_make_resident (module);
- if (g_module_symbol (module, "tracker_get_extract_data", (gpointer *) &func)) {
+ if (g_module_symbol (module, "tracker_extract_get_data", (gpointer *) &func)) {
ModuleData mdata;
mdata.module = module;
diff --git a/src/tracker-extract/tracker-main.h b/src/tracker-extract/tracker-main.h
index 1d1ca03..2caf6f8 100644
--- a/src/tracker-extract/tracker-main.h
+++ b/src/tracker-extract/tracker-main.h
@@ -21,34 +21,15 @@
#ifndef __TRACKER_MAIN_H__
#define __TRACKER_MAIN_H__
-#include <glib.h>
-
-#include <libtracker-common/tracker-storage.h>
-#include <libtracker-common/tracker-statement-list.h>
#include "tracker-fts-config.h"
G_BEGIN_DECLS
-typedef struct TrackerExtractData TrackerExtractData;
-
-typedef TrackerExtractData * (*TrackerExtractDataFunc)(void);
-
-struct TrackerExtractData {
- const gchar *mime;
-
- void (* extract) (const gchar *path,
- TrackerSparqlBuilder *metadata);
-};
-
-/* This is defined in each extract */
-TrackerExtractData *tracker_get_extract_data (void);
-
/* This is used to not shutdown after the default of 30 seconds if we
* get more work to do.
*/
-void tracker_main_quit_timeout_reset (void);
-
-TrackerFTSConfig *tracker_main_get_fts_config (void);
+void tracker_main_quit_timeout_reset (void);
+TrackerFTSConfig *tracker_main_get_fts_config (void);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]