AC_TYPE_SIGNAL from current autoconf can fail if CC=g++.
[s-roff.git] / src / include / groff-getopt.h
blobcf3936f65181161ca4b702e15293b7c118526c89
1 // -*- C++ -*-
2 /* Copyright (C) 2000, 2001, 2005 Free Software Foundation, Inc.
3 Written by Werner Lemberg (wl@gnu.org)
5 This file is part of groff.
7 groff is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
12 groff is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
17 You should have received a copy of the GNU General Public License along
18 with groff; see the file COPYING. If not, write to the Free Software
19 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
22 This file has to be included from within lib.h instead of getopt.h
23 to avoid problems with picky C++ compilers.
26 #ifndef _GROFF_GETOPT_H
27 #define _GROFF_GETOPT_H
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
33 extern char *optarg;
34 extern int optind;
35 extern int opterr;
36 extern int optopt;
38 struct option
40 const char *name;
41 int has_arg;
42 int *flag;
43 int val;
46 #define no_argument 0
47 #define required_argument 1
48 #define optional_argument 2
50 extern int getopt(int, // __argc
51 char *const *, // __argv
52 const char *) // __shortopts
53 throw();
54 extern int getopt_long(int, // __argc
55 char *const *, // __argv
56 const char *, // __shortopts
57 const struct option *, // __longopts
58 int *) // __longind
59 throw();
60 extern int getopt_long_only(int, // __argc
61 char *const *, // __argv
62 const char *, // __shortopts
63 const struct option *, // __longopts
64 int *) // __longind
65 throw();
67 #ifdef __cplusplus
69 #endif
71 #endif /* _GROFF_GETOPT_H */