X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/1f2f436a38f7ae2d39a943ad2898d8fed4ed2e58..aa54d2fad3d9038b43475aa93c76795c5141a993:/stdlib/FreeBSD/getsubopt.3 diff --git a/stdlib/FreeBSD/getsubopt.3 b/stdlib/FreeBSD/getsubopt.3 index 544e343..c1ddee2 100644 --- a/stdlib/FreeBSD/getsubopt.3 +++ b/stdlib/FreeBSD/getsubopt.3 @@ -40,23 +40,27 @@ .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. @@ -65,10 +69,10 @@ The .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 @@ -93,7 +97,7 @@ will be set to point to the ``value'' portion of the token, or if no ``value'' portion was present. .Sh EXAMPLES .Bd -literal -compact -char *tokens[] = { +char *keylistp[] = { #define ONE 0 "one", #define TWO 1 @@ -114,7 +118,7 @@ while ((ch = getopt(argc, argv, "ab:")) != \-1) { case 'b': options = optarg; while (*options) { - switch(getsubopt(&options, tokens, &value)) { + switch(getsubopt(&options, keylistp, &value)) { case ONE: /* process ``one'' sub option */ break;