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

MkErrorC - define the class … More...

+ Collaboration diagram for MkErrorC_Class_C_API:

Topics

 MkErrorC_Class_Define_C_API
 MkErrorC - low level definition, access and cast …
 

Typedefs

typedef struct MkErrorSMK_ERR
 class-shortcut for struct MkErrorS *, all shortcut using the XX_YYY syntax (only for public API) …
 
typedef const struct MkErrorSMK_ERRN
 class-shortcut for const struct MkErrorS *, all const shortcut using the XX_YYYC syntax (only for public API) …
 
typedef struct MkErrorS MK_ERRR
 reference-shortcut for struct MkErrorS, all shortcut using the XX_YYYR syntax (only for public API) …
 

MkErrorC - Export - inline - interact with an external software

static MK_HDL MkErrorHandleGet_RT (MK_RT mkrt, MK_ERR const err)
 Handle-Get-Slot - returns a export-hdl to the MkErrorC useable for external storage
 
static MK_ERR MkErrorHandleResolve_RT (MK_RT mkrt, MK_HDL const netHdl)
 Handle-Resolve-Slot - return a MkErrorC from netHdl or MK_NULL if invalid…
 
#define MkErrorHandleResolve_e(netHdl)
 wrapper for MkErrorHandleResolve with error-handline
 

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

static MK_ERR MkErrorGetNull (void)
 Null-Slot - return a MkErrorC typed NULL instance …
 

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

static MK_ERR MkErrorInstances_RT (MK_RT mkrt)
 get head-instance from linked-list of MkErrorS type …
 
static MK_ERR MkErrorNext (MK_ERR const err)
 get next instance from linked-list of MkErrorS type
 
static MK_ERR MkErrorPrev (MK_ERR const err)
 get previous instance from linked-list of MkErrorS type
 

MkErrorC - Export - function

MK_ERR MkErrorHandleResolveP (MK_RT mkrt, MK_HDL const netHdl)
 Non-inline replacement for MkErrorHandleResolve
 
MK_HDL MkErrorHandleGetP (MK_RT mkrt, MK_ERR const err)
 Non-inline replacement for MkErrorHandleGet
 

MkErrorC - Introspection - function

MK_ERR MkErrorNextP (MK_ERR const err)
 Non-inline replacement for MkErrorNext
 
MK_ERR MkErrorPrevP (MK_ERR const err)
 Non-inline replacement for MkErrorPrev
 
MK_ERR MkErrorInstancesP (MK_RT mkrt)
 Non-inline replacement for MkErrorInstances
 

MkErrorC - Misc - function

MK_ERR MkErrorGetNullP (void)
 Non-inline replacement for MkErrorGetNull
 

MkErrorC - Export - overload

#define MkErrorHandleResolve_NULL(...)
 
#define MkErrorHandleResolve(...)
 
#define MkErrorHandleGet_NULL(...)
 
#define MkErrorHandleGet(...)
 
#define MkErrorHandleGet_0E()
 
#define MkErrorHandleGet_1M(m)
 

MkErrorC - Introspection - overload

#define MkErrorNext_0E()
 
#define MkErrorNext_1M(m)
 
#define MkErrorPrev_0E()
 
#define MkErrorPrev_1M(m)
 
#define MkErrorInstances_NULL()
 
#define MkErrorInstances()
 

Detailed Description

MkErrorC - define the class …

Macro Definition Documentation

◆ MkErrorHandleGet

#define MkErrorHandleGet ( ...)
Value:
static MK_HDL MkErrorHandleGet_RT(MK_RT mkrt, MK_ERR const err)
Handle-Get-Slot - returns a export-hdl to the MkErrorC useable for external storage
#define MK_RT_CALL

Definition at line 955 of file kernel_overload_mk.h.

◆ MkErrorHandleGet_0E

#define MkErrorHandleGet_0E ( )
Value:
#define MkErrorHandleGet(...)
#define MkERROR

Definition at line 956 of file kernel_overload_mk.h.

◆ MkErrorHandleGet_1M

#define MkErrorHandleGet_1M ( m)
Value:

Definition at line 957 of file kernel_overload_mk.h.

◆ MkErrorHandleGet_NULL

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

Definition at line 954 of file kernel_overload_mk.h.

◆ MkErrorHandleResolve

#define MkErrorHandleResolve ( ...)
Value:
static MK_ERR MkErrorHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkErrorC from netHdl or MK_NULL if invalid…

Definition at line 951 of file kernel_overload_mk.h.

◆ MkErrorHandleResolve_e

#define MkErrorHandleResolve_e ( netHdl)
Value:
({ \
MK_HDL tmpHdl=netHdl; \
MK_ERR tmp; \
if (tmpHdl==0) { \
tmp=NULL; \
} else { \
tmp=MkErrorHandleResolve(tmpHdl); \
if (tmp==NULL) { \
MkErrorSetC_1_NULL("ERROR: 'MkErrorC' handle is 'NULL'"); \
goto error; \
}; \
}; \
tmp; \
})
#define MkErrorHandleResolve(...)
int32_t MK_HDL
4 byte int handle data-type
The data-type to store and handle the error-condition …

wrapper for MkErrorHandleResolve with error-handline

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

Definition at line 9922 of file LibMkKernel_mk.h.

9922#define MkErrorHandleResolve_e(netHdl) ({ \
9923 MK_HDL tmpHdl=netHdl; \
9924 MK_ERR tmp; \
9925 if (tmpHdl==0) { \
9926 tmp=NULL; \
9927 } else { \
9928 tmp=MkErrorHandleResolve(tmpHdl); \
9929 if (tmp==NULL) { \
9930 MkErrorSetC_1_NULL("ERROR: 'MkErrorC' handle is 'NULL'"); \
9931 goto error; \
9932 }; \
9933 }; \
9934 tmp; \
9935})

◆ MkErrorHandleResolve_NULL

#define MkErrorHandleResolve_NULL ( ...)
Value:

Definition at line 950 of file kernel_overload_mk.h.

◆ MkErrorInstances

#define MkErrorInstances ( )
Value:
static MK_ERR MkErrorInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkErrorS type …
#define MK_RT_CALL_ONLY

Definition at line 974 of file kernel_overload_mk.h.

◆ MkErrorInstances_NULL

#define MkErrorInstances_NULL ( )
Value:

Definition at line 973 of file kernel_overload_mk.h.

◆ MkErrorNext_0E

#define MkErrorNext_0E ( )
Value:
static MK_ERR MkErrorNext(MK_ERR const err)
get next instance from linked-list of MkErrorS type

Definition at line 967 of file kernel_overload_mk.h.

◆ MkErrorNext_1M

#define MkErrorNext_1M ( m)
Value:

Definition at line 968 of file kernel_overload_mk.h.

◆ MkErrorPrev_0E

#define MkErrorPrev_0E ( )
Value:
static MK_ERR MkErrorPrev(MK_ERR const err)
get previous instance from linked-list of MkErrorS type

Definition at line 969 of file kernel_overload_mk.h.

◆ MkErrorPrev_1M

#define MkErrorPrev_1M ( m)
Value:

Definition at line 970 of file kernel_overload_mk.h.

Typedef Documentation

◆ MK_ERR

typedef struct MkErrorS* MK_ERR

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

Definition at line 1578 of file LibMkKernel_mk.h.

◆ MK_ERRN

typedef const struct MkErrorS* MK_ERRN

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

Definition at line 1581 of file LibMkKernel_mk.h.

◆ MK_ERRR

typedef struct MkErrorS MK_ERRR

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

Definition at line 1584 of file LibMkKernel_mk.h.

Function Documentation

◆ MkErrorGetNull()

static MK_ERR MkErrorGetNull ( void )
inlinestatic

Null-Slot - return a MkErrorC typed NULL instance …

Definition at line 9947 of file LibMkKernel_mk.h.

9947 {
9948 return (MK_ERR)MK_NULL;
9949 }
#define MK_NULL
The Programming-Language-Micro-Kernel (PLMK) NULL value as MK_NULL in C …

◆ MkErrorGetNullP()

MK_ERR MkErrorGetNullP ( void )

Non-inline replacement for MkErrorGetNull

◆ MkErrorHandleGet_RT()

static MK_HDL MkErrorHandleGet_RT ( MK_RT mkrt,
MK_ERR const err )
inlinestatic

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

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]errthe MkErrorS instance to work on - the default-error is automatically created on startup. (NULL allowed)
Returns
the required export-hdl

Definition at line 9889 of file LibMkKernel_mk.h.

9892 {
9893 return MkObjectHandleGet(err?MkOBJ(err):NULL);
9894}
#define MkObjectHandleGet(...)
#define MkOBJ(x)
cast a known-object into an MkObjectS pointer

◆ MkErrorHandleGetP()

MK_HDL MkErrorHandleGetP ( MK_RT mkrt,
MK_ERR const err )

Non-inline replacement for MkErrorHandleGet

◆ MkErrorHandleResolve_RT()

static MK_ERR MkErrorHandleResolve_RT ( MK_RT mkrt,
MK_HDL const netHdl )
inlinestatic

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

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

Definition at line 9906 of file LibMkKernel_mk.h.

9909 {
9910 return MkErr(MkObjectHandleResolve(netHdl));
9911}
static MK_ERR MkErr(MK_MNG mng)
cast a unknown-object into an MkErrorS pointer or NULL if not possible
#define MkObjectHandleResolve(...)

◆ MkErrorHandleResolveP()

MK_ERR MkErrorHandleResolveP ( MK_RT mkrt,
MK_HDL const netHdl )

Non-inline replacement for MkErrorHandleResolve

◆ MkErrorInstances_RT()

static MK_ERR MkErrorInstances_RT ( MK_RT mkrt)
inlinestatic

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

The head-instance is the last instance created.

Definition at line 13271 of file LibMkKernel_mk.h.

13271 {
13274}
#define MkErrorC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MK_STATIC_RT
static MK_OBJ MkTypeInstances(MK_TYP const typ)
access the instance attribute of the type…

◆ MkErrorInstancesP()

MK_ERR MkErrorInstancesP ( MK_RT mkrt)

Non-inline replacement for MkErrorInstances

◆ MkErrorNext()

static MK_ERR MkErrorNext ( MK_ERR const err)
inlinestatic

get next instance from linked-list of MkErrorS type

Definition at line 13278 of file LibMkKernel_mk.h.

13278 {
13279 MK_INSTANCE_HDL(err);
13280 return (MK_ERR)MkErrorC_X2obj(err)->obj_protect.next;
13281}
#define MkErrorC_X2obj(x)
#define MK_INSTANCE_HDL(x)

◆ MkErrorNextP()

MK_ERR MkErrorNextP ( MK_ERR const err)

Non-inline replacement for MkErrorNext

◆ MkErrorPrev()

static MK_ERR MkErrorPrev ( MK_ERR const err)
inlinestatic

get previous instance from linked-list of MkErrorS type

Definition at line 13285 of file LibMkKernel_mk.h.

13285 {
13286 MK_INSTANCE_HDL(err);
13287 return (MK_ERR)MkErrorC_X2obj(err)->obj_protect.prev;
13288}

◆ MkErrorPrevP()

MK_ERR MkErrorPrevP ( MK_ERR const err)

Non-inline replacement for MkErrorPrev