ReactOS
0.4.16-dev-329-g9223134
strtok_s.c
Go to the documentation of this file.
1
/* Taken from Wine Staging msvcrt/string.c */
2
3
#include <precomp.h>
4
#include <
internal/wine/msvcrt.h
>
5
6
/*********************************************************************
7
* strtok_s (MSVCRT.@)
8
*/
9
char
*
CDECL
strtok_s
(
char
*
str
,
const
char
*delim,
char
**
ctx
)
10
{
11
if
(!
MSVCRT_CHECK_PMT
(delim !=
NULL
))
return
NULL
;
12
if
(!
MSVCRT_CHECK_PMT
(
ctx
!=
NULL
))
return
NULL
;
13
if
(!
MSVCRT_CHECK_PMT
(
str
!=
NULL
|| *
ctx
!=
NULL
))
return
NULL
;
14
15
if
(!
str
)
16
str
= *
ctx
;
17
18
while
(*
str
&&
strchr
(delim, *
str
))
19
str
++;
20
if
(!*
str
)
21
{
22
*
ctx
=
str
;
23
return
NULL
;
24
}
25
26
*
ctx
=
str
+1;
27
while
(**
ctx
&& !
strchr
(delim, **
ctx
))
28
(*ctx)++;
29
if
(**
ctx
)
30
*(*ctx)++ = 0;
31
32
return
str
;
33
}
strchr
char * strchr(const char *String, int ch)
Definition:
utclib.c:501
NULL
#define NULL
Definition:
types.h:112
CDECL
#define CDECL
Definition:
compat.h:29
MSVCRT_CHECK_PMT
#define MSVCRT_CHECK_PMT(x)
Definition:
mbstowcs_s.c:26
str
const WCHAR * str
Definition:
rpc_transport.c:2724
msvcrt.h
strtok_s
char *CDECL strtok_s(char *str, const char *delim, char **ctx)
Definition:
strtok_s.c:9
ctx
Definition:
dbghelp_private.h:571
sdk
lib
crt
string
strtok_s.c
Generated on Sat Dec 7 2024 06:13:34 for ReactOS by
1.9.6