Mercurial > emacs
comparison lib-src/getopt.c @ 21501:c8c409640bf3 gcc-2_8_1-980419 gcc-2_8_1-980426 make-3-75-93
automatically generated from GPLed version
author | Ulrich Drepper <drepper@redhat.com> |
---|---|
date | Tue, 14 Apr 1998 00:02:53 +0000 |
parents | fcca6fe56f9c |
children | 465a6898b727 |
comparison
equal
deleted
inserted
replaced
21500:4c72cf4eeedb | 21501:c8c409640bf3 |
---|---|
1 /* Getopt for GNU. | 1 /* Getopt for GNU. |
2 NOTE: getopt is now part of the C library, so if you don't know what | 2 NOTE: getopt is now part of the C library, so if you don't know what |
3 "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu | 3 "Keep this file name-space clean" means, talk to drepper@gnu.org |
4 before changing it! | 4 before changing it! |
5 | 5 |
6 Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 | 6 Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98 |
7 Free Software Foundation, Inc. | 7 Free Software Foundation, Inc. |
8 | 8 |
9 NOTE: The canonical source of this file is maintained with the GNU C Library. | 9 NOTE: The canonical source of this file is maintained with the GNU C Library. |
10 Bugs can be reported to bug-glibc@prep.ai.mit.edu. | 10 Bugs can be reported to bug-glibc@prep.ai.mit.edu. |
11 | 11 |
32 | 32 |
33 #ifdef HAVE_CONFIG_H | 33 #ifdef HAVE_CONFIG_H |
34 #include <config.h> | 34 #include <config.h> |
35 #endif | 35 #endif |
36 | 36 |
37 #if !defined (__STDC__) || !__STDC__ | 37 #if !defined __STDC__ || !__STDC__ |
38 /* This is a separate conditional since some stdc systems | 38 /* This is a separate conditional since some stdc systems |
39 reject `defined (const)'. */ | 39 reject `defined (const)'. */ |
40 #ifndef const | 40 #ifndef const |
41 #define const | 41 #define const |
42 #endif | 42 #endif |
51 (especially if it is a shared library). Rather than having every GNU | 51 (especially if it is a shared library). Rather than having every GNU |
52 program understand `configure --with-gnu-libc' and omit the object files, | 52 program understand `configure --with-gnu-libc' and omit the object files, |
53 it is simpler to just do this in the source for each such file. */ | 53 it is simpler to just do this in the source for each such file. */ |
54 | 54 |
55 #define GETOPT_INTERFACE_VERSION 2 | 55 #define GETOPT_INTERFACE_VERSION 2 |
56 #if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 | 56 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 |
57 #include <gnu-versions.h> | 57 #include <gnu-versions.h> |
58 #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION | 58 #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION |
59 #define ELIDE_CODE | 59 #define ELIDE_CODE |
60 #endif | 60 #endif |
61 #endif | 61 #endif |
223 /* If using GCC, we can safely declare strlen this way. | 223 /* If using GCC, we can safely declare strlen this way. |
224 If not using GCC, it is ok not to declare it. */ | 224 If not using GCC, it is ok not to declare it. */ |
225 #ifdef __GNUC__ | 225 #ifdef __GNUC__ |
226 /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. | 226 /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. |
227 That was relevant to code that was here before. */ | 227 That was relevant to code that was here before. */ |
228 #if !defined (__STDC__) || !__STDC__ | 228 #if !defined __STDC__ || !__STDC__ |
229 /* gcc with -traditional declares the built-in strlen to return int, | 229 /* gcc with -traditional declares the built-in strlen to return int, |
230 and has done so at least since version 2.4.5. -- rms. */ | 230 and has done so at least since version 2.4.5. -- rms. */ |
231 extern int strlen (const char *); | 231 extern int strlen (const char *); |
232 #endif /* not __STDC__ */ | 232 #endif /* not __STDC__ */ |
233 #endif /* __GNUC__ */ | 233 #endif /* __GNUC__ */ |
290 the options processed since those non-options were skipped. | 290 the options processed since those non-options were skipped. |
291 | 291 |
292 `first_nonopt' and `last_nonopt' are relocated so that they describe | 292 `first_nonopt' and `last_nonopt' are relocated so that they describe |
293 the new indices of the non-options in ARGV after they are moved. */ | 293 the new indices of the non-options in ARGV after they are moved. */ |
294 | 294 |
295 #if defined (__STDC__) && __STDC__ | 295 #if defined __STDC__ && __STDC__ |
296 static void exchange (char **); | 296 static void exchange (char **); |
297 #endif | 297 #endif |
298 | 298 |
299 static void | 299 static void |
300 exchange (argv) | 300 exchange (argv) |
376 last_nonopt = optind; | 376 last_nonopt = optind; |
377 } | 377 } |
378 | 378 |
379 /* Initialize the internal data when the first call is made. */ | 379 /* Initialize the internal data when the first call is made. */ |
380 | 380 |
381 #if defined (__STDC__) && __STDC__ | 381 #if defined __STDC__ && __STDC__ |
382 static const char *_getopt_initialize (int, char *const *, const char *); | 382 static const char *_getopt_initialize (int, char *const *, const char *); |
383 #endif | 383 #endif |
384 static const char * | 384 static const char * |
385 _getopt_initialize (argc, argv, optstring) | 385 _getopt_initialize (argc, argv, optstring) |
386 int argc; | 386 int argc; |