]> sjero.net Git - wget/commitdiff
[svn] Add definitions of getopt_long and getopt_long_only to getopt.c.
authorhniksic <devnull@localhost>
Wed, 8 Oct 2003 14:55:44 +0000 (07:55 -0700)
committerhniksic <devnull@localhost>
Wed, 8 Oct 2003 14:55:44 +0000 (07:55 -0700)
The definitions were lost when updating the file.

src/ChangeLog
src/getopt.c

index bc2d75730631b9e0a07e6539f11991522a698c59..9b5aa8a5d15eef4c3f633970c71cb30e16abc80a 100644 (file)
@@ -1,3 +1,7 @@
+2003-10-08  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * getopt.c: Add definitions of getopt_long and getopt_long_only.
+
 2003-10-08  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * config.h.in: Renamed DEBUG to ENABLE_DEBUG.  ENABLE_DEBUG is, I
index d176d3e7e720a406de82663db4740418355998de..46cc07cc84d2962e275b7b3fcfba16dd1aac7c9c 100644 (file)
@@ -974,6 +974,33 @@ getopt (argc, argv, optstring)
                           0);
 }
 
+int
+getopt_long (argc, argv, options, long_options, opt_index)
+     int argc;
+     char *const *argv;
+     const char *options;
+     const struct option *long_options;
+     int *opt_index;
+{
+  return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
+}
+
+/* Like getopt_long, but '-' as well as '--' can indicate a long option.
+   If an option that starts with '-' (not '--') doesn't match a long option,
+   but does match a short option, it is parsed as a short option
+   instead.  */
+
+int
+getopt_long_only (argc, argv, options, long_options, opt_index)
+     int argc;
+     char *const *argv;
+     const char *options;
+     const struct option *long_options;
+     int *opt_index;
+{
+  return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
+}
+
 #endif /* Not ELIDE_CODE.  */
 \f
 #ifdef TEST