theKernel 10.0
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 MkErrorSlibmkkernel::MK_ERR
 class-shortcut for struct MkErrorS *, all shortcut using the XX_YYY syntax (only for public API) …
 
typedef const struct MkErrorSlibmkkernel::MK_ERRN
 class-shortcut for const struct MkErrorS *, all const shortcut using the XX_YYYC syntax (only for public API) …
 
typedef struct MkErrorS libmkkernel::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 libmkkernel::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 libmkkernel::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 libmkkernel::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 libmkkernel::MkErrorInstances_RT (MK_RT mkrt)
 get head-instance from linked-list of MkErrorS type …
 
static MK_ERR libmkkernel::MkErrorNext (MK_ERR const err)
 get next instance from linked-list of MkErrorS type
 
static MK_ERR libmkkernel::MkErrorPrev (MK_ERR const err)
 get previous instance from linked-list of MkErrorS type
 

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:
MkErrorHandleGet_RT(MK_RT_CALL __VA_ARGS__)
#define MK_RT_CALL

Definition at line 952 of file kernel_overload_mk.h.

◆ MkErrorHandleGet_0E

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

Definition at line 953 of file kernel_overload_mk.h.

◆ MkErrorHandleGet_1M

#define MkErrorHandleGet_1M ( m)
Value:

Definition at line 954 of file kernel_overload_mk.h.

◆ MkErrorHandleGet_NULL

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

Definition at line 951 of file kernel_overload_mk.h.

◆ MkErrorHandleResolve

#define MkErrorHandleResolve ( ...)
Value:
MkErrorHandleResolve_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 948 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(...)

wrapper for MkErrorHandleResolve with error-handline

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

Definition at line 9934 of file LibMkKernel_mk.h.

9934
9936
9938// Class export & import
9939
9943 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkErrorC,null-return-allow)
9946 return (MK_ERR)MK_NULL;
9947 }
struct MkErrorS * MK_ERR
class-shortcut for struct MkErrorS *, all shortcut using the XX_YYY syntax (only for public API) …
static MK_ERR MkErrorGetNull(void)
Null-Slot - return a MkErrorC typed NULL instance …
#define mk_inline
#define MK_NULL
The Programming-Language-Micro-Kernel (PLMK) NULL value as MK_NULL in C++ …
#define __parser__pop__
parser: stop apply a list of local attributes to a block of code …
#define __parser__(...)
parser: apply an attribute to an object in local scope …
#define MK_ATTR_STATIC

◆ MkErrorHandleResolve_NULL

#define MkErrorHandleResolve_NULL ( ...)
Value:
MkErrorHandleResolve_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 947 of file kernel_overload_mk.h.

◆ MkErrorInstances

#define MkErrorInstances ( )
Value:
MkErrorInstances_RT(MK_RT_CALL_ONLY)
#define MK_RT_CALL_ONLY

Definition at line 971 of file kernel_overload_mk.h.

◆ MkErrorInstances_NULL

#define MkErrorInstances_NULL ( )
Value:
MkErrorInstances_RT(MK_RT_CALL_NULL_ONLY)
#define MK_RT_CALL_NULL_ONLY

Definition at line 970 of file kernel_overload_mk.h.

◆ MkErrorNext_0E

#define MkErrorNext_0E ( )
Value:
MkErrorNext(&MkERROR)

Definition at line 964 of file kernel_overload_mk.h.

◆ MkErrorNext_1M

#define MkErrorNext_1M ( m)
Value:
MkErrorNext(MkErrorFORMAT_1M(m))

Definition at line 965 of file kernel_overload_mk.h.

◆ MkErrorPrev_0E

#define MkErrorPrev_0E ( )
Value:
MkErrorPrev(&MkERROR)

Definition at line 966 of file kernel_overload_mk.h.

◆ MkErrorPrev_1M

#define MkErrorPrev_1M ( m)
Value:
MkErrorPrev(MkErrorFORMAT_1M(m))

Definition at line 967 of file kernel_overload_mk.h.

Typedef Documentation

◆ MK_ERR

typedef struct MkErrorS* libmkkernel::MK_ERR

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

Definition at line 1576 of file LibMkKernel_mk.h.

◆ MK_ERRN

typedef const struct MkErrorS* libmkkernel::MK_ERRN

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

Definition at line 1579 of file LibMkKernel_mk.h.

◆ MK_ERRR

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

Definition at line 1582 of file LibMkKernel_mk.h.

Function Documentation

◆ MkErrorGetNull()

static MK_ERR libmkkernel::MkErrorGetNull ( void )
inlinestatic

Null-Slot - return a MkErrorC typed NULL instance …

Definition at line 9959 of file LibMkKernel_mk.h.

+ Here is the caller graph for this function:

◆ MkErrorHandleGet_RT()

static MK_HDL libmkkernel::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 9901 of file LibMkKernel_mk.h.

◆ MkErrorHandleResolve_RT()

static MK_ERR libmkkernel::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 9918 of file LibMkKernel_mk.h.

9920 { \
9921 MK_HDL tmpHdl=netHdl; \
9922 MK_ERR tmp; \
9923 if (tmpHdl==0) { \
int32_t MK_HDL
4 byte int handle data-type

◆ MkErrorInstances_RT()

static MK_ERR libmkkernel::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 13301 of file LibMkKernel_mk.h.

13301 {
13302 MK_INSTANCE_HDL(err);
13303 return (MK_ERR)MkErrorC_X2obj(err)->obj_protect.prev;
13304}
#define MkErrorC_X2obj(x)
#define MK_INSTANCE_HDL(x)

◆ MkErrorNext()

static MK_ERR libmkkernel::MkErrorNext ( MK_ERR const err)
inlinestatic

get next instance from linked-list of MkErrorS type

Definition at line 13308 of file LibMkKernel_mk.h.

+ Here is the caller graph for this function:

◆ MkErrorPrev()

static MK_ERR libmkkernel::MkErrorPrev ( MK_ERR const err)
inlinestatic

get previous instance from linked-list of MkErrorS type

Definition at line 13315 of file LibMkKernel_mk.h.

+ Here is the caller graph for this function: