28 #if !defined __STDC__ || !__STDC__
46 #define GETOPT_INTERFACE_VERSION 2
47 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
48 #include <gnu-versions.h>
49 #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
59 #ifdef __GNU_LIBRARY__
72 const struct option *long_options;
88 const struct option *long_options;
107 int digit_optind = 0;
112 int option_index = 0;
113 static struct option long_options[] =
118 {
"verbose", 0, 0, 0},
125 long_options, &option_index);
132 printf (
"option %s", long_options[option_index].
name);
134 printf (
" with arg %s",
optarg);
148 if (digit_optind != 0 && digit_optind != this_option_optind)
149 printf (
"digits occur in two different argv-elements.\n");
150 digit_optind = this_option_optind;
151 printf (
"option %c\n", c);
155 printf (
"option a\n");
159 printf (
"option b\n");
163 printf (
"option c with value `%s'\n",
optarg);
167 printf (
"option d with value `%s'\n",
optarg);
174 printf (
"?? getopt returned character code 0%o ??\n", c);
180 printf (
"non-option ARGV-elements: ");
182 printf (
"%s ", argv[
optind++]);