diff options
author | Willow Liquorice <willow@howhill.com> | 2022-08-26 20:53:33 +0100 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-08-30 09:42:00 +0200 |
commit | 3f99b8b78db4808c903ee093da8b48ff0ed1b934 (patch) | |
tree | 946db496100b60e151c40a550fe07df608338552 /src/util | |
parent | 9f2566910ef020cee7a031605137775b3cb3f32b (diff) | |
download | gnunet-3f99b8b78db4808c903ee093da8b48ff0ed1b934.tar.gz gnunet-3f99b8b78db4808c903ee093da8b48ff0ed1b934.zip |
-First pass through GNUnet common library
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/common_allocation.c | 17 | ||||
-rw-r--r-- | src/util/common_endian.c | 10 | ||||
-rw-r--r-- | src/util/common_logging.c | 42 |
3 files changed, 0 insertions, 69 deletions
diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c index f48f87167..a43ac3865 100644 --- a/src/util/common_allocation.c +++ b/src/util/common_allocation.c | |||
@@ -155,17 +155,6 @@ GNUNET_xnew_array_3d_ (size_t n, | |||
155 | } | 155 | } |
156 | 156 | ||
157 | 157 | ||
158 | /** | ||
159 | * Allocate and initialize memory. Checks the return value, aborts if no more | ||
160 | * memory is available. Don't use #GNUNET_xmemdup_() directly. Use the | ||
161 | * GNUNET_memdup() macro. | ||
162 | * | ||
163 | * @param buf buffer to initialize from (must contain size bytes) | ||
164 | * @param size number of bytes to allocate | ||
165 | * @param filename where is this call being made (for debugging) | ||
166 | * @param linenumber line where this call is being made (for debugging) | ||
167 | * @return allocated memory, never NULL | ||
168 | */ | ||
169 | void * | 158 | void * |
170 | GNUNET_xmemdup_ (const void *buf, | 159 | GNUNET_xmemdup_ (const void *buf, |
171 | size_t size, | 160 | size_t size, |
@@ -476,12 +465,6 @@ GNUNET_snprintf (char *buf, size_t size, const char *format, ...) | |||
476 | } | 465 | } |
477 | 466 | ||
478 | 467 | ||
479 | /** | ||
480 | * Create a copy of the given message. | ||
481 | * | ||
482 | * @param msg message to copy | ||
483 | * @return duplicate of the message | ||
484 | */ | ||
485 | struct GNUNET_MessageHeader * | 468 | struct GNUNET_MessageHeader * |
486 | GNUNET_copy_message (const struct GNUNET_MessageHeader *msg) | 469 | GNUNET_copy_message (const struct GNUNET_MessageHeader *msg) |
487 | { | 470 | { |
diff --git a/src/util/common_endian.c b/src/util/common_endian.c index d69cc1da5..ce70f91da 100644 --- a/src/util/common_endian.c +++ b/src/util/common_endian.c | |||
@@ -65,11 +65,6 @@ GNUNET_ntohll (uint64_t n) | |||
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | 67 | ||
68 | /** | ||
69 | * Convert double to network-byte-order. | ||
70 | * @param d the value in network byte order | ||
71 | * @return the same value in host byte order | ||
72 | */ | ||
73 | double | 68 | double |
74 | GNUNET_hton_double (double d) | 69 | GNUNET_hton_double (double d) |
75 | { | 70 | { |
@@ -83,11 +78,6 @@ GNUNET_hton_double (double d) | |||
83 | } | 78 | } |
84 | 79 | ||
85 | 80 | ||
86 | /** | ||
87 | * Convert double to host-byte-order | ||
88 | * @param d the value in network byte order | ||
89 | * @return the same value in host byte order | ||
90 | */ | ||
91 | double | 81 | double |
92 | GNUNET_ntoh_double (double d) | 82 | GNUNET_ntoh_double (double d) |
93 | { | 83 | { |
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index b07f3fc0b..27d9ca3ce 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -768,15 +768,6 @@ GNUNET_log_setup (const char *comp, | |||
768 | } | 768 | } |
769 | 769 | ||
770 | 770 | ||
771 | /** | ||
772 | * Add a custom logger. Note that installing any custom logger | ||
773 | * will disable the standard logger. When multiple custom loggers | ||
774 | * are installed, all will be called. The standard logger will | ||
775 | * only be used if no custom loggers are present. | ||
776 | * | ||
777 | * @param logger log function | ||
778 | * @param logger_cls closure for @a logger | ||
779 | */ | ||
780 | void | 771 | void |
781 | GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls) | 772 | GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls) |
782 | { | 773 | { |
@@ -790,12 +781,6 @@ GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls) | |||
790 | } | 781 | } |
791 | 782 | ||
792 | 783 | ||
793 | /** | ||
794 | * Remove a custom logger. | ||
795 | * | ||
796 | * @param logger log function | ||
797 | * @param logger_cls closure for @a logger | ||
798 | */ | ||
799 | void | 784 | void |
800 | GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls) | 785 | GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls) |
801 | { | 786 | { |
@@ -936,12 +921,6 @@ flush_bulk (const char *datestr) | |||
936 | } | 921 | } |
937 | 922 | ||
938 | 923 | ||
939 | /** | ||
940 | * Ignore the next n calls to the log function. | ||
941 | * | ||
942 | * @param n number of log calls to ignore (could be negative) | ||
943 | * @param check_reset #GNUNET_YES to assert that the log skip counter is currently zero | ||
944 | */ | ||
945 | void | 924 | void |
946 | GNUNET_log_skip (int n, int check_reset) | 925 | GNUNET_log_skip (int n, int check_reset) |
947 | { | 926 | { |
@@ -1118,12 +1097,6 @@ GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind, | |||
1118 | } | 1097 | } |
1119 | 1098 | ||
1120 | 1099 | ||
1121 | /** | ||
1122 | * Convert error type to string. | ||
1123 | * | ||
1124 | * @param kind type to convert | ||
1125 | * @return string corresponding to the type | ||
1126 | */ | ||
1127 | const char * | 1100 | const char * |
1128 | GNUNET_error_type_to_string (enum GNUNET_ErrorType kind) | 1101 | GNUNET_error_type_to_string (enum GNUNET_ErrorType kind) |
1129 | { | 1102 | { |
@@ -1470,13 +1443,6 @@ GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen) | |||
1470 | } | 1443 | } |
1471 | 1444 | ||
1472 | 1445 | ||
1473 | /** | ||
1474 | * Log error message about missing configuration option. | ||
1475 | * | ||
1476 | * @param kind log level | ||
1477 | * @param section section with missing option | ||
1478 | * @param option name of missing option | ||
1479 | */ | ||
1480 | void | 1446 | void |
1481 | GNUNET_log_config_missing (enum GNUNET_ErrorType kind, | 1447 | GNUNET_log_config_missing (enum GNUNET_ErrorType kind, |
1482 | const char *section, | 1448 | const char *section, |
@@ -1490,14 +1456,6 @@ GNUNET_log_config_missing (enum GNUNET_ErrorType kind, | |||
1490 | } | 1456 | } |
1491 | 1457 | ||
1492 | 1458 | ||
1493 | /** | ||
1494 | * Log error message about invalid configuration option value. | ||
1495 | * | ||
1496 | * @param kind log level | ||
1497 | * @param section section with invalid option | ||
1498 | * @param option name of invalid option | ||
1499 | * @param required what is required that is invalid about the option | ||
1500 | */ | ||
1501 | void | 1459 | void |
1502 | GNUNET_log_config_invalid (enum GNUNET_ErrorType kind, | 1460 | GNUNET_log_config_invalid (enum GNUNET_ErrorType kind, |
1503 | const char *section, | 1461 | const char *section, |