0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00

libobs: Add wstrstri function

Performs a case-insensitive search for a wide-character string within
another wide-character string.
This commit is contained in:
jp9000 2015-01-02 21:07:20 -08:00
parent 9a91bbc16c
commit a87fe6d783
2 changed files with 18 additions and 0 deletions

View File

@ -179,6 +179,23 @@ char *astrstri(const char *str, const char *find)
return NULL;
}
wchar_t *wstrstri(const wchar_t *str, const wchar_t *find)
{
size_t len;
if (!str || !find)
return NULL;
len = wcslen(find);
do {
if (wstrcmpi_n(str, find, len) == 0)
return (wchar_t*)str;
} while (*str++);
return NULL;
}
char *strdepad(char *str)
{
char *temp;

View File

@ -47,6 +47,7 @@ EXPORT int astrcmpi_n(const char *str1, const char *str2, size_t n);
EXPORT int wstrcmpi_n(const wchar_t *str1, const wchar_t *str2, size_t n);
EXPORT char *astrstri(const char *str, const char *find);
EXPORT wchar_t *wstrstri(const wchar_t *str, const wchar_t *find);
EXPORT char *strdepad(char *str);
EXPORT wchar_t *wcsdepad(wchar_t *str);