14000 { \
14001 MkLogV_2(fmtobj,MK_COLOR_ORANGE "Warning: ignore call to '%s' with '%d'" MK_COLOR_RESET "\n", __func__, debug); \
14002 printSTACK_1(fmtobj); \
14003 return; \
14004 }
14005 # define MkDProtect2(_debug,_call) if (MK_RT_REF.debug < _debug) { \
14006 MkLogV_2(fmtobj,MK_COLOR_ORANGE "Warning: ignore call to '%s' from '%s' with '%d'" \
14007 MK_COLOR_RESET "\n", __func__, _call, debug); \
14008 printSTACK_1(fmtobj); \
14009 return; \
14010 }
14011#endif
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022#define META_USE_SELF_REFCOUNT
14023
14024
14025
14026
14027
14028
14029
14030
14034
14035
14036#ifndef __has_parser__
14037
14043
14045# define __parser__(...)
14047# define __parser__define__(...)
14049
14051# define __parser__push__(...)
14053# define __parser__pop__
14054
14056
14057
14063
14065# define __parser__global__(...)
14067# define __parser__global__define__(...)
14071# define __parser__global__push__(...)
14073# define __parser__global__pop__
14074
14076
14077
14078#else
14080#endif
14081
14082
14083
14085
14086
14087
14088
14089
14090
14091
14092
14096
14097
14100
14102
14103
14106#define MK_PARSER_fmtobj MK_OBJN fmtobj __parser__(default=NULL)
14107
14108
14110
14112
14113
14116#if defined(_MSC_VER)
14117
14118
14119
14120 # define __attribute__(dummy)
14121 # define __func__ __FUNCTION__
14122 # define MK_CLRCALL __clrcall
14123 # define MK_STDCALL __stdcall
14124 # define MK_CDECL __cdecl
14125
14126
14127 # ifndef PARSE_C_HEADER_TO_META
14128 # define mk_inline static inline
14129 # endif
14130
14131 # define mk_unlink _unlink
14132 # define mk_snprintf _snprintf
14133
14134 # define MK_ATTR_HOT ???
14135 # define MK_ATTR_COLD ???
14136
14137#else
14138
14139
14140
14141 # define MK_CLRCALL
14142 # define MK_STDCALL
14143 # define MK_CDECL
14144
14145
14146 # ifndef PARSE_C_HEADER_TO_META
14147 # define mk_inline static inline
14148 # endif
14149 # define mk_unlink unlink
14150 # define mk_snprintf snprintf
14151
14152 # define MK_ATTR_HOT __attribute__((hot))
14153 # define MK_ATTR_COLD __attribute__((cold))
14154
14155#endif
14156
14157#if defined(_MANAGED)
14158 # define MK_DECL MK_CLRCALL
14159#elif defined(META_COMPILE_AS_CC)
14160 # define MK_DECL MK_STDCALL
14161#else
14162 # define MK_DECL MK_CDECL
14163#endif
14164
14165
14166
14167
14168
14169#undef BEGIN_MK_C_DECLS
14170#undef END_MK_C_DECLS
14171#if defined(META_COMPILE_AS_CC)
14172# define BEGIN_MK_C_DECLS namespace libmkkernel {
14173# define END_MK_C_DECLS }
14174#elif defined(__cplusplus)
14175# define BEGIN_MK_C_DECLS extern "C" {
14176# define END_MK_C_DECLS }
14177#else
14178# define BEGIN_MK_C_DECLS
14179# define END_MK_C_DECLS
14180#endif
14181
14182
14183
14184
14185
14186
14187#if defined(_MSC_VER) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
14188 #define likely(x) !!(x)
14189 #define unlikely(x) !!(x)
14190 #else
14191 #define likely(x) __builtin_expect((x),1)
14192 #define unlikely(x) __builtin_expect((x),0)
14193#endif
14194
14195#ifndef PARSE_C_HEADER_TO_META
14196 # ifndef _MSC_VER
14197 # include <inttypes.h>
14198 # endif
14199 # ifdef __CYGWIN__
14200 # include <windef.h>
14201 # endif
14202 # include <stdarg.h>
14203 # include <string.h>
14204 # include <stdio.h>
14205 # include <time.h>
14206 # ifndef _MSC_VER
14207 # include <unistd.h>
14208 # include <stdbool.h>
14209 # endif
14210#endif
14211
14212#if defined(_WIN32) && !defined(__CYGWIN__)
14213 # ifndef PARSE_C_HEADER_TO_META
14214 # include <winsock2.h>
14215 # endif
14216
14218 # define mk_timeval timeval
14219
14222 int tz_minuteswest;
14223 int tz_dsttime;
14224 };
14225
14226#else
14227 # define mk_timeval timeval
14228 # define mk_timezone timezone
14231#endif
14232
14234#define MK_UNUSED __attribute__((unused))
14236#define MK_NO_RETURN __attribute__((noreturn))
14237#define MK_UNREACHABLE __builtin_unreachable()
14238
14239#define MK_ARTIFICIAL __attribute__((__artificial__))
14240
14241#define MK_DEPRECATED __attribute__ ((deprecated))
14242
14243#define MK_OPTIMIZE_0 __attribute__((optimize("O0")))
14244
14245#ifndef PARSE_C_HEADER_TO_META
14246 # include <assert.h>
14247#endif
14248
14250
14251
14253
14254
14255
14257
14258
14261
14264
14270
14304#define MK_NULL NULL
14305
14307#define MK_NULL_YES true
14308
14310#define MK_NULL_NO false
14311
14316#define MK_NULL_STR "MK_NULL"
14317
14322#define MK_NULL_STR_LEN strlen(MK_NULL_STR)
14323
14334}
14335
14339 return ((__str) ? strcmp((__str),
MK_NULL_STR)==0 :
true);
14340}
14341
14345 return ((__str) ? (__str)[0] ==
'\0' || strcmp((__str),
MK_NULL_STR)==0 :
true);
14346}
14347
14349
14350
14352
14353
14354
14498#if META_HAS_THREAD
14501 # define MkThreadLocal __thread
14502 # define MK_RT_SHIFT 1
14503 # define MK_RT_ARGS_ONLY MK_RT mkrt
14504 # define MK_RT_ARGS MK_RT_ARGS_ONLY,
14505 # define MK_RT_CALL_ONLY mkrt
14506 # define MK_RT_CALL MK_RT_CALL_ONLY,
14507 # define MK_RT_CALL_O(o) MkRT_O(o),
14508 # define MK_RT_CALL_X(x) MkRT_X(x),
14509 # define MK_RT_CALL_NULL_ONLY MkRT
14510 # define MK_RT_CALL_NULL MK_RT_CALL_NULL_ONLY,
14511 # define MK_RT_NULL NULL,
14512 # define MK_RT_PTR mkrt
14513 # define MK_RT_REF (*mkrt)
14514 # define MK_RT_REF_NULL (MkRuntimeRLS)
14515 # define MK_RT_UNUSED MK_UNUSED
14516 # define MK_RT_CALL_RT(ptr) ptr,
14517 # define MK_PARSER_RT_ONLY MK_RT_ARGS_ONLY __parser__(internal,default=N#RUNTIME)
14518 # define MK_PARSER_RT MK_PARSER_RT_ONLY,
14520#else
14523 # define MkThreadLocal
14524 # define MK_RT_SHIFT 0
14525 # define MK_RT_ARGS_ONLY void
14526 # define MK_RT_ARGS
14527 # define MK_RT_CALL_ONLY
14528 # define MK_RT_CALL
14529 # define MK_RT_CALL_O(o)
14530 # define MK_RT_CALL_X(x)
14531 # define MK_RT_CALL_NULL_ONLY
14532 # define MK_RT_CALL_NULL
14533 # define MK_RT_NULL
14534 # define MK_RT_PTR (&MkRuntimeRLS)
14535 # define MK_RT_REF (MkRuntimeRLS)
14536 # define MK_RT_REF_NULL (MkRuntimeRLS)
14537 # define MK_RT_UNUSED
14538 # define MK_RT_CALL_RT(ptr)
14539 # define MK_PARSER_RT_ONLY void
14540 # define MK_PARSER_RT
14542#endif
14543
14544# define MK_RT_ATTR_FORMAT_1 __attribute__((format (printf, 1+MK_RT_SHIFT, 2+MK_RT_SHIFT)));
14545# define MK_RT_ATTR_FORMAT_2 __attribute__((format (printf, 2+MK_RT_SHIFT, 3+MK_RT_SHIFT)))
14546# define MK_RT_ATTR_FORMAT_4 __attribute__((format (printf, 4+MK_RT_SHIFT, 5+MK_RT_SHIFT)))
14547
14548
14549
14550# define __MK_ATTR_RT_RUNTIME
14551
14552#if META_HDL_USE__NONNULL__GCC_ATTRIBUTE == 1
14553
14554 # define __MK_ATTR_RT_INSTANCE __attribute__((nonnull(1+MK_RT_SHIFT)))
14555 # define __MK_ATTR_INSTANCE __attribute__((nonnull(1)))
14556 # define MK_INSTANCE_HDL(x)
14557#else
14558 # define __MK_ATTR_RT_INSTANCE
14559 # define __MK_ATTR_INSTANCE
14560 # define MK_INSTANCE_HDL(x) assert(x!=NULL)
14561#endif
14562
14563
14564#define MK_ATTR_INSTANCE __MK_ATTR_INSTANCE
14565#define MK_ATTR_RT_INSTANCE __MK_ATTR_RT_RUNTIME __MK_ATTR_RT_INSTANCE
14566#define MK_ATTR_STATIC __parser__(static)
14567#define MK_ATTR_RT_STATIC __MK_ATTR_RT_RUNTIME __parser__(static)
14568
14569
14570#define MK_INSTANCE_RT_X(x) MK_INSTANCE_HDL(x); MkRtSetup_XN_RT(x); META_DEBUG_ERROR_checkX(x)
14571#define MK_INSTANCE_RT_X_NULL(x) MkRtSetup_X_RT(x); META_DEBUG_ERROR_checkX(x)
14572#define MK_INSTANCE_RT_O(o) MK_INSTANCE_HDL(o); MkRtSetup_ON_RT(o); META_DEBUG_ERROR_checkO(o)
14573#define MK_INSTANCE_RT_O_NULL(o) MkRtSetup_O_RT(o); META_DEBUG_ERROR_checkO(o)
14574#define MK_DESTRUCTOR_RT_X(c,x) MK_INSTANCE_HDL(x); \
14575 if (!MkCheckNN(c,x)) return; \
14576 MkRtSetup_XN_RT(x); META_DEBUG_ERROR_check()
14577#define MK_STATIC_RT MkRtSetup_NULL_RT; META_DEBUG_ERROR_check()
14578
14579
14580
14581
14583
14584
14585
14586#ifndef PARSE_C_HEADER_TO_META
14588#endif
14589
14656
14657
14658
14659
14660
14661
14664
14665
14666#if defined(_MSC_VER) && defined(_DLL)
14667 # undef PIC
14668 # define PIC
14669 # undef DLL_EXPORT
14670 # define DLL_EXPORT
14671#endif
14672
14673#ifdef META_IS_WINDOWS
14674 # define META_DIR_SEPARATOR '\\'
14675 # define META_EOL "\r\n"
14676#else
14677 # define META_DIR_SEPARATOR '/'
14678 # define META_EOL "\n"
14679#endif
14680
14681
14682
14683
14684
14685
14686
14687#undef MK_EXTERN
14688#if defined(META_IGNORE_EXTERN)
14689# define MK_EXTERN
14690#elif defined(PIC)
14691
14692# if defined(DLL_EXPORT)
14693
14694# if defined(MK_C_BUILD_DLL)
14695# define MK_EXTERN __declspec(dllexport)
14696# else
14697# define MK_EXTERN __declspec(dllimport)
14698# endif
14699# else
14700
14701# define MK_EXTERN __attribute__ ((visibility("default")))
14702# endif
14703#else
14705# define MK_EXTERN
14706#endif
14707
14708
14709#undef MK_EXTERN_DATA
14710#if defined(META_PRIVATE)
14711# define MK_EXTERN_DATA extern
14712#elif defined(META_IGNORE_EXTERN)
14713# define MK_EXTERN_DATA extern
14714#elif defined(PIC)
14715
14716# if defined(DLL_EXPORT)
14717
14718# if defined(MK_C_BUILD_DLL)
14719# define MK_EXTERN_DATA __declspec(dllexport)
14720# else
14721# define MK_EXTERN_DATA __declspec(dllimport)
14722# endif
14723# else
14724
14725# define MK_EXTERN_DATA __attribute__ ((visibility("default"))) extern
14726# endif
14727#else
14728# define MK_EXTERN_DATA extern
14729#endif
14730
14731
14732
14734#define MK_CPPXSTR(s) MK_CPPSTR(s)
14736#define MK_CPPSTR(s) #s
14738#define MK_CONCAT(a,b) a ## b
14739#define MK_CONCAT2(a,b) MK_CONCAT(a,b)
14740#define MK_CONCAT3(a,b,c) a ## b ## c
14741
14743#ifdef HAVE_STPCPY
14744 #define mk_append_fix_str(t,s) t=stpcpy(t,s)
14745#else
14746 #define mk_append_fix_str(t,s) t=strcpy(t,s)+sizeof(s)-1
14747#endif
14748
14750#define mk_bit_compare(t,f) (t&f)==f
14751
14753
14754
14755
14756
14757
14758
14759
14760
14764
14765struct MkErrorS;
14766struct MkBufferListS;
14767struct MkBufferS;
14768union MkBufferU;
14769struct MkObjectS;
14770struct MkAllocS;
14771struct MkTypeS;
14772struct MkTypeDefS;
14773
14775#define MK_ALFA '@'
14777#define MK_ALFA_STR ((MkStringR){1,"@"})
14778
14779
14780
14783
14785__parser__(type=ME_NB1_MK_BOL:
"1 byte 'boolean' data-type")
14786typedef unsigned char MK_BOL;
14787
14788
14790__parser__(type=ME_NB0_MK_BOOL:
"'boolean' data-type":primary)
14792#define bool2str(_bool) (_bool?"true":"false")
14793
14795
14796
14797
14800
14802__parser__(type=ME_NI1_MK_I8:
"1 byte 'byte' data-type")
14803typedef signed char MK_I8;
14805__parser__(type=ME_NI2_MK_I16:
"2 byte 'short integer' data-type":primary:int16_t)
14806typedef signed short int MK_I16;
14808__parser__(type=ME_NI4_MK_I32:
"4 byte 'integer' data-type":primary:int32_t)
14809typedef signed int MK_I32;
14811#if defined(_MSC_VER)
14814#else
14815 __parser__(type=ME_NI8_MK_I64:
"8 byte 'wide integer' data-type":primary:int64_t)
14816 typedef signed long long MK_I64;
14817#endif
14819__parser__(type=ME_NIL_MK_LONG:
"4/8 byte 'long' data-type":primary)
14820
14822
14824
14825
14826
14829
14830__parser__(type=ME_NU1_MK_U8:
"1 byte 'unsigned byte' data-type":primary:uint8_t)
14831typedef unsigned char MK_U8;
14832__parser__(type=ME_NU2_MK_U16:
"2 byte 'unsigned short' data-type":primary:uint16_t)
14833typedef unsigned short MK_U16;
14834__parser__(type=ME_NU4_MK_U32:
"4 byte 'unsigned integer' data-type":primary:uint32_t)
14835typedef unsigned int MK_U32;
14836__parser__(type=ME_NU8_MK_U64:
"8 byte 'unsigned wide' data-type":primary:uint64_t)
14837typedef unsigned long long MK_U64;
14838
14839
14840__parser__(type=ME_NUL_MK_ULN:
"8 byte 'unsigned long' data-type":primary)
14841typedef unsigned long MK_ULN;
14843
14844
14845
14848
14850__parser__(type=ME_NF4_MK_FLT:
"4 byte 'float' data-type":primary)
14853__parser__(type=ME_NF8_MK_DBL:
"8 byte 'double' data-type":primary)
14855
14857
14858
14859
14863
14874__parser__(type=ME_NIH_MK_HDL:
"handle data-type")
14875
14877#define MK_HDL_REF_S3(__prefix) __prefix ## NI4
14878#define MK_HDL_REF_S1(__prefix) __prefix ## I32
14879#define MK_HDLT MK_I32T
14880
14881
14882
14883
14884
14885
14887
14888
14889
14892
14893__parser__(type=ME_NIL_MK_SIZE:
"long byte 'size' datay-type")
14894
14897__parser__(type=ME_RUA_MkBufferAtomU:
"atomic native data buffer type")
14898typedef union MkBufferAtomU
MK_ATO;
14904#define MK_FORMAT_N "%i"
14905
14907__parser__(type=ME_NI4_MK_DBG:
"debug-level data-type")
14909
14969typedef unsigned int MK_SIG;
14970
14972
14973
14974
14978__parser__(type=ME_NIL_MK_TIME_T:
"time [sec] data-type")
14980#define MK_FORMAT_TIME "%li"
14981#define MK_TIME ((MK_TIME_T)time(NULL))
14982#define MK_TIME_MAX (365*24*60*60)
14984
14985
14986
14989
14990
14991
14993__parser__(type=ME_PVB_MK_PTRB:
"pointer type data-type")
14995
14997__parser__(type=ME_PVX_MK_PTR:
"generic pointer data-type":primary)
15000__parser__(type=ME_PVN_MK_PTRN:
"const generic pointer data-type":primary)
15003__parser__(type=ME_PCX_MK_CCP:
"class constructor/destructor data type")
15006__parser__(type=ME_PAX_MK_CBP:
"generic pointer to call-back data")
15009__parser__(type=ME_CXC_MK_MNG:
"managed object pointer; datatype will be checked at runtime")
15012__parser__(type=ME_CXN_MK_MNGN:
"const - a managed object pointer; datatype will be checked at runtime")
15015__parser__(type=ME_PEX_MK_EXP:
"target language exception-class-object")
15018__parser__(type=ME_CXC_MkExceptionC:
"target language library-exception-class-object")
15020
15022
15023
15024
15027
15029__parser__(type=ME_PLB_MK_LSTB:
"list type data-type")
15030typedef unsigned char MK_LSTB;
15031
15033__parser__(type=ME_PLX_MK_LST:
"list pointer data-type")
15035
15037
15038
15039
15042
15044__parser__(type=ME_PBB_MK_BINB:
"byte-array type data-type")
15045typedef unsigned char MK_BINB;
15046
15048__parser__(type=ME_PBX_MK_BIN:
"byte-array pointer data-type":primary)
15050
15052__parser__(type=ME_PBN_MK_BINN:
"const byte-array pointer data-type":primary)
15054
15056
15057
15058
15061
15063__parser__(type=ME_PSB_MK_STRB:
"string type data-type")
15065
15067__parser__(type=ME_PSX_MK_STR:
"string pointer data-type":primary)
15069
15071__parser__(type=ME_PSN_MK_STRN:
"constant string pointer data-type":primary)
15073
15075__parser__(type=ME_ASN_MK_STRN_A:
"ARRAY of MK_STRN")
15076typedef struct {
15079} MK_STRN_A;
15080
15083
15085__parser__(type=ME_PFX_MK_FST:
"constant 'printf' format string")
15087
15089
15090
15091
15094__parser__(type=ME_PVX_MK_NAT_OBJECT:
"target language object pointer")
15096__parser__(type=ME_PVX_MK_NAT_LIST:
"target language list pointer")
15099
15100
15101
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15116 __parser__(type=ME_CCC_MkObjectC:
"MkObjectC class handle":primary)
15117 typedef struct MkObjectS *
MK_OBJ;
15119 __parser__(type=ME_CCN_MkObjectC:
"const - MkObjectC class handle":primary)
15120 typedef const struct MkObjectS *
MK_OBJN;
15123 typedef struct MkObjectS
MK_OBJR;
15125
15126
15130 __parser__(type=ME_CCC_MkBufferC:
"MkBufferC class handle":primary)
15131 typedef struct MkBufferS *
MK_BUF;
15133 __parser__(type=ME_CCN_MkBufferC:
"const - MkBufferC class handle":primary)
15134 typedef const struct MkBufferS *
MK_BUFN;
15137 typedef struct MkBufferS
MK_BUFR;
15139
15140
15144 __parser__(type=ME_CCC_MkBufferStreamC:
"MkBufferStreamC class handle":primary)
15145 typedef struct MkBufferStreamS *
MK_BUS;
15147 __parser__(type=ME_CCN_MkBufferStreamC:
"const - MkBufferStreamC class handle":primary)
15148 typedef const struct MkBufferStreamS *
MK_BUSN;
15151 typedef struct MkBufferStreamS
MK_BUSR;
15153
15154
15158 __parser__(type=ME_CCC_MkBufferListC:
"MkBufferListC class handle":primary)
15159 typedef struct MkBufferListS *
MK_BFL;
15161 __parser__(type=ME_CCN_MkBufferListC:
"const - MkBufferListC class handle":primary)
15162 typedef const struct MkBufferListS *
MK_BFLN;
15165 typedef struct MkBufferListS
MK_BFLR;
15167
15168
15172 __parser__(type=ME_CCC_MkLogFileC:
"MkLogFileC class handle":primary)
15173 typedef struct MkLogFileS *
MK_LFL;
15175 __parser__(type=ME_CCN_MkLogFileC:
"const - MkLogFileC class handle":primary)
15176 typedef const struct MkLogFileS *
MK_LFLN;
15179 typedef struct MkLogFileS
MK_LFLR;
15181
15182
15186 __parser__(type=ME_CCC_MkErrorC:
"MqErrorC class handle":primary)
15187 typedef struct MkErrorS *
MK_ERR;
15189 __parser__(type=ME_CCN_MkErrorC:
"const - MqErrorC class handle":primary)
15190 typedef const struct MkErrorS *
MK_ERRN;
15193 typedef struct MkErrorS
MK_ERRR;
15195
15196
15200 __parser__(internal,type=ME_CCC_MkExtensionC:
"abstract class for the extension technology":internal)
15203 __parser__(internal,type=ME_CCN_MkExtensionC:
"const - abstract class for the extension technology":internal)
15209
15210
15214 __parser__(internal,type=ME_CCC_MkErrExtC:
"final class for the MkErrorS extention technology":internal)
15217 __parser__(internal,type=ME_CCN_MkErrExtC:
"const - final class for the MkErrorS extention technology":internal)
15218 typedef const struct MkErrExtS *
MK_ERREXTN;
15223
15224
15228 __parser__(internal,type=ME_CCC_MkRtExtC:
"final class for the MkRuntimeS extention technology":internal)
15229 typedef struct MkRtExtS *
MK_RTEXT;
15231 __parser__(internal,type=ME_CCN_MkRtExtC:
"const - final class for the MkRuntimeS extention technology":internal)
15232 typedef const struct MkRtExtS *
MK_RTEXTN;
15237
15238
15242 __parser__(type=ME_CCC_MkRuntimeC:
"runtime singleton class object":primary)
15243 typedef struct MkRuntimeS *
MK_RT;
15245 __parser__(type=ME_CCN_MkRuntimeC:
"const - runtime singleton class object":primary)
15246 typedef const struct MkRuntimeS *
MK_RTN;
15249 typedef struct MkRuntimeS
MK_RTR;
15251
15252
15256 __parser__(internal,type=ME_CCC_MkTypeC:
"a managed object class type !base! pointer":internal)
15257 typedef struct MkTypeS *
MK_TYP;
15259 __parser__(internal,type=ME_CCN_MkTypeC:
"const - a managed object class type !base! pointer":internal)
15260 typedef const struct MkTypeS *
MK_TYPN;
15263 typedef struct MkTypeS
MK_TYPR;
15265
15266
15267
15268
15271__parser__(type=ME_CXC_MK_BAC:
"a list of 'buffer' as last argument in function")
15272typedef struct MkBufferListS *
MK_BAC;
15273
15276__parser__(type=ME_CXN_MK_BAC:
"const - a list of 'buffer' as last argument in function")
15277typedef const struct MkBufferListS *
MK_BACN;
15278
15279
15280
15281
15287
15289
15294typedef struct {
15297} MkBinaryR;
15298
15302 return (MkBinaryR) {size, data};
15303}
15304
15308 return bin.data == NULL;
15309}
15310
15314 if (start>bin.size)
15315 return (const MkBinaryR) {0, NULL};
15316 else
15317 return (const MkBinaryR) {start+wide>bin.size?bin.size-start:wide, bin.data+start};
15318}
15319
15323
15327
15331 return bin.data;
15332}
15333
15337 return bin.size;
15338}
15339
15341
15343
15344
15350
15352
15356
15358typedef struct {
15361} MkStringR;
15362
15363
15367
15371 return (MkStringR) {(len>0?len:(str?(
MK_NUM)strlen(str):0)), str};
15372}
15373
15377 return (MkStringR) {str?(
MK_NUM)strlen(str):0, str};
15378}
15379
15390 if (len < 0) len = strR.
len;
15391 if (start > strR.len) {
15393 } else if ((start+len) > strR.len) {
15395 } else {
15397 }
15398}
15399
15403 assert(len_out != NULL);
15404 assert(str_out != NULL);
15405 *len_out = strR.len; *str_out = strR.ptr;
15406}
15407
15411
15415 return str.ptr;
15416}
15417
15421 return str.len;
15422}
15423
15433}
15434
15436
15438
15439
15440
15441
15442
15443
15444
15445
15448
15450
15453
15460
15465};
15466
15467
15468
15469
15472__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc,
return-type-
default-no)
15474
15477__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc,
return-type-
default-no)
15480 return (MK_I32) value;
15481}
15482
15485__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc)
15487
15488
15489
15490
15492
15494
15495
15498
15505
15522 MK_TIMEOUT_DEFAULT = -1,
15524 MK_TIMEOUT_USER = -2,
15526 MK_TIMEOUT_MAX = -3,
15527};
15528
15529
15530
15531
15534__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc,
return-type-
default-no)
15536
15539__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc,
return-type-
default-no)
15542 return (MK_I32) value;
15543}
15544
15547__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc)
15549
15550
15551
15553
15556
15562};
15563
15564
15565
15568__parser__(internal,no-rpc,prefix=EnumFunc,
return-type-
default-no)
15570
15573__parser__(internal,no-rpc,prefix=EnumFunc,
return-type-
default-no)
15576 return (MK_I32) value;
15577}
15578
15583
15584
15585
15587
15590
15595
15602};
15603
15604
15605
15606
15609__parser__(internal,no-rpc,prefix=EnumFunc,
return-type-
default-no)
15611
15614__parser__(internal,no-rpc,prefix=EnumFunc,
return-type-
default-no)
15617 return (MK_I32) value;
15618}
15619
15624
15625
15626
15628
15629
15632
15634#define MK_TYPE_IS_1_I8E (1<<0)
15635
15637#define MK_TYPE_IS_2_I8E (1<<1)
15638
15640#define MK_TYPE_IS_4_I8E (1<<2)
15641
15643#define MK_TYPE_IS_8_I8E (1<<3)
15644
15646#define MK_TYPE_IS_NATIVE ( MK_TYPE_IS_1_I8E | MK_TYPE_IS_2_I8E | \
15647 MK_TYPE_IS_4_I8E | MK_TYPE_IS_8_I8E )
15648
15650#define MK_TYPE_SHIFT 4
15651
15659
15671};
15672
15673
15674
15675
15678__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc,
return-type-
default-no)
15680
15683__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc,
return-type-
default-no)
15686 return (MK_I32) value;
15687}
15688
15691__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc)
15693
15694
15695
15697
15698
15700
15702
15703
15761
15764union MkBufferAtomU {
15777
15778#if defined(__cplusplus)
15779 MkBufferAtomU() : I64(0L) {};
15780 MkBufferAtomU(MK_I8 val) : I8(val) {};
15781 MkBufferAtomU(MK_BOL val) : BOL(val) {};
15782 MkBufferAtomU(MK_I16 val) : I16(val) {};
15783 MkBufferAtomU(MK_I32 val) : I32(val) {};
15784 MkBufferAtomU(MK_I64 val) : I64(val) {};
15785 MkBufferAtomU(MK_FLT val) : FLT(val) {};
15786 MkBufferAtomU(MK_DBL val) : DBL(val) {};
15787#endif
15788};
15789
15799union MkBufferU {
15805};
15806
15809#define MkType_O MK_BOL
15810#define MkType_Y MK_I8
15811#define MkType_S MK_I16
15812#define MkType_I MK_I32
15813#define MkType_W MK_I64
15814#define MkType_F MK_FLT
15815#define MkType_D MK_DBL
15816#define MkType_C MK_STRN
15817#define MkType_B MK_BIN
15818#define MkType_U MK_BUF
15819#define MkType_L MK_BFL
15821
15823
15824
15844
15845
15846
15847
15850
15853
15854
15861};
15862
15863
15864
15867__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc,
return-type-
default-no)
15869
15872__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc,
return-type-
default-no)
15875 return (MK_I32) value;
15876}
15877
15880__parser__(doc-group=Enum,doc-index=_ignore_,
class=MkKernel,no-rpc,prefix=EnumFunc)
15882
15883
15884
15885
15893struct MkIdS {
15896 bool ioIsPipe;
15897 bool setByExtern;
15898};
15899
15901
15902
15903
15904
15905
15906
15907
15911
15916
15919struct MkCacheItemS {
15920 #define MkCacheItemS_signature 0x44196912
15922 bool doFree;
15923 struct MkCacheItemS * prev;
15924 struct MkCacheItemS * next;
15926};
15927
15936struct MkCacheS {
15938#define MkCacheS_name_size 32
15940 struct MkCacheItemS * used;
15941 struct MkCacheItemS * free_first;
15942 struct MkCacheItemS * free_last;
15947
15948#define MkCacheS_MkCacheItemS_size 8
15951};
15952
15954
15955
15960
15961
15962
15963
15964
15965
15966
16037
16050#ifndef META_COMPILE_AS_CC
16051__attribute__ ((constructor(200)))
16052#endif
16055
16058
16070#ifndef META_COMPILE_AS_CC
16071__attribute__ ((destructor(200)))
16072#endif
16075
16079
16082
16085
16087
16089
16090
16091
16092
16093
16094
16095
16096
16098
16100
16113
16115
16119typedef MK_PTR (*MkSysCallocF) (size_t, size_t) __attribute__ ((alloc_size (1, 2)));
16120
16124typedef MK_PTR (*MkSysMallocF) (size_t) __attribute__ ((alloc_size (1)));
16125
16129typedef MK_STR (*MkSysStrDupF) (MK_STRN);
16130
16134typedef MK_STR (*MkSysStrNCpyF) (char*,const char*,size_t);
16135
16139typedef MK_STR (*MkSysStrNDupF) (MK_STRN, size_t) __attribute__ ((alloc_size (2)));
16140
16144typedef MK_PTR (*MkSysReallocF) (MK_PTR, size_t);
16145
16149typedef void (*MkSysFreeF) (MK_PTR);
16150
16155typedef pid_t (*MkSysForkF) (void);
16156
16160typedef enum MkErrorE (*MkSysWaitF) (
16161 MK_OBJN const fmtobj,
16162 MK_IDNT const id
16163);
16164
16175typedef int (*MkSysExitF) (
16177 int isThread,
16178 int num
16179);
16180
16181
16185typedef void (*MkSysAbortF) (
16186 MK_RT_ARGS
16187 int isThread,
16188 int num
16189) MK_NO_RETURN;
16190*/
16191
16194struct MkLalS {
16216
16227 unsigned int const usec
16228 );
16239 unsigned int const sec
16240 );
16257 );
16260
16270 void (*SysAbort) (
16271 void
16273
16274 enum MkErrorE (*SysIgnorSIGCHLD) (
16277 );
16278
16279 enum MkErrorE (*SysAllowSIGCHLD) (
16282 );
16283};
16284
16288
16295__attribute__ ((alloc_size (2, 3)))
16299 size_t const nmemb,
16300 size_t const size
16301);
16302
16308__attribute__ ((alloc_size (2)))
16312 size_t const size
16313);
16314
16322 MK_STRN const str
16323);
16324
16334 MK_STRN const str,
16335 MK_SIZE const len
16336);
16337
16347 MK_STR const to,
16348 MK_STRN const from,
16349 MK_SIZE const len
16350);
16351
16352
16359__attribute__ ((alloc_size (3)))
16363 MK_PTR const buf,
16364 size_t const size
16365);
16366
16379 MK_PTR const buf,
16380 MK_NUM const oldnum,
16381 MK_NUM const addnum,
16382 size_t const size
16383);
16384
16394 MK_PTRN const blck,
16395 size_t const size
16396);
16397
16406 MK_STRN_A const strA
16407);
16408
16414#define MkSysFree(pointer) \
16415 do { \
16416 if ( likely((pointer) != (NULL)) ) { \
16417 (*MkLal.SysFree)((MK_PTR)pointer); \
16418 (pointer) = (NULL); \
16419 } \
16420 } while (0)
16421
16423#define MkSysFreeNonNull(pointer) (*MkLal.SysFree)((MK_PTR)pointer)
16424
16430 MK_PTR data
16431);
16432
16457 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
16462
16474 MK_STRN const callfunc
__parser__(default=F
#FUNC),
16477
16483 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
16488
16494mk_inline enum MkErrorE MkSysWaitForProcess (
16496 MK_IDNT const id
16497) {
16499};
16500
16508 MK_IDNT const id
16509) {
16511};
16512
16520 useconds_t const usec
16521) {
16523};
16524
16531 MK_I32 const sec
16532) {
16534};
16535
16552 int isThread,
16553 int num
16554) {
16557 } else {
16558 return num;
16559 }
16561
16576
16579 MK_STRN const pathName,
16580 bool const includeExtension
16582
16583
16598 MK_STRN const pathName
16600
16614 MK_STRN const format,
16615 ...
16617
16629);
16630
16633#define MkSysStringSetNULL_R(_str) _str[0] = '\0'
16634
16637#define MkSysStringSet_R(_str,_val) strcpy(_str,_val)
16638
16641#define MkSysStringIsNULL_R(_str) (_str[0] == '\0')
16642
16646};
16647
16650 return (str != NULL && *str != '\0');
16651};
16652
16655#define MkSysStringIsEQUAL(_str,_other) (strcmp(_str,_other) == 0)
16656
16659#define MkSysStringIsLenEQUAL(_str,_other,_len) (strncmp(_str,_other,(size_t)_len) == 0)
16660
16664};
16665
16668 return str == NULL ? "" : str;
16669};
16670
16672
16714 MK_STRN key,
16717
16721 MK_STRN key,
16724
16734 MK_I32 pid,
16735 MK_I32 signal
16737
16746 MK_I32 * pid_out
16748
16750typedef enum MkSysPipeHandlerE {
16754
16759 MkSysPipeHandlerE keepPipe
16761
16763
16764
16847
16848
16849
16850
16851
16852
16889
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904#define __MkCheckTO(t,o) (((*o).signature & (*t).objmask) == (*t).objsig)
16905#define _MkCheckTO(t,o) ((o) && __MkCheckTO((t),(o)))
16906#define __MkCheckO(cls,o) (((*o).signature & cls##_MASK) == cls##_SIGNATURE)
16907#define _MkCheckO(cls,o) ((o) && __MkCheckO(cls,(o)))
16908#define __MkCheckX(cls,x) __MkCheckO(cls,(cls##_X2obj(x)))
16909#define _MkCheckX(cls,x) ((x) && __MkCheckO(cls,(cls##_X2obj(x))))
16910#define __MkCheckM(cls,m) __MkCheckO(cls,((MK_OBJ)(m)))
16911#define _MkCheckM(cls,m) ((m) && __MkCheckM(cls,m))
16912
16913#define MkCheckNN(cls,x) __MkCheckO(cls,(cls##_X2obj(x)))
16914
16915#ifdef __SANITIZE_ADDRESS__
16916
16917 #define MkSanitizeCheck(_root,_m) _MkCheckM(_root,_m)
16918 #define MkSanitizeCheckO(_root,_o) _MkCheckO(_root,_o)
16919#else
16920 #define MkSanitizeCheck(_root,_m) _MkCheckM(_root,_m)
16921 #define MkSanitizeCheckO(_root,_o) _MkCheckO(_root,_o)
16922#endif
16923
16926#define MkAssertO(cls,o) assert(o==NULL?true:__MkCheckO(cls,o))
16927#define MkAssertX(cls,x) assert(x==NULL?true:__MkCheckX(cls,o))
16929
16931#ifdef NDEBUG
16932# define MkAssertCastM(cls,m) ((cls##_type)(m))
16933#else
16934# define MkAssertCastM(cls,m) ((cls##_type)(({MK_OBJ o=(MK_OBJ)(m);MkAssertO(cls,o);o;})))
16935#endif
16936
16937#define toTT(_type) (MkTYP(_type))
16938
16940
16942#define MK_NULL_SIGNATURE 0
16943
16946struct MkObjectProtectS {
16957 bool isLocal;
16958
16961};
16962
16963#define MkDbgObjInstancesO_2(o,c) \
16964do { \
16965 if (o) { \
16966 mk_dbg_color_ln(c,"MkDbgObjInstances: %s[%p] prev<%p>, next<%p>, var<" #o ">", \
16967 (o)->type->type_name, o, (o)->obj_protect.prev, (o)->obj_protect.next); \
16968 } else { \
16969 mk_dbg_color_ln(c,"MkDbgObjInstances: %s[NULL] var<" #o ">", "unknown"); \
16970 } \
16971} while (0)
16972#define MkDbgObjInstancesX_2(x,c) MkDbgObjInstancesO_2(MkOBJ(x),c)
16973#define MkDbgObjInstancesX(x) MkDbgObjInstancesX_2(x,MK_COLOR_CYAN)
16974#define MkDbgObjInstancesO(o) MkDbgObjInstancesO_2(o,MK_COLOR_CYAN)
16975
16976#if META_DEBUG & META_DEBUG_REFCOUNT
16977
16978 __attribute__ ((visibility("default"))) void
16979 MkDbgDeepWriter(
void* mng,const
char* ident, const
char* func, const
char* fmt,...);
16980
16981#else
16982
16983 #define MkDbgDeepWriter(...)
16984
16985#endif
16986
16987#define MkDbgDeepX_4(m,ident,func,fmt,...) MkDbgDeepWriter(m, ident, func, fmt, __VA_ARGS__)
16988#define MkDbgDeepX_3(m,ident,fmt,...) MkDbgDeepX_4(m,ident,__func__,fmt,__VA_ARGS__)
16989#define MkDbgDeepX_2(m,ident) MkDbgDeepX_4(m,ident,__func__,NULL,NULL)
16990
16992struct MkObjectS {
17007
17009
17010
17014 bool deleteCallbackCalled;
17015
17019 bool selfCreated;
17020
17021#if defined(META_USE_SELF_REFCOUNT)
17031#endif
17032
17035
17038
17041 struct MkObjectProtectS obj_protect;
17042
17043
17044
17045
17046};
17047
17048
17049
17054
17055
17058
17059 #define MkObjectC_SIGNATURE (0x59B3u<<16)
17060 #define MkObjectC_MASK (((1u<<16)-1)<<16)
17061
17063
17064
17067
17068 #define MkObjectC_X2obj(x) (x)
17069
17071
17072
17075
17081 #define MkObjectC_T (&MK_RT_REF._MkObjectC_T)
17083 #define MkObjectC_TT (MkTYP(MkObjectC_T))
17085 #define MkObjectST MkObjectC_T
17087 #define MkObjectSTT (MkTYP(MkObjectST))
17089 #define MkObjectC_type MK_OBJ
17091 #define MkObjectCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
17093 #define MkObjectCTT_X(instance) (MkOBJ_R(instance).type)
17095 #define MkObjectCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
17097 #define MkObjectC_NS MK
17099 #define MkObjectCTT MkObjectCTT
17101 #define MkObjectCT ( (struct MkTypeDefS *) MkObjectCTT )
17102
17104
17105
17108
17109 #pragma GCC diagnostic push
17110 #pragma GCC diagnostic ignored "-Wattributes"
17111
17118 }
17119
17126 }
17127
17128 #pragma GCC diagnostic pop
17129 #define MkObjectC_Check(mng) MkObjCheck(mng)
17130
17132
17133
17136
17139 META_ATTRIBUTE_SANITIZE
17142 return (
MkObjCheck(mng) ? (MK_OBJ)mng : NULL);
17143 }
17144
17147 META_ATTRIBUTE_SANITIZE
17149 mk_inline MK_OBJN MkObjN(MK_MNGN mng) {
17150 return (
MkObjCheck(mng) ? (MK_OBJN)mng : NULL);
17151 }
17152
17154 #define MkObjRaise(_obj) if (!_MkCheckX(MkObjectC,_obj)) { \
17155 MkErrorSetC_1E("'MkObjectC' hdl is NULL"); \
17156 goto error ; \
17157 }
17158
17160 #define MkOBJ_R(x) (*(x)).super.obj
17162 #define MkOBJ(x) (&MkOBJ_R(x))
17163
17165
17168
17169
17170
17171
17172
17173
17174
17177
17180__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MkObjectC,no-rpc);
17181
17189
17192 return ((MK_HDL)obj->signature);
17193}
17194
17195#define MkObjectHandleGetOfType_1X(x) MkObjectHandleGetOfType(MkOBJ(x))
17196
17204
17215
17217
17220
17221
17222
17223
17226
17229
17230__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MkObjectC);
17231
17251
17252#define MkObjectHandleGet_1X(x) MkObjectHandleGet(x?MkOBJ(x):NULL)
17253
17264 MK_HDL const netHdl
17266
17276#define MkObjectHandleResolve_e(netHdl) ({ \
17277 MK_HDL tmpHdl=netHdl; \
17278 MK_OBJ tmp; \
17279 if (tmpHdl==0) { \
17280 tmp=NULL; \
17281 } else { \
17282 tmp=MkObjectHandleResolve(tmpHdl); \
17283 if (tmp==NULL) { \
17284 MkErrorSetC_1_NULL("ERROR: 'MkObjectC' handle is 'NULL'"); \
17285 goto error; \
17286 }; \
17287 }; \
17288 tmp; \
17289})
17290
17295 MK_HDL const netHdl
17296);
17297
17302 MK_OBJ const netObj
17303);
17304
17306
17308
17309
17313 __parser__(doc-group=_ignore_,doc-index=Class,doc-name=Misc,
class=MkObjectC,null-
return-allow)
17317 }
17319
17320
17322
17323
17324
17325
17350
17363struct MkAllocDefS {
17367};
17368
17369
17371
17372
17373
17374
17375
17376
17377
17378
17516#define MkDbgTyp2(t,c) \
17517 mk_dbg_color_ln(c,"MkDbgTyp[%-32s]: typ<ID=%-2d,P=%-14p,RT=%p> type_class<%s:%p>, " #t, \
17518 MK_TRIM_LEFT(32,(t)->type_name), (t)->type_id, t, MkRT_X(t), \
17519 (t)->type_class->type_name, (t)->type_class)
17520#define MkDbgTyp(t) MkDbgTyp2(t,MK_COLOR_LIGHT_CYAN)
17521#define MkDbgTypListAll2(t,c) do { \
17522 MK_OBJ o; \
17523 MkRuntimeLogBufferPush(); \
17524 DL_FOREACH2((t)->type_class->instancesR,o,obj_protect.next) { \
17525 MkDbgTyp2(MkTyp(o),c); \
17526 } \
17527 MkRuntimeLogBufferPop(); \
17528} while (0)
17529#define MkDbgTypListAll(t) MkDbgTypListAll2(t,MK_COLOR_GREEN)
17530
17531#define MkDbgTypInstances_2(t,c) \
17532do { \
17533 MK_TYP _typ = (t); \
17534 if (_typ) { \
17535 mk_dbg_start_2(c,"MkDbgTypInstances: %s[%p] ", _typ->type_name, _typ); \
17536 int max=5; \
17537 for (MK_OBJ obj=MkTypeInstances(_typ); obj; obj=MkObjectNext(obj)) { \
17538 mk_dbg_next_2(c,"%p,",obj); \
17539 max--; \
17540 if(max==0) { \
17541 mk_dbg_next_2(MK_COLOR_RED,"%s", "break"); \
17542 break; \
17543 } \
17544 } \
17545 mk_dbg_end(); \
17546 } else { \
17547 mk_dbg_color_ln(c,"MkDbgTypInstances: %s[%p] ", #t, _typ); \
17548 } \
17549} while (0)
17550
17551#define MkDbgTypInstances(t) MkDbgTypInstances_2(t,MK_COLOR_CYAN)
17552
17553
17556struct MkTypeS {
17557
17558
17559 union {
17560 struct MkObjectS obj;
17561 } super;
17562
17563
17564
17565
17566 #define MkTypeS_name_size 32
17570 bool noSelf;
17572 size_t objsize;
17573 size_t typsize;
17574
17577
17578
17592
17594
17595 struct MkAllocDefS objalloc;
17604};
17605
17606
17607
17612
17613
17616
17617 #define MkTypeC_SIGNATURE (MkObjectC_SIGNATURE ^ (11u<<10))
17618 #define MkTypeC_MASK (((1u<<22)-1)<<10)
17619
17621
17622
17625
17626 #define MkTypeC_X2typ(x) (x)
17627 #define MkTypeC_X2obj(x) MkOBJ(x)
17628
17630
17631
17634
17640 #define MkTypeSTT (&MK_RT_REF._MkTypeC_TT)
17642 #define MkTypeC_TT (&MK_RT_REF._MkTypeC_TT)
17644 #define MkTypeC_type MK_TYP
17646 #define MkTypeCT_X(instance) ( (struct MkTypeS *) (MkOBJ_R(instance).type) )
17648 #define MkTypeCTT_X(instance) (MkOBJ_R(instance).type)
17650 #define MkTypeCT_TT(typ) ( (struct MkTypeS *) (typ) )
17652 #define MkTypeC_NS MK
17654 #define MkTypeCTT MkTypeCTT
17656 #define MkTypeCT ( (struct MkTypeS *) MkTypeCTT )
17657
17659
17660
17663
17664 #pragma GCC diagnostic push
17665 #pragma GCC diagnostic ignored "-Wattributes"
17666
17673 }
17674
17681 }
17682
17683 #pragma GCC diagnostic pop
17684 #define MkTypeC_Check(mng) MkTypCheck(mng)
17685
17687
17690
17691
17692
17693
17696mk_inline MK_TYP MkTyp(const MK_MNG mng) {
17702 return NULL;
17703}
17704
17713 return NULL;
17714}
17715
17717#define MkTYP_R(x) (*(x)).super.typ
17719#define MkTYP(x) (&MkTYP_R(x))
17721#define MkTYP_O(o) (*o).type
17723#define MkTYP_X(x) MkOBJ_R(x).type
17724
17731struct MkTypeDefS {
17732
17733
17734 union {
17735 struct MkObjectS obj;
17736 struct MkTypeS typ;
17737 } super;
17738
17739
17740};
17741
17742
17743
17748
17749
17752
17753 #define MkTypeDefC_SIGNATURE (MkTypeC_SIGNATURE ^ (1u<<6))
17754 #define MkTypeDefC_MASK (((1u<<26)-1)<<6)
17755
17757
17758
17761
17762 #define MkTypeDefC_X2typ(x) MkTYP(x)
17763 #define MkTypeDefC_X2obj(x) MkOBJ(x)
17764
17766
17767
17770
17776 #define MkTypeDefSTT (&MK_RT_REF._MkTypeDefC_TT)
17778 #define MkTypeDefC_TT (&MK_RT_REF._MkTypeDefC_TT)
17780 #define MkTypeDefCT_X(instance) ( (struct MkTypeS *) (MkOBJ_R(instance).type) )
17782 #define MkTypeDefCTT_X(instance) (MkOBJ_R(instance).type)
17784 #define MkTypeDefCT_TT(typ) ( (struct MkTypeS *) (typ) )
17786 #define MkTypeDefC_NS MK
17788 #define MkTypeDefCTT MkTypeDefCTT
17790 #define MkTypeDefCT ( (struct MkTypeS *) MkTypeDefCTT )
17791
17793
17796
17797
17798
17799
17803
17818#define MkTypeSlotResolve(_tt,fptr,force) ({ \
17819 MK_TYP tt = (_tt) ; \
17820 tt == NULL ? NULL : \
17821 !force && tt->fptr == (MK_PTR) 0x1 ? NULL : \
17822 tt->fptr > (typeof(tt->fptr)) 0x1 ? tt->fptr : \
17823 tt == MkTypeSTT ? NULL : \
17824 (typeof(tt->fptr)) MkTypeSlotResolveP(MK_RT_CALL tt, offsetof(struct MkTypeS, fptr), force); \
17825}) \
17826
17827#define MkTypeSlotCall(_tt,fptr,...) do { \
17828 typeof((_tt)->fptr) slot = MkTypeSlotResolve((_tt),fptr,false); \
17829 if (slot) (*slot)(MK_RT_CALL __VA_ARGS__); \
17830} while (false)
17831
17833
17834
17835
17836
17837
17843
17845
17856#if defined(META_USE_SELF_REFCOUNT)
17857
17858 #define MkObjInit2(rtmkV,rtExtV,sigV,typeV,refCountV,isLocalV) \
17859 (struct MkObjectS) { \
17860 .signature = sigV, \
17861 .refCount = refCountV, \
17862 .self = NULL, \
17863 .type = typeV, \
17864 .env = NULL, \
17865 .selfCreated = false, \
17866 .selfRefCount = 0, \
17867 .objRt = rtmkV, \
17868 .objRtExt = rtExtV, \
17869 .obj_protect = { \
17870 .isLocal = isLocalV, \
17871 .prev = NULL, \
17872 .next = NULL, \
17873 }, \
17874 }
17875
17876#else
17877 #define MkObjInit2(rtmkV,rtExtV,sigV,typeV,refCountV,isLocalV) \
17878 (struct MkObjectS) { \
17879 .signature = sigV, \
17880 .refCount = refCountV, \
17881 .self = NULL, \
17882 .type = typeV, \
17883 .env = NULL, \
17884 .selfCreated = false, \
17885 .objRt = rtmkV, \
17886 .objRtExt = rtExtV, \
17887 .obj_protect = { \
17888 .isLocal = isLocalV, \
17889 .prev = NULL, \
17890 .next = NULL, \
17891 }, \
17892 }
17893#endif
17894
17895#define MkObjInit(rtmkV,rtExtV,cls,refCountV,isLocalV) \
17896 MkObjInit2(rtmkV,rtExtV,cls##_SIGNATURE,cls##_TT,refCountV,isLocalV)
17897
17898
17899#define MkObjInitFromType(typeV,isLocalV) \
17900 MkObjInit2(MK_RT_PTR, NULL, (*typeV).objsig, typeV, 0, isLocalV)
17901
17902
17903#define MkObjInitFromInstance(instV) \
17904 MkObjInit2(MK_RT_PTR, NULL, MkOBJ_R(instV).type->objsig, MkOBJ_R(instV).type, 0, false)
17905
17922 MK_OBJ const srcobj
17924
17936 MK_OBJ const srcmng,
17937 MK_STRN const ident
17939
17958 MK_OBJ const obj
17960
17970 MK_TYP type
__parser__(internal,
default=NULL),
17971 MK_PTR nat,
17972 MK_PTR lnk
17974
17975
17976
17977
17978
18000 MK_OBJ obj
18002
18003#define MkObjectDelete_NULL(obj) MkObjectDeleteToNull(MkObjectDelete_RT,MK,obj)
18004#define MkObjectDelete_NULL_X(x) MkObjectDeleteToNull_X(MkObjectDelete_RT,MK,x)
18005#define MkObjectDelete_1X(x) MkObjectDeleteToNull_X(MkObjectDelete_RT,MK,x)
18006
18007#define MkObjectDeleteToNull(fct,NS,x) if (x) { fct (NS##_RT_CALL x); (x) = NULL ; }
18008#define MkObjectDeleteToNull_X(fct,NS,x) if (x) { fct (NS##_RT_CALL MkOBJ(x)); (x) = NULL ; }
18009
18028 MK_OBJ obj
18030
18031#define MkObjectDispose_NULL(obj) MkObjectDeleteToNull(MkObjectDispose_RT,MK,obj)
18032#define MkObjectDispose_NULL_X(x) MkObjectDeleteToNull_X(MkObjectDispose_RT,MK,x)
18033#define MkObjectDispose_1X(x) MkObjectDispose(MkOBJ(x))
18034
18036#define MkObjectDeleteCallF_CHECK do { \
18037 assert (__data__ != NULL); \
18038} while (0)
18039
18040
18042#define MkObjectDeleteCallF_ARGS \
18043 MK_RT_ARGS \
18044 MK_OBJN const obj __parser__(internal), \
18045 MK_STRN const typeName, \
18046 MK_HDL const typeHdl, \
18047 MK_HDL const objHdl, \
18048 MK_CBP const __data__ \
18049
18050#define MkObjectDeleteCallF_CALL MK_RT_CALL obj, __data__
18051
18098
18100#define MkObjectDeleteFreeF_ARGS MK_RT_ARGS MK_CBP *dataP __parser__(inout)
18101
18104
18137__parser__(
class=MkObjectC,callback-name=ObjectDelete,callback-null)
18140 MK_STRN ident ,
18141 MkObjectDeleteCallF fCall
__parser__(callback-call),
18143 MkObjectDeleteFreeF fFree
__parser__(callback-free),
18146
18147
18154 MK_STRN ident
18156
18158
18160
18161
18162
18163
18164
18165
18166
18167
18182
18183
18184
18192 MK_OBJ const tgtmng,
18193 MK_OBJN const srcmng
18195
18201 MK_OBJ const obj
18203
18204
18205
18210
18213
18215#define MkRefLOCK 999999
18216
18221mk_inline void MkRefIncr ( MK_OBJ obj ) {
18222 if (obj) ++(*obj).refCount;
18223}
18224
18225#define MkRefIncr_1X(x) MkRefIncr(MkOBJ(x))
18226#define MkRefIncr_1M(m) MkRefIncr(MkObj(m))
18227
18241#define MkRefIncr_FX(x) MkRefIncr(MkOBJ(x))
18242
18254 MK_OBJ obj
18256
18260#define MkRefDecr_O(o) do { MkRefDecr_RT(MK_RT_CALL o); o=NULL; } while (0)
18264#define MkRefDecr_X(x) do { MkRefDecr_RT(MK_RT_CALL MkOBJ(x)); x=NULL; } while (0)
18266#define MkRefDecr_X_NULL(x) do { MkRefDecr_RT(MK_RT_NULL MkOBJ(x)); x=NULL; } while (0)
18271#define MkRefDecr_M(m) do { MkRefDecr_RT(MK_RT_CALL MkObj(m)); m=NULL; } while (0)
18273#define MkRefDecr_M_NULL(m) do { MkRefDecr_RT(MK_RT_NULL MkObj(m)); m=NULL; } while (0)
18274
18276#define MkRefDecr_FX(x) do { --(MkOBJ_R(x).refCount); } while(0)
18277
18288 obj->refCount++;
18289 obj->self = (obj->type->noSelf ? NULL : self);
18290 obj->env = env;
18291}
18292
18293#define MkRefIncrSelf_2X(x,s) MkRefIncrSelf(MkOBJ(x),s)
18294
18311 MK_OBJ const obj
18313
18318
18330 MK_OBJ const obj
18332
18341 return (*obj).refCount;
18342}
18343
18344#define MkRefGet_1X(x) MkRefGet(MkOBJ(x))
18345
18352}
18353#define MkRefLock_1X(x) MkRefLock(MkOBJ(x))
18354
18362}
18363#define MkRefIsLocked_1X(x) MkRefIsLocked(MkOBJ(x))
18364
18366#define MkRefSet(target,source) ({ \
18367 if (target != source) { \
18368 typeof(target) targetSave=target; \
18369 target = source;\
18370 MkRefDecr_X(targetSave);\
18371 MkRefIncr_1X(target);\
18372 } \
18373 target;\
18374})
18375
18378
18379#define MkRefCidN_NULL() MkRefCidN_RT(MK_RT_CALL_NULL_ONLY)
18380
18382
18383
18384
18385
18388
18391
18394
18402 obj->env = env;
18403 obj->self = (obj->type->noSelf ? NULL : self);
18404}
18405
18406#define MkSelfSet_3X(x,self,env) MkSelfSet(MkOBJ(x),self,env)
18407
18413
18414 return obj ? obj->self : NULL;
18415}
18416
18417#define MkSelfGet_1X(x) MkSelfGet(MkOBJ(x))
18418
18446 MK_PTR *self_out,
18447 MK_PTR const env
18448);
18449
18450#define MkSelfNew_3X(x,self_out,env) MkSelfNew(MkOBJ(x),self_out,env)
18451
18463 MK_OBJ const obj,
18464 MK_PTR const env
18465);
18466
18467#define MkSelfCreate_2X(x,env) MkSelfCreate(MkOBJ(x),env)
18468
18480 MK_OBJ const obj
18482
18483#define MkSelfDelete_1X(x) MkSelfDelete_RT(MK_RT_CALL MkOBJ(x))
18484
18504 MK_OBJ obj
18506
18507#define MkSelfDeleteForce_1X(x) MkSelfDeleteForce(MkOBJ(x))
18508
18529 MK_OBJ obj
18531
18532#define MkSelfUnlink_1X(x) MkSelfUnlink(MkOBJ(x))
18533
18538 return obj->self != NULL;
18539}
18540
18541#define MkSelfExists_1X(x) MkSelExists(MkOBJ(x))
18542
18544
18545
18547
18548
18549
18552
18553
18554
18555
18556
18558
18563
18651MK_TYP MkTypeCreate ( MK_MACRO_TYP
const clsV, MK_MACRO_TYP
const basicV, MK_STRN
const identV);
18652
18653#define MkTypeCreate(clsV, basicV, identV) ({ \
18654 assert(!MkSysStringIsNULL(identV)); \
18655 MK_TYP ret = MkTypeDup2(basicV ## _TT,identV); \
18656 ret->objsig = clsV ## _SIGNATURE; \
18657 ret->objmask = clsV ## _MASK; \
18658 ret->objsize = sizeof(clsV##R); \
18659 ret->type_base = basicV ## _TT; \
18660 ret->type_class = ret; \
18661 ret ; \
18662})
18663
18664
18684 MK_TYPN const typ,
18685 MK_STRN const ident
18687
18700 MK_TYPN const typ
18702
18713 MK_TYPN const typ
18715
18721 MK_TYP const typ
18723
18726 MK_TYP const typ
18727) {
18728 assert(typ != NULL);
18729 assert(typ->type_class != NULL);
18730 MK_OBJ ret = typ->type_class->instancesR;
18731
18732
18733
18734
18735
18736 if (ret) assert(ret->type->type_class == typ->type_class);
18737 return ret;
18738}
18739
18742#define MkTypeForeachInstancesSave(typ) DL_FOREACH_SAFE2((typ)->type_class->instancesR,obj,tmp,obj_protect.next)
18743
18749}
18750
18752
18753
18759
18773 MK_TYPN const typ ,
18776 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
18779
18780#define MkTypeLog_2Lvl(t,l,...) MkTypeLog_RT(MK_RT_CALL (t), __VA_ARGS__, (l)
18781
18782
18789#if META_DEBUG & META_DEBUG_TYPE
18790 #define MkTypeLoop(_cls, _var) \
18791 bool _var##_firstB = true; \
18792 _cls##_type _var##_first = (_cls##_type)_cls##_TT->type_class->instancesR; \
18793 for ( \
18794 _cls##_type _var = _var##_first; \
18795 ({ if (!_var##_firstB && _var == _var##_first) { \
18796 MkPanicV_2M(_var,"[MkTypeLoop] INTERNAL ERROR: found 'circle' in 'MkTypeC=%s'", _var->type_name); \
18797 } ; _var##_firstB = false; _var; }); \
18798 _var = (_cls##_type)_cls##_X2obj(_var)->obj_protect.next \
18799 )
18800#else
18801 #define MkTypeLoop(_cls, _var) \
18802 for (_cls##_type _var = (_cls##_type)_cls##_TT->type_class->instancesR; _var != NULL; \
18803 _var = (_cls##_type)_cls##_X2obj(_var)->obj_protect.next)
18804#endif
18805
18807
18809
18810
18811
18813
18817
18823
18825
18826
18831
18843
18844#define MkObjectToName_1X(x) MkObjectToName(MkOBJ(x))
18845
18862 MK_OBJN const obj
18864
18865
18866#define MkObjectToNameOfType_1X(x) MkObjectToNameOfType(MkOBJ(x))
18867
18881 MK_OBJ const obj
18883
18884#define MkObjectToNameOfClass_1X(x) MkObjectToNameOfClass_RT(MK_RT_CALL MkOBJ(x))
18885
18900
18901#define MkObjectToString_1X(x) MkObjectToString(x?MkOBJ(x):NULL)
18902#define MkObjectToString_1M(m) MkObjectToString(m?MkObjN(m):NULL)
18903
18908) {
18910}
18911
18913
18914
18915
18916
18942
18943
18944
18945
18946
18947
18948
18962
18964
18984 MK_STRN const message ,
18986 MK_STRN
const callfunc
__parser__(
default=F#FUNC)
18988
18989#define MkLogC_4X(x,message,debug,callfunc) MkLogC(MkOBJ(x),message,debug,callfunc)
18990#define MkLogC_3X(x,message,debug) MkLogC_3(MkOBJ(x),message,debug)
18991#define MkLogC_2X(x,message) MkLogC_2(MkOBJ(x),message)
18992#define MkLogW(x,callfunc,_debug,message) MkLogC(MkOBJ(x),message,_debug,callfunc)
18993
19007 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
19008 FILE *FH,
19009 MK_FST const printfmt,
19010 ...
19012
19013#define MkDbgV_2X(x,printfmt,...) MkDbgV_RT(MK_RT_CALL MkOBJ(x),__func__,stderr,printfmt,__VA_ARGS__)
19014#define MkDbgV_2O(o,printfmt,...) MkDbgV_RT(MK_RT_CALL o ,__func__,stderr,printfmt,__VA_ARGS__)
19015
19028 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
19030 MK_FST const printfmt,
19031 ...
19033
19034#define MkLogV_lvl(x,debug,printfmt,...) MkLogV(MkOBJ(x),__func__,debug,printfmt,__VA_ARGS__)
19035
19036#define MkLogV_4M(x,callfunc,debug,printfmt,...) MkLogV(MkObjN(x),callfunc,debug,printfmt,__VA_ARGS__)
19037#define MkLogV_4X(x,callfunc,debug,printfmt,...) MkLogV(MkOBJ(x),callfunc,debug,printfmt,__VA_ARGS__)
19038#define MkLogV_3X(x,callfunc,printfmt,...) MkLogV_3(MkOBJ(x),callfunc,printfmt,__VA_ARGS__)
19039#define MkLogV_2X(x,printfmt,...) MkLogV_2(MkOBJ(x),printfmt,__VA_ARGS__)
19040
19054 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
19056 MK_FST const printfmt,
19057 va_list var_list
19059
19060#define MkLogVL_5X(fmtobj,callfunc,debug,printfmt,var_list) \
19061 MkLogVL(MkOBJ(fmtobj),callfunc,debug,printfmt,var_list)
19062
19072 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
19073 MkBinaryR const data
19075
19076#define MkLogHEX_4X(fmtobj,callfunc,data,len) MkLogHEX_RT(MkOBJ(fmtobj),callfunc,data,len)
19077
19091 MK_OBJN const obj ,
19094 MK_STRN const callfunc
__parser__(default=F
#FUNC),
19097
19098#define MkObjectLogShort_1X(x) MkObjectLogShort(MkOBJ(x),NULL,0,__func__,0)
19099#define MkObjectLogShort_2Lvl(o,l) MkObjectLogShort(o,NULL,0,__func__,l)
19100
19114 MK_OBJN const obj ,
19117 MK_STRN const callfunc
__parser__(default=F
#FUNC),
19120
19121#define MkObjectLogLong_1X(x) MkObjectLogLong(MkOBJ(x),NULL,0,__func__,0)
19122#define MkObjectLogLong_1M(m) MkObjectLogLong(MkObj(m),NULL,0,__func__,0)
19123
19137 MK_OBJN const obj ,
19140 MK_STRN const callfunc
__parser__(default=F
#FUNC),
19143
19144#define MkObjectLogLong_1X(x) MkObjectLogLong(MkOBJ(x),NULL,0,__func__,0)
19145#define MkObjectLogLong_1M(m) MkObjectLogLong(MkObj(m),NULL,0,__func__,0)
19146
19225 MK_OBJN const obj ,
19228 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
19231
19232#define MkObjectLog_1X(x) MkObjectLog(MkOBJ(x),NULL,0,__func__,0)
19233#define MkObjectLog_2Lvl(o,l) MkObjectLog(o,NULL,0,__func__,l)
19234
19236
19238
19239
19240
19241
19242
19243
19244
19245
19253
19255
19263 MK_STRN const message ,
19265 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
19268
19269#define MkDbgL_2M(x,message) MkDbgL(MkObj(x),message,0,__func__,-1)
19270
19274__parser__(no-type-extension,
template-overload)
19277 MK_OBJN const obj,
19278 MK_STRN
const message
__parser__(
default=S#
"var"),
19279 MK_STRN
const callfunc
__parser__(
default=F#FUNC)
19281
19282#define MkDbgDump_2M(x,message) MkDbgDump_2(MkObj(x),message)
19283
19287 MK_STRN const message ,
19289 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
19292
19299 MK_STRN const callfunc
__parser__(default=F
#FUNC)
19301
19302#define MkDbgSTACK_3X(x,num,callfunc) MkDbgSTACK_3(MkOBJ(x),num,callfunc)
19303
19314 MK_OBJN const obj,
19315 MK_STRN
const callfunc
__parser__(
default=F#FUNC)
19317
19318#define MkDbgO_2X(x,callfunc) MkDbgO(MkObj(x),callfunc)
19319#define MkDbgO_1X(x) MkDbgO_2X(x,__func__)
19320#define MkDbgO_1O(x) MkDbgO(x,__func__)
19321
19326 MK_OBJN const obj,
19327 MK_STRN
const callfunc
__parser__(
default=F#FUNC)
19329
19331#define MkDbgLogC_2X(x,callfunc) MkDbgLogC_2(MkOBJ(x),callfunc)
19332
19334
19335
19336
19337
19338
19339
19340
19341
19366
19368#define MkBufferS_ils_size (0)
19369
19393
19394struct MkBufferS {
19395
19396
19397 union {
19398 struct MkObjectS obj;
19399 } super;
19400
19401
19402
19403
19404 struct {
19407 } var;
19408
19409 struct {
19410 union MkBufferU first;
19412 bool doBufferFree;
19413 } storage;
19415 struct ilsS {
19418 } ils;
19420};
19421
19422
19423
19428
19429
19432
19433 #define MkBufferC_SIGNATURE (MkObjectC_SIGNATURE ^ (1u<<10))
19434 #define MkBufferC_MASK (((1u<<22)-1)<<10)
19435
19437
19438
19441
19442 #define MkBufferC_X2buf(x) (x)
19443 #define MkBufferC_X2obj(x) MkOBJ(x)
19444
19446
19447
19450
19456 #define MkBufferC_T (&MK_RT_REF._MkBufferC_T)
19458 #define MkBufferC_TT (MkTYP(MkBufferC_T))
19460 #define MkBufferST MkBufferC_T
19462 #define MkBufferSTT (MkTYP(MkBufferST))
19464 #define MkBufferC_type MK_BUF
19466 #define MkBufferCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
19468 #define MkBufferCTT_X(instance) (MkOBJ_R(instance).type)
19470 #define MkBufferCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
19472 #define MkBufferC_NS MK
19474 #define MkBufferCTT MkBufferCTT
19476 #define MkBufferCT ( (struct MkTypeDefS *) MkBufferCTT )
19477
19479
19480
19483
19484 #pragma GCC diagnostic push
19485 #pragma GCC diagnostic ignored "-Wattributes"
19486
19493 }
19494
19501 }
19502
19503 #pragma GCC diagnostic pop
19504 #define MkBufferC_Check(mng) MkBufCheck(mng)
19505
19507
19508
19511
19514 META_ATTRIBUTE_SANITIZE
19517 return (
MkBufCheck(mng) ? (MK_BUF)mng : NULL);
19518 }
19519
19522 META_ATTRIBUTE_SANITIZE
19524 mk_inline MK_BUFN MkBufN(MK_MNGN mng) {
19525 return (
MkBufCheck(mng) ? (MK_BUFN)mng : NULL);
19526 }
19527
19529 #define MkBufRaise(_buf) if (!_MkCheckX(MkBufferC,_buf)) { \
19530 MkErrorSetC_1E("'MkBufferC' hdl is NULL"); \
19531 goto error ; \
19532 }
19533
19535 #define MkBUF_R(x) (*(x)).super.buf
19537 #define MkBUF(x) (&MkBUF_R(x))
19538
19540
19543
19544
19545
19546
19547
19549
19550
19551
19552
19553
19556
19559
19560__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MkBufferC);
19561
19582) {
19584}
19585
19596mk_inline MK_BUF MkBufferHandleResolve_RT (
19598 MK_HDL const netHdl
19599) {
19601}
19602
19612#define MkBufferHandleResolve_e(netHdl) ({ \
19613 MK_HDL tmpHdl=netHdl; \
19614 MK_BUF tmp; \
19615 if (tmpHdl==0) { \
19616 tmp=NULL; \
19617 } else { \
19618 tmp=MkBufferHandleResolve(tmpHdl); \
19619 if (tmp==NULL) { \
19620 MkErrorSetC_1_NULL("ERROR: 'MkBufferC' handle is 'NULL'"); \
19621 goto error; \
19622 }; \
19623 }; \
19624 tmp; \
19625})
19626
19628
19630
19631
19635 __parser__(flags=
new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,
class=MkBufferC,null-
return-allow)
19639 }
19641
19642
19644
19645
19646
19647
19648
19649
19661
19663#define MkBuffer64S_ils_size (64)
19664
19669struct MkBuffer64S {
19670
19671
19672 union {
19673 struct MkObjectS obj;
19674 struct MkBufferS buf;
19675 } super;
19676
19677
19678
19679
19681};
19682
19683
19684
19689
19690
19693
19694 #define MkBuffer64C_SIGNATURE (MkBufferC_SIGNATURE ^ (1u<<6))
19695 #define MkBuffer64C_MASK (((1u<<26)-1)<<6)
19696
19698
19699
19702
19703 #define MkBuffer64C_X2buf(x) MkBUF(x)
19704 #define MkBuffer64C_X2obj(x) MkOBJ(x)
19705
19707
19708
19711
19717 #define MkBuffer64C_T (&MK_RT_REF._MkBuffer64C_T)
19719 #define MkBuffer64C_TT (MkTYP(MkBuffer64C_T))
19721 #define MkBuffer64ST MkBuffer64C_T
19723 #define MkBuffer64STT (MkTYP(MkBuffer64ST))
19725 #define MkBuffer64CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
19727 #define MkBuffer64CTT_X(instance) (MkOBJ_R(instance).type)
19729 #define MkBuffer64CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
19731 #define MkBuffer64C_NS MK
19733 #define MkBuffer64CTT MkBuffer64CTT
19735 #define MkBuffer64CT ( (struct MkTypeDefS *) MkBuffer64CTT )
19736
19738
19741
19742
19743
19744
19746
19747
19748
19749
19755
19757#define MkBuffer256S_ils_size (256)
19758
19763struct MkBuffer256S {
19764
19765
19766 union {
19767 struct MkObjectS obj;
19768 struct MkBufferS buf;
19769 } super;
19770
19771
19772
19773
19775};
19776
19777
19778
19783
19784
19787
19788 #define MkBuffer256C_SIGNATURE (MkBufferC_SIGNATURE ^ (2u<<6))
19789 #define MkBuffer256C_MASK (((1u<<26)-1)<<6)
19790
19792
19793
19796
19797 #define MkBuffer256C_X2buf(x) MkBUF(x)
19798 #define MkBuffer256C_X2obj(x) MkOBJ(x)
19799
19801
19802
19805
19811 #define MkBuffer256C_T (&MK_RT_REF._MkBuffer256C_T)
19813 #define MkBuffer256C_TT (MkTYP(MkBuffer256C_T))
19815 #define MkBuffer256ST MkBuffer256C_T
19817 #define MkBuffer256STT (MkTYP(MkBuffer256ST))
19819 #define MkBuffer256CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
19821 #define MkBuffer256CTT_X(instance) (MkOBJ_R(instance).type)
19823 #define MkBuffer256CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
19825 #define MkBuffer256C_NS MK
19827 #define MkBuffer256CTT MkBuffer256CTT
19829 #define MkBuffer256CT ( (struct MkTypeDefS *) MkBuffer256CTT )
19830
19832
19835
19836
19837
19838
19840
19841
19842
19843
19849
19851#define MkBuffer1024S_ils_size (1024)
19852
19857struct MkBuffer1024S {
19858
19859
19860 union {
19861 struct MkObjectS obj;
19862 struct MkBufferS buf;
19863 } super;
19864
19865
19866
19867
19869};
19870
19871
19872
19877
19878
19881
19882 #define MkBuffer1024C_SIGNATURE (MkBufferC_SIGNATURE ^ (3u<<6))
19883 #define MkBuffer1024C_MASK (((1u<<26)-1)<<6)
19884
19886
19887
19890
19891 #define MkBuffer1024C_X2buf(x) MkBUF(x)
19892 #define MkBuffer1024C_X2obj(x) MkOBJ(x)
19893
19895
19896
19899
19905 #define MkBuffer1024C_T (&MK_RT_REF._MkBuffer1024C_T)
19907 #define MkBuffer1024C_TT (MkTYP(MkBuffer1024C_T))
19909 #define MkBuffer1024ST MkBuffer1024C_T
19911 #define MkBuffer1024STT (MkTYP(MkBuffer1024ST))
19913 #define MkBuffer1024CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
19915 #define MkBuffer1024CTT_X(instance) (MkOBJ_R(instance).type)
19917 #define MkBuffer1024CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
19919 #define MkBuffer1024C_NS MK
19921 #define MkBuffer1024CTT MkBuffer1024CTT
19923 #define MkBuffer1024CT ( (struct MkTypeDefS *) MkBuffer1024CTT )
19924
19926
19929
19930
19931
19932
19934
19935
19936#ifndef __has_parser__
19937
19947#define MkBuf2XXXfast(buf) (*(buf)->storage.first.A)
19948
19949#define MkBuf2BOLfast(buf) MkBuf2XXXfast(buf).BOL
19950#define MkBuf2I8fast(buf) MkBuf2XXXfast(buf).I8
19951#define MkBuf2I16fast(buf) MkBuf2XXXfast(buf).I16
19952#define MkBuf2I32fast(buf) MkBuf2XXXfast(buf).I32
19953#define MkBuf2I64fast(buf) MkBuf2XXXfast(buf).I64
19954#define MkBuf2FLTfast(buf) MkBuf2XXXfast(buf).FLT
19955#define MkBuf2DBLfast(buf) MkBuf2XXXfast(buf).DBL
19957
19964#define MkBuf2XXX(xxx,len,buf) ({MK_##xxx __tmp; memcpy(&__tmp,buf->storage.first.B,len); __tmp;})
19965
19966#define MkBuf2BOL(buf) MkBuf2XXX(BOL,1,buf)
19967#define MkBuf2I8(buf) MkBuf2XXX(I8,1,buf)
19968#define MkBuf2I16(buf) MkBuf2XXX(I16,2,buf)
19969#define MkBuf2I32(buf) MkBuf2XXX(I32,4,buf)
19970#define MkBuf2I64(buf) MkBuf2XXX(I64,8,buf)
19971#define MkBuf2FLT(buf) MkBuf2XXX(FLT,4,buf)
19972#define MkBuf2DBL(buf) MkBuf2XXX(DBL,8,buf)
19973
19974#define MkBuf2Ptr(len,ptr,buf) memcpy((void*)ptr,buf->storage.first.B,len)
19975#define MkBuf2BOL_P(ptr,buf) MkBuf2Ptr(1,ptr,buf)
19976#define MkBuf2I8_P(ptr,buf) MkBuf2Ptr(1,ptr,buf)
19977#define MkBuf2I16_P(ptr,buf) MkBuf2Ptr(2,ptr,buf)
19978#define MkBuf2I32_P(ptr,buf) MkBuf2Ptr(4,ptr,buf)
19979#define MkBuf2I64_P(ptr,buf) MkBuf2Ptr(8,ptr,buf)
19980#define MkBuf2FLT_P(ptr,buf) MkBuf2Ptr(4,ptr,buf)
19981#define MkBuf2DBL_P(ptr,buf) MkBuf2Ptr(8,ptr,buf)
19982
19983#define MkBuf2Ptr_A(l,a,b) memcpy(a.B##l,b->storage.first.B,l)
19984#define MkBuf2BOL_A(ato,buf) MkBuf2Ptr_A(1,ato,buf)
19985#define MkBuf2I8_A(ato,buf) MkBuf2Ptr_A(1,ato,buf)
19986#define MkBuf2I16_A(ato,buf) MkBuf2Ptr_A(2,ato,buf)
19987#define MkBuf2I32_A(ato,buf) MkBuf2Ptr_A(4,ato,buf)
19988#define MkBuf2I64_A(ato,buf) MkBuf2Ptr_A(8,ato,buf)
19989#define MkBuf2FLT_A(ato,buf) MkBuf2Ptr_A(4,ato,buf)
19990#define MkBuf2DBL_A(ato,buf) MkBuf2Ptr_A(8,ato,buf)
19991
19993
19994
19995#endif
19996
19998
20012
20016 MK_STRN const str,
20017 MK_NUM const length,
20018 MK_BOL *val_out
20020
20021#define MkString2O(s,l,r) MkString2BOL_RT(MK_RT_CALL s,l,r)
20022
20025 MK_STRN const str,
20026 MK_NUM const length,
20027 MK_I8 *val_out
20029
20030#define MkString2Y(s,l,r) MkString2I8_RT(MK_RT_CALL s,l,r)
20031
20034 MK_STRN const str,
20035 MK_NUM const length,
20036 MK_I16 *val_out
20038
20039#define MkString2S(s,l,r) MkString2I16_RT(MK_RT_CALL s,l,r)
20040
20043 MK_STRN const str,
20044 MK_NUM const length,
20045 MK_U16 *val_out
20047
20048#define MkString2US(s,l,r) MkString2U16_RT(MK_RT_CALL s,l,r)
20049
20052 MK_STRN const str,
20053 MK_NUM const length,
20054 MK_I32 *val_out
20056
20057#define MkString2I(s,l,r) MkString2I32_RT(MK_RT_CALL s,l,r)
20058
20061 MK_STRN const str,
20062 MK_NUM const length,
20063 MK_U32 *val_out
20065
20066#define MkString2UI(s,l,r) MkString2U32_RT(MK_RT_CALL s,l,r)
20067
20070 MK_STRN const str,
20071 MK_NUM const length,
20072 MK_I64 *val_out
20074
20075#define MkString2W(s,l,r) MkString2I64_RT(MK_RT_CALL s,l,r)
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20090 MK_STRN const str,
20091 MK_NUM const length,
20092 MK_FLT *val_out
20094
20095#define MkString2F(s,l,r) MkString2FLT_RT(MK_RT_CALL s,l,r)
20096
20099 MK_STRN const str,
20100 MK_NUM const length,
20101 MK_DBL *val_out
20103
20104#define MkString2D(s,l,r) MkString2DBL_RT(MK_RT_CALL s,l,r)
20105
20108 MK_STRN const str,
20109 MK_NUM const length,
20110 MK_LONG *val_out
20112
20115 MK_STRN const str,
20116 MK_NUM const length,
20117 MK_BOOL *val_out
20119
20123 MK_STRN const str,
20124 MK_NUM const length,
20125 enum MkTypeE type,
20126 MK_ATO *val_out
20128
20131 MK_STRN const str,
20132 MK_NUM const length,
20133 MK_HDL *val_out
20135
20137
20139
20141
20142
20143
20144
20149
20151
20164
20168 MK_TYP type
__parser__(internal,
default=NULL),
20171
20172
20179
20186
20193
20208
20209#define MkBufferCreateTLS_T(cls,name,size) \
20210 static MkThreadLocal cls##R name##R = {0}; \
20211 MK_BUF name = MkBUF(&name##R); \
20212 if (unlikely(!__MkCheckX(cls,&name##R))) { \
20213 MkBufferInit(name,cls##_TT,size); \
20214 MkRefIncr_1X(name); \
20215 } else if (MkBUF_R(&name##R).var.cursize) { \
20216 MkBufferReset(name); \
20217 }
20218
20219
20228
20229#define MkBufferCreateTLS_inout_T(cls,name,inout) \
20230 static MkThreadLocal struct MkBufferS __hidden_##name##R = {0}; \
20231 MK_BUF name = *inout != NULL ? *inout : &__hidden_##name##R; \
20232 if (likely(!__MkCheckX(MkBufferC,name))) { \
20233 MkBufferInit(name,cls##_TT,0); \
20234 MkRefIncr_1X(name); \
20235 } else if (name->var.cursize) { \
20236 MkBufferReset(name); \
20237 } \
20238
20239
20255
20256#define MkBufferCreateLOCAL_T(cls,name,size) \
20257 cls##R name##R = {0}; \
20258 struct MkBufferS * const name = MkBUF(&name##R); \
20259 MkBufferInit(name,cls##_TT,size)
20260
20261
20273 MK_I8 const val
20275
20281 MK_BOL const val
20283
20289 MK_I16 const val
20291
20297 MK_I32 const val
20299
20305 MK_FLT const val
20307
20313 MK_I64 const val
20315
20321 MK_DBL const val
20323
20329 MK_STRN const val
20331
20337 MkBinaryR const val
20339
20355 MK_STRN const tlsName ,
20358
20364 MK_BUFN const val
20366
20390 MK_BUF const buf
20392
20397
20401 MK_BUF const buf,
20402 MK_TYP type
__parser__(internal,default=NULL),
20405
20406
20415 MK_BUF const buf
20417
20430 MK_BUFN const buf
20432
20451 MK_BUF const buf
20453
20455
20457
20458
20459
20460
20465
20467
20481 MK_BUFN const buf,
20482 MK_I8 * const val_out
20484
20489 MK_BUFN const buf,
20490 MK_BOL * const val_out
20492
20497 MK_BUFN const buf,
20498 MK_I16 * const val_out
20500
20506 MK_BUFN const buf,
20507 MK_U16 * const val_out
20509
20514 MK_BUFN const buf,
20515 MK_I32 * const val_out
20517
20523 MK_BUFN const buf,
20524 MK_U32 * const val_out
20526
20531 MK_BUFN const buf,
20532 MK_FLT * const val_out
20534
20539 MK_BUFN const buf,
20540 MK_I64 * const val_out
20542
20543
20546__parser__(internal)
20547MK_EXTERN enum MkErrorE MK_DECL MkBufferGetLL_RT (
20548 MK_PARSER_RT
20549 MK_BUFN const buf,
20550 MK_LLG * const val_out
20551) MK_ATTR_RT_INSTANCE;
20552
20553#define MkBufferGetLLG(b,o) MkBufferGetLL(b,o)
20554*/
20555
20560 MK_BUFN const buf,
20561 MK_DBL * const val_out
20563
20570 MK_BUFN const buf,
20571 MkBinaryR * const val_out
20573
20577
20580 MK_BUFN const buf,
20581 MK_STRN * const val_out
20583
20584
20591 MK_BUFN const buf,
20592 MkStringR * const val_out
20594
20600 MK_BUF const buf,
20601 MK_BUF * const val_out
20603
20616 MK_BUFN const buf,
20617 MK_BFL * const val_inout
20619
20625 MK_BUFN const buf,
20626 MK_LONG * const val_out
20628
20634 MK_BUFN const buf,
20635 MK_BOOL * const val_out
20637
20639
20640
20641
20642
20643
20648
20650
20662 MK_BUF const buf,
20663 MK_I8 const val
20665
20670 MK_BUF const buf,
20671 MK_BOL const val
20673
20678 MK_BUF const buf,
20679 MK_I16 const val
20681
20686 MK_BUF const buf,
20687 MK_I32 const val
20689
20694 MK_BUF const buf,
20695 MK_FLT const val
20697
20702 MK_BUF const buf,
20703 MK_I64 const val
20705
20710 MK_BUF const buf,
20711 MK_DBL const val
20713
20718 MK_BUF const buf,
20719 MK_STRN const val
20721
20726 MK_BUF const buf,
20727 MkBinaryR const val
20729
20734 MK_BUF const buf,
20735 MK_BUFN const val
20737
20744 MK_BUF const buf,
20745 MK_FST const val,
20746 va_list var_list
20748
20754 MK_BUF const buf,
20755 MK_FST const val,
20756 ...
20758
20763 MK_BUF const buf,
20764 MkBinaryR const val
20766
20771 MK_BUF const buf,
20772 MkStringR const val
20774
20776
20777
20778
20779
20784
20786
20793 MK_BUFN const buf
20795
20801 MK_BUFN const buf
20803
20809 MK_BUFN const buf
20811
20819 MK_BUFN const buf
20821
20835 MK_BUFN const buf ,
20838 MK_STRN const callfunc
__parser__(default=F
#FUNC),
20841
20852 MK_BUFN const buf,
20853 MK_STRN
const varname
__parser__(
default=S#
"buf"),
20855 MK_STRN
const callfunc
__parser__(
default=F#FUNC)
20857
20867 MK_BUFN const buf,
20868 MK_STRN
const varname
__parser__(
default=S#
"buf"),
20870 MK_STRN
const callfunc
__parser__(
default=F#FUNC)
20872
20873#define MkBufferLogS_2V(buf,fmt) MkBufferLogS_3(buf,#fmt,MkOBJ(fmt))
20874
20876
20878
20879
20880
20881
20882
20887
20900 MK_BUFN const buf1,
20901 MK_BUFN const buf2
20903
20913 MK_BUF const buf,
20914 enum MkTypeE const typ
20916
20922 MK_BUFN const inst
20924
20935 MK_BUF const buf,
20936 MK_NUM const size
20938
20948 MK_BUF const buf,
20949 MK_NUM const size
20951
20959 MK_BUF const buf
20961
20971 MK_BUF const buf
20973
20983 MK_BUF const buf,
20984 MK_BUFN const srce
20986
21002 MK_BUFN const buf
21004
21006
21007
21008
21009
21010
21015
21017
21029 MK_BUF const buf,
21030 MK_STRN const val
21032
21044 MK_BUF const buf,
21045 MkStringR const val
21047
21057 MK_BUF const buf,
21058 MK_FST const printfmt,
21059 va_list var_list
21061
21070 MK_BUF const buf,
21071 MK_FST const printfmt,
21072 ...
21074
21084 MK_BUF const buf,
21085 MK_STRN const val
21087
21097 MK_BUF const buf,
21098 MK_STRN const val
21100
21102__parser__(template-required,no-rpc,keep,no-static)
21105 MK_BUF const buf,
21106 MK_NAT_OBJECT * obj_out
21108
21110
21112
21113
21114
21115
21116
21117
21118
21119
21135
21154
21155struct MkBufferStreamSaveS;
21156
21158#define MkBufferStreamS_ils_size (0)
21159
21187
21188struct MkBufferStreamS {
21189
21190
21191 union {
21192 struct MkObjectS obj;
21193 struct MkBufferS buf;
21194 } super;
21195
21196
21197
21198
21199 struct {
21202
21203
21204
21205
21206
21207
21208
21209
21210
21211 bool endian_is_wrong;
21212 } var;
21213 struct {
21219 union MkBufferU cur;
21220 } storage;
21221
21222
21223
21224 struct MkBuffer64S busRef;
21225
21226 struct MkCacheS saveCache;
21227 struct MkBufferStreamSaveS * busWriteSave;
21228 struct MkBufferStreamSaveS * busReadSave;
21229
21231};
21232
21233
21234
21235
21240
21241
21244
21245 #define MkBufferStreamC_SIGNATURE (MkBufferC_SIGNATURE ^ (4u<<6))
21246 #define MkBufferStreamC_MASK (((1u<<26)-1)<<6)
21247
21249
21250
21253
21254 #define MkBufferStreamC_X2bus(x) (x)
21255 #define MkBufferStreamC_X2buf(x) MkBUF(x)
21256 #define MkBufferStreamC_X2obj(x) MkOBJ(x)
21257
21259
21260
21263
21269 #define MkBufferStreamC_T (&MK_RT_REF._MkBufferStreamC_T)
21271 #define MkBufferStreamC_TT (MkTYP(MkBufferStreamC_T))
21273 #define MkBufferStreamST MkBufferStreamC_T
21275 #define MkBufferStreamSTT (MkTYP(MkBufferStreamST))
21277 #define MkBufferStreamC_type MK_BUS
21279 #define MkBufferStreamCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
21281 #define MkBufferStreamCTT_X(instance) (MkOBJ_R(instance).type)
21283 #define MkBufferStreamCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
21285 #define MkBufferStreamC_NS MK
21287 #define MkBufferStreamCTT MkBufferStreamCTT
21289 #define MkBufferStreamCT ( (struct MkTypeDefS *) MkBufferStreamCTT )
21290
21292
21293
21296
21297 #pragma GCC diagnostic push
21298 #pragma GCC diagnostic ignored "-Wattributes"
21299
21302 __parser__(
class=MkBufferStreamC,
static,hide)
21306 }
21307
21310 __parser__(
class=MkBufferStreamC,
static,hide)
21314 }
21315
21316 #pragma GCC diagnostic pop
21317 #define MkBufferStreamC_Check(mng) MkBusCheck(mng)
21318
21320
21321
21324
21326 __parser__(
class=MkBufferStreamC,hide,
static)
21327 META_ATTRIBUTE_SANITIZE
21330 return (
MkBusCheck(mng) ? (MK_BUS)mng : NULL);
21331 }
21332
21334 __parser__(
class=MkBufferStreamC,hide,
static)
21335 META_ATTRIBUTE_SANITIZE
21337 mk_inline MK_BUSN MkBusN(MK_MNGN mng) {
21338 return (
MkBusCheck(mng) ? (MK_BUSN)mng : NULL);
21339 }
21340
21342 #define MkBusRaise(_bus) if (!_MkCheckX(MkBufferStreamC,_bus)) { \
21343 MkErrorSetC_1E("'MkBufferStreamC' hdl is NULL"); \
21344 goto error ; \
21345 }
21346
21348 #define MkBUS_R(x) (*(x)).super.bus
21350 #define MkBUS(x) (&MkBUS_R(x))
21351
21353
21356
21357
21358
21359
21360
21361
21362
21365
21368
21369__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MkBufferStreamC);
21370
21391) {
21393}
21394
21405mk_inline MK_BUS MkBufferStreamHandleResolve_RT (
21407 MK_HDL const netHdl
21408) {
21410}
21411
21421#define MkBufferStreamHandleResolve_e(netHdl) ({ \
21422 MK_HDL tmpHdl=netHdl; \
21423 MK_BUS tmp; \
21424 if (tmpHdl==0) { \
21425 tmp=NULL; \
21426 } else { \
21427 tmp=MkBufferStreamHandleResolve(tmpHdl); \
21428 if (tmp==NULL) { \
21429 MkErrorSetC_1_NULL("ERROR: 'MkBufferStreamC' handle is 'NULL'"); \
21430 goto error; \
21431 }; \
21432 }; \
21433 tmp; \
21434})
21435
21437
21439
21440
21444 __parser__(flags=
new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,
class=MkBufferStreamC,null-
return-allow)
21448 }
21450
21451
21453
21454
21455
21456
21457
21458
21464
21466#define MkBufferStream64_ils_size (64)
21467
21472struct MkBufferStream64S {
21473
21474
21475 union {
21476 struct MkObjectS obj;
21477 struct MkBufferS buf;
21478 struct MkBufferStreamS bus;
21479 } super;
21480
21481
21482
21483
21485};
21486
21487
21488
21493
21494
21497
21498 #define MkBufferStream64C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (3u<<3))
21499 #define MkBufferStream64C_MASK (((1u<<29)-1)<<3)
21500
21502
21503
21506
21507 #define MkBufferStream64C_X2bus(x) MkBUS(x)
21508 #define MkBufferStream64C_X2buf(x) MkBUF(x)
21509 #define MkBufferStream64C_X2obj(x) MkOBJ(x)
21510
21512
21513
21516
21522 #define MkBufferStream64C_T (&MK_RT_REF._MkBufferStream64C_T)
21524 #define MkBufferStream64C_TT (MkTYP(MkBufferStream64C_T))
21526 #define MkBufferStream64ST MkBufferStream64C_T
21528 #define MkBufferStream64STT (MkTYP(MkBufferStream64ST))
21530 #define MkBufferStream64CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
21532 #define MkBufferStream64CTT_X(instance) (MkOBJ_R(instance).type)
21534 #define MkBufferStream64CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
21536 #define MkBufferStream64C_NS MK
21538 #define MkBufferStream64CTT MkBufferStream64CTT
21540 #define MkBufferStream64CT ( (struct MkTypeDefS *) MkBufferStream64CTT )
21541
21543
21546
21547
21548
21549
21551
21552
21553
21559
21561#define MkBufferStream256S_ils_size (256)
21562
21567struct MkBufferStream256S {
21568
21569
21570 union {
21571 struct MkObjectS obj;
21572 struct MkBufferS buf;
21573 struct MkBufferStreamS bus;
21574 } super;
21575
21576
21577
21578
21580};
21581
21582
21583
21588
21589
21592
21593 #define MkBufferStream256C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (2u<<3))
21594 #define MkBufferStream256C_MASK (((1u<<29)-1)<<3)
21595
21597
21598
21601
21602 #define MkBufferStream256C_X2bus(x) MkBUS(x)
21603 #define MkBufferStream256C_X2buf(x) MkBUF(x)
21604 #define MkBufferStream256C_X2obj(x) MkOBJ(x)
21605
21607
21608
21611
21617 #define MkBufferStream256C_T (&MK_RT_REF._MkBufferStream256C_T)
21619 #define MkBufferStream256C_TT (MkTYP(MkBufferStream256C_T))
21621 #define MkBufferStream256ST MkBufferStream256C_T
21623 #define MkBufferStream256STT (MkTYP(MkBufferStream256ST))
21625 #define MkBufferStream256CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
21627 #define MkBufferStream256CTT_X(instance) (MkOBJ_R(instance).type)
21629 #define MkBufferStream256CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
21631 #define MkBufferStream256C_NS MK
21633 #define MkBufferStream256CTT MkBufferStream256CTT
21635 #define MkBufferStream256CT ( (struct MkTypeDefS *) MkBufferStream256CTT )
21636
21638
21641
21642
21643
21644
21646
21647
21648
21654
21656#define MkBufferStream1024_ils_size (1024)
21657
21662struct MkBufferStream1024S {
21663
21664
21665 union {
21666 struct MkObjectS obj;
21667 struct MkBufferS buf;
21668 struct MkBufferStreamS bus;
21669 } super;
21670
21671
21672
21673
21675};
21676
21677
21678
21683
21684
21687
21688 #define MkBufferStream1024C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (4u<<3))
21689 #define MkBufferStream1024C_MASK (((1u<<29)-1)<<3)
21690
21692
21693
21696
21697 #define MkBufferStream1024C_X2bus(x) MkBUS(x)
21698 #define MkBufferStream1024C_X2buf(x) MkBUF(x)
21699 #define MkBufferStream1024C_X2obj(x) MkOBJ(x)
21700
21702
21703
21706
21712 #define MkBufferStream1024C_T (&MK_RT_REF._MkBufferStream1024C_T)
21714 #define MkBufferStream1024C_TT (MkTYP(MkBufferStream1024C_T))
21716 #define MkBufferStream1024ST MkBufferStream1024C_T
21718 #define MkBufferStream1024STT (MkTYP(MkBufferStream1024ST))
21720 #define MkBufferStream1024CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
21722 #define MkBufferStream1024CTT_X(instance) (MkOBJ_R(instance).type)
21724 #define MkBufferStream1024CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
21726 #define MkBufferStream1024C_NS MK
21728 #define MkBufferStream1024CTT MkBufferStream1024CTT
21730 #define MkBufferStream1024CT ( (struct MkTypeDefS *) MkBufferStream1024CTT )
21731
21733
21736
21737
21738
21739
21741
21742
21743
21749
21751#define MkBufferStream16384S_ils_size (16384)
21752
21757struct MkBufferStream16384S {
21758
21759
21760 union {
21761 struct MkObjectS obj;
21762 struct MkBufferS buf;
21763 struct MkBufferStreamS bus;
21764 } super;
21765
21766
21767
21768
21770};
21771
21772
21773
21778
21779
21782
21783 #define MkBufferStream16384C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (1u<<3))
21784 #define MkBufferStream16384C_MASK (((1u<<29)-1)<<3)
21785
21787
21788
21791
21792 #define MkBufferStream16384C_X2bus(x) MkBUS(x)
21793 #define MkBufferStream16384C_X2buf(x) MkBUF(x)
21794 #define MkBufferStream16384C_X2obj(x) MkOBJ(x)
21795
21797
21798
21801
21807 #define MkBufferStream16384C_T (&MK_RT_REF._MkBufferStream16384C_T)
21809 #define MkBufferStream16384C_TT (MkTYP(MkBufferStream16384C_T))
21811 #define MkBufferStream16384ST MkBufferStream16384C_T
21813 #define MkBufferStream16384STT (MkTYP(MkBufferStream16384ST))
21815 #define MkBufferStream16384CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
21817 #define MkBufferStream16384CTT_X(instance) (MkOBJ_R(instance).type)
21819 #define MkBufferStream16384CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
21821 #define MkBufferStream16384C_NS MK
21823 #define MkBufferStream16384CTT MkBufferStream16384CTT
21825 #define MkBufferStream16384CT ( (struct MkTypeDefS *) MkBufferStream16384CTT )
21826
21828
21831
21832
21833
21834
21838
21840
21841
21842
21843
21844
21845
21846
21854
21866 MK_TYP type
__parser__(internal,
default=NULL),
21869
21870#define MkBufferStreamCreate_1(size) MkBufferStreamCreate(NULL,size)
21871
21878
21885
21892
21899
21916 MK_STRN const tlsName ,
21919
21931
21932#define MkBufferStreamCreateLOCAL_T(cls,name,size) \
21933 cls##R name##R = {0}; \
21934 struct MkBufferStreamS * const name = cls##_X2bus(&name##R); \
21935 MkBufferStreamInit(name,cls##_TT,size)
21936
21937
21947
21948#define MkBufferStreamCreateSTATIC_T(cls,name) \
21949 static cls##R name##R = {0}; \
21950 struct MkBufferStreamS * const name = cls##_X2bus(&name##R); \
21951 if (__MkCheckX(cls,&name##R)) { \
21952 MkBufferStreamReset(name); \
21953 } else { \
21954 MkBufferStreamInit(name,cls##TT,0); \
21955 } \
21956
21957
21967
21968#define MkBufferStreamCreateTLS_T(cls,name) \
21969 static MkThreadLocal cls##R name##R = {0}; \
21970 struct MkBufferStreamS * const name = cls##_X2bus(&name##R); \
21971 if (__MkCheckX(cls,&name##R)) { \
21972 MkBufferStreamReset(name); \
21973 } else { \
21974 MkBufferStreamInit(name,cls##_TT,0); \
21975 } \
21976
21977
22011 MK_BUS const bus
22013
22020 MK_BUS const bus,
22021 MK_TYP type
__parser__(internal,
default=NULL),
22024
22033 MK_BUS const bus
22035
22054 MK_BUS const bus
22056
22067 MK_BUSN const src
22069
22071
22073
22074
22075
22076
22077
22078
22079
22080
22086
22088
22098 MK_BUS const bus,
22099 MK_BUSN const src
22101
22110 MK_BUS const bus
22112
22123 MK_BUS const bus
22125
22129 MK_BUS const bus ,
22131 MK_STRN const callfunc
__parser__(default=F
#FUNC)
22133
22142
22146 MK_BUS const bus ,
22149 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
22152
22153#define MkBufferStreamLog_5F(bus,fmt,...) MkBufferStreamLog(bus,MkObj(fmt),__VA_ARGS__)
22154#define MkBufferStreamLog_2F(bus,fmt) MkBufferStreamLog_5F(bus,fmt,0,__func__,0)
22155#define MkBufferStreamLog_3F(bus,fmt,pfx) MkBufferStreamLog_5F(bus,fmt,0,pfx,0)
22156
22157
22161 MK_BUS const bus
22163
22168 MK_BUSN const inst
22170
22179 MK_BUSN const bus
22181
22183
22185
22186
22187
22188
22189
22190
22191
22192
22204
22216 MK_BUS const bus,
22217 MK_I8 const val
22219
22224 MK_BUS const bus,
22225 MK_BOL const val
22227
22232 MK_BUS const bus,
22233 MK_I32 const val
22235
22240 MK_BUS const bus,
22241 MK_FLT const val
22243
22248 MK_BUS const bus,
22249 MK_I64 const val
22251
22256 MK_BUS const bus,
22257 MK_DBL const val
22259
22265 MK_BUS const bus,
22266 MK_STRN const val,
22269
22274 MK_BUS const bus,
22275 MkBinaryR const val
22277
22282 MK_BUS const bus,
22283 MK_BUFN const val
22285
22291 MK_BUS const bus,
22292 MK_I32 const val
22294
22308 MK_BUS const bus,
22309 MK_LONG const val
22311
22315 MK_BUS const bus,
22316 MK_STRN const fmt,
22317 va_list ap
22319
22323 MK_BUS const bus,
22324 MK_STRN const fmt,
22325 ...
22327
22344 MK_BUS const bus,
22345 MK_BFLN const bfl
22347
22368 MK_BUS const bus,
22369 MK_BFL const bfl
22371
22375 MK_BUS const bus
22377
22381 MK_BUS const bus
22383
22395 MK_BUS const bus,
22396 MK_BUSN const add
22398
22400
22402
22403
22404
22405
22406
22407
22408
22409
22420
22429 MK_BUS const bus,
22432
22436 MK_BUS const bus
22438
22449 MK_BUS const bus,
22450 MK_BFL * const val_inout
22452
22474 MK_BUS const bus,
22475 MK_BFL * const val_out
22477
22481 MK_BUS const bus,
22482 MK_NAT_LIST * const val_out
22484
22488 MK_BUS const bus,
22489 MK_NAT_OBJECT * const val_out
22491
22505 MK_BUS const bus,
22506 MK_LONG * const val_out
22508
22509
22510
22526 MK_BUS const bus,
22527 MK_I8 * const val_out
22529
22534 MK_BUS const bus,
22535 MK_BOL * const val_out
22537
22542 MK_BUS const bus,
22543 MK_I32 * const val_out
22545
22550 MK_BUS const bus,
22551 MK_FLT * const val_out
22553
22558 MK_BUS const bus,
22559 MK_I64 * const val_out
22561
22566 MK_BUS const bus,
22567 MK_DBL * const val_out
22569
22574 MK_BUS const bus,
22575 MK_STRN * const val_out
22577
22584 MK_BUS const bus,
22585 MkBinaryR * const val_out
22587
22592 MK_BUS const bus,
22593 MK_BUF*const val_out
22595
22603 MK_BUSN const bus
22605
22613 MK_BUSN const bus
22615
22623 MK_BUSN const bus
22625
22636 MK_BUS const bus
22638
22640
22642
22643
22645
22646
22647
22648
22649
22650
22651
22652
22654#include "MkBufferListC_def_mk.h"
22656
22657
22658
22659
22660
22661
22662
22683
22684#define MkDbgLogData(d) \
22685 MkDbgV_2O(MK_ERROR_FORMAT,MK_COLOR_LIGHT_CYAN "FROM=%s -> TO=%s [%d]" MK_COLOR_RESET "\n", \
22686 MK_RT_REF.log.logNAME, (d), MK_RT_REF.log.logREF);
22687
22691
22692 #if defined(__cplusplus)
22693 #define MkLogDataEA(e) MkLogDataS::e
22694 #else
22695 #define MkLogDataEA(e) e
22696 #endif
22697
22698 enum MkLogDataE {
22699 MkLogDataE_UNDEF,
22700 MkLogDataE_STDERR,
22701 MkLogDataE_STDOUT,
22702 MkLogDataE_BUFFER,
22703 MkLogDataE_FILE
22704 } logWHAT;
22706 FILE *logFILE;
22708 #define MkLogDataS_LogNAME_size 256
22711 bool logLOCK;
22713 char *logBUF;
22715 size_t logSIZE;
22717 int logREF;
22719
22721struct MkLogFileS {
22722
22723
22724 union {
22725 struct MkObjectS obj;
22726 } super;
22727
22728
22729
22730
22732};
22733
22734
22735
22740
22741
22744
22745 #define MkLogFileC_SIGNATURE (MkObjectC_SIGNATURE ^ (3u<<10))
22746 #define MkLogFileC_MASK (((1u<<22)-1)<<10)
22747
22749
22750
22753
22754 #define MkLogFileC_X2lfl(x) (x)
22755 #define MkLogFileC_X2obj(x) MkOBJ(x)
22756
22758
22759
22762
22768 #define MkLogFileC_T (&MK_RT_REF._MkLogFileC_T)
22770 #define MkLogFileC_TT (MkTYP(MkLogFileC_T))
22772 #define MkLogFileST MkLogFileC_T
22774 #define MkLogFileSTT (MkTYP(MkLogFileST))
22776 #define MkLogFileC_type MK_LFL
22778 #define MkLogFileCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
22780 #define MkLogFileCTT_X(instance) (MkOBJ_R(instance).type)
22782 #define MkLogFileCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
22784 #define MkLogFileC_NS MK
22786 #define MkLogFileCTT MkLogFileCTT
22788 #define MkLogFileCT ( (struct MkTypeDefS *) MkLogFileCTT )
22789
22791
22792
22795
22796 #pragma GCC diagnostic push
22797 #pragma GCC diagnostic ignored "-Wattributes"
22798
22805 }
22806
22813 }
22814
22815 #pragma GCC diagnostic pop
22816 #define MkLogFileC_Check(mng) MkLflCheck(mng)
22817
22819
22820
22823
22826 META_ATTRIBUTE_SANITIZE
22829 return (
MkLflCheck(mng) ? (MK_LFL)mng : NULL);
22830 }
22831
22834 META_ATTRIBUTE_SANITIZE
22836 mk_inline MK_LFLN MkLflN(MK_MNGN mng) {
22837 return (
MkLflCheck(mng) ? (MK_LFLN)mng : NULL);
22838 }
22839
22841 #define MkLflRaise(_lfl) if (!_MkCheckX(MkLogFileC,_lfl)) { \
22842 MkErrorSetC_1E("'MkLogFileC' hdl is NULL"); \
22843 goto error ; \
22844 }
22845
22847 #define MkLFL_R(x) (*(x)).super.lfl
22849 #define MkLFL(x) (&MkLFL_R(x))
22850
22852
22855
22856
22857
22858
22859
22860
22861
22864
22867
22868__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MkLogFileC);
22869
22890) {
22892}
22893
22904mk_inline MK_LFL MkLogFileHandleResolve_RT (
22906 MK_HDL const netHdl
22907) {
22909}
22910
22920#define MkLogFileHandleResolve_e(netHdl) ({ \
22921 MK_HDL tmpHdl=netHdl; \
22922 MK_LFL tmp; \
22923 if (tmpHdl==0) { \
22924 tmp=NULL; \
22925 } else { \
22926 tmp=MkLogFileHandleResolve(tmpHdl); \
22927 if (tmp==NULL) { \
22928 MkErrorSetC_1_NULL("ERROR: 'MkLogFileC' handle is 'NULL'"); \
22929 goto error; \
22930 }; \
22931 }; \
22932 tmp; \
22933})
22934
22936
22938
22939
22943 __parser__(flags=
new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,
class=MkLogFileC,null-
return-allow)
22947 }
22949
22950
22952
22953
22954
22955
22956
22957
22963
22965
22981 MK_STRN const file,
22982 MK_LFL * lfh_out
22984
22993 MK_LFL lfh
22995
22997
22999
23000
23001
23002
23007
23009
23021 MK_FST printfmt,
23022 va_list var_list
23024
23035 MK_FST printfmt,
23036 ...
23038
23047MkLogFileWriteC_RT (
23050 MK_STRN text
23052
23060MkLogFileGetFile_RT (
23062 MK_LFLN lfl,
23063 MK_STRN *file_out
23065
23067
23069
23070
23072
23073
23074
23075
23076
23077
23078
23079
23087
23088#define MkDbgMkExt2(c,x) mk_dbg_color_ln(c,"MkExtensionS: ptr<%p>, next<%p>, prev<%p>", (x), (x)->next, (x)->prev)
23089#define MkDbgMkExt(x) MkDbgMkExt2(MK_COLOR_CYAN,x)
23090
23092
23096
23097
23098 union {
23099 struct MkObjectS obj;
23100 } super;
23101
23102
23103
23104
23107
23108
23109
23114
23115
23118
23119 #define MkExtensionC_SIGNATURE (MkObjectC_SIGNATURE ^ (9u<<10))
23120 #define MkExtensionC_MASK (((1u<<22)-1)<<10)
23121
23123
23124
23127
23128 #define MkExtensionC_X2ext(x) (x)
23129 #define MkExtensionC_X2obj(x) MkOBJ(x)
23130
23132
23133
23136
23142 #define MkExtensionC_T (&MK_RT_REF._MkExtensionC_T)
23144 #define MkExtensionC_TT (MkTYP(MkExtensionC_T))
23146 #define MkExtensionST MkExtensionC_T
23148 #define MkExtensionSTT (MkTYP(MkExtensionST))
23150 #define MkExtensionC_type MK_EXT
23152 #define MkExtensionCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
23154 #define MkExtensionCTT_X(instance) (MkOBJ_R(instance).type)
23156 #define MkExtensionCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
23158 #define MkExtensionC_NS MK
23160 #define MkExtensionCTT MkExtensionCTT
23162 #define MkExtensionCT ( (struct MkTypeDefS *) MkExtensionCTT )
23163
23165
23166
23169
23170 #pragma GCC diagnostic push
23171 #pragma GCC diagnostic ignored "-Wattributes"
23172
23175 __parser__(
class=MkExtensionC,
static,ignore)
23179 }
23180
23183 __parser__(
class=MkExtensionC,
static,ignore)
23187 }
23188
23189 #pragma GCC diagnostic pop
23190 #define MkExtensionC_Check(mng) MkExtCheck(mng)
23191
23193
23194
23197
23199 __parser__(
class=MkExtensionC,ignore,
static)
23200 META_ATTRIBUTE_SANITIZE
23203 return (
MkExtCheck(mng) ? (MK_EXT)mng : NULL);
23204 }
23205
23207 __parser__(
class=MkExtensionC,ignore,
static)
23208 META_ATTRIBUTE_SANITIZE
23210 mk_inline MK_EXTN MkExtN(MK_MNGN mng) {
23211 return (
MkExtCheck(mng) ? (MK_EXTN)mng : NULL);
23212 }
23213
23215 #define MkExtRaise(_ext) if (!_MkCheckX(MkExtensionC,_ext)) { \
23216 MkErrorSetC_1E("'MkExtensionC' hdl is NULL"); \
23217 goto error ; \
23218 }
23219
23221 #define MkEXT_R(x) (*(x)).super.ext
23223 #define MkEXT(x) (&MkEXT_R(x))
23224
23226
23229
23230
23231
23232
23236#define MkExtension_size 64
23237
23241 MK_EXT head
23243
23248 MK_EXT head,
23249 MK_EXT add
23251
23256 MK_EXT head,
23257 MK_EXT del
23259
23260
23261
23262
23263
23264
23266
23268
23269
23270
23271
23272
23273
23274
23275
23303
23304#define MkDbgErr_2(err,col) \
23305 mk_dbg_color_ln(col,"MkDbgErr[%p]: check<%d>, mkrt<%s>, isLocal<%d>, format_of_error<%p>", \
23306 err, MkErrCheck(err), MkDbgRtChkX(err), MkOBJ(err)->obj_protect.isLocal, err->format_of_error)
23307#define MkDbgErr(err) MkDbgErr_2(err,MK_COLOR_WHITE)
23308
23309#if META_DEBUG & META_DEBUG_ERROR
23314 MK_STRN
const callfunc
__parser__(
default=F#FUNC)
23316#endif
23317
23321struct MkErrorS {
23322
23323
23324 union {
23325 struct MkObjectS obj;
23326 } super;
23327
23328
23329
23330
23332 struct MkBuffer1024S text;
23334 bool append;
23335 bool noRaise;
23336
23339
23341};
23342
23343
23344
23349
23350
23353
23354 #define MkErrorC_SIGNATURE (MkObjectC_SIGNATURE ^ (4u<<10))
23355 #define MkErrorC_MASK (((1u<<22)-1)<<10)
23356
23358
23359
23362
23363 #define MkErrorC_X2err(x) (x)
23364 #define MkErrorC_X2obj(x) MkOBJ(x)
23365
23367
23368
23371
23377 #define MkErrorC_T (&MK_RT_REF._MkErrorC_T)
23379 #define MkErrorC_TT (MkTYP(MkErrorC_T))
23381 #define MkErrorST MkErrorC_T
23383 #define MkErrorSTT (MkTYP(MkErrorST))
23385 #define MkErrorC_type MK_ERR
23387 #define MkErrorCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
23389 #define MkErrorCTT_X(instance) (MkOBJ_R(instance).type)
23391 #define MkErrorCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
23393 #define MkErrorC_NS MK
23395 #define MkErrorCTT MkErrorCTT
23397 #define MkErrorCT ( (struct MkTypeDefS *) MkErrorCTT )
23398
23400
23401
23404
23405 #pragma GCC diagnostic push
23406 #pragma GCC diagnostic ignored "-Wattributes"
23407
23414 }
23415
23422 }
23423
23424 #pragma GCC diagnostic pop
23425
23427
23428
23431
23434 META_ATTRIBUTE_SANITIZE
23437 return (
MkErrCheck(mng) ? (MK_ERR)mng : NULL);
23438 }
23439
23442 META_ATTRIBUTE_SANITIZE
23444 mk_inline MK_ERRN MkErrN(MK_MNGN mng) {
23445 return (
MkErrCheck(mng) ? (MK_ERRN)mng : NULL);
23446 }
23447
23449 #define MkErrRaise(_err) if (!_MkCheckX(MkErrorC,_err)) { \
23450 MkErrorSetC_1E("'MkErrorC' hdl is NULL"); \
23451 goto error ; \
23452 }
23453
23455 #define MkERR_R(x) (*(x)).super.err
23457 #define MkERR(x) (&MkERR_R(x))
23458
23460
23463
23464
23465
23466
23468
23469
23470
23471
23472
23475
23478
23479__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MkErrorC);
23480
23501) {
23503}
23504
23515mk_inline MK_ERR MkErrorHandleResolve_RT (
23517 MK_HDL const netHdl
23518) {
23520}
23521
23531#define MkErrorHandleResolve_e(netHdl) ({ \
23532 MK_HDL tmpHdl=netHdl; \
23533 MK_ERR tmp; \
23534 if (tmpHdl==0) { \
23535 tmp=NULL; \
23536 } else { \
23537 tmp=MkErrorHandleResolve(tmpHdl); \
23538 if (tmp==NULL) { \
23539 MkErrorSetC_1_NULL("ERROR: 'MkErrorC' handle is 'NULL'"); \
23540 goto error; \
23541 }; \
23542 }; \
23543 tmp; \
23544})
23545
23547
23549
23550
23554 __parser__(flags=
new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,
class=MkErrorC,null-
return-allow)
23558 }
23560
23561
23563
23564
23565
23566
23567
23568
23575
23576#define MK_ERREXT_ARGS MK_RT_ARGS MK_ERR const mkerr, MK_ERREXT const errext
23577#define MK_ERREXT_CALL MK_RT_CALL err, errext
23578
23579#define MK_ERREXT_ARGS_N MK_RT_ARGS MK_ERRN const mkerr, MK_ERREXT const errext
23580#define MK_ERREXT_CALL_N MK_RT_CALL err, errext
23581
23584
23587
23590
23595
23599
23602
23605
23608
23611
23614
23617struct MkErrExtS {
23618
23619
23620 union {
23621 struct MkObjectS obj;
23623 } super;
23624
23625
23626
23628
23631
23634
23637
23640
23643
23646
23649
23652
23655
23658};
23659
23660
23661
23666
23667
23670
23671 #define MkErrExtC_SIGNATURE (MkExtensionC_SIGNATURE ^ (1u<<6))
23672 #define MkErrExtC_MASK (((1u<<26)-1)<<6)
23673
23675
23676
23679
23680 #define MkErrExtC_X2errext(x) (x)
23681 #define MkErrExtC_X2ext(x) MkEXT(x)
23682 #define MkErrExtC_X2obj(x) MkOBJ(x)
23683
23685
23686
23689
23695 #define MkErrExtC_T (&MK_RT_REF._MkErrExtC_T)
23697 #define MkErrExtC_TT (MkTYP(MkErrExtC_T))
23699 #define MkErrExtST MkErrExtC_T
23701 #define MkErrExtSTT (MkTYP(MkErrExtST))
23703 #define MkErrExtC_type MK_ERREXT
23705 #define MkErrExtCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
23707 #define MkErrExtCTT_X(instance) (MkOBJ_R(instance).type)
23709 #define MkErrExtCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
23711 #define MkErrExtC_NS MK
23713 #define MkErrExtCTT MkErrExtCTT
23715 #define MkErrExtCT ( (struct MkTypeDefS *) MkErrExtCTT )
23716
23718
23719
23722
23723 #pragma GCC diagnostic push
23724 #pragma GCC diagnostic ignored "-Wattributes"
23725
23732 }
23733
23740 }
23741
23742 #pragma GCC diagnostic pop
23743 #define MkErrExtC_Check(mng) MkErrExtCheck(mng)
23744
23746
23747
23750
23753 META_ATTRIBUTE_SANITIZE
23755 mk_inline MK_ERREXT MkErrExt(MK_MNG mng) {
23757 }
23758
23761 META_ATTRIBUTE_SANITIZE
23763 mk_inline MK_ERREXTN MkErrExtN(MK_MNGN mng) {
23765 }
23766
23768 #define MkErrExtRaise(_errext) if (!_MkCheckX(MkErrExtC,_errext)) { \
23769 MkErrorSetC_1E("'MkErrExtC' hdl is NULL"); \
23770 goto error ; \
23771 }
23772
23774 #define MkERREXT_R(x) (*(x)).super.errext
23776 #define MkERREXT(x) (&MkERREXT_R(x))
23777
23779
23782
23783
23784
23785
23786#define MkErrExtAdd(_mkerrR,add) do { \
23787 (_mkerrR).mkErrExt = (typeof((_mkerrR).mkErrExt)) MkExtensionAdd(MkEXT((_mkerrR).mkErrExt),MkEXT(add)); \
23788 \
23789 MkERREXT_R(add).mkerrhead = &(_mkerrR); \
23790} while (0) \
23791
23792#define MkErrExtDel(_mkerrR,del) do { \
23793 \
23794 (_mkerrR).mkErrExt = (typeof((_mkerrR).mkErrExt)) MkExtensionDel(MkEXT((_mkerrR).mkErrExt),MkEXT(del)); \
23795 MkERREXT_R(del).mkerrhead = NULL; \
23796} while (0) \
23797
23799
23800
23801
23802
23810
23813struct MkErrorPanicS {
23814
23815
23816 union {
23817 struct MkObjectS obj;
23818 } super;
23819
23820
23821};
23822
23823
23824
23829
23830
23833
23834 #define MkErrorPanicC_SIGNATURE (MkObjectC_SIGNATURE ^ (7u<<10))
23835 #define MkErrorPanicC_MASK (((1u<<22)-1)<<10)
23836
23838
23839
23842
23843 #define MkErrorPanicC_X2obj(x) MkOBJ(x)
23844
23846
23847
23850
23856 #define MkErrorPanicC_T (&MK_RT_REF._MkErrorPanicC_T)
23858 #define MkErrorPanicC_TT (MkTYP(MkErrorPanicC_T))
23860 #define MkErrorPanicST MkErrorPanicC_T
23862 #define MkErrorPanicSTT (MkTYP(MkErrorPanicST))
23864 #define MkErrorPanicCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
23866 #define MkErrorPanicCTT_X(instance) (MkOBJ_R(instance).type)
23868 #define MkErrorPanicCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
23870 #define MkErrorPanicC_NS MK
23872 #define MkErrorPanicCTT MkErrorPanicCTT
23874 #define MkErrorPanicCT ( (struct MkTypeDefS *) MkErrorPanicCTT )
23875
23877
23880
23881
23882
23883
23885
23886
23887
23888
23896
23899struct MkErrorExitS {
23900
23901
23902 union {
23903 struct MkObjectS obj;
23904 } super;
23905
23906
23907};
23908
23909
23910
23915
23916
23919
23920 #define MkErrorExitC_SIGNATURE (MkObjectC_SIGNATURE ^ (8u<<10))
23921 #define MkErrorExitC_MASK (((1u<<22)-1)<<10)
23922
23924
23925
23928
23929 #define MkErrorExitC_X2obj(x) MkOBJ(x)
23930
23932
23933
23936
23942 #define MkErrorExitC_T (&MK_RT_REF._MkErrorExitC_T)
23944 #define MkErrorExitC_TT (MkTYP(MkErrorExitC_T))
23946 #define MkErrorExitST MkErrorExitC_T
23948 #define MkErrorExitSTT (MkTYP(MkErrorExitST))
23950 #define MkErrorExitCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
23952 #define MkErrorExitCTT_X(instance) (MkOBJ_R(instance).type)
23954 #define MkErrorExitCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
23956 #define MkErrorExitC_NS MK
23958 #define MkErrorExitCTT MkErrorExitCTT
23960 #define MkErrorExitCT ( (struct MkTypeDefS *) MkErrorExitCTT )
23961
23963
23966
23967
23968
23969
23971
23972
23973
23974
23982
23985struct MkErrorIgnoreS {
23986
23987
23988 union {
23989 struct MkObjectS obj;
23990 } super;
23991
23992
23993};
23994
23995
23996
24001
24002
24005
24006 #define MkErrorIgnoreC_SIGNATURE (MkObjectC_SIGNATURE ^ (5u<<10))
24007 #define MkErrorIgnoreC_MASK (((1u<<22)-1)<<10)
24008
24010
24011
24014
24015 #define MkErrorIgnoreC_X2obj(x) MkOBJ(x)
24016
24018
24019
24022
24028 #define MkErrorIgnoreC_T (&MK_RT_REF._MkErrorIgnoreC_T)
24030 #define MkErrorIgnoreC_TT (MkTYP(MkErrorIgnoreC_T))
24032 #define MkErrorIgnoreST MkErrorIgnoreC_T
24034 #define MkErrorIgnoreSTT (MkTYP(MkErrorIgnoreST))
24036 #define MkErrorIgnoreCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
24038 #define MkErrorIgnoreCTT_X(instance) (MkOBJ_R(instance).type)
24040 #define MkErrorIgnoreCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
24042 #define MkErrorIgnoreC_NS MK
24044 #define MkErrorIgnoreCTT MkErrorIgnoreCTT
24046 #define MkErrorIgnoreCT ( (struct MkTypeDefS *) MkErrorIgnoreCTT )
24047
24049
24052
24053
24054
24055
24057
24058
24059
24060
24067
24071struct MkErrorPrintS {
24072
24073
24074 union {
24075 struct MkObjectS obj;
24076 } super;
24077
24078
24079};
24080
24081
24082
24087
24088
24091
24092 #define MkErrorPrintC_SIGNATURE (MkObjectC_SIGNATURE ^ (6u<<10))
24093 #define MkErrorPrintC_MASK (((1u<<22)-1)<<10)
24094
24096
24097
24100
24101 #define MkErrorPrintC_X2obj(x) MkOBJ(x)
24102
24104
24105
24108
24114 #define MkErrorPrintC_T (&MK_RT_REF._MkErrorPrintC_T)
24116 #define MkErrorPrintC_TT (MkTYP(MkErrorPrintC_T))
24118 #define MkErrorPrintST MkErrorPrintC_T
24120 #define MkErrorPrintSTT (MkTYP(MkErrorPrintST))
24122 #define MkErrorPrintCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
24124 #define MkErrorPrintCTT_X(instance) (MkOBJ_R(instance).type)
24126 #define MkErrorPrintCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
24128 #define MkErrorPrintC_NS MK
24130 #define MkErrorPrintCTT MkErrorPrintCTT
24132 #define MkErrorPrintCT ( (struct MkTypeDefS *) MkErrorPrintCTT )
24133
24135
24138
24139
24140
24141
24143
24144
24145
24146
24153
24161struct MkErrorDefaultS {
24162
24163
24164 union {
24165 struct MkObjectS obj;
24166 struct MkErrorS err;
24167 } super;
24168
24169
24170};
24171
24172
24173
24178
24179
24182
24183 #define MkErrorDefaultC_SIGNATURE (MkErrorC_SIGNATURE ^ (1u<<6))
24184 #define MkErrorDefaultC_MASK (((1u<<26)-1)<<6)
24185
24187
24188
24191
24192 #define MkErrorDefaultC_X2err(x) MkERR(x)
24193 #define MkErrorDefaultC_X2obj(x) MkOBJ(x)
24194
24196
24197
24200
24206 #define MkErrorDefaultC_T (&MK_RT_REF._MkErrorDefaultC_T)
24208 #define MkErrorDefaultC_TT (MkTYP(MkErrorDefaultC_T))
24210 #define MkErrorDefaultST MkErrorDefaultC_T
24212 #define MkErrorDefaultSTT (MkTYP(MkErrorDefaultST))
24214 #define MkErrorDefaultCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
24216 #define MkErrorDefaultCTT_X(instance) (MkOBJ_R(instance).type)
24218 #define MkErrorDefaultCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
24220 #define MkErrorDefaultC_NS MK
24222 #define MkErrorDefaultCTT MkErrorDefaultCTT
24224 #define MkErrorDefaultCT ( (struct MkTypeDefS *) MkErrorDefaultCTT )
24225
24227
24230
24231
24232
24233
24235
24236
24237
24238
24243
24245
24249#define MkERROR_R(r) ((*r).error_mk)
24250#define MkERROR MkERROR_R(&MK_RT_REF)
24251#define MkERROR_RT MkERROR_R(&MK_RT_REF)
24252#define MkERROR_O(o) MkERROR_R(MkRT_O(o))
24253#define MkERROR_X(x) MkERROR_R(MkRT_X(x))
24254#define MkERROR_XN(x) MkERROR_R(MkRT_XN(x))
24255#define MkERROR_NULL MkERROR_R(&MkRuntimeRLS)
24257
24261
24263#define MK_ERROR_DEFAULT_R(r) MkOBJ(&(*r).error_mk)
24264#define MK_ERROR_DEFAULT MK_ERROR_DEFAULT_R(&MK_RT_REF)
24265#define MK_ERROR_DEFAULT_X(x) MK_ERROR_DEFAULT_R(MkRT_X(x))
24266#define MK_ERROR_DEFAULT_NULL MK_ERROR_DEFAULT_R(&MkRuntimeRLS)
24267
24275
24277
24278
24282
24283#define MK_ERROR_PANIC_R(r) MkOBJ(&(*r).error_panic)
24284#define MK_ERROR_PANIC MK_ERROR_PANIC_R(&MK_RT_REF)
24285#define MK_ERROR_PANIC_X(x) MK_ERROR_PANIC_R(MkRT_X(x))
24287#define MK_ERROR_PANIC_NULL MK_ERROR_PANIC_R(&MkRuntimeRLS)
24288
24306
24308
24309
24313
24314#define MK_ERROR_EXIT_R(r) MkOBJ(&(*r).error_exit)
24315#define MK_ERROR_EXIT MK_ERROR_EXIT_R(&MK_RT_REF)
24316#define MK_ERROR_EXIT_X(x) MK_ERROR_EXIT_R(MkRT_X(x))
24318#define MK_ERROR_EXIT_NULL MK_ERROR_EXIT_R(&MkRuntimeRLS)
24319
24337
24339
24340
24344
24345#define MK_ERROR_IGNORE_R(r) MkOBJ(&(*r).error_ignore)
24346#define MK_ERROR_IGNORE MK_ERROR_IGNORE_R(&MK_RT_REF)
24347#define MK_ERROR_IGNORE_X(x) MK_ERROR_IGNORE_R(MkRT_X(x))
24348#define MK_ERROR_IGNORE_XN(x) MK_ERROR_IGNORE_R(MkRT_XN(x))
24350#define MK_ERROR_IGNORE_NULL MK_ERROR_IGNORE_R(&MkRuntimeRLS)
24351
24377
24379
24380
24384
24385#define MK_ERROR_PRINT_R(r) MkOBJ(&(*r).error_print)
24386#define MK_ERROR_PRINT MK_ERROR_PRINT_R(&MK_RT_REF)
24387#define MK_ERROR_PRINT_X(x) MK_ERROR_PRINT_R(MkRT_X(x))
24389#define MK_ERROR_PRINT_NULL MK_ERROR_PRINT_R(&MkRuntimeRLS)
24390
24405
24407
24408
24412
24413#define MK_ERROR_FORMAT_R(r) ((*r).error_mk.format_of_error ? (*r).error_mk.format_of_error : \
24414 MkObjN((*r).error_mk.source_of_error) ? MkObjN((*r).error_mk.source_of_error) : \
24415 MK_ERROR_DEFAULT_R(r))
24416#define MK_ERROR_FORMAT MK_ERROR_FORMAT_R(&MK_RT_REF)
24417#define MK_ERROR_FORMAT_X(x) MK_ERROR_FORMAT_R(MkRT_X(x))
24419#define MK_ERROR_FORMAT_NULL MK_ERROR_FORMAT_R(&MkRuntimeRLS)
24420
24441
24442#define MkErrorFORMAT_1M(m) MkErrorFORMAT(MkObjN(m))
24443#define MkErrorFORMAT_1X(x) MkErrorFORMAT(MkOBJ(x))
24444#define MkErrorFORMAT_1O(o) MkErrorFORMAT(o)
24445
24451
24453
24455
24457
24458
24459
24460
24465
24467
24476 MK_ERR err
24478
24489 MK_ERRN const srce
24491
24497 MK_ERR dest,
24498 MK_ERRN const srce
24500
24502
24504
24505
24506
24507
24512
24514
24518 MK_ERRN const err
24520
24522#define MkErrorGetCodeI(e) ((*e).code)
24524#define MkErrorGetCodeE_NULL() (MkERROR_NULL.code)
24526#define MkErrorGetCode_O(o) (MkERROR_O(o).code)
24527
24531 MK_ERRN const err
24533
24535#define MkErrorGetTextI(e) (MkBUF_R(&(*e).text).storage.first.C)
24536
24540 MK_ERRN const err
24542
24544#define MkErrorGetSizeI(e) ((MK_SIZE)MkBUF_R(&(*e).text).var.cursize)
24545
24549 MK_ERRN const err
24551
24553#define MkErrorGetNumI(e) ((*e).num)
24554
24556
24558
24559
24560
24561
24562
24563
24564
24565
24566
24567
24573
24575
24579 MK_ERR const err
24581
24582#define MkErrorSetCONTINUE_0E() MkErrorSetCONTINUE(&MkERROR)
24583
24605 MK_ERR const err,
24606 MK_STRN
const callfunc
__parser__(
default=F#FUNC)
24608
24617 MK_ERR const err,
24618 MK_STRN
const detail
__parser__(
default=S#
"UNKNOWN"),
24619 MK_STRN
const callfunc
__parser__(
default=F#FUNC)
24621
24635 MK_ERR const err,
24636 MK_STRN
const detail
__parser__(
default=S#
"UNKNOWN"),
24637 MK_STRN
const callfunc
__parser__(
default=F#FUNC)
24639
24643 MK_ERR const err,
24644 enum MkErrorE code
24646
24649 MK_ERRN const err
24651
24654 MK_ERRN const err
24656
24659 MK_ERRN const err
24661
24688 MK_ERR const err
24690
24692
24694
24695
24696
24697
24698
24699
24700
24701
24709
24711#define MkErrorCheckI(err) ((err) >= MK_ERROR)
24715#define MkErrorCheckE_0E() (MkErrorCheckI(MkErrorGetCode_0E()))
24716#define MkErrorCheckE_NULL() (MkErrorCheckI(MkErrorGetCodeE_NULL()))
24717#define MkErrorCheckE_O(o) (MkErrorCheckI(MkErrorGetCode_O(o)))
24718#define MkErrorCheckE_X(x) MkErrorCheckE_O(MkOBJ(x))
24719#define MkErrorCheckE_E(e) (MkErrorCheckI((e)->code))
24722#define MkErrorCheck(err) if (MkErrorCheckI(err)) goto error
24724#define MkErrorE_Check(err) if (MkErrorCheckI(err)) goto error
24726#define MkErrorCheck_0E() if (MkErrorCheckE_0E()) goto error
24728#define MkErrorBreak(err) if (MkErrorCheckI(err)) break
24730#define MkContinueCheck(err) switch (err) { \
24731case MK_OK: break; case MK_CONTINUE: goto cont; case MK_ERROR: goto error;\
24732};
24733
24735#define MkErrorSwitch(PROC) switch (PROC) {\
24736case MK_OK: break; case MK_ERROR: goto error; case MK_CONTINUE: return MK_CONTINUE;\
24737}
24738
24739
24740
24741
24743#define MkErrorReturnAppend(PROC) \
24744if (MkErrorCheckI(PROC)) { \
24745 return MkErrorStack_0E (); \
24746} else if (MkErrorCheckE_0E()) { \
24747 return MkErrorReset_0E (); \
24748} else { \
24749 return MkERROR.code; \
24750}
24751*/
24753#define MkErrorReturn_2X(mngx,PROC) switch (PROC) {\
24754case MK_OK: return MK_OK; case MK_CONTINUE: return MK_CONTINUE; default: return MkErrorStack_1X (mngx);\
24755};
24757#define MkErrorReturn_1(PROC) switch (PROC) {\
24758case MK_OK: return MK_OK; case MK_CONTINUE: return MK_CONTINUE; default: return MkErrorStack_0E ();\
24759};
24761#define MkErrorReturn(PROC) MkErrorReturn_2X(META_CONTEXT_S,PROC)
24763#define check_MkErrorE(PROC) if (MkErrorCheckI(PROC))
24764
24766#define MkErrorReturnLabel(mng) \
24767 return MK_OK; \
24768error: \
24769 return MkErrorStack_1M(mng);
24770
24772
24773
24774
24775
24782
24785
24799 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
24801 MK_FST const printfmt,
24802 va_list var_list
24804
24805#define MkPanicVL_5M(errobj,callfunc,errnum,printfmt,var_list) \
24806 MkPanicVL(MkObj(errobj),callfunc,errnum,printfmt,var_list)
24807
24820 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
24822 MK_FST const printfmt,
24823 ...
24825
24826#define MkPanicV_4M(errobj,callfunc,errnum,printfmt,...) \
24827 MkPanicV(MkObj(errobj),callfunc,errnum,printfmt,__VA_ARGS__)
24828
24829#define MkPanicV_2M(x,printfmt,...) \
24830 MkPanicV_2(MkObj(x),printfmt,__VA_ARGS__)
24831
24845 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
24847 MK_STRN const message
24849
24850#define MkPanicC_4M(errobj,callfunc,errnum,message) \
24851 MkPanicC(MkObj(errobj),callfunc,errnum,message)
24852
24853#define MkPanicC_2M(x,message) MkPanicC_2(MkObj(x),message)
24854
24866 MK_STRN
const callfunc
__parser__(
default=F#FUNC)
24868
24869#define MkPanicDEFAULT_2M(errobj,...) MkPanicDEFAULT(MkObj(errobj),__VA_ARGS__)
24870#define MkPanicDEFAULT_1M(x) MkPanicDEFAULT_1(MkObj(x))
24871
24876#define MkPanicSYS(mngx) do { \
24877 MkLogC_2X(mngx,"internal ERROR, please contact your local support\n"); \
24878 MkDisasterSignal(-1); \
24879} while (0)
24880
24889) __attribute__ ((noreturn));
24890
24899 MK_ERR const err,
24900 MK_FST const printfmt,
24901 va_list var_list
24903
24912 MK_ERR const err,
24913 MK_FST const printfmt,
24914 ...
24916
24925 MK_ERR const err,
24926 MK_STRN const message
24928
24950 MK_ERR const err
24952
24976 MK_ERR const err,
24977 MK_STRN const message,
24978 enum MkErrorE const errcode
__parser__(default=F
#MK_ERROR),
24982
24994 MK_ERR const err,
24995 MK_ERR const newerr
24997
25012 MK_ERR err,
25013 MK_STRN const message,
25014 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
25017
25018#define MkErrorSetC_1XS(message) MkErrorSetC_4M(META_CONTEXT_S,message,__func__,-1)
25019#define MkErrorSetC_2E_E(caller,message) MkErrorCheck(MkErrorSetC_2E(message,caller))
25020
25021#define MkErrorSetC_4_NULL(...) MkErrorSetC_RT(MK_RT_NULL __VA_ARGS__)
25022#define MkErrorSetC_3_NULL(...) MkErrorSetC_4_NULL(&MkERROR_NULL,__VA_ARGS__)
25023#define MkErrorSetC_2_NULL(msg,pfx) MkErrorSetC_3_NULL(msg,pfx,-1)
25024#define MkErrorSetC_1_NULL(msg) MkErrorSetC_3_NULL(msg,__func__,-1)
25025
25026#define MkErrorSetC_4M_NULL(m,...) MkErrorSetC_4_NULL(MkErrorFORMAT_1M(m),__VA_ARGS__)
25027#define MkErrorSetC_3M_NULL(m,msg,pfx) MkErrorSetC_4M_NULL(m,msg,pfx,-1)
25028#define MkErrorSetC_2M_NULL(m,msg) MkErrorSetC_4M_NULL(m,msg,__func__,-1)
25029
25046 MK_ERR err,
25047 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
25049 MK_FST const printfmt,
25050 va_list var_list
25052
25068 MK_ERR err,
25069 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
25071 MK_FST const printfmt,
25072 ...
25074
25075#define MkErrorSetV_4EO_NULL(o,...) MkErrorSetV_NULL(MkErrorFORMAT_EO(o), __VA_ARGS__)
25076#define MkErrorSetV_4M_NULL(m,...) MkErrorSetV_NULL(MkErrorFORMAT_1M(m),__VA_ARGS__)
25077#define MkErrorSetV_2M_NULL(m,...) MkErrorSetV_4M_NULL(m,__func__,-1,__VA_ARGS__)
25078#define MkErrorSetV_2X(x,...) MkErrorSetV(MkErrorFORMAT_1X(x),__func__,-1,__VA_ARGS__)
25079
25080#define MkErrorSetV_1_NULL(printfmt,...) \
25081 MkErrorSetV_NULL(&MkERROR_NULL,__func__,-1,printfmt,__VA_ARGS__)
25082
25083#define MkErrorSetV_1XS(printfmt,...) \
25084 MkErrorSetV_4M(META_CONTEXT_S,__func__,-1,printfmt,__VA_ARGS__)
25085
25086#define MkErrorSetV_2E_E(caller,printfmt,...) \
25087 MkErrorCheck(MkErrorSetV_2E(caller,printfmt,__VA_ARGS__))
25088
25089#define MkErrorSet_ObjectIsNullError(m,printfmt,...) \
25090 MkErrorSetV_4M(m,"ObjectIsNullError",-1,printfmt,__VA_ARGS__)
25091
25092#define MkErrorSysO(obj,cmd) \
25093 MkErrorSetV_4EO_NULL (obj, __func__, errno, \
25094 "can not '%s' -> ERR<%s>", MK_CPPXSTR(cmd), strerror (errno))
25095
25097
25099
25100
25101
25102
25107
25109
25130 MK_ERR const err,
25131 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
25132 MK_I32
const callline
__parser__(
default=F#LINE)
25134
25144 MK_ERR const err,
25146 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
25147 MK_I32
const callline
__parser__(
default=F#LINE)
25149
25150#define MkErrorPrintln_0() MkErrorPrintln_0E()
25151
25165 MK_ERRN const err ,
25168 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
25171
25172#define MkErrorLog_1EF_NULL(fmt) MkErrorLog(&MkERROR_NULL,fmt,0,__func__,0)
25173#define MkErrorLog_1EF(fmt) MkErrorLog_4E(fmt,0,__func__,0)
25174
25195 MK_ERR const err,
25196 MK_EXP
const exception
__parser__(
default=NULL,has-reference),
25197 MK_STRN
const callfunc
__parser__(
default=F#FUNC)
25199
25228 MK_OBJN const obj,
25229 MK_EXP
const exception
__parser__(
default=NULL,has-reference),
25230 MK_STRN
const callfunc
__parser__(
default=F#FUNC)
25232
25234#define MkObjectErrorCatch_3X(x,...) MkObjectErrorCatch(MkOBJ(x),__VA_ARGS__)
25235
25246 MK_ERRN const err
25248
25257
25260 MK_ERR const err,
25261 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
25262 MK_I32
const callline
__parser__(
default=F#LINE),
25263 bool const force
__parser__(
default=B#
false)
25265
25266#define MkErrorReset_0M() MkErrorReset_4M(NULL,__func__,__LINE__,0);
25267#define MkErrorResetFORCE_1(m) MkErrorReset_4M(m,__func__,__LINE__,1);
25268#define MkErrorResetFORCE_0() MkErrorReset_4M(NULL,__func__,__LINE__,1);
25269
25270#define MkErrorReset_4X(x,...) MkErrorReset(MkErrorFORMAT_1X(x),__VA_ARGS__)
25271#define MkErrorReset_1X(x) MkErrorReset_4X(x,__func__,__LINE__,0)
25272
25273
25284 MK_ERR const err,
25285 MK_STRN callfunc
__parser__(
default=F#FUNC),
25286 MK_STRN callfile
__parser__(
default=F#FILE),
25287 MK_I32
const callline
__parser__(
default=F#LINE)
25289
25303 MK_STRN
const callfunc
__parser__(
default=F#FUNC),
25304 MK_STRN
const callfile
__parser__(
default=F#FILE),
25305 MK_I32
const callline
__parser__(
default=F#LINE)
25307
25308#define MkErrorStack_1M_Check(m) (MkErrorCheckE_0E() ? MkErrorStack_1M(m) : MkErrorGetCode_0E())
25309#define MkErrorStack_0E_Check() (MkErrorCheckE_0E() ? MkErrorStack_0E() : MkErrorGetCode_0E())
25310
25311#define MkErrorStack_4X(x,...) MkErrorStack_RT(MK_RT_CALL MkErrorFORMAT_1X(x),__VA_ARGS__)
25312#define MkErrorStack_3X(...) MkErrorStack_4X(__VA_ARGS__,__LINE__)
25313#define MkErrorStack_2X(...) MkErrorStack_4X(__VA_ARGS__,__FILE__,__LINE__)
25314#define MkErrorStack_1X(...) MkErrorStack_4X(__VA_ARGS__,__func__,__FILE__,__LINE__)
25315
25316#define MkErrorStack_0_NULL() MkErrorStack_NULL(&MkERROR_NULL,__func__,__FILE__,__LINE__)
25317
25318#define MkErrorStack_4X_NULL(x,...) MkErrorStack_NULL(MkErrorFORMAT_1X(x),__VA_ARGS__)
25319#define MkErrorStack_3X_NULL(...) MkErrorStack_4X_NULL(__VA_ARGS__,__LINE__)
25320#define MkErrorStack_2X_NULL(...) MkErrorStack_4X_NULL(__VA_ARGS__,__FILE__,__LINE__)
25321#define MkErrorStack_1X_NULL(...) MkErrorStack_4X_NULL(__VA_ARGS__,__func__,__FILE__,__LINE__)
25322
25323#define MkErrorStack_NUM 50
25324#define MkErrorStack_STR "50"
25325
25331 MK_ERRN const inst
25333
25335
25337
25338
25339
25340
25366
25379
25387 MK_MNG const expobj,
25388 MK_STRN const callfunc,
25389 MK_I32 const callline
25390) ;
25391
25401 MK_MNG const expobj,
25402 MK_EXP const exception,
25403 MK_STRN const callfunc
25404) ;
25405
25407
25408
25409
25410
25416
25419struct MkRtExtS {
25420
25421
25422 union {
25423 struct MkObjectS obj;
25425 } super;
25426
25427
25428
25430};
25431
25432
25433
25438
25439
25442
25443 #define MkRtExtC_SIGNATURE (MkExtensionC_SIGNATURE ^ (2u<<6))
25444 #define MkRtExtC_MASK (((1u<<26)-1)<<6)
25445
25447
25448
25451
25452 #define MkRtExtC_X2rtext(x) (x)
25453 #define MkRtExtC_X2ext(x) MkEXT(x)
25454 #define MkRtExtC_X2obj(x) MkOBJ(x)
25455
25457
25458
25461
25467 #define MkRtExtC_T (&MK_RT_REF._MkRtExtC_T)
25469 #define MkRtExtC_TT (MkTYP(MkRtExtC_T))
25471 #define MkRtExtST MkRtExtC_T
25473 #define MkRtExtSTT (MkTYP(MkRtExtST))
25475 #define MkRtExtC_type MK_RTEXT
25477 #define MkRtExtCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
25479 #define MkRtExtCTT_X(instance) (MkOBJ_R(instance).type)
25481 #define MkRtExtCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
25483 #define MkRtExtC_NS MK
25485 #define MkRtExtCTT MkRtExtCTT
25487 #define MkRtExtCT ( (struct MkTypeDefS *) MkRtExtCTT )
25488
25490
25491
25494
25495 #pragma GCC diagnostic push
25496 #pragma GCC diagnostic ignored "-Wattributes"
25497
25504 }
25505
25512 }
25513
25514 #pragma GCC diagnostic pop
25515 #define MkRtExtC_Check(mng) MkRtExtCheck(mng)
25516
25518
25519
25522
25525 META_ATTRIBUTE_SANITIZE
25527 mk_inline MK_RTEXT MkRtExt(MK_MNG mng) {
25529 }
25530
25533 META_ATTRIBUTE_SANITIZE
25535 mk_inline MK_RTEXTN MkRtExtN(MK_MNGN mng) {
25537 }
25538
25540 #define MkRtExtRaise(_rtext) if (!_MkCheckX(MkRtExtC,_rtext)) { \
25541 MkErrorSetC_1E("'MkRtExtC' hdl is NULL"); \
25542 goto error ; \
25543 }
25544
25546 #define MkRTEXT_R(x) (*(x)).super.rtext
25548 #define MkRTEXT(x) (&MkRTEXT_R(x))
25549
25551
25554
25555
25556
25557
25558#define MkRtExtAdd(_mkrtR,add,id) do { \
25559 (_mkrtR).mkRtExt = (typeof((_mkrtR).mkRtExt)) MkExtensionAdd(MkEXT((_mkrtR).mkRtExt),MkEXT(add)); \
25560 MkRTEXT_R(add).mkrtHead = &(_mkrtR); \
25561 (_mkrtR).mkRtExtAry[id] = MkRTEXT(add); \
25562} while (0) \
25563
25564#define MkRtExtDel(_mkrtR,del,id) do { \
25565 (_mkrtR).mkRtExt = (typeof((_mkrtR).mkRtExt)) MkExtensionDel(MkEXT((_mkrtR).mkRtExt),MkEXT(del)); \
25566 MkRTEXT_R(del).mkrtHead = NULL; \
25567 (_mkrtR).mkRtExtAry[id] = NULL; \
25568} while (0) \
25569
25571
25572
25573
25574
25575
25576
25577
25578
25579
25580
25581
25582
25583
25584
25585
25586
25587
25588
25590
25637#define MkDbgRt_1(c) mk_dbg_color_ln(c,"mkrt<%p>, MkRT<%p>", mkrt, MkRT)
25638#define MkDbgRt() MkDbgRt_1(MK_COLOR_PURPLE)
25639#define MkDbgRtChkX(x) (MkRT_X(x)==MkRT?"ok":"wrong")
25640
25646
25649
25650#pragma GCC diagnostic push
25651#pragma GCC diagnostic ignored "-Wlto-type-mismatch"
25652
25653#if defined(MK_C_BUILD_DLL)
25654
25655 #define META_SECTION_DEFINE
25656 #include "MkRuntimeS_mk.h"
25657 #undef META_SECTION_DEFINE
25658
25659#else
25660
25662struct MkRuntimeS {
25663
25664
25665
25666
25667
25668
25679
25680
25681
25682 union {
25683 struct MkObjectS obj;
25684 } super;
25685
25686
25687
25689 struct MkErrorS error_mk;
25690
25692 struct MkErrorPanicS error_panic;
25693
25695 struct MkErrorPanicS error_exit;
25696
25698 struct MkErrorIgnoreS error_ignore;
25699
25701 struct MkErrorPrintS error_print;
25702
25707
25712 bool isSilent;
25713
25715 bool noDeco;
25716
25724
25727
25729
25731 struct MkBuffer64S tbuf;
25732
25735
25740
25743
25746
25756 bool MkSelfIncrOnCacheB;
25757
25758
25759
25760
25761
25762
25763 struct MkTypeDefS _MkObjectC_T ;
25764 struct MkTypeDefS _MkBufferC_T ;
25765 struct MkTypeDefS _MkBuffer64C_T ;
25766 struct MkTypeDefS _MkBuffer256C_T ;
25767 struct MkTypeDefS _MkBuffer1024C_T ;
25768 struct MkTypeDefS _MkBufferStreamC_T ;
25769 struct MkTypeDefS _MkBufferStream16384C_T ;
25770 struct MkTypeDefS _MkBufferStream256C_T ;
25771 struct MkTypeDefS _MkBufferStream64C_T ;
25772 struct MkTypeDefS _MkBufferStream1024C_T ;
25773 struct MkTypeDefS _MkBufferListC_T ;
25774 struct MkTypeDefS _MkLogFileC_T ;
25775 struct MkTypeDefS _MkErrorC_T ;
25776 struct MkTypeDefS _MkErrorDefaultC_T ;
25777 struct MkTypeDefS _MkErrorIgnoreC_T ;
25778 struct MkTypeDefS _MkErrorPrintC_T ;
25779 struct MkTypeDefS _MkErrorPanicC_T ;
25780 struct MkTypeDefS _MkErrorExitC_T ;
25781 struct MkTypeDefS _MkExtensionC_T ;
25782 struct MkTypeDefS _MkErrExtC_T ;
25783 struct MkTypeDefS _MkRtExtC_T ;
25784 struct MkTypeDefS _MkRuntimeC_T ;
25785 struct MkTypeS _MkTypeC_TT ;
25786 struct MkTypeS _MkTypeDefC_TT ;
25787
25788
25789
25790
25791 MK_BINB private_variables[12986];
25792};
25793
25794#endif
25795
25796#pragma GCC diagnostic pop
25797
25798
25799
25804
25805
25808
25809 #define MkRuntimeC_SIGNATURE (MkObjectC_SIGNATURE ^ (10u<<10))
25810 #define MkRuntimeC_MASK (((1u<<22)-1)<<10)
25811
25813
25814
25817
25818 #define MkRuntimeC_X2rt(x) (x)
25819 #define MkRuntimeC_X2obj(x) MkOBJ(x)
25820
25822
25823
25826
25832 #define MkRuntimeC_T (&MK_RT_REF._MkRuntimeC_T)
25834 #define MkRuntimeC_TT (MkTYP(MkRuntimeC_T))
25836 #define MkRuntimeST MkRuntimeC_T
25838 #define MkRuntimeSTT (MkTYP(MkRuntimeST))
25840 #define MkRuntimeC_type MK_RT
25842 #define MkRuntimeCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
25844 #define MkRuntimeCTT_X(instance) (MkOBJ_R(instance).type)
25846 #define MkRuntimeCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
25848 #define MkRuntimeC_NS MK
25850 #define MkRuntimeCTT MkRuntimeCTT
25852 #define MkRuntimeCT ( (struct MkTypeDefS *) MkRuntimeCTT )
25853
25855
25856
25859
25860 #pragma GCC diagnostic push
25861 #pragma GCC diagnostic ignored "-Wattributes"
25862
25869 }
25870
25877 }
25878
25879 #pragma GCC diagnostic pop
25880 #define MkRuntimeC_Check(mng) MkRtCheck(mng)
25881
25883
25884
25887
25890 META_ATTRIBUTE_SANITIZE
25893 return (
MkRtCheck(mng) ? (MK_RT)mng : NULL);
25894 }
25895
25898 META_ATTRIBUTE_SANITIZE
25901 return (
MkRtCheck(mng) ? (MK_RTN)mng : NULL);
25902 }
25903
25905 #define MkRtRaise(_rt) if (!_MkCheckX(MkRuntimeC,_rt)) { \
25906 MkErrorSetC_1E("'MkRuntimeC' hdl is NULL"); \
25907 goto error ; \
25908 }
25909
25911
25914
25915
25916
25917
25919
25920
25921
25922
25923
25926
25929
25930__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MkRuntimeC);
25931
25952) {
25954}
25955
25966mk_inline MK_RT MkRuntimeHandleResolve_RT (
25968 MK_HDL const netHdl
25969) {
25971}
25972
25982#define MkRuntimeHandleResolve_e(netHdl) ({ \
25983 MK_HDL tmpHdl=netHdl; \
25984 MK_RT tmp; \
25985 if (tmpHdl==0) { \
25986 tmp=NULL; \
25987 } else { \
25988 tmp=MkRuntimeHandleResolve(tmpHdl); \
25989 if (tmp==NULL) { \
25990 MkErrorSetC_1_NULL("ERROR: 'MkRuntimeC' handle is 'NULL'"); \
25991 goto error; \
25992 }; \
25993 }; \
25994 tmp; \
25995})
25996
25998
26000
26001
26005 __parser__(flags=
new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,
class=MkRuntimeC,null-
return-allow)
26009 }
26011
26012
26014
26015
26016
26017
26021
26022
26023
26027
26030
26031#define MkRT (&MkRuntimeRLS)
26032#define MkRT_R (MkRuntimeRLS)
26033
26034#if META_HAS_THREAD
26035 #define MkRT_O(o) ((o) && (*o).objRt ? (*o).objRt : MkRuntimeGet())
26036 #define MkRT_X(x) ((x) && MkOBJ_R(x).objRt ? MkOBJ_R(x).objRt : MkRuntimeGet())
26037 #define MkRT_ONN(o) ((*o).objRt)
26038 #define MkRT_ON(o) ( (*o).objRt ? (*o).objRt : MkRuntimeGet())
26039 #define MkRT_XN(x) ( MkOBJ_R(x).objRt ? MkOBJ_R(x).objRt : MkRuntimeGet())
26040#else
26041 #define MkRT_O(o) MkRT
26042 #define MkRT_X(x) MkRT
26043 #define MkRT_ONN(o) MkRT
26044 #define MkRT_ON(o) MkRT
26045 #define MkRT_XN(x) MkRT
26046#endif
26047
26048#if META_HAS_THREAD
26049 #define MkRtSetup_O(o) MK_RT_UNUSED MK_RT const mkrt = MkRT_O(o)
26050 #define MkRtSetup_X(x) MK_RT_UNUSED MK_RT const mkrt = MkRT_X(x)
26051 #define MkRtSetup_XN(x) MK_RT_UNUSED MK_RT const mkrt = MkRT_XN(x)
26052 #define MkRtSetup_ON(o) MK_RT_UNUSED MK_RT const mkrt = MkRT_ON(o)
26053 #define MkRtSetup_NULL MK_RT_UNUSED MK_RT const mkrt = MkRuntimeGet()
26054 #define MkRtSetup_RT(r) MK_RT_UNUSED MK_RT const mkrt = r
26055 #define MkRtSetupFromRtExt(rtx) MK_RT_UNUSED MK_RT const mkrt = MkRTEXT_R(rtx).mkrtHead
26056
26057
26058 #define MkRtSetup_O_RT(o) if (mkrt == NULL) mkrt = MkRT_O(o)
26059 #define MkRtSetup_ON_RT(o) if (mkrt == NULL) mkrt = MkRT_ON(o)
26060 #define MkRtSetup_X_RT(x) if (mkrt == NULL) mkrt = MkRT_X(x)
26061 #define MkRtSetup_XN_RT(x) if (mkrt == NULL) mkrt = MkRT_XN(x)
26062 #define MkRtSetup_NULL_RT if (mkrt == NULL) mkrt = MkRuntimeGet()
26063
26064 #define AllRtSetup_O(o) MkRtSetup_O(o)
26065 #define AllRtSetup_ON(o) MkRtSetup_ON(o)
26066 #define AllRtSetup_X(x) MkRtSetup_X(x)
26067 #define AllRtSetup_XN(x) MkRtSetup_XN(x)
26068 #define AllRtSetup_NULL MkRtSetup_NULL
26069#else
26070 #define MkRtSetup_O(o)
26071 #define MkRtSetup_X(x)
26072 #define MkRtSetup_XN(x)
26073 #define MkRtSetup_ON(o)
26074 #define MkRtSetup_NULL
26075 #define MkRtSetup_RT(r)
26076
26077 #define MkRtSetup_O_RT(o)
26078 #define MkRtSetup_X_RT(x)
26079 #define MkRtSetup_XN_RT(x)
26080 #define MkRtSetup_ON_RT(o)
26081 #define MkRtSetup_NULL_RT
26082
26083 #define AllRtSetup_O(o)
26084 #define AllRtSetup_ON(o)
26085 #define AllRtSetup_X(x)
26086 #define AllRtSetup_XN(x)
26087 #define AllRtSetup_NULL
26088#endif
26089
26091
26098
26150
26152
26153 #define MkRuntimeCallbackS_ident_size 30
26155
26156
26157 size_t rtId_plus_1 ;
26158
26159
26163
26235 MkRuntimeCallbackS * cbdata,
26236 MkRuntimeInitF rt_callback,
26237 MK_STRN ident
26238);
26239
26245 MkRuntimeCallbackS * cbdata
26246);
26247
26249
26250
26255
26264
26272
26276{
26278}
26279
26284) {
26286}
26287
26289
26290
26291
26292
26302
26304
26309}
26310
26314
26318
26323}
26324
26329}
26330
26337}
26338
26346 MK_STRN logTgt
26347) ;
26348
26355) ;
26356
26360 MK_STRN logTgt
26361) ;
26362
26363#define MkRuntimeLogBufferPush() MkLogDataS saveLogTarget = MkRuntimeLogTargetPush_RT(MK_RT_CALL "BUFFER")
26364
26365
26369 MkLogDataS logOld
26370) ;
26371
26372#define MkRuntimeLogBufferPop() MkRuntimeLogTargetPop_RT(MK_RT_CALL saveLogTarget)
26373
26374
26378
26383) {
26386}
26387
26389
26391
26392
26393
26394
26399
26401
26416 MK_STRN const callfunc
__parser__(default=F
#FUNC),
26419
26421
26423
26424
26425
26426
26427
26428
26429
26430
26486
26487
26653#ifndef MK_EMBEDDED
26655 #define MK_EMBEDDED(type,call,...) ({ \
26656 type ret = (type) 0; \
26657 if (MkErrorCheckI(call (__VA_ARGS__,&ret))) goto error; \
26658 ret; \
26659 })
26660#endif
26661
26662#ifndef MK_EMBEDDED_REF
26664 #define MK_EMBEDDED_REF(type,call,...) ({ \
26665 type ret = {0}; \
26666 if (MkErrorCheckI(call (__VA_ARGS__,&ret))) goto error; \
26667 ret; \
26668 })
26669#endif
26670
26672
26673
26674
26675
26676
26677
26678
26679
26680
26695
26696
26697
26698
26699
26705
26706
26712
26713
26720
26721
26727
26728
26735
26736
26742
26743
26749
26750
26757
26758
26764
26765
26772
26773
26774
26775
26776
26777
26778
26779
26780
26781
26782
26787
26788__parser__push__(doc-name=Introspection,doc-index=Class,
class=MkBufferListC,no-rpc,null-
return-allow,flags=
new);
26789
26796}
26797
26803}
26804
26810}
26811
26813
26816
26817
26822
26823__parser__push__(doc-name=Introspection,doc-index=Class,
class=MkBufferC,no-rpc,null-
return-allow,flags=
new);
26824
26831}
26832
26838}
26839
26845}
26846
26848
26851
26852
26857
26858__parser__push__(doc-name=Introspection,doc-index=Class,
class=MkBufferStreamC,no-rpc,null-
return-allow,flags=
new);
26859
26866}
26867
26873}
26874
26880}
26881
26883
26886
26887
26892
26893__parser__push__(doc-name=Introspection,doc-index=Class,
class=MkErrorC,no-rpc,null-
return-allow,flags=
new);
26894
26901}
26902
26908}
26909
26915}
26916
26918
26921
26922
26927
26928__parser__push__(doc-name=Introspection,doc-index=Class,
class=MkLogFileC,no-rpc,null-
return-allow,flags=
new);
26929
26936}
26937
26943}
26944
26950}
26951
26953
26956
26957
26962
26963__parser__push__(doc-name=Introspection,doc-index=Class,
class=MkObjectC,no-rpc,null-
return-allow);
26964
26971}
26972
26978}
26979
26985}
26986
26988
26991
26992
26997
26998__parser__push__(doc-name=Introspection,doc-index=Class,
class=MkRuntimeC,no-rpc,null-
return-allow,flags=
new);
26999
27006}
27007
27013}
27014
27020}
27021
27023
27026
27027
27028
27029
27033
27038
27041 }
27042 return NULL;
27043}
27044
27045
27046
27047
27048
27049
27050
27051
27052
27059}
27060
27067}
27068
27075}
27076
27083}
27084
27091}
27092
27097 MK_OBJ obj,
27098 MK_PTR *self_out,
27099 MK_PTR const env
27100) {
27101 assert(self_out != NULL);
27102
27103 if (obj == NULL) {
27104 *self_out = NULL;
27106 }
27108
27111 if (self != NULL) {
27113 MkErrorSetV_2M(obj,
"RefCount Error: object '%s' has 'self' but 'refCout <= 0", obj->type->type_name);
27114 goto error;
27115 } else {
27118 goto end;
27119 }
27120 }
27122 if (self == NULL) {
27123 MkErrorSetV_2M(obj,
"Error: '%s->SelfCreate' return a NULL pointer", obj->type->type_name);
27124 goto error;
27125 }
27126end:
27127 *self_out = self;
27128 return ret;
27129error:
27130 *self_out = NULL;
27132}
27133
27136
27148 MK_OBJ const obj
27149) {
27152}
27153
27154#define MkObjectToError_1X(obj) MkObjectToError(MkOBJ(obj))
27155
27157
27158
27161
27166}
27167
27172}
27173
27175
27178
27183}
27184
27190}
27191
27193
27203 }
27205};
27206
27212};
27213
27214
27216
27217
27218#endif
27219
27220
#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
#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.
struct MkBuffer1024S MkBuffer1024CR
instance-struct-reference same as struct MkBuffer1024S, useable in a class-macro as: class##R …
const struct MkBuffer1024S MkBuffer1024CNR
const instance-struct-reference same as const struct MkBuffer1024S, useable in a class-macro as: clas...
#define MkBuffer256S_ils_size
256 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
const struct MkBuffer256S MkBuffer256CNR
const instance-struct-reference same as const struct MkBuffer256S, useable in a class-macro as: class...
struct MkBuffer256S MkBuffer256CR
instance-struct-reference same as struct MkBuffer256S, useable in a class-macro as: class##R …
#define MkBuffer64S_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
const struct MkBuffer64S MkBuffer64CNR
const instance-struct-reference same as const struct MkBuffer64S, useable in a class-macro as: class#...
struct MkBuffer64S MkBuffer64CR
instance-struct-reference same as struct MkBuffer64S, useable in a class-macro as: class##R …
enum MkErrorE MkString2U16_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_U16 *val_out)
enum MkErrorE MkString2LONG_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_LONG *val_out)
enum MkErrorE MkString2I64_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_I64 *val_out)
enum MkErrorE MkString2HDL_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_HDL *val_out)
enum MkErrorE MkString2DBL_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_DBL *val_out)
#define MkBufferS_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
enum MkErrorE MkString2BOOL_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_BOOL *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 MkString2BOL_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_BOL *val_out)
convert a string into a native
enum MkErrorE MkString2I16_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_I16 *val_out)
enum MkErrorE MkString2I8_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_I8 *val_out)
enum MkErrorE MkString2I32_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_I32 *val_out)
enum MkErrorE MkString2FLT_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_FLT *val_out)
enum MkErrorE MkString2U32_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_U32 *val_out)
struct MkBufferS * MK_BUF
class-shortcut for struct MkBufferS *, all shortcut using the XX_YYY syntax (only for public API) …
const struct MkBufferS * MK_BUFN
class-shortcut for const struct MkBufferS *, all const shortcut using the XX_YYYC syntax (only for pu...
static MK_BUF MkBufferGetNull(void)
Null-Slot - return a MkBufferC typed NULL instance …
struct MkBufferS MK_BUFR
reference-shortcut for struct MkBufferS, all shortcut using the XX_YYYR syntax (only for public API) ...
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 MkBufferInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkBufferS type …
static MK_BUF MkBufferPrev(MK_BUF const buf)
get previous instance from linked-list of MkBufferS type
static MK_BUF MkBufferNext(MK_BUF const buf)
get next instance from linked-list of MkBufferS type
struct MkBufferS MkBufferCR
instance-struct-reference same as struct MkBufferS, useable in a class-macro as: class##R …
static MK_BUF MkBuf(MK_MNG mng)
cast a unknown-object into an MkBufferS pointer or NULL if not possible
#define MkBufferC_X2obj(x)
static bool MkBufCheckO(MK_OBJN obj)
check MkBufferS -> libmkkernel::MkObjectS::signature …
static bool MkBufCheck(MK_MNGN mng)
check MkBufferS -> libmkkernel::MkObjectS::signature …
const struct MkBufferS MkBufferCNR
const instance-struct-reference same as const struct MkBufferS, useable in a class-macro as: class##R...
#define MkBufferC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
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) …
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) …
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 …
enum MkErrorE MkBufferCastTo_RT(MK_RT mkrt, MK_BUF const buf, enum MkTypeE const typ)
change the type of an MkBufferC to type …
MK_BUF MkBufferSizeAdd_RT(MK_RT mkrt, MK_BUF const buf, MK_NUM const size)
add 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 MkBufferReset_RT(MK_RT mkrt, MK_BUF const buf)
reset a MkBufferC to the length zero …
MK_BUF MkBufferSizeNew_RT(MK_RT mkrt, MK_BUF const buf, MK_NUM const size)
alloc min size storage to the buf …
MK_BUF MkBufferCreateI8_RT(MK_RT mkrt, MK_I8 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
MK_BUF MkBufferCreateBIN_RT(MK_RT mkrt, MkBinaryR const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreateDBL_RT(MK_RT mkrt, MK_DBL 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 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 MkBufferCreateFLT_RT(MK_RT mkrt, MK_FLT const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
#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 MkBufferCreateSTR_RT(MK_RT mkrt, MK_STRN 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 MkBufferCreateI16_RT(MK_RT mkrt, MK_I16 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 …
#define MkBufferCreateTLS_T(cls, name, size)
create an new MkBufferC object as T)hread L)ocal S)torage…
MK_BUF MkBufferCreateBOL_RT(MK_RT mkrt, MK_BOL const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
struct MkBufferListS MK_BFLR
reference-shortcut for struct MkBufferListS, all shortcut using the XX_YYYR syntax (only for public A...
const struct MkBufferListS * MK_BFLN
class-shortcut for const struct MkBufferListS *, all const shortcut using the XX_YYYC syntax (only fo...
struct MkBufferListS * MK_BFL
class-shortcut for struct MkBufferListS *, all shortcut using the XX_YYY syntax (only for public API)...
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 …
struct MkBufferListS * MK_BAC
a list of 'buffer' as last argument in function …
static MK_BFL MkBufferListNext(MK_BFL const bfl)
get next instance from linked-list of MkBufferListS type
const struct MkBufferListS * MK_BACN
const - a list of 'buffer' as last argument in function …
#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.
const struct MkBufferStream1024S MkBufferStream1024CNR
const instance-struct-reference same as const struct MkBufferStream1024S, useable in a class-macro as...
struct MkBufferStream1024S MkBufferStream1024CR
instance-struct-reference same as struct MkBufferStream1024S, useable in a class-macro as: class##R …
struct MkBufferStream16384S MkBufferStream16384R
reference type of MkBufferStream16384S
#define MkBufferStream16384S_ils_size
16384 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
const struct MkBufferStream16384S MkBufferStream16384CNR
const instance-struct-reference same as const struct MkBufferStream16384S, useable in a class-macro a...
struct MkBufferStream16384S MkBufferStream16384CR
instance-struct-reference same as struct MkBufferStream16384S, useable in a class-macro as: class##R ...
#define MkBufferStream256S_ils_size
256 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
const struct MkBufferStream256S MkBufferStream256CNR
const instance-struct-reference same as const struct MkBufferStream256S, useable in a class-macro as:...
struct MkBufferStream256S MkBufferStream256CR
instance-struct-reference same as struct MkBufferStream256S, useable in a class-macro as: class##R …
#define MkBufferStream64_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
const struct MkBufferStream64S MkBufferStream64CNR
const instance-struct-reference same as const struct MkBufferStream64S, useable in a class-macro as: ...
struct MkBufferStream64S MkBufferStream64CR
instance-struct-reference same as struct MkBufferStream64S, useable in a class-macro as: class##R …
#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
const struct MkBufferStreamS * MK_BUSN
class-shortcut for const struct MkBufferStreamS *, all const shortcut using the XX_YYYC syntax (only ...
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
struct MkBufferStreamS * MK_BUS
class-shortcut for struct MkBufferStreamS *, all shortcut using the XX_YYY syntax (only for public AP...
static MK_BUS MkBufferStreamNext(MK_BUS const bus)
get next instance from linked-list of MkBufferStreamS type
struct MkBufferStreamS MK_BUSR
reference-shortcut for struct MkBufferStreamS, all shortcut using the XX_YYYR syntax (only for public...
static MK_BUS MkBufferStreamGetNull(void)
Null-Slot - return a MkBufferStreamC typed NULL instance …
static MK_BUS MkBus(MK_MNG mng)
cast a unknown-object into an MkBufferStreamS pointer or NULL if not possible
#define MkBufferStreamC_X2obj(x)
struct MkBufferStreamS MkBufferStreamCR
instance-struct-reference same as struct MkBufferStreamS, useable in a class-macro as: class##R …
static bool MkBusCheck(MK_MNGN mng)
check MkBufferStreamS -> libmkkernel::MkObjectS::signature …
const struct MkBufferStreamS MkBufferStreamCNR
const instance-struct-reference same as const struct MkBufferStreamS, useable in a class-macro as: cl...
#define MkBufferStreamC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
static bool MkBusCheckO(MK_OBJN obj)
check MkBufferStreamS -> libmkkernel::MkObjectS::signature …
MK_BFL MkBufferStreamToBFL_RT(MK_RT mkrt, MK_BUSN const bus)
convert the bus into a MkBufferListC …
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 …
MK_STRN MkBufferStreamToString_RT(MK_RT mkrt, MK_BUSN const inst)
String-Slot - returns the string representation of the inst …
void MkBufferStreamFree_RT(MK_RT mkrt, MK_BUS const bus)
init and free a MkBufferStreamS reference
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 MkBufferStreamCreate64_RT(MK_RT mkrt, MK_NUM const size)
call the BufferStreamCreate with default type MkBufferStream64S (64 byte) …
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 …
#define MkBufferStreamCreateTLS_T(cls, name)
Constructs a MkBufferStreamC instance as T)hread L)ocal S)torage …
#define MkBufferStreamCreateLOCAL_T(cls, name, size)
Constructs a MkBufferStreamC instance as L)ocal S)torage …
enum MkErrorE MkBufferStreamWriteI8_RT(MK_RT mkrt, MK_BUS const bus, MK_I8 const val)
write a PRIMITIVE TYPE 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 MkBufferStreamWriteI32_RT(MK_RT mkrt, MK_BUS const bus, MK_I32 const val)
write a PRIMITIVE TYPE 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 MkBufferStreamWriteFLT_RT(MK_RT mkrt, MK_BUS const bus, MK_FLT const val)
write a PRIMITIVE TYPE 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 MkBufferStreamWriteDBL_RT(MK_RT mkrt, MK_BUS const bus, MK_DBL const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
bool(* MkErrorSetVLF)(MK_ERREXT_ARGS, MK_OBJN const fmtobj, MK_STRN const)
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.
void(* MkErrorResetF)(MK_ERREXT_ARGS, MK_OBJN const fmtobj)
bool(* MkErrorAppendFLT)(MK_ERREXT_ARGS, MK_OBJN const fmtobj)
void(* MkErrorSetRF)(MK_ERREXT_ARGS, MK_MNGN const errctx, MK_OBJN const fmtobj)
MK_OBJN(* MkErrorFormatOfF)(MK_ERREXT_ARGS_N, int const dummy)
void(* MkErrorSetEF)(MK_ERREXT_ARGS, MK_ERREXT const newerr, MK_OBJN const fmtobj)
void(* MkErrorLogF)(MK_ERREXT_ARGS_N, MK_OBJN const, MK_DBG const, MK_STRN const, MK_I32 const, MK_STRN const, MK_OBJ const)
void(* MkErrorInit)(MK_ERREXT_ARGS, MK_OBJN const fmtobj)
bool(* MkErrorResetOnExitF)(MK_ERREXT_ARGS, MK_OBJN const fmtobj)
struct MkErrExtS * MK_ERREXT
class-shortcut for struct MkErrExtS *, all shortcut using the XX_YYY syntax (only for public API) …
const struct MkErrExtS * MK_ERREXTN
class-shortcut for const struct MkErrExtS *, all const shortcut using the XX_YYYC syntax (only for pu...
struct MkErrExtS MK_ERREXTR
reference-shortcut for struct MkErrExtS, all shortcut using the XX_YYYR syntax (only for public API) ...
static bool MkErrExtCheckO(MK_OBJN obj)
check MkErrExtS -> libmkkernel::MkObjectS::signature …
static bool MkErrExtCheck(MK_MNGN mng)
check MkErrExtS -> libmkkernel::MkObjectS::signature …
struct MkErrExtS MkErrExtCR
instance-struct-reference same as struct MkErrExtS, useable in a class-macro as: class##R …
const struct MkErrExtS MkErrExtCNR
const instance-struct-reference same as const struct MkErrExtS, useable in a class-macro as: class##R...
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
const struct MkErrorS * MK_ERRN
class-shortcut for const struct MkErrorS *, all const shortcut using the XX_YYYC syntax (only for pub...
static MK_ERR MkErrorNext(MK_ERR const err)
get next instance from linked-list of MkErrorS type
struct MkErrorS MK_ERRR
reference-shortcut for struct MkErrorS, all shortcut using the XX_YYYR syntax (only for public API) …
struct MkErrorS * MK_ERR
class-shortcut for struct MkErrorS *, all shortcut using the XX_YYY syntax (only for public API) …
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 MkErrorInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkErrorS type …
const struct MkErrorS MkErrorCNR
const instance-struct-reference same as const struct MkErrorS, useable in a class-macro as: class##R ...
#define MkErrorC_X2obj(x)
static bool MkErrCheckO(MK_OBJN obj)
check MkErrorS -> libmkkernel::MkObjectS::signature …
static MK_ERR MkErr(MK_MNG mng)
cast a unknown-object into an MkErrorS pointer or NULL if not possible
#define MkErrorC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
struct MkErrorS MkErrorCR
instance-struct-reference same as struct MkErrorS, useable in a class-macro as: class##R …
static bool MkErrCheck(MK_MNGN mng)
check MkErrorS -> libmkkernel::MkObjectS::signature …
enum MkErrorE MkErrorGetCode(MK_ERRN const err)
get the value of MkErrorS::code …
MK_SIZE MkErrorGetSize(MK_ERRN const err)
get the error-message-size from the exception-object …
#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 …
#define MkErrorGetTextI(e)
get the MkErrorS::text …
#define MkErrorGetNumI(e)
get the MkErrorS::num. The number can be used as exit-code …
MK_I32 MkErrorGetNum(MK_ERRN const err)
get the MkErrorS::num. The number can be used as exit-code …
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 libmkkernel::MK_OK …
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 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 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 MkErrorRaise_RT(MK_RT mkrt, MK_ERRN const err)
convert an ccmkkernel error into an programming-language-error and raise afterwards....
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 …
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 ccmkkernel error …
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) …
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 …
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 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 MkDisasterSignal(MK_I32 signal)
called if something get REALLY wrong …
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 …
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 …
#define MkErrorSetV_2M(err, printfmt,...)
void MkPanicDEFAULT_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc) MK_NO_RETURN
make panic from libmkkernel::MkErrorDEFAULT_RT …
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 …
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 …
bool MkErrorIsTIMEOUT(MK_ERRN const err)
check on TIMEOUT error …
bool MkErrorIsSOCKET(MK_ERRN const err)
check on SOCKET-DOWN error …
void MkErrorSetCONTINUE_RT(MK_RT mkrt, MK_ERR const err)
signal end of processing in an MqMqEventIF callback …
void MkErrorSetCode_RT(MK_RT mkrt, MK_ERR const err, enum MkErrorE code)
set the MkErrorS::code value …
enum MkErrorE MkErrorSetSOCKET_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const detail, MK_STRN const callfunc)
create SOCKET-DOWN error …
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 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…
bool MkErrorIsABORT(MK_ERRN const err)
check on ABORT signal …
bool MkErrorIsEXIT(MK_ERR const err)
check on APPLICATION-EXIT error …
MK_ERR MkErrorFORMAT_EO(MK_OBJN fmtobj)
same as [static] MkErrorC* MkErrorC::DEFAULT() but do not set the MkERROR.format_of_error attribute 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 …
#define MkErrorFORMAT_1O(o)
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 …
static MK_ERR MkErrorEXIT_RT(MK_RT mkrt)
panic-system-error - panic on next error …
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...
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 …
const struct MkErrorDefaultS MkErrorDefaultCNR
const instance-struct-reference same as const struct MkErrorDefaultS, useable in a class-macro as: cl...
struct MkErrorDefaultS MkErrorDefaultCR
instance-struct-reference same as struct MkErrorDefaultS, useable in a class-macro as: class##R …
struct MkErrorExitS MkErrorExitCR
instance-struct-reference same as struct MkErrorExitS, useable in a class-macro as: class##R …
const struct MkErrorExitS MkErrorExitCNR
const instance-struct-reference same as const struct MkErrorExitS, useable in a class-macro as: class...
const struct MkErrorIgnoreS MkErrorIgnoreCNR
const instance-struct-reference same as const struct MkErrorIgnoreS, useable in a class-macro as: cla...
struct MkErrorIgnoreS MkErrorIgnoreCR
instance-struct-reference same as struct MkErrorIgnoreS, useable in a class-macro as: class##R …
const struct MkErrorPanicS MkErrorPanicCNR
const instance-struct-reference same as const struct MkErrorPanicS, useable in a class-macro as: clas...
struct MkErrorPanicS MkErrorPanicCR
instance-struct-reference same as struct MkErrorPanicS, useable in a class-macro as: class##R …
const struct MkErrorPrintS MkErrorPrintCNR
const instance-struct-reference same as const struct MkErrorPrintS, useable in a class-macro as: clas...
struct MkErrorPrintS MkErrorPrintCR
instance-struct-reference same as struct MkErrorPrintS, useable in a class-macro as: class##R …
bool MkExceptionCheck(MK_EXP exception)
Checks if Exception is of type MkExceptionC and returns true or false …
void MkExceptionRaise(MK_MNG const expobj, MK_STRN const callfunc, MK_I32 const callline)
convert an MkErrorC into a Target-Programming-Language (TPL) exception …
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 …
MK_EXT MkExtensionAdd_RT(MK_RT mkrt, MK_EXT head, MK_EXT add)
this is an update to head, use: head = MkExtensionAdd(head, add)
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 libmkkernel::MkExtensionS MkExtensionS
Base class for the extension technologie …
#define MkExtension_size
maximum number of runtime-extensions useable in a theKernel software.
bool MkExtensionDeleteAll_RT(MK_RT mkrt, MK_EXT head)
struct MkExtensionS * MK_EXT
class-shortcut for struct MkExtensionS *, all shortcut using the XX_YYY syntax (only for public API) ...
const struct MkExtensionS * MK_EXTN
class-shortcut for const struct MkExtensionS *, all const shortcut using the XX_YYYC syntax (only for...
struct MkExtensionS MK_EXTR
reference-shortcut for struct MkExtensionS, all shortcut using the XX_YYYR syntax (only for public AP...
struct MkExtensionS MkExtensionCR
instance-struct-reference same as struct MkExtensionS, useable in a class-macro as: class##R …
const struct MkExtensionS MkExtensionCNR
const instance-struct-reference same as const struct MkExtensionS, useable in a class-macro as: class...
static bool MkExtCheck(MK_MNGN mng)
check MkExtensionS -> libmkkernel::MkObjectS::signature …
static bool MkExtCheckO(MK_OBJN obj)
check MkExtensionS -> libmkkernel::MkObjectS::signature …
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 ...
static bool MkBinaryIsNull(const MkBinaryR bin)
check if binary is NULL ...
static MkBinaryR MkBinaryDup_RT(MK_RT mkrt, const MkBinaryR bin)
create a binary as duplicate from an already existsing MkBinaryR ...
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 ...
MK_PTR(* MkCacheCF)(MK_RT mkrt, MK_PTR const)
void(* MkCacheDF)(MK_RT mkrt, MK_PTR *const)
#define MK_NULL_STR
the string "MK_NULL" value as MK_NULL_STR …
#define MK_PARSER_fmtobj
use param_fmtobj for documentation
static bool MK_NULL_STR_OR_EMPTY_CHECK_1(char const *const __str)
same as libmkkernel::MK_NULL_STR_CHECK together with "" check but without len parameter
#define MK_NO_RETURN
dosable "MK_NO_RETURN" because C# require "return" from "MqExit" for thread-pool support
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_EXTERN
static library
#define MK_UNUSED
mark unnused variables and functions
static bool MK_NULL_STR_CHECK_1(char const *const __str)
same as libmkkernel::MK_NULL_STR_CHECK but without len parameter
#define MK_NULL
The Programming-Language-Micro-Kernel (PLMK) NULL value as MK_NULL in C++ …
void * MK_MACRO_TYP
helper-type used to declare a prototype for a macro
#define MK_NULL_STR_LEN
the integer strlen("MK_NULL") value as MK_NULL_STR_LEN …
MK_STRN MkBoolE_ToString(enum MkBoolE value)
return the MkBoolE as string …
MK_STRN MkErrorE_ToString(enum MkErrorE value)
return the MkErrorE as string …
enum MkErrorE MkIdSE_FromInt(MK_I32 const value, enum MkIdSE *value_out)
return the MkIdSE from integer …
enum MkErrorE MkNativeIsE_FromInt(MK_I32 const value, enum MkNativeIsE *value_out)
return the MkNativeIsE from integer …
#define MK_TYPE_IS_1_I8E
the type is native and has a size of 1 byte …
MkTypeE
basic data-types supported by Programming-Language-Micro-Kernel (PLMK) …
static MK_I32 MkTypeE_ToInt(enum MkTypeE value)
return the MkTypeE as integer …
MkTimeoutE
Predefined Timeout values …
#define MK_TYPE_IS_2_I8E
the type is native and has a size of 2 bytes …
static MK_I32 MkTimeoutE_ToInt(enum MkTimeoutE value)
return the MkTimeoutE as integer …
MkNativeIsE
define if data is string or little or big endian …
#define MK_TYPE_SHIFT
FIXED: type is only 8bit -> 4 bit=15 for type and 4 bit for flag …
static MK_I32 MkBoolE_ToInt(enum MkBoolE value)
return the MkBoolE as integer …
MkBoolE
the internal boolean …
MK_STRN MkIdSE_ToString(enum MkIdSE value)
return the MkIdSE as string …
#define MK_TYPE_IS_8_I8E
the type is native and has a size of 8 bytes …
MkErrorE
collection for the different error-codes …
MK_STRN MkNativeIsE_ToString(enum MkNativeIsE value)
return the MkNativeIsE as string …
MK_STRN MkTypeE_ToString(enum MkTypeE value)
return the MkTypeE as string …
static MK_I32 MkNativeIsE_ToInt(enum MkNativeIsE value)
return the MkNativeIsE as integer …
static MK_I32 MkErrorE_ToInt(enum MkErrorE value)
return the MkErrorE as integer …
enum MkErrorE MkErrorE_FromInt(MK_I32 const value, enum MkErrorE *value_out)
return the MkErrorE from integer …
enum MkErrorE MkTypeE_FromInt(MK_I32 const value, enum MkTypeE *value_out)
return the MkTypeE from integer …
#define MK_TYPE_IS_4_I8E
the type is native and has a size of 4 bytes …
MK_STRN MkTimeoutE_ToString(enum MkTimeoutE value)
return the MkTimeoutE as string …
enum MkErrorE MkBoolE_FromInt(MK_I32 const value, enum MkBoolE *value_out)
return the MkBoolE from integer …
enum MkErrorE MkTimeoutE_FromInt(MK_I32 const value, enum MkTimeoutE *value_out)
return the MkTimeoutE from integer …
static MK_I32 MkIdSE_ToInt(enum MkIdSE value)
return the MkIdSE as integer …
@ MK_I8T
Y: 1 byte 'byte' type.
@ MK_I16T
S: 2 byte 'short' type.
@ MK_FLTT
F: 4 byte 'float' type.
@ MK_DBLT
D: 8 byte 'double' type.
@ MK_STRT
C: X byte 'string' type (e.g. with a \0 at the end)
@ MK_TIMEOUT_SHORT
short timeout in sec (20 sec) …
@ MK_TIMEOUT_INIT
maximum timeout in sec (900 sec) …
@ MK_TIMEOUT_VERYSHORT
very short timeout in sec (5 sec) …
@ MK_TIMEOUT_LONG
long timeout in sec (180 sec) …
@ 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_NATIVE_IS_INITIAL
0 = initial value
@ MK_NATIVE_IS_STRING
S = using of the string protocol.
@ MK_CONTINUE
(transient) raise an continue-event, the calling-function must handle this.
@ MK_OK
(persistent) everything is OK.
@ MK_ERROR
(persistent) raise an error-event, the calling-fucntion is interrupted.
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 …
static MkStringR MkStringCreate(MK_NUM len, MK_STRN str)
create a str from ptr and len ...
static bool MkStringIsNULL(MkStringR const strR)
check if strR is MK_NULL_STR return true or false …
static MK_NUM MkStringGetSize(MkStringR const str)
get len from the string ...
static MkStringR MkStringDup_RT(MK_RT mkrt, MkStringR const str)
create a string as duplicate from an already existsing MkBinaryR ...
static MkStringR MkStringCreate_1(MK_STRN str)
create a str from ptr use MK_NULL as end-of-string ...
static MK_STRN MkStringGetData(MkStringR const str)
get ptr pointer from the string ...
static void MkStringLog_RT(MK_RT mkrt, MkStringR const str, MK_STRN func)
log the string ...
static MkStringR MkStringSlice(MkStringR strR, MK_NUM start, MK_NUM len)
create a slice of strR start at start with max len bytes …
static void MkStringSplit(MkStringR strR, MK_NUM *len_out, MK_STRN *str_out)
split a str into ptr and len …
const MK_PTRB * MK_PTRN
const generic pointer data-type
unsigned long long MK_U64
double MK_DBL
8 byte double data-type
MK_PTRB * MK_MNG
managed object pointer, datatype will be checked at runtime
unsigned char MK_LSTB
list type data-type
unsigned char MK_BINB
byte-array type data-type
unsigned char MK_BOL
1 byte boolean data-type
union MkBufferAtomU MK_ATO
8 byte atom data-type
signed char MK_I8
1 byte byte data-type
MK_PTRB * MK_CBP
generic pointer to call-back data
float MK_FLT
4 byte float data-type
signed long long MK_I64
8 byte wide integer data-type
MK_PTRB * MK_MXP
MkExceptionC object pointer.
MK_BINB const * MK_BINN
const byte-array pointer data-type
long MK_LONG
4/8 byte long data-type
MK_BINB * MK_BIN
byte-array pointer data-type with binary encoding (MK_BINN)
MK_LSTB * MK_LST
list pointer data-type
MK_STRB const * MK_FST
const format string pointer data-type
bool MK_BOOL
real bool data-type
int32_t MK_HDL
4 byte int handle data-type
MK_PTRB * MK_CCP
class constructor/destructor data type
int32_t MK_NUM
array size data-type ('num' items in array …
char MK_STRB
string type data-type
signed short int MK_I16
2 byte short data-type
int MK_DBG
debug-level data-type …
signed int MK_I32
4 byte integer data-type
MK_STRB * MK_STR
string pointer data-type with UTF8 ecoding (MK_STR)
MK_UNUSED static const MK_STRN_A MK_STRN_A_NULL
unsigned int MK_SIG
signature datatype
MK_PTRB * MK_PTR
generic pointer data-type
const MK_PTRB * MK_MNGN
const - a managed object pointer, datatype will be checked at runtime
MK_PTRB const * MK_EXP
exception object pointer
const MK_STRB * MK_STRN
constant string pointer data-type
void MK_PTRB
pointer type data-type
struct libmkkernel::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 MkLogFileInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkLogFileS type …
static MK_LFL MkLogFileGetNull(void)
Null-Slot - return a MkLogFileC typed NULL instance …
struct MkLogFileS * MK_LFL
class-shortcut for struct MkLogFileS *, all shortcut using the XX_YYY syntax (only for public API) …
static MK_LFL MkLogFilePrev(MK_LFL const lfl)
get previous instance from linked-list of MkLogFileS type
struct MkLogFileS MK_LFLR
reference-shortcut for struct MkLogFileS, all shortcut using the XX_YYYR syntax (only for public API)...
static MK_LFL MkLogFileNext(MK_LFL const lfl)
get next instance from linked-list of MkLogFileS type
const struct MkLogFileS * MK_LFLN
class-shortcut for const struct MkLogFileS *, all const shortcut using the XX_YYYC syntax (only for p...
static bool MkLflCheckO(MK_OBJN obj)
check MkLogFileS -> libmkkernel::MkObjectS::signature …
struct MkLogFileS MkLogFileCR
instance-struct-reference same as struct MkLogFileS, useable in a class-macro as: class##R …
#define MkLogFileC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MkLogFileC_X2obj(x)
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 -> libmkkernel::MkObjectS::signature …
const struct MkLogFileS MkLogFileCNR
const instance-struct-reference same as const struct MkLogFileS, useable in a class-macro as: class##...
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 …
void MkLogFileClose_RT(MK_RT mkrt, MK_LFL lfh)
Destructor - delete a MkLogFileC instance …
enum MkErrorE MkLogFileWriteVL_RT(MK_RT mkrt, MK_LFLN lfl, MK_FST printfmt, va_list var_list)
write to log-file …
enum MkErrorE MkLogFileWriteV_RT(MK_RT mkrt, MK_LFLN lfl, MK_FST printfmt,...)
write to log-file …
void(* MkLogF)(MK_RT mkrt, MK_OBJN const obj, MK_OBJN fmt, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
MK_STRN(* MkToStringF)(MK_RT mkrt, MK_OBJN const obj)
MK_OBJ(* MkResetF)(MK_RT mkrt, MK_OBJ const obj)
void(* MkDestructorF)(MK_RT mkrt, MK_OBJ const obj)
MK_PTR(* MkAllocCreateFLT)(MK_RT mkrt, MK_TYP const type)
void(* MkSelfDeleteF)(MK_RT mkrt, MK_PTR self, MK_PTR const env)
#define __MkCheckX(cls, x)
MK_OBJ(* MkCopyF)(MK_RT mkrt, MK_OBJ const obj, MK_OBJN const src)
void(* MkSelfUnlinkF)(MK_RT mkrt, MK_PTR self, MK_PTR const env)
void(* MkTypeInitF)(MK_RT mkrt, MK_TYP const type)
MK_OBJ(* MkDup2F)(MK_RT mkrt, MK_OBJN const obj, MK_STRN const ident)
#define MkSanitizeCheck(_root, _m)
MK_PTR(* MkSelfCreateF)(MK_RT mkrt, MK_OBJ const obj, MK_PTR const env)
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)
MK_OBJ(* MkMergeF)(MK_RT mkrt, MK_OBJ const obj)
#define MkDbgDeepWriter(...)
void(* MkAllocDeleteF)(MK_RT mkrt, MK_TYP const type, MK_PTR ptr)
MK_OBJ(* MkDupF)(MK_RT mkrt, MK_OBJN const obj)
MK_OBJ(* MkConstructorF)(MK_RT mkrt, MK_TYP type, MK_PTR nat, MK_PTR lnk)
#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…
static MK_OBJ MkObjectPrev(MK_OBJ const obj)
get previous instance from linked-list of MkObjectS type
bool MkObjectHandleExists(MK_OBJ const obj)
check if obj has already a handle defined…
#define MkObjectHandleResolve(...)
static MK_OBJ MkObjectInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkObjectS type …
#define MkObjectHandleGet(...)
const struct MkObjectS * MK_OBJN
class-shortcut for const struct MkObjectS *, all const shortcut using the XX_YYYC syntax (only for pu...
struct MkObjectS MK_OBJR
reference-shortcut for struct MkObjectS, all shortcut using the XX_YYYR syntax (only for public API) ...
static MK_HDL MkObjectHandleGetOfType(MK_OBJ const obj)
Export-Slot - returns typeHdl of the obj .
void MkObjectHandleDeleteByNetHdl_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Delete-Slot - delete a netHdl from handle-storage …
static MK_OBJ MkObjectGetNull(void)
Null-Slot - return a MkObjectC typed NULL instance …
MK_HDL MkObjectHandleGetOr0(MK_OBJ const obj)
return export-hdl or 0 in not created…
void MkObjectHandleDelete_RT(MK_RT mkrt, MK_OBJ const netObj)
Handle-Delete-Slot - delete a netObj from handle-storage …
static MK_OBJ MkObjectNext(MK_OBJ const obj)
get next instance from linked-list of MkObjectS type
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
struct MkObjectS * MK_OBJ
class-shortcut for struct MkObjectS *, all shortcut using the XX_YYY syntax (only for public API) …
#define MkObjectC_X2obj(x)
struct MkObjectS MkObjectCR
instance-struct-reference same as struct MkObjectS, useable in a class-macro as: class##R …
static bool MkObjCheck(MK_MNGN mng)
check MkObjectS -> libmkkernel::MkObjectS::signature …
#define MkOBJ(x)
cast a known-object into an MkObjectS pointer
static bool MkObjCheckO(MK_OBJN obj)
check MkObjectS -> libmkkernel::MkObjectS::signature …
#define MkObjectC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
const struct MkObjectS MkObjectCNR
const instance-struct-reference same as const struct MkObjectS, useable in a class-macro as: class##R...
void MkDbgO_RT(MK_RT mkrt, MK_OBJN const obj, MK_STRN const callfunc)
debug: write the object-details to MkLogFileC (default: stderr) …
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) …
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 …
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 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 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 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 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 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 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 …
MK_STRN const MkObjectToName_RT(MK_RT mkrt, MK_OBJN const obj)
Info-Slot - returns brief information about the obj as a string
static bool MkObjectIsNull(MK_OBJ const obj)
ckeck if the object is MK_NULL
MK_STRN MkObjectToNameOfClass_RT(MK_RT mkrt, MK_OBJ const obj)
Class-Slot - returns the C++-Class-Name of the obj as string
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.
#define MkObjectToString(...)
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_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 ccmkkernel error …
static MK_PTR MkSelfGet(MK_OBJ const obj)
get the MkObjectS::self value
void(* MkSelfIncrF)(MK_RT mkrt, MK_PTR self, MK_PTR const env)
static void MkSelfSet(MK_OBJ const obj, MK_PTR const self, MK_PTR const env)
set the MkObjectS::self value
#define MkSelfCreate(...)
void(* MkSelfDecrF)(MK_RT mkrt, MK_PTR self, MK_PTR const env)
static void MkRefIncrSelf(MK_OBJ const obj, MK_PTR const self, MK_PTR const env)
ATOMIC operation -> link self with reference-count.
MK_NUM MkRefCidN_RT(MK_RT mkrt)
return the reference-count-recursion-level
static MK_I32 MkRefGet(MK_OBJ const obj)
get the reference-count
#define MkRefLOCK
unchangeable reference
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
static bool MkSelfExists(MK_OBJN obj)
Check if the MkObjectS::self exists …
static MK_I32 MkRefLock(MK_OBJ const obj)
lock the object
MK_OBJ MkRefDecrWithUnlinkSelf_RT(MK_RT mkrt, MK_OBJ const obj)
ATOMIC operation -> unlink self from META und decr-ref-count in META.
MK_OBJ MkRefDecrWithoutSelf_RT(MK_RT mkrt, MK_OBJ const obj)
ATOMIC operation -> unlink self with reference-count.
MK_OBJ MkObjCopy_RT(MK_RT mkrt, MK_OBJ const tgtmng, MK_OBJN const srcmng)
call the copy from the object
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 …
void MkSysFreeP(MK_PTR data)
free syscall with ccmkkernel error plugin
static enum MkErrorE MkSysSleep(MK_OBJN fmtobj, MK_I32 const sec)
sleep syscall with ccmkkernel error plugin
static int MkSysExit_RT(MK_RT mkrt, int isThread, int num)
exit syscall with ccmkkernel error plugin
MK_PTR(* MkSysCallocF)(size_t, size_t)
calloc syscall …
static enum MkErrorE MkSysWaitForThread(MK_OBJN fmtobj, MK_IDNT const id)
wait for thread to finish syscall with ccmkkernel error plugin
MK_PTR(* MkSysMallocF)(size_t)
malloc syscall …
#define MkSysPrintStackTrace_2(fmtobj, debug)
#define MkSysStringIsLenEQUAL(_str, _other, _len)
MK_STR(* MkSysStrNCpyF)(char *, const char *, size_t)
strdup strncpy …
MkIdSE
signal type of the MkIdS data val …
static MK_STRN MkSysStringGetNoNULL(MK_STRN str)
get string "" or VALUE …
MK_STR MkSysBasename_RT(MK_RT mkrt, MK_STRN const pathName, bool const includeExtension)
basename syscall with ccmkkernel error plugin
enum MkErrorE(* MkSysWaitF)(MK_OBJN const fmtobj, MK_IDNT const id)
wait for process to finish syscall with ccmkkernel error plugin
MK_STR MkSysDirname_RT(MK_RT mkrt, MK_STRN const pathName)
dirname syscall with ccmkkernel error plugin
uintptr_t MK_IDNT
process or thread identifier …
int(* MkSysExitF)(MK_RT mkrt, int isThread, int num)
static bool MkSysStringIsNULL(MK_STRN str)
test if string is NULL or EMPTY …
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…
#define MkSysFree(pointer)
pid_t(* MkSysForkF)(void)
fork syscall …
#define MkSysStringSetNULL_R(_str)
MK_STR(* MkSysStrNDupF)(MK_STRN, size_t)
strndup syscall …
MK_STR(* MkSysStrDupF)(MK_STRN)
strdup syscall …
struct MkLalS MkLal
Language Abstraction Layer in duty.
#define MkSysStringIsNULL_R(_str)
#define MkSysStringSet_R(_str, _val)
#define MkSysStringIsEQUAL(_str, _other)
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 ccmkkernel error plugin
void MkSysPipeHandler(MkSysPipeHandlerE keepPipe)
internal support for pipe ignore
static bool MkSysStringIsNotNULL(MK_STRN str)
test if string is NOT NULL or EMPTY …
MK_STRN MkSysHashSTR(MK_STRN key, MK_NUM length)
compute the HASH from a string …
#define MkSysFreeNonNull(pointer)
void(* MkSysFreeF)(MK_PTR)
free syscall …
MK_STR MkSysPrintF_RT(MK_RT mkrt, MK_STRN const format,...)
sprintf syscall with ccmkkernel error plugin
static enum MkErrorE MkSysUSleep(MK_OBJN fmtobj, useconds_t const usec)
usleep syscall with ccmkkernel error plugin
MK_PTR(* MkSysReallocF)(MK_PTR, size_t)
realloc syscall …
MK_PTR MkSysMemDup(MK_OBJN fmtobj, MK_PTRN const blck, size_t const size)
memdup syscall with ccmkkernel error plugin
static MK_STRN MkSysStringGet(MK_STRN str)
get string NULL or VALUE …
@ MK_ID_UNUSED
empty struct
@ MK_ID_PROCESS
val has a process handle
@ MK_ID_THREAD
val has a thread handle
void MkObjectDeleteCallbackCleanup_RT(MK_RT mkrt, MK_STRN ident)
cleanup the DeleteCallback installed with MkObjectDeleteCallbackSetup …
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
MK_OBJ MkObjDup_RT(MK_RT mkrt, MK_OBJ const srcobj)
call the Dup-Constructor from the object
void MkObjectDispose_RT(MK_RT mkrt, MK_OBJ obj)
Dispose-Slot - untie the connection between the Native-C++-Instance and the ccmkkernel-Instance.
#define MkObjectDeleteCallF_ARGS
the libmkkernel::MkObjectDeleteCallF arguments with default names
MK_OBJ MkObjMerge_RT(MK_RT mkrt, MK_OBJ const obj)
Constructor - create a new object as a merge from an existing object
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 MkObjectDelete_RT(MK_RT mkrt, MK_OBJ obj)
Delete-Slot - delete an instance.
#define MkObjectDeleteFreeF_ARGS
the libmkkernel::MkObjectDeleteFreeF arguments with default names
struct MkRtExtS MK_RTEXTR
reference-shortcut for struct MkRtExtS, all shortcut using the XX_YYYR syntax (only for public API) …
const struct MkRtExtS * MK_RTEXTN
class-shortcut for const struct MkRtExtS *, all const shortcut using the XX_YYYC syntax (only for pub...
struct MkRtExtS * MK_RTEXT
class-shortcut for struct MkRtExtS *, all shortcut using the XX_YYY syntax (only for public API) …
const struct MkRtExtS MkRtExtCNR
const instance-struct-reference same as const struct MkRtExtS, useable in a class-macro as: class##R ...
static bool MkRtExtCheck(MK_MNGN mng)
check MkRtExtS -> libmkkernel::MkObjectS::signature …
static bool MkRtExtCheckO(MK_OBJN obj)
check MkRtExtS -> libmkkernel::MkObjectS::signature …
struct MkRtExtS MkRtExtCR
instance-struct-reference same as struct MkRtExtS, useable in a class-macro as: class##R …
struct libmkkernel::MkThreadDataS MkThreadDataS
bool MkRuntimeSysPipeHandlerUse
block SIGPIPE ignore handlern default=true, Java require this
#define MkRuntimeHandleResolve(...)
#define MkRuntimeHandleGet(...)
const struct MkRuntimeS * MK_RTN
class-shortcut for const struct MkRuntimeS *, all const shortcut using the XX_YYYC syntax (only for p...
static MK_RT MkRuntimeInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkRuntimeS type …
static MK_RT MkRuntimeNext(MK_RT const rt)
get next instance from linked-list of MkRuntimeS type
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
#define MkRuntimeInstances()
static MK_RT MkRuntimeGetNull(void)
Null-Slot - return a MkRuntimeC typed NULL instance …
static MK_RT MkRuntimePrev(MK_RT const rt)
get previous instance from linked-list of MkRuntimeS type
struct MkRuntimeS * MK_RT
class-shortcut for struct MkRuntimeS *, all shortcut using the XX_YYY syntax (only for public API) …
struct MkRuntimeS MK_RTR
reference-shortcut for struct MkRuntimeS, all shortcut using the XX_YYYR syntax (only for public API)...
#define MkRuntimeC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
const struct MkRuntimeS MkRuntimeCNR
const instance-struct-reference same as const struct MkRuntimeS, useable in a class-macro as: class##...
static bool MkRtCheck(MK_MNGN mng)
check MkRuntimeS -> libmkkernel::MkObjectS::signature …
static MK_RT MkRt(MK_MNG mng)
cast a unknown-object into an MkRuntimeS pointer or NULL if not possible
#define MkRuntimeC_X2obj(x)
struct MkRuntimeS MkRuntimeCR
instance-struct-reference same as struct MkRuntimeS, useable in a class-macro as: class##R …
static bool MkRtCheckO(MK_OBJN obj)
check MkRuntimeS -> libmkkernel::MkObjectS::signature …
void MkRuntimeSetCID(MK_OBJ const cid)
CID == context-in-duty.
MkLogDataS MkRuntimeLogTargetPush_RT(MK_RT mkrt, MK_STRN logTgt)
enum MkErrorE MkRuntimeLogTargetSet_RT(MK_RT mkrt, MK_STRN logTgt)
set the MkRuntimeS::log value and cleanup old value …
void MkRuntimeLogTargetPop_RT(MK_RT mkrt, MkLogDataS logOld)
static void MkRuntimeIsSilentSet_RT(MK_RT mkrt, bool silent)
set the MkRuntimeS::isSilent value …
static void MkRuntimeDebugSet(MK_I32 dbg)
set the MkRuntimeS::debug value …
static bool MkRuntimeIsSilentGet(void)
get the MkRuntimeS::isSilent value …
#define MkRuntimeLogBufferPush()
static void MkRuntimeNoDecoSet_RT(MK_RT mkrt, bool noDeco)
set the MkRuntimeS::noDeco value …
static enum MkErrorE MkRuntimeErrorGetCode_RT(MK_RT mkrt)
return libmkkernel::MkErrorS::code from a given MkRuntimeC …
enum MkErrorE MkRuntimeLogTargetReset_RT(MK_RT mkrt)
set the MkRuntimeS::log value to the DEFAULT value …
#define MkRuntimeLogBufferPop()
static MK_STRN MkRuntimeLogTargetGet(void)
get the MkLogDataS::logNAME value …
static MK_I32 MkRuntimeDebugGet(void)
get the MkRuntimeS::debug value …
static MK_RT MkRuntimeGet(void)
return a initialized MkRuntimeRLS …
#define MkRtSetup_ON_RT(o)
#define MK_ATTR_RT_INSTANCE
static MK_RT MkRuntimeGetFromObj(MK_OBJ obj)
return the initialized MkRuntimeRLS from an obj …
MK_RT MkRuntimeSetup(MK_RT const mkrt)
initialize MkRuntimeRLS …
#define MK_RT_ATTR_FORMAT_4
size_t MkRuntimeCallbackAdd(MK_RT mkrt, MkRuntimeCallbackS *cbdata, MkRuntimeInitF rt_callback, MK_STRN ident)
add a callback to the runtime …
void MkRuntimeCleanup(MK_RT mkrt)
cleanup MkRuntimeRLS …
#define MK_INSTANCE_RT_O(o)
#define MK_RT_ATTR_FORMAT_1
#define MK_RT_ATTR_FORMAT_2
void(* MkRuntimeInitF)(MK_RT mkrt)
additional runtime initialization function …
#define MK_PARSER_RT_ONLY
#define MK_ATTR_RT_STATIC
struct libmkkernel::MkRuntimeCallbackS MkRuntimeCallbackS
keep callback related data …
void MkRuntimeCallbackDel(MK_RT mkrt, MkRuntimeCallbackS *cbdata)
delete a callback from the runtime …
#define MK_INSTANCE_HDL(x)
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
MK_PTR MkTypeSlotResolveP(MK_RT mkrt, MK_TYPN const type, size_t const offset, bool const force)
hidden function for MkTypeSlotResolve
const struct MkTypeS * MK_TYPN
class-shortcut for const struct MkTypeS *, all const shortcut using the XX_YYYC syntax (only for publ...
struct MkTypeS MK_TYPR
reference-shortcut for struct MkTypeS, all shortcut using the XX_YYYR syntax (only for public API) …
struct MkTypeS * MK_TYP
class-shortcut for struct MkTypeS *, all shortcut using the XX_YYY syntax (only for public API) …
const struct MkTypeS MkTypeCNR
const instance-struct-reference same as const struct MkTypeS, useable in a class-macro as: class##R …
struct MkTypeS MkTypeCR
instance-struct-reference same as struct MkTypeS, useable in a class-macro as: class##R …
static bool MkTypCheckO(MK_OBJN obj)
check MkTypeS -> libmkkernel::MkObjectS::signature …
static bool MkTypCheck(MK_MNGN mng)
check MkTypeS -> libmkkernel::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 …
MK_TYP MkTypeResolve_RT(MK_RT mkrt, MK_TYPN const typ)
resolve a new type
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_OBJ MkTypeAlloc_RT(MK_RT mkrt, MK_TYPN const typ)
alloc instance-memory for MkTypeS …
#define MkTypeCreate(clsV, basicV, identV)
void MkTypeDelete_RT(MK_RT mkrt, MK_TYP const typ)
delete a type object
static MK_TYPN MkTypeNextN(MK_TYPN const typ)
get next instance from linked-list of MkObjectS type
const struct MkTypeDefS MkTypeDefCNR
const instance-struct-reference same as const struct MkTypeDefS, useable in a class-macro as: class##...
struct MkTypeDefS MkTypeDefCR
instance-struct-reference same as struct MkTypeDefS, useable in a class-macro as: class##R …
static MK_OBJ MkObjectInstancesOfType_RT(MK_RT mkrt, MK_SIG typeSIG)
return the head-instance from a specific type defined by signature typeSIG …
MK_OBJN format_of_error
used to format the error-message and as input for source_of_error
MkSysWaitF MkSysWaitForThreadCB
wait for process to finish syscall with ccmkkernel error plugin
MkSysWaitF MkSysWaitForProcessCB
wait for process to finish syscall with ccmkkernel error plugin
enum MkErrorE(* SysSleep)(MK_OBJN const obj, unsigned int const sec)
sleep syscall with ccmkkernel error plugin
enum MkErrorE(* SysUSleep)(MK_OBJN const obj, unsigned int const usec)
usleep syscall with ccmkkernel error plugin
bool isSilent
write (false) or don't write (true) any message to MkLogFileC (default: stderr) (default: false) …
bool noDeco
do not use decoration to generate log messages (default: use decoration) …
MK_NUM len
len of the string data