1 /* Declarations for getopt.
2 Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 2, or (at your option) any
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
18 /* XXX THIS HAS BEEN MODIFIED FOR INCORPORATION INTO BASH XXX */
21 #define _SH_GETOPT_H 1
25 /* For communication from `getopt' to the caller.
26 When `getopt' finds an option that takes an argument,
27 the argument value is returned here.
28 Also, when `ordering' is RETURN_IN_ORDER,
29 each non-option ARGV-element is returned here. */
31 extern char *sh_optarg;
33 /* Index in ARGV of the next element to be scanned.
34 This is used for communication to and from the caller
35 and for communication between successive calls to `getopt'.
37 On entry to `getopt', zero means this is the first call; initialize.
39 When `getopt' returns EOF, this is the index of the first of the
40 non-option elements that the caller should itself scan.
42 Otherwise, `sh_optind' communicates from one call to the next
43 how much of ARGV has been scanned so far. */
47 /* Callers store zero here to inhibit the error message `getopt' prints
48 for unrecognized options. */
52 /* Set to an option character which was unrecognized. */
56 /* Set to 1 when an unrecognized option is encountered. */
59 extern int sh_getopt __P((int, char *const *, const char *));
60 extern void sh_getopt_restore_state __P((char **));
62 #endif /* _SH_GETOPT_H */