Loading...
stdlib/getsubopt.3 Libc-262.2.12 Libc-498
--- Libc/Libc-262.2.12/stdlib/getsubopt.3
+++ Libc/Libc-498/stdlib/getsubopt.3
@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)getsubopt.3	8.1 (Berkeley) 6/9/93
-.\" $FreeBSD: src/lib/libc/stdlib/getsubopt.3,v 1.9 2001/09/07 14:46:35 asmodai Exp $
+.\" $FreeBSD: src/lib/libc/stdlib/getsubopt.3,v 1.10 2004/02/23 03:32:10 ache Exp $
 .\"
 .Dd June 9, 1993
 .Dt GETSUBOPT 3
@@ -41,26 +41,30 @@
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
-.In unistd.h
+.In stdlib.h
 .Vt extern char *suboptarg ;
 .Ft int
-.Fn getsubopt "char **optionp" "char * const *tokens" "char **valuep"
+.Fo getsubopt
+.Fa "char **optionp"
+.Fa "char *const *keylistp"
+.Fa "char **valuep"
+.Fc
 .Sh DESCRIPTION
 The
 .Fn getsubopt
 function
-parses a string containing tokens delimited by one or more tab, space or
-comma
+parses a string containing tokens that are delimited
+by one or more tab, space, or comma
 .Pq Ql \&,
 characters.
-It is intended for use in parsing groups of option arguments provided
-as part of a utility command line.
+It is intended for use in parsing groups of option arguments
+that are provided as part of a utility command line.
 .Pp
 The argument
 .Fa optionp
 is a pointer to a pointer to the string.
 The argument
-.Fa tokens
+.Fa keylistp
 is a pointer to a
 .Dv NULL Ns -terminated
 array of pointers to strings.
@@ -69,10 +73,10 @@
 .Fn getsubopt
 function
 returns the zero-based offset of the pointer in the
-.Fa tokens
-array referencing a string which matches the first token
-in the string, or, \-1 if the string contains no tokens or
-.Fa tokens
+.Fa keylistp
+array, referencing a string which matches the first token in the string
+ or \-1 if the string contains no tokens or
+.Fa keylistp
 does not contain a matching string.
 .Pp
 If the token is of the form ``name=value'', the location referenced by
@@ -97,7 +101,7 @@
 if no ``value'' portion was present.
 .Sh EXAMPLES
 .Bd -literal -compact
-char *tokens[] = {
+char *keylistp[] = {
 	#define	ONE	0
 		"one",
 	#define	TWO	1
@@ -118,7 +122,7 @@
 	case 'b':
 		options = optarg;
 		while (*options) {
-			switch(getsubopt(&options, tokens, &value)) {
+			switch(getsubopt(&options, keylistp, &value)) {
 			case ONE:
 				/* process ``one'' sub option */
 				break;