gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated (0f07267b0 -> 6ccf51adc)


From: gnunet
Subject: [gnunet] branch master updated (0f07267b0 -> 6ccf51adc)
Date: Mon, 05 Dec 2022 05:17:01 +0100

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a change to branch master
in repository gnunet.

    from 0f07267b0 -forgot dist
     new 8fd3a06cc -more util include cleanups
     new 6ccf51adc BUILD: Improve extractor handling. Removed platform.h from 
include

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 configure.ac                          |   2 +
 src/fs/fs.h                           |   2 +-
 src/fs/fs_api.c                       |   2 +-
 src/fs/fs_api.h                       |   2 +-
 src/fs/fs_directory.c                 |   2 +-
 src/fs/fs_dirmetascan.c               |   2 +-
 src/fs/fs_download.c                  |   2 +-
 src/fs/fs_getopt.c                    |   2 +-
 src/fs/fs_list_indexed.c              |   2 +-
 src/fs/fs_misc.c                      |   2 +-
 src/fs/fs_namespace.c                 |   2 +-
 src/fs/fs_publish.c                   |   2 +-
 src/fs/fs_publish_ksk.c               |   2 +-
 src/fs/fs_publish_ublock.h            |   2 +-
 src/fs/fs_search.c                    |   2 +-
 src/fs/fs_sharetree.c                 |   2 +-
 src/fs/fs_unindex.c                   |   2 +-
 src/fs/fs_uri.c                       |   2 +-
 src/fs/gnunet-daemon-fsprofiler.c     |   2 +-
 src/fs/gnunet-directory.c             |   2 +-
 src/fs/gnunet-download.c              |   2 +-
 src/fs/gnunet-fs.c                    |   2 +-
 src/fs/gnunet-helper-fs-publish.c     |   2 +-
 src/fs/gnunet-publish.c               |   2 +-
 src/fs/gnunet-search.c                |   2 +-
 src/fs/gnunet-unindex.c               |   2 +-
 src/fs/meta_data.c                    |   2 +-
 src/fs/plugin_block_fs.c              |   2 +-
 src/fs/test_fs_meta_data.c            |   2 +-
 src/include/Makefile.am               |   3 +-
 src/include/gnunet_bandwidth_lib.h    |   5 +-
 src/include/gnunet_common.h           |   2 +
 src/include/gnunet_config.h.in        |   7 ++
 src/include/gnunet_crypto_lib.h       |   1 -
 src/include/gnunet_extractor_compat.h | 149 ----------------------------------
 src/include/gnunet_fs_service.h       | 100 +++++++++++++++++++++++
 src/include/gnunet_mst_lib.h          |   3 -
 src/include/gnunet_os_lib.h           |   9 +-
 src/include/gnunet_plugin_lib.h       |   4 -
 src/include/gnunet_tun_lib.h          |   4 -
 src/include/gnunet_util_lib.h         |   3 +-
 src/util/configuration.c              |   1 -
 42 files changed, 150 insertions(+), 199 deletions(-)
 delete mode 100644 src/include/gnunet_extractor_compat.h

diff --git a/configure.ac b/configure.ac
index 81d678ecd..79b9d82d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1490,6 +1490,8 @@ AS_IF([test "x$extractor" = "x0"],
    AC_MSG_WARN([libextractor not found, but various file-sharing operations 
require it])],
   [libextractor_msg="yes"])
 
+AC_SUBST([extractor])
+
 # libzbar
 AS_IF([test "x$zbar" = "x1"],
   [libzbar_msg="yes"],
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 @@
 #include "gnunet_constants.h"
 #include "gnunet_datastore_service.h"
 #include "gnunet_dht_service.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "gnunet_block_lib.h"
 #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 @@
 
 #include "platform.h"
 #include "gnunet_util_lib.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "fs_api.h"
 #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 @@
 #include "gnunet_constants.h"
 #include "gnunet_datastore_service.h"
 #include "gnunet_dht_service.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "gnunet_block_lib.h"
 #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 @@
  *   into memory
  */
 #include "platform.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "fs_api.h"
 
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 @@
  * @author Christian Grothoff
  */
 #include "platform.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "gnunet_scheduler_lib.h"
 #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 @@
  */
 #include "platform.h"
 #include "gnunet_constants.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "fs_api.h"
 #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 @@
  * @author Igor Wronsky, Christian Grothoff
  */
 #include "platform.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "fs_api.h"
 
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 @@
 
 #include "platform.h"
 #include "gnunet_constants.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "gnunet_protocols.h"
 #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 @@
  */
 #include "platform.h"
 #include "gnunet_constants.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "fs_api.h"
 
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 @@
 #include "gnunet_constants.h"
 #include "gnunet_signatures.h"
 #include "gnunet_util_lib.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "fs_api.h"
 #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 @@
 #include "gnunet_constants.h"
 #include "gnunet_signatures.h"
 #include "gnunet_util_lib.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "fs_api.h"
 #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 @@
 #include "gnunet_constants.h"
 #include "gnunet_signatures.h"
 #include "gnunet_util_lib.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "fs_api.h"
 #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 @@
 
 #include "gnunet_util_lib.h"
 #include "gnunet_datastore_service.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "gnunet_identity_service.h"
 
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 @@
  */
 #include "platform.h"
 #include "gnunet_constants.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "gnunet_protocols.h"
 #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 @@
  * @author Christian Grothoff
  */
 #include "platform.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "gnunet_scheduler_lib.h"
 #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 @@
  */
 #include "platform.h"
 #include "gnunet_constants.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "gnunet_protocols.h"
 #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 @@
  *
  */
 #include "platform.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "gnunet_signatures.h"
 #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 @@
  * - how to signal driver that we're done?
  */
 #include "platform.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "gnunet_statistics_service.h"
 
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 @@
  * @author Christian Grothoff
  */
 #include "platform.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 
 static 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 @@
  * @author Igor Wronsky
  */
 #include "platform.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 
 static 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 @@
  * @author Christian Grothoff
  */
 #include "platform.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 
 /**
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 @@
  * and report the results to stdout.
  */
 #include "platform.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 
 
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 @@
  * @author Igor Wronsky
  */
 #include "platform.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "gnunet_identity_service.h"
 
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 @@
 #include <ctype.h>
 #include <inttypes.h>
 #include <limits.h>
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 
 
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 @@
  * @author Igor Wronsky
  */
 #include "platform.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 
 static 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 @@
 
 #include "platform.h"
 #include "gnunet_util_lib.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 
 /**
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 @@
  */
 #include "platform.h"
 #include "gnunet_block_plugin.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 #include "block_fs.h"
 #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 @@
 
 #include "platform.h"
 #include "gnunet_util_lib.h"
-#include "gnunet_extractor_compat.h"
+
 #include "gnunet_fs_service.h"
 
 #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 = .
 gnunetincludedir = $(includedir)/gnunet
 
 EXTRA_DIST = \
+  platform.h \
   gauger.h \
   block_fs.h \
   block_dns.h \
   block_regex.h
 
 gnunetinclude_HEADERS = \
-  platform.h \
   gnunet_config.h \
   gettext.h \
   compat.h \
@@ -51,7 +51,6 @@ gnunetinclude_HEADERS = \
   gnunet_dnsstub_lib.h \
   gnunet_dns_service.h \
   gnunet_error_codes.h \
-  gnunet_extractor_compat.h \
   gnunet_fragmentation_lib.h \
   gnunet_friends_lib.h \
   gnunet_fs_service.h \
diff --git a/src/include/gnunet_bandwidth_lib.h 
b/src/include/gnunet_bandwidth_lib.h
index 359bf95c4..7c854aab5 100644
--- a/src/include/gnunet_bandwidth_lib.h
+++ b/src/include/gnunet_bandwidth_lib.h
@@ -18,6 +18,10 @@
      SPDX-License-Identifier: AGPL3.0-or-later
  */
 
+#if !defined (__GNUNET_UTIL_LIB_H_INSIDE__)
+#error "Only <gnunet_util_lib.h> can be included directly."
+#endif
+
 /**
  * @addtogroup libgnunetutil
  * Multi-function utilities library for GNUnet programs
@@ -48,7 +52,6 @@ extern "C" {
 #endif
 
 
-#include "gnunet_common.h"
 #include "gnunet_time_lib.h"
 
 GNUNET_NETWORK_STRUCT_BEGIN
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index 0c3300125..07a847814 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -44,7 +44,9 @@
 
 #include <stdlib.h>
 #include <sys/socket.h>
+#include <sys/un.h>
 #include <netinet/in.h>
+#include <arpa/inet.h>
 #include <stdint.h>
 #include <stdarg.h>
 #include <sys/types.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 @@
 /* Set to 1 if GnuTLS has DANE support */
 #define GNUNET_CURL_GNUTLS @curl_gnutls@
 
+/**
+ * Set to 1 if file-sharing meta data parsing is built with
+ * libextractor, which means that callers to the API must use also use
+ * libextractor.
+ */
+#define GNUNET_FS_EXTRACTOR_ENABLED @extractor@
+
 #endif
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index 3fac945a5..8d400118a 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -67,7 +67,6 @@ extern "C" {
  */
 struct GNUNET_PeerIdentity;
 
-#include "gnunet_common.h"
 #include <gcrypt.h>
 
 
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 @@
-/*
-     This file is part of GNUnet
-     Copyright (C) 2022 GNUnet e.V.
-
-     GNUnet is free software: you can redistribute it and/or modify it
-     under the terms of the GNU Affero General Public License as published
-     by the Free Software Foundation, either version 3 of the License,
-     or (at your option) any later version.
-
-     GNUnet is distributed in the hope that it will be useful, but
-     WITHOUT ANY WARRANTY; without even the implied warranty of
-     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-     Affero General Public License for more details.
-
-     You should have received a copy of the GNU Affero General Public License
-     along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-     SPDX-License-Identifier: AGPL3.0-or-later
- */
-/**
- * @author Martin Schanzenbach
- *
- * @file
- * libextractor compatibility insanity helper header
- *
- * @{
- */
-#ifndef GNUNET_EXTRACTOR_COMPAT_H
-#define GNUNET_EXTRACTOR_COMPAT_H
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#if 0                           /* keep Emacsens' auto-indent happy */
-}
-#endif
-#endif
-
-#if HAVE_EXTRACTOR_H
-
-#include <extractor.h>
-
-#else
-
-/* definitions from extractor.h we need for the build */
-
-/**
- * Enumeration defining various sources of keywords.  See also
- * http://dublincore.org/documents/1998/09/dces/
- */
-enum EXTRACTOR_MetaType
-{
-  EXTRACTOR_METATYPE_RESERVED = 0,
-  EXTRACTOR_METATYPE_MIMETYPE = 1,
-  EXTRACTOR_METATYPE_FILENAME = 2,
-  EXTRACTOR_METATYPE_COMMENT = 3,
-  EXTRACTOR_METATYPE_TITLE = 4,
-  EXTRACTOR_METATYPE_BOOK_TITLE = 5,
-  EXTRACTOR_METATYPE_JOURNAL_NAME = 8,
-  EXTRACTOR_METATYPE_AUTHOR_NAME = 13,
-  EXTRACTOR_METATYPE_PUBLICATION_DATE = 24,
-  EXTRACTOR_METATYPE_URL = 29,
-  EXTRACTOR_METATYPE_URI = 30,
-  EXTRACTOR_METATYPE_ISRC = 31,
-  EXTRACTOR_METATYPE_UNKNOWN = 45,
-  EXTRACTOR_METATYPE_DESCRIPTION = 46,
-  EXTRACTOR_METATYPE_KEYWORDS = 49,
-  EXTRACTOR_METATYPE_SUBJECT = 52,
-  EXTRACTOR_METATYPE_PACKAGE_NAME = 69,
-  EXTRACTOR_METATYPE_THUMBNAIL = 114,
-  EXTRACTOR_METATYPE_ALBUM = 129,
-  EXTRACTOR_METATYPE_ARTIST = 130,
-  EXTRACTOR_METATYPE_ORIGINAL_TITLE = 162,
-  EXTRACTOR_METATYPE_GNUNET_FULL_DATA = 174,
-  EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME = 180,
-};
-
-/**
- * Format in which the extracted meta data is presented.
- */
-enum EXTRACTOR_MetaFormat
-{
-  /**
-   * Format is unknown.
-   */
-  EXTRACTOR_METAFORMAT_UNKNOWN = 0,
-
-  /**
-   * 0-terminated, UTF-8 encoded string.  "data_len"
-   * is strlen(data)+1.
-   */
-  EXTRACTOR_METAFORMAT_UTF8 = 1,
-
-  /**
-   * Some kind of binary format, see given Mime type.
-   */
-  EXTRACTOR_METAFORMAT_BINARY = 2,
-
-  /**
-   * 0-terminated string.  The specific encoding is unknown.
-   * "data_len" is strlen (data)+1.
-   */
-  EXTRACTOR_METAFORMAT_C_STRING = 3
-};
-
-
-/**
- * Type of a function that libextractor calls for each
- * meta data item found.
- *
- * @param cls closure (user-defined)
- * @param plugin_name name of the plugin that produced this value;
- *        special values can be used (e.g. '&lt;zlib&gt;' for zlib being
- *        used in the main libextractor library and yielding
- *        meta data).
- * @param type libextractor-type describing the meta data
- * @param format basic format information about @a data
- * @param data_mime_type mime-type of @a data (not of the original file);
- *        can be NULL (if mime-type is not known)
- * @param data actual meta-data found
- * @param data_len number of bytes in @a data
- * @return 0 to continue extracting, 1 to abort
- */
-typedef int (*EXTRACTOR_MetaDataProcessor) (void *cls,
-                                            const char *plugin_name,
-                                            enum EXTRACTOR_MetaType type,
-                                            enum EXTRACTOR_MetaFormat format,
-                                            const char *data_mime_type,
-                                            const char *data,
-                                            size_t data_len);
-
-#endif
-
-#ifndef EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME
-/* hack for LE < 0.6.3 */
-#define EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME 180
-#endif
-
-#if 0                           /* keep Emacsens' auto-indent happy */
-{
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-/** @} */  /* 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"
  */
 #define GNUNET_FS_VERSION 0x00090300
 
+#if GNUNET_FS_EXTRACTOR_ENABLED
+
+#include <extractor.h>
+
+#else
+
+/* definitions from extractor.h we need for the build */
+
+/**
+ * Enumeration defining various sources of keywords.  See also
+ * http://dublincore.org/documents/1998/09/dces/
+ */
+enum EXTRACTOR_MetaType
+{
+  EXTRACTOR_METATYPE_RESERVED = 0,
+  EXTRACTOR_METATYPE_MIMETYPE = 1,
+  EXTRACTOR_METATYPE_FILENAME = 2,
+  EXTRACTOR_METATYPE_COMMENT = 3,
+  EXTRACTOR_METATYPE_TITLE = 4,
+  EXTRACTOR_METATYPE_BOOK_TITLE = 5,
+  EXTRACTOR_METATYPE_JOURNAL_NAME = 8,
+  EXTRACTOR_METATYPE_AUTHOR_NAME = 13,
+  EXTRACTOR_METATYPE_PUBLICATION_DATE = 24,
+  EXTRACTOR_METATYPE_URL = 29,
+  EXTRACTOR_METATYPE_URI = 30,
+  EXTRACTOR_METATYPE_ISRC = 31,
+  EXTRACTOR_METATYPE_UNKNOWN = 45,
+  EXTRACTOR_METATYPE_DESCRIPTION = 46,
+  EXTRACTOR_METATYPE_KEYWORDS = 49,
+  EXTRACTOR_METATYPE_SUBJECT = 52,
+  EXTRACTOR_METATYPE_PACKAGE_NAME = 69,
+  EXTRACTOR_METATYPE_THUMBNAIL = 114,
+  EXTRACTOR_METATYPE_ALBUM = 129,
+  EXTRACTOR_METATYPE_ARTIST = 130,
+  EXTRACTOR_METATYPE_ORIGINAL_TITLE = 162,
+  EXTRACTOR_METATYPE_GNUNET_FULL_DATA = 174,
+  EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME = 180,
+};
+
+/**
+ * Format in which the extracted meta data is presented.
+ */
+enum EXTRACTOR_MetaFormat
+{
+  /**
+   * Format is unknown.
+   */
+  EXTRACTOR_METAFORMAT_UNKNOWN = 0,
+
+  /**
+   * 0-terminated, UTF-8 encoded string.  "data_len"
+   * is strlen(data)+1.
+   */
+  EXTRACTOR_METAFORMAT_UTF8 = 1,
+
+  /**
+   * Some kind of binary format, see given Mime type.
+   */
+  EXTRACTOR_METAFORMAT_BINARY = 2,
+
+  /**
+   * 0-terminated string.  The specific encoding is unknown.
+   * "data_len" is strlen (data)+1.
+   */
+  EXTRACTOR_METAFORMAT_C_STRING = 3
+};
+
+
+/**
+ * Type of a function that libextractor calls for each
+ * meta data item found.
+ *
+ * @param cls closure (user-defined)
+ * @param plugin_name name of the plugin that produced this value;
+ *        special values can be used (e.g. '&lt;zlib&gt;' for zlib being
+ *        used in the main libextractor library and yielding
+ *        meta data).
+ * @param type libextractor-type describing the meta data
+ * @param format basic format information about @a data
+ * @param data_mime_type mime-type of @a data (not of the original file);
+ *        can be NULL (if mime-type is not known)
+ * @param data actual meta-data found
+ * @param data_len number of bytes in @a data
+ * @return 0 to continue extracting, 1 to abort
+ */
+typedef int (*EXTRACTOR_MetaDataProcessor) (void *cls,
+                                            const char *plugin_name,
+                                            enum EXTRACTOR_MetaType type,
+                                            enum EXTRACTOR_MetaFormat format,
+                                            const char *data_mime_type,
+                                            const char *data,
+                                            size_t data_len);
+
+#endif
+
+#ifndef EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME
+/* hack for LE < 0.6.3 */
+#define EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME 180
+#endif
+
 
 /* ******************** URI API *********************** */
 
diff --git a/src/include/gnunet_mst_lib.h b/src/include/gnunet_mst_lib.h
index 3ad98a33b..af2dd3353 100644
--- a/src/include/gnunet_mst_lib.h
+++ b/src/include/gnunet_mst_lib.h
@@ -55,9 +55,6 @@ extern "C"
 #endif
 
 
-#include "gnunet_common.h"
-
-
 /**
  * Handle to a message stream tokenizer.
  */
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h
index 428d8610b..015282054 100644
--- a/src/include/gnunet_os_lib.h
+++ b/src/include/gnunet_os_lib.h
@@ -18,6 +18,10 @@
      SPDX-License-Identifier: AGPL3.0-or-later
  */
 
+#if !defined (__GNUNET_UTIL_LIB_H_INSIDE__)
+#error "Only <gnunet_util_lib.h> can be included directly."
+#endif
+
 /**
  * @addtogroup libgnunetutil
  * Multi-function utilities library for GNUnet programs
@@ -61,11 +65,6 @@ extern "C"
 #endif
 
 
-#include "gnunet_common.h"
-#include "gnunet_configuration_lib.h"
-#include "gnunet_scheduler_lib.h"
-
-
 /**
  * Flags that determine which of the standard streams
  * should be inherited by the child process.
diff --git a/src/include/gnunet_plugin_lib.h b/src/include/gnunet_plugin_lib.h
index df555e0cf..a3135e2cf 100644
--- a/src/include/gnunet_plugin_lib.h
+++ b/src/include/gnunet_plugin_lib.h
@@ -49,10 +49,6 @@ extern "C"
 #endif
 
 
-#include "gnunet_common.h"
-#include "gnunet_configuration_lib.h"
-
-
 /**
  * Signature of any function exported by a plugin.
  *
diff --git a/src/include/gnunet_tun_lib.h b/src/include/gnunet_tun_lib.h
index ab397b049..17acfe5f8 100644
--- a/src/include/gnunet_tun_lib.h
+++ b/src/include/gnunet_tun_lib.h
@@ -42,10 +42,6 @@
 #define GNUNET_TUN_LIB_H
 
 
-#include "gnunet_common.h"
-#include "gnunet_crypto_lib.h"
-
-
 /* see http://www.iana.org/assignments/ethernet-numbers */
 #ifndef ETH_P_IPV4
 /**
diff --git a/src/include/gnunet_util_lib.h b/src/include/gnunet_util_lib.h
index 337552a0c..ada40a4ca 100644
--- a/src/include/gnunet_util_lib.h
+++ b/src/include/gnunet_util_lib.h
@@ -65,7 +65,8 @@ extern "C"
 #define GNUNET_AGPL_URL "https://git.gnunet.org/gnunet.git/tag/?h=v"; \
   GNUNET_VERSION
 
-
+#include "gnunet_config.h"
+#include "gnunet_common.h"
 #include "gnunet_crypto_lib.h"
 #include "gnunet_bandwidth_lib.h"
 #include "gnunet_bio_lib.h"
diff --git a/src/util/configuration.c b/src/util/configuration.c
index af8a0746e..1a66458db 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -25,7 +25,6 @@
 
 #include "platform.h"
 #include "gnunet_util_lib.h"
-#include "gnunet_os_lib.h"
 #include "gnunet_configuration_lib.h"
 
 #define LOG(kind, ...) GNUNET_log_from (kind, "util", __VA_ARGS__)

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]