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/util | |
parent | cfd880578bd21f9adedba557291c903d325e93cd (diff) |
make libextractor actually optional, both for GNUnet and GNUnet-taler builds
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/Makefile.am | 3 | ||||
-rw-r--r-- | src/util/common_allocation.c | 2 | ||||
-rw-r--r-- | src/util/common_endian.c | 2 | ||||
-rw-r--r-- | src/util/common_logging.c | 10 | ||||
-rw-r--r-- | src/util/configuration.c | 5 | ||||
-rw-r--r-- | src/util/container_heap.c | 2 | ||||
-rw-r--r-- | src/util/container_meta_data.c | 9 | ||||
-rw-r--r-- | src/util/container_multihashmap.c | 2 | ||||
-rw-r--r-- | src/util/container_multihashmap32.c | 2 | ||||
-rw-r--r-- | src/util/crypto_crc.c | 2 | ||||
-rw-r--r-- | src/util/crypto_ecc.c | 3 | ||||
-rw-r--r-- | src/util/crypto_hash.c | 3 | ||||
-rw-r--r-- | src/util/crypto_mpi.c | 2 | ||||
-rw-r--r-- | src/util/crypto_random.c | 2 | ||||
-rw-r--r-- | src/util/crypto_rsa.c | 8 | ||||
-rw-r--r-- | src/util/crypto_symmetric.c | 2 | ||||
-rw-r--r-- | src/util/disk.c | 3 | ||||
-rw-r--r-- | src/util/disk.h | 3 | ||||
-rw-r--r-- | src/util/strings.c | 3 | ||||
-rw-r--r-- | src/util/test_container_meta_data.c | 14 | ||||
-rw-r--r-- | src/util/time.c | 3 |
21 files changed, 52 insertions, 33 deletions
diff --git a/src/util/Makefile.am b/src/util/Makefile.am index a2482fc874..916a588fa5 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am @@ -128,7 +128,6 @@ libgnunetutil_taler_wallet_la_SOURCES = \ common_allocation.c \ common_endian.c \ common_logging.c \ - configuration.c \ container_heap.c \ container_multihashmap.c \ container_multihashmap32.c \ @@ -141,8 +140,6 @@ libgnunetutil_taler_wallet_la_SOURCES = \ crypto_mpi.c \ crypto_random.c \ crypto_rsa.c \ - disk.c \ - disk.h \ strings.c \ time.c diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c index 5280d73b25..4fdc05f10a 100644 --- a/src/util/common_allocation.c +++ b/src/util/common_allocation.c @@ -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 diff --git a/src/util/common_endian.c b/src/util/common_endian.c index 4a8a01664b..e6c34250af 100644 --- a/src/util/common_endian.c +++ b/src/util/common_endian.c @@ -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__) diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 695b49913e..492d00dc69 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c @@ -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 @@ setup_log_file (const struct tm *tm) { 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 @@ setup_log_file (const struct tm *tm) 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,16 +385,13 @@ setup_log_file (const struct tm *tm) 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; return GNUNET_OK; } + /** * Utility function - adds a parsed definition to logdefs array. * diff --git a/src/util/configuration.c b/src/util/configuration.c index f61b43d573..3c75709816 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c @@ -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__) diff --git a/src/util/container_heap.c b/src/util/container_heap.c index 8c3de6c260..ad96af01d4 100644 --- a/src/util/container_heap.c +++ b/src/util/container_heap.c @@ -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__) diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c index 622b453349..5cef31f372 100644 --- a/src/util/container_meta_data.c +++ b/src/util/container_meta_data.c @@ -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 @@ GNUNET_CONTAINER_meta_data_add_publication_date (struct 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 @@ GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData *md, * @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; diff --git a/src/util/container_multihashmap.c b/src/util/container_multihashmap.c index df6dd5704a..46379b34ef 100644 --- a/src/util/container_multihashmap.c +++ b/src/util/container_multihashmap.c @@ -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__) diff --git a/src/util/container_multihashmap32.c b/src/util/container_multihashmap32.c index 00dee18cd5..d7b8413c45 100644 --- a/src/util/container_multihashmap32.c +++ b/src/util/container_multihashmap32.c @@ -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__) diff --git a/src/util/crypto_crc.c b/src/util/crypto_crc.c index 252cdad05d..5a83574780 100644 --- a/src/util/crypto_crc.c +++ b/src/util/crypto_crc.c @@ -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__) diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c index 87c7871858..adeaf77c83 100644 --- a/src/util/crypto_ecc.c +++ b/src/util/crypto_ecc.c @@ -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 diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c index e9f25bf842..8e5730ffd6 100644 --- a/src/util/crypto_hash.c +++ b/src/util/crypto_hash.c @@ -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__) diff --git a/src/util/crypto_mpi.c b/src/util/crypto_mpi.c index 806a35da8b..ad64778fd4 100644 --- a/src/util/crypto_mpi.c +++ b/src/util/crypto_mpi.c @@ -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__) diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c index 2960af17ee..f9a0664e25 100644 --- a/src/util/crypto_random.c +++ b/src/util/crypto_random.c @@ -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__) diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c index 0b21b40b4d..b8e29146f0 100644 --- a/src/util/crypto_rsa.c +++ b/src/util/crypto_rsa.c @@ -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 @@ GNUNET_CRYPTO_rsa_blinding_key_create (unsigned int len) /** * 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 @@ GNUNET_CRYPTO_rsa_signature_cmp (struct GNUNET_CRYPTO_rsa_Signature *s1, 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 @@ GNUNET_CRYPTO_rsa_public_key_cmp (struct GNUNET_CRYPTO_rsa_PublicKey *p1, 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, diff --git a/src/util/crypto_symmetric.c b/src/util/crypto_symmetric.c index 4551665463..6465d5eb67 100644 --- a/src/util/crypto_symmetric.c +++ b/src/util/crypto_symmetric.c @@ -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__) diff --git a/src/util/disk.c b/src/util/disk.c index a56966d04f..c9f6408e81 100644 --- a/src/util/disk.c +++ b/src/util/disk.c @@ -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__) diff --git a/src/util/disk.h b/src/util/disk.h index 1dfec216fc..2592bd8c0a 100644 --- a/src/util/disk.h +++ b/src/util/disk.h @@ -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 diff --git a/src/util/strings.c b/src/util/strings.c index 379f3f5a38..407a135d1d 100644 --- a/src/util/strings.c +++ b/src/util/strings.c @@ -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> diff --git a/src/util/test_container_meta_data.c b/src/util/test_container_meta_data.c index a3729fc9f1..df6587efdb 100644 --- a/src/util/test_container_meta_data.c +++ b/src/util/test_container_meta_data.c @@ -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 @@ main (int argc, char *argv[]) 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 */ diff --git a/src/util/time.c b/src/util/time.c index 01a3cddd5a..78dd4c6d24 100644 --- a/src/util/time.c +++ b/src/util/time.c @@ -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__) |