commit 9566b169bbab191091d5364acc17dc0aa649fc14
parent 7ca5bf3eae99cb0658c5ddaf6a34a68cbcef41c6
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 8 Aug 2005 19:16:47 +0000
addKeyword2
Diffstat:
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,6 @@
+Mon Aug 8 12:18:44 PDT 2005
+ Somehow addKeyword2 got lost. Added (again?).
+
Thu Jul 14 18:52:17 CEST 2005
Bugfixes in exiv2 extractor fixing remaining issues.
Changed plugins to not use filename but always only
diff --git a/src/main/extractor.c b/src/main/extractor.c
@@ -663,6 +663,38 @@ EXTRACTOR_getKeywords (EXTRACTOR_ExtractorList * extractor,
return result;
}
+
+
+/**
+ * Extract keywords from a buffer in memory
+ * using the available extractors.
+ *
+ * @param extractor the list of extractor libraries
+ * @param data the data of the file
+ * @param size the number of bytes in data
+ * @return the list of keywords found in the file, NULL if none
+ * were found (or other errors)
+ */
+EXTRACTOR_KeywordList *
+EXTRACTOR_getKeywords2(EXTRACTOR_ExtractorList * extractor,
+ const char * data,
+ size_t size) {
+ EXTRACTOR_KeywordList * result;
+
+ if (data == NULL)
+ return NULL;
+ result = NULL;
+ while (extractor != NULL) {
+ result = extractor->extractMethod(NULL,
+ (char*)data,
+ size,
+ result,
+ extractor->options);
+ extractor = extractor->next;
+ }
+ return result;
+}
+
static void
removeKeyword (const char *keyword,
const EXTRACTOR_KeywordType type,
@@ -926,7 +958,6 @@ char * EXTRACTOR_binaryEncode(const char * data,
size_t i;
unsigned int markers[8]; /* 256 bits */
unsigned char marker;
- char * format;
/* encode! */
binary = malloc(2 + size + (size+256) / 254);