| 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
|
|---|
| 3 | Free Software Foundation, Inc.
|
|---|
| 4 | This file is part of the GNU C Library.
|
|---|
| 5 |
|
|---|
| 6 | This program is free software; you can redistribute it and/or modify
|
|---|
| 7 | it under the terms of the GNU General Public License as published by
|
|---|
| 8 | the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 9 | any later version.
|
|---|
| 10 |
|
|---|
| 11 | This program is distributed in the hope that it will be useful,
|
|---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 14 | GNU General Public License for more details.
|
|---|
| 15 |
|
|---|
| 16 | You should have received a copy of the GNU General Public License
|
|---|
| 17 | along with this program; if not, write to the Free Software Foundation,
|
|---|
| 18 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|---|
| 19 | |
|---|
| 20 |
|
|---|
| 21 | #ifdef HAVE_CONFIG_H
|
|---|
| 22 | #include <config.h>
|
|---|
| 23 | #endif
|
|---|
| 24 |
|
|---|
| 25 | #include "getopt.h"
|
|---|
| 26 |
|
|---|
| 27 | #if !defined __STDC__ || !__STDC__
|
|---|
| 28 | /* This is a separate conditional since some stdc systems
|
|---|
| 29 | reject `defined (const)'. */
|
|---|
| 30 | #ifndef const
|
|---|
| 31 | #define const
|
|---|
| 32 | #endif
|
|---|
| 33 | #endif
|
|---|
| 34 |
|
|---|
| 35 | #include <stdio.h>
|
|---|
| 36 |
|
|---|
| 37 | /* Comment out all this code if we are using the GNU C Library, and are not
|
|---|
| 38 | actually compiling the library itself. This code is part of the GNU C
|
|---|
| 39 | Library, but also included in many other GNU distributions. Compiling
|
|---|
| 40 | and linking in this code is a waste when using the GNU C library
|
|---|
| 41 | (especially if it is a shared library). Rather than having every GNU
|
|---|
| 42 | program understand `configure --with-gnu-libc' and omit the object files,
|
|---|
| 43 | it is simpler to just do this in the source for each such file. */
|
|---|
| 44 |
|
|---|
| 45 | #define GETOPT_INTERFACE_VERSION 2
|
|---|
| 46 | #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
|
|---|
| 47 | #include <gnu-versions.h>
|
|---|
| 48 | #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
|
|---|
| 49 | #define ELIDE_CODE
|
|---|
| 50 | #endif
|
|---|
| 51 | #endif
|
|---|
| 52 |
|
|---|
| 53 | #ifndef ELIDE_CODE
|
|---|
|
|---|