[tracker/libtracker-extract] libtracker-extract: Added documentation



commit 92a1ceefb2fe6f5cfa9182671d6bfca9f805c8fa
Author: Martyn Russell <martyn lanedo com>
Date:   Wed Jan 20 15:19:23 2010 +0000

    libtracker-extract: Added documentation

 configure.ac                                       |    2 +
 docs/reference/Makefile.am                         |    1 +
 docs/reference/libtracker-extract/Makefile.am      |   58 +++++
 .../libtracker-extract-docs.sgml                   |   43 ++++
 .../libtracker-extract-sections.txt                |   27 +++
 docs/reference/libtracker-extract/version.xml.in   |    1 +
 src/libtracker-extract/tracker-exif.c              |   34 +++
 src/libtracker-extract/tracker-extract.h           |  133 ++++++++++-
 src/libtracker-extract/tracker-iptc.c              |   55 +++++
 src/libtracker-extract/tracker-xmp.c               |  239 ++++++++++++--------
 src/tracker-extract/tracker-extract.c              |    4 +-
 11 files changed, 495 insertions(+), 102 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 136113b..30021da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1647,6 +1647,8 @@ AC_CONFIG_FILES([
 	docs/reference/libtracker-client/version.xml
 	docs/reference/libtracker-common/Makefile
 	docs/reference/libtracker-common/version.xml
+	docs/reference/libtracker-extract/Makefile
+	docs/reference/libtracker-extract/version.xml
 	docs/reference/libtracker-miner/Makefile
 	docs/reference/libtracker-miner/version.xml
 	docs/reference/ontology/Makefile
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index 7ad911f..cbb4fde 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -3,6 +3,7 @@ include $(top_srcdir)/Makefile.decl
 SUBDIRS = 			\
 	libtracker-client	\
 	libtracker-common	\
+	libtracker-extract	\
 	libtracker-miner	\
 	ontology
 
diff --git a/docs/reference/libtracker-extract/Makefile.am b/docs/reference/libtracker-extract/Makefile.am
new file mode 100644
index 0000000..b08b203
--- /dev/null
+++ b/docs/reference/libtracker-extract/Makefile.am
@@ -0,0 +1,58 @@
+include $(top_srcdir)/Makefile.decl
+
+AUTOMAKE_OPTIONS = 1.6
+
+# The name of the module.
+DOC_MODULE = libtracker-extract
+
+# The top-level SGML file.
+DOC_MAIN_SGML_FILE = libtracker-extract-docs.sgml
+
+# Extra options to supply to gtkdoc-scan
+SCAN_OPTIONS=--deprecated-guards="TRACKER_DISABLE_DEPRECATED"
+
+# Extra options to pass to gtkdoc-scangobj
+# SCANGOBJ_OPTIONS=--type-init-func="gtk_type_init(0)" 
+
+# The directory containing the source code. Relative to $(srcdir)
+DOC_SOURCE_DIR = ../../../src/libtracker-extract
+
+# Used for dependencies
+HFILE_GLOB = $(top_srcdir)/src/libtracker-extract/*.h
+CFILE_GLOB = $(top_srcdir)/src/libtracker-extract/*.c
+
+# Header files to ignore when scanning
+IGNORE_HFILES =
+
+# CFLAGS and LDFLAGS for compiling scan program. Only needed
+# if $(DOC_MODULE).types is non-empty.
+INCLUDES = 								\
+	-DTRACKER_COMPILATION						\
+	-I$(top_srcdir)/src						\
+	$(GLIB2_CFLAGS)
+
+GTKDOC_LIBS =								\
+	$(top_builddir)/src/libtracker-extract/libtracker-extract.la \
+	$(top_builddir)/src/libtracker-common/libtracker-common.la	\
+	$(GLIB2_LIBS)
+
+
+# Extra options to supply to gtkdoc-mkdb
+MKDB_OPTIONS = --sgml-mode --output-format=xml
+
+# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE)
+content_files =						\
+	version.xml
+
+expand_content_files =
+
+# Images to copy into HTML directory
+HTML_IMAGES =
+
+# Extra options to supply to gtkdoc-fixref
+FIXXREF_OPTIONS =
+
+include $(top_srcdir)/gtk-doc.make
+
+# Other files to distribute
+EXTRA_DIST += version.xml.in
diff --git a/docs/reference/libtracker-extract/libtracker-extract-docs.sgml b/docs/reference/libtracker-extract/libtracker-extract-docs.sgml
new file mode 100644
index 0000000..cc97e30
--- /dev/null
+++ b/docs/reference/libtracker-extract/libtracker-extract-docs.sgml
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"; [
+<!ENTITY tracker-extract SYSTEM "xml/tracker-extract.xml">
+<!ENTITY tracker-xmp SYSTEM "xml/tracker-xmp.xml">
+<!ENTITY tracker-iptc SYSTEM "xml/tracker-iptc.xml">
+<!ENTITY tracker-exif SYSTEM "xml/tracker-exif.xml">
+<!ENTITY version SYSTEM "version.xml">
+]>
+<book id="index">
+  <bookinfo>
+    <title>Tracker Extract Library Reference Manual</title>
+    <releaseinfo>for libtracker-extract &version;</releaseinfo>
+  </bookinfo>
+
+  <part id="libtracker-extract">
+    <title>Overview</title>
+    <partintro>
+      <para>
+        The libtracker-extract library is the foundation for Tracker
+        metadata extraction of embedded data in files. Tracker comes
+        with extractors written for the most common file types (like
+        MP3, JPEG, PNG, etc.), however, for more special cases, 3rd
+        party applications may want to write their own plugin to
+        extract their own file formats. This documentation describes
+        how to do that.
+      </para>
+      <para>
+      </para>
+    </partintro>
+  </part>
+
+    <chapter>
+      <title>Core</title>
+      &tracker-extract;
+    </chapter>
+    <chapter>
+      <title>Common Embedded Support</title>
+      &tracker-xmp;
+      &tracker-iptc;
+      &tracker-exif;
+    </chapter>
+</book>
diff --git a/docs/reference/libtracker-extract/libtracker-extract-sections.txt b/docs/reference/libtracker-extract/libtracker-extract-sections.txt
new file mode 100644
index 0000000..6dc1fbe
--- /dev/null
+++ b/docs/reference/libtracker-extract/libtracker-extract-sections.txt
@@ -0,0 +1,27 @@
+<SECTION>
+<FILE>tracker-xmp</FILE>
+TrackerXmpData
+tracker_xmp_read
+tracker_xmp_apply
+</SECTION>
+
+<SECTION>
+<FILE>tracker-iptc</FILE>
+TrackerIptcData
+tracker_iptc_read
+</SECTION>
+
+<SECTION>
+<FILE>tracker-extract</FILE>
+TrackerExtractMimeFunc
+TrackerExtractDataFunc
+TrackerExtractData
+tracker_extract_get_data
+</SECTION>
+
+<SECTION>
+<FILE>tracker-exif</FILE>
+TrackerExifData
+tracker_exif_read
+</SECTION>
+
diff --git a/docs/reference/libtracker-extract/libtracker-extract.types b/docs/reference/libtracker-extract/libtracker-extract.types
new file mode 100644
index 0000000..e69de29
diff --git a/docs/reference/libtracker-extract/version.xml.in b/docs/reference/libtracker-extract/version.xml.in
new file mode 100644
index 0000000..c7e1225
--- /dev/null
+++ b/docs/reference/libtracker-extract/version.xml.in
@@ -0,0 +1 @@
+ TRACKER_VERSION@
diff --git a/src/libtracker-extract/tracker-exif.c b/src/libtracker-extract/tracker-exif.c
index 40eff24..ee026e1 100644
--- a/src/libtracker-extract/tracker-exif.c
+++ b/src/libtracker-extract/tracker-exif.c
@@ -39,6 +39,22 @@
 
 #ifndef HAVE_STRCASESTR
 
+/**
+ * SECTION:tracker-exif
+ * @short_description: Exchangeable Image File Format (EXIF)
+ * @stability: Stable
+ * @include: libtracker-extract/tracker-exif.h
+ *
+ * Exchangeable Image File Format (EXIF) is a specification for the
+ * image file format used by digital cameras. The specification uses
+ * the existing JPEG, TIFF Rev. 6.0, and RIFF WAV file formats, with
+ * the addition of specific metadata tags. It is not supported in JPEG
+ * 2000, PNG, or GIF.
+ *
+ * This API is provided to remove code duplication between extractors
+ * using these standards.
+ **/
+
 static gchar *
 strcasestr (const gchar *haystack,
             const gchar *needle)
@@ -299,6 +315,22 @@ get_value (ExifData *exif,
 
 #endif /* HAVE_LIBEXIF */
 
+/**
+ * tracker_exif_read:
+ * @buffer: a chunk of data with exif data in it.
+ * @len: the size of @buffer.
+ * @uri: the URI this is related to.
+ * @data: a pointer to a TrackerExifData struture to populate.
+ *
+ * This function takes @len bytes of @buffer and runs it through the
+ * EXIF library. The result is that @data is populated with the EXIF
+ * data found in @uri.
+ *
+ * Returns: %TRUE if the @data was populated successfully, otherwise
+ * %FALSE is returned.
+ *
+ * Since: 0.8
+ **/
 gboolean
 tracker_exif_read (const unsigned char *buffer,
                    size_t               len,
@@ -310,6 +342,8 @@ tracker_exif_read (const unsigned char *buffer,
 	g_return_val_if_fail (uri != NULL, FALSE);
 	g_return_val_if_fail (data != NULL, FALSE);
 	
+	memset (data, 0, sizeof (TrackerExifData));
+
 #ifdef HAVE_LIBEXIF
 	ExifData *exif;
 
diff --git a/src/libtracker-extract/tracker-extract.h b/src/libtracker-extract/tracker-extract.h
index 49511b0..8036af6 100644
--- a/src/libtracker-extract/tracker-extract.h
+++ b/src/libtracker-extract/tracker-extract.h
@@ -26,18 +26,137 @@
 
 G_BEGIN_DECLS
 
-typedef struct TrackerExtractData TrackerExtractData;
+/**
+ * SECTION:tracker-extract
+ * @short_description: How to use libtracker-extract
+ * @stability: Stable
+ * @include: libtracker-extract/tracker-extract.h
+ *
+ * The libtracker-extract library is the foundation for Tracker
+ * metadata extraction of embedded data in files. 
+ *
+ * Tracker comes with extractors written for the most common file
+ * types (like MP3, JPEG, PNG, etc.), however, for more special cases,
+ * 3rd party applications may want to write their own plugin to
+ * extract their own file formats. This documentation describes how to
+ * do that.
+ *
+ * <example>
+ * <title>Basic extractor example</title>
+ * An example of how to write an extractor to retrieve PNG embedded
+ * metadata. 
+ * <programlisting>
+ *  static void extract_png (const gchar          *filename,
+ *                           TrackerSparqlBuilder *metadata);
+ *  
+ *  /&ast; Set functions to use to extract different mime types. &ast;/
+ *  static TrackerExtractData extract_data[] = {
+ *          { "image/png",  extract_png },
+ *          { "sketch/png", extract_png },
+ *          { NULL, NULL }
+ *  };
+ * 
+ *  static void
+ *  extract_png (const gchar         *uri,
+ *              TrackerSparqlBuilder *metadata)
+ *  {
+ *          goffset size;
+ *          gint height, width;
+ *          gchar *filename = g_filename_from_uri (uri, NULL, NULL);
+ * 
+ *          /&ast; Do data extraction. &ast;/
+ *          height = ...
+ *          width = ...
+ *
+ *          /&ast; Insert data into TrackerSparqlBuilder object. &ast;/
+ *          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, "nfo:width");
+ *          tracker_sparql_builder_object_int64 (metadata, width);
+ *          tracker_sparql_builder_predicate (metadata, "nfo:height");
+ *          tracker_sparql_builder_object_int64 (metadata, height);
+ * 
+ *          g_free (filename);
+ *  }
+ * 
+ *  TrackerExtractData *
+ *  tracker_extract_get_data (void)
+ *  {
+ *          return extract_data;
+ *  }
+ * </programlisting>
+ * </example>
+ *
+ */
+
+
+/**
+ * TrackerExtractMimeFunc:
+ * @uri: a string representing a URI.
+ * @metadata: used to populate with metadata.
+ *
+ * The @metadata is used to populate the extracted metadata from the
+ * file using the #TrackerSparqlBuilder APIs.
+ *
+ * Since: 0.8
+ **/
+typedef void (*TrackerExtractMimeFunc) (const gchar          *uri,
+                                        TrackerSparqlBuilder *metadata);
 
-typedef TrackerExtractData * (*TrackerExtractDataFunc)(void);
+/**
+ * TrackerExtractData:
+ * @mime: a string pointer representing a mime type.
+ * @func: a function to extract extract the data in.
+ *
+ * The @mime is usually in the format of "image/png" for example.
 
-struct TrackerExtractData {
+ * The @func is called by tracker-extract if an extractor plugin
+ * matches the @mime.
+ *
+ * Since: 0.8
+ **/
+typedef struct {
 	const gchar *mime;
+	TrackerExtractMimeFunc func;
+} TrackerExtractData;
 
-	void (* extract) (const gchar *path,
-	                  TrackerSparqlBuilder *metadata);
-};
+/**
+ * TrackerExtractDataFunc:
+ *
+ * This function is used by by tracker-extract to call into each
+ * extractor to get a list of mime type and TrackerExtractMimeFunc
+ * combinations.
+ *
+ * Returns: an array of #TrackerExtractData which must be NULL
+ * terminated and must NOT be freed.
+ *
+ * Since: 0.6
+ **/
+typedef TrackerExtractData * (*TrackerExtractDataFunc) (void);
 
-/* This is defined in each extractor */
+/**
+ * tracker_extract_get_data:
+ *
+ *
+ * This function must be provided by ALL extractors. This is merely
+ * the declaration of the function which must be written by each
+ * extractor. 
+ * 
+ * This is checked by tracker-extract by looking up the symbols for
+ * each plugin and making sure this function exists. This is only
+ * called by tracker-extract if a mime type in any of the
+ * #TrackerExtractData structures returned matches the mime type of
+ * the file being handled.
+ *
+ * Returns: a #TrackerExtractData pointer which should not be freed.
+ * This pointer can be an array of #TrackerExtractData structures
+ * where multiple mime types are supported.
+ *
+ * Since: 0.8
+ */
 TrackerExtractData *tracker_extract_get_data (void);
 
 G_END_DECLS
diff --git a/src/libtracker-extract/tracker-iptc.c b/src/libtracker-extract/tracker-iptc.c
index f0f03d5..b9ac67d 100644
--- a/src/libtracker-extract/tracker-iptc.c
+++ b/src/libtracker-extract/tracker-iptc.c
@@ -34,6 +34,43 @@
 
 #define IPTC_DATE_FORMAT "%Y %m %d"
 
+/**
+ * SECTION:tracker-iptc
+ * @short_description: Information Interchange Model (IIM) /
+ * International Press Telecommunications Council (IPTC)
+ * @stability: Stable
+ * @include: libtracker-extract/tracker-iptc.h
+ *
+ * The Information Interchange Model (IIM) is a file structure and set
+ * of metadata attributes that can be applied to text, images and
+ * other media types. It was developed in the early 1990s by the
+ * International Press Telecommunications Council (IPTC) to expedite
+ * the international exchange of news among newspapers and news
+ * agencies.
+ *
+ * The full IIM specification includes a complex data structure and a
+ * set of metadata definitions.
+ * 
+ * Although IIM was intended for use with all types of news items â??
+ * including simple text articles â?? a subset found broad worldwide
+ * acceptance as the standard embedded metadata used by news and
+ * commercial photographers. Information such as the name of the
+ * photographer, copyright information and the caption or other
+ * description can be embedded either manually or automatically.
+ *
+ * IIM metadata embedded in images are often referred to as "IPTC
+ * headers," and can be easily encoded and decoded by most popular
+ * photo editing software.
+ *
+ * The Extensible Metadata Platform (XMP) has largely superseded IIM's
+ * file structure, but the IIM image attributes are defined in the
+ * IPTC Core schema for XMP and most image manipulation programs keep
+ * the XMP and non-XMP IPTC attributes synchronized.
+ *
+ * This API is provided to remove code duplication between extractors
+ * using these standards.
+ **/
+
 static const gchar *
 fix_iptc_orientation (const gchar *orientation)
 {
@@ -145,6 +182,22 @@ foreach_dataset (IptcDataSet *dataset,
 
 #endif /* HAVE_LIBIPTCDATA */
 
+/**
+ * tracker_iptc_read:
+ * @buffer: a chunk of data with iptc data in it.
+ * @len: the size of @buffer.
+ * @uri: the URI this is related to.
+ * @data: a pointer to a TrackerIptcData struture to populate.
+ *
+ * This function takes @len bytes of @buffer and runs it through the
+ * IPTC library. The result is that @data is populated with the IPTC
+ * data found in @uri.
+ *
+ * Returns: %TRUE if the @data was populated successfully, otherwise
+ * %FALSE is returned.
+ *
+ * Since: 0.8
+ **/
 gboolean
 tracker_iptc_read (const unsigned char *buffer,
                    size_t               len,
@@ -156,6 +209,8 @@ tracker_iptc_read (const unsigned char *buffer,
 	g_return_val_if_fail (uri != NULL, FALSE);
 	g_return_val_if_fail (data != NULL, FALSE);
 
+	memset (data, 0, sizeof (TrackerIptcData));
+
 #ifdef HAVE_LIBIPTCDATA
 	IptcData *iptc;
 
diff --git a/src/libtracker-extract/tracker-xmp.c b/src/libtracker-extract/tracker-xmp.c
index a36cdab..86a9b1d 100644
--- a/src/libtracker-extract/tracker-xmp.c
+++ b/src/libtracker-extract/tracker-xmp.c
@@ -35,6 +35,28 @@
 #include <exempi/xmp.h>
 #include <exempi/xmpconsts.h>
 
+/**
+ * SECTION:tracker-xmp
+ * @short_description: Extensible Metadata Platform (XMP)
+ * @stability: Stable
+ * @include: libtracker-extract/tracker-xmp.h
+ *
+ * The Adobe Extensible Metadata Platform (XMP) is a standard, created
+ * by Adobe Systems Inc., for processing and storing standardized and
+ * proprietary information relating to the contents of a file.
+ *
+ * XMP standardizes the definition, creation, and processing of
+ * extensible metadata. Serialized XMP can be embedded into a
+ * significant number of popular file formats, without breaking their
+ * readability by non-XMP-aware applications. Embedding metadata ("the
+ * truth is in the file") avoids many problems that occur when
+ * metadata is stored separately. XMP is used in PDF, photography and
+ * photo editing applications.
+ *
+ * This API is provided to remove code duplication between extractors
+ * using these standards.
+ **/
+
 static void iterate        (XmpPtr                xmp,
                             XmpIteratorPtr        iter,
                             const gchar          *uri,
@@ -420,6 +442,22 @@ iterate (XmpPtr          xmp,
 
 #endif /* HAVE_EXEMPI */
 
+/**
+ * tracker_xmp_read:
+ * @buffer: a chunk of data with xmp data in it.
+ * @len: the size of @buffer.
+ * @uri: the URI this is related to.
+ * @data: a pointer to a TrackerXmpData structure to populate.
+ *
+ * This function takes @len bytes of @buffer and runs it through the
+ * XMP library. The result is that @data is populated with the XMP
+ * data found in @uri.
+ *
+ * Returns: %TRUE if the @data was populated successfully, otherwise
+ * %FALSE is returned.
+ *
+ * Since: 0.8
+ **/
 gboolean
 tracker_xmp_read (const gchar    *buffer,
                   size_t          len,
@@ -431,6 +469,8 @@ tracker_xmp_read (const gchar    *buffer,
 	g_return_val_if_fail (uri != NULL, FALSE);
 	g_return_val_if_fail (data != NULL, FALSE);
 
+	memset (data, 0, sizeof (TrackerXmpData));
+
 #ifdef HAVE_EXEMPI
 	XmpPtr xmp;
 
@@ -490,31 +530,44 @@ insert_keywords (TrackerSparqlBuilder *metadata,
 	}
 }
 
+/**
+ * tracker_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.
+ *
+ * This function applies all data in @data to @metadata.
+ *
+ * Returns: %TRUE if the @data was applied to @metadata successfully,
+ * otherwise %FALSE is returned.
+ *
+ * Since: 0.8
+ **/
 gboolean
 tracker_xmp_apply (TrackerSparqlBuilder *metadata,
                    const gchar          *uri,
-                   TrackerXmpData       *xmp_data)
+                   TrackerXmpData       *data)
 {
 	g_return_val_if_fail (TRACKER_IS_SPARQL_BUILDER (metadata), FALSE);
 	g_return_val_if_fail (uri != NULL, FALSE);
-	g_return_val_if_fail (xmp_data != NULL, FALSE);
+	g_return_val_if_fail (data != NULL, FALSE);
 
-	if (xmp_data->keywords) {
-		insert_keywords (metadata, uri, xmp_data->keywords);
-		g_free (xmp_data->keywords);
+	if (data->keywords) {
+		insert_keywords (metadata, uri, data->keywords);
+		g_free (data->keywords);
 	}
 
-	if (xmp_data->subject) {
-		insert_keywords (metadata, uri, xmp_data->subject);
-		g_free (xmp_data->subject);
+	if (data->subject) {
+		insert_keywords (metadata, uri, data->subject);
+		g_free (data->subject);
 	}
 
-	if (xmp_data->pdf_keywords) {
-		insert_keywords (metadata, uri, xmp_data->pdf_keywords);
-		g_free (xmp_data->pdf_keywords);
+	if (data->pdf_keywords) {
+		insert_keywords (metadata, uri, data->pdf_keywords);
+		g_free (data->pdf_keywords);
 	}
 
-	if (xmp_data->publisher) {
+	if (data->publisher) {
 		tracker_sparql_builder_predicate (metadata, "nco:publisher");
 
 		tracker_sparql_builder_object_blank_open (metadata);
@@ -522,115 +575,115 @@ tracker_xmp_apply (TrackerSparqlBuilder *metadata,
 		tracker_sparql_builder_object (metadata, "nco:Contact");
 
 		tracker_sparql_builder_predicate (metadata, "nco:fullname");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->publisher);
+		tracker_sparql_builder_object_unvalidated (metadata, data->publisher);
 		tracker_sparql_builder_object_blank_close (metadata);
-		g_free (xmp_data->publisher);
+		g_free (data->publisher);
 	}
 
-	if (xmp_data->type) {
+	if (data->type) {
 		tracker_sparql_builder_predicate (metadata, "dc:type");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->type);
-		g_free (xmp_data->type);
+		tracker_sparql_builder_object_unvalidated (metadata, data->type);
+		g_free (data->type);
 	}
 
-	if (xmp_data->format) {
+	if (data->format) {
 		tracker_sparql_builder_predicate (metadata, "dc:format");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->format);
-		g_free (xmp_data->format);
+		tracker_sparql_builder_object_unvalidated (metadata, data->format);
+		g_free (data->format);
 	}
 
-	if (xmp_data->identifier) {
+	if (data->identifier) {
 		tracker_sparql_builder_predicate (metadata, "dc:identifier");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->identifier);
-		g_free (xmp_data->identifier);
+		tracker_sparql_builder_object_unvalidated (metadata, data->identifier);
+		g_free (data->identifier);
 	}
 
-	if (xmp_data->source) {
+	if (data->source) {
 		tracker_sparql_builder_predicate (metadata, "dc:source");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->source);
-		g_free (xmp_data->source);
+		tracker_sparql_builder_object_unvalidated (metadata, data->source);
+		g_free (data->source);
 	}
 
-	if (xmp_data->language) {
+	if (data->language) {
 		tracker_sparql_builder_predicate (metadata, "dc:language");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->language);
-		g_free (xmp_data->language);
+		tracker_sparql_builder_object_unvalidated (metadata, data->language);
+		g_free (data->language);
 	}
 
-	if (xmp_data->relation) {
+	if (data->relation) {
 		tracker_sparql_builder_predicate (metadata, "dc:relation");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->relation);
-		g_free (xmp_data->relation);
+		tracker_sparql_builder_object_unvalidated (metadata, data->relation);
+		g_free (data->relation);
 	}
 
-	if (xmp_data->coverage) {
+	if (data->coverage) {
 		tracker_sparql_builder_predicate (metadata, "dc:coverage");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->coverage);
-		g_free (xmp_data->coverage);
+		tracker_sparql_builder_object_unvalidated (metadata, data->coverage);
+		g_free (data->coverage);
 	}
 
-	if (xmp_data->license) {
+	if (data->license) {
 		tracker_sparql_builder_predicate (metadata, "dc:license");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->license);
-		g_free (xmp_data->license);
+		tracker_sparql_builder_object_unvalidated (metadata, data->license);
+		g_free (data->license);
 	}
 
-	if (xmp_data->make || xmp_data->model) {
-		gchar *final_camera = tracker_merge (" ", 2, xmp_data->make, xmp_data->model);
+	if (data->make || data->model) {
+		gchar *final_camera = tracker_merge (" ", 2, data->make, data->model);
 
 		tracker_sparql_builder_predicate (metadata, "nmm:camera");
 		tracker_sparql_builder_object_unvalidated (metadata, final_camera);
 		g_free (final_camera);
 	}
 
-	if (xmp_data->title || xmp_data->title2 || xmp_data->pdf_title) {
-		gchar *final_title = tracker_coalesce (3, xmp_data->title, 
-		                                       xmp_data->title2,
-		                                       xmp_data->pdf_title);
+	if (data->title || data->title2 || data->pdf_title) {
+		gchar *final_title = tracker_coalesce (3, data->title, 
+		                                       data->title2,
+		                                       data->pdf_title);
 		tracker_sparql_builder_predicate (metadata, "nie:title");
 		tracker_sparql_builder_object_unvalidated (metadata, final_title);
 		g_free (final_title);
 	}
 
-	if (xmp_data->orientation) {
+	if (data->orientation) {
 		tracker_sparql_builder_predicate (metadata, "nfo:orientation");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->orientation);
-		g_free (xmp_data->orientation);
+		tracker_sparql_builder_object_unvalidated (metadata, data->orientation);
+		g_free (data->orientation);
 	}
 	
-	if (xmp_data->rights || xmp_data->copyright) {
-		gchar *final_rights = tracker_coalesce (2, xmp_data->copyright, xmp_data->rights);
+	if (data->rights || data->copyright) {
+		gchar *final_rights = tracker_coalesce (2, data->copyright, data->rights);
 		tracker_sparql_builder_predicate (metadata, "nie:copyright");
 		tracker_sparql_builder_object_unvalidated (metadata, final_rights);
 		g_free (final_rights);
 	}
 
-	if (xmp_data->white_balance) {
+	if (data->white_balance) {
 		tracker_sparql_builder_predicate (metadata, "nmm:whiteBalance");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->white_balance);
-		g_free (xmp_data->white_balance);
+		tracker_sparql_builder_object_unvalidated (metadata, data->white_balance);
+		g_free (data->white_balance);
 	}
 
-	if (xmp_data->fnumber) {
+	if (data->fnumber) {
 		tracker_sparql_builder_predicate (metadata, "nmm:fnumber");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->fnumber);
-		g_free (xmp_data->fnumber);
+		tracker_sparql_builder_object_unvalidated (metadata, data->fnumber);
+		g_free (data->fnumber);
 	}
 
-	if (xmp_data->flash) {
+	if (data->flash) {
 		tracker_sparql_builder_predicate (metadata, "nmm:flash");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->flash);
-		g_free (xmp_data->flash);
+		tracker_sparql_builder_object_unvalidated (metadata, data->flash);
+		g_free (data->flash);
 	}
 
-	if (xmp_data->focal_length) {
+	if (data->focal_length) {
 		tracker_sparql_builder_predicate (metadata, "nmm:focalLength");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->focal_length);
-		g_free (xmp_data->focal_length);
+		tracker_sparql_builder_object_unvalidated (metadata, data->focal_length);
+		g_free (data->focal_length);
 	}
 
-	if (xmp_data->artist || xmp_data->contributor) {
-		gchar *final_artist = tracker_coalesce (2, xmp_data->artist, xmp_data->contributor);
+	if (data->artist || data->contributor) {
+		gchar *final_artist = tracker_coalesce (2, data->artist, data->contributor);
 
 		tracker_sparql_builder_predicate (metadata, "nco:contributor");
 
@@ -644,38 +697,38 @@ tracker_xmp_apply (TrackerSparqlBuilder *metadata,
 		g_free (final_artist);
 	}
 
-	if (xmp_data->exposure_time) {
+	if (data->exposure_time) {
 		tracker_sparql_builder_predicate (metadata, "nmm:exposureTime");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->exposure_time);
-		g_free (xmp_data->exposure_time);
+		tracker_sparql_builder_object_unvalidated (metadata, data->exposure_time);
+		g_free (data->exposure_time);
 	}
 
-	if (xmp_data->iso_speed_ratings) {
+	if (data->iso_speed_ratings) {
 		tracker_sparql_builder_predicate (metadata, "nmm:isoSpeed");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->iso_speed_ratings);
-		g_free (xmp_data->iso_speed_ratings);
+		tracker_sparql_builder_object_unvalidated (metadata, data->iso_speed_ratings);
+		g_free (data->iso_speed_ratings);
 	}
 
-	if (xmp_data->date || xmp_data->time_original) {
-		gchar *final_date = tracker_coalesce (2, xmp_data->date, xmp_data->time_original);
+	if (data->date || data->time_original) {
+		gchar *final_date = tracker_coalesce (2, data->date, data->time_original);
 		tracker_sparql_builder_predicate (metadata, "nie:contentCreated");
 		tracker_sparql_builder_object_unvalidated (metadata, final_date);
 		g_free (final_date);
 	}
 
-	if (xmp_data->description) {
+	if (data->description) {
 		tracker_sparql_builder_predicate (metadata, "nie:description");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->description);
-		g_free (xmp_data->description);
+		tracker_sparql_builder_object_unvalidated (metadata, data->description);
+		g_free (data->description);
 	}
 
-	if (xmp_data->metering_mode) {
+	if (data->metering_mode) {
 		tracker_sparql_builder_predicate (metadata, "nmm:meteringMode");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->metering_mode);
-		g_free (xmp_data->metering_mode);
+		tracker_sparql_builder_object_unvalidated (metadata, data->metering_mode);
+		g_free (data->metering_mode);
 	}
 
-	if (xmp_data->creator) {
+	if (data->creator) {
 		tracker_sparql_builder_predicate (metadata, "nco:creator");
 
 		tracker_sparql_builder_object_blank_open (metadata);
@@ -683,40 +736,40 @@ tracker_xmp_apply (TrackerSparqlBuilder *metadata,
 		tracker_sparql_builder_object (metadata, "nco:Contact");
 
 		tracker_sparql_builder_predicate (metadata, "nco:fullname");
-		tracker_sparql_builder_object_unvalidated (metadata, xmp_data->creator);
+		tracker_sparql_builder_object_unvalidated (metadata, data->creator);
 		tracker_sparql_builder_object_blank_close (metadata);
-		g_free (xmp_data->creator);
+		g_free (data->creator);
 	}
 
-	if (xmp_data->address || xmp_data->country || xmp_data->city) {
+	if (data->address || data->country || data->city) {
 		tracker_sparql_builder_predicate (metadata, "mlo:location");
 
 		tracker_sparql_builder_object_blank_open (metadata);
 		tracker_sparql_builder_predicate (metadata, "a");
 		tracker_sparql_builder_object (metadata, "mlo:GeoPoint");
 
-		if (xmp_data->address) {
+		if (data->address) {
 			tracker_sparql_builder_predicate (metadata, "mlo:address");
-			tracker_sparql_builder_object_unvalidated (metadata, xmp_data->address);
-			g_free (xmp_data->address);
+			tracker_sparql_builder_object_unvalidated (metadata, data->address);
+			g_free (data->address);
 		}
 
-		if (xmp_data->state) {
+		if (data->state) {
 			tracker_sparql_builder_predicate (metadata, "mlo:state");
-			tracker_sparql_builder_object_unvalidated (metadata, xmp_data->state);
-			g_free (xmp_data->state);
+			tracker_sparql_builder_object_unvalidated (metadata, data->state);
+			g_free (data->state);
 		}
 
-		if (xmp_data->city) {
+		if (data->city) {
 			tracker_sparql_builder_predicate (metadata, "mlo:city");
-			tracker_sparql_builder_object_unvalidated (metadata, xmp_data->city);
-			g_free (xmp_data->city);
+			tracker_sparql_builder_object_unvalidated (metadata, data->city);
+			g_free (data->city);
 		}
 
-		if (xmp_data->country) {
+		if (data->country) {
 			tracker_sparql_builder_predicate (metadata, "mlo:country");
-			tracker_sparql_builder_object_unvalidated (metadata, xmp_data->country);
-			g_free (xmp_data->country);
+			tracker_sparql_builder_object_unvalidated (metadata, data->country);
+			g_free (data->country);
 		}
 	
 		tracker_sparql_builder_object_blank_close (metadata);
diff --git a/src/tracker-extract/tracker-extract.c b/src/tracker-extract/tracker-extract.c
index 5a660dc..4cea8bf 100644
--- a/src/tracker-extract/tracker-extract.c
+++ b/src/tracker-extract/tracker-extract.c
@@ -338,7 +338,7 @@ get_file_metadata (TrackerExtract        *extract,
 				                              "  Extracting with module:'%s'",
 				                              g_module_name ((GModule*) mdata.module));
 
-				(*edata->extract) (uri, statements);
+				(*edata->func) (uri, statements);
 
 				items = tracker_sparql_builder_get_length (statements);
 
@@ -373,7 +373,7 @@ get_file_metadata (TrackerExtract        *extract,
 				                              "  Extracting with module:'%s'",
 				                              g_module_name ((GModule*) mdata.module));
 
-				(*edata->extract) (uri, statements);
+				(*edata->func) (uri, statements);
 
 				items = tracker_sparql_builder_get_length (statements);
 



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