golcconfig 9.0
Loading...
Searching...
No Matches
Functions
LcConfigC_Set_C_API

various functions to set the configuration of the LcConfigCMore...

+ Collaboration diagram for LcConfigC_Set_C_API:

Functions

LC_EXTERN void LcConfigSetDefaultFormatP (LC_CFG config, enum LcConfigFormatE format)
 Non-inline replacement for LcConfigSetDefaultFormat
 
LC_EXTERN void LcConfigSetFloatPrecisionP (LC_CFG config, MK_SRT digits)
 Non-inline replacement for LcConfigSetFloatPrecision
 
LC_EXTERN void LcConfigSetIncludeDirP (LC_CFG config, MK_STRN include_dir)
 Non-inline replacement for LcConfigSetIncludeDir
 
LC_EXTERN void LcConfigSetOptionP (LC_CFG config, enum LcConfigOptionsEF option, MK_BOOL flag)
 Non-inline replacement for LcConfigSetOption
 
LC_EXTERN void LcConfigSetOptionsP (LC_CFG config, enum LcConfigOptionsEF options)
 Non-inline replacement for LcConfigSetOptions
 
LC_EXTERN void LcConfigSetTabWidthP (LC_CFG config, MK_SRT width)
 Non-inline replacement for LcConfigSetTabWidth
 
void LcConfigSetDefaultFormat (LC_CFG config, enum LcConfigFormatE format)
 These functions, which are implemented as macros, get and set the default external format for settings in the configuration config
 
void LcConfigSetFloatPrecision (LC_CFG config, MK_SRT digits)
 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 …
 
void LcConfigSetIncludeDir (LC_CFG config, MK_STRN include_dir)
 ConfigSetIncludeDir specifies the include directory, include_dir, relative to which the files specified in '@include' directives will be located for the configuration config
 
void LcConfigSetOption (LC_CFG config, enum LcConfigOptionsEF option, MK_BOOL flag)
 Since v1.7 These functions get and set the given option of the configuration config
 
void LcConfigSetOptions (LC_CFG config, enum LcConfigOptionsEF options)
 These functions get and set the options for the configuration config
 
void LcConfigSetTabWidth (LC_CFG config, MK_SRT width)
 These functions, which are implemented as macros, get and set the tab width for the configuration config
 

Overload

#define LcConfigSetIncludeFunc(...)   LcConfigSetIncludeFunc_RT(MK_RT_CALL __VA_ARGS__)
 
#define LcConfigSetIncludeFunc_E(...)   MkErrorCheck(LcConfigSetIncludeFunc(__VA_ARGS__))
 
#define LcConfigSetIncludeFunc_C(...)   if (MkErrorCheckI(LcConfigSetIncludeFunc(__VA_ARGS__)))
 
#define LcConfigSetSettingDeleteFunc(...)   LcConfigSetSettingDeleteFunc_RT(MK_RT_CALL __VA_ARGS__)
 
#define LcConfigSetSettingDeleteFunc_E(...)   MkErrorCheck(LcConfigSetSettingDeleteFunc(__VA_ARGS__))
 
#define LcConfigSetSettingDeleteFunc_C(...)   if (MkErrorCheckI(LcConfigSetSettingDeleteFunc(__VA_ARGS__)))
 

Detailed Description

various functions to set the configuration of the LcConfigC

Macro Definition Documentation

◆ LcConfigSetIncludeFunc

#define LcConfigSetIncludeFunc (   ...)    LcConfigSetIncludeFunc_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 77 of file config_overload_lc.h.

◆ LcConfigSetIncludeFunc_C

#define LcConfigSetIncludeFunc_C (   ...)    if (MkErrorCheckI(LcConfigSetIncludeFunc(__VA_ARGS__)))

Definition at line 79 of file config_overload_lc.h.

◆ LcConfigSetIncludeFunc_E

#define LcConfigSetIncludeFunc_E (   ...)    MkErrorCheck(LcConfigSetIncludeFunc(__VA_ARGS__))

Definition at line 78 of file config_overload_lc.h.

◆ LcConfigSetSettingDeleteFunc

#define LcConfigSetSettingDeleteFunc (   ...)    LcConfigSetSettingDeleteFunc_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 80 of file config_overload_lc.h.

◆ LcConfigSetSettingDeleteFunc_C

#define LcConfigSetSettingDeleteFunc_C (   ...)    if (MkErrorCheckI(LcConfigSetSettingDeleteFunc(__VA_ARGS__)))

Definition at line 82 of file config_overload_lc.h.

◆ LcConfigSetSettingDeleteFunc_E

#define LcConfigSetSettingDeleteFunc_E (   ...)    MkErrorCheck(LcConfigSetSettingDeleteFunc(__VA_ARGS__))

Definition at line 81 of file config_overload_lc.h.

Function Documentation

◆ LcConfigSetDefaultFormat()

mk_inline void LcConfigSetDefaultFormat ( LC_CFG  config,
enum LcConfigFormatE  format 
)
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
ConfigGetDefaultFormat

Definition at line 551 of file LcConfigC_lc.h.

◆ LcConfigSetDefaultFormatP()

LC_EXTERN void LcConfigSetDefaultFormatP ( LC_CFG  config,
enum LcConfigFormatE  format 
)

Non-inline replacement for LcConfigSetDefaultFormat

◆ LcConfigSetFloatPrecision()

mk_inline void LcConfigSetFloatPrecision ( LC_CFG  config,
MK_SRT  digits 
)
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
ConfigGetFloatPrecision

Definition at line 556 of file LcConfigC_lc.h.

◆ LcConfigSetFloatPrecisionP()

LC_EXTERN void LcConfigSetFloatPrecisionP ( LC_CFG  config,
MK_SRT  digits 
)

Non-inline replacement for LcConfigSetFloatPrecision

◆ LcConfigSetIncludeDir()

mk_inline void LcConfigSetIncludeDir ( LC_CFG  config,
MK_STRN  include_dir 
)
inline

ConfigSetIncludeDir 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.

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

See also
ConfigGetIncludeDir

Definition at line 561 of file LcConfigC_lc.h.

◆ LcConfigSetIncludeDirP()

LC_EXTERN void LcConfigSetIncludeDirP ( LC_CFG  config,
MK_STRN  include_dir 
)

Non-inline replacement for LcConfigSetIncludeDir

◆ LcConfigSetOption()

mk_inline void LcConfigSetOption ( LC_CFG  config,
enum LcConfigOptionsEF  option,
MK_BOOL  flag 
)
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 ConfigSetOptions above for the list of available options.

See also
ConfigGetOption

Definition at line 566 of file LcConfigC_lc.h.

◆ LcConfigSetOptionP()

LC_EXTERN void LcConfigSetOptionP ( LC_CFG  config,
enum LcConfigOptionsEF  option,
MK_BOOL  flag 
)

Non-inline replacement for LcConfigSetOption

◆ LcConfigSetOptions()

mk_inline void LcConfigSetOptions ( LC_CFG  config,
enum LcConfigOptionsEF  options 
)
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 ConfigWriteFile 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
ConfigGetOptions

Definition at line 571 of file LcConfigC_lc.h.

◆ LcConfigSetOptionsP()

LC_EXTERN void LcConfigSetOptionsP ( LC_CFG  config,
enum LcConfigOptionsEF  options 
)

Non-inline replacement for LcConfigSetOptions

◆ LcConfigSetTabWidth()

mk_inline void LcConfigSetTabWidth ( LC_CFG  config,
MK_SRT  width 
)
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
ConfigGetTabWidth

Definition at line 576 of file LcConfigC_lc.h.

◆ LcConfigSetTabWidthP()

LC_EXTERN void LcConfigSetTabWidthP ( LC_CFG  config,
MK_SRT  width 
)

Non-inline replacement for LcConfigSetTabWidth