#include <stdio.h>
#include <string.h>
Go to the source code of this file.
◆ getopt()
Definition at line 20 of file getopt.c.
21{
22 char *curopt;
24 int cursubopt;
25
28 } else {
30 if (curopt ==
NULL || curopt[0] !=
'-' ||
strcmp(curopt,
"-") == 0)
31 return -1;
35 if (
strcmp(curopt,
"--") == 0)
36 return -1;
37 }
39 if ((
p =
strchr(optstring, curopt[cursubopt])) ==
NULL) {
40 optopt = curopt[cursubopt];
43 return '?';
44 }
46 if (curopt[cursubopt+1] != '\0') {
47 optarg = curopt+cursubopt+1;
50 }
55 if (*optstring == ':')
56 return ':';
57 return '?';
58 }
60 }
62}
int strcmp(const char *String1, const char *String2)
char * strchr(const char *String, int ch)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
Referenced by main().
◆ optarg
◆ opterr
◆ optind
◆ optopt
◆ subopt
◆ suboptind