Commit 4b6d5fd5 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

msvcrt: Implemented wcstok_s.

parent 5437c72f
......@@ -1653,7 +1653,7 @@
@ cdecl wcsstr(wstr wstr) msvcrt.wcsstr
@ cdecl wcstod(wstr ptr) msvcrt.wcstod
@ cdecl wcstok(wstr wstr) msvcrt.wcstok
@ stub wcstok_s
@ cdecl wcstok_s(ptr wstr ptr) msvcrt.wcstok_s
@ cdecl wcstol(wstr ptr long) msvcrt.wcstol
@ cdecl wcstombs(ptr ptr long) msvcrt.wcstombs
@ cdecl wcstombs_s(ptr ptr long wstr long) msvcrt.wcstombs_s
......
......@@ -1507,7 +1507,7 @@
@ cdecl wcsstr(wstr wstr) msvcrt.wcsstr
@ cdecl wcstod(wstr ptr) msvcrt.wcstod
@ cdecl wcstok(wstr wstr) msvcrt.wcstok
@ stub wcstok_s
@ cdecl wcstok_s(ptr wstr ptr) msvcrt.wcstok_s
@ cdecl wcstol(wstr ptr long) msvcrt.wcstol
@ cdecl wcstombs(ptr ptr long) msvcrt.wcstombs
@ cdecl wcstombs_s(ptr ptr long wstr long) msvcrt.wcstombs_s
......
......@@ -1491,7 +1491,7 @@
@ cdecl wcsstr(wstr wstr) msvcrt.wcsstr
@ cdecl wcstod(wstr ptr) msvcrt.wcstod
@ cdecl wcstok(wstr wstr) msvcrt.wcstok
@ stub wcstok_s
@ cdecl wcstok_s(ptr wstr ptr) msvcrt.wcstok_s
@ cdecl wcstol(wstr ptr long) msvcrt.wcstol
@ cdecl wcstombs(ptr ptr long) msvcrt.wcstombs
@ cdecl wcstombs_s(ptr ptr long wstr long) msvcrt.wcstombs_s
......
......@@ -1457,7 +1457,7 @@
@ cdecl wcsstr(wstr wstr) ntdll.wcsstr
@ cdecl wcstod(wstr ptr) MSVCRT_wcstod
@ cdecl wcstok(wstr wstr) MSVCRT_wcstok
# stub wcstok_s
@ cdecl wcstok_s(ptr wstr ptr)
@ cdecl wcstol(wstr ptr long) ntdll.wcstol
@ cdecl wcstombs(ptr ptr long) MSVCRT_wcstombs
@ cdecl wcstombs_s(ptr ptr long wstr long) MSVCRT_wcstombs_s
......
......@@ -1368,25 +1368,37 @@ MSVCRT_wchar_t* CDECL MSVCRT_wcspbrk( const MSVCRT_wchar_t* str, const MSVCRT_wc
}
/*********************************************************************
* wcstok (MSVCRT.@)
* wcstok_s (MSVCRT.@)
*/
MSVCRT_wchar_t * CDECL MSVCRT_wcstok( MSVCRT_wchar_t *str, const MSVCRT_wchar_t *delim )
MSVCRT_wchar_t * CDECL wcstok_s( MSVCRT_wchar_t *str, const MSVCRT_wchar_t *delim,
MSVCRT_wchar_t **next_token )
{
thread_data_t *data = msvcrt_get_thread_data();
MSVCRT_wchar_t *ret;
if (!str)
if (!(str = data->wcstok_next)) return NULL;
if (!MSVCRT_CHECK_PMT(delim != NULL) || !MSVCRT_CHECK_PMT(next_token != NULL) ||
!MSVCRT_CHECK_PMT(str != NULL || *next_token != NULL))
{
*MSVCRT__errno() = MSVCRT_EINVAL;
return NULL;
}
if (!str) str = *next_token;
while (*str && strchrW( delim, *str )) str++;
if (!*str) return NULL;
ret = str++;
while (*str && !strchrW( delim, *str )) str++;
if (*str) *str++ = 0;
data->wcstok_next = str;
*next_token = str;
return ret;
}
/*********************************************************************
* wcstok (MSVCRT.@)
*/
MSVCRT_wchar_t * CDECL MSVCRT_wcstok( MSVCRT_wchar_t *str, const MSVCRT_wchar_t *delim )
{
return wcstok_s(str, delim, &msvcrt_get_thread_data()->wcstok_next);
}
/*********************************************************************
* wctomb (MSVCRT.@)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment