diff options
author | David Barksdale <amatus.amongus@gmail.com> | 2013-06-12 23:01:09 -0500 |
---|---|---|
committer | David Barksdale <amatus.amongus@gmail.com> | 2013-06-12 23:01:09 -0500 |
commit | d5ff48456d5ca9d16aebb2e0bc590a308641a853 (patch) | |
tree | 3babc00ed1fcd0dde12dbe801ebe477b8d740c0f | |
parent | 0a0f6a965b4fc6833769b02b2fcdf3e945001654 (diff) |
Added fake libextractor.
Porting libextractor to emscripten will be done later.
I didn't want to make it optional in GNUnet so now we
have a libextractor stub.
-rwxr-xr-x | build-gnunet.sh | 12 | ||||
-rw-r--r-- | fake-extractor/Makefile | 10 | ||||
-rw-r--r-- | fake-extractor/extractor.c | 168 | ||||
-rw-r--r-- | fake-extractor/extractor.h | 661 | ||||
-rw-r--r-- | fake-extractor/extractor_metatypes.c | 607 | ||||
-rw-r--r-- | fake-extractor/libextractor.so | bin | 0 -> 25916 bytes |
6 files changed, 1456 insertions, 2 deletions
diff --git a/build-gnunet.sh b/build-gnunet.sh index 8e5af98..1bfa72d 100755 --- a/build-gnunet.sh +++ b/build-gnunet.sh @@ -127,6 +127,13 @@ emmake make install || die "Unable to install zlib" popd +# Build fake libextractor +pushd fake-extractor +emmake make || + die "Unable to make fake libextractor" +emmake make install DESTDIR="$SYSROOT" || + die "Unable to install fake libextractor" + # Build GNUnet GNUNET_URL=https://gnunet.org/svn/gnunet if ! [ -d "downloads/gnunet" ]; then @@ -138,13 +145,14 @@ pushd gnunet cp -r ../downloads/gnunet gnunet || die "Unable to copy GNUnet repository" cd gnunet -./bootstrap +./bootstrap || + die "Unable to bootstrap GNUnet" EMCONFIGURE_JS=1 emconfigure ./configure --prefix="$SYSROOT" \ --with-libgcrypt-prefix="$SYSROOT" \ --with-libunistring-prefix="$SYSROOT" \ --with-zlib="$SYSROOT" \ + --with-extractor="$SYSROOT" \ --without-libcurl \ - --without-extractor \ --without-libidn || die "Unable to configure GNUnet" popd diff --git a/fake-extractor/Makefile b/fake-extractor/Makefile new file mode 100644 index 0000000..e56d8eb --- /dev/null +++ b/fake-extractor/Makefile @@ -0,0 +1,10 @@ +all: libextractor.so + +libextractor.so: extractor.c extractor_metatypes.c extractor.h + $(CC) -I. -shared -o $@ extractor.c extractor_metatypes.c + +install: + install -d $(DESTDIR)/include + install extractor.h $(DESTDIR)/include + install -d $(DESTDIR)/lib + install libextractor.so $(DESTDIR)/lib diff --git a/fake-extractor/extractor.c b/fake-extractor/extractor.c new file mode 100644 index 0000000..928486a --- /dev/null +++ b/fake-extractor/extractor.c @@ -0,0 +1,168 @@ +/* + This file is part of fake-extractor. + Copyright (C) 2013 David Barksdale + + fake-extractor 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 3, 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 <extractor.h> + +/** + * Load the default set of plugins. The default can be changed + * by setting the LIBEXTRACTOR_LIBRARIES environment variable; + * If it is set to "env", then this function will return + * EXTRACTOR_plugin_add_config (NULL, env, flags). + * + * If LIBEXTRACTOR_LIBRARIES is not set, the function will attempt + * to locate the installed plugins and load all of them. + * The directory where the code will search for plugins is typically + * automatically determined; it can be specified explicitly using the + * "LIBEXTRACTOR_PREFIX" environment variable. + * + * This environment variable must be set to the precise directory with + * the plugins (i.e. "/usr/lib/libextractor", not "/usr"). Note that + * setting the environment variable will disable all of the methods + * that are typically used to determine the location of plugins. + * Multiple paths can be specified using ':' to separate them. + * + * @param flags options for all of the plugins loaded + * @return the default set of plugins, NULL if no plugins were found + */ +struct EXTRACTOR_PluginList * +EXTRACTOR_plugin_add_defaults (enum EXTRACTOR_Options flags) +{ + return NULL; +} + + +/** + * Add a library for keyword extraction. + * + * @param prev the previous list of libraries, may be NULL + * @param library the name of the library (short handle, i.e. "mime") + * @param options options to give to the library + * @param flags options to use + * @return the new list of libraries, equal to prev iff an error occured + */ +struct EXTRACTOR_PluginList * +EXTRACTOR_plugin_add (struct EXTRACTOR_PluginList * prev, + const char *library, + const char *options, + enum EXTRACTOR_Options flags) +{ + return prev; +} + + +/** + * Load multiple libraries as specified by the user. + * + * @param config a string given by the user that defines which + * libraries should be loaded. Has the format + * "[[-]LIBRARYNAME[(options)][:[-]LIBRARYNAME[(options)]]]*". + * For example, 'mp3:ogg' loads the + * mp3 and the ogg plugins. The '-' before the LIBRARYNAME + * indicates that the library should be removed from + * the library list. + * @param prev the previous list of libraries, may be NULL + * @param flags options to use + * @return the new list of libraries, equal to prev iff an error occured + * or if config was empty (or NULL). + */ +struct EXTRACTOR_PluginList * +EXTRACTOR_plugin_add_config (struct EXTRACTOR_PluginList *prev, + const char *config, + enum EXTRACTOR_Options flags) +{ + return prev; +} + + +/** + * Remove a plugin from a list. + * + * @param prev the current list of plugins + * @param library the name of the plugin to remove (short handle) + * @return the reduced list, unchanged if the plugin was not loaded + */ +struct EXTRACTOR_PluginList * +EXTRACTOR_plugin_remove (struct EXTRACTOR_PluginList *prev, + const char *library) +{ + return prev; +} + + +/** + * Remove all plugins from the given list (destroys the list). + * + * @param plugin the list of plugins + */ +void +EXTRACTOR_plugin_remove_all (struct EXTRACTOR_PluginList *plugins) +{ +} + + +/** + * Extract keywords from a file using the given set of plugins. + * + * @param plugins the list of plugins to use + * @param filename the name of the file, can be NULL if data is not NULL + * @param data data of the file in memory, can be NULL (in which + * case libextractor will open file) if filename is not NULL + * @param size number of bytes in data, ignored if data is NULL + * @param proc function to call for each meta data item found + * @param proc_cls cls argument to proc + */ +void +EXTRACTOR_extract (struct EXTRACTOR_PluginList *plugins, + const char *filename, + const void *data, + size_t size, + EXTRACTOR_MetaDataProcessor proc, + void *proc_cls) +{ +} + + +/** + * Simple EXTRACTOR_MetaDataProcessor implementation that simply + * prints the extracted meta data to the given file. Only prints + * those keywords that are in UTF-8 format. + * + * @param handle the file to write to (stdout, stderr), must NOT be NULL, + * must be of type "FILE *". + * @param plugin_name name of the plugin that produced this value + * @param type libextractor-type describing the meta data + * @param format basic format information about data + * @param data_mime_type mime-type of data (not of the original file); + * can be NULL (if mime-type is not known) + * @param data actual meta-data found + * @param data_len number of bytes in data + * @return non-zero if printing failed, otherwise 0. + */ +int +EXTRACTOR_meta_data_print (void * handle, + const char *plugin_name, + enum EXTRACTOR_MetaType type, + enum EXTRACTOR_MetaFormat format, + const char *data_mime_type, + const char *data, + size_t data_len) +{ + return 0; +} diff --git a/fake-extractor/extractor.h b/fake-extractor/extractor.h new file mode 100644 index 0000000..67b6f07 --- /dev/null +++ b/fake-extractor/extractor.h @@ -0,0 +1,661 @@ +/* + This file is part of libextractor. + (C) 2002, 2003, 2004, 2005, 2006, 2009, 2012 Vidyut Samanta and Christian Grothoff + + 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 3, 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. + */ + +#ifndef EXTRACTOR_H +#define EXTRACTOR_H + +#ifdef __cplusplus +extern "C" { +#if 0 /* keep Emacsens' auto-indent happy */ +} +#endif +#endif + + +#include <stdint.h> + +/** + * 0.2.6-1 => 0x00020601 + * 4.5.2-0 => 0x04050200 + */ +#define EXTRACTOR_VERSION 0x01000000 + +#include <stdio.h> + + +/** + * Options for how plugin execution should be done. + */ +enum EXTRACTOR_Options + { + + /** + * Run plugin out-of-process, starting the process once the plugin + * is to be run. If a plugin crashes, automatically restart the + * respective process for the same file and try once more + * (since the crash may be caused by the previous file). If + * the process crashes immediately again, it is not restarted + * until the next file. + */ + EXTRACTOR_OPTION_DEFAULT_POLICY = 0, + + /** + * Deprecated option. Ignored. + */ + EXTRACTOR_OPTION_OUT_OF_PROCESS_NO_RESTART = 1, + + /** + * Run plugins in-process. Unsafe, not recommended, + * can be nice for debugging. + */ + EXTRACTOR_OPTION_IN_PROCESS = 2, + + /** + * Internal value for plugins that have been disabled. + */ + EXTRACTOR_OPTION_DISABLED = 3 + + }; + + +/** + * Format in which the extracted meta data is presented. + */ +enum EXTRACTOR_MetaFormat + { + /** + * Format is unknown. + */ + EXTRACTOR_METAFORMAT_UNKNOWN = 0, + + /** + * 0-terminated, UTF-8 encoded string. "data_len" + * is strlen(data)+1. + */ + EXTRACTOR_METAFORMAT_UTF8 = 1, + + /** + * Some kind of binary format, see given Mime type. + */ + EXTRACTOR_METAFORMAT_BINARY = 2, + + /** + * 0-terminated string. The specific encoding is unknown. + * "data_len" is strlen(data)+1. + */ + EXTRACTOR_METAFORMAT_C_STRING = 3 + + }; + + +/** + * Enumeration defining various sources of keywords. See also + * http://dublincore.org/documents/1998/09/dces/ + */ +enum EXTRACTOR_MetaType + { + /* fundamental types */ + EXTRACTOR_METATYPE_RESERVED = 0, + EXTRACTOR_METATYPE_MIMETYPE = 1, + EXTRACTOR_METATYPE_FILENAME = 2, + EXTRACTOR_METATYPE_COMMENT = 3, + + /* Standard types from bibtex */ + EXTRACTOR_METATYPE_TITLE = 4, + EXTRACTOR_METATYPE_BOOK_TITLE = 5, + EXTRACTOR_METATYPE_BOOK_EDITION = 6, + EXTRACTOR_METATYPE_BOOK_CHAPTER_NUMBER = 7, + EXTRACTOR_METATYPE_JOURNAL_NAME = 8, + EXTRACTOR_METATYPE_JOURNAL_VOLUME = 9, + EXTRACTOR_METATYPE_JOURNAL_NUMBER = 10, + EXTRACTOR_METATYPE_PAGE_COUNT = 11, + EXTRACTOR_METATYPE_PAGE_RANGE = 12, + EXTRACTOR_METATYPE_AUTHOR_NAME = 13, + EXTRACTOR_METATYPE_AUTHOR_EMAIL = 14, + EXTRACTOR_METATYPE_AUTHOR_INSTITUTION = 15, + EXTRACTOR_METATYPE_PUBLISHER = 16, + EXTRACTOR_METATYPE_PUBLISHER_ADDRESS = 17, + EXTRACTOR_METATYPE_PUBLISHER_INSTITUTION = 18, + EXTRACTOR_METATYPE_PUBLISHER_SERIES = 19, + EXTRACTOR_METATYPE_PUBLICATION_TYPE = 20, + EXTRACTOR_METATYPE_PUBLICATION_YEAR = 21, + EXTRACTOR_METATYPE_PUBLICATION_MONTH = 22, + EXTRACTOR_METATYPE_PUBLICATION_DAY = 23, + EXTRACTOR_METATYPE_PUBLICATION_DATE = 24, + EXTRACTOR_METATYPE_BIBTEX_EPRINT = 25, + EXTRACTOR_METATYPE_BIBTEX_ENTRY_TYPE = 26, + EXTRACTOR_METATYPE_LANGUAGE = 27, + EXTRACTOR_METATYPE_CREATION_TIME = 28, + EXTRACTOR_METATYPE_URL = 29, + + /* "unique" document identifiers */ + EXTRACTOR_METATYPE_URI = 30, + EXTRACTOR_METATYPE_ISRC = 31, + EXTRACTOR_METATYPE_HASH_MD4 = 32, + EXTRACTOR_METATYPE_HASH_MD5 = 33, + EXTRACTOR_METATYPE_HASH_SHA0 = 34, + EXTRACTOR_METATYPE_HASH_SHA1 = 35, + EXTRACTOR_METATYPE_HASH_RMD160 = 36, + + /* identifiers of a location */ + EXTRACTOR_METATYPE_GPS_LATITUDE_REF = 37, + EXTRACTOR_METATYPE_GPS_LATITUDE = 38, + EXTRACTOR_METATYPE_GPS_LONGITUDE_REF = 39, + EXTRACTOR_METATYPE_GPS_LONGITUDE = 40, + EXTRACTOR_METATYPE_LOCATION_CITY = 41, + EXTRACTOR_METATYPE_LOCATION_SUBLOCATION = 42, + EXTRACTOR_METATYPE_LOCATION_COUNTRY = 43, + EXTRACTOR_METATYPE_LOCATION_COUNTRY_CODE = 44, + + /* generic attributes */ + EXTRACTOR_METATYPE_UNKNOWN = 45, + EXTRACTOR_METATYPE_DESCRIPTION = 46, + EXTRACTOR_METATYPE_COPYRIGHT = 47, + EXTRACTOR_METATYPE_RIGHTS = 48, + EXTRACTOR_METATYPE_KEYWORDS = 49, + EXTRACTOR_METATYPE_ABSTRACT = 50, + EXTRACTOR_METATYPE_SUMMARY = 51, + EXTRACTOR_METATYPE_SUBJECT = 52, + EXTRACTOR_METATYPE_CREATOR = 53, + EXTRACTOR_METATYPE_FORMAT = 54, + EXTRACTOR_METATYPE_FORMAT_VERSION = 55, + + /* processing history */ + EXTRACTOR_METATYPE_CREATED_BY_SOFTWARE = 56, + EXTRACTOR_METATYPE_UNKNOWN_DATE = 57, + EXTRACTOR_METATYPE_CREATION_DATE = 58, + EXTRACTOR_METATYPE_MODIFICATION_DATE = 59, + EXTRACTOR_METATYPE_LAST_PRINTED = 60, + EXTRACTOR_METATYPE_LAST_SAVED_BY = 61, + EXTRACTOR_METATYPE_TOTAL_EDITING_TIME = 62, + EXTRACTOR_METATYPE_EDITING_CYCLES = 63, + EXTRACTOR_METATYPE_MODIFIED_BY_SOFTWARE = 64, + EXTRACTOR_METATYPE_REVISION_HISTORY = 65, + + EXTRACTOR_METATYPE_EMBEDDED_FILE_SIZE = 66, + EXTRACTOR_METATYPE_FINDER_FILE_TYPE = 67, + EXTRACTOR_METATYPE_FINDER_FILE_CREATOR = 68, + + /* software package specifics (deb, rpm, tgz, elf) */ + EXTRACTOR_METATYPE_PACKAGE_NAME = 69, + EXTRACTOR_METATYPE_PACKAGE_VERSION = 70, + EXTRACTOR_METATYPE_SECTION = 71, + EXTRACTOR_METATYPE_UPLOAD_PRIORITY = 72, + EXTRACTOR_METATYPE_PACKAGE_DEPENDENCY = 73, + EXTRACTOR_METATYPE_PACKAGE_CONFLICTS = 74, + EXTRACTOR_METATYPE_PACKAGE_REPLACES = 75, + EXTRACTOR_METATYPE_PACKAGE_PROVIDES = 76, + EXTRACTOR_METATYPE_PACKAGE_RECOMMENDS = 77, + EXTRACTOR_METATYPE_PACKAGE_SUGGESTS = 78, + EXTRACTOR_METATYPE_PACKAGE_MAINTAINER = 79, + EXTRACTOR_METATYPE_PACKAGE_INSTALLED_SIZE = 80, + EXTRACTOR_METATYPE_PACKAGE_SOURCE = 81, + EXTRACTOR_METATYPE_PACKAGE_ESSENTIAL = 82, + EXTRACTOR_METATYPE_TARGET_ARCHITECTURE = 83, + EXTRACTOR_METATYPE_PACKAGE_PRE_DEPENDENCY = 84, + EXTRACTOR_METATYPE_LICENSE = 85, + EXTRACTOR_METATYPE_PACKAGE_DISTRIBUTION = 86, + EXTRACTOR_METATYPE_BUILDHOST = 87, + EXTRACTOR_METATYPE_VENDOR = 88, + EXTRACTOR_METATYPE_TARGET_OS = 89, + EXTRACTOR_METATYPE_SOFTWARE_VERSION = 90, + EXTRACTOR_METATYPE_TARGET_PLATFORM = 91, + EXTRACTOR_METATYPE_RESOURCE_TYPE = 92, + EXTRACTOR_METATYPE_LIBRARY_SEARCH_PATH = 93, + EXTRACTOR_METATYPE_LIBRARY_DEPENDENCY = 94, + + /* photography specifics */ + EXTRACTOR_METATYPE_CAMERA_MAKE = 95, + EXTRACTOR_METATYPE_CAMERA_MODEL = 96, + EXTRACTOR_METATYPE_EXPOSURE = 97, + EXTRACTOR_METATYPE_APERTURE = 98, + EXTRACTOR_METATYPE_EXPOSURE_BIAS = 99, + EXTRACTOR_METATYPE_FLASH = 100, + EXTRACTOR_METATYPE_FLASH_BIAS = 101, + EXTRACTOR_METATYPE_FOCAL_LENGTH = 102, + EXTRACTOR_METATYPE_FOCAL_LENGTH_35MM = 103, + EXTRACTOR_METATYPE_ISO_SPEED = 104, + EXTRACTOR_METATYPE_EXPOSURE_MODE = 105, + EXTRACTOR_METATYPE_METERING_MODE = 106, + EXTRACTOR_METATYPE_MACRO_MODE = 107, + EXTRACTOR_METATYPE_IMAGE_QUALITY = 108, + EXTRACTOR_METATYPE_WHITE_BALANCE = 109, + EXTRACTOR_METATYPE_ORIENTATION = 110, + EXTRACTOR_METATYPE_MAGNIFICATION = 111, + + /* image specifics */ + EXTRACTOR_METATYPE_IMAGE_DIMENSIONS = 112, + EXTRACTOR_METATYPE_PRODUCED_BY_SOFTWARE = 113, + EXTRACTOR_METATYPE_THUMBNAIL = 114, + EXTRACTOR_METATYPE_IMAGE_RESOLUTION = 115, + EXTRACTOR_METATYPE_SOURCE = 116, + + /* (text) document processing specifics */ + EXTRACTOR_METATYPE_CHARACTER_SET = 117, + EXTRACTOR_METATYPE_LINE_COUNT = 118, + EXTRACTOR_METATYPE_PARAGRAPH_COUNT = 119, + EXTRACTOR_METATYPE_WORD_COUNT = 120, + EXTRACTOR_METATYPE_CHARACTER_COUNT = 121, + EXTRACTOR_METATYPE_PAGE_ORIENTATION = 122, + EXTRACTOR_METATYPE_PAPER_SIZE = 123, + EXTRACTOR_METATYPE_TEMPLATE = 124, + EXTRACTOR_METATYPE_COMPANY = 125, + EXTRACTOR_METATYPE_MANAGER = 126, + EXTRACTOR_METATYPE_REVISION_NUMBER = 127, + + /* music / video specifics */ + EXTRACTOR_METATYPE_DURATION = 128, + EXTRACTOR_METATYPE_ALBUM = 129, + EXTRACTOR_METATYPE_ARTIST = 130, + EXTRACTOR_METATYPE_GENRE = 131, + EXTRACTOR_METATYPE_TRACK_NUMBER = 132, + EXTRACTOR_METATYPE_DISC_NUMBER = 133, + EXTRACTOR_METATYPE_PERFORMER = 134, + EXTRACTOR_METATYPE_CONTACT_INFORMATION = 135, + EXTRACTOR_METATYPE_SONG_VERSION = 136, + EXTRACTOR_METATYPE_PICTURE = 137, + EXTRACTOR_METATYPE_COVER_PICTURE = 138, + EXTRACTOR_METATYPE_CONTRIBUTOR_PICTURE = 139, + EXTRACTOR_METATYPE_EVENT_PICTURE = 140, + EXTRACTOR_METATYPE_LOGO = 141, + EXTRACTOR_METATYPE_BROADCAST_TELEVISION_SYSTEM = 142, + EXTRACTOR_METATYPE_SOURCE_DEVICE = 143, + EXTRACTOR_METATYPE_DISCLAIMER = 144, + EXTRACTOR_METATYPE_WARNING = 145, + EXTRACTOR_METATYPE_PAGE_ORDER = 146, + EXTRACTOR_METATYPE_WRITER = 147, + EXTRACTOR_METATYPE_PRODUCT_VERSION = 148, + EXTRACTOR_METATYPE_CONTRIBUTOR_NAME = 149, + EXTRACTOR_METATYPE_MOVIE_DIRECTOR = 150, + EXTRACTOR_METATYPE_NETWORK_NAME = 151, + EXTRACTOR_METATYPE_SHOW_NAME = 152, + EXTRACTOR_METATYPE_CHAPTER_NAME = 153, + EXTRACTOR_METATYPE_SONG_COUNT = 154, + EXTRACTOR_METATYPE_STARTING_SONG = 155, + EXTRACTOR_METATYPE_PLAY_COUNTER = 156, + EXTRACTOR_METATYPE_CONDUCTOR = 157, + EXTRACTOR_METATYPE_INTERPRETATION = 158, + EXTRACTOR_METATYPE_COMPOSER = 159, + EXTRACTOR_METATYPE_BEATS_PER_MINUTE = 160, + EXTRACTOR_METATYPE_ENCODED_BY = 161, + EXTRACTOR_METATYPE_ORIGINAL_TITLE = 162, + EXTRACTOR_METATYPE_ORIGINAL_ARTIST = 163, + EXTRACTOR_METATYPE_ORIGINAL_WRITER = 164, + EXTRACTOR_METATYPE_ORIGINAL_RELEASE_YEAR = 165, + EXTRACTOR_METATYPE_ORIGINAL_PERFORMER = 166, + EXTRACTOR_METATYPE_LYRICS = 167, + EXTRACTOR_METATYPE_POPULARITY_METER = 168, + EXTRACTOR_METATYPE_LICENSEE = 169, + EXTRACTOR_METATYPE_MUSICIAN_CREDITS_LIST = 170, + EXTRACTOR_METATYPE_MOOD = 171, + EXTRACTOR_METATYPE_SUBTITLE = 172, + + /* GNUnet specific values (never extracted) */ + EXTRACTOR_METATYPE_GNUNET_DISPLAY_TYPE = 173, + EXTRACTOR_METATYPE_GNUNET_FULL_DATA = 174, + EXTRACTOR_METATYPE_RATING = 175, + EXTRACTOR_METATYPE_ORGANIZATION = 176, + EXTRACTOR_METATYPE_RIPPER = 177, + EXTRACTOR_METATYPE_PRODUCER = 178, + EXTRACTOR_METATYPE_GROUP = 179, + EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME = 180, + + EXTRACTOR_METATYPE_DISC_COUNT = 181, + + EXTRACTOR_METATYPE_CODEC = 182, + EXTRACTOR_METATYPE_VIDEO_CODEC = 183, + EXTRACTOR_METATYPE_AUDIO_CODEC = 184, + EXTRACTOR_METATYPE_SUBTITLE_CODEC = 185, + + EXTRACTOR_METATYPE_CONTAINER_FORMAT = 186, + + EXTRACTOR_METATYPE_BITRATE = 187, + EXTRACTOR_METATYPE_NOMINAL_BITRATE = 188, + EXTRACTOR_METATYPE_MINIMUM_BITRATE = 189, + EXTRACTOR_METATYPE_MAXIMUM_BITRATE = 190, + + EXTRACTOR_METATYPE_SERIAL = 191, + + EXTRACTOR_METATYPE_ENCODER = 192, + EXTRACTOR_METATYPE_ENCODER_VERSION = 193, + + EXTRACTOR_METATYPE_TRACK_GAIN = 194, + EXTRACTOR_METATYPE_TRACK_PEAK = 195, + EXTRACTOR_METATYPE_ALBUM_GAIN = 196, + EXTRACTOR_METATYPE_ALBUM_PEAK = 197, + EXTRACTOR_METATYPE_REFERENCE_LEVEL = 198, + + EXTRACTOR_METATYPE_LOCATION_NAME = 199, + EXTRACTOR_METATYPE_LOCATION_ELEVATION = 200, + EXTRACTOR_METATYPE_LOCATION_HORIZONTAL_ERROR = 201, + EXTRACTOR_METATYPE_LOCATION_MOVEMENT_SPEED = 202, + EXTRACTOR_METATYPE_LOCATION_MOVEMENT_DIRECTION = 203, + EXTRACTOR_METATYPE_LOCATION_CAPTURE_DIRECTION = 204, + + EXTRACTOR_METATYPE_SHOW_EPISODE_NUMBER = 205, + EXTRACTOR_METATYPE_SHOW_SEASON_NUMBER = 206, + + EXTRACTOR_METATYPE_GROUPING = 207, + + EXTRACTOR_METATYPE_DEVICE_MANUFACTURER = 208, + EXTRACTOR_METATYPE_DEVICE_MODEL = 209, + + EXTRACTOR_METATYPE_AUDIO_LANGUAGE = 210, + EXTRACTOR_METATYPE_CHANNELS = 211, + EXTRACTOR_METATYPE_SAMPLE_RATE = 212, + EXTRACTOR_METATYPE_AUDIO_DEPTH = 213, + EXTRACTOR_METATYPE_AUDIO_BITRATE = 214, + EXTRACTOR_METATYPE_MAXIMUM_AUDIO_BITRATE = 215, + + EXTRACTOR_METATYPE_VIDEO_DIMENSIONS = 216, + EXTRACTOR_METATYPE_VIDEO_DEPTH = 217, + EXTRACTOR_METATYPE_FRAME_RATE = 218, + EXTRACTOR_METATYPE_PIXEL_ASPECT_RATIO = 219, + EXTRACTOR_METATYPE_VIDEO_BITRATE = 220, + EXTRACTOR_METATYPE_MAXIMUM_VIDEO_BITRATE = 221, + + EXTRACTOR_METATYPE_SUBTITLE_LANGUAGE = 222, + EXTRACTOR_METATYPE_VIDEO_LANGUAGE = 223, + + EXTRACTOR_METATYPE_TOC = 224, + + EXTRACTOR_METATYPE_VIDEO_DURATION = 225, + EXTRACTOR_METATYPE_AUDIO_DURATION = 226, + EXTRACTOR_METATYPE_SUBTITLE_DURATION = 227, + + EXTRACTOR_METATYPE_LAST = 228 + }; + + +/** + * Get the textual name of the keyword. + * + * @param type meta type to get a UTF-8 string for + * @return NULL if the type is not known, otherwise + * an English (locale: C) string describing the type; + * translate using 'dgettext ("libextractor", rval)' + */ +const char * +EXTRACTOR_metatype_to_string (enum EXTRACTOR_MetaType type); + + +/** + * Get a long description for the meta type. + * + * @param type meta type to get a UTF-8 description for + * @return NULL if the type is not known, otherwise + * an English (locale: C) string describing the type; + * translate using 'dgettext ("libextractor", rval)' + */ +const char * +EXTRACTOR_metatype_to_description (enum EXTRACTOR_MetaType type); + + +/** + * Return the highest type number, exclusive as in [0,max). + * + * @return highest legal metatype number for this version of libextractor + */ +enum EXTRACTOR_MetaType +EXTRACTOR_metatype_get_max (void); + + +/** + * Type of a function that libextractor calls for each + * meta data item found. + * + * @param cls closure (user-defined) + * @param plugin_name name of the plugin that produced this value; + * special values can be used (i.e. '<zlib>' for zlib being + * used in the main libextractor library and yielding + * meta data). + * @param type libextractor-type describing the meta data + * @param format basic format information about data + * @param data_mime_type mime-type of data (not of the original file); + * can be NULL (if mime-type is not known) + * @param data actual meta-data found + * @param data_len number of bytes in data + * @return 0 to continue extracting, 1 to abort + */ +typedef int (*EXTRACTOR_MetaDataProcessor) (void *cls, + const char *plugin_name, + enum EXTRACTOR_MetaType type, + enum EXTRACTOR_MetaFormat format, + const char *data_mime_type, + const char *data, + size_t data_len); + + +/** + * Context provided for plugins that perform meta data extraction. + */ +struct EXTRACTOR_ExtractContext +{ + + /** + * Closure argument to pass to all callbacks. + */ + void *cls; + + /** + * Configuration string for the plugin. + */ + const char *config; + + /** + * Obtain a pointer to up to 'size' bytes of data from the file to process. + * + * @param cls the 'cls' member of this struct + * @param data pointer to set to the file data, set to NULL on error + * @param size maximum number of bytes requested + * @return number of bytes now available in data (can be smaller than 'size'), + * -1 on error + */ + ssize_t (*read) (void *cls, + void **data, + size_t size); + + + /** + * Seek in the file. Use 'SEEK_CUR' for whence and 'pos' of 0 to + * obtain the current position in the file. + * + * @param cls the 'cls' member of this struct + * @param pos position to seek (see 'man lseek') + * @param whence how to see (absolute to start, relative, absolute to end) + * @return new absolute position, -1 on error (i.e. desired position + * does not exist) + */ + int64_t (*seek) (void *cls, + int64_t pos, + int whence); + + + /** + * Determine the overall size of the file. + * + * @param cls the 'cls' member of this struct + * @return overall file size, UINT64_MAX on error (i.e. IPC failure) + */ + uint64_t (*get_size) (void *cls); + + /** + * Function to call on extracted data. + */ + EXTRACTOR_MetaDataProcessor proc; + +}; + + +/** + * Signature of the extract method that each plugin + * must provide. + * + * @param ec extraction context provided to the plugin + */ +typedef void (*EXTRACTOR_extract_method) (struct EXTRACTOR_ExtractContext *ec); + + +/** + * Linked list of extractor plugins. An application builds this list + * by telling libextractor to load various keyword-extraction + * plugins. Libraries can also be unloaded (removed from this list, + * see EXTRACTOR_plugin_remove). + */ +struct EXTRACTOR_PluginList; + + +/** + * Load the default set of plugins. The default can be changed + * by setting the LIBEXTRACTOR_LIBRARIES environment variable; + * If it is set to "env", then this function will return + * EXTRACTOR_plugin_add_config (NULL, env, flags). + * + * If LIBEXTRACTOR_LIBRARIES is not set, the function will attempt + * to locate the installed plugins and load all of them. + * The directory where the code will search for plugins is typically + * automatically determined; it can be specified explicitly using the + * "LIBEXTRACTOR_PREFIX" environment variable. + * + * This environment variable must be set to the precise directory with + * the plugins (i.e. "/usr/lib/libextractor", not "/usr"). Note that + * setting the environment variable will disable all of the methods + * that are typically used to determine the location of plugins. + * Multiple paths can be specified using ':' to separate them. + * + * @param flags options for all of the plugins loaded + * @return the default set of plugins, NULL if no plugins were found + */ +struct EXTRACTOR_PluginList * +EXTRACTOR_plugin_add_defaults (enum EXTRACTOR_Options flags); + + +/** + * Add a library for keyword extraction. + * + * @param prev the previous list of libraries, may be NULL + * @param library the name of the library (short handle, i.e. "mime") + * @param options options to give to the library + * @param flags options to use + * @return the new list of libraries, equal to prev iff an error occured + */ +struct EXTRACTOR_PluginList * +EXTRACTOR_plugin_add (struct EXTRACTOR_PluginList * prev, + const char *library, + const char *options, + enum EXTRACTOR_Options flags); + + +/** + * Load multiple libraries as specified by the user. + * + * @param config a string given by the user that defines which + * libraries should be loaded. Has the format + * "[[-]LIBRARYNAME[(options)][:[-]LIBRARYNAME[(options)]]]*". + * For example, 'mp3:ogg' loads the + * mp3 and the ogg plugins. The '-' before the LIBRARYNAME + * indicates that the library should be removed from + * the library list. + * @param prev the previous list of libraries, may be NULL + * @param flags options to use + * @return the new list of libraries, equal to prev iff an error occured + * or if config was empty (or NULL). + */ +struct EXTRACTOR_PluginList * +EXTRACTOR_plugin_add_config (struct EXTRACTOR_PluginList *prev, + const char *config, + enum EXTRACTOR_Options flags); + + +/** + * Remove a plugin from a list. + * + * @param prev the current list of plugins + * @param library the name of the plugin to remove (short handle) + * @return the reduced list, unchanged if the plugin was not loaded + */ +struct EXTRACTOR_PluginList * +EXTRACTOR_plugin_remove (struct EXTRACTOR_PluginList *prev, + const char *library); + + +/** + * Remove all plugins from the given list (destroys the list). + * + * @param plugin the list of plugins + */ +void +EXTRACTOR_plugin_remove_all (struct EXTRACTOR_PluginList *plugins); + + +/** + * Extract keywords from a file using the given set of plugins. + * + * @param plugins the list of plugins to use + * @param filename the name of the file, can be NULL if data is not NULL + * @param data data of the file in memory, can be NULL (in which + * case libextractor will open file) if filename is not NULL + * @param size number of bytes in data, ignored if data is NULL + * @param proc function to call for each meta data item found + * @param proc_cls cls argument to proc + */ +void +EXTRACTOR_extract (struct EXTRACTOR_PluginList *plugins, + const char *filename, + const void *data, + size_t size, + EXTRACTOR_MetaDataProcessor proc, + void *proc_cls); + + +/** + * Simple EXTRACTOR_MetaDataProcessor implementation that simply + * prints the extracted meta data to the given file. Only prints + * those keywords that are in UTF-8 format. + * + * @param handle the file to write to (stdout, stderr), must NOT be NULL, + * must be of type "FILE *". + * @param plugin_name name of the plugin that produced this value + * @param type libextractor-type describing the meta data + * @param format basic format information about data + * @param data_mime_type mime-type of data (not of the original file); + * can be NULL (if mime-type is not known) + * @param data actual meta-data found + * @param data_len number of bytes in data + * @return non-zero if printing failed, otherwise 0. + */ +int +EXTRACTOR_meta_data_print (void * handle, + const char *plugin_name, + enum EXTRACTOR_MetaType type, + enum EXTRACTOR_MetaFormat format, + const char *data_mime_type, + const char *data, + size_t data_len); + + +#if 0 /* keep Emacsens' auto-indent happy */ +{ +#endif +#ifdef __cplusplus +} +#endif + +#endif diff --git a/fake-extractor/extractor_metatypes.c b/fake-extractor/extractor_metatypes.c new file mode 100644 index 0000000..8ce0650 --- /dev/null +++ b/fake-extractor/extractor_metatypes.c @@ -0,0 +1,607 @@ +/* + This file is part of libextractor. + (C) 2002, 2003, 2004, 2005, 2006, 2009, 2012 Vidyut Samanta and Christian Grothoff + + 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 "extractor.h" +#define gettext_noop(str) (str) + +/** + * Description for meta data categories in LE. + */ +struct MetaTypeDescription +{ + /** + * Short (typically 1-word) description. + */ + const char *short_description; + + /** + * More detailed description. + */ + const char *long_description; +}; + + +/** + * The sources of keywords as strings. + */ +static const struct MetaTypeDescription meta_type_descriptions[] = { + /* 0 */ + { gettext_noop ("reserved"), + gettext_noop ("reserved value, do not use") }, + { gettext_noop ("mimetype"), + gettext_noop ("mime type") }, + { gettext_noop ("embedded filename"), + gettext_noop ("filename that was embedded (not necessarily the current filename)") }, + { gettext_noop ("comment"), + gettext_noop ("comment about the content") }, + { gettext_noop ("title"), + gettext_noop ("title of the work")}, + /* 5 */ + { gettext_noop ("book title"), + gettext_noop ("title of the book containing the work") }, + { gettext_noop ("book edition"), + gettext_noop ("edition of the book (or book containing the work)") }, + { gettext_noop ("book chapter"), + gettext_noop ("chapter number") }, + { gettext_noop ("journal name"), + gettext_noop ("journal or magazine the work was published in") }, + { gettext_noop ("journal volume"), + gettext_noop ("volume of a journal or multi-volume book") }, + /* 10 */ + { gettext_noop ("journal number"), + gettext_noop ("number of a journal, magazine or tech-report") }, + { gettext_noop ("page count"), + gettext_noop ("total number of pages of the work") }, + { gettext_noop ("page range"), + gettext_noop ("page numbers of the publication in the respective journal or book") }, + { gettext_noop ("author name"), + gettext_noop ("name of the author(s)") }, + { gettext_noop ("author email"), + gettext_noop ("e-mail of the author(s)") }, + /* 15 */ + { gettext_noop ("author institution"), + gettext_noop ("institution the author worked for") }, + { gettext_noop ("publisher"), + gettext_noop ("name of the publisher") }, + { gettext_noop ("publisher's address"), + gettext_noop ("Address of the publisher (often only the city)") }, + { gettext_noop ("publishing institution"), + gettext_noop ("institution that was involved in the publishing, but not necessarily the publisher") }, + { gettext_noop ("publication series"), + gettext_noop ("series of books the book was published in") }, + /* 20 */ + { gettext_noop ("publication type"), + gettext_noop ("type of the tech-report") }, + { gettext_noop ("publication year"), + gettext_noop ("year of publication (or, if unpublished, the year of creation)") }, + { gettext_noop ("publication month"), + gettext_noop ("month of publication (or, if unpublished, the month of creation)") }, + { gettext_noop ("publication day"), + gettext_noop ("day of publication (or, if unpublished, the day of creation), relative to the given month") }, + { gettext_noop ("publication date"), + gettext_noop ("date of publication (or, if unpublished, the date of creation)") }, + /* 25 */ + { gettext_noop ("bibtex eprint"), + gettext_noop ("specification of an electronic publication") }, + { gettext_noop ("bibtex entry type"), + gettext_noop ("type of the publication for bibTeX bibliographies") }, + { gettext_noop ("language"), + gettext_noop ("language the work uses") }, + { gettext_noop ("creation time"), + gettext_noop ("time and date of creation") }, + { gettext_noop ("URL"), + gettext_noop ("universal resource location (where the work is made available)") }, + /* 30 */ + { gettext_noop ("URI"), + gettext_noop ("universal resource identifier") }, + { gettext_noop ("international standard recording code"), + gettext_noop ("ISRC number identifying the work") }, + { gettext_noop ("MD4"), + gettext_noop ("MD4 hash") }, + { gettext_noop ("MD5"), + gettext_noop ("MD5 hash") }, + { gettext_noop ("SHA-0"), + gettext_noop ("SHA-0 hash") }, + /* 35 */ + { gettext_noop ("SHA-1"), + gettext_noop ("SHA-1 hash") }, + { gettext_noop ("RipeMD160"), + gettext_noop ("RipeMD150 hash") }, + { gettext_noop ("GPS latitude ref"), + gettext_noop ("GPS latitude ref") }, + { gettext_noop ("GPS latitude"), + gettext_noop ("GPS latitude") }, + { gettext_noop ("GPS longitude ref"), + gettext_noop ("GPS longitude ref") }, + /* 40 */ + { gettext_noop ("GPS longitude"), + gettext_noop ("GPS longitude") }, + { gettext_noop ("city"), + gettext_noop ("name of the city where the document originated") }, + { gettext_noop ("sublocation"), + gettext_noop ("more specific location of the geographic origin") }, + { gettext_noop ("country"), + gettext_noop ("name of the country where the document originated") }, + { gettext_noop ("country code"), + gettext_noop ("ISO 2-letter country code for the country of origin") }, + /* 45 */ + { gettext_noop ("unknown"), + gettext_noop ("specifics are not known") }, + { gettext_noop ("description"), + gettext_noop ("description") }, + { gettext_noop ("copyright"), + gettext_noop ("Name of the entity holding the copyright") }, + { gettext_noop ("rights"), + gettext_noop ("information about rights") }, + { gettext_noop ("keywords"), + gettext_noop ("keywords") }, + /* 50 */ + { gettext_noop ("abstract"), + gettext_noop ("abstract") }, + { gettext_noop ("summary"), + gettext_noop ("summary") }, + { gettext_noop ("subject"), + gettext_noop ("subject matter") }, + { gettext_noop ("creator"), + gettext_noop ("name of the person who created the document") }, + { gettext_noop ("format"), + gettext_noop ("name of the document format") }, + /* 55 */ + { gettext_noop ("format version"), + gettext_noop ("version of the document format") }, + { gettext_noop ("created by software"), + gettext_noop ("name of the software that created the document") }, + { gettext_noop ("unknown date"), + gettext_noop ("ambiguous date (could specify creation time, modification time or access time)") }, + { gettext_noop ("creation date"), + gettext_noop ("date the document was created") }, + { gettext_noop ("modification date"), + gettext_noop ("date the document was modified") }, + /* 60 */ + { gettext_noop ("last printed"), + gettext_noop ("date the document was last printed") }, + { gettext_noop ("last saved by"), + gettext_noop ("name of the user who saved the document last") }, + { gettext_noop ("total editing time"), + gettext_noop ("time spent editing the document") }, + { gettext_noop ("editing cycles"), + gettext_noop ("number of editing cycles") }, + { gettext_noop ("modified by software"), + gettext_noop ("name of software making modifications") }, + /* 65 */ + { gettext_noop ("revision history"), + gettext_noop ("information about the revision history") }, + { gettext_noop ("embedded file size"), + gettext_noop ("size of the contents of the container as embedded in the file") }, + { gettext_noop ("file type"), + gettext_noop ("standard Macintosh Finder file type information") }, + { gettext_noop ("creator"), + gettext_noop ("standard Macintosh Finder file creator information") }, + { gettext_noop ("package name"), + gettext_noop ("unique identifier for the package") }, + /* 70 */ + { gettext_noop ("package version"), + gettext_noop ("version of the software and its package") }, + { gettext_noop ("section"), + gettext_noop ("category the software package belongs to") }, + { gettext_noop ("upload priority"), + gettext_noop ("priority for promoting the release to production") }, + { gettext_noop ("dependencies"), + gettext_noop ("packages this package depends upon") }, + { gettext_noop ("conflicting packages"), + gettext_noop ("packages that cannot be installed with this package") }, + /* 75 */ + { gettext_noop ("replaced packages"), + gettext_noop ("packages made obsolete by this package") }, + { gettext_noop ("provides"), + gettext_noop ("functionality provided by this package") }, + { gettext_noop ("recommendations"), + gettext_noop ("packages recommended for installation in conjunction with this package") }, + { gettext_noop ("suggestions"), + gettext_noop ("packages suggested for installation in conjunction with this package") }, + { gettext_noop ("maintainer"), + gettext_noop ("name of the maintainer") }, + /* 80 */ + { gettext_noop ("installed size"), + gettext_noop ("space consumption after installation") }, + { gettext_noop ("source"), + gettext_noop ("original source code") }, + { gettext_noop ("is essential"), + gettext_noop ("package is marked as essential") }, + { gettext_noop ("target architecture"), + gettext_noop ("hardware architecture the contents can be used for") }, + { gettext_noop ("pre-dependency"), + gettext_noop ("dependency that must be satisfied before installation") }, + /* 85 */ + { gettext_noop ("license"), + gettext_noop ("applicable copyright license") }, + { gettext_noop ("distribution"), + gettext_noop ("distribution the package is a part of") }, + { gettext_noop ("build host"), + gettext_noop ("machine the package was build on") }, + { gettext_noop ("vendor"), + gettext_noop ("name of the software vendor") }, + { gettext_noop ("target operating system"), + gettext_noop ("operating system for which this package was made") }, + /* 90 */ + { gettext_noop ("software version"), + gettext_noop ("version of the software contained in the file") }, + { gettext_noop ("target platform"), + gettext_noop ("name of the architecture, operating system and distribution this package is for") }, + { gettext_noop ("resource type"), + gettext_noop ("categorization of the nature of the resource that is more specific than the file format") }, + { gettext_noop ("library search path"), + gettext_noop ("path in the file system to be considered when looking for required libraries") }, + { gettext_noop ("library dependency"), + gettext_noop ("name of a library that this file depends on") }, + /* 95 */ + { gettext_noop ("camera make"), + gettext_noop ("camera make") }, + { gettext_noop ("camera model"), + gettext_noop ("camera model") }, + { gettext_noop ("exposure"), + gettext_noop ("exposure") }, + { gettext_noop ("aperture"), + gettext_noop ("aperture") }, + { gettext_noop ("exposure bias"), + gettext_noop ("exposure bias") }, + /* 100 */ + { gettext_noop ("flash"), + gettext_noop ("flash") }, + { gettext_noop ("flash bias"), + gettext_noop ("flash bias") }, + { gettext_noop ("focal length"), + gettext_noop ("focal length") }, + { gettext_noop ("focal length 35mm"), + gettext_noop ("focal length 35mm") }, + { gettext_noop ("iso speed"), + gettext_noop ("iso speed") }, + /* 105 */ + { gettext_noop ("exposure mode"), + gettext_noop ("exposure mode") }, + { gettext_noop ("metering mode"), + gettext_noop ("metering mode") }, + { gettext_noop ("macro mode"), + gettext_noop ("macro mode") }, + { gettext_noop ("image quality"), + gettext_noop ("image quality") }, + { gettext_noop ("white balance"), + gettext_noop ("white balance") }, + /* 110 */ + { gettext_noop ("orientation"), + gettext_noop ("orientation") }, + { gettext_noop ("magnification"), + gettext_noop ("magnification") }, + { gettext_noop ("image dimensions"), + gettext_noop ("size of the image in pixels (width times height)") }, + { gettext_noop ("produced by software"), + gettext_noop ("produced by software") }, /* what is the exact difference between the software + creator and the software producer? PDF and DVI + both have this distinction (i.e., Writer vs. + OpenOffice) */ + { gettext_noop ("thumbnail"), + gettext_noop ("smaller version of the image for previewing") }, + /* 115 */ + { gettext_noop ("image resolution"), + gettext_noop ("resolution in dots per inch") }, + { gettext_noop ("source"), + gettext_noop ("Originating entity") }, + { gettext_noop ("character set"), + gettext_noop ("character encoding used") }, + { gettext_noop ("line count"), + gettext_noop ("number of lines") }, + { gettext_noop ("paragraph count"), + gettext_noop ("number of paragraphs") }, + /* 120 */ + { gettext_noop ("word count"), + gettext_noop ("number of words") }, + { gettext_noop ("character count"), + gettext_noop ("number of characters") }, + { gettext_noop ("page orientation"), + gettext_noop ("page orientation") }, + { gettext_noop ("paper size"), + gettext_noop ("paper size") }, + { gettext_noop ("template"), + gettext_noop ("template the document uses or is based on") }, + /* 125 */ + { gettext_noop ("company"), + gettext_noop ("company") }, + { gettext_noop ("manager"), + gettext_noop ("manager") }, + { gettext_noop ("revision number"), + gettext_noop ("revision number") }, + { gettext_noop ("duration"), + gettext_noop ("play time for the medium") }, + { gettext_noop ("album"), + gettext_noop ("name of the album") }, + /* 130 */ + { gettext_noop ("artist"), + gettext_noop ("name of the artist or band") }, + { gettext_noop ("genre"), + gettext_noop ("genre") }, + { gettext_noop ("track number"), + gettext_noop ("original number of the track on the distribution medium") }, + { gettext_noop ("disk number"), + gettext_noop ("number of the disk in a multi-disk (or volume) distribution") }, + { gettext_noop ("performer"), + gettext_noop ("The artist(s) who performed the work (conductor, orchestra, soloists, actor, etc.)") }, + /* 135 */ + { gettext_noop ("contact"), + gettext_noop ("Contact information for the creator or distributor") }, + { gettext_noop ("song version"), + gettext_noop ("name of the version of the song (i.e. remix information)") }, + { gettext_noop ("picture"), + gettext_noop ("associated misc. picture") }, + { gettext_noop ("cover picture"), + gettext_noop ("picture of the cover of the distribution medium") }, + { gettext_noop ("contributor picture"), + gettext_noop ("picture of one of the contributors") }, + /* 140 */ + { gettext_noop ("event picture"), + gettext_noop ("picture of an associated event") }, + { gettext_noop ("logo"), + gettext_noop ("logo of an associated organization") }, + { gettext_noop ("broadcast television system"), + gettext_noop ("name of the television system for which the data is coded") }, + { gettext_noop ("source device"), + gettext_noop ("device used to create the object") }, + { gettext_noop ("disclaimer"), + gettext_noop ("legal disclaimer") }, + /* 145 */ + { gettext_noop ("warning"), + gettext_noop ("warning about the nature of the content") }, + { gettext_noop ("page order"), + gettext_noop ("order of the pages") }, + { gettext_noop ("writer"), + gettext_noop ("contributing writer") }, + { gettext_noop ("product version"), + gettext_noop ("product version") }, + { gettext_noop ("contributor"), + gettext_noop ("name of a contributor") }, + /* 150 */ + { gettext_noop ("movie director"), + gettext_noop ("name of the director") }, + { gettext_noop ("network"), + gettext_noop ("name of the broadcasting network or station") }, + { gettext_noop ("show"), + gettext_noop ("name of the show") }, + { gettext_noop ("chapter name"), + gettext_noop ("name of the chapter") }, + { gettext_noop ("song count"), + gettext_noop ("number of songs") }, + /* 155 */ + { gettext_noop ("starting song"), + gettext_noop ("number of the first song to play") }, + { gettext_noop ("play counter"), + gettext_noop ("number of times the media has been played") }, + { gettext_noop ("conductor"), + gettext_noop ("name of the conductor") }, + { gettext_noop ("interpretation"), + gettext_noop ("information about the people behind interpretations of an existing piece") }, + { gettext_noop ("composer"), + gettext_noop ("name of the composer") }, + /* 160 */ + { gettext_noop ("beats per minute"), + gettext_noop ("beats per minute") }, + { gettext_noop ("encoded by"), + gettext_noop ("name of person or organization that encoded the file") }, + { gettext_noop ("original title"), + gettext_noop ("title of the original work") }, + { gettext_noop ("original artist"), + gettext_noop ("name of the original artist") }, + { gettext_noop ("original writer"), + gettext_noop ("name of the original lyricist or writer") }, + /* 165 */ + { gettext_noop ("original release year"), + gettext_noop ("year of the original release") }, + { gettext_noop ("original performer"), + gettext_noop ("name of the original performer") }, + { gettext_noop ("lyrics"), + gettext_noop ("lyrics of the song or text description of vocal activities") }, + { gettext_noop ("popularity"), + gettext_noop ("information about the file's popularity") }, + { gettext_noop ("licensee"), + gettext_noop ("name of the owner or licensee of the file") }, + /* 170 */ + { gettext_noop ("musician credit list"), + gettext_noop ("names of contributing musicians") }, + { gettext_noop ("mood"), + gettext_noop ("keywords reflecting the mood of the piece") }, + { gettext_noop ("subtitle"), + gettext_noop ("subtitle of this part") }, + { gettext_noop ("display type"), + gettext_noop ("what rendering method should be used to display this item") }, + { gettext_noop ("full data"), + gettext_noop ("entry that contains the full, original binary data (not really meta data)") }, + /* 175 */ + { gettext_noop ("rating"), + gettext_noop ("rating of the content") }, + { gettext_noop ("organization"), + gettext_noop ("organization") }, + { gettext_noop ("ripper"), /* any difference to "encoded by"? */ + gettext_noop ("ripper") }, + { gettext_noop ("producer"), + gettext_noop ("producer") }, + { gettext_noop ("group"), + gettext_noop ("name of the group or band") }, + /* 180 */ + { gettext_noop ("original filename"), + gettext_noop ("name of the original file (reserved for GNUnet)") }, + { gettext_noop ("disc count"), + gettext_noop ("count of discs inside collection this disc belongs to") }, + { gettext_noop ("codec"), + gettext_noop ("codec the data is stored in") }, + { gettext_noop ("video codec"), + gettext_noop ("codec the video data is stored in") }, + { gettext_noop ("audio codec"), + gettext_noop ("codec the audio data is stored in") }, + /* 185 */ + { gettext_noop ("subtitle codec"), + gettext_noop ("codec/format the subtitle data is stored in") }, + { gettext_noop ("container format"), + gettext_noop ("container format the data is stored in") }, + { gettext_noop ("bitrate"), + gettext_noop ("exact or average bitrate in bits/s") }, + { gettext_noop ("nominal bitrate"), + gettext_noop ("nominal bitrate in bits/s. The actual bitrate might be different from this target bitrate.") }, + { gettext_noop ("minimum bitrate"), + gettext_noop ("minimum bitrate in bits/s") }, + /* 190 */ + { gettext_noop ("maximum bitrate"), + gettext_noop ("maximum bitrate in bits/s") }, + { gettext_noop ("serial"), + gettext_noop ("serial number of track") }, + { gettext_noop ("encoder"), + gettext_noop ("encoder used to encode this stream") }, + { gettext_noop ("encoder version"), + gettext_noop ("version of the encoder used to encode this stream") }, + { gettext_noop ("track gain"), + gettext_noop ("track gain in db") }, + /* 195 */ + { gettext_noop ("track peak"), + gettext_noop ("peak of the track") }, + { gettext_noop ("album gain"), + gettext_noop ("album gain in db") }, + { gettext_noop ("album peak"), + gettext_noop ("peak of the album") }, + { gettext_noop ("reference level"), + gettext_noop ("reference level of track and album gain values") }, + { gettext_noop ("location name"), + gettext_noop ("human readable descriptive location of where the media has been recorded or produced") }, + /* 200 */ + { gettext_noop ("location elevation"), + gettext_noop ("geo elevation of where the media has been recorded or produced in meters according to WGS84 (zero is average sea level)") }, + { gettext_noop ("location horizontal error"), + gettext_noop ("represents the expected error on the horizontal positioning in meters") }, + { gettext_noop ("location movement speed"), + gettext_noop ("speed of the capturing device when performing the capture. Represented in m/s") }, + { gettext_noop ("location movement direction"), + gettext_noop ("indicates the movement direction of the device performing the capture of a media. It is represented as degrees in floating point representation, 0 means the geographic north, and increases clockwise") }, + { gettext_noop ("location capture direction"), + gettext_noop ("indicates the direction the device is pointing to when capturing a media. It is represented as degrees in floating point representation, 0 means the geographic north, and increases clockwise") }, + /* 205 */ + { gettext_noop ("show episode number"), + gettext_noop ("number of the episode within a season/show") }, + { gettext_noop ("show season number"), + gettext_noop ("number of the season of a show/series") }, + { gettext_noop ("grouping"), + gettext_noop ("groups together media that are related and spans multiple tracks. An example are multiple pieces of a concerto") }, + { gettext_noop ("device manufacturer"), + gettext_noop ("manufacturer of the device used to create the media") }, + { gettext_noop ("device model"), + gettext_noop ("model of the device used to create the media") }, + /* 210 */ + { gettext_noop ("audio language"), + gettext_noop ("language of the audio track") }, + { gettext_noop ("channels"), + gettext_noop ("number of audio channels") }, + { gettext_noop ("sample rate"), + gettext_noop ("sample rate of the audio track") }, + { gettext_noop ("audio depth"), + gettext_noop ("number of bits per audio sample") }, + { gettext_noop ("audio bitrate"), + gettext_noop ("bitrate of the audio track") }, + /* 215 */ + { gettext_noop ("maximum audio bitrate"), + gettext_noop ("maximum audio bitrate") }, + { gettext_noop ("video dimensions"), + gettext_noop ("width and height of the video track (WxH)") }, + { gettext_noop ("video depth"), + gettext_noop ("numbers of bits per pixel") }, + { gettext_noop ("frame rate"), + gettext_noop ("number of frames per second (as D/N or floating point)") }, + { gettext_noop ("pixel aspect ratio"), + gettext_noop ("pixel aspect ratio (as D/N)") }, + /* 220 */ + { gettext_noop ("video bitrate"), + gettext_noop ("video bitrate") }, + { gettext_noop ("maximum video bitrate"), + gettext_noop ("maximum video bitrate") }, + { gettext_noop ("subtitle language"), + gettext_noop ("language of the subtitle track") }, + { gettext_noop ("video language"), + gettext_noop ("language of the video track") }, + { gettext_noop ("table of contents"), + gettext_noop ("chapters, contents or bookmarks (in xml format)") }, + /* 225 */ + { gettext_noop ("video duration"), + gettext_noop ("duration of a video stream") }, + { gettext_noop ("audio duration"), + gettext_noop ("duration of an audio stream") }, + { gettext_noop ("subtitle duration"), + gettext_noop ("duration of a subtitle stream") }, + + { gettext_noop ("last"), + gettext_noop ("last") } +}; + +/** + * Total number of keyword types (for bounds-checking) + */ +#define HIGHEST_METATYPE_NUMBER (sizeof (meta_type_descriptions) / sizeof(*meta_type_descriptions)) + + +/** + * Get the textual name of the keyword. + * + * @param type meta type to get a UTF-8 string for + * @return NULL if the type is not known, otherwise + * an English (locale: C) string describing the type; + * translate using 'dgettext ("libextractor", rval)' + */ +const char * +EXTRACTOR_metatype_to_string (enum EXTRACTOR_MetaType type) +{ + if ( (type < 0) || (type >= HIGHEST_METATYPE_NUMBER) ) + return NULL; + return meta_type_descriptions[type].short_description; +} + + +/** + * Get a long description for the meta type. + * + * @param type meta type to get a UTF-8 description for + * @return NULL if the type is not known, otherwise + * an English (locale: C) string describing the type; + * translate using 'dgettext ("libextractor", rval)' + */ +const char * +EXTRACTOR_metatype_to_description (enum EXTRACTOR_MetaType type) +{ + if ( (type < 0) || (type >= HIGHEST_METATYPE_NUMBER) ) + return NULL; + return meta_type_descriptions[type].long_description; +} + + +/** + * Return the highest type number, exclusive as in [0,max). + * + * @return highest legal metatype number for this version of libextractor + */ +enum EXTRACTOR_MetaType +EXTRACTOR_metatype_get_max () +{ + return HIGHEST_METATYPE_NUMBER; +} + + +/* end of extractor_metatypes.c */ diff --git a/fake-extractor/libextractor.so b/fake-extractor/libextractor.so Binary files differnew file mode 100644 index 0000000..95ece0c --- /dev/null +++ b/fake-extractor/libextractor.so |