aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-05-30 18:35:02 +0000
committerChristian Grothoff <christian@grothoff.org>2015-05-30 18:35:02 +0000
commit93fba12ad8159dc6b683f9e7ce9f0528a11047f5 (patch)
tree73b1bd212c6c5a32adb924d208d8a315b606e854 /src/util
parentcfd880578bd21f9adedba557291c903d325e93cd (diff)
downloadgnunet-93fba12ad8159dc6b683f9e7ce9f0528a11047f5.tar.gz
gnunet-93fba12ad8159dc6b683f9e7ce9f0528a11047f5.zip
make libextractor actually optional, both for GNUnet and GNUnet-taler builds
Diffstat (limited to 'src/util')
-rw-r--r--src/util/Makefile.am3
-rw-r--r--src/util/common_allocation.c2
-rw-r--r--src/util/common_endian.c2
-rw-r--r--src/util/common_logging.c10
-rw-r--r--src/util/configuration.c5
-rw-r--r--src/util/container_heap.c2
-rw-r--r--src/util/container_meta_data.c9
-rw-r--r--src/util/container_multihashmap.c2
-rw-r--r--src/util/container_multihashmap32.c2
-rw-r--r--src/util/crypto_crc.c2
-rw-r--r--src/util/crypto_ecc.c3
-rw-r--r--src/util/crypto_hash.c3
-rw-r--r--src/util/crypto_mpi.c2
-rw-r--r--src/util/crypto_random.c2
-rw-r--r--src/util/crypto_rsa.c8
-rw-r--r--src/util/crypto_symmetric.c2
-rw-r--r--src/util/disk.c3
-rw-r--r--src/util/disk.h3
-rw-r--r--src/util/strings.c3
-rw-r--r--src/util/test_container_meta_data.c14
-rw-r--r--src/util/time.c3
21 files changed, 52 insertions, 33 deletions
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index a2482fc87..916a588fa 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -128,7 +128,6 @@ libgnunetutil_taler_wallet_la_SOURCES = \
128 common_allocation.c \ 128 common_allocation.c \
129 common_endian.c \ 129 common_endian.c \
130 common_logging.c \ 130 common_logging.c \
131 configuration.c \
132 container_heap.c \ 131 container_heap.c \
133 container_multihashmap.c \ 132 container_multihashmap.c \
134 container_multihashmap32.c \ 133 container_multihashmap32.c \
@@ -141,8 +140,6 @@ libgnunetutil_taler_wallet_la_SOURCES = \
141 crypto_mpi.c \ 140 crypto_mpi.c \
142 crypto_random.c \ 141 crypto_random.c \
143 crypto_rsa.c \ 142 crypto_rsa.c \
144 disk.c \
145 disk.h \
146 strings.c \ 143 strings.c \
147 time.c 144 time.c
148 145
diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c
index 5280d73b2..4fdc05f10 100644
--- a/src/util/common_allocation.c
+++ b/src/util/common_allocation.c
@@ -24,7 +24,7 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_util_lib.h" 27#include "gnunet_crypto_lib.h"
28#if HAVE_MALLOC_H 28#if HAVE_MALLOC_H
29#include <malloc.h> 29#include <malloc.h>
30#endif 30#endif
diff --git a/src/util/common_endian.c b/src/util/common_endian.c
index 4a8a01664..e6c34250a 100644
--- a/src/util/common_endian.c
+++ b/src/util/common_endian.c
@@ -26,7 +26,7 @@
26 */ 26 */
27 27
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_util_lib.h" 29#include "gnunet_crypto_lib.h"
30 30
31#define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__) 31#define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__)
32 32
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index 695b49913..492d00dc6 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -24,7 +24,8 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_util_lib.h" 27#include "gnunet_crypto_lib.h"
28#include "gnunet_strings_lib.h"
28#include <regex.h> 29#include <regex.h>
29 30
30 31
@@ -328,7 +329,6 @@ setup_log_file (const struct tm *tm)
328{ 329{
329 static char last_fn[PATH_MAX + 1]; 330 static char last_fn[PATH_MAX + 1];
330 char fn[PATH_MAX + 1]; 331 char fn[PATH_MAX + 1];
331 int dirwarn;
332 int altlog_fd; 332 int altlog_fd;
333 int dup_return; 333 int dup_return;
334 FILE *altlog; 334 FILE *altlog;
@@ -352,7 +352,6 @@ setup_log_file (const struct tm *tm)
352 return GNUNET_OK; /* no change */ 352 return GNUNET_OK; /* no change */
353 log_rotate (last_fn); 353 log_rotate (last_fn);
354 strcpy (last_fn, fn); 354 strcpy (last_fn, fn);
355 dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn));
356#if WINDOWS 355#if WINDOWS
357 altlog_fd = OPEN (fn, O_APPEND | 356 altlog_fd = OPEN (fn, O_APPEND |
358 O_BINARY | 357 O_BINARY |
@@ -386,16 +385,13 @@ setup_log_file (const struct tm *tm)
386 if (-1 == altlog_fd) 385 if (-1 == altlog_fd)
387 { 386 {
388 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "open", fn); 387 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "open", fn);
389 if (dirwarn)
390 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
391 _("Failed to create or access directory for log file `%s'\n"),
392 fn);
393 return GNUNET_SYSERR; 388 return GNUNET_SYSERR;
394 } 389 }
395 GNUNET_stderr = altlog; 390 GNUNET_stderr = altlog;
396 return GNUNET_OK; 391 return GNUNET_OK;
397} 392}
398 393
394
399/** 395/**
400 * Utility function - adds a parsed definition to logdefs array. 396 * Utility function - adds a parsed definition to logdefs array.
401 * 397 *
diff --git a/src/util/configuration.c b/src/util/configuration.c
index f61b43d57..3c7570981 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -25,7 +25,10 @@
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_util_lib.h" 28#include "gnunet_crypto_lib.h"
29#include "gnunet_strings_lib.h"
30#include "gnunet_configuration_lib.h"
31#include "gnunet_disk_lib.h"
29 32
30#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 33#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
31 34
diff --git a/src/util/container_heap.c b/src/util/container_heap.c
index 8c3de6c26..ad96af01d 100644
--- a/src/util/container_heap.c
+++ b/src/util/container_heap.c
@@ -26,7 +26,7 @@
26 */ 26 */
27 27
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_util_lib.h" 29#include "gnunet_container_lib.h"
30 30
31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
32 32
diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c
index 622b45334..5cef31f37 100644
--- a/src/util/container_meta_data.c
+++ b/src/util/container_meta_data.c
@@ -26,7 +26,9 @@
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
29#if HAVE_EXTRACTOR_H
29#include <extractor.h> 30#include <extractor.h>
31#endif
30#include <zlib.h> 32#include <zlib.h>
31 33
32#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 34#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
@@ -432,7 +434,8 @@ GNUNET_CONTAINER_meta_data_add_publication_date (struct
432 struct GNUNET_TIME_Absolute t; 434 struct GNUNET_TIME_Absolute t;
433 435
434 t = GNUNET_TIME_absolute_get (); 436 t = GNUNET_TIME_absolute_get ();
435 GNUNET_CONTAINER_meta_data_delete (md, EXTRACTOR_METATYPE_PUBLICATION_DATE, 437 GNUNET_CONTAINER_meta_data_delete (md,
438 EXTRACTOR_METATYPE_PUBLICATION_DATE,
436 NULL, 0); 439 NULL, 0);
437 dat = GNUNET_STRINGS_absolute_time_to_string (t); 440 dat = GNUNET_STRINGS_absolute_time_to_string (t);
438 GNUNET_CONTAINER_meta_data_insert (md, "<gnunet>", 441 GNUNET_CONTAINER_meta_data_insert (md, "<gnunet>",
@@ -481,8 +484,8 @@ GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData *md,
481 * @return NULL if no entry was found 484 * @return NULL if no entry was found
482 */ 485 */
483char * 486char *
484GNUNET_CONTAINER_meta_data_get_by_type (const struct GNUNET_CONTAINER_MetaData 487GNUNET_CONTAINER_meta_data_get_by_type (const struct GNUNET_CONTAINER_MetaData *md,
485 *md, enum EXTRACTOR_MetaType type) 488 enum EXTRACTOR_MetaType type)
486{ 489{
487 struct MetaItem *pos; 490 struct MetaItem *pos;
488 491
diff --git a/src/util/container_multihashmap.c b/src/util/container_multihashmap.c
index df6dd5704..46379b34e 100644
--- a/src/util/container_multihashmap.c
+++ b/src/util/container_multihashmap.c
@@ -24,7 +24,7 @@
24 */ 24 */
25 25
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_util_lib.h" 27#include "gnunet_container_lib.h"
28 28
29#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 29#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
30 30
diff --git a/src/util/container_multihashmap32.c b/src/util/container_multihashmap32.c
index 00dee18cd..d7b8413c4 100644
--- a/src/util/container_multihashmap32.c
+++ b/src/util/container_multihashmap32.c
@@ -26,7 +26,7 @@
26 */ 26 */
27 27
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_util_lib.h" 29#include "gnunet_container_lib.h"
30 30
31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
32 32
diff --git a/src/util/crypto_crc.c b/src/util/crypto_crc.c
index 252cdad05..5a8357478 100644
--- a/src/util/crypto_crc.c
+++ b/src/util/crypto_crc.c
@@ -28,7 +28,7 @@
28 * @author Christian Grothoff 28 * @author Christian Grothoff
29 */ 29 */
30#include "platform.h" 30#include "platform.h"
31#include "gnunet_util_lib.h" 31#include "gnunet_crypto_lib.h"
32 32
33#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 33#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
34 34
diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c
index 87c787185..adeaf77c8 100644
--- a/src/util/crypto_ecc.c
+++ b/src/util/crypto_ecc.c
@@ -25,7 +25,8 @@
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include <gcrypt.h> 27#include <gcrypt.h>
28#include "gnunet_util_lib.h" 28#include "gnunet_crypto_lib.h"
29#include "gnunet_strings_lib.h"
29 30
30#define EXTRA_CHECKS 0 31#define EXTRA_CHECKS 0
31 32
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c
index e9f25bf84..8e5730ffd 100644
--- a/src/util/crypto_hash.c
+++ b/src/util/crypto_hash.c
@@ -24,7 +24,8 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_util_lib.h" 27#include "gnunet_crypto_lib.h"
28#include "gnunet_strings_lib.h"
28#include <gcrypt.h> 29#include <gcrypt.h>
29 30
30#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 31#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 806a35da8..ad64778fd 100644
--- a/src/util/crypto_mpi.c
+++ b/src/util/crypto_mpi.c
@@ -26,7 +26,7 @@
26 */ 26 */
27#include "platform.h" 27#include "platform.h"
28#include <gcrypt.h> 28#include <gcrypt.h>
29#include "gnunet_util_lib.h" 29#include "gnunet_crypto_lib.h"
30 30
31 31
32#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 32#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 2960af17e..f9a0664e2 100644
--- a/src/util/crypto_random.c
+++ b/src/util/crypto_random.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_util_lib.h" 28#include "gnunet_crypto_lib.h"
29#include <gcrypt.h> 29#include <gcrypt.h>
30 30
31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 31#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 0b21b40b4..b8e29146f 100644
--- a/src/util/crypto_rsa.c
+++ b/src/util/crypto_rsa.c
@@ -22,7 +22,7 @@
22 */ 22 */
23#include "platform.h" 23#include "platform.h"
24#include <gcrypt.h> 24#include <gcrypt.h>
25#include "gnunet_util_lib.h" 25#include "gnunet_crypto_lib.h"
26 26
27#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 27#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
28 28
@@ -413,7 +413,7 @@ GNUNET_CRYPTO_rsa_blinding_key_create (unsigned int len)
413 413
414/** 414/**
415 * Compare the values of two blinding keys. 415 * Compare the values of two blinding keys.
416 * 416 *
417 * @param b1 one key 417 * @param b1 one key
418 * @param b2 the other key 418 * @param b2 the other key
419 * @return 0 if the two are equal 419 * @return 0 if the two are equal
@@ -443,7 +443,7 @@ GNUNET_CRYPTO_rsa_signature_cmp (struct GNUNET_CRYPTO_rsa_Signature *s1,
443 size_t z1; 443 size_t z1;
444 size_t z2; 444 size_t z2;
445 int ret; 445 int ret;
446 446
447 z1 = GNUNET_CRYPTO_rsa_signature_encode (s1, 447 z1 = GNUNET_CRYPTO_rsa_signature_encode (s1,
448 &b1); 448 &b1);
449 z2 = GNUNET_CRYPTO_rsa_signature_encode (s2, 449 z2 = GNUNET_CRYPTO_rsa_signature_encode (s2,
@@ -476,7 +476,7 @@ GNUNET_CRYPTO_rsa_public_key_cmp (struct GNUNET_CRYPTO_rsa_PublicKey *p1,
476 size_t z1; 476 size_t z1;
477 size_t z2; 477 size_t z2;
478 int ret; 478 int ret;
479 479
480 z1 = GNUNET_CRYPTO_rsa_public_key_encode (p1, 480 z1 = GNUNET_CRYPTO_rsa_public_key_encode (p1,
481 &b1); 481 &b1);
482 z2 = GNUNET_CRYPTO_rsa_public_key_encode (p2, 482 z2 = GNUNET_CRYPTO_rsa_public_key_encode (p2,
diff --git a/src/util/crypto_symmetric.c b/src/util/crypto_symmetric.c
index 455166546..6465d5eb6 100644
--- a/src/util/crypto_symmetric.c
+++ b/src/util/crypto_symmetric.c
@@ -26,7 +26,7 @@
26 */ 26 */
27 27
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_util_lib.h" 29#include "gnunet_crypto_lib.h"
30#include <gcrypt.h> 30#include <gcrypt.h>
31 31
32#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 32#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
diff --git a/src/util/disk.c b/src/util/disk.c
index a56966d04..c9f6408e8 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -24,8 +24,9 @@
24 * @author Nils Durner 24 * @author Nils Durner
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_util_lib.h"
28#include "disk.h" 27#include "disk.h"
28#include "gnunet_strings_lib.h"
29#include "gnunet_disk_lib.h"
29 30
30#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
31 32
diff --git a/src/util/disk.h b/src/util/disk.h
index 1dfec216f..2592bd8c0 100644
--- a/src/util/disk.h
+++ b/src/util/disk.h
@@ -26,7 +26,8 @@
26#ifndef GNUNET_DISK_H_ 26#ifndef GNUNET_DISK_H_
27#define GNUNET_DISK_H_ 27#define GNUNET_DISK_H_
28 28
29#include "gnunet_util_lib.h" 29#include "gnunet_crypto_lib.h"
30#include "gnunet_disk_lib.h"
30 31
31/** 32/**
32 * Retrieve OS file handle 33 * Retrieve OS file handle
diff --git a/src/util/strings.c b/src/util/strings.c
index 379f3f5a3..407a135d1 100644
--- a/src/util/strings.c
+++ b/src/util/strings.c
@@ -29,7 +29,8 @@
29#if HAVE_ICONV 29#if HAVE_ICONV
30#include <iconv.h> 30#include <iconv.h>
31#endif 31#endif
32#include "gnunet_util_lib.h" 32#include "gnunet_crypto_lib.h"
33#include "gnunet_strings_lib.h"
33#include <unicase.h> 34#include <unicase.h>
34#include <unistr.h> 35#include <unistr.h>
35#include <uniconv.h> 36#include <uniconv.h>
diff --git a/src/util/test_container_meta_data.c b/src/util/test_container_meta_data.c
index a3729fc9f..df6587efd 100644
--- a/src/util/test_container_meta_data.c
+++ b/src/util/test_container_meta_data.c
@@ -27,6 +27,8 @@
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
29 29
30#if HAVE_EXTRACTOR_H
31
30#define ABORT(m) { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (m != NULL) GNUNET_CONTAINER_meta_data_destroy(m); return 1; } 32#define ABORT(m) { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (m != NULL) GNUNET_CONTAINER_meta_data_destroy(m); return 1; }
31 33
32static int 34static int
@@ -343,4 +345,16 @@ main (int argc, char *argv[])
343 return 0; 345 return 0;
344} 346}
345 347
348#else
349
350int
351main (int argc, char *argv[])
352{
353 fprintf (stderr,
354 "GNU libextractor not found, skipping test.\n");
355 return 0;
356}
357
358#endif
359
346/* end of test_container_meta_data.c */ 360/* end of test_container_meta_data.c */
diff --git a/src/util/time.c b/src/util/time.c
index 01a3cddd5..78dd4c6d2 100644
--- a/src/util/time.c
+++ b/src/util/time.c
@@ -24,7 +24,8 @@
24 * @brief functions for handling time and time arithmetic 24 * @brief functions for handling time and time arithmetic
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_util_lib.h" 27#include "gnunet_crypto_lib.h"
28#include "gnunet_time_lib.h"
28 29
29#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 30#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
30 31