[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r7538 - in Extractor: . src/main src/plugins
From: |
gnunet |
Subject: |
[GNUnet-SVN] r7538 - in Extractor: . src/main src/plugins |
Date: |
Sun, 10 Aug 2008 15:50:11 -0600 (MDT) |
Author: cyberix
Date: 2008-08-10 15:50:11 -0600 (Sun, 10 Aug 2008)
New Revision: 7538
Added:
Extractor/src/plugins/itextractor.c
Modified:
Extractor/AUTHORS
Extractor/ChangeLog
Extractor/NEWS
Extractor/src/main/extractor.c
Extractor/src/plugins/Makefile.am
Log:
Added it support.
Modified: Extractor/AUTHORS
===================================================================
--- Extractor/AUTHORS 2008-08-10 11:03:29 UTC (rev 7537)
+++ Extractor/AUTHORS 2008-08-10 21:50:11 UTC (rev 7538)
@@ -40,6 +40,7 @@
sid - Toni Ruottu <address@hidden>
nsfe - Toni Ruottu <address@hidden>
applefile - Heikki Lindholm
+it - Toni Ruottu <address@hidden>
General contributors:
Yuri N. Sedunov <address@hidden>
Modified: Extractor/ChangeLog
===================================================================
--- Extractor/ChangeLog 2008-08-10 11:03:29 UTC (rev 7537)
+++ Extractor/ChangeLog 2008-08-10 21:50:11 UTC (rev 7538)
@@ -1,3 +1,6 @@
+Mon Aug 11 00:43:46 EEST 2008
+ Added an IT (Impulse Tracker) plugin.
+
Tue Jul 22 02:51:33 MDT 2008
Changed RPM extractor to use librpm.
Fixed crash in OpenOffice extractor.
Modified: Extractor/NEWS
===================================================================
--- Extractor/NEWS 2008-08-10 11:03:29 UTC (rev 7537)
+++ Extractor/NEWS 2008-08-10 21:50:11 UTC (rev 7538)
@@ -1,3 +1,5 @@
+ Added an IT (Impulse Tracker) plugin.
+
Mon Jun 23 19:05:07 EET 2008
Fixed concurrency issues in plugin (un-)loading by adding locking
around libltdl functions.
Modified: Extractor/src/main/extractor.c
===================================================================
--- Extractor/src/main/extractor.c 2008-08-10 11:03:29 UTC (rev 7537)
+++ Extractor/src/main/extractor.c 2008-08-10 21:50:11 UTC (rev 7538)
@@ -263,7 +263,8 @@
libextractor_asf:\
libextractor_sid:\
libextractor_nsfe:\
-libextractor_nsf"
+libextractor_nsf:\
+libextractor_it"
#define DEFAULT_LIBRARIES MPEGSO EXSO OLESO OGGSO FLACSO QTSO DEFSO
Modified: Extractor/src/plugins/Makefile.am
===================================================================
--- Extractor/src/plugins/Makefile.am 2008-08-10 11:03:29 UTC (rev 7537)
+++ Extractor/src/plugins/Makefile.am 2008-08-10 21:50:11 UTC (rev 7538)
@@ -98,6 +98,7 @@
libextractor_id3v2.la \
libextractor_id3v24.la \
libextractor_id3v23.la \
+ libextractor_it.la \
libextractor_jpeg.la \
libextractor_lower.la \
libextractor_man.la \
@@ -198,6 +199,13 @@
libextractor_id3v24_la_LIBADD = \
libconvert.la
+libextractor_it_la_SOURCES = \
+ itextractor.c
+libextractor_it_la_LDFLAGS = \
+ $(PLUGINFLAGS) $(retaincommand)
+libextractor_it_la_LIBADD = \
+ $(top_builddir)/src/main/libextractor.la
+
libextractor_dvi_la_SOURCES = \
dviextractor.c
libextractor_dvi_la_LDFLAGS = \
Added: Extractor/src/plugins/itextractor.c
===================================================================
--- Extractor/src/plugins/itextractor.c (rev 0)
+++ Extractor/src/plugins/itextractor.c 2008-08-10 21:50:11 UTC (rev 7538)
@@ -0,0 +1,107 @@
+/*
+ * This file is part of libextractor.
+ * (C) 2008 Toni Ruottu
+ *
+ * libextractor 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, or (at your
+ * option) any later version.
+ *
+ * libextractor 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 libextractor; see the file COPYING. If not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "platform.h"
+#include "extractor.h"
+#include "convert.h"
+
+#define HEADER_SIZE 0xD0
+
+struct header
+{
+ char magicid[4];
+ char title[26];
+ char hilight[2];
+ char orders[2];
+ char instruments[2];
+ char samples[2];
+ char patterns[2];
+ char version[2];
+ char compatible[2];
+ char flags[2];
+ char special[2];
+};
+
+
+static struct EXTRACTOR_Keywords *addkword
+ (EXTRACTOR_KeywordList * oldhead,
+ const char *phrase, EXTRACTOR_KeywordType type)
+{
+ EXTRACTOR_KeywordList *keyword;
+
+ keyword = malloc (sizeof (EXTRACTOR_KeywordList));
+ keyword->next = oldhead;
+ keyword->keyword = strdup (phrase);
+ keyword->keywordType = type;
+ return (keyword);
+}
+
+
+/* "extract" keyword from an Impulse Tracker module
+ *
+ * ITTECH.TXT as taken from IT 2.14p5 was used,
+ * while this piece of software was originally
+ * written.
+ *
+ */
+struct EXTRACTOR_Keywords *libextractor_it_extract
+ (const char *filename,
+ char *data, size_t size, struct EXTRACTOR_Keywords *prev)
+{
+ char title[26];
+ char itversion[8];
+ struct header *head;
+
+ /* Check header size */
+
+ if (size < HEADER_SIZE)
+ {
+ return (prev);
+ }
+
+ head = (struct header *) data;
+
+ /* Check "magic" id bytes */
+
+ if (memcmp (head->magicid, "IMPM", 4))
+ {
+ return (prev);
+ }
+
+ /* Mime-type */
+
+ prev = addkword (prev, "audio/x-it", EXTRACTOR_MIMETYPE);
+
+
+ /* Version of Tracker */
+
+ sprintf (itversion, "%d.%d", (head->version[0]& 0x01),head->version[1]);
+ prev = addkword (prev, itversion, EXTRACTOR_FORMAT_VERSION);
+
+ /* Song title */
+
+ memcpy (&title, head->title, 26);
+ title[26] = '\0';
+ prev = addkword (prev, title, EXTRACTOR_TITLE);
+
+ return (prev);
+
+}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r7538 - in Extractor: . src/main src/plugins,
gnunet <=