ReactOS 0.4.17-dev-966-gf06eace
strtok_s.c File Reference
#include <precomp.h>
Include dependency graph for strtok_s.c:

Go to the source code of this file.

Macros

#define _CRTIMP
 

Functions

char *CDECL strtok_s (char *str, const char *delim, char **ctx)
 

Variables

void * _imp__strtok_s = strtok_s
 

Macro Definition Documentation

◆ _CRTIMP

#define _CRTIMP

Definition at line 1 of file strtok_s.c.

Function Documentation

◆ strtok_s()

char *CDECL strtok_s ( char *  str,
const char *  delim,
char **  ctx 
)

Definition at line 4 of file strtok_s.c.

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}
#define NULL
Definition: types.h:112
_ACRTIMP char *__cdecl strchr(const char *, int)
Definition: string.c:3291
#define MSVCRT_CHECK_PMT(x)
Definition: msvcrt.h:378
const WCHAR * str

Variable Documentation

◆ _imp__strtok_s

void* _imp__strtok_s = strtok_s

Definition at line 33 of file strtok_s.c.