summaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-12-17 18:29:37 -0500
committerNick Mathewson <nickm@torproject.org>2009-12-17 18:29:37 -0500
commit235f1e1a967cb070c7246617461f58f0413394b3 (patch)
tree63c260d4d5c4a6f54fa620836ed291a94f6d332e /src/common/util.h
parent498c293afe3570210e964456e6cf5a8f315dbfc6 (diff)
downloadtor-235f1e1a967cb070c7246617461f58f0413394b3.tar.gz
tor-235f1e1a967cb070c7246617461f58f0413394b3.zip
Refactor out the 'find string at start of any line' logic.
We do this in too many places throughout the code; it's time to start clamping down. Also, refactor Karsten's patch to use strchr-then-strndup, rather than malloc-then-strlcpy-then-strchr-then-clear.
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h
index 17cbb4a44f..b55bb91c51 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -195,6 +195,8 @@ const char *eat_whitespace_no_nl(const char *s) ATTR_PURE;
const char *eat_whitespace_eos_no_nl(const char *s, const char *eos) ATTR_PURE;
const char *find_whitespace(const char *s) ATTR_PURE;
const char *find_whitespace_eos(const char *s, const char *eos) ATTR_PURE;
+const char *find_str_at_start_of_line(const char *haystack, const char *needle)
+ ATTR_PURE;
int tor_mem_is_zero(const char *mem, size_t len) ATTR_PURE;
int tor_digest_is_zero(const char *digest) ATTR_PURE;
int tor_digest256_is_zero(const char *digest) ATTR_PURE;