blob: d4b233c9ff3f2d1bfb4b2f48f88c30c257f07d70 [file] [log] [blame]
alaffin7ce3a792000-07-27 16:59:03 +00001.\"
2.\" $Id: string_to_tokens.3,v 1.1 2000/07/27 16:59:03 alaffin Exp $
3.\"
4.\" Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
Chris Dearman37550cf2012-10-17 19:54:01 -07005.\"
alaffin7ce3a792000-07-27 16:59:03 +00006.\" This program is free software; you can redistribute it and/or modify it
7.\" under the terms of version 2 of the GNU General Public License as
8.\" published by the Free Software Foundation.
Chris Dearman37550cf2012-10-17 19:54:01 -07009.\"
alaffin7ce3a792000-07-27 16:59:03 +000010.\" This program is distributed in the hope that it would be useful, but
11.\" WITHOUT ANY WARRANTY; without even the implied warranty of
12.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Chris Dearman37550cf2012-10-17 19:54:01 -070013.\"
alaffin7ce3a792000-07-27 16:59:03 +000014.\" Further, this software is distributed without any warranty that it is
15.\" free of the rightful claim of any third person regarding infringement
16.\" or the like. Any license provided herein, whether implied or
17.\" otherwise, applies only to this software file. Patent licenses, if
18.\" any, provided herein do not apply to combinations of this program with
19.\" other software, or any other product whatsoever.
Chris Dearman37550cf2012-10-17 19:54:01 -070020.\"
alaffin7ce3a792000-07-27 16:59:03 +000021.\" You should have received a copy of the GNU General Public License along
Wanlong Gaofed96412012-10-24 10:10:29 +080022.\" with this program; if not, write the Free Software Foundation, Inc.,
23.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Chris Dearman37550cf2012-10-17 19:54:01 -070024.\"
alaffin7ce3a792000-07-27 16:59:03 +000025.\" Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
26.\" Mountain View, CA 94043, or:
Chris Dearman37550cf2012-10-17 19:54:01 -070027.\"
28.\" http://www.sgi.com
29.\"
30.\" For further information regarding this notice, see:
31.\"
alaffin7ce3a792000-07-27 16:59:03 +000032.\" http://oss.sgi.com/projects/GenInfo/NoticeExplan/
33.\"
34.TH STRING_TO_TOKEN 3 07/25/2000 "Linux Test Project"
35.SH NAME
36string_to_tokens \- Break a string into its tokens
37.SH SYNOPSIS
38.nf
39\fB
40int string_to_tokens(arg_string, arg_array, array_size, separator)
41char *arg_string;
42char *arg_array[];
43int array_size;
44char *separator;
45\fR
46.fi
47
48.SH DESCRIPTION
49This function parses the string \fIarg_string\fR, placing pointers to
50the \fIseparator\fR separated tokens into the elements of \fIarg_array\fR.
51The array is terminated with a null pointer.
52\fIarg_array\fR must contains at least \fIarray_size\fR elements.
53Only the first \fIarray_size\fR minus one tokens will be placed into
54\fIarg_array\fR. If there are more than \fIarray_size\fR-1 tokens, the rest are
55ignored by this routine.
56.RE
57
58.SH "SEE ALSO"
59strtok(3).
60
61.SH DIAGNOSTICS
62This function returns the number of \fIseparator\fR separated tokens that
63were found in \fIarg_string\fR.
64If \fIarg_array\fR or \fIseparator\fR is NULL or \fIarray_size\fR is less than 2,
65-1 is returned.
66
67.SH BUGS
68This function uses \fBstrtok()\fR to parse \fIarg_string\fR, and thus
69physically alters \fIarg_string\fR by placing null characters where the
70separators originally were.
71