mirror of
https://gitea.tendokyu.moe/Dniel97/segatools.git
synced 2024-12-18 14:55:51 +01:00
42 lines
750 B
C
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;
|
||
|
}
|