diff options
Diffstat (limited to 'lib/getopt1.c')
-rw-r--r-- | lib/getopt1.c | 61 |
1 files changed, 25 insertions, 36 deletions
diff --git a/lib/getopt1.c b/lib/getopt1.c index ad06cc7f..3288c726 100644 --- a/lib/getopt1.c +++ b/lib/getopt1.c | |||
@@ -1,22 +1,23 @@ | |||
1 | /* getopt_long and getopt_long_only entry points for GNU getopt. | 1 | /* getopt_long and getopt_long_only entry points for GNU getopt. |
2 | Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 | 2 | |
3 | Free Software Foundation, Inc. | 3 | Copyright (C) 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, |
4 | 1997, 1998, 2003 Free Software Foundation, Inc. | ||
5 | |||
4 | This file is part of the GNU C Library. | 6 | This file is part of the GNU C Library. |
5 | 7 | ||
6 | The GNU C Library is free software; you can redistribute it and/or | 8 | This program is free software; you can redistribute it and/or modify |
7 | modify it under the terms of the GNU Lesser General Public | 9 | it under the terms of the GNU General Public License as published by |
8 | License as published by the Free Software Foundation; either | 10 | the Free Software Foundation; either version 2, or (at your option) |
9 | version 2.1 of the License, or (at your option) any later version. | 11 | any later version. |
10 | 12 | ||
11 | The GNU C Library is distributed in the hope that it will be useful, | 13 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | Lesser General Public License for more details. | 16 | GNU General Public License for more details. |
15 | 17 | ||
16 | You should have received a copy of the GNU Lesser General Public | 18 | You should have received a copy of the GNU General Public License along |
17 | License along with the GNU C Library; if not, write to the Free | 19 | with this program; if not, write to the Free Software Foundation, |
18 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | 20 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
19 | 02111-1307 USA. */ | ||
20 | 21 | ||
21 | #ifdef HAVE_CONFIG_H | 22 | #ifdef HAVE_CONFIG_H |
22 | #include <config.h> | 23 | #include <config.h> |
@@ -28,14 +29,6 @@ | |||
28 | # include "getopt.h" | 29 | # include "getopt.h" |
29 | #endif | 30 | #endif |
30 | 31 | ||
31 | #if !defined __STDC__ || !__STDC__ | ||
32 | /* This is a separate conditional since some stdc systems | ||
33 | reject `defined (const)'. */ | ||
34 | #ifndef const | ||
35 | #define const | ||
36 | #endif | ||
37 | #endif | ||
38 | |||
39 | #include <stdio.h> | 32 | #include <stdio.h> |
40 | 33 | ||
41 | /* Comment out all this code if we are using the GNU C Library, and are not | 34 | /* Comment out all this code if we are using the GNU C Library, and are not |
@@ -68,12 +61,11 @@ | |||
68 | #endif | 61 | #endif |
69 | 62 | ||
70 | int | 63 | int |
71 | getopt_long (argc, argv, options, long_options, opt_index) | 64 | getopt_long (int argc, |
72 | int argc; | 65 | char *const *argv, |
73 | char *const *argv; | 66 | const char *options, |
74 | const char *options; | 67 | const struct option *long_options, |
75 | const struct option *long_options; | 68 | int *opt_index) |
76 | int *opt_index; | ||
77 | { | 69 | { |
78 | return _getopt_internal (argc, argv, options, long_options, opt_index, 0); | 70 | return _getopt_internal (argc, argv, options, long_options, opt_index, 0); |
79 | } | 71 | } |
@@ -84,12 +76,11 @@ getopt_long (argc, argv, options, long_options, opt_index) | |||
84 | instead. */ | 76 | instead. */ |
85 | 77 | ||
86 | int | 78 | int |
87 | getopt_long_only (argc, argv, options, long_options, opt_index) | 79 | getopt_long_only (int argc, |
88 | int argc; | 80 | char *const *argv, |
89 | char *const *argv; | 81 | const char *options, |
90 | const char *options; | 82 | const struct option *long_options, |
91 | const struct option *long_options; | 83 | int *opt_index) |
92 | int *opt_index; | ||
93 | { | 84 | { |
94 | return _getopt_internal (argc, argv, options, long_options, opt_index, 1); | 85 | return _getopt_internal (argc, argv, options, long_options, opt_index, 1); |
95 | } | 86 | } |
@@ -106,9 +97,7 @@ libc_hidden_def (getopt_long_only) | |||
106 | #include <stdio.h> | 97 | #include <stdio.h> |
107 | 98 | ||
108 | int | 99 | int |
109 | main (argc, argv) | 100 | main (int argc, char **argv) |
110 | int argc; | ||
111 | char **argv; | ||
112 | { | 101 | { |
113 | int c; | 102 | int c; |
114 | int digit_optind = 0; | 103 | int digit_optind = 0; |