diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-05-30 18:35:02 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-05-30 18:35:02 +0000 |
commit | 93fba12ad8159dc6b683f9e7ce9f0528a11047f5 (patch) | |
tree | 73b1bd212c6c5a32adb924d208d8a315b606e854 /src | |
parent | cfd880578bd21f9adedba557291c903d325e93cd (diff) | |
download | gnunet-93fba12ad8159dc6b683f9e7ce9f0528a11047f5.tar.gz gnunet-93fba12ad8159dc6b683f9e7ce9f0528a11047f5.zip |
make libextractor actually optional, both for GNUnet and GNUnet-taler builds
Diffstat (limited to 'src')
34 files changed, 279 insertions, 66 deletions
diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am index 8ac42c18d..736339aab 100644 --- a/src/fs/Makefile.am +++ b/src/fs/Makefile.am | |||
@@ -51,7 +51,12 @@ libgnunetfs_la_SOURCES = \ | |||
51 | libgnunetfs_la_LIBADD = \ | 51 | libgnunetfs_la_LIBADD = \ |
52 | $(top_builddir)/src/datastore/libgnunetdatastore.la \ | 52 | $(top_builddir)/src/datastore/libgnunetdatastore.la \ |
53 | $(top_builddir)/src/util/libgnunetutil.la \ | 53 | $(top_builddir)/src/util/libgnunetutil.la \ |
54 | $(GN_LIBINTL) $(XLIB) $(LIBGCRYPT_LIBS) -lunistring -lextractor | 54 | $(GN_LIBINTL) $(XLIB) $(LIBGCRYPT_LIBS) -lunistring |
55 | |||
56 | if HAVE_LIBEXTRACTOR | ||
57 | libgnunetfs_la_LIBADD += \ | ||
58 | -lextractor | ||
59 | endif | ||
55 | 60 | ||
56 | libgnunetfs_la_LDFLAGS = \ | 61 | libgnunetfs_la_LDFLAGS = \ |
57 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 62 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ |
@@ -92,9 +97,13 @@ gnunet_directory_SOURCES = \ | |||
92 | gnunet_directory_LDADD = \ | 97 | gnunet_directory_LDADD = \ |
93 | libgnunetfs.la \ | 98 | libgnunetfs.la \ |
94 | $(top_builddir)/src/util/libgnunetutil.la \ | 99 | $(top_builddir)/src/util/libgnunetutil.la \ |
95 | -lextractor \ | ||
96 | $(GN_LIBINTL) | 100 | $(GN_LIBINTL) |
97 | 101 | ||
102 | if HAVE_LIBEXTRACTOR | ||
103 | gnunet_directory_LDADD += \ | ||
104 | -lextractor | ||
105 | endif | ||
106 | |||
98 | gnunet_fs_profiler_SOURCES = \ | 107 | gnunet_fs_profiler_SOURCES = \ |
99 | gnunet-fs-profiler.c | 108 | gnunet-fs-profiler.c |
100 | gnunet_fs_profiler_LDADD = \ | 109 | gnunet_fs_profiler_LDADD = \ |
@@ -107,9 +116,13 @@ gnunet_fs_SOURCES = \ | |||
107 | gnunet_fs_LDADD = \ | 116 | gnunet_fs_LDADD = \ |
108 | libgnunetfs.la \ | 117 | libgnunetfs.la \ |
109 | $(top_builddir)/src/util/libgnunetutil.la \ | 118 | $(top_builddir)/src/util/libgnunetutil.la \ |
110 | -lextractor \ | ||
111 | $(GN_LIBINTL) | 119 | $(GN_LIBINTL) |
112 | 120 | ||
121 | if HAVE_LIBEXTRACTOR | ||
122 | gnunet_fs_LDADD += \ | ||
123 | -lextractor | ||
124 | endif | ||
125 | |||
113 | gnunet_download_SOURCES = \ | 126 | gnunet_download_SOURCES = \ |
114 | gnunet-download.c | 127 | gnunet-download.c |
115 | gnunet_download_LDADD = \ | 128 | gnunet_download_LDADD = \ |
@@ -123,31 +136,48 @@ gnunet_publish_LDADD = \ | |||
123 | $(top_builddir)/src/identity/libgnunetidentity.la \ | 136 | $(top_builddir)/src/identity/libgnunetidentity.la \ |
124 | libgnunetfs.la \ | 137 | libgnunetfs.la \ |
125 | $(top_builddir)/src/util/libgnunetutil.la \ | 138 | $(top_builddir)/src/util/libgnunetutil.la \ |
126 | -lextractor \ | ||
127 | $(GN_LIBINTL) | 139 | $(GN_LIBINTL) |
128 | 140 | ||
141 | if HAVE_LIBEXTRACTOR | ||
142 | gnunet_publish_LDADD += \ | ||
143 | -lextractor | ||
144 | endif | ||
145 | |||
129 | gnunet_auto_share_SOURCES = \ | 146 | gnunet_auto_share_SOURCES = \ |
130 | gnunet-auto-share.c | 147 | gnunet-auto-share.c |
131 | gnunet_auto_share_LDADD = \ | 148 | gnunet_auto_share_LDADD = \ |
132 | $(top_builddir)/src/util/libgnunetutil.la \ | 149 | $(top_builddir)/src/util/libgnunetutil.la \ |
133 | -lextractor \ | ||
134 | $(GN_LIBINTL) | 150 | $(GN_LIBINTL) |
135 | 151 | ||
152 | if HAVE_LIBEXTRACTOR | ||
153 | gnunet_auto_share_LDADD += \ | ||
154 | -lextractor | ||
155 | endif | ||
156 | |||
136 | gnunet_helper_fs_publish_SOURCES = \ | 157 | gnunet_helper_fs_publish_SOURCES = \ |
137 | gnunet-helper-fs-publish.c | 158 | gnunet-helper-fs-publish.c |
138 | gnunet_helper_fs_publish_LDADD = \ | 159 | gnunet_helper_fs_publish_LDADD = \ |
139 | $(top_builddir)/src/util/libgnunetutil.la \ | 160 | $(top_builddir)/src/util/libgnunetutil.la \ |
140 | -lextractor \ | ||
141 | $(GN_LIBINTL) | 161 | $(GN_LIBINTL) |
142 | 162 | ||
163 | if HAVE_LIBEXTRACTOR | ||
164 | gnunet_helper_fs_publish_LDADD += \ | ||
165 | -lextractor | ||
166 | endif | ||
167 | |||
143 | gnunet_search_SOURCES = \ | 168 | gnunet_search_SOURCES = \ |
144 | gnunet-search.c | 169 | gnunet-search.c |
145 | gnunet_search_LDADD = \ | 170 | gnunet_search_LDADD = \ |
146 | libgnunetfs.la \ | 171 | libgnunetfs.la \ |
147 | $(top_builddir)/src/util/libgnunetutil.la \ | 172 | $(top_builddir)/src/util/libgnunetutil.la \ |
148 | -lextractor \ | ||
149 | $(GN_LIBINTL) | 173 | $(GN_LIBINTL) |
150 | 174 | ||
175 | if HAVE_LIBEXTRACTOR | ||
176 | gnunet_search_LDADD += \ | ||
177 | -lextractor | ||
178 | endif | ||
179 | |||
180 | |||
151 | gnunet_daemon_fsprofiler_SOURCES = \ | 181 | gnunet_daemon_fsprofiler_SOURCES = \ |
152 | gnunet-daemon-fsprofiler.c | 182 | gnunet-daemon-fsprofiler.c |
153 | gnunet_daemon_fsprofiler_LDADD = \ | 183 | gnunet_daemon_fsprofiler_LDADD = \ |
@@ -243,9 +273,13 @@ test_plugin_block_fs_LDADD = \ | |||
243 | 273 | ||
244 | if HAVE_PYTHON | 274 | if HAVE_PYTHON |
245 | check_SCRIPTS = \ | 275 | check_SCRIPTS = \ |
246 | test_gnunet_fs_psd.py \ | ||
247 | test_gnunet_fs_rec.py \ | 276 | test_gnunet_fs_rec.py \ |
248 | test_gnunet_fs_idx.py | 277 | test_gnunet_fs_idx.py |
278 | |||
279 | if HAVE_LIBEXTRACTOR | ||
280 | check_SCRIPTS += \ | ||
281 | test_gnunet_fs_psd.py | ||
282 | endif | ||
249 | endif | 283 | endif |
250 | 284 | ||
251 | if ENABLE_MONKEY | 285 | if ENABLE_MONKEY |
@@ -289,10 +323,15 @@ endif | |||
289 | test_fs_directory_SOURCES = \ | 323 | test_fs_directory_SOURCES = \ |
290 | test_fs_directory.c | 324 | test_fs_directory.c |
291 | test_fs_directory_LDADD = \ | 325 | test_fs_directory_LDADD = \ |
292 | -lextractor \ | ||
293 | libgnunetfs.la \ | 326 | libgnunetfs.la \ |
294 | $(top_builddir)/src/util/libgnunetutil.la | 327 | $(top_builddir)/src/util/libgnunetutil.la |
295 | 328 | ||
329 | if HAVE_LIBEXTRACTOR | ||
330 | test_fs_directory_LDADD += \ | ||
331 | -lextractor | ||
332 | endif | ||
333 | |||
334 | |||
296 | test_fs_download_SOURCES = \ | 335 | test_fs_download_SOURCES = \ |
297 | test_fs_download.c | 336 | test_fs_download.c |
298 | test_fs_download_LDADD = \ | 337 | test_fs_download_LDADD = \ |
@@ -324,10 +363,15 @@ test_fs_download_persistence_LDADD = \ | |||
324 | test_fs_file_information_SOURCES = \ | 363 | test_fs_file_information_SOURCES = \ |
325 | test_fs_file_information.c | 364 | test_fs_file_information.c |
326 | test_fs_file_information_LDADD = \ | 365 | test_fs_file_information_LDADD = \ |
327 | -lextractor \ | ||
328 | libgnunetfs.la \ | 366 | libgnunetfs.la \ |
329 | $(top_builddir)/src/util/libgnunetutil.la | 367 | $(top_builddir)/src/util/libgnunetutil.la |
330 | 368 | ||
369 | if HAVE_LIBEXTRACTOR | ||
370 | test_fs_file_information_LDADD += \ | ||
371 | -lextractor | ||
372 | endif | ||
373 | |||
374 | |||
331 | test_fs_getopt_SOURCES = \ | 375 | test_fs_getopt_SOURCES = \ |
332 | test_fs_getopt.c | 376 | test_fs_getopt.c |
333 | test_fs_getopt_LDADD = \ | 377 | test_fs_getopt_LDADD = \ |
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c index ffe2d191d..b787ca8fd 100644 --- a/src/fs/fs_file_information.c +++ b/src/fs/fs_file_information.c | |||
@@ -24,7 +24,9 @@ | |||
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #if HAVE_EXTRACTOR_H | ||
27 | #include <extractor.h> | 28 | #include <extractor.h> |
29 | #endif | ||
28 | #include "gnunet_fs_service.h" | 30 | #include "gnunet_fs_service.h" |
29 | #include "fs_api.h" | 31 | #include "fs_api.h" |
30 | #include "fs_tree.h" | 32 | #include "fs_tree.h" |
diff --git a/src/fs/fs_getopt.c b/src/fs/fs_getopt.c index d2ee34a94..86fc9578c 100644 --- a/src/fs/fs_getopt.c +++ b/src/fs/fs_getopt.c | |||
@@ -118,17 +118,20 @@ GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
118 | * @param scls must be of type "struct GNUNET_MetaData **" | 118 | * @param scls must be of type "struct GNUNET_MetaData **" |
119 | * @param option name of the option (typically 'k') | 119 | * @param option name of the option (typically 'k') |
120 | * @param value command line argument given | 120 | * @param value command line argument given |
121 | * @return GNUNET_OK on success | 121 | * @return #GNUNET_OK on success |
122 | */ | 122 | */ |
123 | int | 123 | int |
124 | GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext | 124 | GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, |
125 | *ctx, void *scls, const char *option, | 125 | void *scls, |
126 | const char *option, | ||
126 | const char *value) | 127 | const char *value) |
127 | { | 128 | { |
128 | struct GNUNET_CONTAINER_MetaData **mm = scls; | 129 | struct GNUNET_CONTAINER_MetaData **mm = scls; |
130 | #if HAVE_EXTRACTOR_H | ||
129 | enum EXTRACTOR_MetaType type; | 131 | enum EXTRACTOR_MetaType type; |
130 | const char *typename; | 132 | const char *typename; |
131 | const char *typename_i18n; | 133 | const char *typename_i18n; |
134 | #endif | ||
132 | struct GNUNET_CONTAINER_MetaData *meta; | 135 | struct GNUNET_CONTAINER_MetaData *meta; |
133 | char *tmp; | 136 | char *tmp; |
134 | 137 | ||
@@ -144,7 +147,7 @@ GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
144 | */ | 147 | */ |
145 | /*tmp = GNUNET_STRINGS_to_utf8 (value, strlen (value), locale_charset ());*/ | 148 | /*tmp = GNUNET_STRINGS_to_utf8 (value, strlen (value), locale_charset ());*/ |
146 | tmp = GNUNET_strdup (value); | 149 | tmp = GNUNET_strdup (value); |
147 | 150 | #if HAVE_EXTRACTOR_H | |
148 | type = EXTRACTOR_metatype_get_max (); | 151 | type = EXTRACTOR_metatype_get_max (); |
149 | while (type > 0) | 152 | while (type > 0) |
150 | { | 153 | { |
@@ -181,7 +184,9 @@ GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
181 | break; | 184 | break; |
182 | } | 185 | } |
183 | } | 186 | } |
184 | if (tmp != NULL) | 187 | #endif |
188 | |||
189 | if (NULL != tmp) | ||
185 | { | 190 | { |
186 | GNUNET_CONTAINER_meta_data_insert (meta, "<gnunet>", | 191 | GNUNET_CONTAINER_meta_data_insert (meta, "<gnunet>", |
187 | EXTRACTOR_METATYPE_UNKNOWN, | 192 | EXTRACTOR_METATYPE_UNKNOWN, |
diff --git a/src/fs/gnunet-directory.c b/src/fs/gnunet-directory.c index 536766abb..c06e1aca2 100644 --- a/src/fs/gnunet-directory.c +++ b/src/fs/gnunet-directory.c | |||
@@ -36,13 +36,17 @@ static int ret; | |||
36 | * @param format format of data | 36 | * @param format format of data |
37 | * @param data_mime_type mime type of data | 37 | * @param data_mime_type mime type of data |
38 | * @param data value of the meta data | 38 | * @param data value of the meta data |
39 | * @param data_size number of bytes in data | 39 | * @param data_size number of bytes in @a data |
40 | * @return always 0 (to continue iterating) | 40 | * @return always 0 (to continue iterating) |
41 | */ | 41 | */ |
42 | static int | 42 | static int |
43 | item_printer (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, | 43 | item_printer (void *cls, |
44 | enum EXTRACTOR_MetaFormat format, const char *data_mime_type, | 44 | const char *plugin_name, |
45 | const char *data, size_t data_size) | 45 | enum EXTRACTOR_MetaType type, |
46 | enum EXTRACTOR_MetaFormat format, | ||
47 | const char *data_mime_type, | ||
48 | const char *data, | ||
49 | size_t data_size) | ||
46 | { | 50 | { |
47 | if (type == EXTRACTOR_METATYPE_GNUNET_FULL_DATA) | 51 | if (type == EXTRACTOR_METATYPE_GNUNET_FULL_DATA) |
48 | { | 52 | { |
@@ -55,9 +59,16 @@ item_printer (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, | |||
55 | return 0; | 59 | return 0; |
56 | if (type == EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME) | 60 | if (type == EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME) |
57 | return 0; | 61 | return 0; |
62 | #if HAVE_LIBEXTRACTOR | ||
58 | printf ("\t%20s: %s\n", | 63 | printf ("\t%20s: %s\n", |
59 | dgettext (LIBEXTRACTOR_GETTEXT_DOMAIN, | 64 | dgettext (LIBEXTRACTOR_GETTEXT_DOMAIN, |
60 | EXTRACTOR_metatype_to_string (type)), data); | 65 | EXTRACTOR_metatype_to_string (type)), |
66 | data); | ||
67 | #else | ||
68 | printf ("\t%20d: %s\n", | ||
69 | type, | ||
70 | data); | ||
71 | #endif | ||
61 | return 0; | 72 | return 0; |
62 | } | 73 | } |
63 | 74 | ||
diff --git a/src/fs/gnunet-helper-fs-publish.c b/src/fs/gnunet-helper-fs-publish.c index 2e63b12a8..6c2c76fe9 100644 --- a/src/fs/gnunet-helper-fs-publish.c +++ b/src/fs/gnunet-helper-fs-publish.c | |||
@@ -82,10 +82,12 @@ struct ScanTreeNode | |||
82 | }; | 82 | }; |
83 | 83 | ||
84 | 84 | ||
85 | #if HAVE_LIBEXTRACTOR | ||
85 | /** | 86 | /** |
86 | * List of libextractor plugins to use for extracting. | 87 | * List of libextractor plugins to use for extracting. |
87 | */ | 88 | */ |
88 | static struct EXTRACTOR_PluginList *plugins; | 89 | static struct EXTRACTOR_PluginList *plugins; |
90 | #endif | ||
89 | 91 | ||
90 | /** | 92 | /** |
91 | * File descriptor we use for IPC with the parent. | 93 | * File descriptor we use for IPC with the parent. |
@@ -93,6 +95,7 @@ static struct EXTRACTOR_PluginList *plugins; | |||
93 | static int output_stream; | 95 | static int output_stream; |
94 | 96 | ||
95 | 97 | ||
98 | #if HAVE_LIBEXTRACTOR | ||
96 | /** | 99 | /** |
97 | * Add meta data that libextractor finds to our meta data | 100 | * Add meta data that libextractor finds to our meta data |
98 | * container. | 101 | * container. |
@@ -111,9 +114,13 @@ static int output_stream; | |||
111 | * @return always 0 to continue extracting | 114 | * @return always 0 to continue extracting |
112 | */ | 115 | */ |
113 | static int | 116 | static int |
114 | add_to_md (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, | 117 | add_to_md (void *cls, |
115 | enum EXTRACTOR_MetaFormat format, const char *data_mime_type, | 118 | const char *plugin_name, |
116 | const char *data, size_t data_len) | 119 | enum EXTRACTOR_MetaType type, |
120 | enum EXTRACTOR_MetaFormat format, | ||
121 | const char *data_mime_type, | ||
122 | const char *data, | ||
123 | size_t data_len) | ||
117 | { | 124 | { |
118 | struct GNUNET_CONTAINER_MetaData *md = cls; | 125 | struct GNUNET_CONTAINER_MetaData *md = cls; |
119 | 126 | ||
@@ -134,6 +141,7 @@ add_to_md (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, | |||
134 | } | 141 | } |
135 | return 0; | 142 | return 0; |
136 | } | 143 | } |
144 | #endif | ||
137 | 145 | ||
138 | 146 | ||
139 | /** | 147 | /** |
@@ -151,7 +159,7 @@ free_tree (struct ScanTreeNode *tree) | |||
151 | if (NULL != tree->parent) | 159 | if (NULL != tree->parent) |
152 | GNUNET_CONTAINER_DLL_remove (tree->parent->children_head, | 160 | GNUNET_CONTAINER_DLL_remove (tree->parent->children_head, |
153 | tree->parent->children_tail, | 161 | tree->parent->children_tail, |
154 | tree); | 162 | tree); |
155 | GNUNET_free (tree->filename); | 163 | GNUNET_free (tree->filename); |
156 | GNUNET_free (tree); | 164 | GNUNET_free (tree); |
157 | } | 165 | } |
@@ -383,7 +391,13 @@ extract_files (struct ScanTreeNode *item) | |||
383 | 391 | ||
384 | /* this is the expensive operation, *afterwards* we'll check for aborts */ | 392 | /* this is the expensive operation, *afterwards* we'll check for aborts */ |
385 | meta = GNUNET_CONTAINER_meta_data_create (); | 393 | meta = GNUNET_CONTAINER_meta_data_create (); |
386 | EXTRACTOR_extract (plugins, item->filename, NULL, 0, &add_to_md, meta); | 394 | #if HAVE_LIBEXTRACTOR |
395 | EXTRACTOR_extract (plugins, | ||
396 | item->filename, | ||
397 | NULL, 0, | ||
398 | &add_to_md, | ||
399 | meta); | ||
400 | #endif | ||
387 | slen = strlen (item->filename) + 1; | 401 | slen = strlen (item->filename) + 1; |
388 | size = GNUNET_CONTAINER_meta_data_get_serialized_size (meta); | 402 | size = GNUNET_CONTAINER_meta_data_get_serialized_size (meta); |
389 | if (-1 == size) | 403 | if (-1 == size) |
@@ -525,10 +539,12 @@ main (int argc, | |||
525 | if ( (NULL == ex) || | 539 | if ( (NULL == ex) || |
526 | (0 != strcmp (ex, "-")) ) | 540 | (0 != strcmp (ex, "-")) ) |
527 | { | 541 | { |
542 | #if HAVE_LIBEXTRACTOR | ||
528 | plugins = EXTRACTOR_plugin_add_defaults (EXTRACTOR_OPTION_DEFAULT_POLICY); | 543 | plugins = EXTRACTOR_plugin_add_defaults (EXTRACTOR_OPTION_DEFAULT_POLICY); |
529 | if (NULL != ex) | 544 | if (NULL != ex) |
530 | plugins = EXTRACTOR_plugin_add_config (plugins, ex, | 545 | plugins = EXTRACTOR_plugin_add_config (plugins, ex, |
531 | EXTRACTOR_OPTION_DEFAULT_POLICY); | 546 | EXTRACTOR_OPTION_DEFAULT_POLICY); |
547 | #endif | ||
532 | } | 548 | } |
533 | 549 | ||
534 | /* scan tree to find out how much work there is to be done */ | 550 | /* scan tree to find out how much work there is to be done */ |
@@ -536,7 +552,9 @@ main (int argc, | |||
536 | &root)) | 552 | &root)) |
537 | { | 553 | { |
538 | (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 0); | 554 | (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 0); |
555 | #if HAVE_LIBEXTRACTOR | ||
539 | EXTRACTOR_plugin_remove_all (plugins); | 556 | EXTRACTOR_plugin_remove_all (plugins); |
557 | #endif | ||
540 | #if WINDOWS | 558 | #if WINDOWS |
541 | GNUNET_free ((void*) argv); | 559 | GNUNET_free ((void*) argv); |
542 | #endif | 560 | #endif |
@@ -547,7 +565,9 @@ main (int argc, | |||
547 | if (GNUNET_OK != | 565 | if (GNUNET_OK != |
548 | write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_COUNTING_DONE, NULL, 0)) | 566 | write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_COUNTING_DONE, NULL, 0)) |
549 | { | 567 | { |
568 | #if HAVE_LIBEXTRACTOR | ||
550 | EXTRACTOR_plugin_remove_all (plugins); | 569 | EXTRACTOR_plugin_remove_all (plugins); |
570 | #endif | ||
551 | #if WINDOWS | 571 | #if WINDOWS |
552 | GNUNET_free ((void*) argv); | 572 | GNUNET_free ((void*) argv); |
553 | #endif | 573 | #endif |
@@ -560,7 +580,9 @@ main (int argc, | |||
560 | { | 580 | { |
561 | (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 0); | 581 | (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 0); |
562 | free_tree (root); | 582 | free_tree (root); |
583 | #if HAVE_LIBEXTRACTOR | ||
563 | EXTRACTOR_plugin_remove_all (plugins); | 584 | EXTRACTOR_plugin_remove_all (plugins); |
585 | #endif | ||
564 | #if WINDOWS | 586 | #if WINDOWS |
565 | GNUNET_free ((void*) argv); | 587 | GNUNET_free ((void*) argv); |
566 | #endif | 588 | #endif |
@@ -570,7 +592,9 @@ main (int argc, | |||
570 | } | 592 | } |
571 | /* enable "clean" shutdown by telling parent that we are done */ | 593 | /* enable "clean" shutdown by telling parent that we are done */ |
572 | (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_FINISHED, NULL, 0); | 594 | (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_FINISHED, NULL, 0); |
595 | #if HAVE_LIBEXTRACTOR | ||
573 | EXTRACTOR_plugin_remove_all (plugins); | 596 | EXTRACTOR_plugin_remove_all (plugins); |
597 | #endif | ||
574 | #if WINDOWS | 598 | #if WINDOWS |
575 | GNUNET_free ((void*) argv); | 599 | GNUNET_free ((void*) argv); |
576 | #endif | 600 | #endif |
@@ -578,4 +602,3 @@ main (int argc, | |||
578 | } | 602 | } |
579 | 603 | ||
580 | /* end of gnunet-helper-fs-publish.c */ | 604 | /* end of gnunet-helper-fs-publish.c */ |
581 | |||
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c index b213218e4..7844acd96 100644 --- a/src/fs/gnunet-publish.c +++ b/src/fs/gnunet-publish.c | |||
@@ -348,7 +348,11 @@ meta_printer (void *cls, | |||
348 | return 0; | 348 | return 0; |
349 | if (EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME == type) | 349 | if (EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME == type) |
350 | return 0; | 350 | return 0; |
351 | #if HAVE_LIBEXTRACTOR | ||
351 | FPRINTF (stdout, "\t%s - %s\n", EXTRACTOR_metatype_to_string (type), data); | 352 | FPRINTF (stdout, "\t%s - %s\n", EXTRACTOR_metatype_to_string (type), data); |
353 | #else | ||
354 | FPRINTF (stdout, "\t%d - %s\n", type, data); | ||
355 | #endif | ||
352 | return 0; | 356 | return 0; |
353 | } | 357 | } |
354 | 358 | ||
diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c index 395fb9ffe..9065922e1 100644 --- a/src/fs/gnunet-search.c +++ b/src/fs/gnunet-search.c | |||
@@ -82,9 +82,15 @@ item_printer (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, | |||
82 | return 0; | 82 | return 0; |
83 | if (type == EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME) | 83 | if (type == EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME) |
84 | return 0; | 84 | return 0; |
85 | #if HAVE_LIBEXTRACTOR | ||
85 | printf ("\t%20s: %s\n", | 86 | printf ("\t%20s: %s\n", |
86 | dgettext (LIBEXTRACTOR_GETTEXT_DOMAIN, | 87 | dgettext (LIBEXTRACTOR_GETTEXT_DOMAIN, |
87 | EXTRACTOR_metatype_to_string (type)), data); | 88 | EXTRACTOR_metatype_to_string (type)), data); |
89 | #else | ||
90 | printf ("\t%20d: %s\n", | ||
91 | type, | ||
92 | data); | ||
93 | #endif | ||
88 | return 0; | 94 | return 0; |
89 | } | 95 | } |
90 | 96 | ||
diff --git a/src/fs/test_fs_directory.c b/src/fs/test_fs_directory.c index bdbaf906f..4960b8922 100644 --- a/src/fs/test_fs_directory.c +++ b/src/fs/test_fs_directory.c | |||
@@ -17,15 +17,15 @@ | |||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | |||
21 | /** | 20 | /** |
22 | * @file fs/test_fs_directory.c | 21 | * @file fs/test_fs_directory.c |
23 | * @brief Test for fs_directory.c | 22 | * @brief Test for fs_directory.c |
24 | * @author Christian Grothoff | 23 | * @author Christian Grothoff |
25 | */ | 24 | */ |
26 | |||
27 | #include "platform.h" | 25 | #include "platform.h" |
26 | #if HAVE_EXTRACTOR_H | ||
28 | #include <extractor.h> | 27 | #include <extractor.h> |
28 | #endif | ||
29 | #include "gnunet_util_lib.h" | 29 | #include "gnunet_util_lib.h" |
30 | #include "gnunet_fs_service.h" | 30 | #include "gnunet_fs_service.h" |
31 | #include "fs_api.h" | 31 | #include "fs_api.h" |
@@ -99,7 +99,11 @@ testDirectory (unsigned int i) | |||
99 | { | 99 | { |
100 | GNUNET_snprintf (txt, sizeof (txt), "%u -- %u\n", p, q); | 100 | GNUNET_snprintf (txt, sizeof (txt), "%u -- %u\n", p, q); |
101 | GNUNET_CONTAINER_meta_data_insert (mds[p], "<test>", | 101 | GNUNET_CONTAINER_meta_data_insert (mds[p], "<test>", |
102 | #if HAVE_EXTRACTOR_H | ||
102 | q % EXTRACTOR_metatype_get_max (), | 103 | q % EXTRACTOR_metatype_get_max (), |
104 | #else | ||
105 | q % 128, | ||
106 | #endif | ||
103 | EXTRACTOR_METAFORMAT_UTF8, | 107 | EXTRACTOR_METAFORMAT_UTF8, |
104 | "text/plain", txt, strlen (txt) + 1); | 108 | "text/plain", txt, strlen (txt) + 1); |
105 | } | 109 | } |
diff --git a/src/include/Makefile.am b/src/include/Makefile.am index c8e40bc27..af6d02ada 100644 --- a/src/include/Makefile.am +++ b/src/include/Makefile.am | |||
@@ -17,11 +17,8 @@ if TALER_ONLY | |||
17 | gnunetinclude_HEADERS = \ | 17 | gnunetinclude_HEADERS = \ |
18 | platform.h plibc.h $(WINPROC) gettext.h \ | 18 | platform.h plibc.h $(WINPROC) gettext.h \ |
19 | gnunet_common.h \ | 19 | gnunet_common.h \ |
20 | gnunet_configuration_lib.h \ | ||
21 | gnunet_container_lib.h \ | 20 | gnunet_container_lib.h \ |
22 | gnunet_crypto_lib.h \ | 21 | gnunet_crypto_lib.h \ |
23 | gnunet_disk_lib.h \ | ||
24 | gnunet_scheduler_lib.h \ | ||
25 | gnunet_strings_lib.h \ | 22 | gnunet_strings_lib.h \ |
26 | gnunet_time_lib.h \ | 23 | gnunet_time_lib.h \ |
27 | gnunet_util_taler_wallet_lib.h | 24 | gnunet_util_taler_wallet_lib.h |
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h index 2aaaac583..0939424a3 100644 --- a/src/include/gnunet_configuration_lib.h +++ b/src/include/gnunet_configuration_lib.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #ifndef GNUNET_CONFIGURATION_LIB_H | 28 | #ifndef GNUNET_CONFIGURATION_LIB_H |
29 | #define GNUNET_CONFIGURATION_LIB_H | 29 | #define GNUNET_CONFIGURATION_LIB_H |
30 | 30 | ||
31 | #include "gnunet_time_lib.h" | ||
31 | 32 | ||
32 | #ifdef __cplusplus | 33 | #ifdef __cplusplus |
33 | extern "C" | 34 | extern "C" |
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 | */ | ||
51 | enum 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 | */ | ||
81 | enum 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. '<zlib>' 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 | */ | ||
123 | typedef 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 |
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index ff337e797..99508af43 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -54,9 +54,13 @@ struct GNUNET_HashCode; | |||
54 | struct GNUNET_PeerIdentity; | 54 | struct GNUNET_PeerIdentity; |
55 | 55 | ||
56 | #include "gnunet_common.h" | 56 | #include "gnunet_common.h" |
57 | #include "gnunet_scheduler_lib.h" | ||
58 | #include <gcrypt.h> | 57 | #include <gcrypt.h> |
59 | 58 | ||
59 | /** | ||
60 | * We need this enum here, but not the entire scheduler API. | ||
61 | * For the full definition, see gnunet_scheduler_lib.h. | ||
62 | */ | ||
63 | enum GNUNET_SCHEDULER_Priority; | ||
60 | 64 | ||
61 | /** | 65 | /** |
62 | * @brief A 512-bit hashcode | 66 | * @brief A 512-bit hashcode |
diff --git a/src/include/gnunet_util_taler_wallet_lib.h b/src/include/gnunet_util_taler_wallet_lib.h index ff3b2613b..a1db60de5 100644 --- a/src/include/gnunet_util_taler_wallet_lib.h +++ b/src/include/gnunet_util_taler_wallet_lib.h | |||
@@ -43,7 +43,6 @@ extern "C" | |||
43 | 43 | ||
44 | #include "gnunet_crypto_lib.h" | 44 | #include "gnunet_crypto_lib.h" |
45 | #include "gnunet_container_lib.h" | 45 | #include "gnunet_container_lib.h" |
46 | #include "gnunet_disk_lib.h" | ||
47 | #include "gnunet_strings_lib.h" | 46 | #include "gnunet_strings_lib.h" |
48 | 47 | ||
49 | #if 0 /* keep Emacsens' auto-indent happy */ | 48 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/util/Makefile.am b/src/util/Makefile.am index a2482fc87..916a588fa 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am | |||
@@ -128,7 +128,6 @@ libgnunetutil_taler_wallet_la_SOURCES = \ | |||
128 | common_allocation.c \ | 128 | common_allocation.c \ |
129 | common_endian.c \ | 129 | common_endian.c \ |
130 | common_logging.c \ | 130 | common_logging.c \ |
131 | configuration.c \ | ||
132 | container_heap.c \ | 131 | container_heap.c \ |
133 | container_multihashmap.c \ | 132 | container_multihashmap.c \ |
134 | container_multihashmap32.c \ | 133 | container_multihashmap32.c \ |
@@ -141,8 +140,6 @@ libgnunetutil_taler_wallet_la_SOURCES = \ | |||
141 | crypto_mpi.c \ | 140 | crypto_mpi.c \ |
142 | crypto_random.c \ | 141 | crypto_random.c \ |
143 | crypto_rsa.c \ | 142 | crypto_rsa.c \ |
144 | disk.c \ | ||
145 | disk.h \ | ||
146 | strings.c \ | 143 | strings.c \ |
147 | time.c | 144 | time.c |
148 | 145 | ||
diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c index 5280d73b2..4fdc05f10 100644 --- a/src/util/common_allocation.c +++ b/src/util/common_allocation.c | |||
@@ -24,7 +24,7 @@ | |||
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_util_lib.h" | 27 | #include "gnunet_crypto_lib.h" |
28 | #if HAVE_MALLOC_H | 28 | #if HAVE_MALLOC_H |
29 | #include <malloc.h> | 29 | #include <malloc.h> |
30 | #endif | 30 | #endif |
diff --git a/src/util/common_endian.c b/src/util/common_endian.c index 4a8a01664..e6c34250a 100644 --- a/src/util/common_endian.c +++ b/src/util/common_endian.c | |||
@@ -26,7 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "platform.h" | 28 | #include "platform.h" |
29 | #include "gnunet_util_lib.h" | 29 | #include "gnunet_crypto_lib.h" |
30 | 30 | ||
31 | #define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__) | 31 | #define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__) |
32 | 32 | ||
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 695b49913..492d00dc6 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -24,7 +24,8 @@ | |||
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_util_lib.h" | 27 | #include "gnunet_crypto_lib.h" |
28 | #include "gnunet_strings_lib.h" | ||
28 | #include <regex.h> | 29 | #include <regex.h> |
29 | 30 | ||
30 | 31 | ||
@@ -328,7 +329,6 @@ setup_log_file (const struct tm *tm) | |||
328 | { | 329 | { |
329 | static char last_fn[PATH_MAX + 1]; | 330 | static char last_fn[PATH_MAX + 1]; |
330 | char fn[PATH_MAX + 1]; | 331 | char fn[PATH_MAX + 1]; |
331 | int dirwarn; | ||
332 | int altlog_fd; | 332 | int altlog_fd; |
333 | int dup_return; | 333 | int dup_return; |
334 | FILE *altlog; | 334 | FILE *altlog; |
@@ -352,7 +352,6 @@ setup_log_file (const struct tm *tm) | |||
352 | return GNUNET_OK; /* no change */ | 352 | return GNUNET_OK; /* no change */ |
353 | log_rotate (last_fn); | 353 | log_rotate (last_fn); |
354 | strcpy (last_fn, fn); | 354 | strcpy (last_fn, fn); |
355 | dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn)); | ||
356 | #if WINDOWS | 355 | #if WINDOWS |
357 | altlog_fd = OPEN (fn, O_APPEND | | 356 | altlog_fd = OPEN (fn, O_APPEND | |
358 | O_BINARY | | 357 | O_BINARY | |
@@ -386,16 +385,13 @@ setup_log_file (const struct tm *tm) | |||
386 | if (-1 == altlog_fd) | 385 | if (-1 == altlog_fd) |
387 | { | 386 | { |
388 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "open", fn); | 387 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "open", fn); |
389 | if (dirwarn) | ||
390 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
391 | _("Failed to create or access directory for log file `%s'\n"), | ||
392 | fn); | ||
393 | return GNUNET_SYSERR; | 388 | return GNUNET_SYSERR; |
394 | } | 389 | } |
395 | GNUNET_stderr = altlog; | 390 | GNUNET_stderr = altlog; |
396 | return GNUNET_OK; | 391 | return GNUNET_OK; |
397 | } | 392 | } |
398 | 393 | ||
394 | |||
399 | /** | 395 | /** |
400 | * Utility function - adds a parsed definition to logdefs array. | 396 | * Utility function - adds a parsed definition to logdefs array. |
401 | * | 397 | * |
diff --git a/src/util/configuration.c b/src/util/configuration.c index f61b43d57..3c7570981 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c | |||
@@ -25,7 +25,10 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_crypto_lib.h" |
29 | #include "gnunet_strings_lib.h" | ||
30 | #include "gnunet_configuration_lib.h" | ||
31 | #include "gnunet_disk_lib.h" | ||
29 | 32 | ||
30 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) | 33 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) |
31 | 34 | ||
diff --git a/src/util/container_heap.c b/src/util/container_heap.c index 8c3de6c26..ad96af01d 100644 --- a/src/util/container_heap.c +++ b/src/util/container_heap.c | |||
@@ -26,7 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "platform.h" | 28 | #include "platform.h" |
29 | #include "gnunet_util_lib.h" | 29 | #include "gnunet_container_lib.h" |
30 | 30 | ||
31 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) | 31 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) |
32 | 32 | ||
diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c index 622b45334..5cef31f37 100644 --- a/src/util/container_meta_data.c +++ b/src/util/container_meta_data.c | |||
@@ -26,7 +26,9 @@ | |||
26 | 26 | ||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_util_lib.h" |
29 | #if HAVE_EXTRACTOR_H | ||
29 | #include <extractor.h> | 30 | #include <extractor.h> |
31 | #endif | ||
30 | #include <zlib.h> | 32 | #include <zlib.h> |
31 | 33 | ||
32 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) | 34 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) |
@@ -432,7 +434,8 @@ GNUNET_CONTAINER_meta_data_add_publication_date (struct | |||
432 | struct GNUNET_TIME_Absolute t; | 434 | struct GNUNET_TIME_Absolute t; |
433 | 435 | ||
434 | t = GNUNET_TIME_absolute_get (); | 436 | t = GNUNET_TIME_absolute_get (); |
435 | GNUNET_CONTAINER_meta_data_delete (md, EXTRACTOR_METATYPE_PUBLICATION_DATE, | 437 | GNUNET_CONTAINER_meta_data_delete (md, |
438 | EXTRACTOR_METATYPE_PUBLICATION_DATE, | ||
436 | NULL, 0); | 439 | NULL, 0); |
437 | dat = GNUNET_STRINGS_absolute_time_to_string (t); | 440 | dat = GNUNET_STRINGS_absolute_time_to_string (t); |
438 | GNUNET_CONTAINER_meta_data_insert (md, "<gnunet>", | 441 | GNUNET_CONTAINER_meta_data_insert (md, "<gnunet>", |
@@ -481,8 +484,8 @@ GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData *md, | |||
481 | * @return NULL if no entry was found | 484 | * @return NULL if no entry was found |
482 | */ | 485 | */ |
483 | char * | 486 | char * |
484 | GNUNET_CONTAINER_meta_data_get_by_type (const struct GNUNET_CONTAINER_MetaData | 487 | GNUNET_CONTAINER_meta_data_get_by_type (const struct GNUNET_CONTAINER_MetaData *md, |
485 | *md, enum EXTRACTOR_MetaType type) | 488 | enum EXTRACTOR_MetaType type) |
486 | { | 489 | { |
487 | struct MetaItem *pos; | 490 | struct MetaItem *pos; |
488 | 491 | ||
diff --git a/src/util/container_multihashmap.c b/src/util/container_multihashmap.c index df6dd5704..46379b34e 100644 --- a/src/util/container_multihashmap.c +++ b/src/util/container_multihashmap.c | |||
@@ -24,7 +24,7 @@ | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_util_lib.h" | 27 | #include "gnunet_container_lib.h" |
28 | 28 | ||
29 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) | 29 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) |
30 | 30 | ||
diff --git a/src/util/container_multihashmap32.c b/src/util/container_multihashmap32.c index 00dee18cd..d7b8413c4 100644 --- a/src/util/container_multihashmap32.c +++ b/src/util/container_multihashmap32.c | |||
@@ -26,7 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "platform.h" | 28 | #include "platform.h" |
29 | #include "gnunet_util_lib.h" | 29 | #include "gnunet_container_lib.h" |
30 | 30 | ||
31 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) | 31 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) |
32 | 32 | ||
diff --git a/src/util/crypto_crc.c b/src/util/crypto_crc.c index 252cdad05..5a8357478 100644 --- a/src/util/crypto_crc.c +++ b/src/util/crypto_crc.c | |||
@@ -28,7 +28,7 @@ | |||
28 | * @author Christian Grothoff | 28 | * @author Christian Grothoff |
29 | */ | 29 | */ |
30 | #include "platform.h" | 30 | #include "platform.h" |
31 | #include "gnunet_util_lib.h" | 31 | #include "gnunet_crypto_lib.h" |
32 | 32 | ||
33 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) | 33 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) |
34 | 34 | ||
diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c index 87c787185..adeaf77c8 100644 --- a/src/util/crypto_ecc.c +++ b/src/util/crypto_ecc.c | |||
@@ -25,7 +25,8 @@ | |||
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include <gcrypt.h> | 27 | #include <gcrypt.h> |
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_crypto_lib.h" |
29 | #include "gnunet_strings_lib.h" | ||
29 | 30 | ||
30 | #define EXTRA_CHECKS 0 | 31 | #define EXTRA_CHECKS 0 |
31 | 32 | ||
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c index e9f25bf84..8e5730ffd 100644 --- a/src/util/crypto_hash.c +++ b/src/util/crypto_hash.c | |||
@@ -24,7 +24,8 @@ | |||
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_util_lib.h" | 27 | #include "gnunet_crypto_lib.h" |
28 | #include "gnunet_strings_lib.h" | ||
28 | #include <gcrypt.h> | 29 | #include <gcrypt.h> |
29 | 30 | ||
30 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) | 31 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) |
diff --git a/src/util/crypto_mpi.c b/src/util/crypto_mpi.c index 806a35da8..ad64778fd 100644 --- a/src/util/crypto_mpi.c +++ b/src/util/crypto_mpi.c | |||
@@ -26,7 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include <gcrypt.h> | 28 | #include <gcrypt.h> |
29 | #include "gnunet_util_lib.h" | 29 | #include "gnunet_crypto_lib.h" |
30 | 30 | ||
31 | 31 | ||
32 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) | 32 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) |
diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c index 2960af17e..f9a0664e2 100644 --- a/src/util/crypto_random.c +++ b/src/util/crypto_random.c | |||
@@ -25,7 +25,7 @@ | |||
25 | * @author Christian Grothoff | 25 | * @author Christian Grothoff |
26 | */ | 26 | */ |
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_crypto_lib.h" |
29 | #include <gcrypt.h> | 29 | #include <gcrypt.h> |
30 | 30 | ||
31 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) | 31 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) |
diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c index 0b21b40b4..b8e29146f 100644 --- a/src/util/crypto_rsa.c +++ b/src/util/crypto_rsa.c | |||
@@ -22,7 +22,7 @@ | |||
22 | */ | 22 | */ |
23 | #include "platform.h" | 23 | #include "platform.h" |
24 | #include <gcrypt.h> | 24 | #include <gcrypt.h> |
25 | #include "gnunet_util_lib.h" | 25 | #include "gnunet_crypto_lib.h" |
26 | 26 | ||
27 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) | 27 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) |
28 | 28 | ||
@@ -413,7 +413,7 @@ GNUNET_CRYPTO_rsa_blinding_key_create (unsigned int len) | |||
413 | 413 | ||
414 | /** | 414 | /** |
415 | * Compare the values of two blinding keys. | 415 | * Compare the values of two blinding keys. |
416 | * | 416 | * |
417 | * @param b1 one key | 417 | * @param b1 one key |
418 | * @param b2 the other key | 418 | * @param b2 the other key |
419 | * @return 0 if the two are equal | 419 | * @return 0 if the two are equal |
@@ -443,7 +443,7 @@ GNUNET_CRYPTO_rsa_signature_cmp (struct GNUNET_CRYPTO_rsa_Signature *s1, | |||
443 | size_t z1; | 443 | size_t z1; |
444 | size_t z2; | 444 | size_t z2; |
445 | int ret; | 445 | int ret; |
446 | 446 | ||
447 | z1 = GNUNET_CRYPTO_rsa_signature_encode (s1, | 447 | z1 = GNUNET_CRYPTO_rsa_signature_encode (s1, |
448 | &b1); | 448 | &b1); |
449 | z2 = GNUNET_CRYPTO_rsa_signature_encode (s2, | 449 | z2 = GNUNET_CRYPTO_rsa_signature_encode (s2, |
@@ -476,7 +476,7 @@ GNUNET_CRYPTO_rsa_public_key_cmp (struct GNUNET_CRYPTO_rsa_PublicKey *p1, | |||
476 | size_t z1; | 476 | size_t z1; |
477 | size_t z2; | 477 | size_t z2; |
478 | int ret; | 478 | int ret; |
479 | 479 | ||
480 | z1 = GNUNET_CRYPTO_rsa_public_key_encode (p1, | 480 | z1 = GNUNET_CRYPTO_rsa_public_key_encode (p1, |
481 | &b1); | 481 | &b1); |
482 | z2 = GNUNET_CRYPTO_rsa_public_key_encode (p2, | 482 | z2 = GNUNET_CRYPTO_rsa_public_key_encode (p2, |
diff --git a/src/util/crypto_symmetric.c b/src/util/crypto_symmetric.c index 455166546..6465d5eb6 100644 --- a/src/util/crypto_symmetric.c +++ b/src/util/crypto_symmetric.c | |||
@@ -26,7 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "platform.h" | 28 | #include "platform.h" |
29 | #include "gnunet_util_lib.h" | 29 | #include "gnunet_crypto_lib.h" |
30 | #include <gcrypt.h> | 30 | #include <gcrypt.h> |
31 | 31 | ||
32 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) | 32 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) |
diff --git a/src/util/disk.c b/src/util/disk.c index a56966d04..c9f6408e8 100644 --- a/src/util/disk.c +++ b/src/util/disk.c | |||
@@ -24,8 +24,9 @@ | |||
24 | * @author Nils Durner | 24 | * @author Nils Durner |
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_util_lib.h" | ||
28 | #include "disk.h" | 27 | #include "disk.h" |
28 | #include "gnunet_strings_lib.h" | ||
29 | #include "gnunet_disk_lib.h" | ||
29 | 30 | ||
30 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) | 31 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) |
31 | 32 | ||
diff --git a/src/util/disk.h b/src/util/disk.h index 1dfec216f..2592bd8c0 100644 --- a/src/util/disk.h +++ b/src/util/disk.h | |||
@@ -26,7 +26,8 @@ | |||
26 | #ifndef GNUNET_DISK_H_ | 26 | #ifndef GNUNET_DISK_H_ |
27 | #define GNUNET_DISK_H_ | 27 | #define GNUNET_DISK_H_ |
28 | 28 | ||
29 | #include "gnunet_util_lib.h" | 29 | #include "gnunet_crypto_lib.h" |
30 | #include "gnunet_disk_lib.h" | ||
30 | 31 | ||
31 | /** | 32 | /** |
32 | * Retrieve OS file handle | 33 | * Retrieve OS file handle |
diff --git a/src/util/strings.c b/src/util/strings.c index 379f3f5a3..407a135d1 100644 --- a/src/util/strings.c +++ b/src/util/strings.c | |||
@@ -29,7 +29,8 @@ | |||
29 | #if HAVE_ICONV | 29 | #if HAVE_ICONV |
30 | #include <iconv.h> | 30 | #include <iconv.h> |
31 | #endif | 31 | #endif |
32 | #include "gnunet_util_lib.h" | 32 | #include "gnunet_crypto_lib.h" |
33 | #include "gnunet_strings_lib.h" | ||
33 | #include <unicase.h> | 34 | #include <unicase.h> |
34 | #include <unistr.h> | 35 | #include <unistr.h> |
35 | #include <uniconv.h> | 36 | #include <uniconv.h> |
diff --git a/src/util/test_container_meta_data.c b/src/util/test_container_meta_data.c index a3729fc9f..df6587efd 100644 --- a/src/util/test_container_meta_data.c +++ b/src/util/test_container_meta_data.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_util_lib.h" |
29 | 29 | ||
30 | #if HAVE_EXTRACTOR_H | ||
31 | |||
30 | #define ABORT(m) { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (m != NULL) GNUNET_CONTAINER_meta_data_destroy(m); return 1; } | 32 | #define ABORT(m) { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (m != NULL) GNUNET_CONTAINER_meta_data_destroy(m); return 1; } |
31 | 33 | ||
32 | static int | 34 | static int |
@@ -343,4 +345,16 @@ main (int argc, char *argv[]) | |||
343 | return 0; | 345 | return 0; |
344 | } | 346 | } |
345 | 347 | ||
348 | #else | ||
349 | |||
350 | int | ||
351 | main (int argc, char *argv[]) | ||
352 | { | ||
353 | fprintf (stderr, | ||
354 | "GNU libextractor not found, skipping test.\n"); | ||
355 | return 0; | ||
356 | } | ||
357 | |||
358 | #endif | ||
359 | |||
346 | /* end of test_container_meta_data.c */ | 360 | /* end of test_container_meta_data.c */ |
diff --git a/src/util/time.c b/src/util/time.c index 01a3cddd5..78dd4c6d2 100644 --- a/src/util/time.c +++ b/src/util/time.c | |||
@@ -24,7 +24,8 @@ | |||
24 | * @brief functions for handling time and time arithmetic | 24 | * @brief functions for handling time and time arithmetic |
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_util_lib.h" | 27 | #include "gnunet_crypto_lib.h" |
28 | #include "gnunet_time_lib.h" | ||
28 | 29 | ||
29 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) | 30 | #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) |
30 | 31 | ||