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/fs | |
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/fs')
-rw-r--r-- | src/fs/Makefile.am | 64 | ||||
-rw-r--r-- | src/fs/fs_file_information.c | 2 | ||||
-rw-r--r-- | src/fs/fs_getopt.c | 15 | ||||
-rw-r--r-- | src/fs/gnunet-directory.c | 21 | ||||
-rw-r--r-- | src/fs/gnunet-helper-fs-publish.c | 35 | ||||
-rw-r--r-- | src/fs/gnunet-publish.c | 4 | ||||
-rw-r--r-- | src/fs/gnunet-search.c | 6 | ||||
-rw-r--r-- | src/fs/test_fs_directory.c | 8 |
8 files changed, 127 insertions, 28 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 | } |