ReactOS  0.4.13-dev-961-g238ea69
wcstok.c File Reference
#include <precomp.h>
Include dependency graph for wcstok.c:

Go to the source code of this file.

Functions

wchar_t *CDECL wcstok_s (wchar_t *str, const wchar_t *delim, wchar_t **next_token)
 
wchar_t *CDECL wcstok (wchar_t *str, const wchar_t *delim)
 

Function Documentation

◆ wcstok()

wchar_t* CDECL wcstok ( wchar_t str,
const wchar_t delim 
)

Definition at line 33 of file wcstok.c.

34 {
35  return wcstok_s(str, delim, &msvcrt_get_thread_data()->wcstok_next);
36 }
const WCHAR * str
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

◆ wcstok_s()

wchar_t* CDECL wcstok_s ( wchar_t str,
const wchar_t delim,
wchar_t **  next_token 
)

Definition at line 8 of file wcstok.c.

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

Referenced by wcstok().