MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_toml.h File Reference
Include dependency graph for mrtk_toml.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int loadopts_toml (const char *file, opt_t *opts)
 Load options from a TOML configuration file.
int saveopts_toml (const char *file, const char *comment, const opt_t *opts)
 Save options to a TOML configuration file.

Function Documentation

◆ loadopts_toml()

int loadopts_toml ( const char * file,
opt_t * opts )
extern

Load options from a TOML configuration file.

Parameters
[in]filePath to the TOML file.
[out]optsOptions table (sysopts[]-compatible, terminated by empty name).
Returns
1 on success, 0 on error.

Reads a TOML file and maps semantic section.key paths to legacy option names in the opts table. Unknown TOML keys are silently skipped.

Definition at line 608 of file mrtk_toml.c.

References check_unknown_keys(), free, toml_alias_t::legacy_name, toml_map_t::legacy_name, MAXSTRPATH, navigate_table(), navsys_str2mask(), toml_alias_t::new_key, toml_alias_t::new_section, toml_datum_t::ok, toml_alias_t::old_key, toml_alias_t::old_section, toml_datum_t::s, searchopt(), str2opt(), toml_alias, toml_array_in(), toml_array_nelem(), toml_free(), toml_map_t::toml_key, toml_key_exists(), toml_mapping, toml_parse_file(), toml_map_t::toml_section, toml_string_at(), toml_val_to_str(), trace(), toml_datum_t::u, and opt_t::var.

Referenced by loadopts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveopts_toml()

int saveopts_toml ( const char * file,
const char * comment,
const opt_t * opts )
extern

Save options to a TOML configuration file.

Parameters
[in]filePath to the output TOML file.
[in]commentHeader comment (NULL for none).
[in]optsOptions table (terminated by empty name).
Returns
1 on success, 0 on error.

Definition at line 785 of file mrtk_toml.c.

References opt_t::format, toml_map_t::legacy_name, opt2str(), searchopt(), toml_map_t::toml_key, toml_mapping, toml_map_t::toml_section, and trace().

Referenced by saveopts().

Here is the call graph for this function:
Here is the caller graph for this function: