*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: getsubopt | Section: 3 | Source: Digital UNIX | File: getsubopt.3.gz
getsubopt(3) Library Functions Manual getsubopt(3) NAME getsubopt - Parses suboption arguments from a command line LIBRARY Standard C Library (libc.so, libc.a) SYNOPSIS #include <stdlib.h> int getsubopt( char **optionp, char *tokens[], char **valuep); STANDARDS Interfaces documented on this reference page conform to industry stan- dards as follows: getsubopt(): XPG4-UNIX Refer to the standards(5) reference page for more information about in- dustry standards and associated tags. PARAMETERS Specifies the address of a pointer to the option string. Specifies an array of possible suboption tokens. Specifies the address of a value string pointer. DESCRIPTION The getsubopt() function parses suboption arguments in a flag argument that was initially parsed by the getopt() function. These suboption arguments must be separated by commas and may consist of either a sin- gle token, or a token-value pair separated by an equal sign. Because commas delimit suboption arguments in the option string, commas are not allowed to be part of the suboption arguments or the value of a subop- tion argument. Similarly, because the equal sign separates a token from its value, a token must not contain an equal sign. The following command line for the mount command gives an example of this syntax: mount -o ro,nosuid,rsize=8192 paradox:/u2 /u2 In this ex- ample, the suboption consists of three arguments: ro and nosuid (to- kens), and rsize=8192 (a token-value pair). When a suboption argument is found in the *optionp string that matches a string in the token array, the index of the matching string in the array is returned. If no match is found, then a -1 is returned. After each match, the *optionp string is updated to point past the matched suboption argument to the next suboption argument in the list. If the suboption argument matched is the last in the string, *optionp is set to the null pointer. If the suboption argument matched is a token- value pair, then *valuep is set to point to the value. If there is no value, then *valuep is to the null pointer. The token array is a list of pointers to strings. The end of the array is signified by a NULL pointer. RETURN VALUES Upon successful completion, the getsubopt() function returns the index of the token or suboption argument that matches the suboption argument in the input string. Otherwise, if no match is found, it returns a value of -1. ERRORS No errors are defined for this routine. RELATED INFORMATION Functions: getopt(3) Standards: standards(5) delim off getsubopt(3)

Navigation Options