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

MkRuntimeC - define the class … More...

+ Collaboration diagram for MkRuntimeC_Class_C_API:

Topics

 MkRuntimeC_Class_Define_C_API
 MkRuntimeC - low level definition, access and cast …
 

Typedefs

typedef struct MkRuntimeSMK_RT
 class-shortcut for struct MkRuntimeS *, all shortcut using the XX_YYY syntax (only for public API) …
 
typedef const struct MkRuntimeSMK_RTN
 class-shortcut for const struct MkRuntimeS *, all const shortcut using the XX_YYYC syntax (only for public API) …
 
typedef struct MkRuntimeS MK_RTR
 reference-shortcut for struct MkRuntimeS, all shortcut using the XX_YYYR syntax (only for public API) …
 

MkRuntimeC - Export - inline - interact with an external software

static MK_HDL MkRuntimeHandleGet_RT (MK_RT mkrt, MK_RT const rt)
 Handle-Get-Slot - returns a export-hdl to the MkRuntimeC useable for external storage
 
static MK_RT MkRuntimeHandleResolve_RT (MK_RT mkrt, MK_HDL const netHdl)
 Handle-Resolve-Slot - return a MkRuntimeC from netHdl or MK_NULL if invalid…
 
#define MkRuntimeHandleResolve_e(netHdl)
 wrapper for MkRuntimeHandleResolve with error-handline
 

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

static MK_RT MkRuntimeGetNull (void)
 Null-Slot - return a MkRuntimeC typed NULL instance …
 

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

static MK_RT MkRuntimeInstances_RT (MK_RT mkrt)
 get head-instance from linked-list of MkRuntimeS type …
 
static MK_RT MkRuntimeNext (MK_RT const rt)
 get next instance from linked-list of MkRuntimeS type
 
static MK_RT MkRuntimePrev (MK_RT const rt)
 get previous instance from linked-list of MkRuntimeS type
 

MkRuntimeC - Export - function

MK_RT MkRuntimeHandleResolveP (MK_RT mkrt, MK_HDL const netHdl)
 Non-inline replacement for MkRuntimeHandleResolve
 
MK_HDL MkRuntimeHandleGetP (MK_RT mkrt, MK_RT const rt)
 Non-inline replacement for MkRuntimeHandleGet
 

MkRuntimeC - Introspection - function

MK_RT MkRuntimeNextP (MK_RT const rt)
 Non-inline replacement for MkRuntimeNext
 
MK_RT MkRuntimePrevP (MK_RT const rt)
 Non-inline replacement for MkRuntimePrev
 
MK_RT MkRuntimeInstancesP (MK_RT mkrt)
 Non-inline replacement for MkRuntimeInstances
 

MkRuntimeC - Misc - function

MK_RT MkRuntimeGetNullP (void)
 Non-inline replacement for MkRuntimeGetNull
 

MkRuntimeC - Export - overload

#define MkRuntimeHandleResolve_NULL(...)
 
#define MkRuntimeHandleResolve(...)
 
#define MkRuntimeHandleGet_NULL(...)
 
#define MkRuntimeHandleGet(...)
 

MkRuntimeC - Introspection - overload

#define MkRuntimeInstances_NULL()
 
#define MkRuntimeInstances()
 

Detailed Description

MkRuntimeC - define the class …

Macro Definition Documentation

◆ MkRuntimeHandleGet

#define MkRuntimeHandleGet ( ...)
Value:
static MK_HDL MkRuntimeHandleGet_RT(MK_RT mkrt, MK_RT const rt)
Handle-Get-Slot - returns a export-hdl to the MkRuntimeC useable for external storage
#define MK_RT_CALL

Definition at line 1798 of file kernel_overload_mk.h.

◆ MkRuntimeHandleGet_NULL

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

Definition at line 1797 of file kernel_overload_mk.h.

◆ MkRuntimeHandleResolve

#define MkRuntimeHandleResolve ( ...)
Value:
static MK_RT MkRuntimeHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkRuntimeC from netHdl or MK_NULL if invalid…

Definition at line 1794 of file kernel_overload_mk.h.

◆ MkRuntimeHandleResolve_e

#define MkRuntimeHandleResolve_e ( netHdl)
Value:
({ \
MK_HDL tmpHdl=netHdl; \
MK_RT tmp; \
if (tmpHdl==0) { \
tmp=NULL; \
} else { \
tmp=MkRuntimeHandleResolve(tmpHdl); \
if (tmp==NULL) { \
MkErrorSetC_1_NULL("ERROR: 'MkRuntimeC' handle is 'NULL'"); \
goto error; \
}; \
}; \
tmp; \
})
int32_t MK_HDL
4 byte int handle data-type
#define MkRuntimeHandleResolve(...)
The MkRuntimeS provide a per-thread environment for libmkkernel …

wrapper for MkRuntimeHandleResolve with error-handline

Parameters
[in]netHdlThe handle previously returned by MkObjectHandleGet.
Returns
Return an valid MK_RT 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.
  • MkRuntimeHandleResolve return an valid MK_RT 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 MK_RT is returned than the netHdl is valid.

Definition at line 11873 of file LibMkKernel_mk.h.

11873#define MkRuntimeHandleResolve_e(netHdl) ({ \
11874 MK_HDL tmpHdl=netHdl; \
11875 MK_RT tmp; \
11876 if (tmpHdl==0) { \
11877 tmp=NULL; \
11878 } else { \
11879 tmp=MkRuntimeHandleResolve(tmpHdl); \
11880 if (tmp==NULL) { \
11881 MkErrorSetC_1_NULL("ERROR: 'MkRuntimeC' handle is 'NULL'"); \
11882 goto error; \
11883 }; \
11884 }; \
11885 tmp; \
11886})

◆ MkRuntimeHandleResolve_NULL

#define MkRuntimeHandleResolve_NULL ( ...)
Value:

Definition at line 1793 of file kernel_overload_mk.h.

◆ MkRuntimeInstances

#define MkRuntimeInstances ( )
Value:
static MK_RT MkRuntimeInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkRuntimeS type …
#define MK_RT_CALL_ONLY

Definition at line 1809 of file kernel_overload_mk.h.

◆ MkRuntimeInstances_NULL

#define MkRuntimeInstances_NULL ( )
Value:

Definition at line 1808 of file kernel_overload_mk.h.

Typedef Documentation

◆ MK_RT

typedef struct MkRuntimeS* MK_RT

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

Definition at line 1550 of file LibMkKernel_mk.h.

◆ MK_RTN

typedef const struct MkRuntimeS* MK_RTN

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

Definition at line 1553 of file LibMkKernel_mk.h.

◆ MK_RTR

typedef struct MkRuntimeS MK_RTR

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

Definition at line 1556 of file LibMkKernel_mk.h.

Function Documentation

◆ MkRuntimeGetNull()

static MK_RT MkRuntimeGetNull ( void )
inlinestatic

Null-Slot - return a MkRuntimeC typed NULL instance …

Definition at line 11898 of file LibMkKernel_mk.h.

11898 {
11899 return (MK_RT)MK_NULL;
11900 }
#define MK_NULL
The Programming-Language-Micro-Kernel (PLMK) NULL value as MK_NULL in C …

◆ MkRuntimeGetNullP()

MK_RT MkRuntimeGetNullP ( void )

Non-inline replacement for MkRuntimeGetNull

◆ MkRuntimeHandleGet_RT()

static MK_HDL MkRuntimeHandleGet_RT ( MK_RT mkrt,
MK_RT const rt )
inlinestatic

Handle-Get-Slot - returns a export-hdl to the MkRuntimeC 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 MkRuntimeHandleResolve.

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]rtthe MkRuntimeS instance to work on - the mk-runtime argument, used by MK_RT_CALL (C-only)
Returns
the required export-hdl

Definition at line 11840 of file LibMkKernel_mk.h.

11843 {
11844 return MkObjectHandleGet(rt?MkOBJ(rt):NULL);
11845}
#define MkObjectHandleGet(...)
#define MkOBJ(x)
cast a known-object into an MkObjectS pointer

◆ MkRuntimeHandleGetP()

MK_HDL MkRuntimeHandleGetP ( MK_RT mkrt,
MK_RT const rt )

Non-inline replacement for MkRuntimeHandleGet

◆ MkRuntimeHandleResolve_RT()

static MK_RT MkRuntimeHandleResolve_RT ( MK_RT mkrt,
MK_HDL const netHdl )
inlinestatic

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

The MkRuntimeHandleResolve undo the MkRuntimeHandleGet 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 MkRuntimeHandleGet
Returns
the required handle or MK_NULL if netHdl is invalid

Definition at line 11857 of file LibMkKernel_mk.h.

11860 {
11861 return MkRt(MkObjectHandleResolve(netHdl));
11862}
#define MkObjectHandleResolve(...)
static MK_RT MkRt(MK_MNG mng)
cast a unknown-object into an MkRuntimeS pointer or NULL if not possible

◆ MkRuntimeHandleResolveP()

MK_RT MkRuntimeHandleResolveP ( MK_RT mkrt,
MK_HDL const netHdl )

Non-inline replacement for MkRuntimeHandleResolve

◆ MkRuntimeInstances_RT()

static MK_RT MkRuntimeInstances_RT ( MK_RT mkrt)
inlinestatic

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

The head-instance is the last instance created.

Definition at line 12862 of file LibMkKernel_mk.h.

12862 {
12864 return (MK_RT)MkRuntimeC_TT->instances;
12865}
#define MkRuntimeC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MK_STATIC_RT

◆ MkRuntimeInstancesP()

MK_RT MkRuntimeInstancesP ( MK_RT mkrt)

Non-inline replacement for MkRuntimeInstances

◆ MkRuntimeNext()

static MK_RT MkRuntimeNext ( MK_RT const rt)
inlinestatic

get next instance from linked-list of MkRuntimeS type

Definition at line 12869 of file LibMkKernel_mk.h.

12869 {
12870 MK_INSTANCE_HDL(rt);
12871 return (MK_RT)MkRuntimeC_X2obj(rt)->obj_protect.next;
12872}
#define MkRuntimeC_X2obj(x)
#define MK_INSTANCE_HDL(x)

◆ MkRuntimeNextP()

MK_RT MkRuntimeNextP ( MK_RT const rt)

Non-inline replacement for MkRuntimeNext

◆ MkRuntimePrev()

static MK_RT MkRuntimePrev ( MK_RT const rt)
inlinestatic

get previous instance from linked-list of MkRuntimeS type

Definition at line 12876 of file LibMkKernel_mk.h.

12876 {
12877 MK_INSTANCE_HDL(rt);
12878 return (MK_RT)MkRuntimeC_X2obj(rt)->obj_protect.prev;
12879}

◆ MkRuntimePrevP()

MK_RT MkRuntimePrevP ( MK_RT const rt)

Non-inline replacement for MkRuntimePrev