aboutsummaryrefslogtreecommitdiff
path: root/src/lib/string/util_string.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-27 15:36:42 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-27 16:18:42 -0400
commite165c9c304800718daa589469349282110e00909 (patch)
treee76462a054c9a1f465b1e38f192dce45a4b33e9c /src/lib/string/util_string.h
parent9e592d1decf1b16128a716220de68322b51d6315 (diff)
downloadtor-e165c9c304800718daa589469349282110e00909.tar.gz
tor-e165c9c304800718daa589469349282110e00909.zip
Move various mem* functions to lib/string
Diffstat (limited to 'src/lib/string/util_string.h')
-rw-r--r--src/lib/string/util_string.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/string/util_string.h b/src/lib/string/util_string.h
index f194c36373..bdc2e77cea 100644
--- a/src/lib/string/util_string.h
+++ b/src/lib/string/util_string.h
@@ -11,6 +11,14 @@
#include <stddef.h>
+const void *tor_memmem(const void *haystack, size_t hlen, const void *needle,
+ size_t nlen) ATTR_NONNULL((1,3));
+const void *tor_memstr(const void *haystack, size_t hlen,
+ const char *needle) ATTR_NONNULL((1,3));
+int tor_mem_is_zero(const char *mem, size_t len);
+int tor_digest_is_zero(const char *digest);
+int tor_digest256_is_zero(const char *digest);
+
/** Allowable characters in a hexadecimal string. */
#define HEX_CHARACTERS "0123456789ABCDEFabcdef"
void tor_strlower(char *s) ATTR_NONNULL((1));