libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit 139bb26e01a47d74c30541b2d7fd54c32ebc169f
parent f398e8df86a54ab97e0b4c29fb200942c723e066
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 16 Dec 2005 08:48:57 +0000

split

Diffstat:
Msrc/include/extractor.h | 3++-
Msrc/main/extractor.c | 3++-
Msrc/plugins/splitextractor.c | 36++++++++++++++++++------------------
3 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/src/include/extractor.h b/src/include/extractor.h @@ -29,7 +29,7 @@ extern "C" { * 0.2.6-1 => 0x00020601 * 4.5.2-0 => 0x04050200 */ -#define EXTRACTOR_VERSION 0x00050600 +#define EXTRACTOR_VERSION 0x00050801 #include <stdio.h> @@ -139,6 +139,7 @@ typedef enum { EXTRACTOR_WHITE_BALANCE = 86, EXTRACTOR_ORIENTATION = 87, EXTRACTOR_TEMPLATE = 88, + EXTRACTOR_SPLIT = 89, } EXTRACTOR_KeywordType; /** diff --git a/src/main/extractor.c b/src/main/extractor.c @@ -130,11 +130,12 @@ static const char *keywordTypes[] = { gettext_noop("white balance"), gettext_noop("orientation"), gettext_noop("template"), + gettext_noop("split"), NULL, }; /* the number of keyword types (for bounds-checking) */ -#define HIGHEST_TYPE_NUMBER 89 +#define HIGHEST_TYPE_NUMBER 90 #ifdef HAVE_LIBOGG #if HAVE_VORBIS diff --git a/src/plugins/splitextractor.c b/src/plugins/splitextractor.c @@ -25,8 +25,8 @@ static char * TOKENIZERS = "._ ,%@-\n_[](){}"; static int MINIMUM_KEYWORD_LENGTH = 4; static void addKeyword(struct EXTRACTOR_Keywords ** list, - char * keyword, - EXTRACTOR_KeywordType type) { + const char * keyword, + EXTRACTOR_KeywordType type) { EXTRACTOR_KeywordList * next; next = malloc(sizeof(EXTRACTOR_KeywordList)); next->next = *list; @@ -36,21 +36,21 @@ static void addKeyword(struct EXTRACTOR_Keywords ** list, } static int token(char letter, - const char * options) { + const char * options) { int i; - - if (options == NULL) - options = TOKENIZERS; + + if (options == NULL) + options = TOKENIZERS; for (i=0;i<strlen(TOKENIZERS);i++) if (letter == TOKENIZERS[i]) return 1; return 0; } -static void splitKeywords(char * keyword, - EXTRACTOR_KeywordType type, - struct EXTRACTOR_Keywords ** list, - const char * options) { +static void splitKeywords(const char * keyword, + EXTRACTOR_KeywordType type, + struct EXTRACTOR_Keywords ** list, + const char * options) { char * dp; int pos; int last; @@ -75,19 +75,19 @@ static void splitKeywords(char * keyword, /* split other keywords into multiple keywords */ struct EXTRACTOR_Keywords * -libextractor_split_extract(char * filename, - char * data, - size_t size, - struct EXTRACTOR_Keywords * prev, - const char * options) { +libextractor_split_extract(const char * filename, + const char * data, + size_t size, + struct EXTRACTOR_Keywords * prev, + const char * options) { struct EXTRACTOR_Keywords * pos; pos = prev; while (pos != NULL) { splitKeywords(pos->keyword, - EXTRACTOR_UNKNOWN, - &prev, - options); + EXTRACTOR_SPLIT, + &prev, + options); pos = pos->next; } return prev;