theConfig 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - cs - 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

static MK_ARTIFICIAL LC_CFG LcConfigC_ObjNew (config_t *hdl)
 return Programming-Language-Micro-Kernel (PLMK) instance from native hdl
 
static LC_CFG LcConfigC_ObjCreate (config_t *hdl)
 return Programming-Language-Micro-Kernel (PLMK) instance from native hdl
 
static 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
 
static 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

static 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

static LC_CFG LcConfigInstances_RT (MK_RT mkrt)
 get head-instance from linked-list of LcConfigS type …
 
static LC_CFG LcConfigNext (LC_CFG const cfg)
 get next instance from linked-list of LcConfigS type
 
static LC_CFG LcConfigPrev (LC_CFG const cfg)
 get previous instance from linked-list of LcConfigS type
 

LcConfigC - Export - function

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

LcConfigC - Introspection - function

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

LcConfigC - Misc - function

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:
static 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:
static 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 316 of file LcConfigC_def_lc.h.

316#define LcConfigHandleResolve_e(netHdl) ({ \
317 MK_HDL tmpHdl=netHdl; \
318 LC_CFG tmp; \
319 if (tmpHdl==0) { \
320 tmp=NULL; \
321 } else { \
322 tmp=LcConfigHandleResolve(tmpHdl); \
323 if (tmp==NULL) { \
324 MkErrorSetC_1_NULL("ERROR: 'LcConfigC' handle is 'NULL'"); \
325 goto error; \
326 }; \
327 }; \
328 tmp; \
329})

◆ LcConfigHandleResolve_NULL

#define LcConfigHandleResolve_NULL ( ...)
Value:

Definition at line 51 of file config_overload_lc.h.

◆ LcConfigInstances

#define LcConfigInstances ( )
Value:
static LC_CFG LcConfigInstances_RT(MK_RT mkrt)
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 238 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 287 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 290 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 293 of file LibLcConfig_lc.h.

Function Documentation

◆ LcConfigC_ObjCreate()

static LC_CFG LcConfigC_ObjCreate ( config_t * hdl)
inlinestatic

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

Definition at line 261 of file LcConfigC_def_lc.h.

261 {
263 return LcGetCfgFromNat(hdl);
264}
#define LcGetCfgFromNat(_nat)
helper for LcConfigC_ObjNew …
#define MkRtSetup_NULL

◆ LcConfigC_ObjNew()

static MK_ARTIFICIAL LC_CFG LcConfigC_ObjNew ( config_t * hdl)
inlinestatic

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

Definition at line 254 of file LcConfigC_def_lc.h.

254 {
256 return LcGetCfgFromNat(hdl);
257}
+ Here is the caller graph for this function:

◆ LcConfigGetNull()

static LC_CFG LcConfigGetNull ( void )
inlinestatic

Null-Slot - return a LcConfigC typed NULL instance …

Definition at line 341 of file LcConfigC_def_lc.h.

341 {
342 return (LC_CFG)MK_NULL;
343 }
#define MK_NULL

◆ LcConfigGetNullP()

LC_CFG LcConfigGetNullP ( void )

Non-inline replacement for LcConfigGetNull

◆ LcConfigHandleGet_RT()

static MK_HDL LcConfigHandleGet_RT ( MK_RT mkrt,
LC_CFG const cfg )
inlinestatic

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.

By default, the export-hdl is initialized to "0", which is equivalent to does not exist. This function returns a non-zero and unique export-hdl that is recreated if necessary.

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 283 of file LcConfigC_def_lc.h.

286 {
287 return MkObjectHandleGet(cfg?MkOBJ(cfg):NULL);
288}
#define MkObjectHandleGet(...)
#define MkOBJ(x)

◆ LcConfigHandleGetP()

MK_HDL LcConfigHandleGetP ( MK_RT mkrt,
LC_CFG const cfg )

Non-inline replacement for LcConfigHandleGet

◆ LcConfigHandleResolve_RT()

static LC_CFG LcConfigHandleResolve_RT ( MK_RT mkrt,
MK_HDL const netHdl )
inlinestatic

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 300 of file LcConfigC_def_lc.h.

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

◆ LcConfigHandleResolveP()

LC_CFG LcConfigHandleResolveP ( MK_RT mkrt,
MK_HDL const netHdl )

Non-inline replacement for LcConfigHandleResolve

◆ LcConfigInstances_RT()

static LC_CFG LcConfigInstances_RT ( MK_RT mkrt)
inlinestatic

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

The head-instance is the last instance created.

Definition at line 365 of file LcConfigC_def_lc.h.

365 {
368}
__thread MK_TYP LcConfigC_TT
class as MkSuperTypeS-class-type …
#define LC_STATIC_RT
MK_OBJ instances

◆ LcConfigInstancesP()

LC_CFG LcConfigInstancesP ( MK_RT mkrt)

Non-inline replacement for LcConfigInstances

◆ LcConfigNext()

static LC_CFG LcConfigNext ( LC_CFG const cfg)
inlinestatic

get next instance from linked-list of LcConfigS type

Definition at line 372 of file LcConfigC_def_lc.h.

372 {
373 MK_INSTANCE_HDL(cfg);
374 return (LC_CFG)LcConfigC_X2obj(cfg)->obj_protect.next;
375}
#define LcConfigC_X2obj(x)
#define MK_INSTANCE_HDL(x)

◆ LcConfigNextP()

LC_CFG LcConfigNextP ( LC_CFG const cfg)

Non-inline replacement for LcConfigNext

◆ LcConfigPrev()

static LC_CFG LcConfigPrev ( LC_CFG const cfg)
inlinestatic

get previous instance from linked-list of LcConfigS type

Definition at line 379 of file LcConfigC_def_lc.h.

379 {
380 MK_INSTANCE_HDL(cfg);
381 return (LC_CFG)LcConfigC_X2obj(cfg)->obj_protect.prev;
382}

◆ LcConfigPrevP()

LC_CFG LcConfigPrevP ( LC_CFG const cfg)

Non-inline replacement for LcConfigPrev