From 5a42e7362b3745fb59f0aa49bab624f7fba83eff Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 20 Sep 2008 15:43:35 -0700 Subject: Add prefixcmp() (stol^H^H^H^Hborrowed from git) This allows us to avoid the nasty repetition in strncmp(foo, bar, strlen(foo)). We'll miss out on the compiler optimizing strlen() into sizeof() - 1 for string literals for this; but we don't use this it for performance-critical functions anyways... --- src/utils.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/utils.h') diff --git a/src/utils.h b/src/utils.h index 0001ba3c8..3958ac9a0 100644 --- a/src/utils.h +++ b/src/utils.h @@ -90,6 +90,8 @@ void xpthread_mutex_destroy(pthread_mutex_t *mutex); void xpthread_cond_destroy(pthread_cond_t *cond); +int prefixcmp(const char *str, const char *prefix); + /* * Work-arounds for braindead APIs that require non-const pointers: * ao_play(), free(), vorbis_comment_add_tag(), iconv() -- cgit v1.2.3