aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-09-23 20:48:08 +0200
committerMax Kellermann <max@duempel.org>2008-09-23 20:48:08 +0200
commitf5df13f853cf4c0e529244dd40ab57c78a7d1bc6 (patch)
treed721db1541d6c900067c8774abad437fe5ef9685 /src/utils.h
parent15b25ad17417141bd913b734f2148e2fb2e9e828 (diff)
downloadmpd-f5df13f853cf4c0e529244dd40ab57c78a7d1bc6.tar.gz
mpd-f5df13f853cf4c0e529244dd40ab57c78a7d1bc6.tar.xz
mpd-f5df13f853cf4c0e529244dd40ab57c78a7d1bc6.zip
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...
Diffstat (limited to '')
-rw-r--r--src/utils.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h
index 77e143702..a6e26d191 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -103,4 +103,6 @@ void xpthread_mutex_destroy(pthread_mutex_t *mutex);
void xpthread_cond_destroy(pthread_cond_t *cond);
+int prefixcmp(const char *str, const char *prefix);
+
#endif