home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 48
/
Amiga_Dream_48.iso
/
Atari
/
c
/
sozobon-v2
/
dlibsrc.lha
/
STRTOK.C
< prev
next >
Wrap
C/C++ Source or Header
|
1988-10-05
|
497b
|
25 lines
#include <stddef.h>
static char *_strtok = NULL; /* local token pointer */
char *strtok(string, delim)
register char *string, *delim;
{
register char *p;
char *strchr();
if(string == NULL)
string = _strtok;
while(*string && strchr(delim, *string))
++string;
if(*string == '\0') /* no more tokens */
return(NULL);
p = string;
while(*string && !strchr(delim, *string))
++string;
if(*string != '\0')
*string++ = '\0';
_strtok = string;
return(p);
}