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

MkBufferC - the abstract class known as buf or buffer is used to create and manage dynamic, generic, mixed typed data. … More...

+ Collaboration diagram for MkBufferC_C_API:

Topics

 MkBuffer64C
 MkBuffer64S - the final class of abstract class MkBufferC with 64 byte ILS-Size
 
 MkBuffer256C
 MkBuffer256S - the final class of abstract class MkBufferC with 256 byte ILS-Size
 
 MkBuffer1024C
 MkBuffer1024S - the final class of abstract class MkBufferC with 1024 byte ILS-Size
 
 MkBufferC_Class_C_API
 MkBufferC - define the class …
 
 MkBufferC_TOR_C_API
 MkBufferC - various functions to create, initialize and destroy a MkBufferC
 
 MkBufferC_Get_C_API
 MkBufferC - various functions to get buffer-data
 
 MkBufferC_Set_C_API
 MkBufferC - various functions to set buffer-data
 
 MkBufferC_Info_C_API
 MkBufferC - various functions to get information out of buffer-data
 
 MkBufferC_Access_C_API
 MkBufferC - various functions to access buffer-data
 
 MkBufferC_Misc_C_API
 MkBufferC - various functions to work on buffer-data
 
 MkKernel_String_C_API
 MkKernel PACKAGE - operate on a string as struct of pointer and size …
 

Data Structures

struct  MkBufferS
 The ABSTRACT-CLASS used to store a native-type-data-item defined by PRIMITIVE TYPEMore...
 

Macros

#define MkBufferS_ils_size   (0)
 64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
 

MkBuf2TTfast

MkBufferC - get a native PRIMITIVE TYPE from the MkBufferS

Attention
these function is only required in an non-alignment environment …
#define MkBuf2XXXfast(buf)
 
#define MkBuf2BOLfast(buf)
 
#define MkBuf2I8fast(buf)
 
#define MkBuf2I16fast(buf)
 
#define MkBuf2I32fast(buf)
 
#define MkBuf2I64fast(buf)
 
#define MkBuf2FLTfast(buf)
 
#define MkBuf2DBLfast(buf)
 

MkBuf2TT

get a native PRIMITIVE TYPE from a non-aligned MkBufferC

the alligned would be: ((*buf->storage.first.A).?)

#define MkBuf2XXX(xxx, len, buf)
 
#define MkBuf2BOL(buf)
 
#define MkBuf2I8(buf)
 
#define MkBuf2I16(buf)
 
#define MkBuf2I32(buf)
 
#define MkBuf2I64(buf)
 
#define MkBuf2FLT(buf)
 
#define MkBuf2DBL(buf)
 
#define MkBuf2Ptr(len, ptr, buf)
 
#define MkBuf2BOL_P(ptr, buf)
 
#define MkBuf2I8_P(ptr, buf)
 
#define MkBuf2I16_P(ptr, buf)
 
#define MkBuf2I32_P(ptr, buf)
 
#define MkBuf2I64_P(ptr, buf)
 
#define MkBuf2FLT_P(ptr, buf)
 
#define MkBuf2DBL_P(ptr, buf)
 
#define MkBuf2Ptr_A(l, a, b)
 
#define MkBuf2BOL_A(ato, buf)
 
#define MkBuf2I8_A(ato, buf)
 
#define MkBuf2I16_A(ato, buf)
 
#define MkBuf2I32_A(ato, buf)
 
#define MkBuf2I64_A(ato, buf)
 
#define MkBuf2FLT_A(ato, buf)
 
#define MkBuf2DBL_A(ato, buf)
 

Detailed Description

MkBufferC - the abstract class known as buf or buffer is used to create and manage dynamic, generic, mixed typed data. …

The MkBufferC is used to store PRIMITIVE TYPE data. If libmkkernel is working on data… libmkkernel is working on an MkBufferC object or on a list of MkBufferC objects called MkBufferListC.

MkBufferS CLASS

The ABSTRACT-CLASS used to store a native-type-data-item defined by PRIMITIVE TYPE

C-Kernel-Details

The ABSTRACT-CLASS MkBufferS is used to store MkTypeE data in an MkBufferS::storage

A new MkBufferS is always preallocated with the predefined ILS-storage (MkBufferS::ils_data), but can switch to a MALLOC-storage if the storage requirements of the user exceed the predefined MkBufferS::ilsS::size.

‍A MkBufferS never run out of storage.

The basic goal of the ILS-storage technology is to minimize the usage of MALLOC, this mean that the MkBufferS::ilsS::size should be large enought to be sufficient for the user needs.

The following conditions must always be met for the ILS memory:

The ABSTRACT-CLASS MkBufferS is missing the ILS-storage, the FINAL-CLASSES are:

MkBuffer64C, MkBuffer256C and MkBuffer1024C

See also
MkBufferListC, MkBufferStreamC

MkBufferS CTOR / DTOR

command synonmym
(constructor,static,runtime) MK_BUF MkBufferCreate(MK_NUM const size) no
(destructor,runtime) void MkBufferDelete(MK_BUF const buf) no

Example from server.c read a buffer-object and convert single-char-type-identifer to string.

static enum MkErrorE
Ot_BUF2 ( MQ_SERVICE_CALL_ARGS )
{
  MK_BUF buf;
  int i;
  char str[2] = {'\0', '\0'};
  MqSendSTART_E (mqctx);
  for (i=0; i<3; i++) {
    MqReadBUF_E (mqctx, &buf);
    str[0] = MkBufferGetType1(buf);
    MqSendSTR_E (mqctx, str);
    MqSendBUF_E (mqctx, buf);
  }
  return MqSendRETURN(mqctx);
error:
  return MkErrorStack_1X(mqctx);
}
See also
BufferGetType1 BufferGetType2 BufferGetType3

Macro Definition Documentation

◆ MkBuf2BOL

#define MkBuf2BOL ( buf)
Value:
MkBuf2XXX(BOL,1,buf)
#define MkBuf2XXX(xxx, len, buf)

Definition at line 5838 of file LibMkKernel_mk.h.

◆ MkBuf2BOL_A

#define MkBuf2BOL_A ( ato,
buf )
Value:
MkBuf2Ptr_A(1,ato,buf)
#define MkBuf2Ptr_A(l, a, b)

Definition at line 5856 of file LibMkKernel_mk.h.

◆ MkBuf2BOL_P

#define MkBuf2BOL_P ( ptr,
buf )
Value:
MkBuf2Ptr(1,ptr,buf)
#define MkBuf2Ptr(len, ptr, buf)

Definition at line 5847 of file LibMkKernel_mk.h.

◆ MkBuf2BOLfast

#define MkBuf2BOLfast ( buf)
Value:
MkBuf2XXXfast(buf).BOL
#define MkBuf2XXXfast(buf)

Definition at line 5821 of file LibMkKernel_mk.h.

◆ MkBuf2DBL

#define MkBuf2DBL ( buf)
Value:
MkBuf2XXX(DBL,8,buf)

Definition at line 5844 of file LibMkKernel_mk.h.

◆ MkBuf2DBL_A

#define MkBuf2DBL_A ( ato,
buf )
Value:
MkBuf2Ptr_A(8,ato,buf)

Definition at line 5862 of file LibMkKernel_mk.h.

◆ MkBuf2DBL_P

#define MkBuf2DBL_P ( ptr,
buf )
Value:
MkBuf2Ptr(8,ptr,buf)

Definition at line 5853 of file LibMkKernel_mk.h.

◆ MkBuf2DBLfast

#define MkBuf2DBLfast ( buf)
Value:
MkBuf2XXXfast(buf).DBL

Definition at line 5827 of file LibMkKernel_mk.h.

◆ MkBuf2FLT

#define MkBuf2FLT ( buf)
Value:
MkBuf2XXX(FLT,4,buf)

Definition at line 5843 of file LibMkKernel_mk.h.

◆ MkBuf2FLT_A

#define MkBuf2FLT_A ( ato,
buf )
Value:
MkBuf2Ptr_A(4,ato,buf)

Definition at line 5861 of file LibMkKernel_mk.h.

◆ MkBuf2FLT_P

#define MkBuf2FLT_P ( ptr,
buf )
Value:
MkBuf2Ptr(4,ptr,buf)

Definition at line 5852 of file LibMkKernel_mk.h.

◆ MkBuf2FLTfast

#define MkBuf2FLTfast ( buf)
Value:
MkBuf2XXXfast(buf).FLT

Definition at line 5826 of file LibMkKernel_mk.h.

◆ MkBuf2I16

#define MkBuf2I16 ( buf)
Value:
MkBuf2XXX(I16,2,buf)

Definition at line 5840 of file LibMkKernel_mk.h.

◆ MkBuf2I16_A

#define MkBuf2I16_A ( ato,
buf )
Value:
MkBuf2Ptr_A(2,ato,buf)

Definition at line 5858 of file LibMkKernel_mk.h.

◆ MkBuf2I16_P

#define MkBuf2I16_P ( ptr,
buf )
Value:
MkBuf2Ptr(2,ptr,buf)

Definition at line 5849 of file LibMkKernel_mk.h.

◆ MkBuf2I16fast

#define MkBuf2I16fast ( buf)
Value:
MkBuf2XXXfast(buf).I16

Definition at line 5823 of file LibMkKernel_mk.h.

◆ MkBuf2I32

#define MkBuf2I32 ( buf)
Value:
MkBuf2XXX(I32,4,buf)

Definition at line 5841 of file LibMkKernel_mk.h.

◆ MkBuf2I32_A

#define MkBuf2I32_A ( ato,
buf )
Value:
MkBuf2Ptr_A(4,ato,buf)

Definition at line 5859 of file LibMkKernel_mk.h.

◆ MkBuf2I32_P

#define MkBuf2I32_P ( ptr,
buf )
Value:
MkBuf2Ptr(4,ptr,buf)

Definition at line 5850 of file LibMkKernel_mk.h.

◆ MkBuf2I32fast

#define MkBuf2I32fast ( buf)
Value:
MkBuf2XXXfast(buf).I32

Definition at line 5824 of file LibMkKernel_mk.h.

◆ MkBuf2I64

#define MkBuf2I64 ( buf)
Value:
MkBuf2XXX(I64,8,buf)

Definition at line 5842 of file LibMkKernel_mk.h.

◆ MkBuf2I64_A

#define MkBuf2I64_A ( ato,
buf )
Value:
MkBuf2Ptr_A(8,ato,buf)

Definition at line 5860 of file LibMkKernel_mk.h.

◆ MkBuf2I64_P

#define MkBuf2I64_P ( ptr,
buf )
Value:
MkBuf2Ptr(8,ptr,buf)

Definition at line 5851 of file LibMkKernel_mk.h.

◆ MkBuf2I64fast

#define MkBuf2I64fast ( buf)
Value:
MkBuf2XXXfast(buf).I64

Definition at line 5825 of file LibMkKernel_mk.h.

◆ MkBuf2I8

#define MkBuf2I8 ( buf)
Value:
MkBuf2XXX(I8,1,buf)

Definition at line 5839 of file LibMkKernel_mk.h.

◆ MkBuf2I8_A

#define MkBuf2I8_A ( ato,
buf )
Value:
MkBuf2Ptr_A(1,ato,buf)

Definition at line 5857 of file LibMkKernel_mk.h.

◆ MkBuf2I8_P

#define MkBuf2I8_P ( ptr,
buf )
Value:
MkBuf2Ptr(1,ptr,buf)

Definition at line 5848 of file LibMkKernel_mk.h.

◆ MkBuf2I8fast

#define MkBuf2I8fast ( buf)
Value:

Definition at line 5822 of file LibMkKernel_mk.h.

◆ MkBuf2Ptr

#define MkBuf2Ptr ( len,
ptr,
buf )
Value:
memcpy((void*)ptr,buf->storage.first.B,len)

Definition at line 5846 of file LibMkKernel_mk.h.

◆ MkBuf2Ptr_A

#define MkBuf2Ptr_A ( l,
a,
b )
Value:
memcpy(a.B##l,b->storage.first.B,l)

Definition at line 5855 of file LibMkKernel_mk.h.

◆ MkBuf2XXX

#define MkBuf2XXX ( xxx,
len,
buf )
Value:
({MK_##xxx __tmp; memcpy(&__tmp,buf->storage.first.B,len); __tmp;})

Definition at line 5836 of file LibMkKernel_mk.h.

◆ MkBuf2XXXfast

#define MkBuf2XXXfast ( buf)
Value:
(*(buf)->storage.first.A)

Definition at line 5819 of file LibMkKernel_mk.h.

◆ MkBufferS_ils_size

#define MkBufferS_ils_size   (0)

64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.

Definition at line 5233 of file LibMkKernel_mk.h.