Lines Matching refs:optstring

57  * that would require moving the 'optstring[0]' test outside of the
60 #define ERR(s, c, i) if (opterr && optstring[0] != ':') { \
81 * (optstring) as a regular, single character option. If the option is found,
82 * return a pointer into optstring pointing at the short-option character,
86 parseshort(const char *optstring, const char c)
88 char *cp = (char *)optstring;
104 * (optstring) as a long-option contained within parenthesis. If the
107 * return a pointer into optstring pointing at the short-option character
110 * optstring The entire optstring passed to getopt() by the caller
122 * returns Pointer to equivalent short-option in optstring, null
123 * if option not found in optstring.
129 parselong(const char *optstring, const char *opt, char **longoptarg)
131 char *cp; /* ptr into optstring, beginning of one option spec. */
132 char *ip; /* ptr into optstring, traverses every char */
134 int match; /* nonzero if opt is matching part of optstring */
136 cp = ip = (char *)optstring;
164 * Handle double-colon in optstring ("a::(longa)")
168 while ((cp > optstring) && ((*cp) == ':')) {
179 getopt(int argc, char *const *argv, const char *optstring)
210 * Note that the syntax of optstring applies special meanings to
219 * the option in optstring by the appropriate algorithm. Either
221 * optstring if the option is found and NULL otherwise.
231 ((cp = parselong(optstring, argv[optind]+2, &longoptarg)) != NULL) :
232 ((cp = parseshort(optstring, c)) != NULL))) {
287 return (optstring[0] == ':' ? ':' : '?');