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

various functions to perform misc operationis on a LcSettingC More...

+ Collaboration diagram for LcSettingC_Misc_C_API:

Functions

LC_EXTERN LC_CFS LcSettingAddIfNotExistsP (LC_CFS setting, MK_STRN name, enum LcConfigTypeE cfgtype)
 Non-inline replacement for LcSettingAddIfNotExists
 
LC_EXTERN LC_CFS LcSettingParentP (LC_CFSN setting)
 Non-inline replacement for LcSettingParent
 
LC_EXTERN MK_BOOL LcSettingExistsP (LC_CFS const setting, MK_STRN name)
 Non-inline replacement for LcSettingExists
 
LC_EXTERN MK_INT LcSettingIndexP (LC_CFSN setting)
 Non-inline replacement for LcSettingIndex
 
LC_EXTERN MK_INT LcSettingLengthP (LC_CFSN setting)
 Non-inline replacement for LcSettingLength
 
LC_EXTERN MK_STRN LcSettingNameP (LC_CFSN setting)
 Non-inline replacement for LcSettingName
 
LC_EXTERN enum MkErrorE LcSettingRemoveP (LC_CFS parent, MK_STRN name)
 Non-inline replacement for LcSettingRemove
 
LC_EXTERN enum MkErrorE LcSettingRemoveElemP (LC_CFS parent, MK_INT idx)
 Non-inline replacement for LcSettingRemoveElem
 
LC_EXTERN MK_STRN LcSettingSourceFileP (LC_CFSN setting)
 Non-inline replacement for LcSettingSourceFile
 
LC_EXTERN MK_INT LcSettingSourceLineP (LC_CFSN setting)
 Non-inline replacement for LcSettingSourceLine
 
LC_EXTERN enum LcConfigTypeE LcSettingTypeP (LC_CFSN setting)
 Non-inline replacement for LcSettingType
 
void LcSettingLog_RT (MK_RT const mkrt, LC_CFSN const setting, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_INT const lvl)
 log the setting
 
LC_CFS LcSettingParent (LC_CFSN setting)
 This function returns the parent setting of the given setting, or NULL if setting is the root setting …
 
MK_INT LcSettingIndex (LC_CFSN setting)
 This function returns the index of the given setting within its parent setting …
 
MK_INT LcSettingLength (LC_CFSN setting)
 This function returns the number of settings in a group, or the number of elements in a list or array …
 
MK_STRN LcSettingName (LC_CFSN setting)
 This function returns the name of the given setting, or NULL if the setting has no name …
 
enum MkErrorE LcSettingRemove (LC_CFS parent, MK_STRN name)
 This function removes and destroys the setting named name from the parent setting parent, which must be a group …
 
enum MkErrorE LcSettingRemoveElem (LC_CFS parent, MK_INT idx)
 This function removes the child setting at the given index index from the setting parent, which must be a group, list, or array …
 
MK_STRN LcSettingSourceFile (LC_CFSN setting)
 This function returns the name of the file from which the setting setting was read, or NULL if the setting was not read from a file …
 
MK_INT LcSettingSourceLine (LC_CFSN setting)
 This function returns the line number of the configuration file or stream at which the setting setting was read, or 0 if no line number is available …
 
enum LcConfigTypeE LcSettingType (LC_CFSN setting)
 This function returns the type of the given setting
 
LC_CFS LcSettingAddIfNotExists (LC_CFS setting, MK_STRN name, enum LcConfigTypeE cfgtype)
 addon - add name with type only if not exists in the setting
 
bool LcSettingExists (const LC_CFS setting, MK_STRN name)
 addon - return true if name exists in the setting otherwise false
 

Overload

#define LcSettingLog(...)   LcSettingLog_RT(MK_RT_CALL __VA_ARGS__)
 
#define LcSettingLog_4(setting, fmtobj, debug, callfunc)   LcSettingLog(setting,fmtobj,debug,callfunc,0)
 
#define LcSettingLog_3(setting, fmtobj, debug)   LcSettingLog(setting,fmtobj,debug,__func__,0)
 
#define LcSettingLog_2(setting, fmtobj)   LcSettingLog(setting,fmtobj,0,__func__,0)
 
#define LcSettingLog_1(setting)   LcSettingLog(setting,NULL,0,__func__,0)
 
#define LcSettingRemove_E(...)   MkErrorCheck(LcSettingRemove(__VA_ARGS__))
 
#define LcSettingRemove_C(...)   if (MkErrorCheckI(LcSettingRemove(__VA_ARGS__)))
 
#define LcSettingRemoveElem_E(...)   MkErrorCheck(LcSettingRemoveElem(__VA_ARGS__))
 
#define LcSettingRemoveElem_C(...)   if (MkErrorCheckI(LcSettingRemoveElem(__VA_ARGS__)))
 

Detailed Description

various functions to perform misc operationis on a LcSettingC

Macro Definition Documentation

◆ LcSettingLog

#define LcSettingLog (   ...)    LcSettingLog_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 136 of file config_overload_lc.h.

◆ LcSettingLog_1

#define LcSettingLog_1 (   setting)    LcSettingLog(setting,NULL,0,__func__,0)

Definition at line 140 of file config_overload_lc.h.

◆ LcSettingLog_2

#define LcSettingLog_2 (   setting,
  fmtobj 
)    LcSettingLog(setting,fmtobj,0,__func__,0)

Definition at line 139 of file config_overload_lc.h.

◆ LcSettingLog_3

#define LcSettingLog_3 (   setting,
  fmtobj,
  debug 
)    LcSettingLog(setting,fmtobj,debug,__func__,0)

Definition at line 138 of file config_overload_lc.h.

◆ LcSettingLog_4

#define LcSettingLog_4 (   setting,
  fmtobj,
  debug,
  callfunc 
)    LcSettingLog(setting,fmtobj,debug,callfunc,0)

Definition at line 137 of file config_overload_lc.h.

◆ LcSettingRemove_C

#define LcSettingRemove_C (   ...)    if (MkErrorCheckI(LcSettingRemove(__VA_ARGS__)))

Definition at line 142 of file config_overload_lc.h.

◆ LcSettingRemove_E

#define LcSettingRemove_E (   ...)    MkErrorCheck(LcSettingRemove(__VA_ARGS__))

Definition at line 141 of file config_overload_lc.h.

◆ LcSettingRemoveElem_C

#define LcSettingRemoveElem_C (   ...)    if (MkErrorCheckI(LcSettingRemoveElem(__VA_ARGS__)))

Definition at line 144 of file config_overload_lc.h.

◆ LcSettingRemoveElem_E

#define LcSettingRemoveElem_E (   ...)    MkErrorCheck(LcSettingRemoveElem(__VA_ARGS__))

Definition at line 143 of file config_overload_lc.h.

Function Documentation

◆ LcSettingAddIfNotExists()

mk_inline LC_CFS LcSettingAddIfNotExists ( LC_CFS  setting,
MK_STRN  name,
enum LcConfigTypeE  cfgtype 
)
inline

addon - add name with type only if not exists in the setting

reference for original

Definition at line 611 of file LcSettingC_lc.h.

◆ LcSettingAddIfNotExistsP()

LC_EXTERN LC_CFS LcSettingAddIfNotExistsP ( LC_CFS  setting,
MK_STRN  name,
enum LcConfigTypeE  cfgtype 
)

Non-inline replacement for LcSettingAddIfNotExists

◆ LcSettingExists()

mk_inline MK_BOOL LcSettingExists ( const LC_CFS  setting,
MK_STRN  name 
)
inline

addon - return true if name exists in the setting otherwise false

reference for original

Definition at line 631 of file LcSettingC_lc.h.

◆ LcSettingExistsP()

LC_EXTERN MK_BOOL LcSettingExistsP ( LC_CFS const  setting,
MK_STRN  name 
)

Non-inline replacement for LcSettingExists

◆ LcSettingIndex()

mk_inline MK_INT LcSettingIndex ( LC_CFSN  setting)
inline

This function returns the index of the given setting within its parent setting …

If setting is the root setting, this function returns -1.

Definition at line 457 of file LcSettingC_lc.h.

◆ LcSettingIndexP()

LC_EXTERN MK_INT LcSettingIndexP ( LC_CFSN  setting)

Non-inline replacement for LcSettingIndex

◆ LcSettingLength()

mk_inline MK_INT LcSettingLength ( LC_CFSN  setting)
inline

This function returns the number of settings in a group, or the number of elements in a list or array …

For other types of settings, it returns 0.

Definition at line 462 of file LcSettingC_lc.h.

◆ LcSettingLengthP()

LC_EXTERN MK_INT LcSettingLengthP ( LC_CFSN  setting)

Non-inline replacement for LcSettingLength

◆ LcSettingLog_RT()

void LcSettingLog_RT ( MK_RT const  mkrt,
LC_CFSN const  setting,
MK_OBJN  fmtobj,
MK_DBG const  debug,
MK_STRN const  callfunc,
MK_INT const  lvl 
)
extern

log the setting

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]settingsame as config_setting_t
[in]fmtobjmanaged object used to format the log-message (default=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)

◆ LcSettingName()

mk_inline MK_STRN LcSettingName ( LC_CFSN  setting)
inline

This function returns the name of the given setting, or NULL if the setting has no name …

Storage for the returned string is managed by the library and released automatically when the setting is destroyed; the string must not be freed by the caller.

Definition at line 467 of file LcSettingC_lc.h.

◆ LcSettingNameP()

LC_EXTERN MK_STRN LcSettingNameP ( LC_CFSN  setting)

Non-inline replacement for LcSettingName

◆ LcSettingParent()

mk_inline LC_CFS LcSettingParent ( LC_CFSN  setting)
inline

This function returns the parent setting of the given setting, or NULL if setting is the root setting …

Definition at line 449 of file LcSettingC_lc.h.

◆ LcSettingParentP()

LC_EXTERN LC_CFS LcSettingParentP ( LC_CFSN  setting)

Non-inline replacement for LcSettingParent

◆ LcSettingRemove()

mk_inline enum MkErrorE LcSettingRemove ( LC_CFS  parent,
MK_STRN  name 
)
inline

This function removes and destroys the setting named name from the parent setting parent, which must be a group …

Any child settings of the setting are recursively destroyed as well.

The name parameter can also specify a setting path relative to the provided parent. (In that case, the setting will be looked up and removed.)

The function returns CONFIG_TRUE on success. If parent is not a group, or if it has no setting with the given name, it returns CONFIG_FALSE.

Definition at line 473 of file LcSettingC_lc.h.

◆ LcSettingRemoveElem()

mk_inline enum MkErrorE LcSettingRemoveElem ( LC_CFS  parent,
MK_INT  idx 
)
inline

This function removes the child setting at the given index index from the setting parent, which must be a group, list, or array …

Any child settings of the removed setting are recursively destroyed as well.

The function returns CONFIG_TRUE on success. If parent is not a group, list, or array, or if index is out of range, it returns CONFIG_FALSE.

Definition at line 482 of file LcSettingC_lc.h.

◆ LcSettingRemoveElemP()

LC_EXTERN enum MkErrorE LcSettingRemoveElemP ( LC_CFS  parent,
MK_INT  idx 
)

Non-inline replacement for LcSettingRemoveElem

◆ LcSettingRemoveP()

LC_EXTERN enum MkErrorE LcSettingRemoveP ( LC_CFS  parent,
MK_STRN  name 
)

Non-inline replacement for LcSettingRemove

◆ LcSettingSourceFile()

mk_inline MK_STRN LcSettingSourceFile ( LC_CFSN  setting)
inline

This function returns the name of the file from which the setting setting was read, or NULL if the setting was not read from a file …

This information is useful for reporting application-level errors. Storage for the returned string is managed by the library and released automatically when the configuration is destroyed; the string must not be freed by the caller.

Definition at line 491 of file LcSettingC_lc.h.

◆ LcSettingSourceFileP()

LC_EXTERN MK_STRN LcSettingSourceFileP ( LC_CFSN  setting)

Non-inline replacement for LcSettingSourceFile

◆ LcSettingSourceLine()

mk_inline MK_INT LcSettingSourceLine ( LC_CFSN  setting)
inline

This function returns the line number of the configuration file or stream at which the setting setting was read, or 0 if no line number is available …

This information is useful for reporting application-level errors.

Definition at line 497 of file LcSettingC_lc.h.

◆ LcSettingSourceLineP()

LC_EXTERN MK_INT LcSettingSourceLineP ( LC_CFSN  setting)

Non-inline replacement for LcSettingSourceLine

◆ LcSettingType()

mk_inline enum LcConfigTypeE LcSettingType ( LC_CFSN  setting)
inline

This function returns the type of the given setting

The return value is one of the constants CONFIG_TYPE_INT, CONFIG_TYPE_INT64, CONFIG_TYPE_FLOAT, CONFIG_TYPE_STRING, CONFIG_TYPE_BOOL, CONFIG_TYPE_ARRAY, CONFIG_TYPE_LIST, or CONFIG_TYPE_GROUP.

Definition at line 502 of file LcSettingC_lc.h.

◆ LcSettingTypeP()

LC_EXTERN enum LcConfigTypeE LcSettingTypeP ( LC_CFSN  setting)

Non-inline replacement for LcSettingType