1
0
mirror of https://gitea.tendokyu.moe/Hay1tsme/segatools.git synced 2024-11-25 01:40:11 +01:00
segatools-hay1tsme/util/str.h

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;
}