Definition at line 44 of file getopt.c.
45{
46 static int sp = 1;
47 register int c;
48 register char *cp;
49
50 if (sp == 1)
51 {
55 {
56 return(EOF);
57 }
59 {
61 return(EOF);
62 }
63 }
65 if (c == ':' || (cp=strchr(opts, c)) == 0)
66 {
67 ERR(
": illegal option -- ", c);
69 {
71 sp = 1;
72 }
73 return('?');
74 }
75 if (*++cp == ':')
76 {
80 {
81 ERR(
": option requires an argument -- ", c);
82 sp = 1;
83 return('?');
84 }
85 else
87 sp = 1;
88 }
89 else
90 {
92 {
93 sp = 1;
95 }
97 }
98 return(c);
99}
References ERR, pgis_optarg, pgis_optind, and pgis_optopt.
Referenced by main(), and main().