1
0
mirror of synced 2024-11-24 05:50:12 +01:00
bananatools/util/str.h
2023-01-02 23:39:03 -05:00

42 lines
750 B
C

#pragma once
#include <stdbool.h>
#include <string.h>
#include <wchar.h>
inline bool str_eq(const char *lhs, const char *rhs)
{
if (lhs == NULL || rhs == NULL) {
return lhs == rhs;
}
return strcmp(lhs, rhs) == 0;
}
inline bool str_ieq(const char *lhs, const char *rhs)
{
if (lhs == NULL || rhs == NULL) {
return lhs == rhs;
}
return _stricmp(lhs, rhs) == 0;
}
inline bool wstr_eq(const wchar_t *lhs, const wchar_t *rhs)
{
if (lhs == NULL || rhs == NULL) {
return lhs == rhs;
}
return wcscmp(lhs, rhs) == 0;
}
inline bool wstr_ieq(const wchar_t *lhs, const wchar_t *rhs)
{
if (lhs == NULL || rhs == NULL) {
return lhs == rhs;
}
return _wcsicmp(lhs, rhs) == 0;
}