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

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
 
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

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

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

MkErrorC - Export - function

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

MkErrorC - Introspection - function

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

MkErrorC - Misc - function

MK_EXTERN 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:
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:
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 9369 of file LibMkKernel_mk.h.

9369#define MkErrorHandleResolve_e(netHdl) ({ \
9370 MK_HDL tmpHdl=netHdl; \
9371 MK_ERR tmp; \
9372 if (tmpHdl==0) { \
9373 tmp=NULL; \
9374 } else { \
9375 tmp=MkErrorHandleResolve(tmpHdl); \
9376 if (tmp==NULL) { \
9377 MkErrorSetC_1_NULL("ERROR: 'MkErrorC' handle is 'NULL'"); \
9378 goto error; \
9379 }; \
9380 }; \
9381 tmp; \
9382})

◆ MkErrorHandleResolve_NULL

#define MkErrorHandleResolve_NULL ( ...)
Value:

Definition at line 950 of file kernel_overload_mk.h.

◆ MkErrorInstances

#define MkErrorInstances ( )
Value:
MK_ERR MkErrorInstances_RT(MK_PARSER_RT_ONLY)
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:
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:
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 1449 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 1452 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 1455 of file LibMkKernel_mk.h.

Function Documentation

◆ MkErrorGetNull()

MK_ERR MkErrorGetNull ( void )
inline

Null-Slot - return a MkErrorC typed NULL instance …

Definition at line 9394 of file LibMkKernel_mk.h.

9394 {
9395 return (MK_ERR)MK_NULL;
9396 }
#define MK_NULL
The Programming-Language-Micro-Kernel (PLMK) NULL value as MK_NULL in C …

◆ MkErrorGetNullP()

MK_EXTERN MK_ERR MkErrorGetNullP ( void )

Non-inline replacement for MkErrorGetNull

◆ MkErrorHandleGet_RT()

MK_HDL MkErrorHandleGet_RT ( MK_RT mkrt,
MK_ERR const err )
inline

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.

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 9336 of file LibMkKernel_mk.h.

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

◆ MkErrorHandleGetP()

MK_EXTERN MK_HDL MkErrorHandleGetP ( MK_RT mkrt,
MK_ERR const err )

Non-inline replacement for MkErrorHandleGet

◆ MkErrorHandleResolve_RT()

MK_ERR MkErrorHandleResolve_RT ( MK_RT mkrt,
MK_HDL const netHdl )
inline

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 9353 of file LibMkKernel_mk.h.

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

◆ MkErrorHandleResolveP()

MK_EXTERN MK_ERR MkErrorHandleResolveP ( MK_RT mkrt,
MK_HDL const netHdl )

Non-inline replacement for MkErrorHandleResolve

◆ MkErrorInstances_RT()

MK_ERR MkErrorInstances_RT ( MK_PARSER_RT_ONLY )
inline

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

The head-instance is the last instance created.

Definition at line 12435 of file LibMkKernel_mk.h.

12435 {
12437 return (MK_ERR)MkErrorC_TT->instances;
12438}
#define MkErrorC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MK_CLASS_RT

◆ MkErrorInstancesP()

MK_EXTERN MK_ERR MkErrorInstancesP ( MK_PARSER_RT_ONLY )

Non-inline replacement for MkErrorInstances

◆ MkErrorNext()

MK_ERR MkErrorNext ( MK_ERR const err)
inline

get next instance from linked-list of MkErrorS type

Definition at line 12442 of file LibMkKernel_mk.h.

12442 {
12443 MK_INSTANCE_HDL(err);
12444 return (MK_ERR)MkErrorC_X2obj(err)->obj_protect.next;
12445}
#define MkErrorC_X2obj(x)
#define MK_INSTANCE_HDL(x)

◆ MkErrorNextP()

MK_EXTERN MK_ERR MkErrorNextP ( MK_ERR const err)

Non-inline replacement for MkErrorNext

◆ MkErrorPrev()

MK_ERR MkErrorPrev ( MK_ERR const err)
inline

get previous instance from linked-list of MkErrorS type

Definition at line 12449 of file LibMkKernel_mk.h.

12449 {
12450 MK_INSTANCE_HDL(err);
12451 return (MK_ERR)MkErrorC_X2obj(err)->obj_protect.prev;
12452}

◆ MkErrorPrevP()

MK_EXTERN MK_ERR MkErrorPrevP ( MK_ERR const err)

Non-inline replacement for MkErrorPrev