annotate lib/getopt_int.h @ 448:5cccf90bf838 3.0 tip

Fixed bug with complex external references generating invalid relocations in the object file
author lost@l-w.ca
date Fri, 05 Nov 2010 22:27:00 -0600
parents b8bf63962a99
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
434
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
1 /* Internal declarations for getopt.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
2 Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2010 Free Software
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
3 Foundation, Inc.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
4 This file is part of the GNU C Library.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
5
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
6 This program is free software: you can redistribute it and/or modify
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
8 the Free Software Foundation; either version 3 of the License, or
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
9 (at your option) any later version.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
10
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
11 This program is distributed in the hope that it will be useful,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
14 GNU General Public License for more details.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
15
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
18
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
19 #ifndef _GETOPT_INT_H
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
20 #define _GETOPT_INT_H 1
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
21
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
22 #include <getopt.h>
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
23
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
24 extern int _getopt_internal (int ___argc, char **___argv,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
25 const char *__shortopts,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
26 const struct option *__longopts, int *__longind,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
27 int __long_only, int __posixly_correct);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
28
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
29
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
30 /* Reentrant versions which can handle parsing multiple argument
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
31 vectors at the same time. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
32
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
33 /* Data type for reentrant functions. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
34 struct _getopt_data
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
35 {
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
36 /* These have exactly the same meaning as the corresponding global
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
37 variables, except that they are used for the reentrant
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
38 versions of getopt. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
39 int optind;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
40 int opterr;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
41 int optopt;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
42 char *optarg;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
43
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
44 /* Internal members. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
45
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
46 /* True if the internal members have been initialized. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
47 int __initialized;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
48
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
49 /* The next char to be scanned in the option-element
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
50 in which the last option character we returned was found.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
51 This allows us to pick up the scan where we left off.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
52
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
53 If this is zero, or a null string, it means resume the scan
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
54 by advancing to the next ARGV-element. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
55 char *__nextchar;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
56
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
57 /* Describe how to deal with options that follow non-option ARGV-elements.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
58
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
59 If the caller did not specify anything,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
60 the default is REQUIRE_ORDER if the environment variable
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
61 POSIXLY_CORRECT is defined, PERMUTE otherwise.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
62
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
63 REQUIRE_ORDER means don't recognize them as options;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
64 stop option processing when the first non-option is seen.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
65 This is what Unix does.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
66 This mode of operation is selected by either setting the environment
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
67 variable POSIXLY_CORRECT, or using `+' as the first character
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
68 of the list of option characters, or by calling getopt.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
69
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
70 PERMUTE is the default. We permute the contents of ARGV as we
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
71 scan, so that eventually all the non-options are at the end.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
72 This allows options to be given in any order, even with programs
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
73 that were not written to expect this.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
74
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
75 RETURN_IN_ORDER is an option available to programs that were
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
76 written to expect options and other ARGV-elements in any order
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
77 and that care about the ordering of the two. We describe each
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
78 non-option ARGV-element as if it were the argument of an option
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
79 with character code 1. Using `-' as the first character of the
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
80 list of option characters selects this mode of operation.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
81
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
82 The special argument `--' forces an end of option-scanning regardless
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
83 of the value of `ordering'. In the case of RETURN_IN_ORDER, only
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
84 `--' can cause `getopt' to return -1 with `optind' != ARGC. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
85
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
86 enum
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
87 {
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
88 REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
89 } __ordering;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
90
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
91 /* If the POSIXLY_CORRECT environment variable is set
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
92 or getopt was called. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
93 int __posixly_correct;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
94
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
95
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
96 /* Handle permutation of arguments. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
97
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
98 /* Describe the part of ARGV that contains non-options that have
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
99 been skipped. `first_nonopt' is the index in ARGV of the first
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
100 of them; `last_nonopt' is the index after the last of them. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
101
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
102 int __first_nonopt;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
103 int __last_nonopt;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
104
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
105 #if defined _LIBC && defined USE_NONOPTION_FLAGS
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
106 int __nonoption_flags_max_len;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
107 int __nonoption_flags_len;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
108 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
109 };
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
110
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
111 /* The initializer is necessary to set OPTIND and OPTERR to their
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
112 default values and to clear the initialization flag. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
113 #define _GETOPT_DATA_INITIALIZER { 1, 1 }
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
114
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
115 extern int _getopt_internal_r (int ___argc, char **___argv,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
116 const char *__shortopts,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
117 const struct option *__longopts, int *__longind,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
118 int __long_only, struct _getopt_data *__data,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
119 int __posixly_correct);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
120
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
121 extern int _getopt_long_r (int ___argc, char **___argv,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
122 const char *__shortopts,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
123 const struct option *__longopts, int *__longind,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
124 struct _getopt_data *__data);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
125
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
126 extern int _getopt_long_only_r (int ___argc, char **___argv,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
127 const char *__shortopts,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
128 const struct option *__longopts,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
129 int *__longind,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
130 struct _getopt_data *__data);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
131
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
132 #endif /* getopt_int.h */