OpenTTD Source
1.11.0-beta2
|
Go to the source code of this file.
Data Structures | |
struct | OptionData |
Data of an option. More... | |
struct | GetOptData |
Data storage for parsing command line options. More... | |
Macros | |
#define | GETOPT_GENERAL(id, shortname, longname, flags) { id, shortname, flags, longname } |
General macro for creating an option. More... | |
#define | GETOPT_NOVAL(shortname, longname) GETOPT_GENERAL(shortname, shortname, longname, ODF_NO_VALUE) |
Short option without value. More... | |
#define | GETOPT_VALUE(shortname, longname) GETOPT_GENERAL(shortname, shortname, longname, ODF_HAS_VALUE) |
Short option with value. More... | |
#define | GETOPT_OPTVAL(shortname, longname) GETOPT_GENERAL(shortname, shortname, longname, ODF_OPTIONAL_VALUE) |
Short option with optional value. More... | |
#define | GETOPT_SHORT_NOVAL(shortname) GETOPT_NOVAL(shortname, nullptr) |
Short option without value. More... | |
#define | GETOPT_SHORT_VALUE(shortname) GETOPT_VALUE(shortname, nullptr) |
Short option with value. More... | |
#define | GETOPT_SHORT_OPTVAL(shortname) GETOPT_OPTVAL(shortname, nullptr) |
Short option with optional value. More... | |
#define | GETOPT_END() { '\0', '\0', ODF_END, nullptr} |
Option terminator. | |
Enumerations | |
enum | OptionDataFlags { ODF_NO_VALUE, ODF_HAS_VALUE, ODF_OPTIONAL_VALUE, ODF_END } |
Flags of an option. More... | |
Library for parsing command-line options.
Definition in file getoptdata.h.
#define GETOPT_GENERAL | ( | id, | |
shortname, | |||
longname, | |||
flags | |||
) | { id, shortname, flags, longname } |
General macro for creating an option.
id | Identification of the option. |
shortname | Short option name. Use '\0' if not used. |
longname | Long option name including leading '-' or '–'. Use nullptr if not used. |
flags | Flags of the option. |
Definition at line 62 of file getoptdata.h.
#define GETOPT_NOVAL | ( | shortname, | |
longname | |||
) | GETOPT_GENERAL(shortname, shortname, longname, ODF_NO_VALUE) |
Short option without value.
shortname | Short option name. Use '\0' if not used. |
longname | Long option name including leading '-' or '–'. Use nullptr if not used. |
Definition at line 69 of file getoptdata.h.
#define GETOPT_OPTVAL | ( | shortname, | |
longname | |||
) | GETOPT_GENERAL(shortname, shortname, longname, ODF_OPTIONAL_VALUE) |
Short option with optional value.
shortname | Short option name. Use '\0' if not used. |
longname | Long option name including leading '-' or '–'. Use nullptr if not used. |
Definition at line 84 of file getoptdata.h.
#define GETOPT_SHORT_NOVAL | ( | shortname | ) | GETOPT_NOVAL(shortname, nullptr) |
Short option without value.
shortname | Short option name. Use '\0' if not used. |
Definition at line 91 of file getoptdata.h.
#define GETOPT_SHORT_OPTVAL | ( | shortname | ) | GETOPT_OPTVAL(shortname, nullptr) |
Short option with optional value.
shortname | Short option name. Use '\0' if not used. |
Definition at line 104 of file getoptdata.h.
#define GETOPT_SHORT_VALUE | ( | shortname | ) | GETOPT_VALUE(shortname, nullptr) |
Short option with value.
shortname | Short option name. Use '\0' if not used. |
Definition at line 97 of file getoptdata.h.
#define GETOPT_VALUE | ( | shortname, | |
longname | |||
) | GETOPT_GENERAL(shortname, shortname, longname, ODF_HAS_VALUE) |
Short option with value.
shortname | Short option name. Use '\0' if not used. |
longname | Long option name including leading '-' or '–'. Use nullptr if not used. |
Definition at line 76 of file getoptdata.h.
enum OptionDataFlags |
Flags of an option.
Definition at line 14 of file getoptdata.h.