MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_options.h File Reference

MRTKLIB Options Module — Configuration option parsing and system option management. More...

#include "mrtklib/mrtk_opt.h"
Include dependency graph for mrtk_options.h:
This graph shows which files directly or indirectly include this file:

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.

Detailed Description

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.

Note
Functions declared here are implemented in mrtk_options.c.

Definition in file mrtk_options.h.

Function Documentation

◆ getsysopts()

void getsysopts ( prcopt_t * popt,
solopt_t * sopt,
filopt_t * fopt )

Get system options.

Parameters
[out]poptProcessing options (NULL: no output)
[out]soptSolution options (NULL: no output)
[out]foptFile options (NULL: no output)

Definition at line 738 of file mrtk_options.c.

References buff2sysopts(), filopt_, prcopt_, solopt_, and trace().

Here is the call graph for this function:

◆ loadopts()

int loadopts ( const char * file,
opt_t * opts )

Load options from file.

Parameters
[in]fileOptions file
[in,out]optsOptions table (terminated with name="")
Returns
Status (1:ok, 0:error)

Definition at line 464 of file mrtk_options.c.

References chop(), loadopts_toml(), searchopt(), str2opt(), and trace().

Here is the call graph for this function:

◆ opt2buf()

int opt2buf ( const opt_t * opt,
char * buff )

Convert option to string (keyword=value # comment).

Parameters
[in]optOption
[out]buffOption string
Returns
Length of output string

Definition at line 441 of file mrtk_options.c.

References opt_t::comment, opt_t::name, opt2str(), and trace().

Referenced by saveopts().

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

◆ opt2str()

int opt2str ( const opt_t * opt,
char * str )

Convert option value to string.

Parameters
[in]optOption
[out]strOption value string
Returns
Length of output 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().

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

◆ resetsysopts()

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().

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

◆ saveopts()

int saveopts ( const char * file,
const char * mode,
const char * comment,
const opt_t * opts )

Save options to file.

Parameters
[in]fileOptions file
[in]modeWrite mode ("w":overwrite, "a":append; append is not supported for a .toml file and returns 0)
[in]commentHeader comment (NULL: no comment)
[in]optsOptions table (terminated with name="")
Returns
Status (1:ok, 0:error)

Definition at line 523 of file mrtk_options.c.

References opt_t::name, opt2buf(), saveopts_toml(), and trace().

Here is the call graph for this function:

◆ searchopt()

opt_t * searchopt ( const char * name,
const opt_t * opts )

Search option record.

Parameters
[in]nameOption name
[in]optsOptions table (terminated with name="")
Returns
Option record (NULL: not found)

Definition at line 364 of file mrtk_options.c.

References opt_t::name, and trace().

Referenced by loadopts(), loadopts_toml(), and saveopts_toml().

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

◆ setsysopts()

void setsysopts ( const prcopt_t * prcopt,
const solopt_t * solopt,
const filopt_t * filopt )

Set system options.

Parameters
[in]prcoptProcessing options (NULL: default)
[in]soloptSolution options (NULL: default)
[in]filoptFile options (NULL: default)

Definition at line 760 of file mrtk_options.c.

References filopt_, prcopt_, resetsysopts(), solopt_, sysopts2buff(), and trace().

Here is the call graph for this function:

◆ str2opt()

int str2opt ( opt_t * opt,
const char * str )

Convert string to option value.

Parameters
[out]optOption
[in]strOption value string
Returns
Status (1:ok, 0:error)

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().

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

Variable Documentation

◆ sysopts

opt_t sysopts[]
extern

System options table.

Note
Terminated with an entry where name[0]=='\0'.

Definition at line 90 of file mrtk_options.c.