2007-01-08 Bruno Haible <bruno@clisp.org>
[gnulib.git] / lib / getopt1.c
index a6fdee5..cc0746e 100644 (file)
@@ -1,5 +1,5 @@
 /* getopt_long and getopt_long_only entry points for GNU getopt.
-   Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004
+   Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006
      Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
 
    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation,
-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 \f
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #ifdef _LIBC
 # include <getopt.h>
 #else
+# include <config.h>
 # include "getopt.h"
 #endif
 #include "getopt_int.h"
@@ -44,16 +41,17 @@ int
 getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
             const struct option *long_options, int *opt_index)
 {
-  return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
+  return _getopt_internal (argc, (char **) argv, options, long_options,
+                          opt_index, 0, 0);
 }
 
 int
-_getopt_long_r (int argc, char *__getopt_argv_const *argv, const char *options,
+_getopt_long_r (int argc, char **argv, const char *options,
                const struct option *long_options, int *opt_index,
                struct _getopt_data *d)
 {
   return _getopt_internal_r (argc, argv, options, long_options, opt_index,
-                            0, d);
+                            0, 0, d);
 }
 
 /* Like getopt_long, but '-' as well as '--' can indicate a long option.
@@ -66,17 +64,17 @@ getopt_long_only (int argc, char *__getopt_argv_const *argv,
                  const char *options,
                  const struct option *long_options, int *opt_index)
 {
-  return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
+  return _getopt_internal (argc, (char **) argv, options, long_options,
+                          opt_index, 1, 0);
 }
 
 int
-_getopt_long_only_r (int argc, char *__getopt_argv_const *argv,
-                    const char *options,
+_getopt_long_only_r (int argc, char **argv, const char *options,
                     const struct option *long_options, int *opt_index,
                     struct _getopt_data *d)
 {
   return _getopt_internal_r (argc, argv, options, long_options, opt_index,
-                            1, d);
+                            1, 0, d);
 }
 
 \f