From ae48dc3b3caeef7eaa4a079b11cdda988d9c1f0d Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sun, 21 Jun 2020 00:06:29 +0200 Subject: Add streq and strcaseeq and use them throughout --- utils.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'utils.h') diff --git a/utils.h b/utils.h index f87159e..a38602c 100644 --- a/utils.h +++ b/utils.h @@ -2,6 +2,7 @@ #define fooutilshfoo #include +#include #include #include #include @@ -91,6 +92,16 @@ static inline bool empty_str(const char *str) return false; } +static inline bool streq(const char *a, const char *b) +{ + return strcmp(a, b) == 0; +} + +static inline bool strcaseeq(const char *a, const char *b) +{ + return strcasecmp(a, b) == 0; +} + #if __BYTE_ORDER == __LITTLE_ENDIAN #define chtobe32(x) __bswap_constant_32(x) #else -- cgit v1.2.3