]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/llvm/tools/lldb/tools/driver/GetOptWrapper.h
MFC r265157: kldxref: Clean up error reporting
[FreeBSD/stable/10.git] / contrib / llvm / tools / lldb / tools / driver / GetOptWrapper.h
1 //===-- GetOptWrapper.h -----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef lldb_GetOptWrapper_h_
11 #define lldb_GetOptWrapper_h_
12
13 // from getopt.h
14 #define no_argument       0
15 #define required_argument 1
16 #define optional_argument 2
17
18 // defined int unistd.h
19 extern int   optreset;
20
21 // from getopt.h
22 extern char *optarg;
23 extern int   optind;
24 extern int   opterr;
25 extern int   optopt;
26
27 // option structure
28 struct option
29 {
30     const char *name;
31     // has_arg can't be an enum because some compilers complain about
32     // type mismatches in all the code that assumes it is an int.
33     int  has_arg;
34     int *flag;
35     int  val;
36 };
37
38 // 
39 extern int
40 getopt_long_only
41 (
42     int                  ___argc,
43     char *const         *___argv,
44     const char          *__shortopts,
45     const struct option *__longopts,
46     int                 *__longind
47 );
48
49 #endif // lldb_GetOptWrapper_h_