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

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

MkKernel - MkKernel_Binary_C_API - function

MkBinaryR MkBinaryCreateP (MK_SIZE size, MK_BINN data)
 Non-inline replacement for MkBinaryCreate
 
MkBinaryR MkBinaryCreateSliceP (MkBinaryR const bin, MK_SIZE start, MK_SIZE wide)
 Non-inline replacement for MkBinaryCreateSlice
 
MkBinaryR MkBinaryDupP (MK_RT mkrt, MkBinaryR const bin)
 Non-inline replacement for MkBinaryDup
 
MK_BINN MkBinaryGetDataP (MkBinaryR const bin)
 Non-inline replacement for MkBinaryGetData
 
MK_SIZE MkBinaryGetSizeP (MkBinaryR const bin)
 Non-inline replacement for MkBinaryGetSize
 
MK_BOOL MkBinaryIsNullP (MkBinaryR const bin)
 Non-inline replacement for MkBinaryIsNull
 
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:
static 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 1351 of file kernel_overload_mk.h.

◆ MkBinaryDup_NULL

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

Definition at line 1350 of file kernel_overload_mk.h.

◆ MkBinaryLog

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

Definition at line 1353 of file kernel_overload_mk.h.

◆ MkBinaryLog_NULL

#define MkBinaryLog_NULL ( ...)
Value:

Definition at line 1352 of file kernel_overload_mk.h.

Function Documentation

◆ MkBinaryCreate()

static MkBinaryR MkBinaryCreate ( MK_SIZE size,
MK_BINN data )
inlinestatic

create a binary from data and size ...

Definition at line 1692 of file LibMkKernel_mk.h.

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

◆ MkBinaryCreateP()

MkBinaryR MkBinaryCreateP ( MK_SIZE size,
MK_BINN data )

Non-inline replacement for MkBinaryCreate

◆ MkBinaryCreateSlice()

static const MkBinaryR MkBinaryCreateSlice ( const MkBinaryR bin,
MK_SIZE start,
MK_SIZE wide )
inlinestatic

create a binary slice ...

Definition at line 1704 of file LibMkKernel_mk.h.

1704 {
1705 if (start>bin.size)
1706 return (const MkBinaryR) {0, NULL};
1707 else
1708 return (const MkBinaryR) {start+wide>bin.size?bin.size-start:wide, bin.data+start};
1709}
MK_SIZE size
size of the data pointer
MK_BINN data
pointer to the binary data

◆ MkBinaryCreateSliceP()

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

Non-inline replacement for MkBinaryCreateSlice

◆ MkBinaryDup_RT()

static MkBinaryR MkBinaryDup_RT ( MK_RT mkrt,
const MkBinaryR bin )
inlinestatic

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

Definition at line 13536 of file LibMkKernel_mk.h.

13536 {
13538 return MkBinaryCreate(bin.size,(MK_BIN)MkSysMemDup(MK_ERROR_PANIC,bin.data,(size_t)bin.size));
13539}
#define MK_ERROR_PANIC
static 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_PTR MkSysMemDup(MK_OBJN fmtobj, MK_PTRN const blck, size_t const size)
memdup syscall with libmkkernel error plugin
#define MK_STATIC_RT

◆ MkBinaryDupP()

MkBinaryR MkBinaryDupP ( MK_RT mkrt,
MkBinaryR const bin )

Non-inline replacement for MkBinaryDup

◆ MkBinaryGetData()

static MK_BINN MkBinaryGetData ( const MkBinaryR bin)
inlinestatic

get data pointer from the binary ...

Definition at line 1721 of file LibMkKernel_mk.h.

1721 {
1722 return bin.data;
1723}

◆ MkBinaryGetDataP()

MK_BINN MkBinaryGetDataP ( MkBinaryR const bin)

Non-inline replacement for MkBinaryGetData

◆ MkBinaryGetSize()

static MK_SIZE MkBinaryGetSize ( const MkBinaryR bin)
inlinestatic

get size from the binary ...

Definition at line 1727 of file LibMkKernel_mk.h.

1727 {
1728 return bin.size;
1729}

◆ MkBinaryGetSizeP()

MK_SIZE MkBinaryGetSizeP ( MkBinaryR const bin)

Non-inline replacement for MkBinaryGetSize

◆ MkBinaryIsNull()

static bool MkBinaryIsNull ( const MkBinaryR bin)
inlinestatic

check if binary is NULL ...

Definition at line 1698 of file LibMkKernel_mk.h.

1698 {
1699 return bin.data == NULL;
1700}

◆ MkBinaryIsNullP()

MK_BOOL MkBinaryIsNullP ( MkBinaryR const bin)

Non-inline replacement for MkBinaryIsNull

◆ MkBinaryLog_RT()

static void MkBinaryLog_RT ( MK_RT mkrt,
const MkBinaryR bin )
inlinestatic

get size from the binary ...

Definition at line 13542 of file LibMkKernel_mk.h.

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

◆ MkBinaryLogP()

void MkBinaryLogP ( MK_RT mkrt,
MkBinaryR const bin )

Non-inline replacement for MkBinaryLog