libextractor
1.11
About: GNU libextractor is a library used to extract meta-data from files of arbitrary type.
![]() ![]() |
command-line tool to run GNU libextractor More...
Go to the source code of this file.
Data Structures | |
struct | Help |
struct | BibTexMap |
Macros | |
#define | YES 1 |
#define | NO 0 |
#define | BORDER 29 |
Functions | |
static void | ignore_sigpipe () |
static void | format_help (const char *general, const char *description, const struct Help *opt) |
static void | print_help () |
static int | print_selected_keywords (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) |
static int | print_selected_keywords_grep_friendly (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) |
static void | cleanup_bibtex () |
static int | print_bibtex (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) |
static void | finish_bibtex (const char *fn) |
static char ** | _make_continuous_arg_copy (int argc, char *const *argv) |
static int | _get_utf8_args (int argc, char *const *argv, int *u8argc, char ***u8argv) |
int | main (int argc, char *argv[]) |
Variables | |
static int * | |
static int | verbose |
static int | in_process |
static int | from_memory |
static char * | entry_type |
static struct BibTexMap | btm [] |
command-line tool to run GNU libextractor
Definition in file extract.c.
|
static |
Returns utf-8 encoded arguments. Returned argv has u8argv[u8argc] == NULL. Returned argv is a single memory block, and can be freed with a single free () call.
argc | argc (as given by main()) |
argv | argv (as given by main()) |
u8argc | a location to store new argc in (though it's th same as argc) |
u8argv | a location to store new argv in |
Definition at line 690 of file extract.c.
References _make_continuous_arg_copy(), and NULL.
Referenced by main().
|
static |
Makes a copy of argv that consists of a single memory chunk that can be freed with a single call to free ();
Definition at line 654 of file extract.c.
References NULL.
Referenced by _get_utf8_args().
|
static |
Clean up the bibtex processor in preparation for the next round.
Definition at line 498 of file extract.c.
References BibTexMap::bibTexName, btm, entry_type, NULL, and BibTexMap::value.
Referenced by main().
|
static |
Print the computed bibTeX entry.
fn | file for which the entry was created. |
Definition at line 564 of file extract.c.
References BibTexMap::bibTexName, btm, entry_type, NULL, and BibTexMap::value.
Referenced by main().
|
static |
int main | ( | int | argc, |
char * | argv[] | ||
) |
Main function for the 'extract' tool. Invoke with a list of filenames to extract keywords from.
argc | number of arguments in argv |
argv | command line options and filename to run on |
Definition at line 753 of file extract.c.
References _, _get_utf8_args(), cleanup_bibtex(), EXTRACTOR_extract(), EXTRACTOR_metatype_get_max(), EXTRACTOR_metatype_to_string(), EXTRACTOR_OPTION_DEFAULT_POLICY, EXTRACTOR_OPTION_IN_PROCESS, EXTRACTOR_plugin_add_config(), EXTRACTOR_plugin_add_defaults(), EXTRACTOR_plugin_remove_all(), finish_bibtex(), from_memory, getopt_long(), gettext, ignore_sigpipe(), in_process, NO, NULL, optarg, optind, print, print_bibtex(), print_help(), print_selected_keywords(), print_selected_keywords_grep_friendly(), textdomain, verbose, and YES.
|
static |
Callback function for printing meta data in bibtex format.
cls | closure, not used |
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). |
type | libextractor-type describing the meta data |
format | basic format information about data |
data_mime_type | mime-type of data (not of the original file); can be NULL (if mime-type is not known) |
data | actual meta-data found |
data_len | number of bytes in data |
Definition at line 529 of file extract.c.
References BibTexMap::bibTexName, btm, entry_type, EXTRACTOR_METAFORMAT_UTF8, EXTRACTOR_METATYPE_BIBTEX_ENTRY_TYPE, BibTexMap::le_type, NULL, print, type, BibTexMap::value, and YES.
Referenced by main().
|
static |
Run –help.
Definition at line 215 of file extract.c.
References _, format_help(), gettext_noop, and NULL.
Referenced by main().
|
static |
Print a keyword list to a file.
cls | closure, not used |
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). |
type | libextractor-type describing the meta data |
format | basic format information about data |
data_mime_type | mime-type of data (not of the original file); can be NULL (if mime-type is not known) |
data | actual meta-data found |
data_len | number of bytes in data |
Definition at line 275 of file extract.c.
References _, EXTRACTOR_METAFORMAT_BINARY, EXTRACTOR_METAFORMAT_C_STRING, EXTRACTOR_METAFORMAT_UNKNOWN, EXTRACTOR_METAFORMAT_UTF8, EXTRACTOR_metatype_to_string(), gettext, iconv_helper(), NULL, print, type, verbose, and YES.
Referenced by main().
|
static |
Print a keyword list to a file without new lines.
cls | closure, not used |
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). |
type | libextractor-type describing the meta data |
format | basic format information about data |
data_mime_type | mime-type of data (not of the original file); can be NULL (if mime-type is not known) |
data | actual meta-data found |
data_len | number of bytes in data |
Definition at line 368 of file extract.c.
References EXTRACTOR_METAFORMAT_BINARY, EXTRACTOR_METAFORMAT_C_STRING, EXTRACTOR_METAFORMAT_UNKNOWN, EXTRACTOR_METAFORMAT_UTF8, EXTRACTOR_metatype_to_string(), gettext, gettext_noop, iconv_helper(), NULL, print, type, verbose, and YES.
Referenced by main().
|
static |
Mapping between bibTeX strings, libextractor meta data types and values for the current document.
Definition at line 462 of file extract.c.
Referenced by cleanup_bibtex(), finish_bibtex(), and print_bibtex().
|
static |
Type of the entry for bibtex.
Definition at line 462 of file extract.c.
Referenced by cleanup_bibtex(), finish_bibtex(), and print_bibtex().
|
static |
|
static |
|
static |
Which keyword types should we print?
Definition at line 37 of file extract.c.
Referenced by main(), print_bibtex(), print_selected_keywords(), and print_selected_keywords_grep_friendly().
|
static |
How verbose are we supposed to be?
Definition at line 42 of file extract.c.
Referenced by main(), print_selected_keywords(), and print_selected_keywords_grep_friendly().