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

MkBufferC - define the class … More...

+ Collaboration diagram for MkBufferC_Class_C_API:

Topics

 MkBufferC_Class_Define_C_API
 MkBufferC - low level definition, access and cast …
 

Typedefs

typedef struct MkBufferSMK_BUF
 class-shortcut for struct MkBufferS *, all shortcut using the XX_YYY syntax (only for public API) …
 
typedef const struct MkBufferSMK_BUFN
 class-shortcut for const struct MkBufferS *, all const shortcut using the XX_YYYC syntax (only for public API) …
 
typedef struct MkBufferS MK_BUFR
 reference-shortcut for struct MkBufferS, all shortcut using the XX_YYYR syntax (only for public API) …
 

MkBufferC - Export - inline - interact with an external software

MK_HDL MkBufferHandleGet_RT (MK_RT mkrt, MK_BUF const buf)
 Handle-Get-Slot - returns a export-hdl to the MkBufferC useable for external storage
 
MK_BUF MkBufferHandleResolve_RT (MK_RT mkrt, MK_HDL const netHdl)
 Handle-Resolve-Slot - return a MkBufferC from netHdl or MK_NULL if invalid…
 
#define MkBufferHandleResolve_e(netHdl)
 wrapper for MkBufferHandleResolve with error-handline
 

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

MK_BUF MkBufferGetNull (void)
 Null-Slot - return a MkBufferC typed NULL instance …
 

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

MK_BUF MkBufferInstances_RT (MK_PARSER_RT_ONLY)
 get head-instance from linked-list of MkBufferS type …
 
MK_BUF MkBufferNext (MK_BUF const buf)
 get next instance from linked-list of MkBufferS type
 
MK_BUF MkBufferPrev (MK_BUF const buf)
 get previous instance from linked-list of MkBufferS type
 

MkBufferC - Export - function

MK_EXTERN MK_BUF MkBufferHandleResolveP (MK_RT mkrt, MK_HDL const netHdl)
 Non-inline replacement for MkBufferHandleResolve
 
MK_EXTERN MK_HDL MkBufferHandleGetP (MK_RT mkrt, MK_BUF const buf)
 Non-inline replacement for MkBufferHandleGet
 

MkBufferC - Introspection - function

MK_EXTERN MK_BUF MkBufferNextP (MK_BUF const buf)
 Non-inline replacement for MkBufferNext
 
MK_EXTERN MK_BUF MkBufferPrevP (MK_BUF const buf)
 Non-inline replacement for MkBufferPrev
 
MK_EXTERN MK_BUF MkBufferInstancesP (MK_PARSER_RT_ONLY)
 Non-inline replacement for MkBufferInstances
 

MkBufferC - Misc - function

MK_EXTERN MK_BUF MkBufferGetNullP (void)
 Non-inline replacement for MkBufferGetNull
 

MkBufferC - Export - overload

#define MkBufferHandleResolve_NULL(...)
 
#define MkBufferHandleResolve(...)
 
#define MkBufferHandleGet_NULL(...)
 
#define MkBufferHandleGet(...)
 

MkBufferC - Introspection - overload

#define MkBufferInstances_NULL()
 
#define MkBufferInstances()
 

Detailed Description

MkBufferC - define the class …

Macro Definition Documentation

◆ MkBufferHandleGet

#define MkBufferHandleGet ( ...)
Value:
MK_HDL MkBufferHandleGet_RT(MK_RT mkrt, MK_BUF const buf)
Handle-Get-Slot - returns a export-hdl to the MkBufferC useable for external storage
#define MK_RT_CALL

Definition at line 58 of file kernel_overload_mk.h.

◆ MkBufferHandleGet_NULL

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

Definition at line 57 of file kernel_overload_mk.h.

◆ MkBufferHandleResolve

#define MkBufferHandleResolve ( ...)
Value:
MK_BUF MkBufferHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkBufferC from netHdl or MK_NULL if invalid…

Definition at line 54 of file kernel_overload_mk.h.

◆ MkBufferHandleResolve_e

#define MkBufferHandleResolve_e ( netHdl)
Value:
({ \
MK_HDL tmpHdl=netHdl; \
MK_BUF tmp; \
if (tmpHdl==0) { \
tmp=NULL; \
} else { \
tmp=MkBufferHandleResolve(tmpHdl); \
if (tmp==NULL) { \
MkErrorSetC_1_NULL("ERROR: 'MkBufferC' handle is 'NULL'"); \
goto error; \
}; \
}; \
tmp; \
})
#define MkBufferHandleResolve(...)
int32_t MK_HDL
4 byte int handle data-type
The ABSTRACT-CLASS used to store a native-type-data-item defined by PRIMITIVE TYPE …

wrapper for MkBufferHandleResolve with error-handline

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

Definition at line 5478 of file LibMkKernel_mk.h.

5478#define MkBufferHandleResolve_e(netHdl) ({ \
5479 MK_HDL tmpHdl=netHdl; \
5480 MK_BUF tmp; \
5481 if (tmpHdl==0) { \
5482 tmp=NULL; \
5483 } else { \
5484 tmp=MkBufferHandleResolve(tmpHdl); \
5485 if (tmp==NULL) { \
5486 MkErrorSetC_1_NULL("ERROR: 'MkBufferC' handle is 'NULL'"); \
5487 goto error; \
5488 }; \
5489 }; \
5490 tmp; \
5491})

◆ MkBufferHandleResolve_NULL

#define MkBufferHandleResolve_NULL ( ...)
Value:

Definition at line 53 of file kernel_overload_mk.h.

◆ MkBufferInstances

#define MkBufferInstances ( )
Value:
MK_BUF MkBufferInstances_RT(MK_PARSER_RT_ONLY)
get head-instance from linked-list of MkBufferS type …
#define MK_RT_CALL_ONLY

Definition at line 69 of file kernel_overload_mk.h.

◆ MkBufferInstances_NULL

#define MkBufferInstances_NULL ( )
Value:

Definition at line 68 of file kernel_overload_mk.h.

Typedef Documentation

◆ MK_BUF

typedef struct MkBufferS* MK_BUF

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

Definition at line 1393 of file LibMkKernel_mk.h.

◆ MK_BUFN

typedef const struct MkBufferS* MK_BUFN

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

Definition at line 1396 of file LibMkKernel_mk.h.

◆ MK_BUFR

typedef struct MkBufferS MK_BUFR

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

Definition at line 1399 of file LibMkKernel_mk.h.

Function Documentation

◆ MkBufferGetNull()

MK_BUF MkBufferGetNull ( void )
inline

Null-Slot - return a MkBufferC typed NULL instance …

Definition at line 5503 of file LibMkKernel_mk.h.

5503 {
5504 return (MK_BUF)MK_NULL;
5505 }
#define MK_NULL
The Programming-Language-Micro-Kernel (PLMK) NULL value as MK_NULL in C …

◆ MkBufferGetNullP()

MK_EXTERN MK_BUF MkBufferGetNullP ( void )

Non-inline replacement for MkBufferGetNull

◆ MkBufferHandleGet_RT()

MK_HDL MkBufferHandleGet_RT ( MK_RT mkrt,
MK_BUF const buf )
inline

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

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]bufthe MkBufferS instance to work on
Returns
the required export-hdl

Definition at line 5445 of file LibMkKernel_mk.h.

5448 {
5449 return MkObjectHandleGet(buf?MkOBJ(buf):NULL);
5450}
#define MkObjectHandleGet(...)
#define MkOBJ(x)
cast a known-object into an MkObjectS pointer

◆ MkBufferHandleGetP()

MK_EXTERN MK_HDL MkBufferHandleGetP ( MK_RT mkrt,
MK_BUF const buf )

Non-inline replacement for MkBufferHandleGet

◆ MkBufferHandleResolve_RT()

MK_BUF MkBufferHandleResolve_RT ( MK_RT mkrt,
MK_HDL const netHdl )
inline

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

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

Definition at line 5462 of file LibMkKernel_mk.h.

5465 {
5466 return MkBuf(MkObjectHandleResolve(netHdl));
5467}
MK_BUF MkBuf(MK_MNG mng)
cast a unknown-object into an MkBufferS pointer or NULL if not possible
#define MkObjectHandleResolve(...)

◆ MkBufferHandleResolveP()

MK_EXTERN MK_BUF MkBufferHandleResolveP ( MK_RT mkrt,
MK_HDL const netHdl )

Non-inline replacement for MkBufferHandleResolve

◆ MkBufferInstances_RT()

MK_BUF MkBufferInstances_RT ( MK_PARSER_RT_ONLY )
inline

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

The head-instance is the last instance created.

Definition at line 12363 of file LibMkKernel_mk.h.

12363 {
12365 return (MK_BUF)MkBufferC_TT->instances;
12366}
#define MkBufferC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MK_CLASS_RT

◆ MkBufferInstancesP()

MK_EXTERN MK_BUF MkBufferInstancesP ( MK_PARSER_RT_ONLY )

Non-inline replacement for MkBufferInstances

◆ MkBufferNext()

MK_BUF MkBufferNext ( MK_BUF const buf)
inline

get next instance from linked-list of MkBufferS type

Definition at line 12370 of file LibMkKernel_mk.h.

12370 {
12371 MK_INSTANCE_HDL(buf);
12372 return (MK_BUF)MkBufferC_X2obj(buf)->obj_protect.next;
12373}
#define MkBufferC_X2obj(x)
#define MK_INSTANCE_HDL(x)

◆ MkBufferNextP()

MK_EXTERN MK_BUF MkBufferNextP ( MK_BUF const buf)

Non-inline replacement for MkBufferNext

◆ MkBufferPrev()

MK_BUF MkBufferPrev ( MK_BUF const buf)
inline

get previous instance from linked-list of MkBufferS type

Definition at line 12377 of file LibMkKernel_mk.h.

12377 {
12378 MK_INSTANCE_HDL(buf);
12379 return (MK_BUF)MkBufferC_X2obj(buf)->obj_protect.prev;
12380}

◆ MkBufferPrevP()

MK_EXTERN MK_BUF MkBufferPrevP ( MK_BUF const buf)

Non-inline replacement for MkBufferPrev