MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_toml.h
Go to the documentation of this file.
1/*------------------------------------------------------------------------------
2 * mrtk_toml.h : TOML configuration file loader for MRTKLIB
3 *
4 * Copyright (C) 2026 H.SHIONO (MRTKLIB Project)
5 *
6 * SPDX-License-Identifier: BSD-2-Clause
7 *----------------------------------------------------------------------------*/
8#ifndef MRTK_TOML_H
9#define MRTK_TOML_H
10
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17/**
18 * @brief Load options from a TOML configuration file.
19 * @param[in] file Path to the TOML file.
20 * @param[out] opts Options table (sysopts[]-compatible, terminated by empty name).
21 * @return 1 on success, 0 on error.
22 *
23 * Reads a TOML file and maps semantic section.key paths to legacy option names
24 * in the opts table. Unknown TOML keys are silently skipped.
25 */
26extern int loadopts_toml(const char* file, opt_t* opts);
27
28/**
29 * @brief Save options to a TOML configuration file.
30 * @param[in] file Path to the output TOML file.
31 * @param[in] comment Header comment (NULL for none).
32 * @param[in] opts Options table (terminated by empty name).
33 * @return 1 on success, 0 on error.
34 */
35extern int saveopts_toml(const char* file, const char* comment, const opt_t* opts);
36
37#ifdef __cplusplus
38}
39#endif
40
41#endif /* MRTK_TOML_H */
MRTKLIB Options Module — Configuration option parsing and system option management.
int loadopts_toml(const char *file, opt_t *opts)
Load options from a TOML configuration file.
Definition mrtk_toml.c:608
int saveopts_toml(const char *file, const char *comment, const opt_t *opts)
Save options to a TOML configuration file.
Definition mrtk_toml.c:785
Option type for configuration file parsing.