strtok2.3
.\" $Id: strtok2.3,v 1.3 2001/10/31 00:24:37 eric Exp $
.\"
.\" Man page for strtok2() function
.\"
.\"
.\" $Log: strtok2.3,v $
.\" Revision 1.3 2001/10/31 00:24:37 eric
.\" Corrected log display
.\"
.\"
.TH strtok2 3 "October 23, 2001" "Strtok2()"
.SH "NAME"
strtok2 \- split string into tokens
.SH "SYNOPSIS"
.B #include <stdio.h>
.br
.B #include <string.h>
.br
.B #include <stdlib.h>
.P
.B char\ *strtok2(\ char
.IR "**buf" ,
.B char
.IR "*delim_storage" ,
.B const\ char
.I *delim_list
.B );
.SH PARAMETERS
.TP
.I buf
A pointer to a string containing the text to be tokenized.
.TP
.I delim_storage
A pointer to a character in which to store the character which
terminated
the current token.
.TP
.I delim_list
A string containing a list of all delimiters to search for when
tokenizing the string.
.SH DESCRIPTION
The
.B strtok2()
function extracts a token from the string pointed to by the
.I buf
parameter. Initial instances of characters in
.I delim_list
are skipped, and the first character after that
is the beginning of the
token, which in turn is terminated by the first character in
.I delim_list
after that.
The character that terminates the token is copied to the
.I delim_storage
variable. Unlike
.B strtok(3),
the contents of
.I buf
are not modified by
.B strtok2().
.P
.B strtok2()
can be called repeatedly to extract all of the tokens in the string.
.SH "RETURN VALUE"
The character terminating the token is returned in
.I delim_storage,
.I buf
is updated to point to the position of the character terminating the
token, and the pointer
.B strtok2()
returns is to a copy of the token, which the caller should
.B free(3)
when the token is no longer needed.
.B strtok2()
returns NULL
if there are no tokens in
.IR "buf" .
.SH "SEE ALSO"
.BR strtok (3)