* All affected files: Update postal address of FSF.
[s-roff.git] / src / include / groff-getopt.h
blobe438f8e278b6969cad718809dcef19859caff886
1 // -*- C++ -*-
2 /* Copyright (C) 2000, 2001 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, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, 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 extern int getopt_long(int, // __argc
54 char *const *, // __argv
55 const char *, // __shortopts
56 const struct option *, // __longopts
57 int *); // __longind
58 extern int getopt_long_only(int, // __argc
59 char *const *, // __argv
60 const char *, // __shortopts
61 const struct option *, // __longopts
62 int *); // __longind
64 #ifdef __cplusplus
66 #endif
68 #endif /* _GROFF_GETOPT_H */