]> git.saurik.com Git - apple/libc.git/blob - stdlib/FreeBSD/getsubopt.3.patch
Libc-594.1.4.tar.gz
[apple/libc.git] / stdlib / FreeBSD / getsubopt.3.patch
1 --- _SB/Libc/stdlib/FreeBSD/getsubopt.3 2004-11-25 11:38:41.000000000 -0800
2 +++ _SB/Libc/stdlib/FreeBSD/getsubopt.3.edit 2006-06-28 16:55:52.000000000 -0700
3 @@ -44,23 +44,27 @@
4 .In stdlib.h
5 .Vt extern char *suboptarg ;
6 .Ft int
7 -.Fn getsubopt "char **optionp" "char * const *tokens" "char **valuep"
8 +.Fo getsubopt
9 +.Fa "char **optionp"
10 +.Fa "char *const *keylistp"
11 +.Fa "char **valuep"
12 +.Fc
13 .Sh DESCRIPTION
14 The
15 .Fn getsubopt
16 function
17 -parses a string containing tokens delimited by one or more tab, space or
18 -comma
19 +parses a string containing tokens that are delimited
20 +by one or more tab, space, or comma
21 .Pq Ql \&,
22 characters.
23 -It is intended for use in parsing groups of option arguments provided
24 -as part of a utility command line.
25 +It is intended for use in parsing groups of option arguments
26 +that are provided as part of a utility command line.
27 .Pp
28 The argument
29 .Fa optionp
30 is a pointer to a pointer to the string.
31 The argument
32 -.Fa tokens
33 +.Fa keylistp
34 is a pointer to a
35 .Dv NULL Ns -terminated
36 array of pointers to strings.
37 @@ -69,10 +73,10 @@
38 .Fn getsubopt
39 function
40 returns the zero-based offset of the pointer in the
41 -.Fa tokens
42 -array referencing a string which matches the first token
43 -in the string, or, \-1 if the string contains no tokens or
44 -.Fa tokens
45 +.Fa keylistp
46 +array, referencing a string which matches the first token in the string
47 + or \-1 if the string contains no tokens or
48 +.Fa keylistp
49 does not contain a matching string.
50 .Pp
51 If the token is of the form ``name=value'', the location referenced by
52 @@ -97,7 +101,7 @@
53 if no ``value'' portion was present.
54 .Sh EXAMPLES
55 .Bd -literal -compact
56 -char *tokens[] = {
57 +char *keylistp[] = {
58 #define ONE 0
59 "one",
60 #define TWO 1
61 @@ -118,7 +122,7 @@
62 case 'b':
63 options = optarg;
64 while (*options) {
65 - switch(getsubopt(&options, tokens, &value)) {
66 + switch(getsubopt(&options, keylistp, &value)) {
67 case ONE:
68 /* process ``one'' sub option */
69 break;