From 6c970aec946942d10996cda55798859dbc90f105 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 7 Oct 2004 21:37:06 +0000 Subject: Turn tor_strpartion into a swiss-army-knife function, so it can terminate or not-terminate appropriately. svn:r2429 --- src/common/util.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/common/util.h') diff --git a/src/common/util.h b/src/common/util.h index c579c92a9..2b13f92b4 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -88,8 +88,12 @@ char *tor_strndup(const char *s, size_t n); void tor_strlower(char *s); int strcmpstart(const char *s1, const char *s2); int tor_strstrip(char *s, const char *strip); +typedef enum { + ALWAYS_TERMINATE, NEVER_TERMINATE, TERMINATE_IF_EVEN +} part_finish_rule_t; int tor_strpartition(char *dest, size_t dest_len, - const char *s, const char *insert, size_t n); + const char *s, const char *insert, size_t n, + part_finish_rule_t rule); /* Some platforms segfault when you try to access a multi-byte type -- cgit v1.2.3