theConfig 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - py - rb - jv - cc
Loading...
Searching...
No Matches
LcConfigC_Class_C_API

LcConfigC - define the class … More...

+ Collaboration diagram for LcConfigC_Class_C_API:

Topics

 LcConfigC_Class_Define_C_API
 LcConfigC - low level definition, access and cast …
 

Macros

#define LcGetCfgFromNat(_nat)
 helper for LcConfigC_ObjNew
 

Typedefs

typedef struct LcConfigSLC_CFG
 class-shortcut for struct LcConfigS *, all shortcut using the XX_YYY syntax (only for public API) …
 
typedef const struct LcConfigSLC_CFGN
 class-shortcut for const struct LcConfigS *, all const shortcut using the XX_YYYC syntax (only for public API) …
 
typedef struct LcConfigS LC_CFGR
 reference-shortcut for struct LcConfigS, all shortcut using the XX_YYYR syntax (only for public API) …
 

LcConfigC - Export - inline - interact with an external software

MK_ARTIFICIAL LC_CFG LcConfigC_ObjNew (config_t *hdl)
 return Programming-Language-Micro-Kernel (PLMK) instance from native hdl
 
LC_CFG LcConfigC_ObjCreate (config_t *hdl)
 return Programming-Language-Micro-Kernel (PLMK) instance from native hdl
 
MK_HDL LcConfigHandleGet_RT (MK_RT mkrt, LC_CFG const cfg)
 Handle-Get-Slot - returns a export-hdl to the LcConfigC useable for external storage
 
LC_CFG LcConfigHandleResolve_RT (MK_RT mkrt, MK_HDL const netHdl)
 Handle-Resolve-Slot - return a LcConfigC from netHdl or MK_NULL if invalid…
 
#define LcConfigHandleResolve_e(netHdl)
 wrapper for LcConfigHandleResolve with error-handline
 

LcConfigC - Misc - function - unspecified functions to perform different tasks

LC_CFG LcConfigGetNull (void)
 Null-Slot - return a LcConfigC typed NULL instance …
 

LcConfigC - Introspection - inline - access to all instances created by class starting with the last one

LC_CFG LcConfigInstances_RT (MK_PARSER_RT_ONLY)
 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
 

LcConfigC - Export - function

LC_EXTERN LC_CFG LcConfigHandleResolveP (MK_RT mkrt, MK_HDL const netHdl)
 Non-inline replacement for LcConfigHandleResolve
 
LC_EXTERN MK_HDL LcConfigHandleGetP (MK_RT mkrt, LC_CFG const cfg)
 Non-inline replacement for LcConfigHandleGet
 

LcConfigC - Introspection - function

LC_EXTERN LC_CFG LcConfigNextP (LC_CFG const cfg)
 Non-inline replacement for LcConfigNext
 
LC_EXTERN LC_CFG LcConfigPrevP (LC_CFG const cfg)
 Non-inline replacement for LcConfigPrev
 
LC_EXTERN LC_CFG LcConfigInstancesP (MK_PARSER_RT_ONLY)
 Non-inline replacement for LcConfigInstances
 

LcConfigC - Misc - function

LC_EXTERN LC_CFG LcConfigGetNullP (void)
 Non-inline replacement for LcConfigGetNull
 

LcConfigC - Export - overload

#define LcConfigHandleResolve_NULL(...)
 
#define LcConfigHandleResolve(...)
 
#define LcConfigHandleGet_NULL(...)
 
#define LcConfigHandleGet(...)
 

LcConfigC - Introspection - overload

#define LcConfigInstances_NULL()
 
#define LcConfigInstances()
 

Detailed Description

LcConfigC - define the class …

Macro Definition Documentation

◆ LcConfigHandleGet

#define LcConfigHandleGet ( ...)
Value:
MK_HDL LcConfigHandleGet_RT(MK_RT mkrt, LC_CFG const cfg)
Handle-Get-Slot - returns a export-hdl to the LcConfigC useable for external storage
#define MK_RT_CALL

Definition at line 56 of file config_overload_lc.h.

◆ LcConfigHandleGet_NULL

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

Definition at line 55 of file config_overload_lc.h.

◆ LcConfigHandleResolve

#define LcConfigHandleResolve ( ...)
Value:
LC_CFG LcConfigHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a LcConfigC from netHdl or MK_NULL if invalid…

Definition at line 52 of file config_overload_lc.h.

◆ LcConfigHandleResolve_e

#define LcConfigHandleResolve_e ( netHdl)
Value:
({ \
MK_HDL tmpHdl=netHdl; \
LC_CFG tmp; \
if (tmpHdl==0) { \
tmp=NULL; \
} else { \
tmp=LcConfigHandleResolve(tmpHdl); \
if (tmp==NULL) { \
MkErrorSetC_1_NULL("ERROR: 'LcConfigC' handle is 'NULL'"); \
goto error; \
}; \
}; \
tmp; \
})
#define LcConfigHandleResolve(...)
int32_t MK_HDL
Struct to represent the data from the LcConfigC …

wrapper for LcConfigHandleResolve with error-handline

Parameters
[in]netHdlThe handle previously returned by MkObjectHandleGet.
Returns
Return an valid LC_CFG or MK_NULL with an error set.
  • If netHdl is 0 than MK_NULL is returned and the upper-code decide how to deal with it.
  • LcConfigHandleResolve return an valid LC_CFG or MK_NULL if the netHdl is invalid or the underlying object has already been deleted.
    • If a MK_NULL is returned than an error-message is created and a jump to the label error is done.
    • If a LC_CFG is returned than the netHdl is valid.

Definition at line 331 of file LcConfigC_def_lc.h.

331#define LcConfigHandleResolve_e(netHdl) ({ \
332 MK_HDL tmpHdl=netHdl; \
333 LC_CFG tmp; \
334 if (tmpHdl==0) { \
335 tmp=NULL; \
336 } else { \
337 tmp=LcConfigHandleResolve(tmpHdl); \
338 if (tmp==NULL) { \
339 MkErrorSetC_1_NULL("ERROR: 'LcConfigC' handle is 'NULL'"); \
340 goto error; \
341 }; \
342 }; \
343 tmp; \
344})

◆ LcConfigHandleResolve_NULL

#define LcConfigHandleResolve_NULL ( ...)
Value:

Definition at line 51 of file config_overload_lc.h.

◆ LcConfigInstances

#define LcConfigInstances ( )
Value:
LC_CFG LcConfigInstances_RT(MK_PARSER_RT_ONLY)
get head-instance from linked-list of LcConfigS type …
#define MK_RT_CALL_ONLY

Definition at line 67 of file config_overload_lc.h.

◆ LcConfigInstances_NULL

#define LcConfigInstances_NULL ( )
Value:

Definition at line 66 of file config_overload_lc.h.

◆ LcGetCfgFromNat

#define LcGetCfgFromNat ( _nat)
Value:
LC_SET_T(LcConfigC,config_get_hook,_nat)
#define LC_SET_T(_cls, _hook, _nat)
#define config_get_hook(C)

helper for LcConfigC_ObjNew

Definition at line 256 of file LcConfigC_def_lc.h.

Typedef Documentation

◆ LC_CFG

typedef struct LcConfigS* LC_CFG

class-shortcut for struct LcConfigS *, all shortcut using the XX_YYY syntax (only for public API) …

Definition at line 321 of file LibLcConfig_lc.h.

◆ LC_CFGN

typedef const struct LcConfigS* LC_CFGN

class-shortcut for const struct LcConfigS *, all const shortcut using the XX_YYYC syntax (only for public API) …

Definition at line 324 of file LibLcConfig_lc.h.

◆ LC_CFGR

typedef struct LcConfigS LC_CFGR

reference-shortcut for struct LcConfigS, all shortcut using the XX_YYYR syntax (only for public API) …

Definition at line 327 of file LibLcConfig_lc.h.

Function Documentation

◆ LcConfigC_ObjCreate()

LC_CFG LcConfigC_ObjCreate ( config_t * hdl)
inline

return Programming-Language-Micro-Kernel (PLMK) instance from native hdl

Definition at line 279 of file LcConfigC_def_lc.h.

279 {
281 return LcGetCfgFromNat(hdl);
282}
#define LcGetCfgFromNat(_nat)
helper for LcConfigC_ObjNew …
#define MkRtSetup_NULL

◆ LcConfigC_ObjNew()

MK_ARTIFICIAL LC_CFG LcConfigC_ObjNew ( config_t * hdl)
inline

return Programming-Language-Micro-Kernel (PLMK) instance from native hdl

Definition at line 272 of file LcConfigC_def_lc.h.

272 {
274 return LcGetCfgFromNat(hdl);
275}
+ Here is the caller graph for this function:

◆ LcConfigGetNull()

LC_CFG LcConfigGetNull ( void )
inline

Null-Slot - return a LcConfigC typed NULL instance …

Definition at line 356 of file LcConfigC_def_lc.h.

356 {
357 return (LC_CFG)MK_NULL;
358 }
#define MK_NULL

◆ LcConfigGetNullP()

LC_EXTERN LC_CFG LcConfigGetNullP ( void )

Non-inline replacement for LcConfigGetNull

◆ LcConfigHandleGet_RT()

MK_HDL LcConfigHandleGet_RT ( MK_RT mkrt,
LC_CFG const cfg )
inline

Handle-Get-Slot - returns a export-hdl to the LcConfigC useable for external storage

The export-hdl is a reference to an instance that can be stored in software and converted back into an instance using the LcConfigHandleResolve.

The export-hdl is only valid until the Programming-Language-Micro-Kernel (PLMK) ends.

example: The export-hdl is used in rpc to identify an object across the network.

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
Returns
the required export-hdl

Definition at line 298 of file LcConfigC_def_lc.h.

301 {
302 return MkObjectHandleGet(cfg?MkOBJ(cfg):NULL);
303}
#define MkObjectHandleGet(...)
#define MkOBJ(x)

◆ LcConfigHandleGetP()

LC_EXTERN MK_HDL LcConfigHandleGetP ( MK_RT mkrt,
LC_CFG const cfg )

Non-inline replacement for LcConfigHandleGet

◆ LcConfigHandleResolve_RT()

LC_CFG LcConfigHandleResolve_RT ( MK_RT mkrt,
MK_HDL const netHdl )
inline

Handle-Resolve-Slot - return a LcConfigC from netHdl or MK_NULL if invalid…

The LcConfigHandleResolve undo the LcConfigHandleGet and is intended to export a unique identifer into external code not belonging to the Programming-Language-Micro-Kernel (PLMK).

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]netHdlhandle former exported with LcConfigHandleGet
Returns
the required handle or MK_NULL if netHdl is invalid

Definition at line 315 of file LcConfigC_def_lc.h.

318 {
319 return LcCfg(MkObjectHandleResolve(netHdl));
320}
LC_CFG LcCfg(MK_MNG mng)
cast a unknown-object into an LcConfigS pointer or NULL if not possible
#define MkObjectHandleResolve(...)

◆ LcConfigHandleResolveP()

LC_EXTERN LC_CFG LcConfigHandleResolveP ( MK_RT mkrt,
MK_HDL const netHdl )

Non-inline replacement for LcConfigHandleResolve

◆ LcConfigInstances_RT()

LC_CFG LcConfigInstances_RT ( MK_PARSER_RT_ONLY )
inline

get head-instance from linked-list of LcConfigS type …

The head-instance is the last instance created.

Definition at line 380 of file LcConfigC_def_lc.h.

380 {
383}
MkThreadLocal MK_TYP LcConfigC_TT
class as MkSuperTypeS-class-type …
#define LC_STATIC_RT
MK_OBJ instances

◆ LcConfigInstancesP()

LC_EXTERN LC_CFG LcConfigInstancesP ( MK_PARSER_RT_ONLY )

Non-inline replacement for LcConfigInstances

◆ LcConfigNext()

LC_CFG LcConfigNext ( LC_CFG const cfg)
inline

get next instance from linked-list of LcConfigS type

Definition at line 387 of file LcConfigC_def_lc.h.

387 {
388 MK_INSTANCE_HDL(cfg);
389 return (LC_CFG)LcConfigC_X2obj(cfg)->obj_protect.next;
390}
#define LcConfigC_X2obj(x)
#define MK_INSTANCE_HDL(x)

◆ LcConfigNextP()

LC_EXTERN LC_CFG LcConfigNextP ( LC_CFG const cfg)

Non-inline replacement for LcConfigNext

◆ LcConfigPrev()

LC_CFG LcConfigPrev ( LC_CFG const cfg)
inline

get previous instance from linked-list of LcConfigS type

Definition at line 394 of file LcConfigC_def_lc.h.

394 {
395 MK_INSTANCE_HDL(cfg);
396 return (LC_CFG)LcConfigC_X2obj(cfg)->obj_protect.prev;
397}

◆ LcConfigPrevP()

LC_EXTERN LC_CFG LcConfigPrevP ( LC_CFG const cfg)

Non-inline replacement for LcConfigPrev