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

MkBufferC - various functions to work on buffer-dataMore...

+ Collaboration diagram for MkBufferC_Misc_C_API:

Functions

MK_I32 MkBufferCmp_RT (MK_RT mkrt, MK_BUFN const buf1, MK_BUFN const buf2)
 compare TWO MkBufferC objects like strcmp do it for strings …
 
enum MkErrorE MkBufferCastTo_RT (MK_RT mkrt, MK_BUF const buf, enum MkTypeE const typ)
 change the type of an MkBufferC to type
 
MK_STRN MkBufferToString_RT (MK_RT mkrt, MK_BUFN const inst)
 String-Slot - returns the string representation of the inst
 
MK_BUF MkBufferSizeNew_RT (MK_RT mkrt, MK_BUF const buf, MK_NUM const size)
 alloc min size storage to the buf
 
MK_BUF MkBufferSizeAdd_RT (MK_RT mkrt, MK_BUF const buf, MK_NUM const size)
 add size storage to the buf
 
MK_BUF MkBufferReset_RT (MK_RT mkrt, MK_BUF const buf)
 reset a MkBufferC to the length zero …
 
void MkBufferResetFull_RT (MK_RT mkrt, MK_BUF const buf)
 reset a MkBufferC to the length zero and free allocated storage…
 
MK_BUF MkBufferCopy_RT (MK_RT mkrt, MK_BUF const buf, MK_BUFN const srce)
 copy the MkBufferC from srce to dest
 
MK_BUF MkBufferTemp_RT (MK_RT mkrt, MK_BUFN const buf)
 create a temporary copy of the MkBufferC buf …
 

MkBufferC - MkBufferC_Misc_C_API - overload

#define MkBufferCopy_NULL(...)
 
#define MkBufferCopy(...)
 
#define MkBufferReset_NULL(...)
 
#define MkBufferReset(...)
 
#define MkBufferSizeAdd_NULL(...)
 
#define MkBufferSizeAdd(...)
 
#define MkBufferSizeNew_NULL(...)
 
#define MkBufferSizeNew(...)
 
#define MkBufferTemp_NULL(...)
 
#define MkBufferTemp(...)
 
#define MkBufferCastTo_NULL(...)
 
#define MkBufferCastTo(...)
 
#define MkBufferCastTo_E(...)
 
#define MkBufferCastTo_C(...)
 
#define MkBufferCmp_NULL(...)
 
#define MkBufferCmp(...)
 
#define MkBufferResetFull_NULL(...)
 
#define MkBufferResetFull(...)
 
#define MkBufferToString_NULL(...)
 
#define MkBufferToString(...)
 

Detailed Description

MkBufferC - various functions to work on buffer-data

Macro Definition Documentation

◆ MkBufferCastTo

#define MkBufferCastTo ( ...)
Value:
enum MkErrorE MkBufferCastTo_RT(MK_RT mkrt, MK_BUF const buf, enum MkTypeE const typ)
change the type of an MkBufferC to type …
#define MK_RT_CALL

Definition at line 218 of file kernel_overload_mk.h.

◆ MkBufferCastTo_C

#define MkBufferCastTo_C ( ...)
Value:
if (MkErrorCheckI(MkBufferCastTo(__VA_ARGS__)))
#define MkErrorCheckI(err)
#define MkBufferCastTo(...)

Definition at line 220 of file kernel_overload_mk.h.

◆ MkBufferCastTo_E

#define MkBufferCastTo_E ( ...)
Value:
#define MkErrorCheck(err)
check return-code and goto error on error …

Definition at line 219 of file kernel_overload_mk.h.

◆ MkBufferCastTo_NULL

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

Definition at line 217 of file kernel_overload_mk.h.

◆ MkBufferCmp

#define MkBufferCmp ( ...)
Value:
MK_I32 MkBufferCmp_RT(MK_RT mkrt, MK_BUFN const buf1, MK_BUFN const buf2)
compare TWO MkBufferC objects like strcmp do it for strings …

Definition at line 222 of file kernel_overload_mk.h.

◆ MkBufferCmp_NULL

#define MkBufferCmp_NULL ( ...)
Value:

Definition at line 221 of file kernel_overload_mk.h.

◆ MkBufferCopy

#define MkBufferCopy ( ...)
Value:
MK_BUF MkBufferCopy_RT(MK_RT mkrt, MK_BUF const buf, MK_BUFN const srce)
copy the MkBufferC from srce to dest …

Definition at line 206 of file kernel_overload_mk.h.

◆ MkBufferCopy_NULL

#define MkBufferCopy_NULL ( ...)
Value:

Definition at line 205 of file kernel_overload_mk.h.

◆ MkBufferReset

#define MkBufferReset ( ...)
Value:
MK_BUF MkBufferReset_RT(MK_RT mkrt, MK_BUF const buf)
reset a MkBufferC to the length zero …

Definition at line 208 of file kernel_overload_mk.h.

◆ MkBufferReset_NULL

#define MkBufferReset_NULL ( ...)
Value:

Definition at line 207 of file kernel_overload_mk.h.

◆ MkBufferResetFull

#define MkBufferResetFull ( ...)
Value:
void MkBufferResetFull_RT(MK_RT mkrt, MK_BUF const buf)
reset a MkBufferC to the length zero and free allocated storage…

Definition at line 224 of file kernel_overload_mk.h.

◆ MkBufferResetFull_NULL

#define MkBufferResetFull_NULL ( ...)
Value:

Definition at line 223 of file kernel_overload_mk.h.

◆ MkBufferSizeAdd

#define MkBufferSizeAdd ( ...)
Value:
MK_BUF MkBufferSizeAdd_RT(MK_RT mkrt, MK_BUF const buf, MK_NUM const size)
add size storage to the buf …

Definition at line 210 of file kernel_overload_mk.h.

◆ MkBufferSizeAdd_NULL

#define MkBufferSizeAdd_NULL ( ...)
Value:

Definition at line 209 of file kernel_overload_mk.h.

◆ MkBufferSizeNew

#define MkBufferSizeNew ( ...)
Value:
MK_BUF MkBufferSizeNew_RT(MK_RT mkrt, MK_BUF const buf, MK_NUM const size)
alloc min size storage to the buf …

Definition at line 212 of file kernel_overload_mk.h.

◆ MkBufferSizeNew_NULL

#define MkBufferSizeNew_NULL ( ...)
Value:

Definition at line 211 of file kernel_overload_mk.h.

◆ MkBufferTemp

#define MkBufferTemp ( ...)
Value:
MK_BUF MkBufferTemp_RT(MK_RT mkrt, MK_BUFN const buf)
create a temporary copy of the MkBufferC buf …

Definition at line 214 of file kernel_overload_mk.h.

◆ MkBufferTemp_NULL

#define MkBufferTemp_NULL ( ...)
Value:

Definition at line 213 of file kernel_overload_mk.h.

◆ MkBufferToString

#define MkBufferToString ( ...)
Value:
MK_STRN MkBufferToString_RT(MK_RT mkrt, MK_BUFN const inst)
String-Slot - returns the string representation of the inst …

Definition at line 226 of file kernel_overload_mk.h.

◆ MkBufferToString_NULL

#define MkBufferToString_NULL ( ...)
Value:

Definition at line 225 of file kernel_overload_mk.h.

Function Documentation

◆ MkBufferCastTo_RT()

enum MkErrorE MkBufferCastTo_RT ( MK_RT mkrt,
MK_BUF const buf,
enum MkTypeE const typ )

change the type of an MkBufferC to type

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
[in]typcast buf to typ
Returns
The MkErrorE status from the DEFAULT MkErrorC in MkRuntimeS::error_mk

◆ MkBufferCmp_RT()

MK_I32 MkBufferCmp_RT ( MK_RT mkrt,
MK_BUFN const buf1,
MK_BUFN const buf2 )

compare TWO MkBufferC objects like strcmp do it for strings …

  1. if both types are equal than the native types are compared
  2. if both types are non-equal than the string representation of the types are compared
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]buf1the FIRST MkBufferC object to compare
[in]buf2the SECOND MkBufferC object to compare
Returns
Returns < 0 if buf1 is less than buf2; > 0 if buf1 is greater than buf2, and 0 if they are equal.

◆ MkBufferCopy_RT()

MK_BUF MkBufferCopy_RT ( MK_RT mkrt,
MK_BUF const buf,
MK_BUFN const srce )

copy the MkBufferC from srce to dest

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
srcesource of the copy
Returns
the dest object

◆ MkBufferReset_RT()

MK_BUF MkBufferReset_RT ( MK_RT mkrt,
MK_BUF const buf )

reset a MkBufferC to the length zero …

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
See also
(runtime) void MkBufferResetFull(MK_BUF const buf)

◆ MkBufferResetFull_RT()

void MkBufferResetFull_RT ( MK_RT mkrt,
MK_BUF const buf )

reset a MkBufferC to the length zero and free allocated storage…

In addition to (runtime) MK_BUF MkBufferReset(MK_BUF const buf) the allocated storage is freed and reset to ILS

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
See also
(runtime) MK_BUF MkBufferReset(MK_BUF const buf)

◆ MkBufferSizeAdd_RT()

MK_BUF MkBufferSizeAdd_RT ( MK_RT mkrt,
MK_BUF const buf,
MK_NUM const size )

add size storage to the buf

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
[in]sizeThe initial size of the instance-local-storage. The MkBufferC has dynamic-memory-management, the size value is just a hint to provide enought memory for future tasks. The real size created is the maximum of type-ILS-size and size . (default: 0 = use the type-ILS-size)
Returns
the input buf

◆ MkBufferSizeNew_RT()

MK_BUF MkBufferSizeNew_RT ( MK_RT mkrt,
MK_BUF const buf,
MK_NUM const size )

alloc min size storage to the buf

Returns
the input buf
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
[in]sizeThe initial size of the instance-local-storage. The MkBufferC has dynamic-memory-management, the size value is just a hint to provide enought memory for future tasks. The real size created is the maximum of type-ILS-size and size . (default: 0 = use the type-ILS-size)

◆ MkBufferTemp_RT()

MK_BUF MkBufferTemp_RT ( MK_RT mkrt,
MK_BUFN const buf )

create a temporary copy of the MkBufferC buf …

This function always return the same global memory from the per-thread-runtime-storage initialized with buf. This storage must not be freed and should only be used for temporary-short-time usage. In theory every function-call in the same thread could overwrite this memory.

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
buf- the source of the copy
Returns
the temporary buffer-object
Attention
(do not free) The memory of the out/return value belongs to the called libmkkernel function and therefore never becomes MK_NULL for a non-error result.
For details on the out/return value, see: MkKernel_Storage_C_API.

◆ MkBufferToString_RT()

MK_STRN MkBufferToString_RT ( MK_RT mkrt,
MK_BUFN const inst )

String-Slot - returns the string representation of the inst

The string is a human-readable form of the data stored in the object.

See also
slot: every class should provide a ToString function by default.
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]inst- the instance to work on
Returns
the requested string or "MK_NULL" on error
Note
(do not free) The memory of the out/return value belongs to the called libmkkernel function and therefore never becomes MK_NULL for a non-error result.
For details on the out/return value, see: MkKernel_Storage_C_API.