|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
MRTKLIB Options Module — Configuration option parsing and system option management. More...
#include "mrtklib/mrtk_opt.h"Go to the source code of this file.
Classes | |
| struct | opt_t |
| Option type for configuration file parsing. More... | |
Functions | |
| opt_t * | searchopt (const char *name, const opt_t *opts) |
| Search option record. | |
| int | str2opt (opt_t *opt, const char *str) |
| Convert string to option value. | |
| int | opt2str (const opt_t *opt, char *str) |
| Convert option value to string. | |
| int | opt2buf (const opt_t *opt, char *buff) |
| Convert option to string (keyword=value # comment). | |
| int | loadopts (const char *file, opt_t *opts) |
| Load options from file. | |
| int | saveopts (const char *file, const char *mode, const char *comment, const opt_t *opts) |
| Save options to file. | |
| void | resetsysopts (void) |
| Reset system options to default. | |
| void | getsysopts (prcopt_t *popt, solopt_t *sopt, filopt_t *fopt) |
| Get system options. | |
| void | setsysopts (const prcopt_t *prcopt, const solopt_t *solopt, const filopt_t *filopt) |
| Set system options. | |
Variables | |
| opt_t | sysopts [] |
| System options table. | |
MRTKLIB Options Module — Configuration option parsing and system option management.
This header provides the opt_t type for option table entries, functions for loading/saving/converting options, and the system options interface (sysopts, getsysopts, setsysopts, resetsysopts). Extracted from the legacy options.c / rtklib.h with zero algorithmic changes.
Definition in file mrtk_options.h.
Get system options.
| [out] | popt | Processing options (NULL: no output) |
| [out] | sopt | Solution options (NULL: no output) |
| [out] | fopt | File options (NULL: no output) |
Definition at line 738 of file mrtk_options.c.
References buff2sysopts(), filopt_, prcopt_, solopt_, and trace().
| int loadopts | ( | const char * | file, |
| opt_t * | opts ) |
Load options from file.
| [in] | file | Options file |
| [in,out] | opts | Options table (terminated with name="") |
Definition at line 464 of file mrtk_options.c.
References chop(), loadopts_toml(), searchopt(), str2opt(), and trace().
| int opt2buf | ( | const opt_t * | opt, |
| char * | buff ) |
Convert option to string (keyword=value # comment).
| [in] | opt | Option |
| [out] | buff | Option string |
Definition at line 441 of file mrtk_options.c.
References opt_t::comment, opt_t::name, opt2str(), and trace().
Referenced by saveopts().
| int opt2str | ( | const opt_t * | opt, |
| char * | str ) |
Convert option value to string.
| [in] | opt | Option |
| [out] | str | Option value string |
Definition at line 414 of file mrtk_options.c.
References opt_t::comment, enum2str(), opt_t::format, opt_t::name, trace(), and opt_t::var.
Referenced by opt2buf(), and saveopts_toml().
| void resetsysopts | ( | void | ) |
Reset system options to default.
Definition at line 700 of file mrtk_options.c.
References antpos_, antpostype_, bds2prn_given_, elmask_, elmaskar_, elmaskhold_, exsats_, filopt_, prcopt_, prcopt_default, signals_, solopt_, solopt_default, and trace().
Referenced by setsysopts().
| int saveopts | ( | const char * | file, |
| const char * | mode, | ||
| const char * | comment, | ||
| const opt_t * | opts ) |
Save options to file.
| [in] | file | Options file |
| [in] | mode | Write mode ("w":overwrite, "a":append; append is not supported for a .toml file and returns 0) |
| [in] | comment | Header comment (NULL: no comment) |
| [in] | opts | Options table (terminated with name="") |
Definition at line 523 of file mrtk_options.c.
References opt_t::name, opt2buf(), saveopts_toml(), and trace().
Search option record.
| [in] | name | Option name |
| [in] | opts | Options table (terminated with name="") |
Definition at line 364 of file mrtk_options.c.
References opt_t::name, and trace().
Referenced by loadopts(), loadopts_toml(), and saveopts_toml().
Set system options.
| [in] | prcopt | Processing options (NULL: default) |
| [in] | solopt | Solution options (NULL: default) |
| [in] | filopt | File options (NULL: default) |
Definition at line 760 of file mrtk_options.c.
References filopt_, prcopt_, resetsysopts(), solopt_, sysopts2buff(), and trace().
| int str2opt | ( | opt_t * | opt, |
| const char * | str ) |
Convert string to option value.
| [out] | opt | Option |
| [in] | str | Option value string |
Definition at line 382 of file mrtk_options.c.
References bds2prn_given_, opt_t::comment, opt_t::format, prcopt_, str2enum(), and opt_t::var.
Referenced by loadopts(), and loadopts_toml().
|
extern |
System options table.
Definition at line 90 of file mrtk_options.c.