aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_container_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_container_lib.h')
-rw-r--r--src/include/gnunet_container_lib.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h
index 778e5b84b..590c6a2fa 100644
--- a/src/include/gnunet_container_lib.h
+++ b/src/include/gnunet_container_lib.h
@@ -35,8 +35,102 @@
35 35
36/* add error and config prototypes */ 36/* add error and config prototypes */
37#include "gnunet_crypto_lib.h" 37#include "gnunet_crypto_lib.h"
38
39#if HAVE_EXTRACTOR_H
40
38#include <extractor.h> 41#include <extractor.h>
39 42
43#else
44
45/* definitions from extractor.h we need for the build */
46
47/**
48 * Enumeration defining various sources of keywords. See also
49 * http://dublincore.org/documents/1998/09/dces/
50 */
51enum EXTRACTOR_MetaType {
52 EXTRACTOR_METATYPE_RESERVED = 0,
53 EXTRACTOR_METATYPE_MIMETYPE = 1,
54 EXTRACTOR_METATYPE_FILENAME = 2,
55 EXTRACTOR_METATYPE_COMMENT = 3,
56 EXTRACTOR_METATYPE_TITLE = 4,
57 EXTRACTOR_METATYPE_BOOK_TITLE = 5,
58 EXTRACTOR_METATYPE_JOURNAL_NAME = 8,
59 EXTRACTOR_METATYPE_AUTHOR_NAME = 13,
60 EXTRACTOR_METATYPE_PUBLICATION_DATE = 24,
61 EXTRACTOR_METATYPE_URL = 29,
62 EXTRACTOR_METATYPE_URI = 30,
63 EXTRACTOR_METATYPE_ISRC = 31,
64 EXTRACTOR_METATYPE_UNKNOWN = 45,
65 EXTRACTOR_METATYPE_DESCRIPTION = 46,
66 EXTRACTOR_METATYPE_KEYWORDS = 49,
67 EXTRACTOR_METATYPE_SUBJECT = 52,
68 EXTRACTOR_METATYPE_PACKAGE_NAME = 69,
69 EXTRACTOR_METATYPE_THUMBNAIL = 114,
70 EXTRACTOR_METATYPE_ALBUM = 129,
71 EXTRACTOR_METATYPE_ARTIST = 130,
72 EXTRACTOR_METATYPE_ORIGINAL_TITLE = 162,
73 EXTRACTOR_METATYPE_GNUNET_FULL_DATA = 174,
74 EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME = 180,
75
76};
77
78/**
79 * Format in which the extracted meta data is presented.
80 */
81enum EXTRACTOR_MetaFormat {
82 /**
83 * Format is unknown.
84 */
85 EXTRACTOR_METAFORMAT_UNKNOWN = 0,
86
87 /**
88 * 0-terminated, UTF-8 encoded string. "data_len"
89 * is strlen(data)+1.
90 */
91 EXTRACTOR_METAFORMAT_UTF8 = 1,
92
93 /**
94 * Some kind of binary format, see given Mime type.
95 */
96 EXTRACTOR_METAFORMAT_BINARY = 2,
97
98 /**
99 * 0-terminated string. The specific encoding is unknown.
100 * "data_len" is strlen (data)+1.
101 */
102 EXTRACTOR_METAFORMAT_C_STRING = 3
103};
104
105
106/**
107 * Type of a function that libextractor calls for each
108 * meta data item found.
109 *
110 * @param cls closure (user-defined)
111 * @param plugin_name name of the plugin that produced this value;
112 * special values can be used (i.e. '&lt;zlib&gt;' for zlib being
113 * used in the main libextractor library and yielding
114 * meta data).
115 * @param type libextractor-type describing the meta data
116 * @param format basic format information about @a data
117 * @param data_mime_type mime-type of @a data (not of the original file);
118 * can be NULL (if mime-type is not known)
119 * @param data actual meta-data found
120 * @param data_len number of bytes in @a data
121 * @return 0 to continue extracting, 1 to abort
122 */
123typedef int
124(*EXTRACTOR_MetaDataProcessor) (void *cls,
125 const char *plugin_name,
126 enum EXTRACTOR_MetaType type,
127 enum EXTRACTOR_MetaFormat format,
128 const char *data_mime_type,
129 const char *data,
130 size_t data_len);
131
132#endif
133
40#ifndef EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME 134#ifndef EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME
41/* hack for LE < 0.6.3 */ 135/* hack for LE < 0.6.3 */
42#define EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME 180 136#define EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME 180