ReactOS 0.4.16-dev-321-g63bb46a
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}
thread_data_t * msvcrt_get_thread_data(void)
Definition: tls.c:31
const WCHAR * str
wchar_t *CDECL wcstok_s(wchar_t *str, const wchar_t *delim, wchar_t **next_token)
Definition: wcstok.c:8

◆ 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}
#define EINVAL
Definition: acclib.h:90
int next_token(char **, FILE *)
#define NULL
Definition: types.h:112
#define MSVCRT_CHECK_PMT(x)
Definition: mbstowcs_s.c:26
#define strchrW(s, c)
Definition: unicode.h:40
errno_t __cdecl _set_errno(_In_ int _Value)
int ret

Referenced by wcstok().