diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-09-02 18:25:50 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-09-02 18:25:50 +0000 |
commit | f311206d1db3bb88f686cfb52a4c503e97cbe249 (patch) | |
tree | 365adfb183859ff5a52cd2f8d5f017efaa226db7 /src/common/util.h | |
parent | 3590eb535a539911cf899511f6f3f21c745c65b8 (diff) | |
download | tor-f311206d1db3bb88f686cfb52a4c503e97cbe249.tar.gz tor-f311206d1db3bb88f686cfb52a4c503e97cbe249.zip |
Make split function smarter; add a strcmpstart function so we can stop bungling strcmp(x, y, strlen(y));
svn:r2325
Diffstat (limited to 'src/common/util.h')
-rw-r--r-- | src/common/util.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common/util.h b/src/common/util.h index 184a78b66e..e96b16129d 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -86,6 +86,7 @@ char *tor_strdup(const char *s); char *tor_strndup(const char *s, size_t n); #define tor_free(p) do {if(p) {free(p); (p)=NULL;}} while(0) void tor_strlower(char *s); +int strcmpstart(const char *s1, const char *s2); /* Some platforms segfault when you try to access a multi-byte type * that isn't aligned to a word boundary. The macros and/or functions @@ -153,8 +154,10 @@ void *smartlist_del(smartlist_t *sl, int idx); void *smartlist_del_keeporder(smartlist_t *sl, int idx); void smartlist_insert(smartlist_t *sl, int idx, void *val); int smartlist_len(const smartlist_t *sl); +#define SPLIT_SKIP_SPACE 0x01 +#define SPLIT_IGNORE_BLANK 0x02 int smartlist_split_string(smartlist_t *sl, const char *str, const char *sep, - int skipSpace); + int flags, int max); #define SMARTLIST_FOREACH(sl, type, var, cmd) \ do { \ |