aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/utils/utils.h
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2013-08-06 17:27:15 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2013-08-24 16:22:51 +0200
commit32a145fdbd657eb886bee15ccd7fbef7bbea7801 (patch)
tree8c4a2998332c02851098d4a3434c04e3b478939c /src/libstrongswan/utils/utils.h
parent49032d15be34cdb0ba9f233e837e3949ee14067c (diff)
downloadstrongswan-32a145fdbd657eb886bee15ccd7fbef7bbea7801.tar.bz2
strongswan-32a145fdbd657eb886bee15ccd7fbef7bbea7801.tar.xz
utils: Add case-insensitive version of strpfx()
Diffstat (limited to 'src/libstrongswan/utils/utils.h')
-rw-r--r--src/libstrongswan/utils/utils.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstrongswan/utils/utils.h b/src/libstrongswan/utils/utils.h
index d055f712d..8fe741211 100644
--- a/src/libstrongswan/utils/utils.h
+++ b/src/libstrongswan/utils/utils.h
@@ -113,6 +113,14 @@ static inline bool strncaseeq(const char *x, const char *y, size_t len)
}
/**
+ * Helper function that checks if a string starts with a given prefix
+ */
+static inline bool strcasepfx(const char *x, const char *prefix)
+{
+ return strncaseeq(x, prefix, strlen(prefix));
+}
+
+/**
* NULL-safe strdup variant
*/
static inline char *strdupnull(const char *s)