aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-10-07 21:37:06 +0000
committerNick Mathewson <nickm@torproject.org>2004-10-07 21:37:06 +0000
commit6c970aec946942d10996cda55798859dbc90f105 (patch)
tree90681cc5e09b7454250d5c79bb336bebc89c9563 /src/common/util.h
parentc7e8c2098abd93bf24439f869016c385067e5e5b (diff)
downloadtor-6c970aec946942d10996cda55798859dbc90f105.tar
tor-6c970aec946942d10996cda55798859dbc90f105.tar.gz
Turn tor_strpartion into a swiss-army-knife function, so it can terminate or not-terminate appropriately.
svn:r2429
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h6
1 files changed, 5 insertions, 1 deletions
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