ReactOS  0.4.14-dev-98-gb0d4763
wcstok.c
Go to the documentation of this file.
1 /* taken from wine wcs.c */
2 
3 #include <precomp.h>
4 
5 /*********************************************************************
6  * wcstok_s (MSVCRT.@)
7  */
8 wchar_t * CDECL wcstok_s( wchar_t *str, const wchar_t *delim,
9  wchar_t **next_token )
10 {
11  wchar_t *ret;
12 
13  if (!MSVCRT_CHECK_PMT(delim != NULL) || !MSVCRT_CHECK_PMT(next_token != NULL) ||
15  {
17  return NULL;
18  }
19  if (!str) str = *next_token;
20 
21  while (*str && strchrW( delim, *str )) str++;
22  if (!*str) return NULL;
23  ret = str++;
24  while (*str && !strchrW( delim, *str )) str++;
25  if (*str) *str++ = 0;
26  *next_token = str;
27  return ret;
28 }
29 
30 /*********************************************************************
31  * wcstok (MSVCRT.@)
32  */
33 wchar_t * CDECL wcstok( wchar_t *str, const wchar_t *delim )
34 {
35  return wcstok_s(str, delim, &msvcrt_get_thread_data()->wcstok_next);
36 }
errno_t __cdecl _set_errno(_In_ int _Value)
WINE_UNICODE_INLINE WCHAR * strchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:248
Definition: arc.h:39
int next_token(char **, FILE *)
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
int ret
#define MSVCRT_CHECK_PMT(x)
Definition: mbstowcs_s.c:26
wchar_t *CDECL wcstok_s(wchar_t *str, const wchar_t *delim, wchar_t **next_token)
Definition: wcstok.c:8
thread_data_t * msvcrt_get_thread_data(void)
Definition: tls.c:31
#define CDECL
Definition: compat.h:21
wchar_t *CDECL wcstok(wchar_t *str, const wchar_t *delim)
Definition: wcstok.c:33