libextractor  1.11
About: GNU libextractor is a library used to extract meta-data from files of arbitrary type.
  Fossies Dox: libextractor-1.11.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Loading...
Searching...
No Matches
extractor.h File Reference
#include <stdint.h>
#include <stdio.h>
Include dependency graph for extractor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  EXTRACTOR_ExtractContext
 

Macros

#define EXTRACTOR_VERSION   0x010B0000
 
#define _EXTRACTOR_EXTERN   extern
 

Typedefs

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)
 
typedef void(* EXTRACTOR_extract_method) (struct EXTRACTOR_ExtractContext *ec)
 

Enumerations

enum  EXTRACTOR_Options { EXTRACTOR_OPTION_DEFAULT_POLICY = 0 , EXTRACTOR_OPTION_OUT_OF_PROCESS_NO_RESTART = 1 , EXTRACTOR_OPTION_IN_PROCESS = 2 , EXTRACTOR_OPTION_DISABLED = 3 }
 
enum  EXTRACTOR_MetaFormat { EXTRACTOR_METAFORMAT_UNKNOWN = 0 , EXTRACTOR_METAFORMAT_UTF8 = 1 , EXTRACTOR_METAFORMAT_BINARY = 2 , EXTRACTOR_METAFORMAT_C_STRING = 3 }
 
enum  EXTRACTOR_MetaType {
  EXTRACTOR_METATYPE_RESERVED = 0 , EXTRACTOR_METATYPE_MIMETYPE = 1 , EXTRACTOR_METATYPE_FILENAME = 2 , EXTRACTOR_METATYPE_COMMENT = 3 ,
  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 , 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 , 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 , 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 ,
  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 , 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 , 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 ,
  EXTRACTOR_METATYPE_IMAGE_DIMENSIONS = 112 , EXTRACTOR_METATYPE_PRODUCED_BY_SOFTWARE = 113 , EXTRACTOR_METATYPE_THUMBNAIL = 114 , EXTRACTOR_METATYPE_IMAGE_RESOLUTION = 115 ,
  EXTRACTOR_METATYPE_SOURCE = 116 , 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 ,
  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 , 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_AUDIO_PREVIEW = 228 , EXTRACTOR_METATYPE_NARINFO = 229 , EXTRACTOR_METATYPE_NAR = 230 , EXTRACTOR_METATYPE_LAST = 231
}
 

Functions

const char * EXTRACTOR_metatype_to_string (enum EXTRACTOR_MetaType type)
 
const char * EXTRACTOR_metatype_to_description (enum EXTRACTOR_MetaType type)
 
enum EXTRACTOR_MetaType EXTRACTOR_metatype_get_max (void)
 
struct EXTRACTOR_PluginListEXTRACTOR_plugin_add_defaults (enum EXTRACTOR_Options flags)
 
struct EXTRACTOR_PluginListEXTRACTOR_plugin_add (struct EXTRACTOR_PluginList *prev, const char *library, const char *options, enum EXTRACTOR_Options flags)
 
struct EXTRACTOR_PluginListEXTRACTOR_plugin_add_config (struct EXTRACTOR_PluginList *prev, const char *config, enum EXTRACTOR_Options flags)
 
struct EXTRACTOR_PluginListEXTRACTOR_plugin_remove (struct EXTRACTOR_PluginList *prev, const char *library)
 
void EXTRACTOR_plugin_remove_all (struct EXTRACTOR_PluginList *plugins)
 
void EXTRACTOR_extract (struct EXTRACTOR_PluginList *plugins, const char *filename, const void *data, size_t size, EXTRACTOR_MetaDataProcessor proc, void *proc_cls)
 
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)
 

Macro Definition Documentation

◆ _EXTRACTOR_EXTERN

#define _EXTRACTOR_EXTERN   extern

Definition at line 49 of file extractor.h.

◆ EXTRACTOR_VERSION

#define EXTRACTOR_VERSION   0x010B0000

0.2.6-1 => 0x00020601 4.5.2-0 => 0x04050200

Definition at line 38 of file extractor.h.

Typedef Documentation

◆ EXTRACTOR_extract_method

typedef void(* EXTRACTOR_extract_method) (struct EXTRACTOR_ExtractContext *ec)

Signature of the extract method that each plugin must provide.

Parameters
ecextraction context provided to the plugin

Definition at line 536 of file extractor.h.

◆ EXTRACTOR_MetaDataProcessor

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)

Type of a function that libextractor calls for each meta data item found.

Parameters
clsclosure (user-defined)
plugin_namename 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).
typelibextractor-type describing the meta data
formatbasic format information about data
data_mime_typemime-type of data (not of the original file); can be NULL (if mime-type is not known)
dataactual meta-data found
data_lennumber of bytes in data
Returns
0 to continue extracting, 1 to abort

Definition at line 459 of file extractor.h.

Enumeration Type Documentation

◆ EXTRACTOR_MetaFormat

Format in which the extracted meta data is presented.

Enumerator
EXTRACTOR_METAFORMAT_UNKNOWN 

Format is unknown.

EXTRACTOR_METAFORMAT_UTF8 

0-terminated, UTF-8 encoded string. "data_len" is strlen(data)+1.

EXTRACTOR_METAFORMAT_BINARY 

Some kind of binary format, see given Mime type.

EXTRACTOR_METAFORMAT_C_STRING 

0-terminated string. The specific encoding is unknown. "data_len" is strlen (data)+1.

Definition at line 91 of file extractor.h.

◆ EXTRACTOR_Options

Options for how plugin execution should be done.

Enumerator
EXTRACTOR_OPTION_DEFAULT_POLICY 

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_OUT_OF_PROCESS_NO_RESTART 

Deprecated option. Ignored.

EXTRACTOR_OPTION_IN_PROCESS 

Run plugins in-process. Unsafe, not recommended, can be nice for debugging.

EXTRACTOR_OPTION_DISABLED 

Internal value for plugins that have been disabled.

Definition at line 56 of file extractor.h.

Function Documentation

◆ EXTRACTOR_extract()

void EXTRACTOR_extract ( struct EXTRACTOR_PluginList plugins,
const char *  filename,
const void *  data,
size_t  size,
EXTRACTOR_MetaDataProcessor  proc,
void *  proc_cls 
)

Extract keywords from a file using the given set of plugins.

Parameters
pluginsthe list of plugins to use
filenamethe name of the file, can be NULL if data is not NULL
datadata of the file in memory, can be NULL (in which case libextractor will open file) if filename is not NULL
sizenumber of bytes in data, ignored if data is NULL
procfunction to call for each meta data item found
proc_clscls argument to proc

Extract keywords from a file using the given set of plugins. If needed, opens the file and loads its data (via mmap). Then decompresses it if the data is compressed. Finally runs the plugins on the (now possibly decompressed) data.

Parameters
pluginsthe list of plugins to use
filenamethe name of the file, can be NULL if data is not NULL
datadata of the file in memory, can be NULL (in which case libextractor will open file) if filename is not NULL
sizenumber of bytes in data, ignored if data is NULL
procfunction to call for each meta data item found
proc_clscls argument to proc

Definition at line 597 of file extractor.c.

References EXTRACTOR_PluginList::channel, DEFAULT_SHM_SIZE, do_extract(), EXTRACTOR_datasource_create_from_buffer_(), EXTRACTOR_datasource_create_from_file_(), EXTRACTOR_datasource_destroy_(), EXTRACTOR_IPC_channel_create_(), EXTRACTOR_IPC_shared_memory_change_rc_(), EXTRACTOR_IPC_shared_memory_create_(), EXTRACTOR_OPTION_IN_PROCESS, EXTRACTOR_PluginList::flags, LOG, EXTRACTOR_PluginList::next, NULL, EXTRACTOR_PluginList::round_finished, and EXTRACTOR_PluginList::shm.

Referenced by main().

◆ EXTRACTOR_meta_data_print()

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 
)

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.

Parameters
handlethe file to write to (stdout, stderr), must NOT be NULL, must be of type FILE *.
plugin_namename of the plugin that produced this value
typelibextractor-type describing the meta data
formatbasic format information about data
data_mime_typemime-type of data (not of the original file); can be NULL (if mime-type is not known)
dataactual meta-data found
data_lennumber of bytes in data
Returns
non-zero if printing failed, otherwise 0.

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.

Parameters
handlethe file to write to (stdout, stderr), must NOT be NULL, must be of type "FILE *".
plugin_namename of the plugin that produced this value
typelibextractor-type describing the meta data
formatbasic format information about data
data_mime_typemime-type of data (not of the original file); can be NULL (if mime-type is not known)
dataactual meta-data found
data_lennumber of bytes in data
Returns
non-zero if printing failed, otherwise 0.

Definition at line 49 of file extractor_print.c.

References dgettext, EXTRACTOR_METAFORMAT_UTF8, EXTRACTOR_metatype_to_string(), gettext_noop, iconv_helper(), LOG_STRERROR, NULL, and type.

◆ EXTRACTOR_plugin_add()

struct EXTRACTOR_PluginList * EXTRACTOR_plugin_add ( struct EXTRACTOR_PluginList prev,
const char *  library,
const char *  options,
enum EXTRACTOR_Options  flags 
)

Add a library for keyword extraction.

Parameters
prevthe previous list of libraries, may be NULL
librarythe name of the library (short handle, i.e. "mime")
optionsoptions to give to the library
flagsoptions to use
Returns
the new list of libraries, equal to prev iff an error occured

Add a library for keyword extraction.

Parameters
prevthe previous list of libraries, may be NULL
librarythe name of the library
optionsoptions to pass to the plugin
flagsoptions to use
Returns
the new list of libraries, equal to prev iff an error occurred

Definition at line 206 of file extractor_plugins.c.

References EXTRACTOR_find_plugin_(), EXTRACTOR_PluginList::flags, EXTRACTOR_PluginList::libname, LOG, EXTRACTOR_PluginList::next, NULL, EXTRACTOR_PluginList::plugin_options, EXTRACTOR_PluginList::seek_request, and EXTRACTOR_PluginList::short_libname.

Referenced by EXTRACTOR_plugin_add_config(), and load_plugins_from_dir().

◆ EXTRACTOR_plugin_add_config()

struct EXTRACTOR_PluginList * EXTRACTOR_plugin_add_config ( struct EXTRACTOR_PluginList prev,
const char *  config,
enum EXTRACTOR_Options  flags 
)

Load multiple libraries as specified by the user.

Parameters
configa 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.
prevthe previous list of libraries, may be NULL
flagsoptions to use
Returns
the new list of libraries, equal to prev iff an error occured or if config was empty (or NULL).

Load multiple libraries as specified by the user.

Parameters
configa string given by the user that defines which libraries should be loaded. Has the format "[[-]LIBRARYNAME[(options)][:[-]LIBRARYNAME[(options)]]]*". For example, 'mp3:ogg.so' loads the mp3 and the ogg library. The '-' before the LIBRARYNAME indicates that the library should be removed from the library list.
prevthe previous list of libraries, may be NULL
flagsoptions to use
Returns
the new list of libraries, equal to prev iff an error occurred or if config was empty (or NULL).

Definition at line 261 of file extractor_plugins.c.

References ABORT, EXTRACTOR_plugin_add(), EXTRACTOR_plugin_remove(), EXTRACTOR_PluginList::flags, and NULL.

Referenced by EXTRACTOR_plugin_add_defaults(), and main().

◆ EXTRACTOR_plugin_add_defaults()

struct EXTRACTOR_PluginList * EXTRACTOR_plugin_add_defaults ( enum EXTRACTOR_Options  flags)

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.

Parameters
flagsoptions for all of the plugins loaded
Returns
the default set of plugins, NULL if no plugins were found

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). Otherwise, it will load all of the installed plugins and return them.

Parameters
flagsoptions for all of the plugins loaded
Returns
the default set of plugins, NULL if no plugins were found

Definition at line 683 of file extractor_plugpath.c.

References EXTRACTOR_plugin_add_config(), DefaultLoaderContext::flags, get_installation_paths(), getenv(), load_plugins_from_dir(), NULL, and DefaultLoaderContext::res.

Referenced by main().

◆ EXTRACTOR_plugin_remove()

struct EXTRACTOR_PluginList * EXTRACTOR_plugin_remove ( struct EXTRACTOR_PluginList prev,
const char *  library 
)

Remove a plugin from a list.

Parameters
prevthe current list of plugins
librarythe name of the plugin to remove (short handle)
Returns
the reduced list, unchanged if the plugin was not loaded

Remove a plugin from a list.

Parameters
prevthe current list of plugins
librarythe name of the plugin to remove
Returns
the reduced list, unchanged if the plugin was not loaded

Definition at line 342 of file extractor_plugins.c.

References EXTRACTOR_PluginList::channel, EXTRACTOR_IPC_channel_destroy_(), EXTRACTOR_IPC_shared_memory_change_rc_(), EXTRACTOR_IPC_shared_memory_destroy_(), EXTRACTOR_PluginList::libname, EXTRACTOR_PluginList::libraryHandle, LOG, EXTRACTOR_PluginList::next, NULL, EXTRACTOR_PluginList::plugin_options, EXTRACTOR_PluginList::shm, and EXTRACTOR_PluginList::short_libname.

Referenced by EXTRACTOR_plugin_add_config(), and EXTRACTOR_plugin_remove_all().

◆ EXTRACTOR_plugin_remove_all()

void EXTRACTOR_plugin_remove_all ( struct EXTRACTOR_PluginList plugins)

Remove all plugins from the given list (destroys the list).

Parameters
pluginthe list of plugins

Definition at line 390 of file extractor_plugins.c.

References EXTRACTOR_plugin_remove(), NULL, and EXTRACTOR_PluginList::short_libname.

Referenced by main().