|
OpenTTD
|
Library for parsing command-line options. More...
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. | |
| #define | GETOPT_NOVAL(shortname, longname) GETOPT_GENERAL(shortname, shortname, longname, ODF_NO_VALUE) |
| Short option without value. | |
| #define | GETOPT_VALUE(shortname, longname) GETOPT_GENERAL(shortname, shortname, longname, ODF_HAS_VALUE) |
| Short option with value. | |
| #define | GETOPT_OPTVAL(shortname, longname) GETOPT_GENERAL(shortname, shortname, longname, ODF_OPTIONAL_VALUE) |
| Short option with optional value. | |
| #define | GETOPT_SHORT_NOVAL(shortname) GETOPT_NOVAL(shortname, NULL) |
| Short option without value. | |
| #define | GETOPT_SHORT_VALUE(shortname) GETOPT_VALUE(shortname, NULL) |
| Short option with value. | |
| #define | GETOPT_SHORT_OPTVAL(shortname) GETOPT_OPTVAL(shortname, NULL) |
| Short option with optional value. | |
| #define | GETOPT_END() { '\0', '\0', ODF_END, NULL} |
| 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_END | ( | ) | { '\0', '\0', ODF_END, NULL} |
Option terminator.
Definition at line 109 of 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 NULL if not used. |
| flags | Flags of the option. |
Definition at line 64 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 NULL if not used. |
Definition at line 71 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 NULL if not used. |
Definition at line 86 of file getoptdata.h.
| #define GETOPT_SHORT_NOVAL | ( | shortname | ) | GETOPT_NOVAL(shortname, NULL) |
Short option without value.
| shortname | Short option name. Use '\0' if not used. |
Definition at line 93 of file getoptdata.h.
| #define GETOPT_SHORT_OPTVAL | ( | shortname | ) | GETOPT_OPTVAL(shortname, NULL) |
Short option with optional value.
| shortname | Short option name. Use '\0' if not used. |
Definition at line 106 of file getoptdata.h.
| #define GETOPT_SHORT_VALUE | ( | shortname | ) | GETOPT_VALUE(shortname, NULL) |
Short option with value.
| shortname | Short option name. Use '\0' if not used. |
Definition at line 99 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 NULL if not used. |
Definition at line 78 of file getoptdata.h.
| enum OptionDataFlags |
Flags of an option.
| ODF_NO_VALUE |
A plain option (no value attached to it). |
| ODF_HAS_VALUE |
An option with a value. |
| ODF_OPTIONAL_VALUE |
An option with an optional value. |
| ODF_END |
Terminator (data is not parsed further). |
Definition at line 16 of file getoptdata.h.
1.8.1.2