]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame - getopt/getopt.h
import smartmontools 7.0
[mirror_smartmontools-debian.git] / getopt / getopt.h
CommitLineData
a23d5117 1/* Declarations for getopt.
ff28b140 2 Copyright (C) 1989-2018 Free Software Foundation, Inc.
a23d5117 3 This file is part of the GNU C Library.
ff28b140
TL
4 Unlike the bulk of the getopt implementation, this file is NOT part
5 of gnulib; gnulib also has a getopt.h but it is different.
a23d5117
GI
6
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
ff28b140
TL
18 License along with the GNU C Library; if not, see
19 <http://www.gnu.org/licenses/>. */
a23d5117
GI
20
21#ifndef _GETOPT_H
ff28b140 22#define _GETOPT_H 1
a23d5117 23
ff28b140
TL
24#ifndef _GETOPT_STANDALONE
25#include <features.h>
a23d5117
GI
26#endif
27
ff28b140
TL
28// From <sys/cdefs.h>:
29#ifndef __BEGIN_DECLS
30# ifdef __cplusplus
31# define __BEGIN_DECLS extern "C" {
32# define __END_DECLS }
a23d5117 33# else
ff28b140
TL
34# define __BEGIN_DECLS
35# define __END_DECLS
a23d5117 36# endif
ff28b140
TL
37#endif
38#ifndef __THROW
39# ifdef __cplusplus
40# define __THROW throw()
41# elif defined(__GNUC__)
42# define __THROW __attribute__ ((__nothrow__))
43# else
44# define __THROW
a23d5117 45# endif
ff28b140
TL
46#endif
47#ifndef __nonnull
48# ifdef __GNUC__
49# define __nonnull(x) __attribute__ ((__nonnull__ x))
50# else
51# define __nonnull(x)
a23d5117 52# endif
ff28b140 53#endif
a23d5117 54
ff28b140
TL
55/* The type of the 'argv' argument to getopt_long and getopt_long_only
56 is properly 'char **', since both functions may write to the array
57 (in order to move all the options to the beginning). However, for
58 compatibility with old versions of LSB, glibc has to use 'char *const *'
59 instead. */
60#ifndef __getopt_argv_const
61# define __getopt_argv_const const
a23d5117
GI
62#endif
63
ff28b140
TL
64#include <bits/getopt_core.h>
65#include <bits/getopt_ext.h>
a23d5117
GI
66
67#endif /* getopt.h */