mirror of https://github.com/mpv-player/mpv
bstr: add bstr_equals/bstr_equals0 utility function
This commit is contained in:
parent
d079395c5d
commit
7c04542e09
10
bstr.h
10
bstr.h
|
@ -142,6 +142,16 @@ static inline int bstrcmp0(struct bstr str1, const char *str2)
|
||||||
return bstrcmp(str1, bstr0(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)
|
static inline int bstrcasecmp0(struct bstr str1, const char *str2)
|
||||||
{
|
{
|
||||||
return bstrcasecmp(str1, bstr0(str2));
|
return bstrcasecmp(str1, bstr0(str2));
|
||||||
|
|
Loading…
Reference in New Issue