diff options
author | Tobias Brunner <tobias@strongswan.org> | 2013-08-06 17:27:15 +0200 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2013-08-24 16:22:51 +0200 |
commit | 32a145fdbd657eb886bee15ccd7fbef7bbea7801 (patch) | |
tree | 8c4a2998332c02851098d4a3434c04e3b478939c /src/libstrongswan/utils/utils.h | |
parent | 49032d15be34cdb0ba9f233e837e3949ee14067c (diff) | |
download | strongswan-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.h | 8 |
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) |