"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/include/extractor.h" between
libextractor-1.8.tar.gz and libextractor-1.9.tar.gz

About: GNU libextractor is a library used to extract meta-data from files of arbitrary type.

extractor.h  (libextractor-1.8):extractor.h  (libextractor-1.9)
skipping to change at line 37 skipping to change at line 37
} }
#endif #endif
#endif #endif
#include <stdint.h> #include <stdint.h>
/** /**
* 0.2.6-1 => 0x00020601 * 0.2.6-1 => 0x00020601
* 4.5.2-0 => 0x04050200 * 4.5.2-0 => 0x04050200
*/ */
#define EXTRACTOR_VERSION 0x01080000 #define EXTRACTOR_VERSION 0x01080001
#include <stdio.h> #include <stdio.h>
#ifndef _EXTRACTOR_EXTERN
#if defined(_WIN32) && defined(MHD_W32LIB)
#define _EXTRACTOR_EXTERN extern
#elif defined (_WIN32) && defined(MHD_W32DLL)
/* Define MHD_W32DLL when using MHD as W32 .DLL to speed up linker a little */
#define _EXTRACTOR_EXTERN __declspec(dllimport)
#else
#define _EXTRACTOR_EXTERN extern
#endif
#endif
/** /**
* Options for how plugin execution should be done. * Options for how plugin execution should be done.
*/ */
enum EXTRACTOR_Options enum EXTRACTOR_Options
{ {
/** /**
* Run plugin out-of-process, starting the process once the plugin * Run plugin out-of-process, starting the process once the plugin
* is to be run. If a plugin crashes, automatically restart the * is to be run. If a plugin crashes, automatically restart the
* respective process for the same file and try once more * respective process for the same file and try once more
skipping to change at line 401 skipping to change at line 412
/** /**
* Get the textual name of the keyword. * Get the textual name of the keyword.
* *
* @param type meta type to get a UTF-8 string for * @param type meta type to get a UTF-8 string for
* @return NULL if the type is not known, otherwise * @return NULL if the type is not known, otherwise
* an English (locale: C) string describing the type; * an English (locale: C) string describing the type;
* translate using `dgettext ("libextractor", rval)` * translate using `dgettext ("libextractor", rval)`
* @ingroup types * @ingroup types
*/ */
const char * _EXTRACTOR_EXTERN const char *
EXTRACTOR_metatype_to_string (enum EXTRACTOR_MetaType type); EXTRACTOR_metatype_to_string (enum EXTRACTOR_MetaType type);
/** /**
* Get a long description for the meta type. * Get a long description for the meta type.
* *
* @param type meta type to get a UTF-8 description for * @param type meta type to get a UTF-8 description for
* @return NULL if the type is not known, otherwise * @return NULL if the type is not known, otherwise
* an English (locale: C) string describing the type; * an English (locale: C) string describing the type;
* translate using `dgettext ("libextractor", rval)` * translate using `dgettext ("libextractor", rval)`
* @ingroup types * @ingroup types
*/ */
const char * _EXTRACTOR_EXTERN const char *
EXTRACTOR_metatype_to_description (enum EXTRACTOR_MetaType type); EXTRACTOR_metatype_to_description (enum EXTRACTOR_MetaType type);
/** /**
* Return the highest type number, exclusive as in [0,max). * Return the highest type number, exclusive as in [0,max).
* *
* @return highest legal metatype number for this version of libextractor * @return highest legal metatype number for this version of libextractor
* @ingroup types * @ingroup types
*/ */
enum EXTRACTOR_MetaType _EXTRACTOR_EXTERN enum EXTRACTOR_MetaType
EXTRACTOR_metatype_get_max (void); EXTRACTOR_metatype_get_max (void);
/** /**
* Type of a function that libextractor calls for each * Type of a function that libextractor calls for each
* meta data item found. * meta data item found.
* *
* @param cls closure (user-defined) * @param cls closure (user-defined)
* @param plugin_name name of the plugin that produced this value; * @param plugin_name name of the plugin that produced this value;
* special values can be used (i.e. '&lt;zlib&gt;' for zlib being * special values can be used (i.e. '&lt;zlib&gt;' for zlib being
* used in the main libextractor library and yielding * used in the main libextractor library and yielding
skipping to change at line 547 skipping to change at line 558
* *
* This environment variable must be set to the precise directory with * This environment variable must be set to the precise directory with
* the plugins (i.e. "/usr/lib/libextractor", not "/usr"). Note that * the plugins (i.e. "/usr/lib/libextractor", not "/usr"). Note that
* setting the environment variable will disable all of the methods * setting the environment variable will disable all of the methods
* that are typically used to determine the location of plugins. * that are typically used to determine the location of plugins.
* Multiple paths can be specified using ':' to separate them. * Multiple paths can be specified using ':' to separate them.
* *
* @param flags options for all of the plugins loaded * @param flags options for all of the plugins loaded
* @return the default set of plugins, NULL if no plugins were found * @return the default set of plugins, NULL if no plugins were found
*/ */
struct EXTRACTOR_PluginList * _EXTRACTOR_EXTERN struct EXTRACTOR_PluginList *
EXTRACTOR_plugin_add_defaults (enum EXTRACTOR_Options flags); EXTRACTOR_plugin_add_defaults (enum EXTRACTOR_Options flags);
/** /**
* Add a library for keyword extraction. * Add a library for keyword extraction.
* *
* @param prev the previous list of libraries, may be NULL * @param prev the previous list of libraries, may be NULL
* @param library the name of the library (short handle, i.e. "mime") * @param library the name of the library (short handle, i.e. "mime")
* @param options options to give to the library * @param options options to give to the library
* @param flags options to use * @param flags options to use
* @return the new list of libraries, equal to prev iff an error occured * @return the new list of libraries, equal to prev iff an error occured
*/ */
struct EXTRACTOR_PluginList * _EXTRACTOR_EXTERN struct EXTRACTOR_PluginList *
EXTRACTOR_plugin_add (struct EXTRACTOR_PluginList * prev, EXTRACTOR_plugin_add (struct EXTRACTOR_PluginList * prev,
const char *library, const char *library,
const char *options, const char *options,
enum EXTRACTOR_Options flags); enum EXTRACTOR_Options flags);
/** /**
* Load multiple libraries as specified by the user. * Load multiple libraries as specified by the user.
* *
* @param config a string given by the user that defines which * @param config a string given by the user that defines which
* libraries should be loaded. Has the format * libraries should be loaded. Has the format
* "[[-]LIBRARYNAME[(options)][:[-]LIBRARYNAME[(options)]]]*". * "[[-]LIBRARYNAME[(options)][:[-]LIBRARYNAME[(options)]]]*".
* For example, 'mp3:ogg' loads the * For example, 'mp3:ogg' loads the
* mp3 and the ogg plugins. The '-' before the LIBRARYNAME * mp3 and the ogg plugins. The '-' before the LIBRARYNAME
* indicates that the library should be removed from * indicates that the library should be removed from
* the library list. * the library list.
* @param prev the previous list of libraries, may be NULL * @param prev the previous list of libraries, may be NULL
* @param flags options to use * @param flags options to use
* @return the new list of libraries, equal to prev iff an error occured * @return the new list of libraries, equal to prev iff an error occured
* or if config was empty (or NULL). * or if config was empty (or NULL).
*/ */
struct EXTRACTOR_PluginList * _EXTRACTOR_EXTERN struct EXTRACTOR_PluginList *
EXTRACTOR_plugin_add_config (struct EXTRACTOR_PluginList *prev, EXTRACTOR_plugin_add_config (struct EXTRACTOR_PluginList *prev,
const char *config, const char *config,
enum EXTRACTOR_Options flags); enum EXTRACTOR_Options flags);
/** /**
* Remove a plugin from a list. * Remove a plugin from a list.
* *
* @param prev the current list of plugins * @param prev the current list of plugins
* @param library the name of the plugin to remove (short handle) * @param library the name of the plugin to remove (short handle)
* @return the reduced list, unchanged if the plugin was not loaded * @return the reduced list, unchanged if the plugin was not loaded
*/ */
struct EXTRACTOR_PluginList * _EXTRACTOR_EXTERN struct EXTRACTOR_PluginList *
EXTRACTOR_plugin_remove (struct EXTRACTOR_PluginList *prev, EXTRACTOR_plugin_remove (struct EXTRACTOR_PluginList *prev,
const char *library); const char *library);
/** /**
* Remove all plugins from the given list (destroys the list). * Remove all plugins from the given list (destroys the list).
* *
* @param plugin the list of plugins * @param plugin the list of plugins
*/ */
void _EXTRACTOR_EXTERN void
EXTRACTOR_plugin_remove_all (struct EXTRACTOR_PluginList *plugins); EXTRACTOR_plugin_remove_all (struct EXTRACTOR_PluginList *plugins);
/** /**
* Extract keywords from a file using the given set of plugins. * Extract keywords from a file using the given set of plugins.
* *
* @param plugins the list of plugins to use * @param plugins the list of plugins to use
* @param filename the name of the file, can be NULL if @a data is not NULL * @param filename the name of the file, can be NULL if @a data is not NULL
* @param data data of the file in memory, can be NULL (in which * @param data data of the file in memory, can be NULL (in which
* case libextractor will open file) if filename is not NULL * case libextractor will open file) if filename is not NULL
* @param size number of bytes in @a data, ignored if @a data is NULL * @param size number of bytes in @a data, ignored if @a data is NULL
* @param proc function to call for each meta data item found * @param proc function to call for each meta data item found
* @param proc_cls cls argument to @a proc * @param proc_cls cls argument to @a proc
*/ */
void _EXTRACTOR_EXTERN void
EXTRACTOR_extract (struct EXTRACTOR_PluginList *plugins, EXTRACTOR_extract (struct EXTRACTOR_PluginList *plugins,
const char *filename, const char *filename,
const void *data, const void *data,
size_t size, size_t size,
EXTRACTOR_MetaDataProcessor proc, EXTRACTOR_MetaDataProcessor proc,
void *proc_cls); void *proc_cls);
/** /**
* Simple #EXTRACTOR_MetaDataProcessor implementation that simply * Simple #EXTRACTOR_MetaDataProcessor implementation that simply
* prints the extracted meta data to the given file. Only prints * prints the extracted meta data to the given file. Only prints
skipping to change at line 639 skipping to change at line 650
* must be of type `FILE *`. * must be of type `FILE *`.
* @param plugin_name name of the plugin that produced this value * @param plugin_name name of the plugin that produced this value
* @param type libextractor-type describing the meta data * @param type libextractor-type describing the meta data
* @param format basic format information about data * @param format basic format information about data
* @param data_mime_type mime-type of @a data (not of the original file); * @param data_mime_type mime-type of @a data (not of the original file);
* can be NULL (if mime-type is not known) * can be NULL (if mime-type is not known)
* @param data actual meta-data found * @param data actual meta-data found
* @param data_len number of bytes in @a data * @param data_len number of bytes in @a data
* @return non-zero if printing failed, otherwise 0. * @return non-zero if printing failed, otherwise 0.
*/ */
int _EXTRACTOR_EXTERN int
EXTRACTOR_meta_data_print (void *handle, EXTRACTOR_meta_data_print (void *handle,
const char *plugin_name, const char *plugin_name,
enum EXTRACTOR_MetaType type, enum EXTRACTOR_MetaType type,
enum EXTRACTOR_MetaFormat format, enum EXTRACTOR_MetaFormat format,
const char *data_mime_type, const char *data_mime_type,
const char *data, const char *data,
size_t data_len); size_t data_len);
#if 0 /* keep Emacsens' auto-indent happy */ #if 0 /* keep Emacsens' auto-indent happy */
{ {
 End of changes. 12 change blocks. 
11 lines changed or deleted 22 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)