llvm-project/lldb/tools/driver/GetOptWrapper.h
Deepak Panickal 429222c1f6 Patch enabling lldb command line driver to run on windows.
CHANGES:
- Thread locking switched from pthreads to C++11 standard library.
- Abstracted platform specific header includes into 'platform.h'.
- Create editline emulator for windows.
- Emulated various platform dependant functions on windows.
TODO:
- User input currently handled by gets_s(), work started on better handler:
    see _WIP_INPUT_METHOD define blocks in 'ELWrapper.cpp'.
    Aim is to handle 'tab' auto completion on windows.
- Tidy up 'getopt.inc' from lldbHostCommon to serve as LLDB Drivers getopt windows implementation.

llvm-svn: 192714
2013-10-15 15:46:40 +00:00

49 lines
1.1 KiB
C++

//===-- GetOptWrapper.h -----------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef lldb_GetOptWrapper_h_
#define lldb_GetOptWrapper_h_
// from getopt.h
#define no_argument 0
#define required_argument 1
#define optional_argument 2
// defined int unistd.h
extern int optreset;
// from getopt.h
extern char *optarg;
extern int optind;
extern int opterr;
extern int optopt;
// option structure
struct option
{
const char *name;
// has_arg can't be an enum because some compilers complain about
// type mismatches in all the code that assumes it is an int.
int has_arg;
int *flag;
int val;
};
//
extern int
getopt_long_only
(
int ___argc,
char *const *___argv,
const char *__shortopts,
const struct option *__longopts,
int *__longind
);
#endif // lldb_GetOptWrapper_h_