gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r35842 - in gnunet: . po src/fs src/include src/util


From: gnunet
Subject: [GNUnet-SVN] r35842 - in gnunet: . po src/fs src/include src/util
Date: Sat, 30 May 2015 20:35:02 +0200

Author: grothoff
Date: 2015-05-30 20:35:02 +0200 (Sat, 30 May 2015)
New Revision: 35842

Modified:
   gnunet/README
   gnunet/configure.ac
   gnunet/po/POTFILES.in
   gnunet/src/fs/Makefile.am
   gnunet/src/fs/fs_file_information.c
   gnunet/src/fs/fs_getopt.c
   gnunet/src/fs/gnunet-directory.c
   gnunet/src/fs/gnunet-helper-fs-publish.c
   gnunet/src/fs/gnunet-publish.c
   gnunet/src/fs/gnunet-search.c
   gnunet/src/fs/test_fs_directory.c
   gnunet/src/include/Makefile.am
   gnunet/src/include/gnunet_configuration_lib.h
   gnunet/src/include/gnunet_container_lib.h
   gnunet/src/include/gnunet_crypto_lib.h
   gnunet/src/include/gnunet_util_taler_wallet_lib.h
   gnunet/src/util/Makefile.am
   gnunet/src/util/common_allocation.c
   gnunet/src/util/common_endian.c
   gnunet/src/util/common_logging.c
   gnunet/src/util/configuration.c
   gnunet/src/util/container_heap.c
   gnunet/src/util/container_meta_data.c
   gnunet/src/util/container_multihashmap.c
   gnunet/src/util/container_multihashmap32.c
   gnunet/src/util/crypto_crc.c
   gnunet/src/util/crypto_ecc.c
   gnunet/src/util/crypto_hash.c
   gnunet/src/util/crypto_mpi.c
   gnunet/src/util/crypto_random.c
   gnunet/src/util/crypto_rsa.c
   gnunet/src/util/crypto_symmetric.c
   gnunet/src/util/disk.c
   gnunet/src/util/disk.h
   gnunet/src/util/strings.c
   gnunet/src/util/test_container_meta_data.c
   gnunet/src/util/time.c
Log:
make libextractor actually optional, both for GNUnet and GNUnet-taler builds

Modified: gnunet/README
===================================================================
--- gnunet/README       2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/README       2015-05-30 18:35:02 UTC (rev 35842)
@@ -28,14 +28,13 @@
 
 These are the direct dependencies for running GNUnet:
 
-- libextractor  >= 0.6.1
-- libmicrohttpd >= 0.9.33
+- libmicrohttpd >= 0.9.40
 - libgcrypt     >= 1.6
 - libgnurl      >= 7.35.0 (available from https://gnunet.org/gnurl)
 - libunistring  >= 0.9.2
 - gnutls        >= 3.2.12
 - libidn        >= 1.0
-- libglpk       >= 4.45
+- libextractor  >= 0.6.1 (highly recommended)
 - openssl       >= 1.0 (binary, used to generate X.509 certificate)
 - libltdl       >= 2.2 (part of GNU libtool)
 - sqlite        >= 3.8 (default database, required)
@@ -46,6 +45,7 @@
 - libogg        >= 1.3.0 (optional for experimental conversation tool)
 - python-zbar   >= 0.10 (optional for gnunet-qr)
 - TeX Live      >= 2012 (optional for gnunet-bcd)
+- libglpk       >= 4.45 (optional for experimental code)
 
 Recommended autotools for compiling the SVN version are:
 - autoconf >= 2.59

Modified: gnunet/configure.ac
===================================================================
--- gnunet/configure.ac 2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/configure.ac 2015-05-30 18:35:02 UTC (rev 35842)
@@ -557,11 +557,6 @@
 AC_MSG_RESULT($taler_only)
 AM_CONDITIONAL([TALER_ONLY], [test "x$taler_only" = "xyes"])
 
-if test "$taler_only" != yes
-then
-
-
-
 # test for libextractor
 extractor=0
 AC_MSG_CHECKING(for libextractor)
@@ -590,14 +585,22 @@
     AC_CHECK_HEADERS(extractor.h,
      AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
       extractor=1))])
+# restore LIBS
+LIBS=$SAVE_LIBS
+
 if test "$extractor" != 1
 then
- AC_MSG_ERROR([GNUnet requires libextractor])
+ AM_CONDITIONAL(HAVE_LIBEXTRACTOR, false)
+ AC_DEFINE([HAVE_LIBEXTRACTOR],[0],[Lacking libextractor])
+else
+ AM_CONDITIONAL(HAVE_LIBEXTRACTOR, true)
+ AC_DEFINE([HAVE_LIBEXTRACTOR],[1],[Have libextractor])
 fi
-# restore LIBS
-LIBS=$SAVE_LIBS
 
 
+if test "$taler_only" != yes
+then
+
 # Check for libltdl header (#2999)
 ltdl=0
 AC_MSG_CHECKING(for libltdl)
@@ -1674,6 +1677,10 @@
   fi
 fi
 
+if test "$extractor" != 1
+then
+ AC_MSG_WARN([NOTICE: libextractor not found, but various file-sharing 
functions require it])
+fi
 
 AC_MSG_NOTICE([NOTICE: Database support is set to MySQL: $mysql, SQLite: 
$sqlite, Postgres: $postgres])
 

Modified: gnunet/po/POTFILES.in
===================================================================
--- gnunet/po/POTFILES.in       2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/po/POTFILES.in       2015-05-30 18:35:02 UTC (rev 35842)
@@ -391,6 +391,7 @@
 src/util/common_endian.c
 src/util/common_logging.c
 src/util/configuration.c
+src/util/configuration_loader.c
 src/util/connection.c
 src/util/container_bloomfilter.c
 src/util/container_heap.c
@@ -400,7 +401,9 @@
 src/util/container_multipeermap.c
 src/util/crypto_crc.c
 src/util/crypto_ecc.c
+src/util/crypto_ecc_setup.c
 src/util/crypto_hash.c
+src/util/crypto_hash_file.c
 src/util/crypto_hkdf.c
 src/util/crypto_kdf.c
 src/util/crypto_mpi.c
@@ -409,6 +412,7 @@
 src/util/crypto_rsa.c
 src/util/crypto_symmetric.c
 src/util/disk.c
+src/util/disk_iterator.c
 src/util/getopt.c
 src/util/getopt_helpers.c
 src/util/gnunet-config.c

Modified: gnunet/src/fs/Makefile.am
===================================================================
--- gnunet/src/fs/Makefile.am   2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/fs/Makefile.am   2015-05-30 18:35:02 UTC (rev 35842)
@@ -51,8 +51,13 @@
 libgnunetfs_la_LIBADD = \
   $(top_builddir)/src/datastore/libgnunetdatastore.la \
   $(top_builddir)/src/util/libgnunetutil.la \
-  $(GN_LIBINTL) $(XLIB) $(LIBGCRYPT_LIBS) -lunistring -lextractor
+  $(GN_LIBINTL) $(XLIB) $(LIBGCRYPT_LIBS) -lunistring
 
+if HAVE_LIBEXTRACTOR
+libgnunetfs_la_LIBADD += \
+  -lextractor
+endif
+
 libgnunetfs_la_LDFLAGS = \
   $(GN_LIB_LDFLAGS)  $(WINFLAGS) \
   -version-info 3:1:1
@@ -92,9 +97,13 @@
 gnunet_directory_LDADD = \
   libgnunetfs.la \
   $(top_builddir)/src/util/libgnunetutil.la \
-  -lextractor \
   $(GN_LIBINTL)
 
+if HAVE_LIBEXTRACTOR
+gnunet_directory_LDADD += \
+  -lextractor
+endif
+
 gnunet_fs_profiler_SOURCES = \
  gnunet-fs-profiler.c
 gnunet_fs_profiler_LDADD = \
@@ -107,9 +116,13 @@
 gnunet_fs_LDADD = \
   libgnunetfs.la \
   $(top_builddir)/src/util/libgnunetutil.la \
-  -lextractor \
   $(GN_LIBINTL)
 
+if HAVE_LIBEXTRACTOR
+gnunet_fs_LDADD += \
+  -lextractor
+endif
+
 gnunet_download_SOURCES =  \
  gnunet-download.c
 gnunet_download_LDADD =  \
@@ -123,31 +136,48 @@
  $(top_builddir)/src/identity/libgnunetidentity.la \
  libgnunetfs.la \
  $(top_builddir)/src/util/libgnunetutil.la \
- -lextractor \
  $(GN_LIBINTL)
 
+if HAVE_LIBEXTRACTOR
+gnunet_publish_LDADD += \
+  -lextractor
+endif
+
 gnunet_auto_share_SOURCES =  \
  gnunet-auto-share.c
 gnunet_auto_share_LDADD =  \
  $(top_builddir)/src/util/libgnunetutil.la \
- -lextractor \
  $(GN_LIBINTL)
 
+if HAVE_LIBEXTRACTOR
+gnunet_auto_share_LDADD += \
+  -lextractor
+endif
+
 gnunet_helper_fs_publish_SOURCES =  \
  gnunet-helper-fs-publish.c
 gnunet_helper_fs_publish_LDADD =  \
  $(top_builddir)/src/util/libgnunetutil.la \
- -lextractor \
  $(GN_LIBINTL)
 
+if HAVE_LIBEXTRACTOR
+gnunet_helper_fs_publish_LDADD += \
+  -lextractor
+endif
+
 gnunet_search_SOURCES = \
  gnunet-search.c
 gnunet_search_LDADD = \
   libgnunetfs.la \
   $(top_builddir)/src/util/libgnunetutil.la \
- -lextractor \
   $(GN_LIBINTL)
 
+if HAVE_LIBEXTRACTOR
+gnunet_search_LDADD += \
+  -lextractor
+endif
+
+
 gnunet_daemon_fsprofiler_SOURCES =  \
  gnunet-daemon-fsprofiler.c
 gnunet_daemon_fsprofiler_LDADD = \
@@ -243,10 +273,14 @@
 
 if HAVE_PYTHON
 check_SCRIPTS = \
- test_gnunet_fs_psd.py \
  test_gnunet_fs_rec.py \
  test_gnunet_fs_idx.py
+
+if HAVE_LIBEXTRACTOR
+check_SCRIPTS += \
+ test_gnunet_fs_psd.py
 endif
+endif
 
 if ENABLE_MONKEY
  MONKEY = @MONKEYPREFIX@
@@ -289,10 +323,15 @@
 test_fs_directory_SOURCES = \
  test_fs_directory.c
 test_fs_directory_LDADD = \
-  -lextractor \
   libgnunetfs.la  \
   $(top_builddir)/src/util/libgnunetutil.la
 
+if HAVE_LIBEXTRACTOR
+test_fs_directory_LDADD += \
+  -lextractor
+endif
+
+
 test_fs_download_SOURCES = \
  test_fs_download.c
 test_fs_download_LDADD = \
@@ -324,10 +363,15 @@
 test_fs_file_information_SOURCES = \
  test_fs_file_information.c
 test_fs_file_information_LDADD = \
-  -lextractor \
   libgnunetfs.la  \
   $(top_builddir)/src/util/libgnunetutil.la
 
+if HAVE_LIBEXTRACTOR
+test_fs_file_information_LDADD += \
+  -lextractor
+endif
+
+
 test_fs_getopt_SOURCES = \
  test_fs_getopt.c
 test_fs_getopt_LDADD = \

Modified: gnunet/src/fs/fs_file_information.c
===================================================================
--- gnunet/src/fs/fs_file_information.c 2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/fs/fs_file_information.c 2015-05-30 18:35:02 UTC (rev 35842)
@@ -24,7 +24,9 @@
  * @author Christian Grothoff
  */
 #include "platform.h"
+#if HAVE_EXTRACTOR_H
 #include <extractor.h>
+#endif
 #include "gnunet_fs_service.h"
 #include "fs_api.h"
 #include "fs_tree.h"

Modified: gnunet/src/fs/fs_getopt.c
===================================================================
--- gnunet/src/fs/fs_getopt.c   2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/fs/fs_getopt.c   2015-05-30 18:35:02 UTC (rev 35842)
@@ -118,17 +118,20 @@
  * @param scls must be of type "struct GNUNET_MetaData **"
  * @param option name of the option (typically 'k')
  * @param value command line argument given
- * @return GNUNET_OK on success
+ * @return #GNUNET_OK on success
  */
 int
-GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext
-                               *ctx, void *scls, const char *option,
+GNUNET_FS_getopt_set_metadata (struct 
GNUNET_GETOPT_CommandLineProcessorContext *ctx,
+                               void *scls,
+                               const char *option,
                                const char *value)
 {
   struct GNUNET_CONTAINER_MetaData **mm = scls;
+#if HAVE_EXTRACTOR_H
   enum EXTRACTOR_MetaType type;
   const char *typename;
   const char *typename_i18n;
+#endif
   struct GNUNET_CONTAINER_MetaData *meta;
   char *tmp;
 
@@ -144,7 +147,7 @@
    */
   /*tmp = GNUNET_STRINGS_to_utf8 (value, strlen (value), locale_charset ());*/
   tmp = GNUNET_strdup (value);
-
+#if HAVE_EXTRACTOR_H
   type = EXTRACTOR_metatype_get_max ();
   while (type > 0)
   {
@@ -181,7 +184,9 @@
       break;
     }
   }
-  if (tmp != NULL)
+#endif
+
+  if (NULL != tmp)
   {
     GNUNET_CONTAINER_meta_data_insert (meta, "<gnunet>",
                                        EXTRACTOR_METATYPE_UNKNOWN,

Modified: gnunet/src/fs/gnunet-directory.c
===================================================================
--- gnunet/src/fs/gnunet-directory.c    2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/fs/gnunet-directory.c    2015-05-30 18:35:02 UTC (rev 35842)
@@ -36,13 +36,17 @@
  * @param format format of data
  * @param data_mime_type mime type of data
  * @param data value of the meta data
- * @param data_size number of bytes in data
+ * @param data_size number of bytes in @a data
  * @return always 0 (to continue iterating)
  */
 static int
-item_printer (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_size)
+item_printer (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_size)
 {
   if (type == EXTRACTOR_METATYPE_GNUNET_FULL_DATA)
   {
@@ -55,9 +59,16 @@
     return 0;
   if (type == EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME)
     return 0;
+#if HAVE_LIBEXTRACTOR
   printf ("\t%20s: %s\n",
           dgettext (LIBEXTRACTOR_GETTEXT_DOMAIN,
-                    EXTRACTOR_metatype_to_string (type)), data);
+                    EXTRACTOR_metatype_to_string (type)),
+    data);
+#else
+  printf ("\t%20d: %s\n",
+          type,
+          data);
+#endif
   return 0;
 }
 

Modified: gnunet/src/fs/gnunet-helper-fs-publish.c
===================================================================
--- gnunet/src/fs/gnunet-helper-fs-publish.c    2015-05-29 13:06:33 UTC (rev 
35841)
+++ gnunet/src/fs/gnunet-helper-fs-publish.c    2015-05-30 18:35:02 UTC (rev 
35842)
@@ -82,10 +82,12 @@
 };
 
 
+#if HAVE_LIBEXTRACTOR
 /**
  * List of libextractor plugins to use for extracting.
  */
 static struct EXTRACTOR_PluginList *plugins;
+#endif
 
 /**
  * File descriptor we use for IPC with the parent.
@@ -93,6 +95,7 @@
 static int output_stream;
 
 
+#if HAVE_LIBEXTRACTOR
 /**
  * Add meta data that libextractor finds to our meta data
  * container.
@@ -111,9 +114,13 @@
  * @return always 0 to continue extracting
  */
 static int
-add_to_md (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)
+add_to_md (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)
 {
   struct GNUNET_CONTAINER_MetaData *md = cls;
 
@@ -134,6 +141,7 @@
   }
   return 0;
 }
+#endif
 
 
 /**
@@ -151,7 +159,7 @@
   if (NULL != tree->parent)
     GNUNET_CONTAINER_DLL_remove (tree->parent->children_head,
                                 tree->parent->children_tail,
-                                tree);                         
+                                tree);
   GNUNET_free (tree->filename);
   GNUNET_free (tree);
 }
@@ -383,7 +391,13 @@
 
   /* this is the expensive operation, *afterwards* we'll check for aborts */
   meta = GNUNET_CONTAINER_meta_data_create ();
-  EXTRACTOR_extract (plugins, item->filename, NULL, 0, &add_to_md, meta);
+#if HAVE_LIBEXTRACTOR
+  EXTRACTOR_extract (plugins,
+                     item->filename,
+                     NULL, 0,
+                     &add_to_md,
+                     meta);
+#endif
   slen = strlen (item->filename) + 1;
   size = GNUNET_CONTAINER_meta_data_get_serialized_size (meta);
   if (-1 == size)
@@ -525,10 +539,12 @@
   if ( (NULL == ex) ||
        (0 != strcmp (ex, "-")) )
   {
+#if HAVE_LIBEXTRACTOR
     plugins = EXTRACTOR_plugin_add_defaults (EXTRACTOR_OPTION_DEFAULT_POLICY);
     if (NULL != ex)
       plugins = EXTRACTOR_plugin_add_config (plugins, ex,
                                             EXTRACTOR_OPTION_DEFAULT_POLICY);
+#endif
   }
 
   /* scan tree to find out how much work there is to be done */
@@ -536,7 +552,9 @@
                                    &root))
   {
     (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 
0);
+#if HAVE_LIBEXTRACTOR
     EXTRACTOR_plugin_remove_all (plugins);
+#endif
 #if WINDOWS
     GNUNET_free ((void*) argv);
 #endif
@@ -547,7 +565,9 @@
   if (GNUNET_OK !=
       write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_COUNTING_DONE, 
NULL, 0))
   {
+#if HAVE_LIBEXTRACTOR
     EXTRACTOR_plugin_remove_all (plugins);
+#endif
 #if WINDOWS
     GNUNET_free ((void*) argv);
 #endif
@@ -560,7 +580,9 @@
     {
       (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 
0);
       free_tree (root);
+#if HAVE_LIBEXTRACTOR
       EXTRACTOR_plugin_remove_all (plugins);
+#endif
 #if WINDOWS
       GNUNET_free ((void*) argv);
 #endif
@@ -570,7 +592,9 @@
   }
   /* enable "clean" shutdown by telling parent that we are done */
   (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_FINISHED, NULL, 
0);
+#if HAVE_LIBEXTRACTOR
   EXTRACTOR_plugin_remove_all (plugins);
+#endif
 #if WINDOWS
   GNUNET_free ((void*) argv);
 #endif
@@ -578,4 +602,3 @@
 }
 
 /* end of gnunet-helper-fs-publish.c */
-

Modified: gnunet/src/fs/gnunet-publish.c
===================================================================
--- gnunet/src/fs/gnunet-publish.c      2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/fs/gnunet-publish.c      2015-05-30 18:35:02 UTC (rev 35842)
@@ -348,7 +348,11 @@
     return 0;
   if (EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME == type)
     return 0;
+#if HAVE_LIBEXTRACTOR
   FPRINTF (stdout, "\t%s - %s\n", EXTRACTOR_metatype_to_string (type), data);
+#else
+  FPRINTF (stdout, "\t%d - %s\n", type, data);
+#endif
   return 0;
 }
 

Modified: gnunet/src/fs/gnunet-search.c
===================================================================
--- gnunet/src/fs/gnunet-search.c       2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/fs/gnunet-search.c       2015-05-30 18:35:02 UTC (rev 35842)
@@ -82,9 +82,15 @@
     return 0;
   if (type == EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME)
     return 0;
+#if HAVE_LIBEXTRACTOR
   printf ("\t%20s: %s\n",
           dgettext (LIBEXTRACTOR_GETTEXT_DOMAIN,
                     EXTRACTOR_metatype_to_string (type)), data);
+#else
+  printf ("\t%20d: %s\n",
+          type,
+          data);
+#endif
   return 0;
 }
 

Modified: gnunet/src/fs/test_fs_directory.c
===================================================================
--- gnunet/src/fs/test_fs_directory.c   2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/fs/test_fs_directory.c   2015-05-30 18:35:02 UTC (rev 35842)
@@ -17,15 +17,15 @@
      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
      Boston, MA 02111-1307, USA.
 */
-
 /**
  * @file fs/test_fs_directory.c
  * @brief Test for fs_directory.c
  * @author Christian Grothoff
  */
-
 #include "platform.h"
+#if HAVE_EXTRACTOR_H
 #include <extractor.h>
+#endif
 #include "gnunet_util_lib.h"
 #include "gnunet_fs_service.h"
 #include "fs_api.h"
@@ -99,7 +99,11 @@
     {
       GNUNET_snprintf (txt, sizeof (txt), "%u -- %u\n", p, q);
       GNUNET_CONTAINER_meta_data_insert (mds[p], "<test>",
+#if HAVE_EXTRACTOR_H
                                          q % EXTRACTOR_metatype_get_max (),
+#else
+                                         q % 128,
+#endif
                                          EXTRACTOR_METAFORMAT_UTF8,
                                          "text/plain", txt, strlen (txt) + 1);
     }

Modified: gnunet/src/include/Makefile.am
===================================================================
--- gnunet/src/include/Makefile.am      2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/include/Makefile.am      2015-05-30 18:35:02 UTC (rev 35842)
@@ -17,11 +17,8 @@
 gnunetinclude_HEADERS = \
   platform.h plibc.h $(WINPROC) gettext.h \
   gnunet_common.h \
-  gnunet_configuration_lib.h \
   gnunet_container_lib.h \
   gnunet_crypto_lib.h \
-  gnunet_disk_lib.h \
-  gnunet_scheduler_lib.h \
   gnunet_strings_lib.h \
   gnunet_time_lib.h \
   gnunet_util_taler_wallet_lib.h

Modified: gnunet/src/include/gnunet_configuration_lib.h
===================================================================
--- gnunet/src/include/gnunet_configuration_lib.h       2015-05-29 13:06:33 UTC 
(rev 35841)
+++ gnunet/src/include/gnunet_configuration_lib.h       2015-05-30 18:35:02 UTC 
(rev 35842)
@@ -28,6 +28,7 @@
 #ifndef GNUNET_CONFIGURATION_LIB_H
 #define GNUNET_CONFIGURATION_LIB_H
 
+#include "gnunet_time_lib.h"
 
 #ifdef __cplusplus
 extern "C"

Modified: gnunet/src/include/gnunet_container_lib.h
===================================================================
--- gnunet/src/include/gnunet_container_lib.h   2015-05-29 13:06:33 UTC (rev 
35841)
+++ gnunet/src/include/gnunet_container_lib.h   2015-05-30 18:35:02 UTC (rev 
35842)
@@ -35,8 +35,102 @@
 
 /* add error and config prototypes */
 #include "gnunet_crypto_lib.h"
+
+#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 (i.e. '&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

Modified: gnunet/src/include/gnunet_crypto_lib.h
===================================================================
--- gnunet/src/include/gnunet_crypto_lib.h      2015-05-29 13:06:33 UTC (rev 
35841)
+++ gnunet/src/include/gnunet_crypto_lib.h      2015-05-30 18:35:02 UTC (rev 
35842)
@@ -54,9 +54,13 @@
 struct GNUNET_PeerIdentity;
 
 #include "gnunet_common.h"
-#include "gnunet_scheduler_lib.h"
 #include <gcrypt.h>
 
+/**
+ * We need this enum here, but not the entire scheduler API.
+ * For the full definition, see gnunet_scheduler_lib.h.
+ */
+enum GNUNET_SCHEDULER_Priority;
 
 /**
  * @brief A 512-bit hashcode

Modified: gnunet/src/include/gnunet_util_taler_wallet_lib.h
===================================================================
--- gnunet/src/include/gnunet_util_taler_wallet_lib.h   2015-05-29 13:06:33 UTC 
(rev 35841)
+++ gnunet/src/include/gnunet_util_taler_wallet_lib.h   2015-05-30 18:35:02 UTC 
(rev 35842)
@@ -43,7 +43,6 @@
 
 #include "gnunet_crypto_lib.h"
 #include "gnunet_container_lib.h"
-#include "gnunet_disk_lib.h"
 #include "gnunet_strings_lib.h"
 
 #if 0                           /* keep Emacsens' auto-indent happy */

Modified: gnunet/src/util/Makefile.am
===================================================================
--- gnunet/src/util/Makefile.am 2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/Makefile.am 2015-05-30 18:35:02 UTC (rev 35842)
@@ -128,7 +128,6 @@
   common_allocation.c \
   common_endian.c \
   common_logging.c \
-  configuration.c \
   container_heap.c \
   container_multihashmap.c \
   container_multihashmap32.c \
@@ -141,8 +140,6 @@
   crypto_mpi.c \
   crypto_random.c \
   crypto_rsa.c \
-  disk.c \
-  disk.h \
   strings.c \
   time.c
 

Modified: gnunet/src/util/common_allocation.c
===================================================================
--- gnunet/src/util/common_allocation.c 2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/common_allocation.c 2015-05-30 18:35:02 UTC (rev 35842)
@@ -24,7 +24,7 @@
  * @author Christian Grothoff
  */
 #include "platform.h"
-#include "gnunet_util_lib.h"
+#include "gnunet_crypto_lib.h"
 #if HAVE_MALLOC_H
 #include <malloc.h>
 #endif

Modified: gnunet/src/util/common_endian.c
===================================================================
--- gnunet/src/util/common_endian.c     2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/common_endian.c     2015-05-30 18:35:02 UTC (rev 35842)
@@ -26,7 +26,7 @@
  */
 
 #include "platform.h"
-#include "gnunet_util_lib.h"
+#include "gnunet_crypto_lib.h"
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__)
 

Modified: gnunet/src/util/common_logging.c
===================================================================
--- gnunet/src/util/common_logging.c    2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/common_logging.c    2015-05-30 18:35:02 UTC (rev 35842)
@@ -24,7 +24,8 @@
  * @author Christian Grothoff
  */
 #include "platform.h"
-#include "gnunet_util_lib.h"
+#include "gnunet_crypto_lib.h"
+#include "gnunet_strings_lib.h"
 #include <regex.h>
 
 
@@ -328,7 +329,6 @@
 {
   static char last_fn[PATH_MAX + 1];
   char fn[PATH_MAX + 1];
-  int dirwarn;
   int altlog_fd;
   int dup_return;
   FILE *altlog;
@@ -352,7 +352,6 @@
     return GNUNET_OK; /* no change */
   log_rotate (last_fn);
   strcpy (last_fn, fn);
-  dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn));
 #if WINDOWS
   altlog_fd = OPEN (fn, O_APPEND |
                         O_BINARY |
@@ -386,10 +385,6 @@
   if (-1 == altlog_fd)
   {
     GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "open", fn);
-    if (dirwarn)
-      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  _("Failed to create or access directory for log file 
`%s'\n"),
-                  fn);
     return GNUNET_SYSERR;
   }
   GNUNET_stderr = altlog;
@@ -396,6 +391,7 @@
   return GNUNET_OK;
 }
 
+
 /**
  * Utility function - adds a parsed definition to logdefs array.
  *

Modified: gnunet/src/util/configuration.c
===================================================================
--- gnunet/src/util/configuration.c     2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/configuration.c     2015-05-30 18:35:02 UTC (rev 35842)
@@ -25,7 +25,10 @@
  */
 
 #include "platform.h"
-#include "gnunet_util_lib.h"
+#include "gnunet_crypto_lib.h"
+#include "gnunet_strings_lib.h"
+#include "gnunet_configuration_lib.h"
+#include "gnunet_disk_lib.h"
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 

Modified: gnunet/src/util/container_heap.c
===================================================================
--- gnunet/src/util/container_heap.c    2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/container_heap.c    2015-05-30 18:35:02 UTC (rev 35842)
@@ -26,7 +26,7 @@
  */
 
 #include "platform.h"
-#include "gnunet_util_lib.h"
+#include "gnunet_container_lib.h"
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 

Modified: gnunet/src/util/container_meta_data.c
===================================================================
--- gnunet/src/util/container_meta_data.c       2015-05-29 13:06:33 UTC (rev 
35841)
+++ gnunet/src/util/container_meta_data.c       2015-05-30 18:35:02 UTC (rev 
35842)
@@ -26,7 +26,9 @@
 
 #include "platform.h"
 #include "gnunet_util_lib.h"
+#if HAVE_EXTRACTOR_H
 #include <extractor.h>
+#endif
 #include <zlib.h>
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
@@ -432,7 +434,8 @@
   struct GNUNET_TIME_Absolute t;
 
   t = GNUNET_TIME_absolute_get ();
-  GNUNET_CONTAINER_meta_data_delete (md, EXTRACTOR_METATYPE_PUBLICATION_DATE,
+  GNUNET_CONTAINER_meta_data_delete (md,
+                                     EXTRACTOR_METATYPE_PUBLICATION_DATE,
                                      NULL, 0);
   dat = GNUNET_STRINGS_absolute_time_to_string (t);
   GNUNET_CONTAINER_meta_data_insert (md, "<gnunet>",
@@ -481,8 +484,8 @@
  * @return NULL if no entry was found
  */
 char *
-GNUNET_CONTAINER_meta_data_get_by_type (const struct GNUNET_CONTAINER_MetaData
-                                        *md, enum EXTRACTOR_MetaType type)
+GNUNET_CONTAINER_meta_data_get_by_type (const struct GNUNET_CONTAINER_MetaData 
*md,
+                                        enum EXTRACTOR_MetaType type)
 {
   struct MetaItem *pos;
 

Modified: gnunet/src/util/container_multihashmap.c
===================================================================
--- gnunet/src/util/container_multihashmap.c    2015-05-29 13:06:33 UTC (rev 
35841)
+++ gnunet/src/util/container_multihashmap.c    2015-05-30 18:35:02 UTC (rev 
35842)
@@ -24,7 +24,7 @@
  */
 
 #include "platform.h"
-#include "gnunet_util_lib.h"
+#include "gnunet_container_lib.h"
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 

Modified: gnunet/src/util/container_multihashmap32.c
===================================================================
--- gnunet/src/util/container_multihashmap32.c  2015-05-29 13:06:33 UTC (rev 
35841)
+++ gnunet/src/util/container_multihashmap32.c  2015-05-30 18:35:02 UTC (rev 
35842)
@@ -26,7 +26,7 @@
  */
 
 #include "platform.h"
-#include "gnunet_util_lib.h"
+#include "gnunet_container_lib.h"
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 

Modified: gnunet/src/util/crypto_crc.c
===================================================================
--- gnunet/src/util/crypto_crc.c        2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/crypto_crc.c        2015-05-30 18:35:02 UTC (rev 35842)
@@ -28,7 +28,7 @@
  * @author Christian Grothoff
  */
 #include "platform.h"
-#include "gnunet_util_lib.h"
+#include "gnunet_crypto_lib.h"
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 

Modified: gnunet/src/util/crypto_ecc.c
===================================================================
--- gnunet/src/util/crypto_ecc.c        2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/crypto_ecc.c        2015-05-30 18:35:02 UTC (rev 35842)
@@ -25,7 +25,8 @@
  */
 #include "platform.h"
 #include <gcrypt.h>
-#include "gnunet_util_lib.h"
+#include "gnunet_crypto_lib.h"
+#include "gnunet_strings_lib.h"
 
 #define EXTRA_CHECKS 0
 

Modified: gnunet/src/util/crypto_hash.c
===================================================================
--- gnunet/src/util/crypto_hash.c       2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/crypto_hash.c       2015-05-30 18:35:02 UTC (rev 35842)
@@ -24,7 +24,8 @@
  * @author Christian Grothoff
  */
 #include "platform.h"
-#include "gnunet_util_lib.h"
+#include "gnunet_crypto_lib.h"
+#include "gnunet_strings_lib.h"
 #include <gcrypt.h>
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)

Modified: gnunet/src/util/crypto_mpi.c
===================================================================
--- gnunet/src/util/crypto_mpi.c        2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/crypto_mpi.c        2015-05-30 18:35:02 UTC (rev 35842)
@@ -26,7 +26,7 @@
  */
 #include "platform.h"
 #include <gcrypt.h>
-#include "gnunet_util_lib.h"
+#include "gnunet_crypto_lib.h"
 
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)

Modified: gnunet/src/util/crypto_random.c
===================================================================
--- gnunet/src/util/crypto_random.c     2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/crypto_random.c     2015-05-30 18:35:02 UTC (rev 35842)
@@ -25,7 +25,7 @@
  * @author Christian Grothoff
  */
 #include "platform.h"
-#include "gnunet_util_lib.h"
+#include "gnunet_crypto_lib.h"
 #include <gcrypt.h>
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)

Modified: gnunet/src/util/crypto_rsa.c
===================================================================
--- gnunet/src/util/crypto_rsa.c        2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/crypto_rsa.c        2015-05-30 18:35:02 UTC (rev 35842)
@@ -22,7 +22,7 @@
  */
 #include "platform.h"
 #include <gcrypt.h>
-#include "gnunet_util_lib.h"
+#include "gnunet_crypto_lib.h"
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 
@@ -413,7 +413,7 @@
 
 /**
  * Compare the values of two blinding keys.
- * 
+ *
  * @param b1 one key
  * @param b2 the other key
  * @return 0 if the two are equal
@@ -443,7 +443,7 @@
   size_t z1;
   size_t z2;
   int ret;
-  
+
   z1 = GNUNET_CRYPTO_rsa_signature_encode (s1,
                                           &b1);
   z2 = GNUNET_CRYPTO_rsa_signature_encode (s2,
@@ -476,7 +476,7 @@
   size_t z1;
   size_t z2;
   int ret;
-  
+
   z1 = GNUNET_CRYPTO_rsa_public_key_encode (p1,
                                            &b1);
   z2 = GNUNET_CRYPTO_rsa_public_key_encode (p2,

Modified: gnunet/src/util/crypto_symmetric.c
===================================================================
--- gnunet/src/util/crypto_symmetric.c  2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/crypto_symmetric.c  2015-05-30 18:35:02 UTC (rev 35842)
@@ -26,7 +26,7 @@
  */
 
 #include "platform.h"
-#include "gnunet_util_lib.h"
+#include "gnunet_crypto_lib.h"
 #include <gcrypt.h>
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)

Modified: gnunet/src/util/disk.c
===================================================================
--- gnunet/src/util/disk.c      2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/disk.c      2015-05-30 18:35:02 UTC (rev 35842)
@@ -24,8 +24,9 @@
  * @author Nils Durner
  */
 #include "platform.h"
-#include "gnunet_util_lib.h"
 #include "disk.h"
+#include "gnunet_strings_lib.h"
+#include "gnunet_disk_lib.h"
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 

Modified: gnunet/src/util/disk.h
===================================================================
--- gnunet/src/util/disk.h      2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/disk.h      2015-05-30 18:35:02 UTC (rev 35842)
@@ -26,7 +26,8 @@
 #ifndef GNUNET_DISK_H_
 #define GNUNET_DISK_H_
 
-#include "gnunet_util_lib.h"
+#include "gnunet_crypto_lib.h"
+#include "gnunet_disk_lib.h"
 
 /**
  * Retrieve OS file handle

Modified: gnunet/src/util/strings.c
===================================================================
--- gnunet/src/util/strings.c   2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/strings.c   2015-05-30 18:35:02 UTC (rev 35842)
@@ -29,7 +29,8 @@
 #if HAVE_ICONV
 #include <iconv.h>
 #endif
-#include "gnunet_util_lib.h"
+#include "gnunet_crypto_lib.h"
+#include "gnunet_strings_lib.h"
 #include <unicase.h>
 #include <unistr.h>
 #include <uniconv.h>

Modified: gnunet/src/util/test_container_meta_data.c
===================================================================
--- gnunet/src/util/test_container_meta_data.c  2015-05-29 13:06:33 UTC (rev 
35841)
+++ gnunet/src/util/test_container_meta_data.c  2015-05-30 18:35:02 UTC (rev 
35842)
@@ -27,6 +27,8 @@
 #include "platform.h"
 #include "gnunet_util_lib.h"
 
+#if HAVE_EXTRACTOR_H
+
 #define ABORT(m) { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if 
(m != NULL) GNUNET_CONTAINER_meta_data_destroy(m); return 1; }
 
 static int
@@ -343,4 +345,16 @@
   return 0;
 }
 
+#else
+
+int
+main (int argc, char *argv[])
+{
+  fprintf (stderr,
+           "GNU libextractor not found, skipping test.\n");
+  return 0;
+}
+
+#endif
+
 /* end of test_container_meta_data.c */

Modified: gnunet/src/util/time.c
===================================================================
--- gnunet/src/util/time.c      2015-05-29 13:06:33 UTC (rev 35841)
+++ gnunet/src/util/time.c      2015-05-30 18:35:02 UTC (rev 35842)
@@ -24,7 +24,8 @@
  * @brief functions for handling time and time arithmetic
  */
 #include "platform.h"
-#include "gnunet_util_lib.h"
+#include "gnunet_crypto_lib.h"
+#include "gnunet_time_lib.h"
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 




reply via email to

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