aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-12-05 13:15:09 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2022-12-05 13:15:09 +0900
commit6ccf51adc80cdb818416971cfd8ba82084571299 (patch)
tree969e4715caf2057613a96f175302c16a0c7c7206 /src
parent8fd3a06ccdee5319d9a3b6d42201e879375bbb2a (diff)
downloadgnunet-6ccf51adc80cdb818416971cfd8ba82084571299.tar.gz
gnunet-6ccf51adc80cdb818416971cfd8ba82084571299.zip
BUILD: Improve extractor handling. Removed platform.h from include
Extractor is not properly detected and GNUNET_FS_EXTRACTOR_ENABLED added to gnunet_config.h. platform.h is removed from $PREFIX/include as it must not be included by third parties anyway.
Diffstat (limited to 'src')
-rw-r--r--src/fs/fs.h2
-rw-r--r--src/fs/fs_api.c2
-rw-r--r--src/fs/fs_api.h2
-rw-r--r--src/fs/fs_directory.c2
-rw-r--r--src/fs/fs_dirmetascan.c2
-rw-r--r--src/fs/fs_download.c2
-rw-r--r--src/fs/fs_getopt.c2
-rw-r--r--src/fs/fs_list_indexed.c2
-rw-r--r--src/fs/fs_misc.c2
-rw-r--r--src/fs/fs_namespace.c2
-rw-r--r--src/fs/fs_publish.c2
-rw-r--r--src/fs/fs_publish_ksk.c2
-rw-r--r--src/fs/fs_publish_ublock.h2
-rw-r--r--src/fs/fs_search.c2
-rw-r--r--src/fs/fs_sharetree.c2
-rw-r--r--src/fs/fs_unindex.c2
-rw-r--r--src/fs/fs_uri.c2
-rw-r--r--src/fs/gnunet-daemon-fsprofiler.c2
-rw-r--r--src/fs/gnunet-directory.c2
-rw-r--r--src/fs/gnunet-download.c2
-rw-r--r--src/fs/gnunet-fs.c2
-rw-r--r--src/fs/gnunet-helper-fs-publish.c2
-rw-r--r--src/fs/gnunet-publish.c2
-rw-r--r--src/fs/gnunet-search.c2
-rw-r--r--src/fs/gnunet-unindex.c2
-rw-r--r--src/fs/meta_data.c2
-rw-r--r--src/fs/plugin_block_fs.c2
-rw-r--r--src/fs/test_fs_meta_data.c2
-rw-r--r--src/include/Makefile.am3
-rw-r--r--src/include/gnunet_config.h.in7
-rw-r--r--src/include/gnunet_extractor_compat.h149
-rw-r--r--src/include/gnunet_fs_service.h100
-rw-r--r--src/include/gnunet_util_lib.h1
33 files changed, 137 insertions, 179 deletions
diff --git a/src/fs/fs.h b/src/fs/fs.h
index 920cf27b2..c3bae65d2 100644
--- a/src/fs/fs.h
+++ b/src/fs/fs.h
@@ -29,7 +29,7 @@
29#include "gnunet_constants.h" 29#include "gnunet_constants.h"
30#include "gnunet_datastore_service.h" 30#include "gnunet_datastore_service.h"
31#include "gnunet_dht_service.h" 31#include "gnunet_dht_service.h"
32#include "gnunet_extractor_compat.h" 32
33#include "gnunet_fs_service.h" 33#include "gnunet_fs_service.h"
34#include "gnunet_block_lib.h" 34#include "gnunet_block_lib.h"
35#include "block_fs.h" 35#include "block_fs.h"
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index c786d660c..627c58004 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -26,7 +26,7 @@
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_extractor_compat.h" 29
30#include "gnunet_fs_service.h" 30#include "gnunet_fs_service.h"
31#include "fs_api.h" 31#include "fs_api.h"
32#include "fs_tree.h" 32#include "fs_tree.h"
diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h
index 9c9ce0f24..fdda91928 100644
--- a/src/fs/fs_api.h
+++ b/src/fs/fs_api.h
@@ -29,7 +29,7 @@
29#include "gnunet_constants.h" 29#include "gnunet_constants.h"
30#include "gnunet_datastore_service.h" 30#include "gnunet_datastore_service.h"
31#include "gnunet_dht_service.h" 31#include "gnunet_dht_service.h"
32#include "gnunet_extractor_compat.h" 32
33#include "gnunet_fs_service.h" 33#include "gnunet_fs_service.h"
34#include "gnunet_block_lib.h" 34#include "gnunet_block_lib.h"
35#include "block_fs.h" 35#include "block_fs.h"
diff --git a/src/fs/fs_directory.c b/src/fs/fs_directory.c
index e53b2dc11..c693f9216 100644
--- a/src/fs/fs_directory.c
+++ b/src/fs/fs_directory.c
@@ -33,7 +33,7 @@
33 * into memory 33 * into memory
34 */ 34 */
35#include "platform.h" 35#include "platform.h"
36#include "gnunet_extractor_compat.h" 36
37#include "gnunet_fs_service.h" 37#include "gnunet_fs_service.h"
38#include "fs_api.h" 38#include "fs_api.h"
39 39
diff --git a/src/fs/fs_dirmetascan.c b/src/fs/fs_dirmetascan.c
index 3990a2521..2379e29ce 100644
--- a/src/fs/fs_dirmetascan.c
+++ b/src/fs/fs_dirmetascan.c
@@ -26,7 +26,7 @@
26 * @author Christian Grothoff 26 * @author Christian Grothoff
27 */ 27 */
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_extractor_compat.h" 29
30#include "gnunet_fs_service.h" 30#include "gnunet_fs_service.h"
31#include "gnunet_scheduler_lib.h" 31#include "gnunet_scheduler_lib.h"
32#include <pthread.h> 32#include <pthread.h>
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index 73e12acb1..2a21e4810 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -24,7 +24,7 @@
24 */ 24 */
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_constants.h" 26#include "gnunet_constants.h"
27#include "gnunet_extractor_compat.h" 27
28#include "gnunet_fs_service.h" 28#include "gnunet_fs_service.h"
29#include "fs_api.h" 29#include "fs_api.h"
30#include "fs_tree.h" 30#include "fs_tree.h"
diff --git a/src/fs/fs_getopt.c b/src/fs/fs_getopt.c
index 186963bba..0135e2e05 100644
--- a/src/fs/fs_getopt.c
+++ b/src/fs/fs_getopt.c
@@ -24,7 +24,7 @@
24 * @author Igor Wronsky, Christian Grothoff 24 * @author Igor Wronsky, Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_extractor_compat.h" 27
28#include "gnunet_fs_service.h" 28#include "gnunet_fs_service.h"
29#include "fs_api.h" 29#include "fs_api.h"
30 30
diff --git a/src/fs/fs_list_indexed.c b/src/fs/fs_list_indexed.c
index 7d30933dd..78816cad1 100644
--- a/src/fs/fs_list_indexed.c
+++ b/src/fs/fs_list_indexed.c
@@ -26,7 +26,7 @@
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_constants.h" 28#include "gnunet_constants.h"
29#include "gnunet_extractor_compat.h" 29
30#include "gnunet_fs_service.h" 30#include "gnunet_fs_service.h"
31#include "gnunet_protocols.h" 31#include "gnunet_protocols.h"
32#include "fs_api.h" 32#include "fs_api.h"
diff --git a/src/fs/fs_misc.c b/src/fs/fs_misc.c
index 3ae82a82e..a8e23f042 100644
--- a/src/fs/fs_misc.c
+++ b/src/fs/fs_misc.c
@@ -24,7 +24,7 @@
24 */ 24 */
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_constants.h" 26#include "gnunet_constants.h"
27#include "gnunet_extractor_compat.h" 27
28#include "gnunet_fs_service.h" 28#include "gnunet_fs_service.h"
29#include "fs_api.h" 29#include "fs_api.h"
30 30
diff --git a/src/fs/fs_namespace.c b/src/fs/fs_namespace.c
index b3eeeb23c..f8b7b91c0 100644
--- a/src/fs/fs_namespace.c
+++ b/src/fs/fs_namespace.c
@@ -28,7 +28,7 @@
28#include "gnunet_constants.h" 28#include "gnunet_constants.h"
29#include "gnunet_signatures.h" 29#include "gnunet_signatures.h"
30#include "gnunet_util_lib.h" 30#include "gnunet_util_lib.h"
31#include "gnunet_extractor_compat.h" 31
32#include "gnunet_fs_service.h" 32#include "gnunet_fs_service.h"
33#include "fs_api.h" 33#include "fs_api.h"
34#include "fs_publish_ublock.h" 34#include "fs_publish_ublock.h"
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index bd533fcfb..d1662c78b 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -28,7 +28,7 @@
28#include "gnunet_constants.h" 28#include "gnunet_constants.h"
29#include "gnunet_signatures.h" 29#include "gnunet_signatures.h"
30#include "gnunet_util_lib.h" 30#include "gnunet_util_lib.h"
31#include "gnunet_extractor_compat.h" 31
32#include "gnunet_fs_service.h" 32#include "gnunet_fs_service.h"
33#include "fs_api.h" 33#include "fs_api.h"
34#include "fs_tree.h" 34#include "fs_tree.h"
diff --git a/src/fs/fs_publish_ksk.c b/src/fs/fs_publish_ksk.c
index d8ea22da2..3981ad335 100644
--- a/src/fs/fs_publish_ksk.c
+++ b/src/fs/fs_publish_ksk.c
@@ -30,7 +30,7 @@
30#include "gnunet_constants.h" 30#include "gnunet_constants.h"
31#include "gnunet_signatures.h" 31#include "gnunet_signatures.h"
32#include "gnunet_util_lib.h" 32#include "gnunet_util_lib.h"
33#include "gnunet_extractor_compat.h" 33
34#include "gnunet_fs_service.h" 34#include "gnunet_fs_service.h"
35#include "fs_api.h" 35#include "fs_api.h"
36#include "fs_tree.h" 36#include "fs_tree.h"
diff --git a/src/fs/fs_publish_ublock.h b/src/fs/fs_publish_ublock.h
index 991926444..4adffc6c1 100644
--- a/src/fs/fs_publish_ublock.h
+++ b/src/fs/fs_publish_ublock.h
@@ -30,7 +30,7 @@
30 30
31#include "gnunet_util_lib.h" 31#include "gnunet_util_lib.h"
32#include "gnunet_datastore_service.h" 32#include "gnunet_datastore_service.h"
33#include "gnunet_extractor_compat.h" 33
34#include "gnunet_fs_service.h" 34#include "gnunet_fs_service.h"
35#include "gnunet_identity_service.h" 35#include "gnunet_identity_service.h"
36 36
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index 975dcfb14..823f046ed 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -24,7 +24,7 @@
24 */ 24 */
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_constants.h" 26#include "gnunet_constants.h"
27#include "gnunet_extractor_compat.h" 27
28#include "gnunet_fs_service.h" 28#include "gnunet_fs_service.h"
29#include "gnunet_protocols.h" 29#include "gnunet_protocols.h"
30#include "fs_api.h" 30#include "fs_api.h"
diff --git a/src/fs/fs_sharetree.c b/src/fs/fs_sharetree.c
index a09b3589d..6c246a3ad 100644
--- a/src/fs/fs_sharetree.c
+++ b/src/fs/fs_sharetree.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_extractor_compat.h" 28
29#include "gnunet_fs_service.h" 29#include "gnunet_fs_service.h"
30#include "gnunet_scheduler_lib.h" 30#include "gnunet_scheduler_lib.h"
31#include <pthread.h> 31#include <pthread.h>
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c
index 6031d7bc3..68ba667c4 100644
--- a/src/fs/fs_unindex.c
+++ b/src/fs/fs_unindex.c
@@ -26,7 +26,7 @@
26 */ 26 */
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_constants.h" 28#include "gnunet_constants.h"
29#include "gnunet_extractor_compat.h" 29
30#include "gnunet_fs_service.h" 30#include "gnunet_fs_service.h"
31#include "gnunet_protocols.h" 31#include "gnunet_protocols.h"
32#include "fs_api.h" 32#include "fs_api.h"
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c
index 0810f77ca..b0be0db4f 100644
--- a/src/fs/fs_uri.c
+++ b/src/fs/fs_uri.c
@@ -81,7 +81,7 @@
81 * 81 *
82 */ 82 */
83#include "platform.h" 83#include "platform.h"
84#include "gnunet_extractor_compat.h" 84
85#include "gnunet_fs_service.h" 85#include "gnunet_fs_service.h"
86#include "gnunet_signatures.h" 86#include "gnunet_signatures.h"
87#include "fs_api.h" 87#include "fs_api.h"
diff --git a/src/fs/gnunet-daemon-fsprofiler.c b/src/fs/gnunet-daemon-fsprofiler.c
index bc7ca9521..b99933cfa 100644
--- a/src/fs/gnunet-daemon-fsprofiler.c
+++ b/src/fs/gnunet-daemon-fsprofiler.c
@@ -27,7 +27,7 @@
27 * - how to signal driver that we're done? 27 * - how to signal driver that we're done?
28 */ 28 */
29#include "platform.h" 29#include "platform.h"
30#include "gnunet_extractor_compat.h" 30
31#include "gnunet_fs_service.h" 31#include "gnunet_fs_service.h"
32#include "gnunet_statistics_service.h" 32#include "gnunet_statistics_service.h"
33 33
diff --git a/src/fs/gnunet-directory.c b/src/fs/gnunet-directory.c
index e720628b3..ab9f2905a 100644
--- a/src/fs/gnunet-directory.c
+++ b/src/fs/gnunet-directory.c
@@ -23,7 +23,7 @@
23 * @author Christian Grothoff 23 * @author Christian Grothoff
24 */ 24 */
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_extractor_compat.h" 26
27#include "gnunet_fs_service.h" 27#include "gnunet_fs_service.h"
28 28
29static int ret; 29static int ret;
diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c
index f463f901e..4694077e9 100644
--- a/src/fs/gnunet-download.c
+++ b/src/fs/gnunet-download.c
@@ -26,7 +26,7 @@
26 * @author Igor Wronsky 26 * @author Igor Wronsky
27 */ 27 */
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_extractor_compat.h" 29
30#include "gnunet_fs_service.h" 30#include "gnunet_fs_service.h"
31 31
32static int ret; 32static int ret;
diff --git a/src/fs/gnunet-fs.c b/src/fs/gnunet-fs.c
index 3dd00c7dc..21e3c4a40 100644
--- a/src/fs/gnunet-fs.c
+++ b/src/fs/gnunet-fs.c
@@ -23,7 +23,7 @@
23 * @author Christian Grothoff 23 * @author Christian Grothoff
24 */ 24 */
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_extractor_compat.h" 26
27#include "gnunet_fs_service.h" 27#include "gnunet_fs_service.h"
28 28
29/** 29/**
diff --git a/src/fs/gnunet-helper-fs-publish.c b/src/fs/gnunet-helper-fs-publish.c
index b886280c9..0e07b79dc 100644
--- a/src/fs/gnunet-helper-fs-publish.c
+++ b/src/fs/gnunet-helper-fs-publish.c
@@ -27,7 +27,7 @@
27 * and report the results to stdout. 27 * and report the results to stdout.
28 */ 28 */
29#include "platform.h" 29#include "platform.h"
30#include "gnunet_extractor_compat.h" 30
31#include "gnunet_fs_service.h" 31#include "gnunet_fs_service.h"
32 32
33 33
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c
index 094cbc9b9..59f16210a 100644
--- a/src/fs/gnunet-publish.c
+++ b/src/fs/gnunet-publish.c
@@ -26,7 +26,7 @@
26 * @author Igor Wronsky 26 * @author Igor Wronsky
27 */ 27 */
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_extractor_compat.h" 29
30#include "gnunet_fs_service.h" 30#include "gnunet_fs_service.h"
31#include "gnunet_identity_service.h" 31#include "gnunet_identity_service.h"
32 32
diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c
index b55602523..a72cf97cc 100644
--- a/src/fs/gnunet-search.c
+++ b/src/fs/gnunet-search.c
@@ -30,7 +30,7 @@
30#include <ctype.h> 30#include <ctype.h>
31#include <inttypes.h> 31#include <inttypes.h>
32#include <limits.h> 32#include <limits.h>
33#include "gnunet_extractor_compat.h" 33
34#include "gnunet_fs_service.h" 34#include "gnunet_fs_service.h"
35 35
36 36
diff --git a/src/fs/gnunet-unindex.c b/src/fs/gnunet-unindex.c
index 80cd95c19..326f75a63 100644
--- a/src/fs/gnunet-unindex.c
+++ b/src/fs/gnunet-unindex.c
@@ -26,7 +26,7 @@
26 * @author Igor Wronsky 26 * @author Igor Wronsky
27 */ 27 */
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_extractor_compat.h" 29
30#include "gnunet_fs_service.h" 30#include "gnunet_fs_service.h"
31 31
32static int ret; 32static int ret;
diff --git a/src/fs/meta_data.c b/src/fs/meta_data.c
index f676ce57c..3e2857101 100644
--- a/src/fs/meta_data.c
+++ b/src/fs/meta_data.c
@@ -28,7 +28,7 @@
28 28
29#include "platform.h" 29#include "platform.h"
30#include "gnunet_util_lib.h" 30#include "gnunet_util_lib.h"
31#include "gnunet_extractor_compat.h" 31
32#include "gnunet_fs_service.h" 32#include "gnunet_fs_service.h"
33 33
34/** 34/**
diff --git a/src/fs/plugin_block_fs.c b/src/fs/plugin_block_fs.c
index a6cfb2e64..bbd0ff57b 100644
--- a/src/fs/plugin_block_fs.c
+++ b/src/fs/plugin_block_fs.c
@@ -25,7 +25,7 @@
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_block_plugin.h" 27#include "gnunet_block_plugin.h"
28#include "gnunet_extractor_compat.h" 28
29#include "gnunet_fs_service.h" 29#include "gnunet_fs_service.h"
30#include "block_fs.h" 30#include "block_fs.h"
31#include "gnunet_signatures.h" 31#include "gnunet_signatures.h"
diff --git a/src/fs/test_fs_meta_data.c b/src/fs/test_fs_meta_data.c
index 50f902cb5..bee7844ea 100644
--- a/src/fs/test_fs_meta_data.c
+++ b/src/fs/test_fs_meta_data.c
@@ -28,7 +28,7 @@
28 28
29#include "platform.h" 29#include "platform.h"
30#include "gnunet_util_lib.h" 30#include "gnunet_util_lib.h"
31#include "gnunet_extractor_compat.h" 31
32#include "gnunet_fs_service.h" 32#include "gnunet_fs_service.h"
33 33
34#define ABORT(m) { fprintf (stderr, "Error at %s:%d\n", __FILE__, __LINE__); \ 34#define ABORT(m) { fprintf (stderr, "Error at %s:%d\n", __FILE__, __LINE__); \
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index 6ece35851..4a0429900 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -4,13 +4,13 @@ SUBDIRS = .
4gnunetincludedir = $(includedir)/gnunet 4gnunetincludedir = $(includedir)/gnunet
5 5
6EXTRA_DIST = \ 6EXTRA_DIST = \
7 platform.h \
7 gauger.h \ 8 gauger.h \
8 block_fs.h \ 9 block_fs.h \
9 block_dns.h \ 10 block_dns.h \
10 block_regex.h 11 block_regex.h
11 12
12gnunetinclude_HEADERS = \ 13gnunetinclude_HEADERS = \
13 platform.h \
14 gnunet_config.h \ 14 gnunet_config.h \
15 gettext.h \ 15 gettext.h \
16 compat.h \ 16 compat.h \
@@ -51,7 +51,6 @@ gnunetinclude_HEADERS = \
51 gnunet_dnsstub_lib.h \ 51 gnunet_dnsstub_lib.h \
52 gnunet_dns_service.h \ 52 gnunet_dns_service.h \
53 gnunet_error_codes.h \ 53 gnunet_error_codes.h \
54 gnunet_extractor_compat.h \
55 gnunet_fragmentation_lib.h \ 54 gnunet_fragmentation_lib.h \
56 gnunet_friends_lib.h \ 55 gnunet_friends_lib.h \
57 gnunet_fs_service.h \ 56 gnunet_fs_service.h \
diff --git a/src/include/gnunet_config.h.in b/src/include/gnunet_config.h.in
index ce7c5a894..63ffd84bd 100644
--- a/src/include/gnunet_config.h.in
+++ b/src/include/gnunet_config.h.in
@@ -48,4 +48,11 @@
48/* Set to 1 if GnuTLS has DANE support */ 48/* Set to 1 if GnuTLS has DANE support */
49#define GNUNET_CURL_GNUTLS @curl_gnutls@ 49#define GNUNET_CURL_GNUTLS @curl_gnutls@
50 50
51/**
52 * Set to 1 if file-sharing meta data parsing is built with
53 * libextractor, which means that callers to the API must use also use
54 * libextractor.
55 */
56#define GNUNET_FS_EXTRACTOR_ENABLED @extractor@
57
51#endif 58#endif
diff --git a/src/include/gnunet_extractor_compat.h b/src/include/gnunet_extractor_compat.h
deleted file mode 100644
index d69525c9d..000000000
--- a/src/include/gnunet_extractor_compat.h
+++ /dev/null
@@ -1,149 +0,0 @@
1/*
2 This file is part of GNUnet
3 Copyright (C) 2022 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20/**
21 * @author Martin Schanzenbach
22 *
23 * @file
24 * libextractor compatibility insanity helper header
25 *
26 * @{
27 */
28#ifndef GNUNET_EXTRACTOR_COMPAT_H
29#define GNUNET_EXTRACTOR_COMPAT_H
30
31
32#ifdef __cplusplus
33extern "C"
34{
35#if 0 /* keep Emacsens' auto-indent happy */
36}
37#endif
38#endif
39
40#if HAVE_EXTRACTOR_H
41
42#include <extractor.h>
43
44#else
45
46/* definitions from extractor.h we need for the build */
47
48/**
49 * Enumeration defining various sources of keywords. See also
50 * http://dublincore.org/documents/1998/09/dces/
51 */
52enum EXTRACTOR_MetaType
53{
54 EXTRACTOR_METATYPE_RESERVED = 0,
55 EXTRACTOR_METATYPE_MIMETYPE = 1,
56 EXTRACTOR_METATYPE_FILENAME = 2,
57 EXTRACTOR_METATYPE_COMMENT = 3,
58 EXTRACTOR_METATYPE_TITLE = 4,
59 EXTRACTOR_METATYPE_BOOK_TITLE = 5,
60 EXTRACTOR_METATYPE_JOURNAL_NAME = 8,
61 EXTRACTOR_METATYPE_AUTHOR_NAME = 13,
62 EXTRACTOR_METATYPE_PUBLICATION_DATE = 24,
63 EXTRACTOR_METATYPE_URL = 29,
64 EXTRACTOR_METATYPE_URI = 30,
65 EXTRACTOR_METATYPE_ISRC = 31,
66 EXTRACTOR_METATYPE_UNKNOWN = 45,
67 EXTRACTOR_METATYPE_DESCRIPTION = 46,
68 EXTRACTOR_METATYPE_KEYWORDS = 49,
69 EXTRACTOR_METATYPE_SUBJECT = 52,
70 EXTRACTOR_METATYPE_PACKAGE_NAME = 69,
71 EXTRACTOR_METATYPE_THUMBNAIL = 114,
72 EXTRACTOR_METATYPE_ALBUM = 129,
73 EXTRACTOR_METATYPE_ARTIST = 130,
74 EXTRACTOR_METATYPE_ORIGINAL_TITLE = 162,
75 EXTRACTOR_METATYPE_GNUNET_FULL_DATA = 174,
76 EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME = 180,
77};
78
79/**
80 * Format in which the extracted meta data is presented.
81 */
82enum EXTRACTOR_MetaFormat
83{
84 /**
85 * Format is unknown.
86 */
87 EXTRACTOR_METAFORMAT_UNKNOWN = 0,
88
89 /**
90 * 0-terminated, UTF-8 encoded string. "data_len"
91 * is strlen(data)+1.
92 */
93 EXTRACTOR_METAFORMAT_UTF8 = 1,
94
95 /**
96 * Some kind of binary format, see given Mime type.
97 */
98 EXTRACTOR_METAFORMAT_BINARY = 2,
99
100 /**
101 * 0-terminated string. The specific encoding is unknown.
102 * "data_len" is strlen (data)+1.
103 */
104 EXTRACTOR_METAFORMAT_C_STRING = 3
105};
106
107
108/**
109 * Type of a function that libextractor calls for each
110 * meta data item found.
111 *
112 * @param cls closure (user-defined)
113 * @param plugin_name name of the plugin that produced this value;
114 * special values can be used (e.g. '&lt;zlib&gt;' for zlib being
115 * used in the main libextractor library and yielding
116 * meta data).
117 * @param type libextractor-type describing the meta data
118 * @param format basic format information about @a data
119 * @param data_mime_type mime-type of @a data (not of the original file);
120 * can be NULL (if mime-type is not known)
121 * @param data actual meta-data found
122 * @param data_len number of bytes in @a data
123 * @return 0 to continue extracting, 1 to abort
124 */
125typedef int (*EXTRACTOR_MetaDataProcessor) (void *cls,
126 const char *plugin_name,
127 enum EXTRACTOR_MetaType type,
128 enum EXTRACTOR_MetaFormat format,
129 const char *data_mime_type,
130 const char *data,
131 size_t data_len);
132
133#endif
134
135#ifndef EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME
136/* hack for LE < 0.6.3 */
137#define EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME 180
138#endif
139
140#if 0 /* keep Emacsens' auto-indent happy */
141{
142#endif
143#ifdef __cplusplus
144}
145#endif
146
147#endif
148
149/** @} */ /* end of group */
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h
index 53ca6a9ec..5c271c71f 100644
--- a/src/include/gnunet_fs_service.h
+++ b/src/include/gnunet_fs_service.h
@@ -71,6 +71,106 @@ extern "C"
71 */ 71 */
72#define GNUNET_FS_VERSION 0x00090300 72#define GNUNET_FS_VERSION 0x00090300
73 73
74#if GNUNET_FS_EXTRACTOR_ENABLED
75
76#include <extractor.h>
77
78#else
79
80/* definitions from extractor.h we need for the build */
81
82/**
83 * Enumeration defining various sources of keywords. See also
84 * http://dublincore.org/documents/1998/09/dces/
85 */
86enum EXTRACTOR_MetaType
87{
88 EXTRACTOR_METATYPE_RESERVED = 0,
89 EXTRACTOR_METATYPE_MIMETYPE = 1,
90 EXTRACTOR_METATYPE_FILENAME = 2,
91 EXTRACTOR_METATYPE_COMMENT = 3,
92 EXTRACTOR_METATYPE_TITLE = 4,
93 EXTRACTOR_METATYPE_BOOK_TITLE = 5,
94 EXTRACTOR_METATYPE_JOURNAL_NAME = 8,
95 EXTRACTOR_METATYPE_AUTHOR_NAME = 13,
96 EXTRACTOR_METATYPE_PUBLICATION_DATE = 24,
97 EXTRACTOR_METATYPE_URL = 29,
98 EXTRACTOR_METATYPE_URI = 30,
99 EXTRACTOR_METATYPE_ISRC = 31,
100 EXTRACTOR_METATYPE_UNKNOWN = 45,
101 EXTRACTOR_METATYPE_DESCRIPTION = 46,
102 EXTRACTOR_METATYPE_KEYWORDS = 49,
103 EXTRACTOR_METATYPE_SUBJECT = 52,
104 EXTRACTOR_METATYPE_PACKAGE_NAME = 69,
105 EXTRACTOR_METATYPE_THUMBNAIL = 114,
106 EXTRACTOR_METATYPE_ALBUM = 129,
107 EXTRACTOR_METATYPE_ARTIST = 130,
108 EXTRACTOR_METATYPE_ORIGINAL_TITLE = 162,
109 EXTRACTOR_METATYPE_GNUNET_FULL_DATA = 174,
110 EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME = 180,
111};
112
113/**
114 * Format in which the extracted meta data is presented.
115 */
116enum EXTRACTOR_MetaFormat
117{
118 /**
119 * Format is unknown.
120 */
121 EXTRACTOR_METAFORMAT_UNKNOWN = 0,
122
123 /**
124 * 0-terminated, UTF-8 encoded string. "data_len"
125 * is strlen(data)+1.
126 */
127 EXTRACTOR_METAFORMAT_UTF8 = 1,
128
129 /**
130 * Some kind of binary format, see given Mime type.
131 */
132 EXTRACTOR_METAFORMAT_BINARY = 2,
133
134 /**
135 * 0-terminated string. The specific encoding is unknown.
136 * "data_len" is strlen (data)+1.
137 */
138 EXTRACTOR_METAFORMAT_C_STRING = 3
139};
140
141
142/**
143 * Type of a function that libextractor calls for each
144 * meta data item found.
145 *
146 * @param cls closure (user-defined)
147 * @param plugin_name name of the plugin that produced this value;
148 * special values can be used (e.g. '&lt;zlib&gt;' for zlib being
149 * used in the main libextractor library and yielding
150 * meta data).
151 * @param type libextractor-type describing the meta data
152 * @param format basic format information about @a data
153 * @param data_mime_type mime-type of @a data (not of the original file);
154 * can be NULL (if mime-type is not known)
155 * @param data actual meta-data found
156 * @param data_len number of bytes in @a data
157 * @return 0 to continue extracting, 1 to abort
158 */
159typedef int (*EXTRACTOR_MetaDataProcessor) (void *cls,
160 const char *plugin_name,
161 enum EXTRACTOR_MetaType type,
162 enum EXTRACTOR_MetaFormat format,
163 const char *data_mime_type,
164 const char *data,
165 size_t data_len);
166
167#endif
168
169#ifndef EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME
170/* hack for LE < 0.6.3 */
171#define EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME 180
172#endif
173
74 174
75/* ******************** URI API *********************** */ 175/* ******************** URI API *********************** */
76 176
diff --git a/src/include/gnunet_util_lib.h b/src/include/gnunet_util_lib.h
index 280304825..ada40a4ca 100644
--- a/src/include/gnunet_util_lib.h
+++ b/src/include/gnunet_util_lib.h
@@ -65,6 +65,7 @@ extern "C"
65#define GNUNET_AGPL_URL "https://git.gnunet.org/gnunet.git/tag/?h=v" \ 65#define GNUNET_AGPL_URL "https://git.gnunet.org/gnunet.git/tag/?h=v" \
66 GNUNET_VERSION 66 GNUNET_VERSION
67 67
68#include "gnunet_config.h"
68#include "gnunet_common.h" 69#include "gnunet_common.h"
69#include "gnunet_crypto_lib.h" 70#include "gnunet_crypto_lib.h"
70#include "gnunet_bandwidth_lib.h" 71#include "gnunet_bandwidth_lib.h"