theConfig 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - py - rb - jv - cc
Loading...
Searching...
No Matches
LcConfigC_Get_C_API

LcConfigC - various functions to get config-dataMore...

+ Collaboration diagram for LcConfigC_Get_C_API:

Functions

MK_PTR LcConfigGetIncludeFunc (LC_CFG const cfg)
 return the callback-name for the include-config-file
 
MK_PTR LcConfigGetSettingDeleteFunc (LC_CFG const cfg)
 get the __parser__(callback-name) for setting-delete
 
enum LcConfigFormatE LcConfigGetDefaultFormat (LC_CFGN config)
 These functions, which are implemented as macros, get and set the default external format for settings in the configuration config
 
MK_I16 LcConfigGetFloatPrecision (LC_CFGN config)
 Since v1.6 These functions get and set the number of decimal digits to output after the radix character when writing the configuration to a file or stream …
 
MK_STRN LcConfigGetIncludeDir (LC_CFGN config)
 config_set_include_dir specifies the include directory, include_dir, relative to which the files specified in '@include' directives will be located for the configuration config
 
MK_BOOL LcConfigGetOption (LC_CFGN config, enum LcConfigOptionsEF option)
 Since v1.7 These functions get and set the given option of the configuration config
 
enum LcConfigOptionsEF LcConfigGetOptions (LC_CFGN config)
 These functions get and set the options for the configuration config
 
MK_I16 LcConfigGetTabWidth (LC_CFGN config)
 These functions, which are implemented as macros, get and set the tab width for the configuration config
 

LcConfigC - LcConfigC_Get_C_API - function

enum LcConfigFormatE LcConfigGetDefaultFormatP (LC_CFGN config)
 Non-inline replacement for LcConfigGetDefaultFormat
 
MK_I16 LcConfigGetFloatPrecisionP (LC_CFGN config)
 Non-inline replacement for LcConfigGetFloatPrecision
 
MK_STRN LcConfigGetIncludeDirP (LC_CFGN config)
 Non-inline replacement for LcConfigGetIncludeDir
 
MK_PTR LcConfigGetIncludeFuncP (LC_CFG const cfg)
 Non-inline replacement for LcConfigGetIncludeFunc
 
MK_BOOL LcConfigGetOptionP (LC_CFGN config, enum LcConfigOptionsEF option)
 Non-inline replacement for LcConfigGetOption
 
enum LcConfigOptionsEF LcConfigGetOptionsP (LC_CFGN config)
 Non-inline replacement for LcConfigGetOptions
 
MK_PTR LcConfigGetSettingDeleteFuncP (LC_CFG const cfg)
 Non-inline replacement for LcConfigGetSettingDeleteFunc
 
MK_I16 LcConfigGetTabWidthP (LC_CFGN config)
 Non-inline replacement for LcConfigGetTabWidth
 

Detailed Description

LcConfigC - various functions to get config-data

Function Documentation

◆ LcConfigGetDefaultFormat()

enum LcConfigFormatE LcConfigGetDefaultFormat ( LC_CFGN config)
inline

These functions, which are implemented as macros, get and set the default external format for settings in the configuration config

If a non-default format has not been set for a setting with config_setting_set_format, this configuration-wide default format will be used instead when that setting is written to a file or stream.

See also
config_set_default_format

Definition at line 234 of file LcConfigC_lc.h.

234 {
235 LC_INSTANCE_HDL(config);
236 return (enum LcConfigFormatE)config_get_default_format(config->nat);
237 }
LcConfigFormatE
set the format of a LcSettingC …
Definition LcEnum_lc.h:47
#define LC_INSTANCE_HDL(x)
#define config_get_default_format(C)
config_t * nat
internal - link between LcConfigS and native library
+ Here is the caller graph for this function:

◆ LcConfigGetDefaultFormatP()

enum LcConfigFormatE LcConfigGetDefaultFormatP ( LC_CFGN config)
extern

Non-inline replacement for LcConfigGetDefaultFormat

◆ LcConfigGetFloatPrecision()

MK_I16 LcConfigGetFloatPrecision ( LC_CFGN config)
inline

Since v1.6 These functions get and set the number of decimal digits to output after the radix character when writing the configuration to a file or stream …

Valid values for digits range from 0 (no decimals) to about 15 (implementation defined). This parameter has no effect on parsing.

The default float precision is 6.

See also
config_set_float_precision

Definition at line 240 of file LcConfigC_lc.h.

240 {
241 LC_INSTANCE_HDL(config);
242 return (MK_I16)config_get_float_precision(config->nat);
243 }
signed short int MK_I16
LIBCONFIG_API unsigned short config_get_float_precision(const config_t *config)
+ Here is the caller graph for this function:

◆ LcConfigGetFloatPrecisionP()

MK_I16 LcConfigGetFloatPrecisionP ( LC_CFGN config)
extern

Non-inline replacement for LcConfigGetFloatPrecision

◆ LcConfigGetIncludeDir()

MK_STRN LcConfigGetIncludeDir ( LC_CFGN config)
inline

config_set_include_dir specifies the include directory, include_dir, relative to which the files specified in '@include' directives will be located for the configuration config

By default, there is no include directory, and all include files are expected to be relative to the current working directory. If include_dir is NULL, the default behavior is reinstated.

For example, if the include directory is set to /usr/local/etc, the include directive '@include "configs/extra.cfg"' would include the file /usr/local/etc/configs/extra.cfg.

config_get_include_dir returns the current include directory for the configuration config, or NULL if none is set.

See also
config_set_include_dir

Definition at line 246 of file LcConfigC_lc.h.

246 {
247 LC_INSTANCE_HDL(config);
248 MK_STRN __retVal__L = config_get_include_dir(config->nat);
249 return __retVal__L;
250 }
const MK_STRB * MK_STRN
#define config_get_include_dir(C)
+ Here is the caller graph for this function:

◆ LcConfigGetIncludeDirP()

MK_STRN LcConfigGetIncludeDirP ( LC_CFGN config)
extern

Non-inline replacement for LcConfigGetIncludeDir

◆ LcConfigGetIncludeFunc()

MK_PTR LcConfigGetIncludeFunc ( LC_CFG const cfg)
inline

return the callback-name for the include-config-file

See also
LcConfigSetIncludeFunc

Definition at line 127 of file LcConfigC_lc.h.

129 {
130 return cfg ? cfg->fConfigIncludeData : NULL;
131}

◆ LcConfigGetIncludeFuncP()

MK_PTR LcConfigGetIncludeFuncP ( LC_CFG const cfg)
extern

Non-inline replacement for LcConfigGetIncludeFunc

◆ LcConfigGetOption()

MK_BOOL LcConfigGetOption ( LC_CFGN config,
enum LcConfigOptionsEF option )
inline

Since v1.7 These functions get and set the given option of the configuration config

The option is enabled if flag is CONFIG_TRUE and disabled if it is CONFIG_FALSE.

See config_set_options above for the list of available options.

See also
config_set_option

Definition at line 253 of file LcConfigC_lc.h.

253 {
254 LC_INSTANCE_HDL(config);
255 return (MK_BOOL)config_get_option(config->nat, option);
256 }
bool MK_BOOL
LIBCONFIG_API int config_get_option(const config_t *config, int option)
+ Here is the caller graph for this function:

◆ LcConfigGetOptionP()

MK_BOOL LcConfigGetOptionP ( LC_CFGN config,
enum LcConfigOptionsEF option )
extern

Non-inline replacement for LcConfigGetOption

◆ LcConfigGetOptions()

enum LcConfigOptionsEF LcConfigGetOptions ( LC_CFGN config)
inline

These functions get and set the options for the configuration config

The options affect how configurations are read and written. The following options are defined:

CONFIG_OPTION_AUTOCONVERT

Turning this option on enables number auto-conversion for the configuration. When this feature is enabled, an attempt to retrieve a floating point setting's value into an integer (or vice versa), or store an integer to a floating point setting's value (or vice versa) will cause the library to silently perform the necessary conversion (possibly leading to loss of data), rather than reporting failure. By default this option is turned off.

CONFIG_OPTION_SEMICOLON_SEPARATORS

This option controls whether a semicolon (';') is output after each setting when the configuration is written to a file or stream. (The semicolon separators are optional in the configuration syntax.) By default this option is turned on.

CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS

This option controls whether a colon (':') is output between each group setting's name and its value when the configuration is written to a file or stream. If the option is turned off, an equals sign ('=') is output instead. (These tokens are interchangeable in the configuration syntax.) By default this option is turned on.

CONFIG_OPTION_COLON_ASSIGNMENT_FOR_NON_GROUPS

This option controls whether a colon (':') is output between each non-group setting's name and its value when the configuration is written to a file or stream. If the option is turned off, an equals sign ('=') is output instead. (These tokens are interchangeable in the configuration syntax.) By default this option is turned off.

CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE

This option controls whether an open brace ('{') will be written on its own line when the configuration is written to a file or stream. If the option is turned off, the brace will be written at the end of the previous line. By default this option is turned on.

CONFIG_OPTION_ALLOW_SCIENTIFIC_NOTATION

(Since v1.7) This option controls whether scientific notation may be used as appropriate when writing floating point values (corresponding to printf 'g' format) or should never be used (corresponding to printf 'f' format). By default this option is turned off.

CONFIG_OPTION_FSYNC

(Since v1.7.1) This option controls whether the config_write_file function performs an fsync operation after writing the configuration and before closing the file. By default this option is turned off.

CONFIG_OPTION_ALLOW_OVERRIDES

(Since v1.7.3) This option controls whether duplicate settings override previous settings with the same name. If this option is turned off, duplicate settings are rejected. By default this option is turned off.

See also
config_set_options

Definition at line 259 of file LcConfigC_lc.h.

259 {
260 LC_INSTANCE_HDL(config);
261 return (enum LcConfigOptionsEF)config_get_options(config->nat);
262 }
LcConfigOptionsEF
define the configuration-option of a LcConfigC …
Definition LcEnum_lc.h:151
LIBCONFIG_API int config_get_options(const config_t *config)
+ Here is the caller graph for this function:

◆ LcConfigGetOptionsP()

enum LcConfigOptionsEF LcConfigGetOptionsP ( LC_CFGN config)
extern

Non-inline replacement for LcConfigGetOptions

◆ LcConfigGetSettingDeleteFunc()

MK_PTR LcConfigGetSettingDeleteFunc ( LC_CFG const cfg)
inline

get the __parser__(callback-name) for setting-delete

See also
LcConfigSetSettingDeleteFunc

config_setting_get_hook documentation

These functions make it possible to attach arbitrary data to each setting structure, for instance a ''wrapper'' or ''peer'' object written in another programming language …

The destructor function, if one has been supplied via a call to config_set_destructor, will be called by the library to dispose of this data when the setting itself is destroyed. There is no default destructor.

See also
config_setting_set_hook

Definition at line 167 of file LcConfigC_lc.h.

169 {
170 return cfg ? cfg->fSettingDeleteData : NULL;
171}

◆ LcConfigGetSettingDeleteFuncP()

MK_PTR LcConfigGetSettingDeleteFuncP ( LC_CFG const cfg)
extern

Non-inline replacement for LcConfigGetSettingDeleteFunc

◆ LcConfigGetTabWidth()

MK_I16 LcConfigGetTabWidth ( LC_CFGN config)
inline

These functions, which are implemented as macros, get and set the tab width for the configuration config

The tab width affects the formatting of the configuration when it is written to a file or stream: each level of nesting is indented by width spaces, or by a single tab character if width is 0. The tab width has no effect on parsing.

Valid tab widths range from 0 to 15. The default tab width is 2.

See also
config_set_tab_width

Definition at line 265 of file LcConfigC_lc.h.

265 {
266 LC_INSTANCE_HDL(config);
267 return (MK_I16)config_get_tab_width(config->nat);
268 }
LIBCONFIG_API unsigned short config_get_tab_width(const config_t *config)
+ Here is the caller graph for this function:

◆ LcConfigGetTabWidthP()

MK_I16 LcConfigGetTabWidthP ( LC_CFGN config)
extern

Non-inline replacement for LcConfigGetTabWidth