157#ifndef META_HAS_THREAD
158 #error "META_HAS_THREAD was NOT defined, require 1 or 0, forget to include 'theKernel/c/compiler.mk' ?"
208#define META_TIMEOUT_REF 900
215#define META_HDL_USE__NONNULL__GCC_ATTRIBUTE 0
224#if !defined(META_ATTRIBUTE_SANITIZE)
225# define META_ATTRIBUTE_SANITIZE __attribute__((no_sanitize("address")))
267#ifndef META_DOXYGEN_USE_C_PRIVAT
268# ifdef META_DOXYGEN_SHOULD_SKIP_THIS
269# define META_DOXYGEN_USE_C_PRIVAT 0
271# define META_DOXYGEN_USE_C_PRIVAT 1
282# undef MK_C_BUILD_DLL
283# define MK_C_BUILD_DLL
284# undef META_IGNORE_EXTERN
285# define META_IGNORE_EXTERN
294#define META_DEBUG_ALL -1
295#define META_DEBUG_DEFAULT (1<<1)
296#define META_DEBUG_CACHE (1<<2)
297#define META_DEBUG_TYPE (1<<3)
305#define META_DEBUG_SOCKET (1<<4)
306#define META_DEBUG_EVENT (1<<5)
307#define META_DEBUG_MEM (1<<6)
314#define META_DEBUG_REFCOUNT (1<<7)
315#define META_DEBUG_ERROR (1<<8)
321#if META_DEBUG & META_DEBUG_TYPE
322# define META_DEBUG_TYPE__printV(...) printV(__VA_ARGS__)
324# define META_DEBUG_TYPE__printV(...)
328#if META_DEBUG & META_DEBUG_ERROR
329# define META_DEBUG_ERROR_check() META_DEBUG_ERROR_checkO(NULL)
330# define META_DEBUG_ERROR_checkX(x) META_DEBUG_ERROR_checkO(MkOBJ(x))
331# define META_DEBUG_ERROR_checkO(o) if (MkErrorCheckE_0E()) MkDbgError_RT(MK_RT_CALL o, __func__);
333# define META_DEBUG_ERROR_check()
334# define META_DEBUG_ERROR_checkX(x)
335# define META_DEBUG_ERROR_checkO(o)
338#if !defined(PARSE_C_HEADER_TO_META) && META_DEBUG
339# include "debug_mk.h"
344#if defined(META_DISABLE_LOG)
345 # define MkDCheck(_debug)
346 # define MkDLogC(x,_debug,str)
347 # define MkDLogV(x,_debug,printfmt,...)
348 # define MkDProtect(_debug) if (MK_RT_REF.debug < _debug) return
349 # define MkDProtect2(_debug,_call) if (MK_RT_REF.debug < _debug) return
352 # define MkDDInit const MK_I32 __dbg = MK_RT_REF.debug
353 # define MkDDInitNum(n) const MK_I32 __dbg = n
358# define MkDCheck(_debug) if (unlikely(MK_RT_REF.debug >= _debug))
359# define MkDDCheck(_debug) if (unlikely(__dbg >= _debug))
367# define MkDLogC_O(fmtobj,_debug,str) \
368 if (unlikely(MK_RT_REF.debug >= _debug)) MkLogC(fmtobj,str,_debug,__func__)
370# define MkDLogC(x,_debug,str) MkDLogC_O(MkOBJ(x),_debug,str)
372# define MkDDLogC(x,_debug,str) \
373 if (unlikely(__dbg >= _debug)) MkLogC_4X(x,str,_debug,__func__)
382# define MkDLogV_O(fmtobj,_debug,printfmt,...) \
383 if (unlikely(MK_RT_REF.debug >= _debug)) MkLogV(fmtobj,__func__,_debug,printfmt,__VA_ARGS__)
385# define MkDLogV(x,_debug,printfmt,...) MkDLogV_O(MkOBJ(x),_debug,printfmt,__VA_ARGS__)
387# define MkDDLogV(fmtobj,_debug,printfmt,...) \
388 if (unlikely(__dbg >= _debug)) MkLogV_4M(fmtobj,__func__,_debug,printfmt,__VA_ARGS__)
391 # define MkDProtect(_debug) if (MK_RT_REF.debug < _debug) { \
392 MkLogV_2(fmtobj,MK_COLOR_ORANGE "Warning: ignore call to '%s' with '%d'" MK_COLOR_RESET "\n", __func__, debug); \
393 printSTACK_1(fmtobj); \
396 # define MkDProtect2(_debug,_call) if (MK_RT_REF.debug < _debug) { \
397 MkLogV_2(fmtobj,MK_COLOR_ORANGE "Warning: ignore call to '%s' from '%s' with '%d'" \
398 MK_COLOR_RESET "\n", __func__, _call, debug); \
399 printSTACK_1(fmtobj); \
413#define META_USE_SELF_REFCOUNT
427#ifndef __has_parser__
436# define __parser__(...)
438# define __parser__define__(...)
442# define __parser__push__(...)
444# define __parser__pop__
456# define __parser__global__(...)
458# define __parser__global__define__(...)
462# define __parser__global__push__(...)
464# define __parser__global__pop__
497#define MK_PARSER_fmtobj MK_OBJN fmtobj __parser__(default=NULL)
511 # define __attribute__(dummy)
512 # define __func__ __FUNCTION__
513 # define MK_CLRCALL __clrcall
514 # define MK_STDCALL __stdcall
515 # define MK_CDECL __cdecl
518 # ifndef PARSE_C_HEADER_TO_META
519 # define mk_inline static inline
522 # define mk_unlink _unlink
523 # define mk_snprintf _snprintf
525 # define MK_ATTR_HOT ???
526 # define MK_ATTR_COLD ???
537 # ifndef PARSE_C_HEADER_TO_META
538 # define mk_inline static inline
540 # define mk_unlink unlink
541 # define mk_snprintf snprintf
543 # define MK_ATTR_HOT __attribute__((hot))
544 # define MK_ATTR_COLD __attribute__((cold))
549 # define MK_DECL MK_CLRCALL
550#elif defined(META_COMPILE_AS_CC)
551 # define MK_DECL MK_STDCALL
553 # define MK_DECL MK_CDECL
560#undef BEGIN_MK_C_DECLS
562#if defined(META_COMPILE_AS_CC)
563# define BEGIN_MK_C_DECLS namespace libmkkernel {
564# define END_MK_C_DECLS }
565#elif defined(__cplusplus)
566# define BEGIN_MK_C_DECLS extern "C" {
567# define END_MK_C_DECLS }
569# define BEGIN_MK_C_DECLS
570# define END_MK_C_DECLS
578#if defined(_MSC_VER) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
579 #define likely(x) !!(x)
580 #define unlikely(x) !!(x)
582 #define likely(x) __builtin_expect((x),1)
583 #define unlikely(x) __builtin_expect((x),0)
586#ifndef PARSE_C_HEADER_TO_META
588 # include <inttypes.h>
599 # include <stdbool.h>
603#if defined(_WIN32) && !defined(__CYGWIN__)
604 # ifndef PARSE_C_HEADER_TO_META
605 # include <winsock2.h>
609 # define mk_timeval timeval
618 # define mk_timeval timeval
619 # define mk_timezone timezone
625#define MK_UNUSED __attribute__((unused))
627#define MK_NO_RETURN __attribute__((noreturn))
628#define MK_UNREACHABLE __builtin_unreachable()
630#define MK_ARTIFICIAL __attribute__((__artificial__))
632#define MK_DEPRECATED __attribute__ ((deprecated))
634#define MK_OPTIMIZE_0 __attribute__((optimize("O0")))
636#ifndef PARSE_C_HEADER_TO_META
698#define MK_NULL_YES true
701#define MK_NULL_NO false
707#define MK_NULL_STR "MK_NULL"
713#define MK_NULL_STR_LEN strlen(MK_NULL_STR)
730 return ((__str) ? strcmp((__str),
MK_NULL_STR)==0 :
true);
736 return ((__str) ? (__str)[0] ==
'\0' || strcmp((__str),
MK_NULL_STR)==0 :
true);
892 # define MkThreadLocal __thread
893 # define MK_RT_SHIFT 1
894 # define MK_RT_ARGS_ONLY MK_RT mkrt
895 # define MK_RT_ARGS MK_RT_ARGS_ONLY,
896 # define MK_RT_CALL_ONLY mkrt
897 # define MK_RT_CALL MK_RT_CALL_ONLY,
898 # define MK_RT_CALL_O(o) MkRT_O(o),
899 # define MK_RT_CALL_X(x) MkRT_X(x),
900 # define MK_RT_CALL_NULL_ONLY MkRT
901 # define MK_RT_CALL_NULL MK_RT_CALL_NULL_ONLY,
902 # define MK_RT_NULL NULL,
903 # define MK_RT_PTR mkrt
904 # define MK_RT_REF (*mkrt)
905 # define MK_RT_REF_NULL (MkRuntimeRLS)
906 # define MK_RT_UNUSED MK_UNUSED
907 # define MK_RT_CALL_RT(ptr) ptr,
908 # define MK_PARSER_RT_ONLY MK_RT_ARGS_ONLY __parser__(internal,default=N#RUNTIME)
909 # define MK_PARSER_RT MK_PARSER_RT_ONLY,
914 # define MkThreadLocal
915 # define MK_RT_SHIFT 0
916 # define MK_RT_ARGS_ONLY void
918 # define MK_RT_CALL_ONLY
920 # define MK_RT_CALL_O(o)
921 # define MK_RT_CALL_X(x)
922 # define MK_RT_CALL_NULL_ONLY
923 # define MK_RT_CALL_NULL
925 # define MK_RT_PTR (&MkRuntimeRLS)
926 # define MK_RT_REF (MkRuntimeRLS)
927 # define MK_RT_REF_NULL (MkRuntimeRLS)
928 # define MK_RT_UNUSED
929 # define MK_RT_CALL_RT(ptr)
930 # define MK_PARSER_RT_ONLY void
931 # define MK_PARSER_RT
935# define MK_RT_ATTR_FORMAT_1 __attribute__((format (printf, 1+MK_RT_SHIFT, 2+MK_RT_SHIFT)));
936# define MK_RT_ATTR_FORMAT_2 __attribute__((format (printf, 2+MK_RT_SHIFT, 3+MK_RT_SHIFT)))
937# define MK_RT_ATTR_FORMAT_4 __attribute__((format (printf, 4+MK_RT_SHIFT, 5+MK_RT_SHIFT)))
941# define __MK_ATTR_RT_RUNTIME
943#if META_HDL_USE__NONNULL__GCC_ATTRIBUTE == 1
945 # define __MK_ATTR_RT_INSTANCE __attribute__((nonnull(1+MK_RT_SHIFT)))
946 # define __MK_ATTR_INSTANCE __attribute__((nonnull(1)))
947 # define MK_INSTANCE_HDL(x)
949 # define __MK_ATTR_RT_INSTANCE
950 # define __MK_ATTR_INSTANCE
951 # define MK_INSTANCE_HDL(x) assert(x!=NULL)
955#define MK_ATTR_INSTANCE __MK_ATTR_INSTANCE
956#define MK_ATTR_RT_INSTANCE __MK_ATTR_RT_RUNTIME __MK_ATTR_RT_INSTANCE
957#define MK_ATTR_STATIC __parser__(static)
958#define MK_ATTR_RT_STATIC __MK_ATTR_RT_RUNTIME __parser__(static)
961#define MK_INSTANCE_RT_X(x) MK_INSTANCE_HDL(x); MkRtSetup_XN_RT(x); META_DEBUG_ERROR_checkX(x)
962#define MK_INSTANCE_RT_X_NULL(x) MkRtSetup_X_RT(x); META_DEBUG_ERROR_checkX(x)
963#define MK_INSTANCE_RT_O(o) MK_INSTANCE_HDL(o); MkRtSetup_ON_RT(o); META_DEBUG_ERROR_checkO(o)
964#define MK_INSTANCE_RT_O_NULL(o) MkRtSetup_O_RT(o); META_DEBUG_ERROR_checkO(o)
965#define MK_DESTRUCTOR_RT_X(c,x) MK_INSTANCE_HDL(x); \
966 if (!MkCheckNN(c,x)) return; \
967 MkRtSetup_XN_RT(x); META_DEBUG_ERROR_check()
968#define MK_STATIC_RT MkRtSetup_NULL_RT; META_DEBUG_ERROR_check()
977#ifndef PARSE_C_HEADER_TO_META
1057#if defined(_MSC_VER) && defined(_DLL)
1064#ifdef META_IS_WINDOWS
1065 # define META_DIR_SEPARATOR '\\'
1066 # define META_EOL "\r\n"
1068 # define META_DIR_SEPARATOR '/'
1069 # define META_EOL "\n"
1079#if defined(META_IGNORE_EXTERN)
1083# if defined(DLL_EXPORT)
1085# if defined(MK_C_BUILD_DLL)
1086# define MK_EXTERN __declspec(dllexport)
1088# define MK_EXTERN __declspec(dllimport)
1092# define MK_EXTERN __attribute__ ((visibility("default")))
1100#undef MK_EXTERN_DATA
1101#if defined(META_PRIVATE)
1102# define MK_EXTERN_DATA extern
1103#elif defined(META_IGNORE_EXTERN)
1104# define MK_EXTERN_DATA extern
1107# if defined(DLL_EXPORT)
1109# if defined(MK_C_BUILD_DLL)
1110# define MK_EXTERN_DATA __declspec(dllexport)
1112# define MK_EXTERN_DATA __declspec(dllimport)
1116# define MK_EXTERN_DATA __attribute__ ((visibility("default"))) extern
1119# define MK_EXTERN_DATA extern
1125#define MK_CPPXSTR(s) MK_CPPSTR(s)
1127#define MK_CPPSTR(s) #s
1129#define MK_CONCAT(a,b) a ## b
1130#define MK_CONCAT2(a,b) MK_CONCAT(a,b)
1131#define MK_CONCAT3(a,b,c) a ## b ## c
1135 #define mk_append_fix_str(t,s) t=stpcpy(t,s)
1137 #define mk_append_fix_str(t,s) t=strcpy(t,s)+sizeof(s)-1
1141#define mk_bit_compare(t,f) (t&f)==f
1168#define MK_ALFA_STR ((MkStringR){1,"@"})
1176__parser__(type=ME_NB1_MK_BOL:
"1 byte 'boolean' data-type")
1181__parser__(type=ME_NB0_MK_BOOL:"'
boolean' data-type":primary)
1183#define bool2str(_bool) (_bool?"true":"false")
1193__parser__(type=ME_NI1_MK_I8:
"1 byte 'byte' data-type")
1196__parser__(type=ME_NI2_MK_I16:"2
byte '
short integer' data-type":primary:int16_t)
1199__parser__(type=ME_NI4_MK_I32:"4
byte 'integer' data-type":primary:int32_t)
1202#if defined(_MSC_VER)
1206 __parser__(type=ME_NI8_MK_I64:
"8 byte 'wide integer' data-type":primary:int64_t)
1210__parser__(type=ME_NIL_MK_LONG:
"4/8 byte 'long' data-type":primary)
1221__parser__(type=ME_NU1_MK_U8:"1
byte '
unsigned byte' data-type":primary:uint8_t)
1223__parser__(type=ME_NU2_MK_U16:"2
byte '
unsigned short' data-type":primary:uint16_t)
1225__parser__(type=ME_NU4_MK_U32:"4
byte '
unsigned integer' data-type":primary:uint32_t)
1227__parser__(type=ME_NU8_MK_U64:"8
byte '
unsigned wide' data-type":primary:uint64_t)
1231__parser__(type=ME_NUL_MK_ULN:"8
byte '
unsigned long' data-type":primary)
1241__parser__(type=ME_NF4_MK_FLT:"4
byte '
float' data-type":primary)
1244__parser__(type=ME_NF8_MK_DBL:"8
byte '
double' data-type":primary)
1265__parser__(type=ME_NIH_MK_HDL:"handle data-type")
1268#define MK_HDL_REF_S3(__prefix) __prefix ## NI4
1269#define MK_HDL_REF_S1(__prefix) __prefix ## I32
1270#define MK_HDLT MK_I32T
1284__parser__(type=ME_NIL_MK_SIZE:
"long byte 'size' datay-type")
1288__parser__(type=ME_RUA_MkBufferAtomU:"atomic native data buffer type")
1295#define MK_FORMAT_N "%i"
1298__parser__(type=ME_NI4_MK_DBG:
"debug-level data-type")
1369__parser__(type=ME_NIL_MK_TIME_T:"time [sec] data-type")
1371#define MK_FORMAT_TIME "%li"
1372#define MK_TIME ((MK_TIME_T)time(NULL))
1373#define MK_TIME_MAX (365*24*60*60)
1384__parser__(type=ME_PVB_MK_PTRB:
"pointer type data-type")
1388__parser__(type=ME_PVX_MK_PTR:"generic pointer data-type":primary)
1391__parser__(type=ME_PVN_MK_PTRN:"const generic pointer data-type":primary)
1394__parser__(type=ME_PCX_MK_CCP:"class constructor/destructor data type")
1397__parser__(type=ME_PAX_MK_CBP:"generic pointer to call-back data")
1400__parser__(type=ME_CXC_MK_MNG:"managed
object pointer; datatype will be checked at runtime")
1403__parser__(type=ME_CXN_MK_MNGN:"const - a managed
object pointer; datatype will be checked at runtime")
1406__parser__(type=ME_PEX_MK_EXP:"target language exception-class-
object")
1409__parser__(type=ME_CXC_MkExceptionC:"target language library-exception-class-
object")
1420__parser__(type=ME_PLB_MK_LSTB:"list type data-type")
1424__parser__(type=ME_PLX_MK_LST:"list pointer data-type")
1435__parser__(type=ME_PBB_MK_BINB:"
byte-array type data-type")
1439__parser__(type=ME_PBX_MK_BIN:"
byte-array pointer data-type":primary)
1443__parser__(type=ME_PBN_MK_BINN:"const
byte-array pointer data-type":primary)
1454__parser__(type=ME_PSB_MK_STRB:"
string type data-type")
1458__parser__(type=ME_PSX_MK_STR:"
string pointer data-type":primary)
1462__parser__(type=ME_PSN_MK_STRN:"constant
string pointer data-type":primary)
1476__parser__(type=ME_PFX_MK_FST:
"constant 'printf' format string")
1485__parser__(type=ME_PVX_MK_NAT_OBJECT:"target language
object pointer")
1487__parser__(type=ME_PVX_MK_NAT_LIST:"target language list pointer")
1507 __parser__(type=ME_CCC_MkObjectC:"MkObjectC class handle":primary)
1510 __parser__(type=ME_CCN_MkObjectC:"const - MkObjectC class handle":primary)
1521 __parser__(type=ME_CCC_MkBufferC:"MkBufferC class handle":primary)
1524 __parser__(type=ME_CCN_MkBufferC:"const - MkBufferC class handle":primary)
1535 __parser__(type=ME_CCC_MkBufferStreamC:"MkBufferStreamC class handle":primary)
1538 __parser__(type=ME_CCN_MkBufferStreamC:"const - MkBufferStreamC class handle":primary)
1549 __parser__(type=ME_CCC_MkBufferListC:"MkBufferListC class handle":primary)
1552 __parser__(type=ME_CCN_MkBufferListC:"const - MkBufferListC class handle":primary)
1563 __parser__(type=ME_CCC_MkLogFileC:"MkLogFileC class handle":primary)
1566 __parser__(type=ME_CCN_MkLogFileC:"const - MkLogFileC class handle":primary)
1577 __parser__(type=ME_CCC_MkErrorC:"MqErrorC class handle":primary)
1580 __parser__(type=ME_CCN_MkErrorC:"const - MqErrorC class handle":primary)
1591 __parser__(internal,type=ME_CCC_MkExtensionC:"abstract class for the extension technology":internal)
1594 __parser__(internal,type=ME_CCN_MkExtensionC:"const - abstract class for the extension technology":internal)
1605 __parser__(internal,type=ME_CCC_MkErrExtC:"final class for the
MkErrorS extention technology":internal)
1608 __parser__(internal,type=ME_CCN_MkErrExtC:"const - final class for the
MkErrorS extention technology":internal)
1619 __parser__(internal,type=ME_CCC_MkRtExtC:"final class for the
MkRuntimeS extention technology":internal)
1622 __parser__(internal,type=ME_CCN_MkRtExtC:"const - final class for the
MkRuntimeS extention technology":internal)
1633 __parser__(type=ME_CCC_MkRuntimeC:"runtime singleton class
object":primary)
1636 __parser__(type=ME_CCN_MkRuntimeC:"const - runtime singleton class
object":primary)
1647 __parser__(internal,type=ME_CCC_MkTypeC:"a managed
object class type !base! pointer":internal)
1650 __parser__(internal,type=ME_CCN_MkTypeC:"const - a managed
object class type !base! pointer":internal)
1662__parser__(type=ME_CXC_MK_BAC:"a list of 'buffer' as last argument in function")
1667__parser__(type=ME_CXN_MK_BAC:"const - a list of 'buffer' as last argument in function")
1699 return bin.
data == NULL;
1781 if (len < 0) len = strR.
len;
1782 if (start > strR.
len) {
1784 }
else if ((start+len) > strR.
len) {
1794 assert(len_out != NULL);
1795 assert(str_out != NULL);
1796 *len_out = strR.
len; *str_out = strR.
ptr;
1863__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc,
return-type-
default-no)
1868__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
1876__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc)
1925__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc,
return-type-
default-no)
1930__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
1938__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc)
1959__parser__(internal,no-rpc,prefix=EnumFunc,
return-type-
default-no)
1964__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
2000__parser__(internal,no-rpc,prefix=EnumFunc,
return-type-
default-no)
2005__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
2025#define MK_TYPE_IS_1_I8E (1<<0)
2028#define MK_TYPE_IS_2_I8E (1<<1)
2031#define MK_TYPE_IS_4_I8E (1<<2)
2034#define MK_TYPE_IS_8_I8E (1<<3)
2037#define MK_TYPE_IS_NATIVE ( MK_TYPE_IS_1_I8E | MK_TYPE_IS_2_I8E | \
2038 MK_TYPE_IS_4_I8E | MK_TYPE_IS_8_I8E )
2041#define MK_TYPE_SHIFT 4
2069__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc,
return-type-
default-no)
2074__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
2082__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc)
2169#if defined(__cplusplus)
2200#define MkType_O MK_BOL
2201#define MkType_Y MK_I8
2202#define MkType_S MK_I16
2203#define MkType_I MK_I32
2204#define MkType_W MK_I64
2205#define MkType_F MK_FLT
2206#define MkType_D MK_DBL
2207#define MkType_C MK_STRN
2208#define MkType_B MK_BIN
2209#define MkType_U MK_BUF
2210#define MkType_L MK_BFL
2258__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc,
return-type-
default-no)
2263__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
2271__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc)
2311 #define MkCacheItemS_signature 0x44196912
2329#define MkCacheS_name_size 32
2339#define MkCacheS_MkCacheItemS_size 8
2427__parser__push__(no-rpc,template-overload,doc-group=libmkkernel,doc-index=Setup,prefix=Setup);
2441#ifndef META_COMPILE_AS_CC
2442__attribute__ ((constructor(200)))
2461#ifndef META_COMPILE_AS_CC
2462__attribute__ ((destructor(200)))
2576typedef void (*MkSysAbortF) (
2618 unsigned int const usec
2630 unsigned int const sec
2686__attribute__ ((alloc_size (2, 3)))
2699__attribute__ ((alloc_size (2)))
2750__attribute__ ((alloc_size (3)))
2805#define MkSysFree(pointer) \
2807 if ( likely((pointer) != (NULL)) ) { \
2808 (*MkLal.SysFree)((MK_PTR)pointer); \
2809 (pointer) = (NULL); \
2814#define MkSysFreeNonNull(pointer) (*MkLal.SysFree)((MK_PTR)pointer)
2911 useconds_t const usec
2971 bool const includeExtension
3024#define MkSysStringSetNULL_R(_str) _str[0] = '\0'
3028#define MkSysStringSet_R(_str,_val) strcpy(_str,_val)
3032#define MkSysStringIsNULL_R(_str) (_str[0] == '\0')
3041 return (str != NULL && *str !=
'\0');
3046#define MkSysStringIsEQUAL(_str,_other) (strcmp(_str,_other) == 0)
3050#define MkSysStringIsLenEQUAL(_str,_other,_len) (strncmp(_str,_other,(size_t)_len) == 0)
3059 return str == NULL ?
"" : str;
3295#define __MkCheckTO(t,o) (((*o).signature & (*t).objmask) == (*t).objsig)
3296#define _MkCheckTO(t,o) ((o) && __MkCheckTO((t),(o)))
3297#define __MkCheckO(cls,o) (((*o).signature & cls##_MASK) == cls##_SIGNATURE)
3298#define _MkCheckO(cls,o) ((o) && __MkCheckO(cls,(o)))
3299#define __MkCheckX(cls,x) __MkCheckO(cls,(cls##_X2obj(x)))
3300#define _MkCheckX(cls,x) ((x) && __MkCheckO(cls,(cls##_X2obj(x))))
3301#define __MkCheckM(cls,m) __MkCheckO(cls,((MK_OBJ)(m)))
3302#define _MkCheckM(cls,m) ((m) && __MkCheckM(cls,m))
3304#define MkCheckNN(cls,x) __MkCheckO(cls,(cls##_X2obj(x)))
3306#ifdef __SANITIZE_ADDRESS__
3308 #define MkSanitizeCheck(_root,_m) _MkCheckM(_root,_m)
3309 #define MkSanitizeCheckO(_root,_o) _MkCheckO(_root,_o)
3311 #define MkSanitizeCheck(_root,_m) _MkCheckM(_root,_m)
3312 #define MkSanitizeCheckO(_root,_o) _MkCheckO(_root,_o)
3317#define MkAssertO(cls,o) assert(o==NULL?true:__MkCheckO(cls,o))
3318#define MkAssertX(cls,x) assert(x==NULL?true:__MkCheckX(cls,o))
3323# define MkAssertCastM(cls,m) ((cls##_type)(m))
3325# define MkAssertCastM(cls,m) ((cls##_type)(({MK_OBJ o=(MK_OBJ)(m);MkAssertO(cls,o);o;})))
3328#define toTT(_type) (MkTYP(_type))
3333#define MK_NULL_SIGNATURE 0
3354#define MkDbgObjInstancesO_2(o,c) \
3357 mk_dbg_color_ln(c,"MkDbgObjInstances: %s[%p] prev<%p>, next<%p>, var<" #o ">", \
3358 (o)->type->type_name, o, (o)->obj_protect.prev, (o)->obj_protect.next); \
3360 mk_dbg_color_ln(c,"MkDbgObjInstances: %s[NULL] var<" #o ">", "unknown"); \
3363#define MkDbgObjInstancesX_2(x,c) MkDbgObjInstancesO_2(MkOBJ(x),c)
3364#define MkDbgObjInstancesX(x) MkDbgObjInstancesX_2(x,MK_COLOR_CYAN)
3365#define MkDbgObjInstancesO(o) MkDbgObjInstancesO_2(o,MK_COLOR_CYAN)
3367#if META_DEBUG & META_DEBUG_REFCOUNT
3369 __attribute__ ((visibility(
"default"))) void
3370 MkDbgDeepWriter(
void* mng,const
char* ident, const
char* func, const
char* fmt,...);
3374 #define MkDbgDeepWriter(...)
3378#define MkDbgDeepX_4(m,ident,func,fmt,...) MkDbgDeepWriter(m, ident, func, fmt, __VA_ARGS__)
3379#define MkDbgDeepX_3(m,ident,fmt,...) MkDbgDeepX_4(m,ident,__func__,fmt,__VA_ARGS__)
3380#define MkDbgDeepX_2(m,ident) MkDbgDeepX_4(m,ident,__func__,NULL,NULL)
3412#if defined(META_USE_SELF_REFCOUNT)
3450 #define MkObjectC_SIGNATURE (0x59B3u<<16)
3451 #define MkObjectC_MASK (((1u<<16)-1)<<16)
3459 #define MkObjectC_X2obj(x) (x)
3472 #define MkObjectC_T (&MK_RT_REF._MkObjectC_T)
3474 #define MkObjectC_TT (MkTYP(MkObjectC_T))
3476 #define MkObjectST MkObjectC_T
3478 #define MkObjectSTT (MkTYP(MkObjectST))
3480 #define MkObjectC_type MK_OBJ
3482 #define MkObjectCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
3484 #define MkObjectCTT_X(instance) (MkOBJ_R(instance).type)
3486 #define MkObjectCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
3488 #define MkObjectC_NS MK
3490 #define MkObjectCTT MkObjectCTT
3492 #define MkObjectCT ( (struct MkTypeDefS *) MkObjectCTT )
3500 #pragma GCC diagnostic push
3501 #pragma GCC diagnostic ignored "-Wattributes"
3519 #pragma GCC diagnostic pop
3520 #define MkObjectC_Check(mng) MkObjCheck(mng)
3530 META_ATTRIBUTE_SANITIZE
3538 META_ATTRIBUTE_SANITIZE
3545 #define MkObjRaise(_obj) if (!_MkCheckX(MkObjectC,_obj)) { \
3546 MkErrorSetC_1E("'MkObjectC' hdl is NULL"); \
3551 #define MkOBJ_R(x) (*(x)).super.obj
3553 #define MkOBJ(x) (&MkOBJ_R(x))
3571__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MkObjectC,no-rpc);
3586#define MkObjectHandleGetOfType_1X(x) MkObjectHandleGetOfType(MkOBJ(x))
3621__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MkObjectC);
3643#define MkObjectHandleGet_1X(x) MkObjectHandleGet(x?MkOBJ(x):NULL)
3667#define MkObjectHandleResolve_e(netHdl) ({ \
3668 MK_HDL tmpHdl=netHdl; \
3673 tmp=MkObjectHandleResolve(tmpHdl); \
3675 MkErrorSetC_1_NULL("ERROR: 'MkObjectC' handle is 'NULL'"); \
3704 __parser__(doc-group=_ignore_,doc-index=Class,doc-name=Misc,
class=MkObjectC,null-
return-allow)
3907#define MkDbgTyp2(t,c) \
3908 mk_dbg_color_ln(c,"MkDbgTyp[%-32s]: typ<ID=%-2d,P=%-14p,RT=%p> type_class<%s:%p>, " #t, \
3909 MK_TRIM_LEFT(32,(t)->type_name), (t)->type_id, t, MkRT_X(t), \
3910 (t)->type_class->type_name, (t)->type_class)
3911#define MkDbgTyp(t) MkDbgTyp2(t,MK_COLOR_LIGHT_CYAN)
3912#define MkDbgTypListAll2(t,c) do { \
3914 MkRuntimeLogBufferPush(); \
3915 DL_FOREACH2((t)->type_class->instancesR,o,obj_protect.next) { \
3916 MkDbgTyp2(MkTyp(o),c); \
3918 MkRuntimeLogBufferPop(); \
3920#define MkDbgTypListAll(t) MkDbgTypListAll2(t,MK_COLOR_GREEN)
3922#define MkDbgTypInstances_2(t,c) \
3924 MK_TYP _typ = (t); \
3926 mk_dbg_start_2(c,"MkDbgTypInstances: %s[%p] ", _typ->type_name, _typ); \
3928 for (MK_OBJ obj=MkTypeInstances(_typ); obj; obj=MkObjectNext(obj)) { \
3929 mk_dbg_next_2(c,"%p,",obj); \
3932 mk_dbg_next_2(MK_COLOR_RED,"%s", "break"); \
3938 mk_dbg_color_ln(c,"MkDbgTypInstances: %s[%p] ", #t, _typ); \
3942#define MkDbgTypInstances(t) MkDbgTypInstances_2(t,MK_COLOR_CYAN)
3957 #define MkTypeS_name_size 32
4008 #define MkTypeC_SIGNATURE (MkObjectC_SIGNATURE ^ (11u<<10))
4009 #define MkTypeC_MASK (((1u<<22)-1)<<10)
4017 #define MkTypeC_X2typ(x) (x)
4018 #define MkTypeC_X2obj(x) MkOBJ(x)
4031 #define MkTypeSTT (&MK_RT_REF._MkTypeC_TT)
4033 #define MkTypeC_TT (&MK_RT_REF._MkTypeC_TT)
4035 #define MkTypeC_type MK_TYP
4037 #define MkTypeCT_X(instance) ( (struct MkTypeS *) (MkOBJ_R(instance).type) )
4039 #define MkTypeCTT_X(instance) (MkOBJ_R(instance).type)
4041 #define MkTypeCT_TT(typ) ( (struct MkTypeS *) (typ) )
4043 #define MkTypeC_NS MK
4045 #define MkTypeCTT MkTypeCTT
4047 #define MkTypeCT ( (struct MkTypeS *) MkTypeCTT )
4055 #pragma GCC diagnostic push
4056 #pragma GCC diagnostic ignored "-Wattributes"
4074 #pragma GCC diagnostic pop
4075 #define MkTypeC_Check(mng) MkTypCheck(mng)
4108#define MkTYP_R(x) (*(x)).super.typ
4110#define MkTYP(x) (&MkTYP_R(x))
4112#define MkTYP_O(o) (*o).type
4114#define MkTYP_X(x) MkOBJ_R(x).type
4144 #define MkTypeDefC_SIGNATURE (MkTypeC_SIGNATURE ^ (1u<<6))
4145 #define MkTypeDefC_MASK (((1u<<26)-1)<<6)
4153 #define MkTypeDefC_X2typ(x) MkTYP(x)
4154 #define MkTypeDefC_X2obj(x) MkOBJ(x)
4167 #define MkTypeDefSTT (&MK_RT_REF._MkTypeDefC_TT)
4169 #define MkTypeDefC_TT (&MK_RT_REF._MkTypeDefC_TT)
4171 #define MkTypeDefCT_X(instance) ( (struct MkTypeS *) (MkOBJ_R(instance).type) )
4173 #define MkTypeDefCTT_X(instance) (MkOBJ_R(instance).type)
4175 #define MkTypeDefCT_TT(typ) ( (struct MkTypeS *) (typ) )
4177 #define MkTypeDefC_NS MK
4179 #define MkTypeDefCTT MkTypeDefCTT
4181 #define MkTypeDefCT ( (struct MkTypeS *) MkTypeDefCTT )
4209#define MkTypeSlotResolve(_tt,fptr,force) ({ \
4210 MK_TYP tt = (_tt) ; \
4211 tt == NULL ? NULL : \
4212 !force && tt->fptr == (MK_PTR) 0x1 ? NULL : \
4213 tt->fptr > (typeof(tt->fptr)) 0x1 ? tt->fptr : \
4214 tt == MkTypeSTT ? NULL : \
4215 (typeof(tt->fptr)) MkTypeSlotResolveP(MK_RT_CALL tt, offsetof(struct MkTypeS, fptr), force); \
4218#define MkTypeSlotCall(_tt,fptr,...) do { \
4219 typeof((_tt)->fptr) slot = MkTypeSlotResolve((_tt),fptr,false); \
4220 if (slot) (*slot)(MK_RT_CALL __VA_ARGS__); \
4247#if defined(META_USE_SELF_REFCOUNT)
4249 #define MkObjInit2(rtmkV,rtExtV,sigV,typeV,refCountV,isLocalV) \
4250 (struct MkObjectS) { \
4251 .signature = sigV, \
4252 .refCount = refCountV, \
4256 .selfCreated = false, \
4257 .selfRefCount = 0, \
4259 .objRtExt = rtExtV, \
4261 .isLocal = isLocalV, \
4268 #define MkObjInit2(rtmkV,rtExtV,sigV,typeV,refCountV,isLocalV) \
4269 (struct MkObjectS) { \
4270 .signature = sigV, \
4271 .refCount = refCountV, \
4275 .selfCreated = false, \
4277 .objRtExt = rtExtV, \
4279 .isLocal = isLocalV, \
4286#define MkObjInit(rtmkV,rtExtV,cls,refCountV,isLocalV) \
4287 MkObjInit2(rtmkV,rtExtV,cls##_SIGNATURE,cls##_TT,refCountV,isLocalV)
4290#define MkObjInitFromType(typeV,isLocalV) \
4291 MkObjInit2(MK_RT_PTR, NULL, (*typeV).objsig, typeV, 0, isLocalV)
4294#define MkObjInitFromInstance(instV) \
4295 MkObjInit2(MK_RT_PTR, NULL, MkOBJ_R(instV).type->objsig, MkOBJ_R(instV).type, 0, false)
4394#define MkObjectDelete_NULL(obj) MkObjectDeleteToNull(MkObjectDelete_RT,MK,obj)
4395#define MkObjectDelete_NULL_X(x) MkObjectDeleteToNull_X(MkObjectDelete_RT,MK,x)
4396#define MkObjectDelete_1X(x) MkObjectDeleteToNull_X(MkObjectDelete_RT,MK,x)
4398#define MkObjectDeleteToNull(fct,NS,x) if (x) { fct (NS##_RT_CALL x); (x) = NULL ; }
4399#define MkObjectDeleteToNull_X(fct,NS,x) if (x) { fct (NS##_RT_CALL MkOBJ(x)); (x) = NULL ; }
4422#define MkObjectDispose_NULL(obj) MkObjectDeleteToNull(MkObjectDispose_RT,MK,obj)
4423#define MkObjectDispose_NULL_X(x) MkObjectDeleteToNull_X(MkObjectDispose_RT,MK,x)
4424#define MkObjectDispose_1X(x) MkObjectDispose(MkOBJ(x))
4427#define MkObjectDeleteCallF_CHECK do { \
4428 assert (__data__ != NULL); \
4433#define MkObjectDeleteCallF_ARGS \
4435 MK_OBJN const obj __parser__(internal), \
4436 MK_STRN const typeName, \
4437 MK_HDL const typeHdl, \
4438 MK_HDL const objHdl, \
4439 MK_CBP const __data__ \
4441#define MkObjectDeleteCallF_CALL MK_RT_CALL obj, __data__
4491#define MkObjectDeleteFreeF_ARGS MK_RT_ARGS MK_CBP *dataP __parser__(inout)
4528__parser__(class=MkObjectC,callback-name=ObjectDelete,callback-null)
4606#define MkRefLOCK 999999
4616#define MkRefIncr_1X(x) MkRefIncr(MkOBJ(x))
4617#define MkRefIncr_1M(m) MkRefIncr(MkObj(m))
4632#define MkRefIncr_FX(x) MkRefIncr(MkOBJ(x))
4651#define MkRefDecr_O(o) do { MkRefDecr_RT(MK_RT_CALL o); o=NULL; } while (0)
4655#define MkRefDecr_X(x) do { MkRefDecr_RT(MK_RT_CALL MkOBJ(x)); x=NULL; } while (0)
4657#define MkRefDecr_X_NULL(x) do { MkRefDecr_RT(MK_RT_NULL MkOBJ(x)); x=NULL; } while (0)
4662#define MkRefDecr_M(m) do { MkRefDecr_RT(MK_RT_CALL MkObj(m)); m=NULL; } while (0)
4664#define MkRefDecr_M_NULL(m) do { MkRefDecr_RT(MK_RT_NULL MkObj(m)); m=NULL; } while (0)
4667#define MkRefDecr_FX(x) do { --(MkOBJ_R(x).refCount); } while(0)
4684#define MkRefIncrSelf_2X(x,s) MkRefIncrSelf(MkOBJ(x),s)
4732 return (*obj).refCount;
4735#define MkRefGet_1X(x) MkRefGet(MkOBJ(x))
4744#define MkRefLock_1X(x) MkRefLock(MkOBJ(x))
4754#define MkRefIsLocked_1X(x) MkRefIsLocked(MkOBJ(x))
4757#define MkRefSet(target,source) ({ \
4758 if (target != source) { \
4759 typeof(target) targetSave=target; \
4761 MkRefDecr_X(targetSave);\
4762 MkRefIncr_1X(target);\
4770#define MkRefCidN_NULL() MkRefCidN_RT(MK_RT_CALL_NULL_ONLY)
4797#define MkSelfSet_3X(x,self,env) MkSelfSet(MkOBJ(x),self,env)
4808#define MkSelfGet_1X(x) MkSelfGet(MkOBJ(x))
4841#define MkSelfNew_3X(x,self_out,env) MkSelfNew(MkOBJ(x),self_out,env)
4858#define MkSelfCreate_2X(x,env) MkSelfCreate(MkOBJ(x),env)
4874#define MkSelfDelete_1X(x) MkSelfDelete_RT(MK_RT_CALL MkOBJ(x))
4898#define MkSelfDeleteForce_1X(x) MkSelfDeleteForce(MkOBJ(x))
4923#define MkSelfUnlink_1X(x) MkSelfUnlink(MkOBJ(x))
4932#define MkSelfExists_1X(x) MkSelExists(MkOBJ(x))
5044#define MkTypeCreate(clsV, basicV, identV) ({ \
5045 assert(!MkSysStringIsNULL(identV)); \
5046 MK_TYP ret = MkTypeDup2(basicV ## _TT,identV); \
5047 ret->objsig = clsV ## _SIGNATURE; \
5048 ret->objmask = clsV ## _MASK; \
5049 ret->objsize = sizeof(clsV##R); \
5050 ret->type_base = basicV ## _TT; \
5051 ret->type_class = ret; \
5119 assert(
typ != NULL);
5133#define MkTypeForeachInstancesSave(typ) DL_FOREACH_SAFE2((typ)->type_class->instancesR,obj,tmp,obj_protect.next)
5171#define MkTypeLog_2Lvl(t,l,...) MkTypeLog_RT(MK_RT_CALL (t), __VA_ARGS__, (l)
5180#if META_DEBUG & META_DEBUG_TYPE
5181 #define MkTypeLoop(_cls, _var) \
5182 bool _var##_firstB = true; \
5183 _cls##_type _var##_first = (_cls##_type)_cls##_TT->type_class->instancesR; \
5185 _cls##_type _var = _var##_first; \
5186 ({ if (!_var##_firstB && _var == _var##_first) { \
5187 MkPanicV_2M(_var,"[MkTypeLoop] INTERNAL ERROR: found 'circle' in 'MkTypeC=%s'", _var->type_name); \
5188 } ; _var##_firstB = false; _var; }); \
5189 _var = (_cls##_type)_cls##_X2obj(_var)->obj_protect.next \
5192 #define MkTypeLoop(_cls, _var) \
5193 for (_cls##_type _var = (_cls##_type)_cls##_TT->type_class->instancesR; _var != NULL; \
5194 _var = (_cls##_type)_cls##_X2obj(_var)->obj_protect.next)
5235#define MkObjectToName_1X(x) MkObjectToName(MkOBJ(x))
5257#define MkObjectToNameOfType_1X(x) MkObjectToNameOfType(MkOBJ(x))
5275#define MkObjectToNameOfClass_1X(x) MkObjectToNameOfClass_RT(MK_RT_CALL MkOBJ(x))
5292#define MkObjectToString_1X(x) MkObjectToString(x?MkOBJ(x):NULL)
5293#define MkObjectToString_1M(m) MkObjectToString(m?MkObjN(m):NULL)
5380#define MkLogC_4X(x,message,debug,callfunc) MkLogC(MkOBJ(x),message,debug,callfunc)
5381#define MkLogC_3X(x,message,debug) MkLogC_3(MkOBJ(x),message,debug)
5382#define MkLogC_2X(x,message) MkLogC_2(MkOBJ(x),message)
5383#define MkLogW(x,callfunc,_debug,message) MkLogC(MkOBJ(x),message,_debug,callfunc)
5404#define MkDbgV_2X(x,printfmt,...) MkDbgV_RT(MK_RT_CALL MkOBJ(x),__func__,stderr,printfmt,__VA_ARGS__)
5405#define MkDbgV_2O(o,printfmt,...) MkDbgV_RT(MK_RT_CALL o ,__func__,stderr,printfmt,__VA_ARGS__)
5425#define MkLogV_lvl(x,debug,printfmt,...) MkLogV(MkOBJ(x),__func__,debug,printfmt,__VA_ARGS__)
5427#define MkLogV_4M(x,callfunc,debug,printfmt,...) MkLogV(MkObjN(x),callfunc,debug,printfmt,__VA_ARGS__)
5428#define MkLogV_4X(x,callfunc,debug,printfmt,...) MkLogV(MkOBJ(x),callfunc,debug,printfmt,__VA_ARGS__)
5429#define MkLogV_3X(x,callfunc,printfmt,...) MkLogV_3(MkOBJ(x),callfunc,printfmt,__VA_ARGS__)
5430#define MkLogV_2X(x,printfmt,...) MkLogV_2(MkOBJ(x),printfmt,__VA_ARGS__)
5451#define MkLogVL_5X(fmtobj,callfunc,debug,printfmt,var_list) \
5452 MkLogVL(MkOBJ(fmtobj),callfunc,debug,printfmt,var_list)
5467#define MkLogHEX_4X(fmtobj,callfunc,data,len) MkLogHEX_RT(MkOBJ(fmtobj),callfunc,data,len)
5489#define MkObjectLogShort_1X(x) MkObjectLogShort(MkOBJ(x),NULL,0,__func__,0)
5490#define MkObjectLogShort_2Lvl(o,l) MkObjectLogShort(o,NULL,0,__func__,l)
5512#define MkObjectLogLong_1X(x) MkObjectLogLong(MkOBJ(x),NULL,0,__func__,0)
5513#define MkObjectLogLong_1M(m) MkObjectLogLong(MkObj(m),NULL,0,__func__,0)
5535#define MkObjectLogLong_1X(x) MkObjectLogLong(MkOBJ(x),NULL,0,__func__,0)
5536#define MkObjectLogLong_1M(m) MkObjectLogLong(MkObj(m),NULL,0,__func__,0)
5623#define MkObjectLog_1X(x) MkObjectLog(MkOBJ(x),NULL,0,__func__,0)
5624#define MkObjectLog_2Lvl(o,l) MkObjectLog(o,NULL,0,__func__,l)
5660#define MkDbgL_2M(x,message) MkDbgL(MkObj(x),message,0,__func__,-1)
5665__parser__(no-type-extension,
template-overload)
5673#define MkDbgDump_2M(x,message) MkDbgDump_2(MkObj(x),message)
5693#define MkDbgSTACK_3X(x,num,callfunc) MkDbgSTACK_3(MkOBJ(x),num,callfunc)
5709#define MkDbgO_2X(x,callfunc) MkDbgO(MkObj(x),callfunc)
5710#define MkDbgO_1X(x) MkDbgO_2X(x,__func__)
5711#define MkDbgO_1O(x) MkDbgO(x,__func__)
5722#define MkDbgLogC_2X(x,callfunc) MkDbgLogC_2(MkOBJ(x),callfunc)
5759#define MkBufferS_ils_size (0)
5824 #define MkBufferC_SIGNATURE (MkObjectC_SIGNATURE ^ (1u<<10))
5825 #define MkBufferC_MASK (((1u<<22)-1)<<10)
5833 #define MkBufferC_X2buf(x) (x)
5834 #define MkBufferC_X2obj(x) MkOBJ(x)
5847 #define MkBufferC_T (&MK_RT_REF._MkBufferC_T)
5849 #define MkBufferC_TT (MkTYP(MkBufferC_T))
5851 #define MkBufferST MkBufferC_T
5853 #define MkBufferSTT (MkTYP(MkBufferST))
5855 #define MkBufferC_type MK_BUF
5857 #define MkBufferCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
5859 #define MkBufferCTT_X(instance) (MkOBJ_R(instance).type)
5861 #define MkBufferCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
5863 #define MkBufferC_NS MK
5865 #define MkBufferCTT MkBufferCTT
5867 #define MkBufferCT ( (struct MkTypeDefS *) MkBufferCTT )
5875 #pragma GCC diagnostic push
5876 #pragma GCC diagnostic ignored "-Wattributes"
5894 #pragma GCC diagnostic pop
5895 #define MkBufferC_Check(mng) MkBufCheck(mng)
5905 META_ATTRIBUTE_SANITIZE
5913 META_ATTRIBUTE_SANITIZE
5920 #define MkBufRaise(_buf) if (!_MkCheckX(MkBufferC,_buf)) { \
5921 MkErrorSetC_1E("'MkBufferC' hdl is NULL"); \
5926 #define MkBUF_R(x) (*(x)).super.buf
5928 #define MkBUF(x) (&MkBUF_R(x))
5951__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MkBufferC);
6003#define MkBufferHandleResolve_e(netHdl) ({ \
6004 MK_HDL tmpHdl=netHdl; \
6009 tmp=MkBufferHandleResolve(tmpHdl); \
6011 MkErrorSetC_1_NULL("ERROR: 'MkBufferC' handle is 'NULL'"); \
6026 __parser__(flags=
new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,
class=MkBufferC,null-
return-allow)
6054#define MkBuffer64S_ils_size (64)
6085 #define MkBuffer64C_SIGNATURE (MkBufferC_SIGNATURE ^ (1u<<6))
6086 #define MkBuffer64C_MASK (((1u<<26)-1)<<6)
6094 #define MkBuffer64C_X2buf(x) MkBUF(x)
6095 #define MkBuffer64C_X2obj(x) MkOBJ(x)
6108 #define MkBuffer64C_T (&MK_RT_REF._MkBuffer64C_T)
6110 #define MkBuffer64C_TT (MkTYP(MkBuffer64C_T))
6112 #define MkBuffer64ST MkBuffer64C_T
6114 #define MkBuffer64STT (MkTYP(MkBuffer64ST))
6116 #define MkBuffer64CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
6118 #define MkBuffer64CTT_X(instance) (MkOBJ_R(instance).type)
6120 #define MkBuffer64CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
6122 #define MkBuffer64C_NS MK
6124 #define MkBuffer64CTT MkBuffer64CTT
6126 #define MkBuffer64CT ( (struct MkTypeDefS *) MkBuffer64CTT )
6148#define MkBuffer256S_ils_size (256)
6179 #define MkBuffer256C_SIGNATURE (MkBufferC_SIGNATURE ^ (2u<<6))
6180 #define MkBuffer256C_MASK (((1u<<26)-1)<<6)
6188 #define MkBuffer256C_X2buf(x) MkBUF(x)
6189 #define MkBuffer256C_X2obj(x) MkOBJ(x)
6202 #define MkBuffer256C_T (&MK_RT_REF._MkBuffer256C_T)
6204 #define MkBuffer256C_TT (MkTYP(MkBuffer256C_T))
6206 #define MkBuffer256ST MkBuffer256C_T
6208 #define MkBuffer256STT (MkTYP(MkBuffer256ST))
6210 #define MkBuffer256CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
6212 #define MkBuffer256CTT_X(instance) (MkOBJ_R(instance).type)
6214 #define MkBuffer256CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
6216 #define MkBuffer256C_NS MK
6218 #define MkBuffer256CTT MkBuffer256CTT
6220 #define MkBuffer256CT ( (struct MkTypeDefS *) MkBuffer256CTT )
6242#define MkBuffer1024S_ils_size (1024)
6273 #define MkBuffer1024C_SIGNATURE (MkBufferC_SIGNATURE ^ (3u<<6))
6274 #define MkBuffer1024C_MASK (((1u<<26)-1)<<6)
6282 #define MkBuffer1024C_X2buf(x) MkBUF(x)
6283 #define MkBuffer1024C_X2obj(x) MkOBJ(x)
6296 #define MkBuffer1024C_T (&MK_RT_REF._MkBuffer1024C_T)
6298 #define MkBuffer1024C_TT (MkTYP(MkBuffer1024C_T))
6300 #define MkBuffer1024ST MkBuffer1024C_T
6302 #define MkBuffer1024STT (MkTYP(MkBuffer1024ST))
6304 #define MkBuffer1024CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
6306 #define MkBuffer1024CTT_X(instance) (MkOBJ_R(instance).type)
6308 #define MkBuffer1024CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
6310 #define MkBuffer1024C_NS MK
6312 #define MkBuffer1024CTT MkBuffer1024CTT
6314 #define MkBuffer1024CT ( (struct MkTypeDefS *) MkBuffer1024CTT )
6327#ifndef __has_parser__
6338#define MkBuf2XXXfast(buf) (*(buf)->storage.first.A)
6340#define MkBuf2BOLfast(buf) MkBuf2XXXfast(buf).BOL
6341#define MkBuf2I8fast(buf) MkBuf2XXXfast(buf).I8
6342#define MkBuf2I16fast(buf) MkBuf2XXXfast(buf).I16
6343#define MkBuf2I32fast(buf) MkBuf2XXXfast(buf).I32
6344#define MkBuf2I64fast(buf) MkBuf2XXXfast(buf).I64
6345#define MkBuf2FLTfast(buf) MkBuf2XXXfast(buf).FLT
6346#define MkBuf2DBLfast(buf) MkBuf2XXXfast(buf).DBL
6355#define MkBuf2XXX(xxx,len,buf) ({MK_##xxx __tmp; memcpy(&__tmp,buf->storage.first.B,len); __tmp;})
6357#define MkBuf2BOL(buf) MkBuf2XXX(BOL,1,buf)
6358#define MkBuf2I8(buf) MkBuf2XXX(I8,1,buf)
6359#define MkBuf2I16(buf) MkBuf2XXX(I16,2,buf)
6360#define MkBuf2I32(buf) MkBuf2XXX(I32,4,buf)
6361#define MkBuf2I64(buf) MkBuf2XXX(I64,8,buf)
6362#define MkBuf2FLT(buf) MkBuf2XXX(FLT,4,buf)
6363#define MkBuf2DBL(buf) MkBuf2XXX(DBL,8,buf)
6365#define MkBuf2Ptr(len,ptr,buf) memcpy((void*)ptr,buf->storage.first.B,len)
6366#define MkBuf2BOL_P(ptr,buf) MkBuf2Ptr(1,ptr,buf)
6367#define MkBuf2I8_P(ptr,buf) MkBuf2Ptr(1,ptr,buf)
6368#define MkBuf2I16_P(ptr,buf) MkBuf2Ptr(2,ptr,buf)
6369#define MkBuf2I32_P(ptr,buf) MkBuf2Ptr(4,ptr,buf)
6370#define MkBuf2I64_P(ptr,buf) MkBuf2Ptr(8,ptr,buf)
6371#define MkBuf2FLT_P(ptr,buf) MkBuf2Ptr(4,ptr,buf)
6372#define MkBuf2DBL_P(ptr,buf) MkBuf2Ptr(8,ptr,buf)
6374#define MkBuf2Ptr_A(l,a,b) memcpy(a.B##l,b->storage.first.B,l)
6375#define MkBuf2BOL_A(ato,buf) MkBuf2Ptr_A(1,ato,buf)
6376#define MkBuf2I8_A(ato,buf) MkBuf2Ptr_A(1,ato,buf)
6377#define MkBuf2I16_A(ato,buf) MkBuf2Ptr_A(2,ato,buf)
6378#define MkBuf2I32_A(ato,buf) MkBuf2Ptr_A(4,ato,buf)
6379#define MkBuf2I64_A(ato,buf) MkBuf2Ptr_A(8,ato,buf)
6380#define MkBuf2FLT_A(ato,buf) MkBuf2Ptr_A(4,ato,buf)
6381#define MkBuf2DBL_A(ato,buf) MkBuf2Ptr_A(8,ato,buf)
6412#define MkString2O(s,l,r) MkString2BOL_RT(MK_RT_CALL s,l,r)
6421#define MkString2Y(s,l,r) MkString2I8_RT(MK_RT_CALL s,l,r)
6430#define MkString2S(s,l,r) MkString2I16_RT(MK_RT_CALL s,l,r)
6439#define MkString2US(s,l,r) MkString2U16_RT(MK_RT_CALL s,l,r)
6448#define MkString2I(s,l,r) MkString2I32_RT(MK_RT_CALL s,l,r)
6457#define MkString2UI(s,l,r) MkString2U32_RT(MK_RT_CALL s,l,r)
6466#define MkString2W(s,l,r) MkString2I64_RT(MK_RT_CALL s,l,r)
6486#define MkString2F(s,l,r) MkString2FLT_RT(MK_RT_CALL s,l,r)
6495#define MkString2D(s,l,r) MkString2DBL_RT(MK_RT_CALL s,l,r)
6600#define MkBufferCreateTLS_T(cls,name,size) \
6601 static MkThreadLocal cls##R name##R = {0}; \
6602 MK_BUF name = MkBUF(&name##R); \
6603 if (unlikely(!__MkCheckX(cls,&name##R))) { \
6604 MkBufferInit(name,cls##_TT,size); \
6605 MkRefIncr_1X(name); \
6606 } else if (MkBUF_R(&name##R).var.cursize) { \
6607 MkBufferReset(name); \
6620#define MkBufferCreateTLS_inout_T(cls,name,inout) \
6621 static MkThreadLocal struct MkBufferS __hidden_##name##R = {0}; \
6622 MK_BUF name = *inout != NULL ? *inout : &__hidden_##name##R; \
6623 if (likely(!__MkCheckX(MkBufferC,name))) { \
6624 MkBufferInit(name,cls##_TT,0); \
6625 MkRefIncr_1X(name); \
6626 } else if (name->var.cursize) { \
6627 MkBufferReset(name); \
6647#define MkBufferCreateLOCAL_T(cls,name,size) \
6648 cls##R name##R = {0}; \
6649 struct MkBufferS * const name = MkBUF(&name##R); \
6650 MkBufferInit(name,cls##_TT,size)
6873 MK_I8 * const val_out
6938MK_EXTERN enum MkErrorE MK_DECL MkBufferGetLL_RT (
6941 MK_LLG * const val_out
6942) MK_ATTR_RT_INSTANCE;
6944#define MkBufferGetLLG(b,o) MkBufferGetLL(b,o)
7264#define MkBufferLogS_2V(buf,fmt) MkBufferLogS_3(buf,#fmt,MkOBJ(fmt))
7493__parser__(template-required,no-rpc,keep,no-static)
7546struct MkBufferStreamSaveS;
7549#define MkBufferStreamS_ils_size (0)
7636 #define MkBufferStreamC_SIGNATURE (MkBufferC_SIGNATURE ^ (4u<<6))
7637 #define MkBufferStreamC_MASK (((1u<<26)-1)<<6)
7645 #define MkBufferStreamC_X2bus(x) (x)
7646 #define MkBufferStreamC_X2buf(x) MkBUF(x)
7647 #define MkBufferStreamC_X2obj(x) MkOBJ(x)
7660 #define MkBufferStreamC_T (&MK_RT_REF._MkBufferStreamC_T)
7662 #define MkBufferStreamC_TT (MkTYP(MkBufferStreamC_T))
7664 #define MkBufferStreamST MkBufferStreamC_T
7666 #define MkBufferStreamSTT (MkTYP(MkBufferStreamST))
7668 #define MkBufferStreamC_type MK_BUS
7670 #define MkBufferStreamCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
7672 #define MkBufferStreamCTT_X(instance) (MkOBJ_R(instance).type)
7674 #define MkBufferStreamCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
7676 #define MkBufferStreamC_NS MK
7678 #define MkBufferStreamCTT MkBufferStreamCTT
7680 #define MkBufferStreamCT ( (struct MkTypeDefS *) MkBufferStreamCTT )
7688 #pragma GCC diagnostic push
7689 #pragma GCC diagnostic ignored "-Wattributes"
7693 __parser__(
class=MkBufferStreamC,
static,hide)
7701 __parser__(
class=MkBufferStreamC,
static,hide)
7707 #pragma GCC diagnostic pop
7708 #define MkBufferStreamC_Check(mng) MkBusCheck(mng)
7717 __parser__(
class=MkBufferStreamC,hide,
static)
7718 META_ATTRIBUTE_SANITIZE
7725 __parser__(
class=MkBufferStreamC,hide,
static)
7726 META_ATTRIBUTE_SANITIZE
7733 #define MkBusRaise(_bus) if (!_MkCheckX(MkBufferStreamC,_bus)) { \
7734 MkErrorSetC_1E("'MkBufferStreamC' hdl is NULL"); \
7739 #define MkBUS_R(x) (*(x)).super.bus
7741 #define MkBUS(x) (&MkBUS_R(x))
7760__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MkBufferStreamC);
7812#define MkBufferStreamHandleResolve_e(netHdl) ({ \
7813 MK_HDL tmpHdl=netHdl; \
7818 tmp=MkBufferStreamHandleResolve(tmpHdl); \
7820 MkErrorSetC_1_NULL("ERROR: 'MkBufferStreamC' handle is 'NULL'"); \
7835 __parser__(flags=
new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,
class=MkBufferStreamC,null-
return-allow)
7857#define MkBufferStream64_ils_size (64)
7889 #define MkBufferStream64C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (3u<<3))
7890 #define MkBufferStream64C_MASK (((1u<<29)-1)<<3)
7898 #define MkBufferStream64C_X2bus(x) MkBUS(x)
7899 #define MkBufferStream64C_X2buf(x) MkBUF(x)
7900 #define MkBufferStream64C_X2obj(x) MkOBJ(x)
7913 #define MkBufferStream64C_T (&MK_RT_REF._MkBufferStream64C_T)
7915 #define MkBufferStream64C_TT (MkTYP(MkBufferStream64C_T))
7917 #define MkBufferStream64ST MkBufferStream64C_T
7919 #define MkBufferStream64STT (MkTYP(MkBufferStream64ST))
7921 #define MkBufferStream64CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
7923 #define MkBufferStream64CTT_X(instance) (MkOBJ_R(instance).type)
7925 #define MkBufferStream64CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
7927 #define MkBufferStream64C_NS MK
7929 #define MkBufferStream64CTT MkBufferStream64CTT
7931 #define MkBufferStream64CT ( (struct MkTypeDefS *) MkBufferStream64CTT )
7952#define MkBufferStream256S_ils_size (256)
7984 #define MkBufferStream256C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (2u<<3))
7985 #define MkBufferStream256C_MASK (((1u<<29)-1)<<3)
7993 #define MkBufferStream256C_X2bus(x) MkBUS(x)
7994 #define MkBufferStream256C_X2buf(x) MkBUF(x)
7995 #define MkBufferStream256C_X2obj(x) MkOBJ(x)
8008 #define MkBufferStream256C_T (&MK_RT_REF._MkBufferStream256C_T)
8010 #define MkBufferStream256C_TT (MkTYP(MkBufferStream256C_T))
8012 #define MkBufferStream256ST MkBufferStream256C_T
8014 #define MkBufferStream256STT (MkTYP(MkBufferStream256ST))
8016 #define MkBufferStream256CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
8018 #define MkBufferStream256CTT_X(instance) (MkOBJ_R(instance).type)
8020 #define MkBufferStream256CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
8022 #define MkBufferStream256C_NS MK
8024 #define MkBufferStream256CTT MkBufferStream256CTT
8026 #define MkBufferStream256CT ( (struct MkTypeDefS *) MkBufferStream256CTT )
8047#define MkBufferStream1024_ils_size (1024)
8079 #define MkBufferStream1024C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (4u<<3))
8080 #define MkBufferStream1024C_MASK (((1u<<29)-1)<<3)
8088 #define MkBufferStream1024C_X2bus(x) MkBUS(x)
8089 #define MkBufferStream1024C_X2buf(x) MkBUF(x)
8090 #define MkBufferStream1024C_X2obj(x) MkOBJ(x)
8103 #define MkBufferStream1024C_T (&MK_RT_REF._MkBufferStream1024C_T)
8105 #define MkBufferStream1024C_TT (MkTYP(MkBufferStream1024C_T))
8107 #define MkBufferStream1024ST MkBufferStream1024C_T
8109 #define MkBufferStream1024STT (MkTYP(MkBufferStream1024ST))
8111 #define MkBufferStream1024CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
8113 #define MkBufferStream1024CTT_X(instance) (MkOBJ_R(instance).type)
8115 #define MkBufferStream1024CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
8117 #define MkBufferStream1024C_NS MK
8119 #define MkBufferStream1024CTT MkBufferStream1024CTT
8121 #define MkBufferStream1024CT ( (struct MkTypeDefS *) MkBufferStream1024CTT )
8142#define MkBufferStream16384S_ils_size (16384)
8174 #define MkBufferStream16384C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (1u<<3))
8175 #define MkBufferStream16384C_MASK (((1u<<29)-1)<<3)
8183 #define MkBufferStream16384C_X2bus(x) MkBUS(x)
8184 #define MkBufferStream16384C_X2buf(x) MkBUF(x)
8185 #define MkBufferStream16384C_X2obj(x) MkOBJ(x)
8198 #define MkBufferStream16384C_T (&MK_RT_REF._MkBufferStream16384C_T)
8200 #define MkBufferStream16384C_TT (MkTYP(MkBufferStream16384C_T))
8202 #define MkBufferStream16384ST MkBufferStream16384C_T
8204 #define MkBufferStream16384STT (MkTYP(MkBufferStream16384ST))
8206 #define MkBufferStream16384CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
8208 #define MkBufferStream16384CTT_X(instance) (MkOBJ_R(instance).type)
8210 #define MkBufferStream16384CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
8212 #define MkBufferStream16384C_NS MK
8214 #define MkBufferStream16384CTT MkBufferStream16384CTT
8216 #define MkBufferStream16384CT ( (struct MkTypeDefS *) MkBufferStream16384CTT )
8261#define MkBufferStreamCreate_1(size) MkBufferStreamCreate(NULL,size)
8323#define MkBufferStreamCreateLOCAL_T(cls,name,size) \
8324 cls##R name##R = {0}; \
8325 struct MkBufferStreamS * const name = cls##_X2bus(&name##R); \
8326 MkBufferStreamInit(name,cls##_TT,size)
8339#define MkBufferStreamCreateSTATIC_T(cls,name) \
8340 static cls##R name##R = {0}; \
8341 struct MkBufferStreamS * const name = cls##_X2bus(&name##R); \
8342 if (__MkCheckX(cls,&name##R)) { \
8343 MkBufferStreamReset(name); \
8345 MkBufferStreamInit(name,cls##TT,0); \
8359#define MkBufferStreamCreateTLS_T(cls,name) \
8360 static MkThreadLocal cls##R name##R = {0}; \
8361 struct MkBufferStreamS * const name = cls##_X2bus(&name##R); \
8362 if (__MkCheckX(cls,&name##R)) { \
8363 MkBufferStreamReset(name); \
8365 MkBufferStreamInit(name,cls##_TT,0); \
8544#define MkBufferStreamLog_5F(bus,fmt,...) MkBufferStreamLog(bus,MkObj(fmt),__VA_ARGS__)
8545#define MkBufferStreamLog_2F(bus,fmt) MkBufferStreamLog_5F(bus,fmt,0,__func__,0)
8546#define MkBufferStreamLog_3F(bus,fmt,pfx) MkBufferStreamLog_5F(bus,fmt,0,pfx,0)
8918 MK_I8 * const val_out
9045#include "MkBufferListC_def_mk.h"
9075#define MkDbgLogData(d) \
9076 MkDbgV_2O(MK_ERROR_FORMAT,MK_COLOR_LIGHT_CYAN "FROM=%s -> TO=%s [%d]" MK_COLOR_RESET "\n", \
9077 MK_RT_REF.log.logNAME, (d), MK_RT_REF.log.logREF);
9083 #if defined(__cplusplus)
9084 #define MkLogDataEA(e) MkLogDataS::e
9086 #define MkLogDataEA(e) e
9099 #define MkLogDataS_LogNAME_size 256
9136 #define MkLogFileC_SIGNATURE (MkObjectC_SIGNATURE ^ (3u<<10))
9137 #define MkLogFileC_MASK (((1u<<22)-1)<<10)
9145 #define MkLogFileC_X2lfl(x) (x)
9146 #define MkLogFileC_X2obj(x) MkOBJ(x)
9159 #define MkLogFileC_T (&MK_RT_REF._MkLogFileC_T)
9161 #define MkLogFileC_TT (MkTYP(MkLogFileC_T))
9163 #define MkLogFileST MkLogFileC_T
9165 #define MkLogFileSTT (MkTYP(MkLogFileST))
9167 #define MkLogFileC_type MK_LFL
9169 #define MkLogFileCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
9171 #define MkLogFileCTT_X(instance) (MkOBJ_R(instance).type)
9173 #define MkLogFileCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
9175 #define MkLogFileC_NS MK
9177 #define MkLogFileCTT MkLogFileCTT
9179 #define MkLogFileCT ( (struct MkTypeDefS *) MkLogFileCTT )
9187 #pragma GCC diagnostic push
9188 #pragma GCC diagnostic ignored "-Wattributes"
9206 #pragma GCC diagnostic pop
9207 #define MkLogFileC_Check(mng) MkLflCheck(mng)
9217 META_ATTRIBUTE_SANITIZE
9225 META_ATTRIBUTE_SANITIZE
9232 #define MkLflRaise(_lfl) if (!_MkCheckX(MkLogFileC,_lfl)) { \
9233 MkErrorSetC_1E("'MkLogFileC' hdl is NULL"); \
9238 #define MkLFL_R(x) (*(x)).super.lfl
9240 #define MkLFL(x) (&MkLFL_R(x))
9259__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MkLogFileC);
9311#define MkLogFileHandleResolve_e(netHdl) ({ \
9312 MK_HDL tmpHdl=netHdl; \
9317 tmp=MkLogFileHandleResolve(tmpHdl); \
9319 MkErrorSetC_1_NULL("ERROR: 'MkLogFileC' handle is 'NULL'"); \
9334 __parser__(flags=
new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,
class=MkLogFileC,null-
return-allow)
9479#define MkDbgMkExt2(c,x) mk_dbg_color_ln(c,"MkExtensionS: ptr<%p>, next<%p>, prev<%p>", (x), (x)->next, (x)->prev)
9480#define MkDbgMkExt(x) MkDbgMkExt2(MK_COLOR_CYAN,x)
9510 #define MkExtensionC_SIGNATURE (MkObjectC_SIGNATURE ^ (9u<<10))
9511 #define MkExtensionC_MASK (((1u<<22)-1)<<10)
9519 #define MkExtensionC_X2ext(x) (x)
9520 #define MkExtensionC_X2obj(x) MkOBJ(x)
9533 #define MkExtensionC_T (&MK_RT_REF._MkExtensionC_T)
9535 #define MkExtensionC_TT (MkTYP(MkExtensionC_T))
9537 #define MkExtensionST MkExtensionC_T
9539 #define MkExtensionSTT (MkTYP(MkExtensionST))
9541 #define MkExtensionC_type MK_EXT
9543 #define MkExtensionCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
9545 #define MkExtensionCTT_X(instance) (MkOBJ_R(instance).type)
9547 #define MkExtensionCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
9549 #define MkExtensionC_NS MK
9551 #define MkExtensionCTT MkExtensionCTT
9553 #define MkExtensionCT ( (struct MkTypeDefS *) MkExtensionCTT )
9561 #pragma GCC diagnostic push
9562 #pragma GCC diagnostic ignored "-Wattributes"
9580 #pragma GCC diagnostic pop
9581 #define MkExtensionC_Check(mng) MkExtCheck(mng)
9591 META_ATTRIBUTE_SANITIZE
9599 META_ATTRIBUTE_SANITIZE
9606 #define MkExtRaise(_ext) if (!_MkCheckX(MkExtensionC,_ext)) { \
9607 MkErrorSetC_1E("'MkExtensionC' hdl is NULL"); \
9612 #define MkEXT_R(x) (*(x)).super.ext
9614 #define MkEXT(x) (&MkEXT_R(x))
9627#define MkExtension_size 64
9695#define MkDbgErr_2(err,col) \
9696 mk_dbg_color_ln(col,"MkDbgErr[%p]: check<%d>, mkrt<%s>, isLocal<%d>, format_of_error<%p>", \
9697 err, MkErrCheck(err), MkDbgRtChkX(err), MkOBJ(err)->obj_protect.isLocal, err->format_of_error)
9698#define MkDbgErr(err) MkDbgErr_2(err,MK_COLOR_WHITE)
9700#if META_DEBUG & META_DEBUG_ERROR
9745 #define MkErrorC_SIGNATURE (MkObjectC_SIGNATURE ^ (4u<<10))
9746 #define MkErrorC_MASK (((1u<<22)-1)<<10)
9754 #define MkErrorC_X2err(x) (x)
9755 #define MkErrorC_X2obj(x) MkOBJ(x)
9768 #define MkErrorC_T (&MK_RT_REF._MkErrorC_T)
9770 #define MkErrorC_TT (MkTYP(MkErrorC_T))
9772 #define MkErrorST MkErrorC_T
9774 #define MkErrorSTT (MkTYP(MkErrorST))
9776 #define MkErrorC_type MK_ERR
9778 #define MkErrorCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
9780 #define MkErrorCTT_X(instance) (MkOBJ_R(instance).type)
9782 #define MkErrorCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
9784 #define MkErrorC_NS MK
9786 #define MkErrorCTT MkErrorCTT
9788 #define MkErrorCT ( (struct MkTypeDefS *) MkErrorCTT )
9796 #pragma GCC diagnostic push
9797 #pragma GCC diagnostic ignored "-Wattributes"
9815 #pragma GCC diagnostic pop
9825 META_ATTRIBUTE_SANITIZE
9833 META_ATTRIBUTE_SANITIZE
9840 #define MkErrRaise(_err) if (!_MkCheckX(MkErrorC,_err)) { \
9841 MkErrorSetC_1E("'MkErrorC' hdl is NULL"); \
9846 #define MkERR_R(x) (*(x)).super.err
9848 #define MkERR(x) (&MkERR_R(x))
9870__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MkErrorC);
9922#define MkErrorHandleResolve_e(netHdl) ({ \
9923 MK_HDL tmpHdl=netHdl; \
9928 tmp=MkErrorHandleResolve(tmpHdl); \
9930 MkErrorSetC_1_NULL("ERROR: 'MkErrorC' handle is 'NULL'"); \
9945 __parser__(flags=
new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,
class=MkErrorC,null-
return-allow)
9967#define MK_ERREXT_ARGS MK_RT_ARGS MK_ERR const mkerr, MK_ERREXT const errext
9968#define MK_ERREXT_CALL MK_RT_CALL err, errext
9970#define MK_ERREXT_ARGS_N MK_RT_ARGS MK_ERRN const mkerr, MK_ERREXT const errext
9971#define MK_ERREXT_CALL_N MK_RT_CALL err, errext
10062 #define MkErrExtC_SIGNATURE (MkExtensionC_SIGNATURE ^ (1u<<6))
10063 #define MkErrExtC_MASK (((1u<<26)-1)<<6)
10071 #define MkErrExtC_X2errext(x) (x)
10072 #define MkErrExtC_X2ext(x) MkEXT(x)
10073 #define MkErrExtC_X2obj(x) MkOBJ(x)
10086 #define MkErrExtC_T (&MK_RT_REF._MkErrExtC_T)
10088 #define MkErrExtC_TT (MkTYP(MkErrExtC_T))
10090 #define MkErrExtST MkErrExtC_T
10092 #define MkErrExtSTT (MkTYP(MkErrExtST))
10094 #define MkErrExtC_type MK_ERREXT
10096 #define MkErrExtCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
10098 #define MkErrExtCTT_X(instance) (MkOBJ_R(instance).type)
10100 #define MkErrExtCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
10102 #define MkErrExtC_NS MK
10104 #define MkErrExtCTT MkErrExtCTT
10106 #define MkErrExtCT ( (struct MkTypeDefS *) MkErrExtCTT )
10114 #pragma GCC diagnostic push
10115 #pragma GCC diagnostic ignored "-Wattributes"
10133 #pragma GCC diagnostic pop
10134 #define MkErrExtC_Check(mng) MkErrExtCheck(mng)
10144 META_ATTRIBUTE_SANITIZE
10152 META_ATTRIBUTE_SANITIZE
10159 #define MkErrExtRaise(_errext) if (!_MkCheckX(MkErrExtC,_errext)) { \
10160 MkErrorSetC_1E("'MkErrExtC' hdl is NULL"); \
10165 #define MkERREXT_R(x) (*(x)).super.errext
10167 #define MkERREXT(x) (&MkERREXT_R(x))
10177#define MkErrExtAdd(_mkerrR,add) do { \
10178 (_mkerrR).mkErrExt = (typeof((_mkerrR).mkErrExt)) MkExtensionAdd(MkEXT((_mkerrR).mkErrExt),MkEXT(add)); \
10180 MkERREXT_R(add).mkerrhead = &(_mkerrR); \
10183#define MkErrExtDel(_mkerrR,del) do { \
10185 (_mkerrR).mkErrExt = (typeof((_mkerrR).mkErrExt)) MkExtensionDel(MkEXT((_mkerrR).mkErrExt),MkEXT(del)); \
10186 MkERREXT_R(del).mkerrhead = NULL; \
10225 #define MkErrorPanicC_SIGNATURE (MkObjectC_SIGNATURE ^ (7u<<10))
10226 #define MkErrorPanicC_MASK (((1u<<22)-1)<<10)
10234 #define MkErrorPanicC_X2obj(x) MkOBJ(x)
10247 #define MkErrorPanicC_T (&MK_RT_REF._MkErrorPanicC_T)
10249 #define MkErrorPanicC_TT (MkTYP(MkErrorPanicC_T))
10251 #define MkErrorPanicST MkErrorPanicC_T
10253 #define MkErrorPanicSTT (MkTYP(MkErrorPanicST))
10255 #define MkErrorPanicCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
10257 #define MkErrorPanicCTT_X(instance) (MkOBJ_R(instance).type)
10259 #define MkErrorPanicCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
10261 #define MkErrorPanicC_NS MK
10263 #define MkErrorPanicCTT MkErrorPanicCTT
10265 #define MkErrorPanicCT ( (struct MkTypeDefS *) MkErrorPanicCTT )
10311 #define MkErrorExitC_SIGNATURE (MkObjectC_SIGNATURE ^ (8u<<10))
10312 #define MkErrorExitC_MASK (((1u<<22)-1)<<10)
10320 #define MkErrorExitC_X2obj(x) MkOBJ(x)
10333 #define MkErrorExitC_T (&MK_RT_REF._MkErrorExitC_T)
10335 #define MkErrorExitC_TT (MkTYP(MkErrorExitC_T))
10337 #define MkErrorExitST MkErrorExitC_T
10339 #define MkErrorExitSTT (MkTYP(MkErrorExitST))
10341 #define MkErrorExitCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
10343 #define MkErrorExitCTT_X(instance) (MkOBJ_R(instance).type)
10345 #define MkErrorExitCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
10347 #define MkErrorExitC_NS MK
10349 #define MkErrorExitCTT MkErrorExitCTT
10351 #define MkErrorExitCT ( (struct MkTypeDefS *) MkErrorExitCTT )
10397 #define MkErrorIgnoreC_SIGNATURE (MkObjectC_SIGNATURE ^ (5u<<10))
10398 #define MkErrorIgnoreC_MASK (((1u<<22)-1)<<10)
10406 #define MkErrorIgnoreC_X2obj(x) MkOBJ(x)
10419 #define MkErrorIgnoreC_T (&MK_RT_REF._MkErrorIgnoreC_T)
10421 #define MkErrorIgnoreC_TT (MkTYP(MkErrorIgnoreC_T))
10423 #define MkErrorIgnoreST MkErrorIgnoreC_T
10425 #define MkErrorIgnoreSTT (MkTYP(MkErrorIgnoreST))
10427 #define MkErrorIgnoreCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
10429 #define MkErrorIgnoreCTT_X(instance) (MkOBJ_R(instance).type)
10431 #define MkErrorIgnoreCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
10433 #define MkErrorIgnoreC_NS MK
10435 #define MkErrorIgnoreCTT MkErrorIgnoreCTT
10437 #define MkErrorIgnoreCT ( (struct MkTypeDefS *) MkErrorIgnoreCTT )
10483 #define MkErrorPrintC_SIGNATURE (MkObjectC_SIGNATURE ^ (6u<<10))
10484 #define MkErrorPrintC_MASK (((1u<<22)-1)<<10)
10492 #define MkErrorPrintC_X2obj(x) MkOBJ(x)
10505 #define MkErrorPrintC_T (&MK_RT_REF._MkErrorPrintC_T)
10507 #define MkErrorPrintC_TT (MkTYP(MkErrorPrintC_T))
10509 #define MkErrorPrintST MkErrorPrintC_T
10511 #define MkErrorPrintSTT (MkTYP(MkErrorPrintST))
10513 #define MkErrorPrintCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
10515 #define MkErrorPrintCTT_X(instance) (MkOBJ_R(instance).type)
10517 #define MkErrorPrintCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
10519 #define MkErrorPrintC_NS MK
10521 #define MkErrorPrintCTT MkErrorPrintCTT
10523 #define MkErrorPrintCT ( (struct MkTypeDefS *) MkErrorPrintCTT )
10574 #define MkErrorDefaultC_SIGNATURE (MkErrorC_SIGNATURE ^ (1u<<6))
10575 #define MkErrorDefaultC_MASK (((1u<<26)-1)<<6)
10583 #define MkErrorDefaultC_X2err(x) MkERR(x)
10584 #define MkErrorDefaultC_X2obj(x) MkOBJ(x)
10597 #define MkErrorDefaultC_T (&MK_RT_REF._MkErrorDefaultC_T)
10599 #define MkErrorDefaultC_TT (MkTYP(MkErrorDefaultC_T))
10601 #define MkErrorDefaultST MkErrorDefaultC_T
10603 #define MkErrorDefaultSTT (MkTYP(MkErrorDefaultST))
10605 #define MkErrorDefaultCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
10607 #define MkErrorDefaultCTT_X(instance) (MkOBJ_R(instance).type)
10609 #define MkErrorDefaultCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
10611 #define MkErrorDefaultC_NS MK
10613 #define MkErrorDefaultCTT MkErrorDefaultCTT
10615 #define MkErrorDefaultCT ( (struct MkTypeDefS *) MkErrorDefaultCTT )
10640#define MkERROR_R(r) ((*r).error_mk)
10641#define MkERROR MkERROR_R(&MK_RT_REF)
10642#define MkERROR_RT MkERROR_R(&MK_RT_REF)
10643#define MkERROR_O(o) MkERROR_R(MkRT_O(o))
10644#define MkERROR_X(x) MkERROR_R(MkRT_X(x))
10645#define MkERROR_XN(x) MkERROR_R(MkRT_XN(x))
10646#define MkERROR_NULL MkERROR_R(&MkRuntimeRLS)
10654#define MK_ERROR_DEFAULT_R(r) MkOBJ(&(*r).error_mk)
10655#define MK_ERROR_DEFAULT MK_ERROR_DEFAULT_R(&MK_RT_REF)
10656#define MK_ERROR_DEFAULT_X(x) MK_ERROR_DEFAULT_R(MkRT_X(x))
10657#define MK_ERROR_DEFAULT_NULL MK_ERROR_DEFAULT_R(&MkRuntimeRLS)
10674#define MK_ERROR_PANIC_R(r) MkOBJ(&(*r).error_panic)
10675#define MK_ERROR_PANIC MK_ERROR_PANIC_R(&MK_RT_REF)
10676#define MK_ERROR_PANIC_X(x) MK_ERROR_PANIC_R(MkRT_X(x))
10678#define MK_ERROR_PANIC_NULL MK_ERROR_PANIC_R(&MkRuntimeRLS)
10705#define MK_ERROR_EXIT_R(r) MkOBJ(&(*r).error_exit)
10706#define MK_ERROR_EXIT MK_ERROR_EXIT_R(&MK_RT_REF)
10707#define MK_ERROR_EXIT_X(x) MK_ERROR_EXIT_R(MkRT_X(x))
10709#define MK_ERROR_EXIT_NULL MK_ERROR_EXIT_R(&MkRuntimeRLS)
10736#define MK_ERROR_IGNORE_R(r) MkOBJ(&(*r).error_ignore)
10737#define MK_ERROR_IGNORE MK_ERROR_IGNORE_R(&MK_RT_REF)
10738#define MK_ERROR_IGNORE_X(x) MK_ERROR_IGNORE_R(MkRT_X(x))
10739#define MK_ERROR_IGNORE_XN(x) MK_ERROR_IGNORE_R(MkRT_XN(x))
10741#define MK_ERROR_IGNORE_NULL MK_ERROR_IGNORE_R(&MkRuntimeRLS)
10776#define MK_ERROR_PRINT_R(r) MkOBJ(&(*r).error_print)
10777#define MK_ERROR_PRINT MK_ERROR_PRINT_R(&MK_RT_REF)
10778#define MK_ERROR_PRINT_X(x) MK_ERROR_PRINT_R(MkRT_X(x))
10780#define MK_ERROR_PRINT_NULL MK_ERROR_PRINT_R(&MkRuntimeRLS)
10804#define MK_ERROR_FORMAT_R(r) ((*r).error_mk.format_of_error ? (*r).error_mk.format_of_error : \
10805 MkObjN((*r).error_mk.source_of_error) ? MkObjN((*r).error_mk.source_of_error) : \
10806 MK_ERROR_DEFAULT_R(r))
10807#define MK_ERROR_FORMAT MK_ERROR_FORMAT_R(&MK_RT_REF)
10808#define MK_ERROR_FORMAT_X(x) MK_ERROR_FORMAT_R(MkRT_X(x))
10810#define MK_ERROR_FORMAT_NULL MK_ERROR_FORMAT_R(&MkRuntimeRLS)
10833#define MkErrorFORMAT_1M(m) MkErrorFORMAT(MkObjN(m))
10834#define MkErrorFORMAT_1X(x) MkErrorFORMAT(MkOBJ(x))
10835#define MkErrorFORMAT_1O(o) MkErrorFORMAT(o)
10913#define MkErrorGetCodeI(e) ((*e).code)
10915#define MkErrorGetCodeE_NULL() (MkERROR_NULL.code)
10917#define MkErrorGetCode_O(o) (MkERROR_O(o).code)
10926#define MkErrorGetTextI(e) (MkBUF_R(&(*e).text).storage.first.C)
10935#define MkErrorGetSizeI(e) ((MK_SIZE)MkBUF_R(&(*e).text).var.cursize)
10944#define MkErrorGetNumI(e) ((*e).num)
10973#define MkErrorSetCONTINUE_0E() MkErrorSetCONTINUE(&MkERROR)
11088#define MkErrorCheckI(err) ((err) >= MK_ERROR)
11092#define MkErrorCheckE_0E() (MkErrorCheckI(MkErrorGetCode_0E()))
11093#define MkErrorCheckE_NULL() (MkErrorCheckI(MkErrorGetCodeE_NULL()))
11094#define MkErrorCheckE_O(o) (MkErrorCheckI(MkErrorGetCode_O(o)))
11095#define MkErrorCheckE_X(x) MkErrorCheckE_O(MkOBJ(x))
11096#define MkErrorCheckE_E(e) (MkErrorCheckI((e)->code))
11099#define MkErrorCheck(err) if (MkErrorCheckI(err)) goto error
11101#define MkErrorE_Check(err) if (MkErrorCheckI(err)) goto error
11103#define MkErrorCheck_0E() if (MkErrorCheckE_0E()) goto error
11105#define MkErrorBreak(err) if (MkErrorCheckI(err)) break
11107#define MkContinueCheck(err) switch (err) { \
11108case MK_OK: break; case MK_CONTINUE: goto cont; case MK_ERROR: goto error;\
11112#define MkErrorSwitch(PROC) switch (PROC) {\
11113case MK_OK: break; case MK_ERROR: goto error; case MK_CONTINUE: return MK_CONTINUE;\
11120#define MkErrorReturnAppend(PROC) \
11121if (MkErrorCheckI(PROC)) { \
11122 return MkErrorStack_0E (); \
11123} else if (MkErrorCheckE_0E()) { \
11124 return MkErrorReset_0E (); \
11126 return MkERROR.code; \
11130#define MkErrorReturn_2X(mngx,PROC) switch (PROC) {\
11131case MK_OK: return MK_OK; case MK_CONTINUE: return MK_CONTINUE; default: return MkErrorStack_1X (mngx);\
11134#define MkErrorReturn_1(PROC) switch (PROC) {\
11135case MK_OK: return MK_OK; case MK_CONTINUE: return MK_CONTINUE; default: return MkErrorStack_0E ();\
11138#define MkErrorReturn(PROC) MkErrorReturn_2X(META_CONTEXT_S,PROC)
11140#define check_MkErrorE(PROC) if (MkErrorCheckI(PROC))
11143#define MkErrorReturnLabel(mng) \
11146 return MkErrorStack_1M(mng);
11182#define MkPanicVL_5M(errobj,callfunc,errnum,printfmt,var_list) \
11183 MkPanicVL(MkObj(errobj),callfunc,errnum,printfmt,var_list)
11203#define MkPanicV_4M(errobj,callfunc,errnum,printfmt,...) \
11204 MkPanicV(MkObj(errobj),callfunc,errnum,printfmt,__VA_ARGS__)
11206#define MkPanicV_2M(x,printfmt,...) \
11207 MkPanicV_2(MkObj(x),printfmt,__VA_ARGS__)
11227#define MkPanicC_4M(errobj,callfunc,errnum,message) \
11228 MkPanicC(MkObj(errobj),callfunc,errnum,message)
11230#define MkPanicC_2M(x,message) MkPanicC_2(MkObj(x),message)
11246#define MkPanicDEFAULT_2M(errobj,...) MkPanicDEFAULT(MkObj(errobj),__VA_ARGS__)
11247#define MkPanicDEFAULT_1M(x) MkPanicDEFAULT_1(MkObj(x))
11253#define MkPanicSYS(mngx) do { \
11254 MkLogC_2X(mngx,"internal ERROR, please contact your local support\n"); \
11255 MkDisasterSignal(-1); \
11266) __attribute__ ((noreturn));
11395#define MkErrorSetC_1XS(message) MkErrorSetC_4M(META_CONTEXT_S,message,__func__,-1)
11396#define MkErrorSetC_2E_E(caller,message) MkErrorCheck(MkErrorSetC_2E(message,caller))
11398#define MkErrorSetC_4_NULL(...) MkErrorSetC_RT(MK_RT_NULL __VA_ARGS__)
11399#define MkErrorSetC_3_NULL(...) MkErrorSetC_4_NULL(&MkERROR_NULL,__VA_ARGS__)
11400#define MkErrorSetC_2_NULL(msg,pfx) MkErrorSetC_3_NULL(msg,pfx,-1)
11401#define MkErrorSetC_1_NULL(msg) MkErrorSetC_3_NULL(msg,__func__,-1)
11403#define MkErrorSetC_4M_NULL(m,...) MkErrorSetC_4_NULL(MkErrorFORMAT_1M(m),__VA_ARGS__)
11404#define MkErrorSetC_3M_NULL(m,msg,pfx) MkErrorSetC_4M_NULL(m,msg,pfx,-1)
11405#define MkErrorSetC_2M_NULL(m,msg) MkErrorSetC_4M_NULL(m,msg,__func__,-1)
11452#define MkErrorSetV_4EO_NULL(o,...) MkErrorSetV_NULL(MkErrorFORMAT_EO(o), __VA_ARGS__)
11453#define MkErrorSetV_4M_NULL(m,...) MkErrorSetV_NULL(MkErrorFORMAT_1M(m),__VA_ARGS__)
11454#define MkErrorSetV_2M_NULL(m,...) MkErrorSetV_4M_NULL(m,__func__,-1,__VA_ARGS__)
11455#define MkErrorSetV_2X(x,...) MkErrorSetV(MkErrorFORMAT_1X(x),__func__,-1,__VA_ARGS__)
11457#define MkErrorSetV_1_NULL(printfmt,...) \
11458 MkErrorSetV_NULL(&MkERROR_NULL,__func__,-1,printfmt,__VA_ARGS__)
11460#define MkErrorSetV_1XS(printfmt,...) \
11461 MkErrorSetV_4M(META_CONTEXT_S,__func__,-1,printfmt,__VA_ARGS__)
11463#define MkErrorSetV_2E_E(caller,printfmt,...) \
11464 MkErrorCheck(MkErrorSetV_2E(caller,printfmt,__VA_ARGS__))
11466#define MkErrorSet_ObjectIsNullError(m,printfmt,...) \
11467 MkErrorSetV_4M(m,"ObjectIsNullError",-1,printfmt,__VA_ARGS__)
11469#define MkErrorSysO(obj,cmd) \
11470 MkErrorSetV_4EO_NULL (obj, __func__, errno, \
11471 "can not '%s' -> ERR<%s>", MK_CPPXSTR(cmd), strerror (errno))
11527#define MkErrorPrintln_0() MkErrorPrintln_0E()
11549#define MkErrorLog_1EF_NULL(fmt) MkErrorLog(&MkERROR_NULL,fmt,0,__func__,0)
11550#define MkErrorLog_1EF(fmt) MkErrorLog_4E(fmt,0,__func__,0)
11611#define MkObjectErrorCatch_3X(x,...) MkObjectErrorCatch(MkOBJ(x),__VA_ARGS__)
11640 bool const force
__parser__(
default=B#
false)
11643#define MkErrorReset_0M() MkErrorReset_4M(NULL,__func__,__LINE__,0);
11644#define MkErrorResetFORCE_1(m) MkErrorReset_4M(m,__func__,__LINE__,1);
11645#define MkErrorResetFORCE_0() MkErrorReset_4M(NULL,__func__,__LINE__,1);
11647#define MkErrorReset_4X(x,...) MkErrorReset(MkErrorFORMAT_1X(x),__VA_ARGS__)
11648#define MkErrorReset_1X(x) MkErrorReset_4X(x,__func__,__LINE__,0)
11685#define MkErrorStack_1M_Check(m) (MkErrorCheckE_0E() ? MkErrorStack_1M(m) : MkErrorGetCode_0E())
11686#define MkErrorStack_0E_Check() (MkErrorCheckE_0E() ? MkErrorStack_0E() : MkErrorGetCode_0E())
11688#define MkErrorStack_4X(x,...) MkErrorStack_RT(MK_RT_CALL MkErrorFORMAT_1X(x),__VA_ARGS__)
11689#define MkErrorStack_3X(...) MkErrorStack_4X(__VA_ARGS__,__LINE__)
11690#define MkErrorStack_2X(...) MkErrorStack_4X(__VA_ARGS__,__FILE__,__LINE__)
11691#define MkErrorStack_1X(...) MkErrorStack_4X(__VA_ARGS__,__func__,__FILE__,__LINE__)
11693#define MkErrorStack_0_NULL() MkErrorStack_NULL(&MkERROR_NULL,__func__,__FILE__,__LINE__)
11695#define MkErrorStack_4X_NULL(x,...) MkErrorStack_NULL(MkErrorFORMAT_1X(x),__VA_ARGS__)
11696#define MkErrorStack_3X_NULL(...) MkErrorStack_4X_NULL(__VA_ARGS__,__LINE__)
11697#define MkErrorStack_2X_NULL(...) MkErrorStack_4X_NULL(__VA_ARGS__,__FILE__,__LINE__)
11698#define MkErrorStack_1X_NULL(...) MkErrorStack_4X_NULL(__VA_ARGS__,__func__,__FILE__,__LINE__)
11700#define MkErrorStack_NUM 50
11701#define MkErrorStack_STR "50"
11820 #define MkRtExtC_SIGNATURE (MkExtensionC_SIGNATURE ^ (2u<<6))
11821 #define MkRtExtC_MASK (((1u<<26)-1)<<6)
11829 #define MkRtExtC_X2rtext(x) (x)
11830 #define MkRtExtC_X2ext(x) MkEXT(x)
11831 #define MkRtExtC_X2obj(x) MkOBJ(x)
11844 #define MkRtExtC_T (&MK_RT_REF._MkRtExtC_T)
11846 #define MkRtExtC_TT (MkTYP(MkRtExtC_T))
11848 #define MkRtExtST MkRtExtC_T
11850 #define MkRtExtSTT (MkTYP(MkRtExtST))
11852 #define MkRtExtC_type MK_RTEXT
11854 #define MkRtExtCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
11856 #define MkRtExtCTT_X(instance) (MkOBJ_R(instance).type)
11858 #define MkRtExtCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
11860 #define MkRtExtC_NS MK
11862 #define MkRtExtCTT MkRtExtCTT
11864 #define MkRtExtCT ( (struct MkTypeDefS *) MkRtExtCTT )
11872 #pragma GCC diagnostic push
11873 #pragma GCC diagnostic ignored "-Wattributes"
11891 #pragma GCC diagnostic pop
11892 #define MkRtExtC_Check(mng) MkRtExtCheck(mng)
11902 META_ATTRIBUTE_SANITIZE
11910 META_ATTRIBUTE_SANITIZE
11917 #define MkRtExtRaise(_rtext) if (!_MkCheckX(MkRtExtC,_rtext)) { \
11918 MkErrorSetC_1E("'MkRtExtC' hdl is NULL"); \
11923 #define MkRTEXT_R(x) (*(x)).super.rtext
11925 #define MkRTEXT(x) (&MkRTEXT_R(x))
11935#define MkRtExtAdd(_mkrtR,add,id) do { \
11936 (_mkrtR).mkRtExt = (typeof((_mkrtR).mkRtExt)) MkExtensionAdd(MkEXT((_mkrtR).mkRtExt),MkEXT(add)); \
11937 MkRTEXT_R(add).mkrtHead = &(_mkrtR); \
11938 (_mkrtR).mkRtExtAry[id] = MkRTEXT(add); \
11941#define MkRtExtDel(_mkrtR,del,id) do { \
11942 (_mkrtR).mkRtExt = (typeof((_mkrtR).mkRtExt)) MkExtensionDel(MkEXT((_mkrtR).mkRtExt),MkEXT(del)); \
11943 MkRTEXT_R(del).mkrtHead = NULL; \
11944 (_mkrtR).mkRtExtAry[id] = NULL; \
12014#define MkDbgRt_1(c) mk_dbg_color_ln(c,"mkrt<%p>, MkRT<%p>", mkrt, MkRT)
12015#define MkDbgRt() MkDbgRt_1(MK_COLOR_PURPLE)
12016#define MkDbgRtChkX(x) (MkRT_X(x)==MkRT?"ok":"wrong")
12027#pragma GCC diagnostic push
12028#pragma GCC diagnostic ignored "-Wlto-type-mismatch"
12030#if defined(MK_C_BUILD_DLL)
12032 #define META_SECTION_DEFINE
12033 #include "MkRuntimeS_mk.h"
12034 #undef META_SECTION_DEFINE
12173#pragma GCC diagnostic pop
12186 #define MkRuntimeC_SIGNATURE (MkObjectC_SIGNATURE ^ (10u<<10))
12187 #define MkRuntimeC_MASK (((1u<<22)-1)<<10)
12195 #define MkRuntimeC_X2rt(x) (x)
12196 #define MkRuntimeC_X2obj(x) MkOBJ(x)
12209 #define MkRuntimeC_T (&MK_RT_REF._MkRuntimeC_T)
12211 #define MkRuntimeC_TT (MkTYP(MkRuntimeC_T))
12213 #define MkRuntimeST MkRuntimeC_T
12215 #define MkRuntimeSTT (MkTYP(MkRuntimeST))
12217 #define MkRuntimeC_type MK_RT
12219 #define MkRuntimeCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
12221 #define MkRuntimeCTT_X(instance) (MkOBJ_R(instance).type)
12223 #define MkRuntimeCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
12225 #define MkRuntimeC_NS MK
12227 #define MkRuntimeCTT MkRuntimeCTT
12229 #define MkRuntimeCT ( (struct MkTypeDefS *) MkRuntimeCTT )
12237 #pragma GCC diagnostic push
12238 #pragma GCC diagnostic ignored "-Wattributes"
12256 #pragma GCC diagnostic pop
12257 #define MkRuntimeC_Check(mng) MkRtCheck(mng)
12267 META_ATTRIBUTE_SANITIZE
12275 META_ATTRIBUTE_SANITIZE
12282 #define MkRtRaise(_rt) if (!_MkCheckX(MkRuntimeC,_rt)) { \
12283 MkErrorSetC_1E("'MkRuntimeC' hdl is NULL"); \
12307__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MkRuntimeC);
12359#define MkRuntimeHandleResolve_e(netHdl) ({ \
12360 MK_HDL tmpHdl=netHdl; \
12365 tmp=MkRuntimeHandleResolve(tmpHdl); \
12367 MkErrorSetC_1_NULL("ERROR: 'MkRuntimeC' handle is 'NULL'"); \
12382 __parser__(flags=
new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,
class=MkRuntimeC,null-
return-allow)
12408#define MkRT (&MkRuntimeRLS)
12409#define MkRT_R (MkRuntimeRLS)
12412 #define MkRT_O(o) ((o) && (*o).objRt ? (*o).objRt : MkRuntimeGet())
12413 #define MkRT_X(x) ((x) && MkOBJ_R(x).objRt ? MkOBJ_R(x).objRt : MkRuntimeGet())
12414 #define MkRT_ONN(o) ((*o).objRt)
12415 #define MkRT_ON(o) ( (*o).objRt ? (*o).objRt : MkRuntimeGet())
12416 #define MkRT_XN(x) ( MkOBJ_R(x).objRt ? MkOBJ_R(x).objRt : MkRuntimeGet())
12418 #define MkRT_O(o) MkRT
12419 #define MkRT_X(x) MkRT
12420 #define MkRT_ONN(o) MkRT
12421 #define MkRT_ON(o) MkRT
12422 #define MkRT_XN(x) MkRT
12426 #define MkRtSetup_O(o) MK_RT_UNUSED MK_RT const mkrt = MkRT_O(o)
12427 #define MkRtSetup_X(x) MK_RT_UNUSED MK_RT const mkrt = MkRT_X(x)
12428 #define MkRtSetup_XN(x) MK_RT_UNUSED MK_RT const mkrt = MkRT_XN(x)
12429 #define MkRtSetup_ON(o) MK_RT_UNUSED MK_RT const mkrt = MkRT_ON(o)
12430 #define MkRtSetup_NULL MK_RT_UNUSED MK_RT const mkrt = MkRuntimeGet()
12431 #define MkRtSetup_RT(r) MK_RT_UNUSED MK_RT const mkrt = r
12432 #define MkRtSetupFromRtExt(rtx) MK_RT_UNUSED MK_RT const mkrt = MkRTEXT_R(rtx).mkrtHead
12435 #define MkRtSetup_O_RT(o) if (mkrt == NULL) mkrt = MkRT_O(o)
12436 #define MkRtSetup_ON_RT(o) if (mkrt == NULL) mkrt = MkRT_ON(o)
12437 #define MkRtSetup_X_RT(x) if (mkrt == NULL) mkrt = MkRT_X(x)
12438 #define MkRtSetup_XN_RT(x) if (mkrt == NULL) mkrt = MkRT_XN(x)
12439 #define MkRtSetup_NULL_RT if (mkrt == NULL) mkrt = MkRuntimeGet()
12441 #define AllRtSetup_O(o) MkRtSetup_O(o)
12442 #define AllRtSetup_ON(o) MkRtSetup_ON(o)
12443 #define AllRtSetup_X(x) MkRtSetup_X(x)
12444 #define AllRtSetup_XN(x) MkRtSetup_XN(x)
12445 #define AllRtSetup_NULL MkRtSetup_NULL
12447 #define MkRtSetup_O(o)
12448 #define MkRtSetup_X(x)
12449 #define MkRtSetup_XN(x)
12450 #define MkRtSetup_ON(o)
12451 #define MkRtSetup_NULL
12452 #define MkRtSetup_RT(r)
12454 #define MkRtSetup_O_RT(o)
12455 #define MkRtSetup_X_RT(x)
12456 #define MkRtSetup_XN_RT(x)
12457 #define MkRtSetup_ON_RT(o)
12458 #define MkRtSetup_NULL_RT
12460 #define AllRtSetup_O(o)
12461 #define AllRtSetup_ON(o)
12462 #define AllRtSetup_X(x)
12463 #define AllRtSetup_XN(x)
12464 #define AllRtSetup_NULL
12530 #define MkRuntimeCallbackS_ident_size 30
12736#define MkRuntimeLogBufferPush() MkLogDataS saveLogTarget = MkRuntimeLogTargetPush_RT(MK_RT_CALL "BUFFER")
12745#define MkRuntimeLogBufferPop() MkRuntimeLogTargetPop_RT(MK_RT_CALL saveLogTarget)
13028 #define MK_EMBEDDED(type,call,...) ({ \
13029 type ret = (type) 0; \
13030 if (MkErrorCheckI(call (__VA_ARGS__,&ret))) goto error; \
13035#ifndef MK_EMBEDDED_REF
13037 #define MK_EMBEDDED_REF(type,call,...) ({ \
13039 if (MkErrorCheckI(call (__VA_ARGS__,&ret))) goto error; \
13161__parser__push__(doc-name=Introspection,doc-index=Class,
class=MkBufferListC,no-rpc,null-
return-allow,flags=
new);
13196__parser__push__(doc-name=Introspection,doc-index=Class,
class=MkBufferC,no-rpc,null-
return-allow,flags=
new);
13231__parser__push__(doc-name=Introspection,doc-index=Class,
class=MkBufferStreamC,no-rpc,null-
return-allow,flags=
new);
13266__parser__push__(doc-name=Introspection,doc-index=Class,
class=MkErrorC,no-rpc,null-
return-allow,flags=
new);
13301__parser__push__(doc-name=Introspection,doc-index=Class,
class=MkLogFileC,no-rpc,null-
return-allow,flags=
new);
13336__parser__push__(doc-name=Introspection,doc-index=Class,
class=MkObjectC,no-rpc,null-
return-allow);
13371__parser__push__(doc-name=Introspection,doc-index=Class,
class=MkRuntimeC,no-rpc,null-
return-allow,flags=
new);
13474 assert(self_out != NULL);
13484 if (self != NULL) {
13486 MkErrorSetV_2M(obj,
"RefCount Error: object '%s' has 'self' but 'refCout <= 0", obj->type->type_name);
13495 if (self == NULL) {
13496 MkErrorSetV_2M(obj,
"Error: '%s->SelfCreate' return a NULL pointer", obj->type->type_name);
13527#define MkObjectToError_1X(obj) MkObjectToError(MkOBJ(obj))
#define MkLogDataS_LogNAME_size
append to logFILE, valid values are: stderr, stdout or a filename (default: stderr)
#define MkCacheS_MkCacheItemS_size
#define MkCacheS_name_size
#define MkTypeS_name_size
static MK_OBJ MkObjectInstancesOfType_RT(MK_RT mkrt, MK_SIG typeSIG)
return the head-instance from a specific type defined by signature typeSIG …
#define MkRuntimeCallbackS_ident_size
#define MkBuffer1024S_ils_size
1024 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBuffer256S_ils_size
256 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBuffer64S_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
MK_NUM MkBufferPush_RT(MK_RT mkrt, MK_BUF const buf, MK_STRN const val)
add str to the MkBufferC …
enum MkErrorE MkBufferToObject_RT(MK_RT mkrt, MK_BUF const buf, MK_NAT_OBJECT *obj_out)
return the native language object from a MkBufferC …
MK_BUF MkBufferAppendC_RT(MK_RT mkrt, MK_BUF const buf, MK_STRN const val)
append a single string to a MkBufferC object …
MK_I32 MkBufferAppendV_RT(MK_RT mkrt, MK_BUF const buf, MK_FST const printfmt,...)
append a single string with format and ... arguments to a MkBuffer64S …
MK_I32 MkBufferAppendVL_RT(MK_RT mkrt, MK_BUF const buf, MK_FST const printfmt, va_list var_list)
append a single string with format and var_list arguments to a MkBuffer64S …
MK_BUF MkBufferAppendStringR_RT(MK_RT mkrt, MK_BUF const buf, MkStringR const val)
append a single string to a MkBufferC object …
MK_NUM MkBufferPop_RT(MK_RT mkrt, MK_BUF const buf, MK_STRN const val)
delete str from the MkBufferC …
#define MkBufferS_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
static MK_BUF MkBufferNext(MK_BUF const buf)
get next instance from linked-list of MkBufferS type
static MK_BUF MkBufferInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkBufferS type …
static MK_BUF MkBufferGetNull(void)
Null-Slot - return a MkBufferC typed NULL instance …
static MK_BUF MkBufferHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkBufferC from netHdl or MK_NULL if invalid…
static MK_HDL MkBufferHandleGet_RT(MK_RT mkrt, MK_BUF const buf)
Handle-Get-Slot - returns a export-hdl to the MkBufferC useable for external storage
static MK_BUF MkBufferPrev(MK_BUF const buf)
get previous instance from linked-list of MkBufferS type
static MK_BUF MkBuf(MK_MNG mng)
cast a unknown-object into an MkBufferS pointer or NULL if not possible
static bool MkBufCheckO(MK_OBJN obj)
check MkBufferS -> MkObjectS::signature …
#define MkBufferC_X2obj(x)
static bool MkBufCheck(MK_MNGN mng)
check MkBufferS -> MkObjectS::signature …
#define MkBufferC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
static MK_BUFN MkBufN(MK_MNGN mng)
(const) cast a unknown-object into an MkBufferS pointer or NULL if not possible
enum MkErrorE MkBufferGetI64_RT(MK_RT mkrt, MK_BUFN const buf, MK_I64 *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetDBL_RT(MK_RT mkrt, MK_BUFN const buf, MK_DBL *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetBOOL_RT(MK_RT mkrt, MK_BUFN const buf, MK_BOOL *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetFLT_RT(MK_RT mkrt, MK_BUFN const buf, MK_FLT *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetBIN_RT(MK_RT mkrt, MK_BUFN const buf, MkBinaryR *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetSTR_RT(MK_RT mkrt, MK_BUFN const buf, MK_STRN *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetBOL_RT(MK_RT mkrt, MK_BUFN const buf, MK_BOL *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetU32_RT(MK_RT mkrt, MK_BUFN const buf, MK_U32 *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetI32_RT(MK_RT mkrt, MK_BUFN const buf, MK_I32 *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetLONG_RT(MK_RT mkrt, MK_BUFN const buf, MK_LONG *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetI8_RT(MK_RT mkrt, MK_BUFN const buf, MK_I8 *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetU16_RT(MK_RT mkrt, MK_BUFN const buf, MK_U16 *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetI16_RT(MK_RT mkrt, MK_BUFN const buf, MK_I16 *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetBUF_RT(MK_RT mkrt, MK_BUF const buf, MK_BUF *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetStringR_RT(MK_RT mkrt, MK_BUFN const buf, MkStringR *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetBFL_RT(MK_RT mkrt, MK_BUFN const buf, MK_BFL *const val_inout)
function to read an MkBufferListC from an MkBufferC object …
bool MkBufferIsLocal_RT(MK_RT mkrt, MK_BUFN const buf)
Check if the MkBufferC is local (temporary), not local mean global …
enum MkTypeE MkBufferGetType2_RT(MK_RT mkrt, MK_BUFN const buf)
return the MkTypeE from a MkBufferC …
void MkBufferLog_RT(MK_RT mkrt, MK_BUFN const buf, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the MkBufferC …
MK_STRB MkBufferGetType1_RT(MK_RT mkrt, MK_BUFN const buf)
return the type from a MkBufferC as single character value …
MK_STRN MkBufferGetType3_RT(MK_RT mkrt, MK_BUFN const buf)
return the type from a MkBufferC as single character string …
void MkBufferLogSS_RT(MK_RT mkrt, MK_BUFN const buf, MK_STRN const varname, MK_OBJN fmtobj, MK_STRN const callfunc)
log the whole MkBufferC object to the MkLogFileC (default: stderr) …
void MkBufferLogS_RT(MK_RT mkrt, MK_BUFN const buf, MK_STRN const varname, MK_OBJN fmtobj, MK_STRN const callfunc)
log the short MkBufferC object data to the MkLogFileC (default: stderr) …
enum MkErrorE MkBufferCastTo_RT(MK_RT mkrt, MK_BUF const buf, enum MkTypeE const typ)
change the type of an MkBufferC to type …
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 …
MK_STRN MkBufferToString_RT(MK_RT mkrt, MK_BUFN const inst)
String-Slot - returns the string representation of the inst …
MK_BUF MkBufferTemp_RT(MK_RT mkrt, MK_BUFN const buf)
create a temporary copy of the MkBufferC buf …
MK_BUF MkBufferSizeNew_RT(MK_RT mkrt, MK_BUF const buf, MK_NUM const size)
alloc min size storage to the buf …
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 MkBufferReset_RT(MK_RT mkrt, MK_BUF const buf)
reset a MkBufferC to the length zero …
MK_BUF MkBufferSizeAdd_RT(MK_RT mkrt, MK_BUF const buf, MK_NUM const size)
add size storage to the buf …
MK_BUF MkBufferSetI8_RT(MK_RT mkrt, MK_BUF const buf, MK_I8 const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetBinaryR_RT(MK_RT mkrt, MK_BUF const buf, MkBinaryR const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetV_RT(MK_RT mkrt, MK_BUF const buf, MK_FST const val,...)
set the MkBufferC using a ... value …
MK_BUF MkBufferSetI16_RT(MK_RT mkrt, MK_BUF const buf, MK_I16 const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetSTR_RT(MK_RT mkrt, MK_BUF const buf, MK_STRN const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetBIN_RT(MK_RT mkrt, MK_BUF const buf, MkBinaryR const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetDBL_RT(MK_RT mkrt, MK_BUF const buf, MK_DBL const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetFLT_RT(MK_RT mkrt, MK_BUF const buf, MK_FLT const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetI32_RT(MK_RT mkrt, MK_BUF const buf, MK_I32 const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetVL_RT(MK_RT mkrt, MK_BUF const buf, MK_FST const val, va_list var_list)
set the MkBufferC using a va_list value …
MK_BUF MkBufferSetBOL_RT(MK_RT mkrt, MK_BUF const buf, MK_BOL const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetStringR_RT(MK_RT mkrt, MK_BUF const buf, MkStringR const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetI64_RT(MK_RT mkrt, MK_BUF const buf, MK_I64 const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetBUF_RT(MK_RT mkrt, MK_BUF const buf, MK_BUFN const val)
Set the MkBufferC to the val …
MK_BUF MkBufferMerge_RT(MK_RT mkrt, MK_BUF const buf)
Merge-Constructor - create a new MkBufferC as a merge from an existing object …
MK_BUF MkBufferCreateSTR_RT(MK_RT mkrt, MK_STRN const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreateI8_RT(MK_RT mkrt, MK_I8 const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
#define MkBufferCreateLOCAL_T(cls, name, size)
create an new MkBufferC object as L)ocal S)torage…
MK_BUF MkBufferCreateBOL_RT(MK_RT mkrt, MK_BOL const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreateI64_RT(MK_RT mkrt, MK_I64 const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreateI32_RT(MK_RT mkrt, MK_I32 const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreate64_RT(MK_RT mkrt, MK_NUM const size)
call the BufferCreate with default type MkBuffer64S (64 byte) …
#define MkBufferCreateTLS_inout_T(cls, name, inout)
Constructs a MkBufferC instance as T)hread L)ocal S)torage OR reuse inout if possible…
MK_BUF MkBufferCreate256_RT(MK_RT mkrt, MK_NUM const size)
call the BufferCreate with default type MkBuffer256S (256 byte) …
MK_BUF MkBufferCreate_RT(MK_RT mkrt, MK_TYP type, MK_NUM const size)
Constructor - create a new MkBufferC with minimum size of internal storage …
MK_BUF MkBufferCreateI16_RT(MK_RT mkrt, MK_I16 const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
void MkBufferInit_RT(MK_RT mkrt, MK_BUF const buf, MK_TYP type, MK_NUM const size)
initialize or free an MkBufferC reference-instance …
#define MkBufferCreateTLS_T(cls, name, size)
create an new MkBufferC object as T)hread L)ocal S)torage…
MK_BUF MkBufferDup_RT(MK_RT mkrt, MK_BUFN const buf)
Dup-Constructor - create a new MkBufferC instance as copy from an existing MkBufferC instance
MK_BUF MkBufferCreateDBL_RT(MK_RT mkrt, MK_DBL const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
void MkBufferFree_RT(MK_RT mkrt, MK_BUF const buf)
initialize or free an MkBufferC reference-instance …
MK_BUF MkBufferCreateFLT_RT(MK_RT mkrt, MK_FLT const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreateTLS_RT(MK_RT mkrt, MK_STRN const tlsName, bool const resetB)
same as BufferCreate but require no cleanup
void MkBufferDelete_RT(MK_RT mkrt, MK_BUF const buf)
Destructor - delete a MkBufferC instance …
MK_BUF MkBufferCreateBIN_RT(MK_RT mkrt, MkBinaryR const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreate1024_RT(MK_RT mkrt, MK_NUM const size)
call the BufferCreate with default type MkBuffer1024S (1024 byte) …
MK_BUF MkBufferCreateBUF_RT(MK_RT mkrt, MK_BUFN const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
static MK_BFL MkBufferListNext(MK_BFL const bfl)
get next instance from linked-list of MkBufferListS type
static MK_BFL MkBufferListPrev(MK_BFL const bfl)
get previous instance from linked-list of MkBufferListS type
static MK_BFL MkBufferListInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkBufferListS type …
#define MkBufferListC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MkBufferListC_X2obj(x)
#define MkBufferStream1024_ils_size
1024 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBufferStream16384S_ils_size
16384 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBufferStream256S_ils_size
256 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBufferStream64_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBufferStreamS_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
static MK_HDL MkBufferStreamHandleGet_RT(MK_RT mkrt, MK_BUS const bus)
Handle-Get-Slot - returns a export-hdl to the MkBufferStreamC useable for external storage
static MK_BUS MkBufferStreamNext(MK_BUS const bus)
get next instance from linked-list of MkBufferStreamS type
static MK_BUS MkBufferStreamGetNull(void)
Null-Slot - return a MkBufferStreamC typed NULL instance …
static MK_BUS MkBufferStreamInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkBufferStreamS type …
static MK_BUS MkBufferStreamPrev(MK_BUS const bus)
get previous instance from linked-list of MkBufferStreamS type
static MK_BUS MkBufferStreamHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkBufferStreamC from netHdl or MK_NULL if invalid…
static MK_BUS MkBus(MK_MNG mng)
cast a unknown-object into an MkBufferStreamS pointer or NULL if not possible
#define MkBufferStreamC_X2obj(x)
static MK_BUSN MkBusN(MK_MNGN mng)
(const) cast a unknown-object into an MkBufferStreamS pointer or NULL if not possible
static bool MkBusCheck(MK_MNGN mng)
check MkBufferStreamS -> MkObjectS::signature …
#define MkBufferStreamC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
static bool MkBusCheckO(MK_OBJN obj)
check MkBufferStreamS -> MkObjectS::signature …
MK_BFL MkBufferStreamToBFL_RT(MK_RT mkrt, MK_BUSN const bus)
convert the bus into a MkBufferListC …
MK_BUS MkBufferStreamCopy_RT(MK_RT mkrt, MK_BUS const bus, MK_BUSN const src)
copy the MkBufferStreamC from src to bus …
MK_BUS MkBufferStreamReset_RT(MK_RT mkrt, MK_BUS const bus)
reset a MkBufferStreamC to the length zero …
void MkBufferStreamLog_RT(MK_RT mkrt, MK_BUS const bus, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the MkBufferStreamC …
void MkBufferStreamPosToStart_RT(MK_RT mkrt, MK_BUS const bus)
set the current-access-position to the start of MkBufferStreamC …
void MkBufferStreamResetFull_RT(MK_RT mkrt, MK_BUS const bus)
reset a MkBufferStreamC to the length zero and free allocated storage…
void MkBufferStreamLogS_RT(MK_RT mkrt, MK_BUS const bus, MK_OBJ fmtobj, MK_STRN const callfunc)
MK_STRN MkBufferStreamToString_RT(MK_RT mkrt, MK_BUSN const inst)
String-Slot - returns the string representation of the inst …
enum MkErrorE MkBufferStreamReadI8_RT(MK_RT mkrt, MK_BUS const bus, MK_I8 *const val_out)
read a val_out from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadI64_RT(MK_RT mkrt, MK_BUS const bus, MK_I64 *const val_out)
read a val_out from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadBUF_RT(MK_RT mkrt, MK_BUS const bus, MK_BUF *const val_out)
read a val_out from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadI32_RT(MK_RT mkrt, MK_BUS const bus, MK_I32 *const val_out)
read a val_out from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadFLT_RT(MK_RT mkrt, MK_BUS const bus, MK_FLT *const val_out)
read a val_out from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadLONG_RT(MK_RT mkrt, MK_BUS const bus, MK_LONG *const val_out)
read the long native object from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadBFL_RT(MK_RT mkrt, MK_BUS const bus, MK_BFL *const val_out)
read a MkBufferListC from the MkBufferStreamC …
enum MkTypeE MkBufferStreamReadGetNextType_RT(MK_RT mkrt, MK_BUSN const bus)
get the type (MkTypeE) of the next Item in the MkBufferStreamC or "0" if not available
enum MkErrorE MkBufferStreamReadSTR_RT(MK_RT mkrt, MK_BUS const bus, MK_STRN *const val_out)
read a val_out from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadUndo_RT(MK_RT mkrt, MK_BUS const bus)
undo the last MkBufferStreamC READ function call …
bool MkBufferStreamReadItemExists_RT(MK_RT mkrt, MK_BUSN const bus)
check if an item exists in the read-data-package …
enum MkErrorE MkBufferStreamReadNEXT_RT(MK_RT mkrt, MK_BUS const bus, MK_NAT_OBJECT *const val_out)
enum MkErrorE MkBufferStreamReadL_START_RT(MK_RT mkrt, MK_BUS const bus, MK_BUF buf)
START read a list-item-type from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadBIN_RT(MK_RT mkrt, MK_BUS const bus, MkBinaryR *const val_out)
read a val_out from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadL_END_RT(MK_RT mkrt, MK_BUS const bus)
END read a list-item-type from the MkBufferStreamC …
MK_NUM MkBufferStreamReadGetNumItems_RT(MK_RT mkrt, MK_BUSN const bus)
get the number of items left in the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadDBL_RT(MK_RT mkrt, MK_BUS const bus, MK_DBL *const val_out)
read a val_out from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadALL_RT(MK_RT mkrt, MK_BUS const bus, MK_BFL *const val_inout)
get a temporary MkBufferListC from all data in the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadLIST_RT(MK_RT mkrt, MK_BUS const bus, MK_NAT_LIST *const val_out)
enum MkErrorE MkBufferStreamReadBOL_RT(MK_RT mkrt, MK_BUS const bus, MK_BOL *const val_out)
read a val_out from the MkBufferStreamC …
MK_BUS MkBufferStreamCreate1024_RT(MK_RT mkrt, MK_NUM const size)
call the BufferStreamCreate with default type MkBufferStream1024S (1024 byte) …
MK_BUS MkBufferStreamDup_RT(MK_RT mkrt, MK_BUSN const src)
Dup-Constructor - create a new MkBufferStreamC instance as copy from an existing MkBufferStreamC inst...
void MkBufferStreamDelete_RT(MK_RT mkrt, MK_BUS const bus)
Destructor - delete a MkBufferStreamC instance …
MK_BUS MkBufferStreamCreate64_RT(MK_RT mkrt, MK_NUM const size)
call the BufferStreamCreate with default type MkBufferStream64S (64 byte) …
MK_BUS MkBufferStreamCreate16384_RT(MK_RT mkrt, MK_NUM const size)
call the BufferStreamCreate with default type MkBufferStream16384S (16384 byte) …
MK_BUS MkBufferStreamMerge_RT(MK_RT mkrt, MK_BUS const bus)
Merge-Constructor - create a new MkBufferStreamC as a merge from an existing object …
void MkBufferStreamInit_RT(MK_RT mkrt, MK_BUS const bus, MK_TYP type, MK_NUM const size)
init and free a MkBufferStreamS reference
MK_BUS MkBufferStreamCreate_RT(MK_RT mkrt, MK_TYP type, MK_NUM const size)
create and initialize an MkBufferStreamC instance …
#define MkBufferStreamCreateSTATIC_T(cls, name)
Constructs a MkBufferStreamC instance as S)tatic S)torage …
MK_BUS MkBufferStreamCreateTLS_RT(MK_RT mkrt, MK_STRN const tlsName, bool const resetB)
same as BufferStreamCreate but require no cleanup …
void MkBufferStreamFree_RT(MK_RT mkrt, MK_BUS const bus)
init and free a MkBufferStreamS reference
#define MkBufferStreamCreateTLS_T(cls, name)
Constructs a MkBufferStreamC instance as T)hread L)ocal S)torage …
MK_BUS MkBufferStreamCreate256_RT(MK_RT mkrt, MK_NUM const size)
call the BufferStreamCreate with default type MkBufferStream256S (256 byte) …
#define MkBufferStreamCreateLOCAL_T(cls, name, size)
Constructs a MkBufferStreamC instance as L)ocal S)torage …
enum MkErrorE MkBufferStreamWriteL_FLAT_RT(MK_RT mkrt, MK_BUS const bus, MK_BFL const bfl)
write a MkBufferListC FLAT into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteBIN_RT(MK_RT mkrt, MK_BUS const bus, MkBinaryR const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteI32_RT(MK_RT mkrt, MK_BUS const bus, MK_I32 const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteDBL_RT(MK_RT mkrt, MK_BUS const bus, MK_DBL const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteL_END_RT(MK_RT mkrt, MK_BUS const bus)
END write a list-item-type into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteFLT_RT(MK_RT mkrt, MK_BUS const bus, MK_FLT const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteHDL_RT(MK_RT mkrt, MK_BUS const bus, MK_I32 const val)
write the handle into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteV_RT(MK_RT mkrt, MK_BUS const bus, MK_STRN const fmt,...)
write format-string into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteVL_RT(MK_RT mkrt, MK_BUS const bus, MK_STRN const fmt, va_list ap)
write format-string into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteBOL_RT(MK_RT mkrt, MK_BUS const bus, MK_BOL const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteL_START_RT(MK_RT mkrt, MK_BUS const bus)
START write a list-item-type into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteBFL_RT(MK_RT mkrt, MK_BUS const bus, MK_BFLN const bfl)
write a MkBufferListC into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteLONG_RT(MK_RT mkrt, MK_BUS const bus, MK_LONG const val)
write the long native object into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteSTR_RT(MK_RT mkrt, MK_BUS const bus, MK_STRN const val, MK_NUM const len)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteBUS_FLAT_RT(MK_RT mkrt, MK_BUS const bus, MK_BUSN const add)
write a MkBufferStreamC into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteI64_RT(MK_RT mkrt, MK_BUS const bus, MK_I64 const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteBUF_RT(MK_RT mkrt, MK_BUS const bus, MK_BUFN const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteI8_RT(MK_RT mkrt, MK_BUS const bus, MK_I8 const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
MK_OBJN(* MkErrorFormatOfF)(MK_ERREXT_ARGS_N, int const dummy)
void(* MkErrorPanikF)(MK_ERREXT_ARGS_N, MK_OBJN const errobj, MK_STRN const prefix, MK_I32 const errnum, MK_STRN const fmt, va_list ap)
MK_OBJN const errobj because of MK_ERROR_FORMAT value.
bool(* MkErrorSetVLF)(MK_ERREXT_ARGS, MK_OBJN const fmtobj, MK_STRN const)
void(* MkErrorLogF)(MK_ERREXT_ARGS_N, MK_OBJN const, MK_DBG const, MK_STRN const, MK_I32 const, MK_STRN const, MK_OBJ const)
bool(* MkErrorAppendFLT)(MK_ERREXT_ARGS, MK_OBJN const fmtobj)
void(* MkErrorResetF)(MK_ERREXT_ARGS, MK_OBJN const fmtobj)
bool(* MkErrorResetOnExitF)(MK_ERREXT_ARGS, MK_OBJN const fmtobj)
void(* MkErrorSetRF)(MK_ERREXT_ARGS, MK_MNGN const errctx, MK_OBJN const fmtobj)
void(* MkErrorSetEF)(MK_ERREXT_ARGS, MK_ERREXT const newerr, MK_OBJN const fmtobj)
void(* MkErrorInit)(MK_ERREXT_ARGS, MK_OBJN const fmtobj)
static MK_ERREXTN MkErrExtN(MK_MNGN mng)
(const) cast a unknown-object into an MkErrExtS pointer or NULL if not possible
static bool MkErrExtCheckO(MK_OBJN obj)
check MkErrExtS -> MkObjectS::signature …
static MK_ERREXT MkErrExt(MK_MNG mng)
cast a unknown-object into an MkErrExtS pointer or NULL if not possible
static bool MkErrExtCheck(MK_MNGN mng)
check MkErrExtS -> MkObjectS::signature …
static MK_ERR MkErrorNext(MK_ERR const err)
get next instance from linked-list of MkErrorS type
static MK_ERR MkErrorGetNull(void)
Null-Slot - return a MkErrorC typed NULL instance …
static MK_ERR MkErrorPrev(MK_ERR const err)
get previous instance from linked-list of MkErrorS type
static MK_ERR MkErrorHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkErrorC from netHdl or MK_NULL if invalid…
static MK_HDL MkErrorHandleGet_RT(MK_RT mkrt, MK_ERR const err)
Handle-Get-Slot - returns a export-hdl to the MkErrorC useable for external storage
static MK_ERR MkErrorInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkErrorS type …
#define MkErrorC_X2obj(x)
static MK_ERRN MkErrN(MK_MNGN mng)
(const) cast a unknown-object into an MkErrorS pointer or NULL if not possible
static bool MkErrCheck(MK_MNGN mng)
check MkErrorS -> MkObjectS::signature …
static MK_ERR MkErr(MK_MNG mng)
cast a unknown-object into an MkErrorS pointer or NULL if not possible
static bool MkErrCheckO(MK_OBJN obj)
check MkErrorS -> MkObjectS::signature …
#define MkErrorC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
MK_I32 MkErrorGetNum(MK_ERRN const err)
get the MkErrorS::num. The number can be used as exit-code …
#define MkErrorGetSizeI(e)
get the error-message-size from the exception-object …
#define MkErrorGetCodeI(e)
get the value of MkErrorS::code …
MK_STRN MkErrorGetText(MK_ERRN const err)
get the MkErrorS::text …
MK_SIZE MkErrorGetSize(MK_ERRN const err)
get the error-message-size from the exception-object …
#define MkErrorGetTextI(e)
get the MkErrorS::text …
#define MkErrorGetNumI(e)
get the MkErrorS::num. The number can be used as exit-code …
enum MkErrorE MkErrorGetCode(MK_ERRN const err)
get the value of MkErrorS::code …
void MkErrorStackFormat_RT(MK_RT mkrt, MK_ERR const err, MK_STRN callfunc, MK_STRN callfile, MK_I32 const callline)
append an ensemble of func, file and line to the error-message …
void MkErrorCleanup_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const callfunc, MK_I32 const callline)
cleanup and print unwanted active error …
void MkErrorPrintln_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const msg, MK_STRN const callfunc, MK_I32 const callline)
print the default-error to the MkLogFileC (default: stderr) and clear the error afterwards …
MK_STRN MkErrorToString_RT(MK_RT mkrt, MK_ERRN const inst)
String-Slot - returns the string representation of the inst …
enum MkErrorE MkErrorReset_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const callfunc, MK_I32 const callline, bool const force)
This function clears the err and resets to MK_OK …
void MkErrorLog_RT(MK_RT mkrt, MK_ERRN const err, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the error to MkLogFileC (default: stderr) …
MK_ERR MkErrorCatch_RT(MK_RT mkrt, MK_ERR const err, MK_EXP const exception, MK_STRN const callfunc)
convert a programming-language-error into an libmkkernel error …
enum MkErrorE MkErrorStack_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const callfunc, MK_STRN const callfile, MK_I32 const callline)
check on error and if yes append an ErrorStackFormat to the error-message …
enum MkErrorE MkErrorRaise_RT(MK_RT mkrt, MK_ERRN const err)
convert an libmkkernel error into an programming-language-error and raise afterwards....
MK_ERR MkErrorNoRaise_RT(MK_RT mkrt, MK_ERR const err)
ignore the next return of MK_ERROR and do not raise an target-language-exception …
void MkDisasterSignal(MK_I32 signal)
called if something get REALLY wrong …
void MkPanicC_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MK_I32 const errnum, MK_STRN const message)
do a panic with string as argument …
enum MkErrorE MkErrorSetVL_RT(MK_RT mkrt, MK_ERR err, MK_STRN const callfunc, MK_I32 const errnum, MK_FST const printfmt, va_list var_list)
'set' and 'raise' the MkErrorC using a vararg-list message …
enum MkErrorE MkErrorSetE_RT(MK_RT mkrt, MK_ERR const err, MK_ERR const newerr)
set the MkErrorC from a MkErrorC copy and raise an error …
#define MkErrorSetV_2M(err, printfmt,...)
enum MkErrorE MkErrorSetC_RT(MK_RT mkrt, MK_ERR err, MK_STRN const message, MK_STRN const callfunc, MK_I32 const errnum)
'set' and 'raise' the MkErrorC using a string-message and a errnum-number …
enum MkErrorE MkErrorSetV_RT(MK_RT mkrt, MK_ERR err, MK_STRN const callfunc, MK_I32 const errnum, MK_FST const printfmt,...)
set the MkErrorS object using a format string argument list and raise an error …
void MkErrorAppendC_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const message)
append the message to the MkErrorS::text …
void MkPanicV_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MK_I32 const errnum, MK_FST const printfmt,...)
do a panic with a vararg as argument …
void MkErrorAppendV_RT(MK_RT mkrt, MK_ERR const err, MK_FST const printfmt,...)
append a vararg string to the MkErrorC …
void MkErrorAppendVL_RT(MK_RT mkrt, MK_ERR const err, MK_FST const printfmt, va_list var_list)
append a va_list string to the MkErrorC …
void MkPanicVL_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MK_I32 const errnum, MK_FST const printfmt, va_list var_list)
do a panic with a vararg-list as argument …
enum MkErrorE MkErrorSetR_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const message, enum MkErrorE const errcode, MK_I32 const errnum, MK_MNG const errctx)
set the MkErrorC and raise the error …
void MkPanicDEFAULT_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc) MK_NO_RETURN
make panic from MkErrorDEFAULT_RT …
bool MkErrorIsSOCKET(MK_ERRN const err)
check on SOCKET-DOWN error …
bool MkErrorIsABORT(MK_ERRN const err)
check on ABORT signal …
enum MkErrorE MkErrorSetEXIT_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const callfunc)
finish the current callback, return to toplevel and MqExit the application …
enum MkErrorE MkErrorSetSOCKET_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const detail, MK_STRN const callfunc)
create SOCKET-DOWN error …
bool MkErrorIsEXIT(MK_ERR const err)
check on APPLICATION-EXIT error …
void MkErrorSetCONTINUE_RT(MK_RT mkrt, MK_ERR const err)
signal end of processing in an MqMqEventIF callback …
bool MkErrorIsTIMEOUT(MK_ERRN const err)
check on TIMEOUT error …
enum MkErrorE MkErrorSetABORT_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const detail, MK_STRN const callfunc)
send the ABORT signal to the calling stack…
void MkErrorSetCode_RT(MK_RT mkrt, MK_ERR const err, enum MkErrorE code)
set the MkErrorS::code value …
static MK_ERR MkErrorPANIC_RT(MK_RT mkrt)
panic-system-error - panic on next error …
static MK_ERR MkErrorDEFAULT_RT(MK_RT mkrt)
default-system-error - default-error …
#define MkErrorFORMAT_1O(o)
static MK_ERR MkErrorPRINT_RT(MK_RT mkrt)
ignore-system-error - print the next error into MkLogFileC …
MK_ERR MkErrorFORMAT(MK_OBJN fmtobj)
system-error-format - format and return the default-error …
static MK_ERR MkErrorIGNORE_RT(MK_RT mkrt)
ignore-system-error - ignore the next error …
static MK_ERR MkErrorEXIT_RT(MK_RT mkrt)
panic-system-error - panic on next error …
MK_ERR MkErrorFORMAT_EO(MK_OBJN fmtobj)
same as (static,runtime) MK_ERR MkErrorDEFAULT() but do not set the MkERROR.format_of_error attribute...
void MkErrorDelete_RT(MK_RT mkrt, MK_ERR err)
Destructor - delete a MkErrorS object …
MK_ERR MkErrorDup_RT(MK_RT mkrt, MK_ERRN const srce)
Dup-Constructor - create a new MkErrorC instance as copy from an existing MkErrorC instance …
void MkErrorCopy_RT(MK_RT mkrt, MK_ERR dest, MK_ERRN const srce)
Copy-Constructor - sync an existing MkErrorC instance with the values from an existing MkErrorC insta...
MK_ERR MkExceptionCatch(MK_MNG const expobj, MK_EXP const exception, MK_STRN const callfunc)
convert an Target-Programming-Language (TPL) exception into an MkErrorC …
void MkExceptionRaise(MK_MNG const expobj, MK_STRN const callfunc, MK_I32 const callline)
convert an MkErrorC into a Target-Programming-Language (TPL) exception …
bool MkExceptionCheck(MK_EXP exception)
Checks if Exception is of type MkExceptionC and returns MK_YES or MK_NO …
#define MkExtension_size
maximum number of runtime-extensions useable in a theKernel software.
MK_EXT MkExtensionDel_RT(MK_RT mkrt, MK_EXT head, MK_EXT del)
this is an update to head, use: head = MkExtensionDel(head, del)
struct MkExtensionS MkExtensionS
Base class for the extension technologie …
bool MkExtensionDeleteAll_RT(MK_RT mkrt, MK_EXT head)
MK_EXT MkExtensionAdd_RT(MK_RT mkrt, MK_EXT head, MK_EXT add)
this is an update to head, use: head = MkExtensionAdd(head, add)
static bool MkExtCheck(MK_MNGN mng)
check MkExtensionS -> MkObjectS::signature …
static MK_EXT MkExt(MK_MNG mng)
cast a unknown-object into an MkExtensionS pointer or NULL if not possible
static MK_EXTN MkExtN(MK_MNGN mng)
(const) cast a unknown-object into an MkExtensionS pointer or NULL if not possible
static bool MkExtCheckO(MK_OBJN obj)
check MkExtensionS -> MkObjectS::signature …
static MK_SIZE MkBinaryGetSize(const MkBinaryR bin)
get size from the binary ...
static MK_BINN MkBinaryGetData(const MkBinaryR bin)
get data pointer from the binary ...
static MkBinaryR MkBinaryDup_RT(MK_RT mkrt, const MkBinaryR bin)
create a binary as duplicate from an already existsing MkBinaryR ...
static bool MkBinaryIsNull(const MkBinaryR bin)
check if binary is NULL ...
static void MkBinaryLog_RT(MK_RT mkrt, const MkBinaryR bin)
get size from the binary ...
static MkBinaryR MkBinaryCreate(MK_SIZE size, MK_BINN data)
create a binary from data and size ...
static const MkBinaryR MkBinaryCreateSlice(const MkBinaryR bin, MK_SIZE start, MK_SIZE wide)
create a binary slice ...
MK_PTR(* MkCacheCF)(MK_RT mkrt, MK_PTR const)
void(* MkCacheDF)(MK_RT mkrt, MK_PTR *const)
void * MK_MACRO_TYP
helper-type used to declare a prototype for a macro
#define MK_NULL_STR
the string "MK_NULL" value as MK_NULL_STR …
#define MK_PARSER_fmtobj
use param_fmtobj for documentation
#define MK_NO_RETURN
dosable "MK_NO_RETURN" because C# require "return" from "MqExit" for thread-pool support
static bool MK_NULL_STR_OR_EMPTY_CHECK_1(char const *const __str)
same as MK_NULL_STR_CHECK together with "" check but without len parameter
static bool MK_NULL_STR_CHECK_1(char const *const __str)
same as MK_NULL_STR_CHECK but without len parameter
#define MK_EXTERN
static library
#define MK_UNUSED
mark unnused variables and functions
static bool MK_NULL_STR_CHECK(char const *const __str, const long int __len)
check if __str is MK_NULL_STR return true or false …
#define MK_NULL
The Programming-Language-Micro-Kernel (PLMK) NULL value as MK_NULL in C …
#define MK_NULL_STR_LEN
the integer strlen("MK_NULL") value as MK_NULL_STR_LEN …
MK_STRN MkTimeoutE_ToString(enum MkTimeoutE value)
return the MkTimeoutE as string …
MkTimeoutE
Predefined Timeout values …
MkBoolE
the internal boolean …
#define MK_TYPE_IS_1_I8E
the type is native and has a size of 1 byte …
enum MkErrorE MkIdSE_FromInt(MK_I32 const value, enum MkIdSE *value_out)
return the MkIdSE from integer …
static MK_I32 MkTypeE_ToInt(enum MkTypeE value)
return the MkTypeE as integer …
enum MkErrorE MkNativeIsE_FromInt(MK_I32 const value, enum MkNativeIsE *value_out)
return the MkNativeIsE from integer …
#define MK_TYPE_IS_2_I8E
the type is native and has a size of 2 bytes …
static MK_I32 MkErrorE_ToInt(enum MkErrorE value)
return the MkErrorE as integer …
#define MK_TYPE_SHIFT
FIXED: type is only 8bit -> 4 bit=15 for type and 4 bit for flag …
MK_STRN MkNativeIsE_ToString(enum MkNativeIsE value)
return the MkNativeIsE as string …
static MK_I32 MkTimeoutE_ToInt(enum MkTimeoutE value)
return the MkTimeoutE as integer …
enum MkErrorE MkTypeE_FromInt(MK_I32 const value, enum MkTypeE *value_out)
return the MkTypeE from integer …
static MK_I32 MkBoolE_ToInt(enum MkBoolE value)
return the MkBoolE as integer …
MK_STRN MkBoolE_ToString(enum MkBoolE value)
return the MkBoolE as string …
#define MK_TYPE_IS_8_I8E
the type is native and has a size of 8 bytes …
MK_STRN MkIdSE_ToString(enum MkIdSE value)
return the MkIdSE as string …
static MK_I32 MkIdSE_ToInt(enum MkIdSE value)
return the MkIdSE as integer …
enum MkErrorE MkErrorE_FromInt(MK_I32 const value, enum MkErrorE *value_out)
return the MkErrorE from integer …
enum MkErrorE MkTimeoutE_FromInt(MK_I32 const value, enum MkTimeoutE *value_out)
return the MkTimeoutE from integer …
static MK_I32 MkNativeIsE_ToInt(enum MkNativeIsE value)
return the MkNativeIsE as integer …
#define MK_TYPE_IS_4_I8E
the type is native and has a size of 4 bytes …
MK_STRN MkTypeE_ToString(enum MkTypeE value)
return the MkTypeE as string …
MkErrorE
collection for the different error-codes …
MkNativeIsE
define if data is string or little or big endian …
enum MkErrorE MkBoolE_FromInt(MK_I32 const value, enum MkBoolE *value_out)
return the MkBoolE from integer …
MkTypeE
basic data-types supported by Programming-Language-Micro-Kernel (PLMK) …
MK_STRN MkErrorE_ToString(enum MkErrorE value)
return the MkErrorE as string …
@ MK_TIMEOUT_LONG
long timeout in sec (180 sec) …
@ MK_TIMEOUT_VERYSHORT
very short timeout in sec (5 sec) …
@ MK_TIMEOUT_INIT
maximum timeout in sec (900 sec) …
@ MK_TIMEOUT_MAX
request the maximum possible (infinite) timeout value …
@ MK_TIMEOUT_NORMAL
normal timeout in sec (90 sec) …
@ MK_TIMEOUT_USER
request the user defined timeout value from the –timeout configuration value …
@ MK_TIMEOUT_SOCKET
shorter timeout in sec (10 sec) … This TIMEOUT is used for socket connection with 'connect'
@ MK_TIMEOUT_SHORT
short timeout in sec (20 sec) …
@ MK_TIMEOUT_DEFAULT
request the default timeout value …
@ MK_ERROR
(persistent) raise an error-event, the calling-fucntion is interrupted.
@ MK_CONTINUE
(transient) raise an continue-event, the calling-function must handle this.
@ MK_OK
(persistent) everything is OK.
@ MK_NATIVE_IS_INITIAL
0 = initial value
@ MK_NATIVE_IS_STRING
S = using of the string protocol.
@ MK_NATIVE_IS_LITTLE
L = using if the binary protocoll, data in little-edian.
@ MK_NATIVE_IS_BIG
B = using if the binary protocoll, data in big-endian.
@ MK_I8T
Y: 1 byte 'byte' type.
@ MK_I64T
W: 8 byte 'long long int' type.
@ MK_FLTT
F: 4 byte 'float' type.
@ MK_BINT
B: X byte 'byte-array' type.
@ MK_I16T
S: 2 byte 'short' type.
@ MK_BOLT
O: 1 byte 'boolean' type.
@ MK_DBLT
D: 8 byte 'double' type.
@ MK_I32T
I: 4 byte 'int' type.
@ MK_STRT
C: X byte 'string' type (e.g. with a \0 at the end)
@ MK_LSTT
L: X byte 'list' type.
MK_BFL MkKernelGetTypeList_RT(MK_RT mkrt)
return a list of all types defind in the Programming-Language-Micro-Kernel (PLMK) …
#define __parser__global__(...)
parser: apply an attribute to a dunction in global scope …
#define __parser__pop__
parser: stop apply a list of local attributes to a block of code …
#define __parser__push__(...)
parser: start apply a list of local attributes to a block of code …
#define __parser__(...)
parser: apply an attribute to an object in local scope …
void MkSetup(void)
setup libmkkernel internal memory …
void MkCleanup(void)
cleanup libmkkernel internal memory …
bool MkCleanupActive
signal that code was triggert by MkCleanup
static void MkStringSplit(MkStringR strR, MK_NUM *len_out, MK_STRN *str_out)
split a str into ptr and len …
enum MkErrorE MkString2U16_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_U16 *val_out)
enum MkErrorE MkString2BOOL_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_BOOL *val_out)
static MK_STRN MkStringGetData(MkStringR const str)
get ptr pointer from the string ...
enum MkErrorE MkString2I8_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_I8 *val_out)
enum MkErrorE MkString2I16_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_I16 *val_out)
enum MkErrorE MkString2ATO_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, enum MkTypeE type, MK_ATO *val_out)
enum MkErrorE MkString2I64_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_I64 *val_out)
enum MkErrorE MkString2LONG_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_LONG *val_out)
enum MkErrorE MkString2FLT_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_FLT *val_out)
static MkStringR MkStringSlice(MkStringR strR, MK_NUM start, MK_NUM len)
create a slice of strR start at start with max len bytes …
enum MkErrorE MkString2HDL_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_HDL *val_out)
static MkStringR MkStringCreate_1(MK_STRN str)
create a str from ptr use MK_NULL as end-of-string ...
static MkStringR MkStringDup_RT(MK_RT mkrt, MkStringR const str)
create a string as duplicate from an already existsing MkBinaryR ...
enum MkErrorE MkString2U32_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_U32 *val_out)
static MkStringR MkStringCreate(MK_NUM len, MK_STRN str)
create a str from ptr and len ...
enum MkErrorE MkString2DBL_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_DBL *val_out)
enum MkErrorE MkString2I32_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_I32 *val_out)
static void MkStringLog_RT(MK_RT mkrt, MkStringR const str, MK_STRN func)
log the string ...
static MK_NUM MkStringGetSize(MkStringR const str)
get len from the string ...
static bool MkStringIsNULL(MkStringR const strR)
check if strR is MK_NULL_STR return true or false …
enum MkErrorE MkString2BOL_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_BOL *val_out)
convert a string into a native
const MK_PTRB * MK_MNGN
const - a managed object pointer, datatype will be checked at runtime
int32_t MK_NUM
array size data-type ('num' items in array …
float MK_FLT
4 byte float data-type
MK_PTRB * MK_PTR
generic pointer data-type
const MK_STRB * MK_STRN
constant string pointer data-type
MK_LSTB * MK_LST
list pointer data-type
MK_PTRB * MK_MNG
managed object pointer, datatype will be checked at runtime
MK_PTRB const * MK_EXP
exception object pointer
const MK_PTRB * MK_PTRN
const generic pointer data-type
unsigned int MK_SIG
signature datatype
MK_STRB const * MK_FST
const format string pointer data-type
char MK_STRB
string type data-type
unsigned long long MK_U64
MK_PTRB * MK_CBP
generic pointer to call-back data
MK_UNUSED static const MK_STRN_A MK_STRN_A_NULL
MK_BINB * MK_BIN
byte-array pointer data-type with binary encoding (MK_BINN)
signed char MK_I8
1 byte byte data-type
MK_PTRB * MK_MXP
MkExceptionC object pointer.
unsigned char MK_BINB
byte-array type data-type
unsigned char MK_LSTB
list type data-type
signed long long MK_I64
8 byte wide integer data-type
bool MK_BOOL
real bool data-type
MK_STRB * MK_STR
string pointer data-type with UTF8 ecoding (MK_STR)
unsigned char MK_BOL
1 byte boolean data-type
void MK_PTRB
pointer type data-type
MK_PTRB * MK_CCP
class constructor/destructor data type
void(* MkMarkF)(MK_RT mkrt, MK_PTR data)
prototype for a Garbage-Collection mark function …
long MK_LONG
4/8 byte long data-type
signed short int MK_I16
2 byte short data-type
double MK_DBL
8 byte double data-type
int32_t MK_HDL
4 byte int handle data-type
MK_BINB const * MK_BINN
const byte-array pointer data-type
signed int MK_I32
4 byte integer data-type
int MK_DBG
debug-level data-type …
struct MkLogDataS MkLogDataS
struct to hold the mkrt-logging-data …
static MK_HDL MkLogFileHandleGet_RT(MK_RT mkrt, MK_LFL const lfl)
Handle-Get-Slot - returns a export-hdl to the MkLogFileC useable for external storage
static MK_LFL MkLogFilePrev(MK_LFL const lfl)
get previous instance from linked-list of MkLogFileS type
static MK_LFL MkLogFileInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkLogFileS type …
static MK_LFL MkLogFileHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkLogFileC from netHdl or MK_NULL if invalid…
static MK_LFL MkLogFileNext(MK_LFL const lfl)
get next instance from linked-list of MkLogFileS type
static MK_LFL MkLogFileGetNull(void)
Null-Slot - return a MkLogFileC typed NULL instance …
#define MkLogFileC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MkLogFileC_X2obj(x)
static MK_LFLN MkLflN(MK_MNGN mng)
(const) cast a unknown-object into an MkLogFileS pointer or NULL if not possible
static bool MkLflCheckO(MK_OBJN obj)
check MkLogFileS -> MkObjectS::signature …
static MK_LFL MkLfl(MK_MNG mng)
cast a unknown-object into an MkLogFileS pointer or NULL if not possible
static bool MkLflCheck(MK_MNGN mng)
check MkLogFileS -> MkObjectS::signature …
void MkLogFileClose_RT(MK_RT mkrt, MK_LFL lfh)
Destructor - delete a MkLogFileC instance …
enum MkErrorE MkLogFileOpen_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const file, MK_LFL *lfh_out)
open the log-file in append mode …
enum MkErrorE MkLogFileWriteVL_RT(MK_RT mkrt, MK_LFLN lfl, MK_FST printfmt, va_list var_list)
write to log-file …
enum MkErrorE MkLogFileGetFile_RT(MK_RT mkrt, MK_LFLN lfl, MK_STRN *file_out)
get the log-file …
enum MkErrorE MkLogFileWriteV_RT(MK_RT mkrt, MK_LFLN lfl, MK_FST printfmt,...)
write to log-file …
enum MkErrorE MkLogFileWriteC_RT(MK_RT mkrt, MK_LFLN lfl, MK_STRN text)
write to log-file …
void(* MkTypeInitF)(MK_RT mkrt, MK_TYP const type)
MK_OBJ(* MkDup2F)(MK_RT mkrt, MK_OBJN const obj, MK_STRN const ident)
void(* MkSelfDeleteF)(MK_RT mkrt, MK_PTR self, MK_PTR const env)
MK_OBJ(* MkResetF)(MK_RT mkrt, MK_OBJ const obj)
void(* MkSelfUnlinkF)(MK_RT mkrt, MK_PTR self, MK_PTR const env)
MK_OBJ(* MkCopyF)(MK_RT mkrt, MK_OBJ const obj, MK_OBJN const src)
MK_PTR(* MkAllocCreateFLT)(MK_RT mkrt, MK_TYP const type)
void(* MkAllocDeleteF)(MK_RT mkrt, MK_TYP const type, MK_PTR ptr)
#define __MkCheckX(cls, x)
MK_OBJ(* MkDupF)(MK_RT mkrt, MK_OBJN const obj)
MK_STRN(* MkToStringF)(MK_RT mkrt, MK_OBJN const obj)
MK_OBJ(* MkMergeF)(MK_RT mkrt, MK_OBJ const obj)
void(* MkDestructorF)(MK_RT mkrt, MK_OBJ const obj)
MK_OBJ(* MkConstructorF)(MK_RT mkrt, MK_TYP type, MK_PTR nat, MK_PTR lnk)
void(* MkLogF)(MK_RT mkrt, MK_OBJN const obj, MK_OBJN fmt, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
bool(* MkLogFormatF)(MK_RT mkrt, char *header, MK_SIZE const headerSize, MK_OBJN const obj, MK_STRN const caller, MK_I32 const debug, MK_STRN const fmt)
#define MkSanitizeCheck(_root, _m)
#define MkDbgDeepWriter(...)
MK_PTR(* MkSelfCreateF)(MK_RT mkrt, MK_OBJ const obj, MK_PTR const env)
#define MkSanitizeCheckO(_root, _o)
MK_OBJ MkObjectHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkObjectC from netHdl or MK_NULL if invalid…
void MkObjectHandleDeleteByNetHdl_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Delete-Slot - delete a netHdl from handle-storage …
#define MkObjectHandleResolve(...)
#define MkObjectHandleGet(...)
static MK_HDL MkObjectHandleGetOfType(MK_OBJ const obj)
Export-Slot - returns typeHdl of the obj .
static MK_OBJ MkObjectGetNull(void)
Null-Slot - return a MkObjectC typed NULL instance …
static MK_OBJ MkObjectPrev(MK_OBJ const obj)
get previous instance from linked-list of MkObjectS type
static MK_OBJ MkObjectNext(MK_OBJ const obj)
get next instance from linked-list of MkObjectS type
static MK_OBJ MkObjectInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkObjectS type …
void MkObjectHandleDelete_RT(MK_RT mkrt, MK_OBJ const netObj)
Handle-Delete-Slot - delete a netObj from handle-storage …
struct MkObjectS * MK_OBJ
class-shortcut for struct MkObjectS *, all shortcut using the XX_YYY syntax (only for public API) …
MK_HDL MkObjectHandleGet_RT(MK_RT mkrt, MK_OBJ const obj)
Handle-Get-Slot - returns a export-hdl to the MkObjectC useable for external storage
MK_HDL MkObjectHandleGetOr0(MK_OBJ const obj)
return export-hdl or 0 in not created…
bool MkObjectHandleExists(MK_OBJ const obj)
check if obj has already a handle defined…
static MK_OBJN MkObjN(MK_MNGN mng)
(const) cast a unknown-object into an MkObjectS pointer or NULL if not possible
static bool MkObjCheckO(MK_OBJN obj)
check MkObjectS -> MkObjectS::signature …
#define MkObjectC_X2obj(x)
#define MkOBJ(x)
cast a known-object into an MkObjectS pointer
#define MkObjectC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
static bool MkObjCheck(MK_MNGN mng)
check MkObjectS -> MkObjectS::signature …
static MK_OBJ MkObj(MK_MNG mng)
cast a unknown-object into an MkObjectS pointer or NULL if not possible
void MkDbgLogC_RT(MK_RT mkrt, MK_OBJN const obj, MK_STRN const callfunc)
debug: write a short-obj-summary to MkLogFileC (default: stderr) …
void MkDbgM_RT(MK_RT mkrt, MK_STRN const message, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
debug: write a static-marker to the MkLogFileC (default: stderr) …
enum MkErrorE MkDbgDump_RT(MK_RT mkrt, MK_OBJN const obj, MK_STRN const message, MK_STRN const callfunc)
debug: Dump a instance to stderr with LNG and MQ internal data…
void MkDbgL_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const message, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
debug: write a instance-marker to the MkLogFileC (default: stderr) using the fmtobj as prefix …
void MkDbgSTACK_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_I32 const skip, MK_I32 const num, MK_STRN const callfunc)
debug: write the stack-trace to MkLogFileC (default: stderr) …
void MkDbgO_RT(MK_RT mkrt, MK_OBJN const obj, MK_STRN const callfunc)
debug: write the object-details to MkLogFileC (default: stderr) …
void MkDbgV_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, FILE *FH, MK_FST const printfmt,...)
write a printf style debug-message to FH using the internal format …
void MkLogHEX_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MkBinaryR const data)
log binaray data as HEX into the MkLogFileC (default: stderr) …
void MkLogV_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MK_DBG debug, MK_FST const printfmt,...)
write a printf style logging-message to MkLogFileC (default: stderr) using the internal format …
void MkObjectLog_RT(MK_RT mkrt, MK_OBJN const obj, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
Log-Slot - log a summary of an object to the MkLogFileC (default: stderr) target …
void MkObjectLogType_RT(MK_RT mkrt, MK_OBJN const obj, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the tyoe of the MkObjectS into the MkLogFileC (default: stderr) …
void MkObjectLogShort_RT(MK_RT mkrt, MK_OBJN const obj, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the MkObjectS into the MkLogFileC (default: stderr) …
void MkLogC_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const message, MK_DBG const debug, MK_STRN const callfunc)
write a logging-message to MkLogFileC (default: stderr) using the internal format …
void MkLogVL_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MK_DBG debug, MK_FST const printfmt, va_list var_list)
write a vprintf style logging-message to MkLogFileC using the internal format …
void MkObjectLogLong_RT(MK_RT mkrt, MK_OBJN const obj, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the MkObjectS verbose into the MkLogFileC (default: stderr) …
MK_STRN MkObjectToString_RT(MK_RT mkrt, MK_OBJN const inst)
String-Slot - returns the string representation of the inst …
static MK_ERR MkObjectToError_RT(MK_RT mkrt, MK_OBJ const obj)
Error-Slot - return an error-object pre initialized with obj data.
MK_ERR MkObjectErrorCatch_RT(MK_RT mkrt, MK_OBJN const obj, MK_EXP const exception, MK_STRN const callfunc)
convert a programming-language-error into an libmkkernel error …
static bool MkObjectIsNull(MK_OBJ const obj)
ckeck if the object is MK_NULL
MK_STRN MkObjectToNameOfType_RT(MK_RT mkrt, MK_OBJN const obj)
Type-Slot - returns the LibMkKernel-Type-Name of the obj as a string
MK_STRN const MkObjectToName_RT(MK_RT mkrt, MK_OBJN const obj)
Info-Slot - returns brief information about the obj as a string
#define MkObjectToString(...)
MK_STRN MkObjectToNameOfClass_RT(MK_RT mkrt, MK_OBJ const obj)
Class-Slot - returns the C-Class-Name of the obj as string
MK_NUM MkRefCidN_RT(MK_RT mkrt)
return the reference-count-recursion-level
MK_OBJ MkObjCopy_RT(MK_RT mkrt, MK_OBJ const tgtmng, MK_OBJN const srcmng)
call the copy from the object
bool MkSelfDeleteForce_RT(MK_RT mkrt, MK_OBJ obj)
force delete an instance, last step in instance-destructor
void(* MkSelfIncrF)(MK_RT mkrt, MK_PTR self, MK_PTR const env)
#define MkSelfCreate(...)
static MK_ATTR_HOT enum MkErrorE MkSelfNew_RT(MK_RT mkrt, MK_OBJ obj, MK_PTR *self_out, MK_PTR const env)
return the self pointer for a given obj …
static void MkSelfSet(MK_OBJ const obj, MK_PTR const self, MK_PTR const env)
set the MkObjectS::self value
MK_OBJ MkRefDecrWithoutSelf_RT(MK_RT mkrt, MK_OBJ const obj)
ATOMIC operation -> unlink self with reference-count.
static bool MkSelfExists(MK_OBJN obj)
Check if the MkObjectS::self exists …
static void MkRefIncr(MK_OBJ obj)
increment the reference-count
#define MkRefLOCK
unchangeable reference
static MK_I32 MkRefLock(MK_OBJ const obj)
lock the object
void MkRefDecr_RT(MK_RT mkrt, MK_OBJ obj)
decrement the reference-count
void MkSelfUnlink_RT(MK_RT mkrt, MK_OBJ obj)
Run the MkTypeS::selfUnlink slot from the instance...
MK_OBJ MkObjReset_RT(MK_RT mkrt, MK_OBJ const obj)
free the internal memory of an object and initialize the local variables to default values
MK_PTR MkSelfCreate_RT(MK_RT mkrt, MK_OBJ const obj, MK_PTR const env)
create the MkObjectS::self value
static bool MkRefIsLocked(MK_OBJ const obj)
check if object is locked
void(* MkSelfDecrF)(MK_RT mkrt, MK_PTR self, MK_PTR const env)
static MK_PTR MkSelfGet(MK_OBJ const obj)
get the MkObjectS::self value
MK_OBJ MkRefDecrWithUnlinkSelf_RT(MK_RT mkrt, MK_OBJ const obj)
ATOMIC operation -> unlink self from META und decr-ref-count in META.
bool MkSelfDelete_RT(MK_RT mkrt, MK_OBJ const obj)
delete the MkObjectS::self value
static MK_I32 MkRefGet(MK_OBJ const obj)
get the reference-count
static void MkRefIncrSelf(MK_OBJ const obj, MK_PTR const self, MK_PTR const env)
ATOMIC operation -> link self with reference-count.
MK_PTR(* MkSysCallocF)(size_t, size_t)
calloc syscall …
MkIdSE
signal type of the MkIdS data val …
void MkSysPrintStackTrace_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl, MK_I32 skip, MK_I32 const num)
backtrace syscall with libmkkernel error plugin
#define MkSysPrintStackTrace_2(fmtobj, debug)
#define MkSysStringIsLenEQUAL(_str, _other, _len)
static enum MkErrorE MkSysWaitForProcess(MK_OBJN fmtobj, MK_IDNT const id)
wait for process to finish syscall with libmkkernel error plugin
MK_STR(* MkSysStrNCpyF)(char *, const char *, size_t)
strdup strncpy …
static enum MkErrorE MkSysUSleep(MK_OBJN fmtobj, useconds_t const usec)
usleep syscall with libmkkernel error plugin
MK_STR MkSysStrNDup(MK_OBJN fmtobj, MK_STRN const str, MK_SIZE const len)
strndup syscall with libmkkernel error plugin
MK_PTR(* MkSysMallocF)(size_t)
malloc syscall …
void MkSysPrintProcessMemoryMap_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl)
write the memory-map to MkLogFileC used at MkDisasterSignal …
enum MkErrorE MkSysKill(MK_OBJN fmtobj, MK_I32 pid, MK_I32 signal)
kill syscall with libmkkernel error plugin
void MkSysPipeHandler(MkSysPipeHandlerE keepPipe)
internal support for pipe ignore
MK_PTR MkSysRealloc(MK_OBJN fmtobj, MK_PTR const buf, size_t const size)
realloc syscall with libmkkernel error plugin
enum MkErrorE MkSysGetPid(MK_OBJN fmtobj, MK_I32 *pid_out)
getpid syscall with libmkkernel error plugin
MK_PTR MkSysCalloc(MK_OBJN fmtobj, size_t const nmemb, size_t const size)
calloc syscall with libmkkernel error plugin
enum MkErrorE MkSysStrNCpy(MK_OBJN fmtobj, MK_STR const to, MK_STRN const from, MK_SIZE const len)
strncpy syscall with libmkkernel error plugin
pid_t(* MkSysForkF)(void)
fork syscall …
#define MkSysFree(pointer)
static enum MkErrorE MkSysWaitForThread(MK_OBJN fmtobj, MK_IDNT const id)
wait for thread to finish syscall with libmkkernel error plugin
MK_STRN MkSysHashSTR(MK_STRN key, MK_NUM length)
compute the HASH from a string …
static bool MkSysStringIsNotNULL(MK_STRN str)
test if string is NOT NULL or EMPTY …
#define MkSysStringSetNULL_R(_str)
MK_STR MkSysBasename_RT(MK_RT mkrt, MK_STRN const pathName, bool const includeExtension)
basename syscall with libmkkernel error plugin
void MkSysFreeP(MK_PTR data)
free syscall with libmkkernel error plugin
enum MkErrorE(* MkSysWaitF)(MK_OBJN const fmtobj, MK_IDNT const id)
wait for process to finish syscall with libmkkernel error plugin
MK_PTR MkSysMemDup(MK_OBJN fmtobj, MK_PTRN const blck, size_t const size)
memdup syscall with libmkkernel error plugin
MK_PTR MkSysReCalloc(MK_OBJN fmtobj, MK_PTR const buf, MK_NUM const oldnum, MK_NUM const addnum, size_t const size)
realloc syscall with libmkkernel error plugin
#define MkSysStringIsNULL_R(_str)
#define MkSysStringSet_R(_str, _val)
enum MkErrorE MkSysGetTimeOfDay(MK_OBJN fmtobj, struct mk_timeval *tv_out, struct mk_timezone *tz_out)
gettimeofday syscall with libmkkernel error plugin
#define MkSysStringIsEQUAL(_str, _other)
MK_PTR MkSysMalloc(MK_OBJN fmtobj, size_t const size)
malloc syscall with libmkkernel error plugin
static int MkSysExit_RT(MK_RT mkrt, int isThread, int num)
exit syscall with libmkkernel error plugin
MK_STR(* MkSysStrNDupF)(MK_STRN, size_t)
strndup syscall …
MK_STRN_A MkSysStringArrayDup(MK_OBJN fmtobj, MK_STRN_A const strA)
strdup syscall with libmkkernel error plugin
struct MkLalS MkLal
Language Abstraction Layer in duty.
#define MkSysFreeNonNull(pointer)
MK_STR MkSysPrintF_RT(MK_RT mkrt, MK_STRN const format,...)
sprintf syscall with libmkkernel error plugin
MK_STR(* MkSysStrDupF)(MK_STRN)
strdup syscall …
void(* MkSysFreeF)(MK_PTR)
free syscall …
MK_STRN MkSysGetTrace_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl, MK_I32 skip, MK_I32 const num)
same as MkSysPrintStackTrace but return a string…
static MK_STRN MkSysStringGetNoNULL(MK_STRN str)
get string "" or VALUE …
MK_PTR(* MkSysReallocF)(MK_PTR, size_t)
realloc syscall …
static MK_STRN MkSysStringGet(MK_STRN str)
get string NULL or VALUE …
MK_STR MkSysStrDup(MK_OBJN fmtobj, MK_STRN const str)
strdup syscall with libmkkernel error plugin
uintptr_t MK_IDNT
process or thread identifier …
static enum MkErrorE MkSysSleep(MK_OBJN fmtobj, MK_I32 const sec)
sleep syscall with libmkkernel error plugin
MK_STR MkSysDirname_RT(MK_RT mkrt, MK_STRN const pathName)
dirname syscall with libmkkernel error plugin
int(* MkSysExitF)(MK_RT mkrt, int isThread, int num)
static bool MkSysStringIsNULL(MK_STRN str)
test if string is NULL or EMPTY …
MK_I32 MkSysHashI32(MK_STRN key, MK_NUM length)
same as MkSysHashSTR but return MK_I32 …
@ MK_ID_THREAD
val has a thread handle
@ MK_ID_PROCESS
val has a process handle
@ MK_ID_UNUSED
empty struct
enum MkErrorE MkObjectDeleteCallbackSetup_RT(MK_RT mkrt, MK_STRN ident, MkObjectDeleteCallF fCall, MK_CBP callback, MkObjectDeleteFreeF fFree, MK_STRN filter)
Create/Delete the instance-delete-callback …
void MkObjectDeleteCallbackCleanup_RT(MK_RT mkrt, MK_STRN ident)
cleanup the DeleteCallback installed with MkObjectDeleteCallbackSetup …
void(* MkObjectDeleteFreeF)(MkObjectDeleteFreeF_ARGS)
void MkObjectDispose_RT(MK_RT mkrt, MK_OBJ obj)
Dispose-Slot - untie the connection between the Native-C-Instance and the libmkkernel-Instance.
MK_OBJ MkObjMerge_RT(MK_RT mkrt, MK_OBJ const obj)
Constructor - create a new object as a merge from an existing object
#define MkObjectDeleteCallF_ARGS
the MkObjectDeleteCallF arguments with default names
MK_OBJ MkObjCreate_RT(MK_RT mkrt, MK_TYP type, MK_PTR nat, MK_PTR lnk)
call the Constructor from the object
MK_OBJ MkObjDup2_RT(MK_RT mkrt, MK_OBJ const srcmng, MK_STRN const ident)
call the Dup2-Constructor from the object
#define MkObjectDeleteFreeF_ARGS
the MkObjectDeleteFreeF arguments with default names
void MkObjectDelete_RT(MK_RT mkrt, MK_OBJ obj)
Delete-Slot - delete an instance.
MK_OBJ MkObjDup_RT(MK_RT mkrt, MK_OBJ const srcobj)
call the Dup-Constructor from the object
enum MkErrorE(* MkObjectDeleteCallF)(MK_RT mkrt, MK_OBJN const obj, MK_STRN const typeName, MK_HDL const typeHdl, MK_HDL const objHdl, MK_CBP const __data__)
static callback to delete an obj …
static bool MkRtExtCheckO(MK_OBJN obj)
check MkRtExtS -> MkObjectS::signature …
static MK_RTEXTN MkRtExtN(MK_MNGN mng)
(const) cast a unknown-object into an MkRtExtS pointer or NULL if not possible
static bool MkRtExtCheck(MK_MNGN mng)
check MkRtExtS -> MkObjectS::signature …
static MK_RTEXT MkRtExt(MK_MNG mng)
cast a unknown-object into an MkRtExtS pointer or NULL if not possible
struct MkThreadDataS MkThreadDataS
bool MkRuntimeSysPipeHandlerUse
block SIGPIPE ignore handlern default=MK_YES, Java require this
static MK_HDL MkRuntimeHandleGet_RT(MK_RT mkrt, MK_RT const rt)
Handle-Get-Slot - returns a export-hdl to the MkRuntimeC useable for external storage
static MK_RT MkRuntimePrev(MK_RT const rt)
get previous instance from linked-list of MkRuntimeS type
static MK_RT MkRuntimeNext(MK_RT const rt)
get next instance from linked-list of MkRuntimeS type
#define MkRuntimeHandleResolve(...)
#define MkRuntimeHandleGet(...)
static MK_RT MkRuntimeGetNull(void)
Null-Slot - return a MkRuntimeC typed NULL instance …
static MK_RT MkRuntimeHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkRuntimeC from netHdl or MK_NULL if invalid…
#define MkRuntimeInstances()
static MK_RT MkRuntimeInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkRuntimeS type …
#define MkRuntimeC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
static MK_RTN MkRtN(MK_MNGN mng)
(const) cast a unknown-object into an MkRuntimeS pointer or NULL if not possible
#define MkRuntimeC_X2obj(x)
static MK_RT MkRt(MK_MNG mng)
cast a unknown-object into an MkRuntimeS pointer or NULL if not possible
static bool MkRtCheckO(MK_OBJN obj)
check MkRuntimeS -> MkObjectS::signature …
static bool MkRtCheck(MK_MNGN mng)
check MkRuntimeS -> MkObjectS::signature …
void MkRuntimeLogTargetPop_RT(MK_RT mkrt, MkLogDataS logOld)
static void MkRuntimeDebugSet(MK_I32 dbg)
set the MkRuntimeS::debug value …
enum MkErrorE MkRuntimeLogTargetSet_RT(MK_RT mkrt, MK_STRN logTgt)
set the MkRuntimeS::log value and cleanup old value …
static enum MkErrorE MkRuntimeErrorGetCode_RT(MK_RT mkrt)
return MkErrorS::code from a given MkRuntimeC …
static bool MkRuntimeIsSilentGet(void)
get the MkRuntimeS::isSilent value …
static void MkRuntimeIsSilentSet_RT(MK_RT mkrt, bool silent)
set the MkRuntimeS::isSilent value …
void MkRuntimeSetCID(MK_OBJ const cid)
CID == context-in-duty.
static MK_I32 MkRuntimeDebugGet(void)
get the MkRuntimeS::debug value …
MkLogDataS MkRuntimeLogTargetPush_RT(MK_RT mkrt, MK_STRN logTgt)
#define MkRuntimeLogBufferPush()
static void MkRuntimeNoDecoSet_RT(MK_RT mkrt, bool noDeco)
static MK_STRN MkRuntimeLogTargetGet(void)
get the MkLogDataS::logNAME value …
enum MkErrorE MkRuntimeLogTargetReset_RT(MK_RT mkrt)
set the MkRuntimeS::log value to the DEFAULT value …
#define MkRuntimeLogBufferPop()
void MkRuntimeLog0_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the MkRuntimeC …
void MkRuntimeCleanup(MK_RT mkrt)
cleanup MkRuntimeRLS …
#define MkRtSetup_ON_RT(o)
size_t MkRuntimeCallbackAdd(MK_RT mkrt, MkRuntimeCallbackS *cbdata, MkRuntimeInitF rt_callback, MK_STRN ident)
add a callback to the runtime …
static MK_RT MkRuntimeGetFromObj(MK_OBJ obj)
return the initialized MkRuntimeRLS from an obj …
#define MK_ATTR_RT_INSTANCE
struct MkRuntimeCallbackS MkRuntimeCallbackS
keep callback related data …
__thread struct MkRuntimeS MkRuntimeRLS
RLS …
#define MK_RT_ATTR_FORMAT_4
MK_RT MkRuntimeSetup(MK_RT const mkrt)
initialize MkRuntimeRLS …
#define MK_INSTANCE_RT_O(o)
void MkRuntimeCallbackDel(MK_RT mkrt, MkRuntimeCallbackS *cbdata)
delete a callback from the runtime …
#define MK_RT_ATTR_FORMAT_1
#define MK_RT_ATTR_FORMAT_2
#define MK_PARSER_RT_ONLY
#define MK_ATTR_RT_STATIC
void(* MkRuntimeInitF)(MK_RT mkrt)
additional runtime initialization function …
static MK_RT MkRuntimeGet(void)
return a initialized MkRuntimeRLS …
#define MK_INSTANCE_HDL(x)
MK_PTR MkTypeSlotResolveP(MK_RT mkrt, MK_TYPN const type, size_t const offset, bool const force)
hidden function for MkTypeSlotResolve
static MK_TYP MkTyp(const MK_MNG mng)
type-check and cast a unknown-managed-object into an MkTypeS pointer or MK_NULL if not possible
static MK_TYPN MkTypN(const MK_MNGN mng)
type-check and cast a unknown-managed-object into an MkTypeS pointer or MK_NULL if not possible
static bool MkTypCheckO(MK_OBJN obj)
check MkTypeS -> MkObjectS::signature …
static bool MkTypCheck(MK_MNGN mng)
check MkTypeS -> MkObjectS::signature …
#define MkTypeLoop(_cls, _var)
void MkTypeLog_RT(MK_RT mkrt, MK_TYPN const typ, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the MkTypeS …
void MkTypeDelete_RT(MK_RT mkrt, MK_TYP const typ)
delete a type object
static MK_OBJ MkTypeInstances(MK_TYP const typ)
access the instance attribute of the type…
MK_TYP MkTypeDup2_RT(MK_RT mkrt, MK_TYPN const typ, MK_STRN const ident)
duplicate typ to create a lightweight-type …
MK_TYP MkTypeResolve_RT(MK_RT mkrt, MK_TYPN const typ)
resolve a new type
static MK_TYPN MkTypeNextN(MK_TYPN const typ)
get next instance from linked-list of MkObjectS type
MK_OBJ MkTypeAlloc_RT(MK_RT mkrt, MK_TYPN const typ)
alloc instance-memory for MkTypeS …
#define MkTypeCreate(clsV, basicV, identV)
kernel_overload_mk.h - 17 Mar 2025 - aotto1968
parser_mk.h - 11 Apr 2025 - aotto1968
array of MK_STRN values …
define the storage-allocator function
MkAllocDeleteF alloc_deleteF
"free" the memory of the object
MkAllocCreateFLT alloc_createF
"calloc" the memory of the object
MK_PTR alloc_data
data use for alloc_createF and alloc_deleteF
binary data default format …
MK_SIZE size
size of the data pointer
MK_BINN data
pointer to the binary data
the final class of MkBufferS with 1024 byte ILS-Size …
the final class of MkBufferS with 256 byte ILS-Size …
the final class of MkBufferS with 64 byte ILS-Size …
The CLASS used to store a list of MkBufferS items into a flat array…
instance storage predefined
MK_NUM offset
offset from start of MkBufferS to the start of MkBufferS::ils_data
MK_NUM size
size of the MkBufferS::ils_data
The ABSTRACT-CLASS used to store a native-type-data-item defined by PRIMITIVE TYPE …
union MkBufferU first
POINTER to native data representation (ILS or malloc)
struct MkBufferS::ilsS ils
ILS = predefined storage used for MkBufferS::storage->first.
MK_BINB ils_data[MkBufferS_ils_size]
ILS storage
struct MkBufferS::@5 storage
MK_NUM size
the size of the data-segment
bool doBufferFree
should the data be freed? -> example: pBufferRefInit
struct MkBufferS::@4 var
variable part of the instance-data
union MkBufferS::@3 super
MK_NUM cursize
currently used size (always: cursize < size)
enum MkTypeE type
type of the item stored into the data-segment
the final class of MkBufferStreamS with 1024 byte ILS-Size …
struct MkBufferStreamS bus
the final class of MkBufferStreamS with 16384 byte ILS-Size …
struct MkBufferStreamS bus
the final class of MkBufferStreamS with 256 byte ILS-Size …
struct MkBufferStreamS bus
the final class of MkBufferStreamS with 64 byte ILS-Size …
struct MkBufferStreamS bus
The ABSTRACT-CLASS MkBufferStreamS is used for package-based serialized IO …
struct MkBuffer64S busRef
union MkBufferU cur
point to current position in the package, used for write-to or read-from .
struct MkBufferStreamS::@11 storage
struct MkBufferStreamSaveS * busReadSave
MK_BINB ils_data[MkBufferStreamS_ils_size]
struct MkBufferStreamSaveS * busWriteSave
struct MkCacheS saveCache
union MkBufferStreamS::@9 super
struct MkBufferStreamS::@10 var
a linked-list to opearate a storage of data items
MK_SIG signature
check if item is valid or not
bool doFree
should the item be freed?
struct MkCacheItemS * prev
link to the prev item
struct MkCacheItemS * next
link to the next item
This is an circel storage of a linked-list connected with a "lock" at MkCacheS …
MK_NUM num
MIN num items in cache.
MkCacheCF createF
function to create 'data'
struct MkCacheItemS * free_first
free first cache item
MK_PTR createD
additional create data item
MkCacheDF deleteF
function to delete 'data'
struct MkCacheItemS * used
used cache items
struct MkCacheItemS * free_last
free last cache item
MK_RT runtime
link to the runtime
extension-slot for MkErrorS …
MkErrorFormatOfF fErrorFormatOf
plugin for sErr2Fmt …
MkErrorSetRF fErrorSetR
plugin for MkErrorSetR …
MkErrorResetF fErrorReset
plugin for MkErrorReset …
MkErrorPanikF fErrorPanik
plugin for MkPanicVL …
MkErrorSetEF fErrorSetE
plugin for MkErrorSetE …
MkErrorLogF fErrorLog
plugin for MkErrorLog …
MkErrorResetOnExitF fErrorResetOnExit
plugin for MkErrorReset …
MkErrorAppendFLT fErrorAppend
plugin for MkErrorAppendVL …
MkErrorSetVLF fErrorSetVL
plugin for MkErrorSetVL …
MkErrorInit fErrorInit
plugin for MkErrorSetVL …
signal-slot for raise an error …
signal-slot for panic on error …
signal-slot for ignore on error …
signal-slot for panic on error …
signal-slot for print on error …
The data-type to store and handle the error-condition …
MK_OBJN format_of_error
used to format the error-message and as input for source_of_error
bool noRaise
do not return MK_ERROR and do not raise an target-language-exception
MK_ERREXT mkErrExt
package specific error extension goes into this double linked list
MK_I32 num
the error number also used as exit code
enum MkErrorE code
the error code
bool append
allow to append? -> true or false
struct MkBuffer1024S text
the error message
union MkErrorS::@18 super
MK_MNGN source_of_error
source of the error, NULL = current context
Base class for the extension technologie …
union MkExtensionS::@17 super
struct MkExtensionS * next
struct MkExtensionS * prev
the double-linked-list (utlist_mk.h) needs this
data type for process/thread identification …
bool setByExtern
vales of val was set by extern source
MK_IDNT val
process or thread handle
bool ioIsPipe
startet in PIPE mode: client @ server @ ... and NOT in server --thread|spawn|fork
enum MkIdSE type
signal type of val data
Interface between libmkkernel and the Operating-System …
MkSysStrDupF SysStrDup
strdup syscall …
MkSysStrNCpyF SysStrNCpy
strdup strncpy …
MkSysWaitF MkSysWaitForProcessCB
wait for process to finish syscall with libmkkernel error plugin
MkSysWaitF MkSysWaitForThreadCB
wait for process to finish syscall with libmkkernel error plugin
MkSysCallocF SysCalloc
calloc syscall …
enum MkErrorE(* SysUSleep)(MK_OBJN const obj, unsigned int const usec)
usleep syscall with libmkkernel error plugin
MkSysReallocF SysRealloc
realloc syscall …
MkSysMallocF SysMalloc
malloc syscall …
MkSysFreeF SysFree
free syscall …
MkSysStrNDupF SysStrNDup
strndup syscall …
MkSysForkF SysFork
fork syscall …
enum MkErrorE(* SysSleep)(MK_OBJN const obj, unsigned int const sec)
sleep syscall with libmkkernel error plugin
struct to hold the mkrt-logging-data …
char logNAME[MkLogDataS_LogNAME_size]
FILE * logFILE
logging target… open MkLogDataS::logFILE (default: stderr)
bool logLOCK
indicate if log was set (true) or has the default (false)
int logREF
protect "BUFFER" against recursion
size_t logSIZE
size of logBUF
define a MkLogFileC object …
union MkLogFileS::@16 super
the protect is used to "protect" data set by pAllocCreate if the new object is later initialized with...
bool isLocal
has the object a local reference? - has been created by TLS or MkBufferCreateREF ?...
bool selfCreated
if the self was created by selfCreate than it is an INTERNAL object …
struct MkObjectProtectS obj_protect
the protect is used to "protect" data set by pAllocCreate if the new object is later initialized with...
MK_SIG signature
should be the SIGNATURE
MK_RT objRt
link to the kernel-runtime the instance was created in …
MK_PTR env
link to the object "runtime", set by selfCreate …
MK_I32 selfRefCount
Delete the MkObjectS::self at the same MkObjectS::refCount as was created …
MK_RTEXT objRtExt
link to the kernel-runtime-extension the instance was created in …
MK_TYP type
link to the object type
bool deleteCallbackCalled
Activate if object is on delete.
MK_HDL netHdl
if not-null the object was exported with MkObjectHandleGet
MK_PTR self
link between the managed object and the object in the target-programming-language
MK_I32 refCount
is THIS object in use?
MkRtExtS - extend the MkRuntimeC with a library specific feature …
keep callback related data …
struct MkRuntimeCallbackS * next
MkRuntimeInitF cb
required data
MK_STRB ident[MkRuntimeCallbackS_ident_size+1]
required data
struct MkRuntimeCallbackS * prev
The MkRuntimeS provide a per-thread environment for libmkkernel …
struct MkTypeDefS _MkErrorIgnoreC_T
struct MkTypeDefS _MkRtExtC_T
struct MkTypeDefS _MkErrorDefaultC_T
struct MkTypeDefS _MkBufferStreamC_T
struct MkTypeDefS _MkExtensionC_T
struct MkTypeDefS _MkBuffer256C_T
struct MkTypeDefS _MkErrorPanicC_T
MkThreadDataS mkThreadData
application specific thread data …
struct MkTypeDefS _MkErrExtC_T
bool MkSelfIncrOnCacheB
incr refCount on self at MkSelfNew …
MkLogDataS log
struct to hold the mkrt-logging-data …
struct MkTypeDefS _MkLogFileC_T
struct MkTypeDefS _MkRuntimeC_T
struct MkTypeS _MkTypeC_TT
struct MkTypeDefS _MkErrorC_T
struct MkErrorPanicS error_panic
panic-system-error - panic on next error …
MkSelfDecrF fSelfDecr
"decr" Self pointer if pointer stored INTERNAL (MkObjectHandleDelete)
bool isSilent
write (MK_NO) or don't write (MK_YES) any message to MkLogFileC (default: stderr) (default: MK_NO) …
MK_I32 debug
set the debug-level of the context … Valid values are 0 <= debug-level <= 9 using 0 for no-debug and ...
struct MkErrorIgnoreS error_ignore
ignore-system-error - ignore the next error …
struct MkTypeDefS _MkBufferC_T
struct MkTypeDefS _MkErrorExitC_T
struct MkTypeDefS _MkBuffer1024C_T
struct MkTypeDefS _MkBufferStream64C_T
MK_RTEXT mkRtExt
package specific runtime extension …
struct MkBuffer64S tbuf
runtime local buffer (RLS) for misc tasks …
bool noDeco
do not use decoration to generate log messages (default: use decoration) …
struct MkTypeDefS _MkBufferListC_T
struct MkTypeDefS _MkBuffer64C_T
MkSelfIncrF fSelfIncr
"incr" Self pointer if pointer stored INTERNAL (MkObjectHandleGet)
struct MkTypeDefS _MkBufferStream1024C_T
struct MkErrorS error_mk
default-system-error - default-error …
struct MkErrorPrintS error_print
ignore-system-error - print the next error into MkLogFileC …
struct MkTypeDefS _MkErrorPrintC_T
struct MkTypeDefS _MkBufferStream16384C_T
struct MkTypeS _MkTypeDefC_TT
MK_BINB private_variables[12986]
struct MkTypeDefS _MkObjectC_T
struct MkErrorPanicS error_exit
panic-system-error - panic on next error …
struct MkTypeDefS _MkBufferStream256C_T
union MkRuntimeS::@26 super
is the MkRuntimeS initialized? …
MK_RTEXT mkRtExtAry[MkExtension_size]
package specific runtime extension - fast access by …
string data default format …
MK_STRN ptr
pointer to the string data
MK_NUM len
len of the string data
super-class-base, the MkTypeS using the super-macro-syntax for all non specific types …
MkTypeS - class known as typ or type is used as class-base for a Managed-Object-Technology (MOT) type...
MkSelfUnlinkF selfUnlink
"unlink" the "self" pointer from META-Kernel
MkSelfDeleteF selfDelete
"delete" the "self" pointer
bool noSelf
do NOT use the self feature -> used by MqFactoryS
MkLogF log
"log" object data to MkLogFileC (default: stderr)
MkLogFormatF fLogFormat
format the log message of an object, used in "sLogVL_O"
MkToStringF toString
get the string representation
MkSelfCreateF selfCreate
"create" the "self" pointer
size_t typsize
the size of the this type self, used in MkTypeDup2
MK_TYP type_class
point to the instancesR linked list of the class-type
MkConstructorF constructor
create an object
MkTypeInitF type_init
initializer for new type
MkDup2F dup2
"dup" constructor with "ident" initialisation
size_t objsize
the size of the new object created with this type, used in malloc
MkResetF reset
"reset" the object to the "initial" state
MkDupF dup
"dup" constructor
MkDestructorF destructor
delete an object
MK_I32 delCbCnt
number of callback registered for this type
MK_SIG objsig
type-instance: signature as unsinged integer (32bit)
MK_SIG objmask
type-instance: mask to filter out the valid part of the signatur
MkMergeF merge
"merge" constructor
MK_TYP type_base
base type
MK_I32 type_id
default "0" but "MkFactoryTypeAdd" need more
union used to set or modify native data from an MkBufferS object …
MK_BOL BOL
1 byte boolean data
MK_I64 I64
8 byte integer data
MK_DBL DBL
8 byte double data
MK_I16 I16
2 byte short data
MK_FLT FLT
4 byte float data
MK_I32 I32
4 byte integer data
a union for all data items supported by MkBufferS …
MK_STRN C
const C string like data (e.g. with a \0 at the end)
MK_ATO * A
atom for native data-types
MK_LST L
list object type data
MK_STR S
C string like data (e.g. with a \0 at the end)
MK_BIN B
arbitrary byte-array data