liblcconfig 9.0
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
LcConfigC_lc.h File Reference

LcConfigC_lc.h - 27 May 2023 - aotto1968. More...

Go to the source code of this file.

Data Structures

struct  LcConfigS
 Class to represent a the entire configuration of the of the libconfig library … More...
 

Macros

#define BEGIN_LC_C_DECLS   /* empty */
 
#define END_LC_C_DECLS   /* empty */
 
#define LcConfigIncludeCallF_ARGS    MK_RT_ARGS struct LcConfigS* const cfg, MK_STRN incDir, MK_STRN path, MK_BFL ret_inout
 
#define LcConfigIncludeFreeF_ARGS   MK_RT_ARGS struct LcConfigS* const cfg
 
#define LcSettingDeleteCallF_ARGS    MK_RT_ARGS struct LcConfigS* const cfg, struct LcSettingS* const cfs
 
#define LcSettingDeleteFreeF_ARGS   MK_RT_ARGS struct LcConfigS* const cfg
 
#define LcConfigC_nat   config_t*
 
#define LcCfgRaise(_cfg)
 raise an error if class-instance is not valid
 
#define LcCFG_R(x)   (*(x)).super.cfg
 cast a known-object into an LcConfigS reference
 
#define LcCFG(x)   (&LcCFG_R(x))
 cast a known-object into an LcConfigS pointer
 
#define MqConfigDelete_NULL(cfg)   MkObjectDeleteToNull(MqConfigDelete,cfg)
 
#define LcGetCfgFromNat(_nat)   LC_SET_T(LcConfigC,config_get_hook,_nat)
 helper for LcConfigC_ObjNew
 
LcConfigC signature define
#define LcConfigC_SIGNATURE   (MkObjectC_SIGNATURE ^ (11u<<10))
 
#define LcConfigC_MASK   (((1u<<22)-1)<<10)
 
LcConfigC cast to superclass
#define LcConfigC_X2cfg(x)   (x)
 
#define LcConfigC_X2obj(x)   MkOBJ(x)
 

Typedefs

typedef MK_PTRBLC_CBP
 
typedef enum MkErrorE(* LcConfigIncludeCallF) (LcConfigIncludeCallF_ARGS)
 
typedef void(* LcConfigIncludeFreeF) (LcConfigIncludeFreeF_ARGS)
 
typedef enum MkErrorE(* LcSettingDeleteCallF) (LcSettingDeleteCallF_ARGS)
 
typedef void(* LcSettingDeleteFreeF) (LcSettingDeleteFreeF_ARGS)
 

Functions

LC_CFG LcCfg (MK_MNG mng)
 cast a unknown-object into an LcConfigS pointer or NULL if not possible
 
LC_CFGN LcCfgN (MK_MNGN mng)
 (const) cast a unknown-object into an LcConfigS pointer or NULL if not possible
 
LC_CFG LcConfigCreate (MK_TYP type, config_t *nat)
 create a LcConfigC instance …
 
void LcConfigDelete_RT (MK_RT const mkrt, LC_CFG const cfg)
 delete a LcConfigC instance …
 
enum MkErrorE LcConfigIncludeCall (LcConfigIncludeCallF_ARGS)
 
void LcConfigIncludeFree (LcConfigIncludeFreeF_ARGS)
 
enum MkErrorE LcConfigSetIncludeFunc_RT (MK_RT const mkrt, LC_CFG const cfg, LcConfigIncludeCallF fConfigIncludeCall, LC_CBP fConfigIncludeData, LcConfigIncludeFreeF fConfigIncludeFree)
 
MK_PTR LcConfigGetIncludeFunc (LC_CFG const cfg)
 return the include-function
 
enum MkErrorE LcConfigSetSettingDeleteFunc_RT (MK_RT const mkrt, LC_CFG const cfg, LcSettingDeleteCallF fSettingDeleteCall, LC_CBP fSettingDeleteData, LcSettingDeleteFreeF fSettingDeleteFree)
 callback called on delete a setting, used to cleanup user data…
 
MK_PTR LcConfigGetSettingDeleteFunc (LC_CFG const cfg)
 
enum MkErrorE LcConfigWriteString_RT (MK_RT const mkrt, LC_CFGN const cfg, MK_STRN *val_out)
 read the entire configuration cfg into the string val_out
 
void LcConfigLog_RT (MK_RT const mkrt, LC_CFGN const cfg, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_INT const lvl)
 log the config
 
LC_CFS LcSettingC_ObjNew (config_setting_t *hdl)
 return Programming-Language-Micro-Kernel instance from hdl
 
LC_CFG LcConfigC_ObjNew (config_t *hdl)
 return Programming-Language-Micro-Kernel instance from hdl
 
LC_CFG LcConfigFromHandle (MK_LONG const exporthdl)
 return a LcConfigC from exporthdl
 
LC_CFG LcConfigInstances (void)
 get head-instance from linked-list of LcConfigS type …
 
LC_CFG LcConfigNext (LC_CFG const cfg)
 get next instance from linked-list of LcConfigS type
 
LC_CFG LcConfigPrev (LC_CFG const cfg)
 get previous instance from linked-list of LcConfigS type
 
enum LcErrorTypeE LcConfigErrorType (LC_CFGN config)
 This function, which is implemented as a macro, returns the type of error that occurred during the last call to one of the read or write functions …
 
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_SRT 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)
 ConfigSetIncludeDir 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_SRT LcConfigGetTabWidth (LC_CFGN config)
 These functions, which are implemented as macros, get and set the tab width for the configuration config
 
LC_CFS LcConfigLookup (LC_CFGN config, MK_STRN path)
 This function locates the setting in the configuration config specified by the path path
 
enum MkErrorE LcConfigLookupBool (LC_CFGN config, MK_STRN path, MK_BOOL *value_out)
 These functions look up the value of the setting in the configuration config specified by the path path
 
enum MkErrorE LcConfigLookupFloat (LC_CFGN config, MK_STRN path, MK_DBL *value_out)
 These functions look up the value of the setting in the configuration config specified by the path path
 
enum MkErrorE LcConfigLookupInt (LC_CFGN config, MK_STRN path, MK_INT *value_out)
 These functions look up the value of the setting in the configuration config specified by the path path
 
enum MkErrorE LcConfigLookupInt64 (LC_CFGN config, MK_STRN path, MK_WID *value_out)
 These functions look up the value of the setting in the configuration config specified by the path path
 
enum MkErrorE LcConfigLookupString (LC_CFGN config, MK_STRN path, MK_STRN *value_out)
 These functions look up the value of the setting in the configuration config specified by the path path
 
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
 
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
 

LcConfigC type definition

#define LcConfigC_T   ( (struct MkDefTypeS *) (LcConfigC_TT) )
 instance-type as specific-instance-type (cast from LcConfigC_TT into MkTypeS) …
 
#define LcConfigST   LcConfigC_T
 instance-type as specific-instance-type
 
#define LcConfigSTT   (MkTYP(LcConfigST))
 instance-type as common-instance-type (cast from LcConfigST into MkTypeS) …
 
#define LcConfigC_type   LC_CFG
 same as LcConfigS but useable in a class-macro as: class##_type
 
#define LcConfigCT_X(instance)   ( (struct MkDefTypeS *) (MkOBJ_R(instance).type) )
 cast from an instance into the specific-instance-type
 
#define LcConfigCTT_X(instance)   (MkOBJ_R(instance).type)
 cast from an instance into the common-instance-type
 
#define LcConfigCT_TT(typ)   ( (struct MkDefTypeS *) (typ) )
 cast from an common-instance-type into an specific-instance-type
 
#define LcConfigC_NS   LC
 map class to namespace …
 
#define LcConfigCTT   LcConfigCTT
 instance-type as common-instance-type for LcConfigC in the target-programming-language (C,C++,C#,VB.NET,Java,Python,Ruby,Perl,PHP,Tcl or GO)
 
#define LcConfigCT   ( (struct MkDefTypeS *) LcConfigCTT )
 instance-type as specific-instance-type for LcConfigC in the target-programming-language (C,C++,C#,VB.NET,Java,Python,Ruby,Perl,PHP,Tcl or GO)
 
typedef struct LcConfigS LcConfigCR
 instance-struct-reference same as struct LcConfigS, useable in a class-macro as: class##R
 
typedef const struct LcConfigS LcConfigCNR
 const instance-struct-reference same as const struct LcConfigS, useable in a class-macro as: class##R
 
MkThreadLocal MK_TYP LcConfigC_TT
 instance-type as specific-instance-type
 

LcConfigC signature check

#define LcConfigC_Check(mng)   LcCfgCheck(mng)
 
bool LcCfgCheck (MK_MNGN mng)
 check LcConfigS%->Mk{ObjectS::signature} …
 

Detailed Description

LcConfigC_lc.h - 27 May 2023 - aotto1968.

Version
9220f56ae9df672d911c9d7255ea7e76516b4d65
Date
Sat May 27 15:18:36 2023 +0200
Author
aotto1968 aotto.nosp@m.1968.nosp@m.@t-on.nosp@m.line.nosp@m..de

Definition in file LcConfigC_lc.h.

Macro Definition Documentation

◆ BEGIN_LC_C_DECLS

#define BEGIN_LC_C_DECLS   /* empty */

Definition at line 24 of file LcConfigC_lc.h.

◆ END_LC_C_DECLS

#define END_LC_C_DECLS   /* empty */

Definition at line 25 of file LcConfigC_lc.h.

Function Documentation

◆ LcConfigGetIncludeFunc()

MK_PTR LcConfigGetIncludeFunc ( LC_CFG const  cfg)
inline

return the include-function

Definition at line 270 of file LcConfigC_lc.h.

◆ LcConfigGetSettingDeleteFunc()

MK_PTR LcConfigGetSettingDeleteFunc ( LC_CFG const  cfg)
inline

Definition at line 286 of file LcConfigC_lc.h.

◆ LcConfigIncludeCall()

enum MkErrorE LcConfigIncludeCall ( LcConfigIncludeCallF_ARGS  )
extern

◆ LcConfigIncludeFree()

void LcConfigIncludeFree ( LcConfigIncludeFreeF_ARGS  )
extern

◆ LcConfigSetIncludeFunc_RT()

enum MkErrorE LcConfigSetIncludeFunc_RT ( MK_RT const  mkrt,
LC_CFG const  cfg,
LcConfigIncludeCallF  fConfigIncludeCall,
LC_CBP  fConfigIncludeData,
LcConfigIncludeFreeF  fConfigIncludeFree 
)
extern

◆ LcConfigSetSettingDeleteFunc_RT()

enum MkErrorE LcConfigSetSettingDeleteFunc_RT ( MK_RT const  mkrt,
LC_CFG const  cfg,
LcSettingDeleteCallF  fSettingDeleteCall,
LC_CBP  fSettingDeleteData,
LcSettingDeleteFreeF  fSettingDeleteFree 
)
extern

callback called on delete a setting, used to cleanup user data…