From 7c04542e09f34d3c0b1240d47bb518e26d5aaf07 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 29 Sep 2012 18:08:47 +0200 Subject: bstr: add bstr_equals/bstr_equals0 utility function --- bstr.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bstr.h b/bstr.h index 5f04a75db8..fab9be5814 100644 --- a/bstr.h +++ b/bstr.h @@ -142,6 +142,16 @@ static inline int bstrcmp0(struct bstr str1, const char *str2) return bstrcmp(str1, bstr0(str2)); } +static inline bool bstr_equals(struct bstr str1, struct bstr str2) +{ + return bstrcmp(str1, str2) == 0; +} + +static inline bool bstr_equals0(struct bstr str1, const char *str2) +{ + return bstrcmp(str1, bstr0(str2)) == 0; +} + static inline int bstrcasecmp0(struct bstr str1, const char *str2) { return bstrcasecmp(str1, bstr0(str2)); -- cgit v1.2.3