theConfig 10.0
Loading...
Searching...
No Matches
LcConfigC_Misc_C_API

LcConfigC - various functions to perform misc operations … More...

+ Collaboration diagram for LcConfigC_Misc_C_API:

Functions

enum MkErrorE LcConfigWriteString_RT (MK_RT mkrt, LC_CFGN const cfg, MK_STRN *val_out)
 read the entire configuration cfg into the string val_out
 
void LcConfigLog_RT (MK_RT mkrt, LC_CFGN const cfg, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
 log the config
 
static LC_CFS LcConfigRootSetting (LC_CFGN config)
 This function, which is implemented as a macro, returns the root setting for the configuration config
 
static void LcConfigClear (LC_CFG config)
 Since v1.7 This function clears the configuration config
 
static enum MkErrorE LcConfigReadFile (LC_CFG config, MK_STRN filename)
 This function reads and parses a configuration from the file named filename into the configuration object config
 
static enum MkErrorE LcConfigReadString (LC_CFG config, MK_STRN str)
 This function reads and parses a configuration from the string str into the configuration object config
 
static enum MkErrorE LcConfigWriteFile (LC_CFG config, MK_STRN filename)
 This function writes the configuration config to the file named filename
 

LcConfigC - LcConfigC_Misc_C_API - function

LC_CFS LcConfigRootSettingP (LC_CFGN config)
 Non-inline replacement for LcConfigRootSetting
 
void LcConfigClearP (LC_CFG config)
 Non-inline replacement for LcConfigClear
 
enum MkErrorE LcConfigReadFileP (LC_CFG config, MK_STRN filename)
 Non-inline replacement for LcConfigReadFile
 
enum MkErrorE LcConfigReadStringP (LC_CFG config, MK_STRN str)
 Non-inline replacement for LcConfigReadString
 
enum MkErrorE LcConfigWriteFileP (LC_CFG config, MK_STRN filename)
 Non-inline replacement for LcConfigWriteFile
 

LcConfigC - LcConfigC_Misc_C_API - overload

#define LcConfigLog_NULL(...)
 
#define LcConfigLog(...)
 
#define LcConfigLog_4(cfg, fmtobj, debug, callfunc)
 
#define LcConfigLog_3(cfg, fmtobj, debug)
 
#define LcConfigLog_2(cfg, fmtobj)
 
#define LcConfigLog_1(cfg)
 
#define LcConfigReadFile_E(...)
 
#define LcConfigReadFile_C(...)
 
#define LcConfigReadString_E(...)
 
#define LcConfigReadString_C(...)
 
#define LcConfigWriteFile_E(...)
 
#define LcConfigWriteFile_C(...)
 
#define LcConfigWriteString_NULL(...)
 
#define LcConfigWriteString(...)
 
#define LcConfigWriteString_E(...)
 
#define LcConfigWriteString_C(...)
 
#define LcConfigWriteString_e(...)
 

Detailed Description

LcConfigC - various functions to perform misc operations …

Macro Definition Documentation

◆ LcConfigLog

#define LcConfigLog ( ...)
Value:
void LcConfigLog_RT(MK_RT mkrt, LC_CFGN const cfg, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the config …
#define MK_RT_CALL

Definition at line 99 of file config_overload_lc.h.

◆ LcConfigLog_1

#define LcConfigLog_1 ( cfg)
Value:
LcConfigLog(cfg,NULL,0,__func__,0)
#define LcConfigLog(...)

Definition at line 103 of file config_overload_lc.h.

◆ LcConfigLog_2

#define LcConfigLog_2 ( cfg,
fmtobj )
Value:
LcConfigLog(cfg,fmtobj,0,__func__,0)

Definition at line 102 of file config_overload_lc.h.

◆ LcConfigLog_3

#define LcConfigLog_3 ( cfg,
fmtobj,
debug )
Value:
LcConfigLog(cfg,fmtobj,debug,__func__,0)

Definition at line 101 of file config_overload_lc.h.

◆ LcConfigLog_4

#define LcConfigLog_4 ( cfg,
fmtobj,
debug,
callfunc )
Value:
LcConfigLog(cfg,fmtobj,debug,callfunc,0)

Definition at line 100 of file config_overload_lc.h.

◆ LcConfigLog_NULL

#define LcConfigLog_NULL ( ...)
Value:
#define MK_RT_CALL_NULL

Definition at line 98 of file config_overload_lc.h.

◆ LcConfigReadFile_C

#define LcConfigReadFile_C ( ...)
Value:
if (MkErrorCheckI(LcConfigReadFile(__VA_ARGS__)))
static enum MkErrorE LcConfigReadFile(LC_CFG config, MK_STRN filename)
This function reads and parses a configuration from the file named filename into the configuration ob...

Definition at line 105 of file config_overload_lc.h.

◆ LcConfigReadFile_E

#define LcConfigReadFile_E ( ...)
Value:
MkErrorCheck(LcConfigReadFile(__VA_ARGS__))

Definition at line 104 of file config_overload_lc.h.

◆ LcConfigReadString_C

#define LcConfigReadString_C ( ...)
Value:
if (MkErrorCheckI(LcConfigReadString(__VA_ARGS__)))
static enum MkErrorE LcConfigReadString(LC_CFG config, MK_STRN str)
This function reads and parses a configuration from the string str into the configuration object conf...

Definition at line 107 of file config_overload_lc.h.

◆ LcConfigReadString_E

#define LcConfigReadString_E ( ...)
Value:
MkErrorCheck(LcConfigReadString(__VA_ARGS__))

Definition at line 106 of file config_overload_lc.h.

◆ LcConfigWriteFile_C

#define LcConfigWriteFile_C ( ...)
Value:
if (MkErrorCheckI(LcConfigWriteFile(__VA_ARGS__)))
static enum MkErrorE LcConfigWriteFile(LC_CFG config, MK_STRN filename)
This function writes the configuration config to the file named filename …

Definition at line 109 of file config_overload_lc.h.

◆ LcConfigWriteFile_E

#define LcConfigWriteFile_E ( ...)
Value:
MkErrorCheck(LcConfigWriteFile(__VA_ARGS__))

Definition at line 108 of file config_overload_lc.h.

◆ LcConfigWriteString

#define LcConfigWriteString ( ...)
Value:
enum MkErrorE LcConfigWriteString_RT(MK_RT mkrt, LC_CFGN const cfg, MK_STRN *val_out)
read the entire configuration cfg into the string val_out …

Definition at line 113 of file config_overload_lc.h.

◆ LcConfigWriteString_C

#define LcConfigWriteString_C ( ...)
Value:
if (MkErrorCheckI(LcConfigWriteString(__VA_ARGS__)))
#define LcConfigWriteString(...)

Definition at line 115 of file config_overload_lc.h.

◆ LcConfigWriteString_E

#define LcConfigWriteString_E ( ...)
Value:
MkErrorCheck(LcConfigWriteString(__VA_ARGS__))

Definition at line 114 of file config_overload_lc.h.

◆ LcConfigWriteString_e

#define LcConfigWriteString_e ( ...)
Value:
MK_EMBEDDED(MK_STRN,LcConfigWriteString,__VA_ARGS__)
const MK_STRB * MK_STRN

Definition at line 116 of file config_overload_lc.h.

◆ LcConfigWriteString_NULL

#define LcConfigWriteString_NULL ( ...)
Value:

Definition at line 112 of file config_overload_lc.h.

Function Documentation

◆ LcConfigClear()

static void LcConfigClear ( LC_CFG config)
inlinestatic

Since v1.7 This function clears the configuration config

All child settings of the root setting are recursively destroyed. All other attributes of the configuration are left unchanged.

Definition at line 332 of file LcConfigC_lc.h.

332 {
333 LC_INSTANCE_HDL(config);
334 config_clear(config->nat);
335 }
#define LC_INSTANCE_HDL(x)
LIBCONFIG_API void config_clear(config_t *config)
config_t * nat
internal - link between LcConfigS and native library

◆ LcConfigClearP()

void LcConfigClearP ( LC_CFG config)

Non-inline replacement for LcConfigClear

◆ LcConfigLog_RT()

void LcConfigLog_RT ( MK_RT mkrt,
LC_CFGN const cfg,
MK_OBJN fmtobj,
MK_DBG const debug,
MK_STRN const callfunc,
MK_I32 const lvl )

log the config

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]cfgProgramming-Language-Micro-Kernel (PLMK) instance from config_t
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]debugthe debug level from MkRuntimeS::debug, use 0 <= debug <= 9 (default=0)
[in]callfunca user-defined postfix to identify the calling-function or the environment (default = name-of-function, MK_NULL = resolve-own-name)
[in]lvla user-defined prefix starting with "" for lvl=0 and increase with " " for lvl+1 (default=0)

◆ LcConfigReadFile()

static enum MkErrorE LcConfigReadFile ( LC_CFG config,
MK_STRN filename )
inlinestatic

This function reads and parses a configuration from the file named filename into the configuration object config

It returns CONFIG_TRUE on success, or CONFIG_FALSE on failure; the config_error_text and config_error_line functions, described below, can be used to obtain information about the error.

Definition at line 338 of file LcConfigC_lc.h.

338 {
339 LC_INSTANCE_HDL(config);
340 enum LcErrorE errVal = (enum LcErrorE)config_read_file(config->nat, filename);
341 LcErrorE_Check(config, errVal);
342 return MK_OK;
343 error:
344 return MK_ERROR;
345 }
LcErrorE
Signals an error and is used as the return value of a function …
Definition LcEnum_lc.h:188
#define LcErrorE_Check(lc_hdl, PROC)
check on a liblcconfig error and convert into a liblcconfig error …
MK_ERROR
MK_OK
LIBCONFIG_API int config_read_file(config_t *config, const char *filename)

◆ LcConfigReadFileP()

enum MkErrorE LcConfigReadFileP ( LC_CFG config,
MK_STRN filename )

Non-inline replacement for LcConfigReadFile

◆ LcConfigReadString()

static enum MkErrorE LcConfigReadString ( LC_CFG config,
MK_STRN str )
inlinestatic

This function reads and parses a configuration from the string str into the configuration object config

It returns CONFIG_TRUE on success, or CONFIG_FALSE on failure; the config_error_text and config_error_line functions, described below, can be used to obtain information about the error.

Definition at line 348 of file LcConfigC_lc.h.

348 {
349 LC_INSTANCE_HDL(config);
350 enum LcErrorE errVal = (enum LcErrorE)config_read_string(config->nat, str);
351 LcErrorE_Check(config, errVal);
352 return MK_OK;
353 error:
354 return MK_ERROR;
355 }
LIBCONFIG_API int config_read_string(config_t *config, const char *str)

◆ LcConfigReadStringP()

enum MkErrorE LcConfigReadStringP ( LC_CFG config,
MK_STRN str )

Non-inline replacement for LcConfigReadString

◆ LcConfigRootSetting()

static LC_CFS LcConfigRootSetting ( LC_CFGN config)
inlinestatic

This function, which is implemented as a macro, returns the root setting for the configuration config

The root setting is a group.

Definition at line 324 of file LcConfigC_lc.h.

324 {
325 LC_INSTANCE_HDL(config);
327 }
static MK_ARTIFICIAL LC_CFS LcSettingC_ObjNew(config_setting_t *hdl)
return Programming-Language-Micro-Kernel (PLMK) instance from native hdl …
#define config_root_setting(C)

◆ LcConfigRootSettingP()

LC_CFS LcConfigRootSettingP ( LC_CFGN config)

Non-inline replacement for LcConfigRootSetting

◆ LcConfigWriteFile()

static enum MkErrorE LcConfigWriteFile ( LC_CFG config,
MK_STRN filename )
inlinestatic

This function writes the configuration config to the file named filename

It returns CONFIG_TRUE on success, or CONFIG_FALSE on failure.

Definition at line 358 of file LcConfigC_lc.h.

358 {
359 LC_INSTANCE_HDL(config);
360 enum LcErrorE errVal = (enum LcErrorE)config_write_file(config->nat, filename);
361 LcErrorE_Check(config, errVal);
362 return MK_OK;
363 error:
364 return MK_ERROR;
365 }
LIBCONFIG_API int config_write_file(config_t *config, const char *filename)

◆ LcConfigWriteFileP()

enum MkErrorE LcConfigWriteFileP ( LC_CFG config,
MK_STRN filename )

Non-inline replacement for LcConfigWriteFile

◆ LcConfigWriteString_RT()

enum MkErrorE LcConfigWriteString_RT ( MK_RT mkrt,
LC_CFGN const cfg,
MK_STRN * val_out )

read the entire configuration cfg into the string val_out

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]cfgProgramming-Language-Micro-Kernel (PLMK) instance from config_t
[out]val_outthe entire configuration as string - value owed by (runtime) enum MkErrorE LcConfigWriteString(LC_CFGN const cfg, MK_STRN *val_out) .
Returns
The MkErrorE status from the DEFAULT MkErrorC in MkRuntimeS::error_mk