ReactOS
0.4.17-dev-966-gf06eace
strtok_s.c
Go to the documentation of this file.
1
#define _CRTIMP
2
#include <
precomp.h
>
3
4
char
*
CDECL
strtok_s
(
char
*
str
,
const
char
*delim,
char
**
ctx
)
5
{
6
if
(!
MSVCRT_CHECK_PMT
(delim !=
NULL
))
return
NULL
;
7
if
(!
MSVCRT_CHECK_PMT
(
ctx
!=
NULL
))
return
NULL
;
8
if
(!
MSVCRT_CHECK_PMT
(
str
!=
NULL
|| *
ctx
!=
NULL
))
return
NULL
;
9
10
if
(!
str
)
11
str
= *
ctx
;
12
13
while
(*
str
&&
strchr
(delim, *
str
))
14
str
++;
15
if
(!*
str
)
16
{
17
*
ctx
=
str
;
18
return
NULL
;
19
}
20
21
*
ctx
=
str
+1;
22
while
(**
ctx
&& !
strchr
(delim, **
ctx
))
23
(*ctx)++;
24
if
(**
ctx
)
25
*(*ctx)++ = 0;
26
27
return
str
;
28
}
29
30
#ifdef _WIN64
31
void
* __imp_strtok_s =
strtok_s
;
32
#else
33
void
*
_imp__strtok_s
=
strtok_s
;
34
#endif
NULL
#define NULL
Definition:
types.h:112
CDECL
#define CDECL
Definition:
compat.h:29
strchr
_ACRTIMP char *__cdecl strchr(const char *, int)
Definition:
string.c:3291
MSVCRT_CHECK_PMT
#define MSVCRT_CHECK_PMT(x)
Definition:
msvcrt.h:378
str
const WCHAR * str
Definition:
rpc_transport.c:2696
_imp__strtok_s
void * _imp__strtok_s
Definition:
strtok_s.c:33
strtok_s
char *CDECL strtok_s(char *str, const char *delim, char **ctx)
Definition:
strtok_s.c:4
ctx
Definition:
dbghelp_private.h:571
precomp.h
sdk
lib
crt
strtok_s.c
Generated on Thu Oct 1 2026 06:20:13 for ReactOS by
1.9.6