libmkkernel 9.0
Loading...
Searching...
No Matches
Functions

various functions to work on buffer-dataMore...

+ Collaboration diagram for MkBufferC_Misc_C_API:

Functions

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

Overload

#define MkBufferCopy(...)   MkBufferCopy_RT(MK_RT_CALL __VA_ARGS__)
 
#define MkBufferSizeAdd(...)   MkBufferSizeAdd_RT(MK_RT_CALL __VA_ARGS__)
 
#define MkBufferSizeNew(...)   MkBufferSizeNew_RT(MK_RT_CALL __VA_ARGS__)
 
#define MkBufferTemp(...)   MkBufferTemp_RT(MK_RT_CALL __VA_ARGS__)
 
#define MkBufferCastTo(...)   MkBufferCastTo_RT(MK_RT_CALL __VA_ARGS__)
 
#define MkBufferCastTo_E(...)   MkErrorCheck(MkBufferCastTo(__VA_ARGS__))
 
#define MkBufferCastTo_C(...)   if (MkErrorCheckI(MkBufferCastTo(__VA_ARGS__)))
 
#define MkBufferCmp(...)   MkBufferCmp_RT(MK_RT_CALL __VA_ARGS__)
 
#define MkBufferReset(...)   MkBufferReset_RT(MK_RT_CALL __VA_ARGS__)
 
#define MkBufferResetFull(...)   MkBufferResetFull_RT(MK_RT_CALL __VA_ARGS__)
 
#define MkBufferToString(...)   MkBufferToString_RT(MK_RT_CALL __VA_ARGS__)
 

Detailed Description

various functions to work on buffer-data

Macro Definition Documentation

◆ MkBufferCastTo

#define MkBufferCastTo (   ...)    MkBufferCastTo_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 949 of file kernel_overload_mk.h.

◆ MkBufferCastTo_C

#define MkBufferCastTo_C (   ...)    if (MkErrorCheckI(MkBufferCastTo(__VA_ARGS__)))

Definition at line 951 of file kernel_overload_mk.h.

◆ MkBufferCastTo_E

#define MkBufferCastTo_E (   ...)    MkErrorCheck(MkBufferCastTo(__VA_ARGS__))

Definition at line 950 of file kernel_overload_mk.h.

◆ MkBufferCmp

#define MkBufferCmp (   ...)    MkBufferCmp_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 952 of file kernel_overload_mk.h.

◆ MkBufferCopy

#define MkBufferCopy (   ...)    MkBufferCopy_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 942 of file kernel_overload_mk.h.

◆ MkBufferReset

#define MkBufferReset (   ...)    MkBufferReset_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 953 of file kernel_overload_mk.h.

◆ MkBufferResetFull

#define MkBufferResetFull (   ...)    MkBufferResetFull_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 954 of file kernel_overload_mk.h.

◆ MkBufferSizeAdd

#define MkBufferSizeAdd (   ...)    MkBufferSizeAdd_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 943 of file kernel_overload_mk.h.

◆ MkBufferSizeNew

#define MkBufferSizeNew (   ...)    MkBufferSizeNew_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 944 of file kernel_overload_mk.h.

◆ MkBufferTemp

#define MkBufferTemp (   ...)    MkBufferTemp_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 945 of file kernel_overload_mk.h.

◆ MkBufferToString

#define MkBufferToString (   ...)    MkBufferToString_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 955 of file kernel_overload_mk.h.

Function Documentation

◆ MkBufferCastTo_RT()

MK_EXTERN enum MkErrorE MkBufferCastTo_RT ( MK_RT const  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
set the MkErrorC to the status MK_OK, MK_CONTINUE or MK_ERROR

◆ MkBufferCmp_RT()

MK_EXTERN MK_INT MkBufferCmp_RT ( MK_RT const  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_EXTERN MK_BUF MkBufferCopy_RT ( MK_RT const  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_EXTERN void MkBufferReset_RT ( MK_RT const  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
void MkBufferResetFull(MK_BUF buf)

◆ MkBufferResetFull_RT()

MK_EXTERN void MkBufferResetFull_RT ( MK_RT const  mkrt,
MK_BUF const  buf 
)

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

In addition to void MkBufferReset(MK_BUF 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
void MkBufferReset(MK_BUF buf)

◆ MkBufferSizeAdd_RT()

MK_EXTERN MK_BUF MkBufferSizeAdd_RT ( MK_RT const  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_EXTERN MK_BUF MkBufferSizeNew_RT ( MK_RT const  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_EXTERN MK_BUF MkBufferTemp_RT ( MK_RT const  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
The memory of the out-value belongs to the called LibMkKernel function and therefore never becomes NULL. For details on the out-value, see: MkKernel_Storage_C_API.

◆ MkBufferToString_RT()

MK_EXTERN MK_STRN MkBufferToString_RT ( MK_RT const  mkrt,
MK_BUFN const  buf 
)

get the string representation of 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
Returns
the required string
Attention
~ The returned string is owned by self… do not free.
~ On error an empty string is returned.