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

MkKernel PACKAGE - operate on a binary al struct of pointer and size … More...

+ Collaboration diagram for MkKernel_Binary_C_API:

Data Structures

struct  MkBinaryR
 binary data default format … More...
 

Functions

MkBinaryR MkBinaryCreate (MK_SIZE size, MK_BINN data)
 create a binary from data and size ...
 
bool MkBinaryIsNull (const MkBinaryR bin)
 check if binary is NULL ...
 
const MkBinaryR MkBinaryCreateSlice (const MkBinaryR bin, MK_SIZE start, MK_SIZE wide)
 create a binary slice ...
 
MkBinaryR MkBinaryDup_RT (MK_RT mkrt, const MkBinaryR bin)
 create a binary as duplicate from an already existsing MkBinaryR ...
 
void MkBinaryLog_RT (MK_RT mkrt, const MkBinaryR bin)
 get size from the binary ...
 
MK_BINN MkBinaryGetData (const MkBinaryR bin)
 get data pointer from the binary ...
 
MK_SIZE MkBinaryGetSize (const MkBinaryR bin)
 get size from the binary ...
 

MkKernel - MkKernel_Binary_C_API - function

MK_EXTERN MkBinaryR MkBinaryCreateP (MK_SIZE size, MK_BINN data)
 Non-inline replacement for MkBinaryCreate
 
MK_EXTERN MkBinaryR MkBinaryCreateSliceP (MkBinaryR const bin, MK_SIZE start, MK_SIZE wide)
 Non-inline replacement for MkBinaryCreateSlice
 
MK_EXTERN MkBinaryR MkBinaryDupP (MK_RT mkrt, MkBinaryR const bin)
 Non-inline replacement for MkBinaryDup
 
MK_EXTERN MK_BINN MkBinaryGetDataP (MkBinaryR const bin)
 Non-inline replacement for MkBinaryGetData
 
MK_EXTERN MK_SIZE MkBinaryGetSizeP (MkBinaryR const bin)
 Non-inline replacement for MkBinaryGetSize
 
MK_EXTERN MK_BOOL MkBinaryIsNullP (MkBinaryR const bin)
 Non-inline replacement for MkBinaryIsNull
 
MK_EXTERN void MkBinaryLogP (MK_RT mkrt, MkBinaryR const bin)
 Non-inline replacement for MkBinaryLog
 

MkKernel - MkKernel_Binary_C_API - overload

#define MkBinaryDup_NULL(...)
 
#define MkBinaryDup(...)
 
#define MkBinaryLog_NULL(...)
 
#define MkBinaryLog(...)
 

Detailed Description

MkKernel PACKAGE - operate on a binary al struct of pointer and size …

Attention
In general MkBinaryR is owned by the called function, to get your own copy use MkBinaryDup.

Macro Definition Documentation

◆ MkBinaryDup

#define MkBinaryDup ( ...)
Value:
MkBinaryR MkBinaryDup_RT(MK_RT mkrt, const MkBinaryR bin)
create a binary as duplicate from an already existsing MkBinaryR ...
#define MK_RT_CALL

Definition at line 1320 of file kernel_overload_mk.h.

◆ MkBinaryDup_NULL

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

Definition at line 1319 of file kernel_overload_mk.h.

◆ MkBinaryLog

#define MkBinaryLog ( ...)
Value:
void MkBinaryLog_RT(MK_RT mkrt, const MkBinaryR bin)
get size from the binary ...

Definition at line 1322 of file kernel_overload_mk.h.

◆ MkBinaryLog_NULL

#define MkBinaryLog_NULL ( ...)
Value:

Definition at line 1321 of file kernel_overload_mk.h.

Function Documentation

◆ MkBinaryCreate()

MkBinaryR MkBinaryCreate ( MK_SIZE size,
MK_BINN data )
inline

create a binary from data and size ...

Definition at line 1563 of file LibMkKernel_mk.h.

1563 {
1564 return (MkBinaryR) {size, data};
1565}
binary data default format …
+ Here is the caller graph for this function:

◆ MkBinaryCreateP()

MK_EXTERN MkBinaryR MkBinaryCreateP ( MK_SIZE size,
MK_BINN data )

Non-inline replacement for MkBinaryCreate

◆ MkBinaryCreateSlice()

const MkBinaryR MkBinaryCreateSlice ( const MkBinaryR bin,
MK_SIZE start,
MK_SIZE wide )
inline

create a binary slice ...

Definition at line 1575 of file LibMkKernel_mk.h.

1575 {
1576 if (start>bin.size)
1577 return (const MkBinaryR) {0, NULL};
1578 else
1579 return (const MkBinaryR) {start+wide>bin.size?bin.size-start:wide, bin.data+start};
1580}
MK_SIZE size
size of the data pointer
MK_BINN data
pointer to the binary data

◆ MkBinaryCreateSliceP()

MK_EXTERN MkBinaryR MkBinaryCreateSliceP ( MkBinaryR const bin,
MK_SIZE start,
MK_SIZE wide )

Non-inline replacement for MkBinaryCreateSlice

◆ MkBinaryDup_RT()

MkBinaryR MkBinaryDup_RT ( MK_RT mkrt,
const MkBinaryR bin )
inline

create a binary as duplicate from an already existsing MkBinaryR ...

Definition at line 12691 of file LibMkKernel_mk.h.

12691 {
12693 return MkBinaryCreate(bin.size,(MK_BIN)MkSysMemDup(MK_ERROR_PANIC,bin.data,(size_t)bin.size));
12694}
#define MK_ERROR_PANIC
MkBinaryR MkBinaryCreate(MK_SIZE size, MK_BINN data)
create a binary from data and size ...
MK_BINB * MK_BIN
byte-array pointer data-type with binary encoding (MK_BINN)
MK_EXTERN MK_PTR MkSysMemDup(MK_OBJN fmtobj, MK_PTRN const blck, size_t const size)
memdup syscall with libmkkernel error plugin
#define MK_CLASS_RT

◆ MkBinaryDupP()

MK_EXTERN MkBinaryR MkBinaryDupP ( MK_RT mkrt,
MkBinaryR const bin )

Non-inline replacement for MkBinaryDup

◆ MkBinaryGetData()

MK_BINN MkBinaryGetData ( const MkBinaryR bin)
inline

get data pointer from the binary ...

Definition at line 1592 of file LibMkKernel_mk.h.

1592 {
1593 return bin.data;
1594}

◆ MkBinaryGetDataP()

MK_EXTERN MK_BINN MkBinaryGetDataP ( MkBinaryR const bin)

Non-inline replacement for MkBinaryGetData

◆ MkBinaryGetSize()

MK_SIZE MkBinaryGetSize ( const MkBinaryR bin)
inline

get size from the binary ...

Definition at line 1598 of file LibMkKernel_mk.h.

1598 {
1599 return bin.size;
1600}

◆ MkBinaryGetSizeP()

MK_EXTERN MK_SIZE MkBinaryGetSizeP ( MkBinaryR const bin)

Non-inline replacement for MkBinaryGetSize

◆ MkBinaryIsNull()

bool MkBinaryIsNull ( const MkBinaryR bin)
inline

check if binary is NULL ...

Definition at line 1569 of file LibMkKernel_mk.h.

1569 {
1570 return bin.data == NULL;
1571}

◆ MkBinaryIsNullP()

MK_EXTERN MK_BOOL MkBinaryIsNullP ( MkBinaryR const bin)

Non-inline replacement for MkBinaryIsNull

◆ MkBinaryLog_RT()

void MkBinaryLog_RT ( MK_RT mkrt,
const MkBinaryR bin )
inline

get size from the binary ...

Definition at line 12697 of file LibMkKernel_mk.h.

12697 {
12699 MkLogV(MK_ERROR_FORMAT,__func__,0,"MkBinaryR: size=%li, data=%p\n", bin.size, bin.data);
12700}
#define MK_ERROR_FORMAT
#define MkLogV(...)

◆ MkBinaryLogP()

MK_EXTERN void MkBinaryLogP ( MK_RT mkrt,
MkBinaryR const bin )

Non-inline replacement for MkBinaryLog