2 // fgcom_init.hxx -- FGCOM configuration parsing and initialization
3 // FGCOM: Copyright (C) H. Wirtz <wirtz@dfn.de>
5 // Adaption of fg_init.h from FlightGear
6 // FlightGear: Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
8 // Huge part rewritten by Tobias Ramforth to fit needs of FGCOM.
9 // <tobias@ramforth.com>
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License as
14 // published by the Free Software Foundation; either version 2 of the
15 // License, or (at your option) any later version.
17 // This program is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 // General Public License for more details.
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
33 FGCOM_OPTIONS_HELP = 1,
34 FGCOM_OPTIONS_ERROR = 2,
35 FGCOM_OPTIONS_EXIT = 3,
36 FGCOM_OPTIONS_VERBOSE_HELP = 4
40 option has_param type property b_param s_param func
43 option : name of the option
44 has_param : option is --name=value if true or --name if false
45 type : OPTION_BOOL - property is a boolean
46 OPTION_STRING - property is a string
47 OPTION_FLOAT - property is a float
48 OPTION_DOUBLE - property is a double
49 OPTION_FREQ - property is a double and stands for a frequency
50 OPTION_INT - property is an integer
51 OPTION_INT - property is a char
53 For OPTION_FLOAT, OPTION_DOUBLE and OPTION_INT, the parameter value is converted into a
54 float, double or an integer and set to the property.
68 typedef struct _OptionEntry OptionEntry;
72 const char *long_option;
78 const char *description;
79 const void *default_value;
82 // Read in configuration (file and command line)
83 bool fgcomInitOptions (const OptionEntry * fgcomOptions, int argc, char **argv);
84 void fgcomUsage (); // fgcom usage