theConfig 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - cs - 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
 
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 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__)))
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 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__)))
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 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__)))
static 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:
MK_EMBEDDED(MK_STRN,LcConfigWriteString,__VA_ARGS__)
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()

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

335 {
336 LC_INSTANCE_HDL(config);
337 config_clear(config->nat);
338 }
#define LC_INSTANCE_HDL(x)
LIBCONFIG_API void config_clear(config_t *config)
config_t * nat
internal - link between LcConfigS and native library
+ Here is the caller graph for this function:

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

341 {
342 LC_INSTANCE_HDL(config);
343 enum LcErrorE errVal = (enum LcErrorE)config_read_file(config->nat, filename);
344 LcErrorE_Check(config, errVal);
345 return MK_OK;
346 error:
347 return MK_ERROR;
348 }
LcErrorE
Signals an error and is used as the return value of a function …
Definition LcEnum_lc.h:191
#define LcErrorE_Check(lc_hdl, PROC)
check on a tcllcconfig error and convert into a tcllcconfig error …
MK_ERROR
MK_OK
LIBCONFIG_API int config_read_file(config_t *config, const char *filename)
+ Here is the caller graph for this function:

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

351 {
352 LC_INSTANCE_HDL(config);
353 enum LcErrorE errVal = (enum LcErrorE)config_read_string(config->nat, str);
354 LcErrorE_Check(config, errVal);
355 return MK_OK;
356 error:
357 return MK_ERROR;
358 }
LIBCONFIG_API int config_read_string(config_t *config, const char *str)
+ Here is the caller graph for this function:

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

327 {
328 LC_INSTANCE_HDL(config);
330 }
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)
+ Here is the caller graph for this function:

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

361 {
362 LC_INSTANCE_HDL(config);
363 enum LcErrorE errVal = (enum LcErrorE)config_write_file(config->nat, filename);
364 LcErrorE_Check(config, errVal);
365 return MK_OK;
366 error:
367 return MK_ERROR;
368 }
LIBCONFIG_API int config_write_file(config_t *config, const char *filename)
+ Here is the caller graph for this function:

◆ 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 string [$cfg WriteString] .
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)