theConfig 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - py - rb - jv - cc
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
 
LC_CFS LcConfigRootSetting (LC_CFGN config)
 This function, which is implemented as a macro, returns the root setting for the configuration config
 
void LcConfigClear (LC_CFG config)
 Since v1.7 This function clears the configuration config
 
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
 
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
 
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_EXTERN LC_CFS LcConfigRootSettingP (LC_CFGN config)
 Non-inline replacement for LcConfigRootSetting
 
LC_EXTERN void LcConfigClearP (LC_CFG config)
 Non-inline replacement for LcConfigClear
 
LC_EXTERN enum MkErrorE LcConfigReadFileP (LC_CFG config, MK_STRN filename)
 Non-inline replacement for LcConfigReadFile
 
LC_EXTERN enum MkErrorE LcConfigReadStringP (LC_CFG config, MK_STRN str)
 Non-inline replacement for LcConfigReadString
 
LC_EXTERN 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 102 of file config_overload_lc.h.

◆ LcConfigLog_1

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

Definition at line 106 of file config_overload_lc.h.

◆ LcConfigLog_2

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

Definition at line 105 of file config_overload_lc.h.

◆ LcConfigLog_3

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

Definition at line 104 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 103 of file config_overload_lc.h.

◆ LcConfigLog_NULL

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

Definition at line 101 of file config_overload_lc.h.

◆ LcConfigReadFile_C

#define LcConfigReadFile_C ( ...)
Value:
if (MkErrorCheckI(LcConfigReadFile(__VA_ARGS__)))
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 108 of file config_overload_lc.h.

◆ LcConfigReadFile_E

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

Definition at line 107 of file config_overload_lc.h.

◆ LcConfigReadString_C

#define LcConfigReadString_C ( ...)
Value:
if (MkErrorCheckI(LcConfigReadString(__VA_ARGS__)))
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 110 of file config_overload_lc.h.

◆ LcConfigReadString_E

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

Definition at line 109 of file config_overload_lc.h.

◆ LcConfigWriteFile_C

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

Definition at line 112 of file config_overload_lc.h.

◆ LcConfigWriteFile_E

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

Definition at line 111 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 116 of file config_overload_lc.h.

◆ LcConfigWriteString_C

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

Definition at line 118 of file config_overload_lc.h.

◆ LcConfigWriteString_E

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

Definition at line 117 of file config_overload_lc.h.

◆ LcConfigWriteString_e

#define LcConfigWriteString_e ( ...)
Value:
#define MK_EMBEDDED(type, call,...)
const MK_STRB * MK_STRN

Definition at line 119 of file config_overload_lc.h.

◆ LcConfigWriteString_NULL

#define LcConfigWriteString_NULL ( ...)
Value:

Definition at line 115 of file config_overload_lc.h.

Function Documentation

◆ LcConfigClear()

void LcConfigClear ( LC_CFG config)
inline

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 349 of file LcConfigC_lc.h.

349 {
350 LC_INSTANCE_HDL(config);
351 config_clear(config->nat);
352 }
#define LC_INSTANCE_HDL(x)
LIBCONFIG_API void config_clear(config_t *config)
config_t * nat
internal - link between LcConfigS and native library

◆ LcConfigClearP()

LC_EXTERN 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 )
extern

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)
[in]lvla user-defined prefix starting with "" for lvl=0 and increase with " " for lvl+1 (default=0)

◆ LcConfigReadFile()

enum MkErrorE LcConfigReadFile ( LC_CFG config,
MK_STRN filename )
inline

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 355 of file LcConfigC_lc.h.

355 {
356 LC_INSTANCE_HDL(config);
357 enum LcErrorE errVal = (enum LcErrorE)config_read_file(config->nat, filename);
358 LcErrorE_Check(config, errVal);
359 return MK_OK;
360 error:
361 return MK_ERROR;
362 }
LcErrorE
Signals an error and is used as the return value of a function …
Definition LcEnum_lc.h:205
#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()

LC_EXTERN enum MkErrorE LcConfigReadFileP ( LC_CFG config,
MK_STRN filename )

Non-inline replacement for LcConfigReadFile

◆ LcConfigReadString()

enum MkErrorE LcConfigReadString ( LC_CFG config,
MK_STRN str )
inline

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 365 of file LcConfigC_lc.h.

365 {
366 LC_INSTANCE_HDL(config);
367 enum LcErrorE errVal = (enum LcErrorE)config_read_string(config->nat, str);
368 LcErrorE_Check(config, errVal);
369 return MK_OK;
370 error:
371 return MK_ERROR;
372 }
LIBCONFIG_API int config_read_string(config_t *config, const char *str)

◆ LcConfigReadStringP()

LC_EXTERN enum MkErrorE LcConfigReadStringP ( LC_CFG config,
MK_STRN str )

Non-inline replacement for LcConfigReadString

◆ LcConfigRootSetting()

LC_CFS LcConfigRootSetting ( LC_CFGN config)
inline

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 341 of file LcConfigC_lc.h.

341 {
342 LC_INSTANCE_HDL(config);
344 }
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_EXTERN LC_CFS LcConfigRootSettingP ( LC_CFGN config)

Non-inline replacement for LcConfigRootSetting

◆ LcConfigWriteFile()

enum MkErrorE LcConfigWriteFile ( LC_CFG config,
MK_STRN filename )
inline

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 375 of file LcConfigC_lc.h.

375 {
376 LC_INSTANCE_HDL(config);
377 enum LcErrorE errVal = (enum LcErrorE)config_write_file(config->nat, filename);
378 LcErrorE_Check(config, errVal);
379 return MK_OK;
380 error:
381 return MK_ERROR;
382 }
LIBCONFIG_API int config_write_file(config_t *config, const char *filename)

◆ LcConfigWriteFileP()

LC_EXTERN 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 )
extern

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