theKernel 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - cs - py - rb - jv - cc
Loading...
Searching...
No Matches
LibMkKernel_mk.h
Go to the documentation of this file.
1
12/* LABEL-NO */
13
14#ifndef KERNEL_MK_H
15#define KERNEL_MK_H
16
17# ifndef PARSE_C_HEADER_TO_META
18# include "debug_mk.h"
19# endif
20
21// MARK_D ################################################################
22// -----------------------------------------------------------------------
23// documentation order
42
59
66
80
94
107
118
125
141
150
151// =========================================================================================
152// Config: configure definitions
153
154// define: META_HAS_THREAD
155// source: msgque_config.h - set with the "configure" script
156// default: depend on how the LNG and libmqmsgque was compiled
157// definition: 1. if defined the T)hread L)ocal S)torage is used.
158// 2. the "runtime" command-line-artgumen "mkrt" as FIRST parameter is set
159// 3. if "libmqmsgque" was compiled with META_HAS_THREAD this have to be set as well.
160
161#ifndef META_HAS_THREAD
162 #error "META_HAS_THREAD was NOT defined, require 1 or 0, forget to include 'theKernel/c/compiler.mk' ?"
163#endif
164
165// =========================================================================================
166// Makefile: CPPFLAGS definitions
167
168// define: META_IGNORE_EXTERN
169// source: Makefile
170// default: not set
171// definition: If the source-code is direct used in an external library (example: C++)
172// (without dynamic linking) and this library should *not* export
173// the symbol's of libmsgque then the flag META_IGNORE_EXTERN have
174// to be set
175
176// define: META_COMPILE_AS_CC
177// source: Makefile, CPPFLAGS=-DMETA_COMPILE_AS_CC
178// target: "C" main header file like 'kernel_mk.h'
179// default: only set by "ccmqmsgque" to compile "C" code as "C++" code with "namespace" support
180// definition: The preprocessor flag "META_COMPILE_AS_CC" is ONLY used together with the C++ compiler.
181// If the "META_COMPILE_AS_CC" flag is set, the C-code is not compiled into an independent library,
182// but translated directly into the C++ library together with the additional C++ code as C++ code in
183// the "libmkkernel" namespace. The difference is that the C code is additionally validated as "C++"
184// syntax and supports the C++ calling convention. Without "META_COMPILE_AS_CC" the C code is
185// compiled with "extern C" in the C++ compiler.
186//
187// The following changes are done:
188// 1. libmkkernel -> compile the code into "namespace libmkkernel"
189// 2. libmqmsgque -> compile the code into "namespace libmqmsgque"
190// 3. liblcconfig -> compile the code into "namespace liblcconfig"
191
192// =========================================================================================
193// Header: build control
194
195// define: MK_C_BUILD_DLL
196// source: Makefile
197// target: api-header and kernel_mk.h
198// default: set at build of the 'libmkkernel' library but NOT set for other libraries
199// definition: this define has two porpose:
200// 1. set the MK_EXTERN and MK_EXTERN_DATA to export of definition
201// 2. use the private definition of partly public struct's
202
203// =========================================================================================
204// Header: api definition
205
206// define: META_TIMEOUT_REF
207// source: api-header or Makefile
208// default: 900sec
209// definition: base timeout value - all other timeout will be calulated relative to this timeout
210
211#define META_TIMEOUT_REF 900 //< reference value for timeout… default: 15 min
212
213// define: META_HDL_USE__NONNULL__GCC_ATTRIBUTE
214// source: api-header or Makefile
215// target: api-header, check_mk.h
216// default: do NOT use "nonnull" attribute
217
218#define META_HDL_USE__NONNULL__GCC_ATTRIBUTE 0
219
220// define: META_ATTRIBUTE_SANITIZE
221// source: api-header or Makefile
222// target: msgque_mq.h
223// default: __attribute__((no_sanitize("address")))
224// definition: The C2GO compiler does NOT understand the 'no_sanitize("address")' attribute
225// -> use "-DMETA_ATTRIBUTE_SANITIZE=" at "env-build.sh: CGO_CFLAGS" to ignore it
226// The "sanitize" is set at "configure" with the "NHI1_SANITIZE" makefile definition and env-Variable
227#if !defined(META_ATTRIBUTE_SANITIZE)
228# define META_ATTRIBUTE_SANITIZE __attribute__((no_sanitize("address")))
229#endif
230
231// define: META_MEM_DEBUG
232// target: libmqmsgque internal, cache_mq.c etc
233// default: not set = use the cache
234// action: disable reuse of memory
235// definition: libmqmsgque is using the CACHE to reuse a deleted instance and memory.
236// To debug the memory this "reuse" is a problem.
237
238//#define META_MEM_DEBUG
239
240// define: META_LOG_CLICKS
241// target: libmqmsgque internal, logging additional clicks-timestamp
242// default: not set = no clicks-timestamp
243// action: add clicks-timestamp to output
244// definition: libmqmsgque is using an verbose logging prefix to help debbugging
245// multi-thread/proc software - with META_LOG_CLICKS an additional
246// column with "clicks" data is added
247// attention: debug_mk.h also needs the "META_LOG_CLICKS", but is usually loaded before msgque_mq.h
248
249//#if !defined(META_LOG_CLICKS)
250// #define META_LOG_CLICKS
251//#endif
252
253// define: META_PERF_DEBUG
254// target: libmqmsgque internal, disable some inline to create better code for callgrind
255// default: not set = no performance debugging
256// action: add performance debugging features
257// definition: inline code is embedded into calling code, this is faster BUT make it impossible
258// to analyse a single inlined function for performance optimization
259
260//#define META_PERF_DEBUG
261
262// define: META_DISABLE_LOG
263// target: command-line definition for compiling
264// default: not set = show logging based on MkDLogC and MkDLogV
265// action: hide logging macros
266// definition: logging is done using so called logging-macros. if META_DISABLE_LOG is defined the logging-macros
267// will dissappear.
268
269//#define META_DISABLE_LOG
270
271// define: META_DOXYGEN_USE_C_PRIVAT
272// target: the doxygen configuration files.
273// default: yes=1 - on compillation, no=0 on documentation if NOT defined as 1
274// action: add / hide code and documentation
275// definition: use/hide private code/documentation from doxygen docu and compilation
276// the private code/documentation is only use in "C" compiling and documantation,
277// use this switch to hide this code/documentation from non "C" languages
278
279#ifndef META_DOXYGEN_USE_C_PRIVAT
280# ifdef META_DOXYGEN_SHOULD_SKIP_THIS
281# define META_DOXYGEN_USE_C_PRIVAT 0
282# else
283# define META_DOXYGEN_USE_C_PRIVAT 1
284# endif
285#endif
286
287// define: META_STATIC
288// target: build and target, library and executable
289// default: not set -> do NOT force static linking
290// action: build (static) internal and external library
291// definition: ...
292
293#ifdef META_STATIC
294# undef MK_C_BUILD_DLL
295# define MK_C_BUILD_DLL
296# undef META_IGNORE_EXTERN
297# define META_IGNORE_EXTERN
298#endif
299
300// define: META_TYPE_DEBUG
301// target: meta library with type support
302// default: depend on _DEBUG -> add simple type debug code
303// action: add extra type debug code
304// definition: 0 = NO debug
305// 1 = ADD debug but invisible
306// 2 = ADD debug AND add extra logging, (only for a type debugging session)
307
308//#define META_TYPE_DEBUG 2
309
310#ifndef META_TYPE_DEBUG
311# ifdef _DEBUG
312# define META_TYPE_DEBUG 1
313# else
314# define META_TYPE_DEBUG 0
315# endif
316#endif
317
318#if META_TYPE_DEBUG == 2
319# define META_TYPE_DEBUG__printV(...) printV(__VA_ARGS__)
320#else
321# define META_TYPE_DEBUG__printV(...)
322#endif
323
324/*****************************************************************************/
325/* */
326/* add feature - used to compile 'libmqmsgque' library itself */
327/* */
328/*****************************************************************************/
329
330// DOKU: MkObjectS->selfRefCount
331#define META_USE_SELF_REFCOUNT
332
333/* ############################################################### */
334/* ### ### */
335/* ### PARSER ### */
336/* ### ### */
337/* ############################################################### */
338
339// META_P
343
344// [__parser__]
345#ifndef __has_parser__
346
352
354# define __parser__(...)
356# define __parser__define__(...)
358
360# define __parser__push__(...)
362# define __parser__pop__
363
365// END: local attributes
366
372
374# define __parser__global__(...)
376# define __parser__global__define__(...)
380# define __parser__global__push__(...)
382# define __parser__global__pop__
383
385// END: global attributes
386
387#else
388# include "parser_mk.h"
389#endif
390// END: !__has_parser__
391// [__parser__]
392
394// MkKernel_Parser_C_API
395
396/* ############################################################### */
397/* ### ### */
398/* ### START ### */
399/* ### ### */
400/* ############################################################### */
401
405
406// =========================================================================
409
410__parser__(library=MkKernel@internal@Mk);
411
412// GLOBAL: all "fmtobj" arguments become attribute "formatter"
413__parser__global__(formatter=fmtobj);
415#define MK_PARSER_fmtobj MK_OBJN fmtobj __parser__(default=NULL)
416
417// GLOBAL: all "macros" become hide
418__parser__global__(hide-rx=^Mk\w+_T$);
419
421// END: global __parser__ definition
422
425#if defined(_MSC_VER)
426
427 // Visual C++ Express-Edition
428
429 # define __attribute__(dummy)
430 # define __func__ __FUNCTION__
431 # define MK_CLRCALL __clrcall
432 # define MK_STDCALL __stdcall
433 # define MK_CDECL __cdecl
434
435 // helper
436 # ifndef PARSE_C_HEADER_TO_META
437 # define mk_inline static inline
438 # endif
439 //# define bool int
440 # define mk_unlink _unlink
441 # define mk_snprintf _snprintf
442
443 # define MK_ATTR_HOT ???
444 # define MK_ATTR_COLD ???
445
446#else // !_MSC_VER
447
448 // GCC
449
450 # define MK_CLRCALL
451 # define MK_STDCALL
452 # define MK_CDECL
453
454 // helper
455 # ifndef PARSE_C_HEADER_TO_META
456 # define mk_inline static inline
457 # endif
458 # define mk_unlink unlink
459 # define mk_snprintf snprintf
460
461 # define MK_ATTR_HOT __attribute__((hot))
462 # define MK_ATTR_COLD __attribute__((cold))
463
464#endif // _MSC_VER
465
466#if defined(_MANAGED)
467 # define MK_DECL MK_CLRCALL
468#elif defined(META_COMPILE_AS_CC)
469 # define MK_DECL MK_STDCALL
470#else
471 # define MK_DECL MK_CDECL
472#endif
473
474/* BEGIN_MK_C_DECLS should be used at the beginning of your declarations,
475 so that C++ compilers don't mangle their names. Use END_MK_C_DECLS at
476 the end of C declarations. */
477
478#undef BEGIN_MK_C_DECLS
479#undef END_MK_C_DECLS
480#if defined(META_COMPILE_AS_CC)
481# define BEGIN_MK_C_DECLS namespace libmkkernel {
482# define END_MK_C_DECLS }
483#elif defined(__cplusplus)
484# define BEGIN_MK_C_DECLS extern "C" {
485# define END_MK_C_DECLS }
486#else
487# define BEGIN_MK_C_DECLS /* empty */
488# define END_MK_C_DECLS /* empty */
489#endif
490
491/* Somewhere in the middle of the GCC 2.96 development cycle, we implemented
492 a mechanism by which the user can annotate likely branch directions and
493 expect the blocks to be reordered appropriately. Define __builtin_expect
494 to nothing for earlier compilers. */
495
496#if defined(_MSC_VER) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
497 #define likely(x) !!(x)
498 #define unlikely(x) !!(x)
499 #else
500 #define likely(x) __builtin_expect((x),1)
501 #define unlikely(x) __builtin_expect((x),0)
502#endif
503
504#ifndef PARSE_C_HEADER_TO_META
505 # ifndef _MSC_VER
506 # include <inttypes.h>
507 # endif
508 # ifdef __CYGWIN__
509 # include <windef.h>
510 # endif
511 # include <stdarg.h>
512 # include <stdio.h>
513 # include <time.h>
514 # include <limits.h>
515 # include <string.h>
516 # ifndef _MSC_VER
517 # include <unistd.h>
518 # include <stdbool.h>
519 # endif
520#endif
521
522#if defined(_WIN32) && !defined(__CYGWIN__)
523 # ifndef PARSE_C_HEADER_TO_META
524 # include <winsock2.h>
525 # endif
526
528 # define mk_timeval timeval
529
531 struct mk_timezone {
532 int tz_minuteswest;
533 int tz_dsttime;
534 };
535
536#else
537 # define mk_timeval timeval
538 # define mk_timezone timezone
539 struct mk_timeval;
540 struct mk_timezone;
541#endif
542
544#define MK_UNUSED __attribute__((unused))
546#define MK_NO_RETURN
547//#define MK_NO_RETURN __attribute__((noreturn))
548#define MK_UNREACHABLE __builtin_unreachable()
549// https://stackoverflow.com/questions/20110291/use-cases-of-the-gcc-artificial-function-attribute
550#define MK_ARTIFICIAL __attribute__((__artificial__))
551
552#ifndef PARSE_C_HEADER_TO_META
553 # include <assert.h>
554#endif
555
557// END: native compiler definition
558
560// END: MkKernel_Compiler_C_API
561
562// Namespace for the 'ccmkkernel' API …
564
565// ==============================================================================================
568
570typedef void* MK_MACRO_TYP;
571
577
610__parser__(ignore)
611#define MK_NULL NULL
612
614#define MK_NULL_YES true
615
617#define MK_NULL_NO false
618
622__parser__(ignore)
623#define MK_NULL_STR "MK_NULL"
624
628__parser__(ignore)
629#define MK_NULL_STR_LEN strlen(MK_NULL_STR)
630
638__parser__(ignore)
639mk_inline bool MK_NULL_STR_CHECK(char const * const __str, const long int __len) {
640 return ((__str) ? ( (__len) == MK_NULL_STR_LEN && strcmp((__str),MK_NULL_STR)==0 ) : true);
641}
642
644__parser__(ignore)
645mk_inline bool MK_NULL_STR_CHECK_1(char const * const __str) {
646 return ((__str) ? strcmp((__str),MK_NULL_STR)==0 : true);
647}
648
650__parser__(ignore)
651mk_inline bool MK_NULL_STR_OR_EMPTY_CHECK_1(char const * const __str) {
652 return ((__str) ? (__str)[0] == '\0' || strcmp((__str),MK_NULL_STR)==0 : true);
653}
654
656// name: MK_NULL
657
659// MkKernel_Compiler_C_API
660
661// ==============================================================================================
805#if META_HAS_THREAD
808 # define MkThreadLocal __thread
809 # define MK_RT_SHIFT 1
810 # define MK_RT_ARGS_ONLY MK_RT mkrt
811 # define MK_RT_ARGS MK_RT_ARGS_ONLY,
812 # define MK_RT_CALL_ONLY mkrt
813 # define MK_RT_CALL MK_RT_CALL_ONLY,
814 # define MK_RT_CALL_O(o) MkRT_O(o),
815 # define MK_RT_CALL_X(x) MkRT_X(x),
816 # define MK_RT_CALL_NULL_ONLY MkRT
817 # define MK_RT_CALL_NULL MK_RT_CALL_NULL_ONLY,
818 # define MK_RT_NULL NULL,
819 # define MK_RT_PTR mkrt
820 # define MK_RT_REF (*mkrt)
821 # define MK_RT_REF_NULL (MkRuntimeRLS)
822 # define MK_RT_UNUSED MK_UNUSED
823 # define MK_RT_CALL_RT(ptr) ptr,
824 # define MK_PARSER_RT_ONLY MK_RT_ARGS_ONLY __parser__(internal,default=N#RUNTIME)
825 # define MK_PARSER_RT MK_PARSER_RT_ONLY,
827#else
830 # define MkThreadLocal
831 # define MK_RT_SHIFT 0
832 # define MK_RT_ARGS_ONLY void
833 # define MK_RT_ARGS
834 # define MK_RT_CALL_ONLY
835 # define MK_RT_CALL
836 # define MK_RT_CALL_O(o)
837 # define MK_RT_CALL_X(x)
838 # define MK_RT_CALL_NULL_ONLY
839 # define MK_RT_CALL_NULL
840 # define MK_RT_NULL
841 # define MK_RT_PTR (&MkRuntimeRLS)
842 # define MK_RT_REF (MkRuntimeRLS)
843 # define MK_RT_REF_NULL (MkRuntimeRLS)
844 # define MK_RT_UNUSED
845 # define MK_RT_CALL_RT(ptr)
846 # define MK_PARSER_RT_ONLY void
847 # define MK_PARSER_RT
849#endif
850
851# define MK_RT_ATTR_FORMAT_1 __attribute__((format (printf, 1+MK_RT_SHIFT, 2+MK_RT_SHIFT)));
852# define MK_RT_ATTR_FORMAT_2 __attribute__((format (printf, 2+MK_RT_SHIFT, 3+MK_RT_SHIFT)))
853# define MK_RT_ATTR_FORMAT_4 __attribute__((format (printf, 4+MK_RT_SHIFT, 5+MK_RT_SHIFT)))
854
855// nonnull for runtime yesORno? → problem is C# (and propably go), because runtime is a C feature and getting a nonnull C Pointer
856// for every API call in C# is expensive. solution? → allow NULL and resolve the mkrt pointer in C
857# define __MK_ATTR_RT_RUNTIME // empty
858
859#if META_HDL_USE__NONNULL__GCC_ATTRIBUTE == 1
860 // with "nonnull" on HDL the assert disable itself
861 # define __MK_ATTR_RT_INSTANCE __attribute__((nonnull(1+MK_RT_SHIFT)))
862 # define __MK_ATTR_INSTANCE __attribute__((nonnull(1)))
863 # define MK_INSTANCE_HDL(x)
864#else
865 # define __MK_ATTR_RT_INSTANCE
866 # define __MK_ATTR_INSTANCE
867 # define MK_INSTANCE_HDL(x) assert(x!=NULL)
868#endif
869
870// ".h" file
871#define MK_ATTR_INSTANCE __MK_ATTR_INSTANCE
872#define MK_ATTR_RT_INSTANCE __MK_ATTR_RT_RUNTIME __MK_ATTR_RT_INSTANCE
873#define MK_ATTR_STATIC __parser__(static)
874#define MK_ATTR_RT_STATIC __MK_ATTR_RT_RUNTIME __parser__(static)
875
876// ".c" file
877#define MK_INSTANCE_RT_X(x) MK_INSTANCE_HDL(x); MkRtSetup_XN_RT(x)
878#define MK_INSTANCE_RT_XN(x) MkRtSetup_X_RT(x)
879#define MK_INSTANCE_RT_O(o) MK_INSTANCE_HDL(o); MkRtSetup_ON_RT(o)
880#define MK_INSTANCE_RT_ON(o) MkRtSetup_O_RT(o)
881#define MK_DESTRUCTOR_RT_X(c,x) MK_INSTANCE_HDL(x); \
882 if (!MkCheckNN(c,x)) return; /* do NOT delete an invalid pointer */ \
883 MkRtSetup_XN_RT(x)
884#define MK_STATIC_RT MkRtSetup_NULL_RT
885
886// example: probably future enhancement on class/method definition
887// #define MK_INLINE_RT_STATIC(func,...) mk_inline MK_ATTR_RT_STATIC func##_RT (MK_PARSER_RT __VA_ARGS__)
888
890// MkRuntimeC_Interface_C_API
891
892// MARK_O
893#ifndef PARSE_C_HEADER_TO_META
894 # include "gen/kernel_overload_mk.h"
895#endif
896
963/*****************************************************************************/
964/* */
965/* compiler and os definition */
966/* */
967/*****************************************************************************/
968
971
972// on windows using the 'native' compiler 'cl.exe' we have to define some missing symbols
973#if defined(_MSC_VER) && defined(_DLL)
974 # undef PIC
975 # define PIC
976 # undef DLL_EXPORT
977 # define DLL_EXPORT
978#endif
979
980#ifdef META_IS_WINDOWS
981 # define META_DIR_SEPARATOR '\\'
982 # define META_EOL "\r\n"
983#else
984 # define META_DIR_SEPARATOR '/'
985 # define META_EOL "\n"
986#endif
987
988// BEGIN-HEADER - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
989
990// If the source of libmkkernel is direct used in an external library
991// (without dynamic linking) and this library should *not* export
992// the symbol's of libmkkernel then the flag META_IGNORE_EXTERN have
993// to be set
994#undef MK_EXTERN
995#if defined(META_IGNORE_EXTERN)
996# define MK_EXTERN
997#elif defined(PIC)
998 // does we build a DLL ?
999# if defined(DLL_EXPORT)
1000 // does we build the libmkkernel library ?
1001# if defined(MK_C_BUILD_DLL)
1002# define MK_EXTERN __declspec(dllexport)
1003# else
1004# define MK_EXTERN __declspec(dllimport)
1005# endif
1006# else
1007 // no DLL - architecture specific extern specifier
1008# define MK_EXTERN __attribute__ ((visibility("default")))
1009# endif
1010#else
1012# define MK_EXTERN
1013#endif
1014
1015// external data lookup
1016#undef MK_EXTERN_DATA
1017#if defined(META_PRIVATE)
1018# define MK_EXTERN_DATA extern
1019#elif defined(META_IGNORE_EXTERN)
1020# define MK_EXTERN_DATA extern
1021#elif defined(PIC)
1022 // does we build a DLL ?
1023# if defined(DLL_EXPORT)
1024 // does we build the libmkkernel library ?
1025# if defined(MK_C_BUILD_DLL)
1026# define MK_EXTERN_DATA __declspec(dllexport)
1027# else
1028# define MK_EXTERN_DATA __declspec(dllimport)
1029# endif
1030# else
1031 // no DLL - architecture specific extern specifier
1032# define MK_EXTERN_DATA __attribute__ ((visibility("default"))) extern
1033# endif
1034#else
1035# define MK_EXTERN_DATA extern
1036#endif
1037
1038// END-HEADER - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1039
1041#define MK_CPPXSTR(s) MK_CPPSTR(s)
1043#define MK_CPPSTR(s) #s
1045#define MK_CONCAT(a,b) a ## b
1046#define MK_CONCAT2(a,b) MK_CONCAT(a,b)
1047#define MK_CONCAT3(a,b,c) a ## b ## c
1048
1050#ifdef HAVE_STPCPY
1051 #define mk_append_fix_str(t,s) t=stpcpy(t,s)
1052#else
1053 #define mk_append_fix_str(t,s) t=strcpy(t,s)+sizeof(s)-1
1054#endif
1055
1057#define mk_bit_compare(t,f) (t&f)==f
1058
1060// MkKernel_Compiler_C_API
1061
1062/* MARK_T ********************************************************************/
1063/* */
1064/* types/generic */
1065/* */
1066/*****************************************************************************/
1067
1071
1072struct MkErrorS;
1073struct MkBufferListS;
1074struct MkBufferS;
1075union MkBufferU;
1076struct MkObjectS;
1077struct MkAllocS;
1078struct MkTypeS;
1079struct MkSuperTypeS;
1080
1082#define MK_ALFA '@'
1084#define MK_ALFA_STR ((MkStringR){1,"@"})
1085
1086// ----------------------------------------------------------------------------------
1087
1090
1092__parser__(type=ME_NB1_MK_BOL:"1 byte 'boolean' data-type")
1093typedef unsigned char MK_BOL;
1094
1095// hint: bool into printf %B → https://stackoverflow.com/questions/17307275/what-is-the-printf-format-specifier-for-bool
1097__parser__(type=ME_NB0_MK_BOOL:"'boolean' data-type":primary)
1098typedef bool MK_BOOL;
1099#define bool2str(_bool) (_bool?"true":"false")
1100
1102
1103// ----------------------------------------------------------------------------------
1104
1107
1109__parser__(type=ME_NI1_MK_I8:"1 byte 'byte' data-type")
1110typedef signed char MK_I8;
1112__parser__(type=ME_NI2_MK_I16:"2 byte 'short integer' data-type":primary:int16_t)
1113typedef signed short int MK_I16;
1115__parser__(type=ME_NI4_MK_I32:"4 byte 'integer' data-type":primary:int32_t)
1116typedef signed int MK_I32;
1118#if defined(_MSC_VER)
1119 typedef __int64 MK_I64;
1120 typedef long MK_SIZE;
1121#else
1122 __parser__(type=ME_NI8_MK_I64:"8 byte 'wide integer' data-type":primary:int64_t)
1123 typedef signed long long MK_I64;
1124#endif
1126__parser__(type=ME_NIL_MK_LONG:"4/8 byte 'long' data-type":primary)
1127// TODO → make MK_LONG network save
1128typedef long MK_LONG;
1129
1131
1132// ----------------------------------------------------------------------------------
1133
1136
1137__parser__(type=ME_NU1_MK_U8:"1 byte 'unsigned byte' data-type":primary:uint8_t)
1138typedef unsigned char MK_U8;
1139__parser__(type=ME_NU2_MK_U16:"2 byte 'unsigned short' data-type":primary:uint16_t)
1140typedef unsigned short MK_U16;
1141__parser__(type=ME_NU4_MK_U32:"4 byte 'unsigned integer' data-type":primary:uint32_t)
1142typedef unsigned int MK_U32;
1143__parser__(type=ME_NU8_MK_U64:"8 byte 'unsigned wide' data-type":primary:uint64_t)
1144typedef unsigned long long MK_U64;
1145//__parser__(type=ME_NUX_MK_UXN:"min 8 byte 'unsigned long long' data-type":primary)
1146//typedef unsigned long long MK_UXN;
1147__parser__(type=ME_NUL_MK_ULN:"8 byte 'unsigned long' data-type":primary)
1148typedef unsigned long MK_ULN;
1150
1151// ----------------------------------------------------------------------------------
1152
1155
1157__parser__(type=ME_NF4_MK_FLT:"4 byte 'float' data-type":primary)
1158typedef float MK_FLT;
1160__parser__(type=ME_NF8_MK_DBL:"8 byte 'double' data-type":primary)
1161typedef double MK_DBL;
1162
1164
1165// ----------------------------------------------------------------------------------
1166
1170
1181__parser__(type=ME_NIH_MK_HDL:"handle data-type")
1182// also change: MqHigh_jv.c=jint
1183typedef int32_t MK_HDL;
1184#define MK_HDL_REF_S3(__prefix) __prefix ## NI4
1185#define MK_HDL_REF_S1(__prefix) __prefix ## I32
1186#define MK_HDLT MK_I32T
1187
1188// OLD: internal \b hdl used in uplevel-programming-language-shell to store a pointer:
1189// OLD: \li \e java uses \b jlong equal to \RMKNS{LONG}
1190// OLD: \li \e csharp uses \b IntPtr equal to \RMKNS{PTR}
1191// OLD: typedef MK_PTRB *MK_HDL;
1192
1194
1195// ----------------------------------------------------------------------------------
1196
1199
1200__parser__(type=ME_NIL_MK_SIZE:"long byte 'size' datay-type")
1201// choose "long" because it have to fit a pointer-diff (eg: ptr1-ptr2) without cast
1202typedef long MK_SIZE;
1204__parser__(type=ME_RUA_MkBufferAtomU:"atomic native data buffer type")
1205typedef union MkBufferAtomU MK_ATO;
1209__parser__(type=ME_NI4_MK_NUM)
1210typedef int32_t MK_NUM;
1211#define MK_FORMAT_N "%i"
1212
1214__parser__(type=ME_NI4_MK_DBG:"debug-level data-type")
1215typedef int MK_DBG;
1216
1275__parser__(type=ME_NU4_MK_SIG)
1276typedef unsigned int MK_SIG;
1277
1279
1280// ----------------------------------------------------------------------------------
1281
1285__parser__(type=ME_NIL_MK_TIME_T:"time [sec] data-type")
1286typedef time_t MK_TIME_T;
1287#define MK_FORMAT_TIME "%li"
1288#define MK_TIME ((MK_TIME_T)time(NULL))
1289#define MK_TIME_MAX (365*24*60*60)
1291
1292// ----------------------------------------------------------------------------------
1293
1296
1297// attention: "google go" can not uses nested typedef's -> use "#define" for the basic types
1298
1300__parser__(type=ME_PVB_MK_PTRB:"pointer type data-type")
1301typedef void MK_PTRB;
1302
1304__parser__(type=ME_PVX_MK_PTR:"generic pointer data-type":primary)
1307__parser__(type=ME_PVN_MK_PTRN:"const generic pointer data-type":primary)
1308typedef const MK_PTRB *MK_PTRN;
1310__parser__(type=ME_PCX_MK_CCP:"class constructor/destructor data type")
1313__parser__(type=ME_PAX_MK_CBP:"generic pointer to call-back data")
1316__parser__(type=ME_CXC_MK_MNG:"managed object pointer; datatype will be checked at runtime")
1319__parser__(type=ME_CXN_MK_MNGN:"const - a managed object pointer; datatype will be checked at runtime")
1320typedef const MK_PTRB *MK_MNGN;
1322__parser__(type=ME_PEX_MK_EXP:"target language exception-class-object")
1323typedef MK_PTRB const *MK_EXP;
1325__parser__(type=ME_CXC_MkExceptionC:"target language library-exception-class-object")
1327
1329
1330// ----------------------------------------------------------------------------------
1331
1334
1336__parser__(type=ME_PLB_MK_LSTB:"list type data-type")
1337typedef unsigned char MK_LSTB;
1338
1340__parser__(type=ME_PLX_MK_LST:"list pointer data-type")
1342
1344
1345// ----------------------------------------------------------------------------------
1346
1349
1351__parser__(type=ME_PBB_MK_BINB:"byte-array type data-type")
1352typedef unsigned char MK_BINB;
1353
1355__parser__(type=ME_PBX_MK_BIN:"byte-array pointer data-type":primary)
1357
1359__parser__(type=ME_PBN_MK_BINN:"const byte-array pointer data-type":primary)
1360typedef MK_BINB const *MK_BINN;
1361
1363
1364// ----------------------------------------------------------------------------------
1365
1368
1370__parser__(type=ME_PSB_MK_STRB:"string type data-type")
1371typedef char MK_STRB;
1372
1374__parser__(type=ME_PSX_MK_STR:"string pointer data-type":primary)
1376
1378__parser__(type=ME_PSN_MK_STRN:"constant string pointer data-type":primary)
1379typedef const MK_STRB *MK_STRN;
1380
1382__parser__(type=ME_ASN_MK_STRN_A:"ARRAY of MK_STRN")
1383typedef struct {
1386} MK_STRN_A;
1387
1388__parser__(ignore)
1389MK_UNUSED const static MK_STRN_A MK_STRN_A_NULL = (MK_STRN_A) {0,0};
1390
1392__parser__(type=ME_PFX_MK_FST:"constant 'printf' format string")
1393typedef MK_STRB const *MK_FST;
1394
1396
1397// ----------------------------------------------------------------------------------
1398
1401__parser__(type=ME_PVX_MK_NAT_OBJECT:"target language object pointer")
1402typedef void* MK_NAT_OBJECT;
1403__parser__(type=ME_PVX_MK_NAT_LIST:"target language list pointer")
1404typedef void* MK_NAT_LIST;
1406
1407// ----------------------------------------------------------------------------------
1408
1410// MkKernel_Type_C_API
1411
1412/* MARK_C ********************************************************************/
1413/* */
1414/* class types */
1415/* */
1416/*****************************************************************************/
1417
1418// BEGIN-ShortDef - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1419
1423 __parser__(type=ME_CCC_MkObjectC:"MkObjectC class handle":primary)
1424 typedef struct MkObjectS * MK_OBJ;
1426 __parser__(type=ME_CCN_MkObjectC:"const - MkObjectC class handle":primary)
1427 typedef const struct MkObjectS * MK_OBJN;
1429 __parser__(ignore)
1430 typedef struct MkObjectS MK_OBJR;
1432// MkObjectC_Class_C_API
1433
1437 __parser__(type=ME_CCC_MkBufferC:"MkBufferC class handle":primary)
1438 typedef struct MkBufferS * MK_BUF;
1440 __parser__(type=ME_CCN_MkBufferC:"const - MkBufferC class handle":primary)
1441 typedef const struct MkBufferS * MK_BUFN;
1443 __parser__(ignore)
1444 typedef struct MkBufferS MK_BUFR;
1446// MkBufferC_Class_C_API
1447
1451 __parser__(type=ME_CCC_MkBufferStreamC:"MkBufferStreamC class handle":primary)
1452 typedef struct MkBufferStreamS * MK_BUS;
1454 __parser__(type=ME_CCN_MkBufferStreamC:"const - MkBufferStreamC class handle":primary)
1455 typedef const struct MkBufferStreamS * MK_BUSN;
1457 __parser__(ignore)
1458 typedef struct MkBufferStreamS MK_BUSR;
1460// MkBufferStreamC_Class_C_API
1461
1465 __parser__(type=ME_CCC_MkBufferListC:"MkBufferListC class handle":primary)
1466 typedef struct MkBufferListS * MK_BFL;
1468 __parser__(type=ME_CCN_MkBufferListC:"const - MkBufferListC class handle":primary)
1469 typedef const struct MkBufferListS * MK_BFLN;
1471 __parser__(ignore)
1472 typedef struct MkBufferListS MK_BFLR;
1474// MkBufferListC_Class_C_API
1475
1479 __parser__(type=ME_CCC_MkLogFileC:"MkLogFileC class handle":primary)
1480 typedef struct MkLogFileS * MK_LFL;
1482 __parser__(type=ME_CCN_MkLogFileC:"const - MkLogFileC class handle":primary)
1483 typedef const struct MkLogFileS * MK_LFLN;
1485 __parser__(ignore)
1486 typedef struct MkLogFileS MK_LFLR;
1488// MkLogFileC_Class_C_API
1489
1493 __parser__(type=ME_CCC_MkErrorC:"MqErrorC class handle":primary)
1494 typedef struct MkErrorS * MK_ERR;
1496 __parser__(type=ME_CCN_MkErrorC:"const - MqErrorC class handle":primary)
1497 typedef const struct MkErrorS * MK_ERRN;
1499 __parser__(ignore)
1500 typedef struct MkErrorS MK_ERRR;
1502// MkErrorC_Class_C_API
1503
1507 __parser__(internal,type=ME_CCC_MkExtensionC:"abstract class for the extension technology":internal)
1508 typedef struct MkExtensionS * MK_EXT;
1510 __parser__(internal,type=ME_CCN_MkExtensionC:"const - abstract class for the extension technology":internal)
1511 typedef const struct MkExtensionS * MK_EXTN;
1513 __parser__(ignore)
1514 typedef struct MkExtensionS MK_EXTR;
1516// MkExtensionC_Class_C_API
1517
1521 __parser__(internal,type=ME_CCC_MkErrExtC:"final class for the MkErrorS extention technology":internal)
1522 typedef struct MkErrExtS * MK_ERREXT;
1524 __parser__(internal,type=ME_CCN_MkErrExtC:"const - final class for the MkErrorS extention technology":internal)
1525 typedef const struct MkErrExtS * MK_ERREXTN;
1527 __parser__(ignore)
1528 typedef struct MkErrExtS MK_ERREXTR;
1530// MkErrExtC_Class_C_API
1531
1535 __parser__(internal,type=ME_CCC_MkRtExtC:"final class for the MkRuntimeS extention technology":internal)
1536 typedef struct MkRtExtS * MK_RTEXT;
1538 __parser__(internal,type=ME_CCN_MkRtExtC:"const - final class for the MkRuntimeS extention technology":internal)
1539 typedef const struct MkRtExtS * MK_RTEXTN;
1541 __parser__(ignore)
1542 typedef struct MkRtExtS MK_RTEXTR;
1544// MkRtExtC_Class_C_API
1545
1549 __parser__(type=ME_CCC_MkRuntimeC:"runtime singleton class object":primary)
1550 typedef struct MkRuntimeS * MK_RT;
1552 __parser__(type=ME_CCN_MkRuntimeC:"const - runtime singleton class object":primary)
1553 typedef const struct MkRuntimeS * MK_RTN;
1555 __parser__(ignore)
1556 typedef struct MkRuntimeS MK_RTR;
1558// MkRuntimeC_Class_C_API
1559
1563 __parser__(internal,type=ME_CCC_MkTypeC:"a managed object class type !base! pointer":internal)
1564 typedef struct MkTypeS * MK_TYP;
1566 __parser__(internal,type=ME_CCN_MkTypeC:"const - a managed object class type !base! pointer":internal)
1567 typedef const struct MkTypeS * MK_TYPN;
1569 __parser__(ignore)
1570 typedef struct MkTypeS MK_TYPR;
1572// MkTypeC_Class_C_API
1573
1574// END-ShortDef - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1575
1578__parser__(type=ME_CXC_MK_BAC:"a list of 'buffer' as last argument in function")
1579typedef struct MkBufferListS *MK_BAC;
1580
1583__parser__(type=ME_CXN_MK_BAC:"const - a list of 'buffer' as last argument in function")
1584typedef const struct MkBufferListS *MK_BACN;
1585
1586// --------------------------------------------------------------------
1587// binary
1588
1594
1595__parser__push__(hide);
1596
1600__parser__(reference)
1601typedef struct {
1604} MkBinaryR;
1605
1609 return (MkBinaryR) {size, data};
1610}
1611
1615 return bin.data == NULL;
1616}
1617
1621 if (start>bin.size)
1622 return (const MkBinaryR) {0, NULL};
1623 else
1624 return (const MkBinaryR) {start+wide>bin.size?bin.size-start:wide, bin.data+start};
1625}
1626
1629mk_inline MkBinaryR MkBinaryDup_RT ( MK_PARSER_RT const MkBinaryR bin );
1630
1633mk_inline void MkBinaryLog_RT ( MK_PARSER_RT const MkBinaryR bin );
1634
1638 return bin.data;
1639}
1640
1644 return bin.size;
1645}
1646
1648
1650// MkKernel_Binary_C_API
1651
1657
1658__parser__push__(hide);
1659
1663// [MkStringR]
1664__parser__(reference)
1665typedef struct {
1668} MkStringR;
1669// [MkStringR]
1670
1673mk_inline void MkStringLog_RT ( MK_PARSER_RT MkStringR const str, MK_STRN func ) ;
1674
1678 return (MkStringR) {(len>0?len:str?(MK_NUM)strlen(str):0), str};
1679}
1680
1684 return (MkStringR) {str?(MK_NUM)strlen(str):0, str};
1685}
1686
1697 if (len < 0) len = strR.len;
1698 if (start > strR.len) {
1699 return MkStringCreate(0,NULL);
1700 } else if ((start+len) > strR.len) {
1701 return MkStringCreate(strR.len-start,strR.ptr+start);
1702 } else {
1703 return MkStringCreate(len,strR.ptr+start);
1704 }
1705}
1706
1709mk_inline void MkStringSplit ( MkStringR strR, MK_NUM *len_out, MK_STRN *str_out ) {
1710 assert(len_out != NULL);
1711 assert(str_out != NULL);
1712 *len_out = strR.len; *str_out = strR.ptr;
1713}
1714
1717mk_inline MkStringR MkStringDup_RT ( MK_PARSER_RT MkStringR const str );
1718
1722 return str.ptr;
1723}
1724
1728 return str.len;
1729}
1730
1739 return ((strR.ptr) && (strR.len) == MK_NULL_STR_LEN && strcmp((strR.ptr),MK_NULL_STR)==0);
1740}
1741
1743
1745// - MkKernel_String_C_API
1746
1747/*****************************************************************************/
1748/* */
1749/* enum definitions */
1750/* */
1751/*****************************************************************************/
1752
1755
1756__parser__push__(doc-group=Enum);
1757
1760
1767// [MkErrorE]
1773// [MkErrorE]
1774
1775// BEGIN-MkErrorE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1776
1779__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
1780MK_EXTERN MK_STRN MK_DECL MkErrorE_ToString ( enum MkErrorE value ) MK_ATTR_STATIC ;
1781
1784__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
1786mk_inline MK_I32 MkErrorE_ToInt ( enum MkErrorE value ) {
1787 return (MK_I32) value;
1788}
1789
1792__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc)
1793MK_EXTERN enum MkErrorE MkErrorE_FromInt ( MK_I32 const value, enum MkErrorE * value_out ) MK_ATTR_STATIC ;
1794
1795// END-MkErrorE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1796
1797// additional attribute for MkErrorE_FromInt - this function return TWO errors 1) return and 2) the value_out
1798__parser__global__(MkErrorE_FromInt:error-ignore=2);
1799
1801// MkErrorE
1802
1805
1812// [MkTimeoutE]
1813__parser__(enum-accept-integer=long)
1835// [MkTimeoutE]
1836
1837// BEGIN-MkTimeoutE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1838
1841__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
1842MK_EXTERN MK_STRN MK_DECL MkTimeoutE_ToString ( enum MkTimeoutE value ) MK_ATTR_STATIC ;
1843
1846__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
1848mk_inline MK_I32 MkTimeoutE_ToInt ( enum MkTimeoutE value ) {
1849 return (MK_I32) value;
1850}
1851
1854__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc)
1855MK_EXTERN enum MkErrorE MkTimeoutE_FromInt ( MK_I32 const value, enum MkTimeoutE * value_out ) MK_ATTR_STATIC ;
1856
1857// END-MkTimeoutE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1858
1860
1863
1865__parser__(internal)
1867 MK_NO = 0,
1869};
1870
1871// BEGIN-MkBoolE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1872
1875__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
1876MK_EXTERN MK_STRN MK_DECL MkBoolE_ToString ( enum MkBoolE value ) MK_ATTR_STATIC ;
1877
1880__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
1882mk_inline MK_I32 MkBoolE_ToInt ( enum MkBoolE value ) {
1883 return (MK_I32) value;
1884}
1885
1888__parser__(internal,no-rpc,prefix=EnumFunc)
1889MK_EXTERN enum MkErrorE MkBoolE_FromInt ( MK_I32 const value, enum MkBoolE * value_out ) MK_ATTR_STATIC ;
1890
1891// END-MkBoolE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1892
1894
1897
1902// [MkNativeIsE]
1903__parser__(internal)
1910// [MkNativeIsE]
1911
1912// BEGIN-MkNativeIsE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1913
1916__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
1917MK_EXTERN MK_STRN MK_DECL MkNativeIsE_ToString ( enum MkNativeIsE value ) MK_ATTR_STATIC ;
1918
1921__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
1923mk_inline MK_I32 MkNativeIsE_ToInt ( enum MkNativeIsE value ) {
1924 return (MK_I32) value;
1925}
1926
1929__parser__(internal,no-rpc,prefix=EnumFunc)
1930MK_EXTERN enum MkErrorE MkNativeIsE_FromInt ( MK_I32 const value, enum MkNativeIsE * value_out ) MK_ATTR_STATIC ;
1931
1932// END-MkNativeIsE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1933
1935// MkNativeIsE
1936
1939
1941#define MK_TYPE_IS_1_I8E (1<<0)
1942
1944#define MK_TYPE_IS_2_I8E (1<<1)
1945
1947#define MK_TYPE_IS_4_I8E (1<<2)
1948
1950#define MK_TYPE_IS_8_I8E (1<<3)
1951
1953#define MK_TYPE_IS_NATIVE ( MK_TYPE_IS_1_I8E | MK_TYPE_IS_2_I8E | \
1954 MK_TYPE_IS_4_I8E | MK_TYPE_IS_8_I8E )
1955
1957#define MK_TYPE_SHIFT 4
1958
1966// [MkTypeE]
1979// [MkTypeE]
1980
1981// BEGIN-MkTypeE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1982
1985__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
1986MK_EXTERN MK_STRN MK_DECL MkTypeE_ToString ( enum MkTypeE value ) MK_ATTR_STATIC ;
1987
1990__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
1992mk_inline MK_I32 MkTypeE_ToInt ( enum MkTypeE value ) {
1993 return (MK_I32) value;
1994}
1995
1998__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc)
1999MK_EXTERN enum MkErrorE MkTypeE_FromInt ( MK_I32 const value, enum MkTypeE * value_out ) MK_ATTR_STATIC ;
2000
2001// END-MkTypeE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
2002
2004// MkTypeE
2005
2007
2009// MkKernel_Enum_C_API
2010
2068
2070__parser__(ignore)
2079 MK_BINB B[8];
2080 MK_BINB B8[8];
2081 MK_BINB B4[4];
2082 MK_BINB B2[2];
2083 MK_BINB B1[1];
2084
2085#if defined(__cplusplus)
2086 MkBufferAtomU() : I64(0L) {};
2087 MkBufferAtomU(MK_I8 val) : I8(val) {};
2088 MkBufferAtomU(MK_BOL val) : BOL(val) {};
2089 MkBufferAtomU(MK_I16 val) : I16(val) {};
2090 MkBufferAtomU(MK_I32 val) : I32(val) {};
2091 MkBufferAtomU(MK_I64 val) : I64(val) {};
2092 MkBufferAtomU(MK_FLT val) : FLT(val) {};
2093 MkBufferAtomU(MK_DBL val) : DBL(val) {};
2094#endif
2095};
2096
2105__parser__(ignore)
2113
2116#define MkType_O MK_BOL
2117#define MkType_Y MK_I8
2118#define MkType_S MK_I16
2119#define MkType_I MK_I32
2120#define MkType_W MK_I64
2121#define MkType_F MK_FLT
2122#define MkType_D MK_DBL
2123#define MkType_C MK_STRN
2124#define MkType_B MK_BIN
2125#define MkType_U MK_BUF
2126#define MkType_L MK_BFL
2128
2130// MkKernel_PrimitiveType_C_API
2131
2151
2152
2153// =============================================================================================
2154
2157
2159typedef uintptr_t MK_IDNT;
2160
2161// also: theLink/cs/libmqmsgque.cs
2163__parser__(hide)
2169
2170// BEGIN-MkIdSE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
2171
2174__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
2175MK_EXTERN MK_STRN MK_DECL MkIdSE_ToString ( enum MkIdSE value ) MK_ATTR_STATIC ;
2176
2179__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
2181mk_inline MK_I32 MkIdSE_ToInt ( enum MkIdSE value ) {
2182 return (MK_I32) value;
2183}
2184
2187__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc)
2188MK_EXTERN enum MkErrorE MkIdSE_FromInt ( MK_I32 const value, enum MkIdSE * value_out ) MK_ATTR_STATIC ;
2189
2190// END-MkIdSE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
2191
2192// also: theLink/cs/libmqmsgque.cs
2199__parser__(hide)
2205
2207
2208/*****************************************************************************/
2209/* */
2210/* cache */
2211/* */
2212/*****************************************************************************/
2213
2217
2218__parser__(ignore)
2219typedef MK_PTR ( *MkCacheCF) ( MK_RT_ARGS MK_PTR const);
2220__parser__(ignore)
2221typedef void ( *MkCacheDF) ( MK_RT_ARGS MK_PTR * const);
2222
2224__parser__(ignore)
2226 #define MkCacheItemS_signature 0x44196912
2228 bool doFree;
2232};
2233
2241__parser__(ignore)
2258
2260// MkKernel_Cache_C_API
2261
2264__parser__(flags=public-internal)
2265typedef void ( MK_DECL *MkMarkF ) ( MK_RT_ARGS MK_PTR data );
2266
2267/*****************************************************************************/
2268/* */
2269/* create / delete */
2270/* */
2271/*****************************************************************************/
2272
2342__parser__push__(no-rpc,template-overload,doc-group=libmkkernel,doc-index=Setup,prefix=Setup);
2343
2349__parser__(no-inline)
2350MK_EXTERN void MK_DECL MkSetup (void) __attribute__ ((constructor(200))) MK_ATTR_STATIC ;
2351
2359__parser__(no-inline)
2360MK_EXTERN void MK_DECL MkCleanup (void) __attribute__ ((destructor(200))) MK_ATTR_STATIC ;
2361
2363__parser__(ignore)
2364MK_EXTERN_DATA bool MkCleanupActive;
2365
2366__parser__(internal)
2367MK_EXTERN bool MK_DECL MkHasThread (void);
2368
2369__parser__(internal)
2370MK_EXTERN bool MK_DECL MkHasFork (void);
2371
2373
2375
2376/* ####################################################################### */
2377/* ### ### */
2378/* ### S Y S T E M - A P I ### */
2379/* ### ### */
2380/* ####################################################################### */
2381
2382// MkObjectC_Sys_C_API: hide all ^MkSys
2383__parser__global__(hide-rx=^MkSys);
2384// MkObjectC_Sys_C_API: default class for MkSys is MkObjectC
2385__parser__global__(prefix2class:MkSys=MkObjectC);
2386
2399
2400__parser__push__(internal); // \{ internal
2401
2405typedef MK_PTR (*MkSysCallocF) (size_t, size_t) __attribute__ ((alloc_size (1, 2)));
2406
2410typedef MK_PTR (*MkSysMallocF) (size_t) __attribute__ ((alloc_size (1)));
2411
2415typedef MK_STR (*MkSysStrDupF) (MK_STRN);
2416
2420typedef MK_STR (*MkSysStrNCpyF) (char*,const char*,size_t);
2421
2425typedef MK_STR (*MkSysStrNDupF) (MK_STRN, size_t) __attribute__ ((alloc_size (2)));
2426
2430typedef MK_PTR (*MkSysReallocF) (MK_PTR, size_t);
2431
2435typedef void (*MkSysFreeF) (MK_PTR);
2436
2441typedef pid_t (*MkSysForkF) (void);
2442
2446typedef enum MkErrorE (*MkSysWaitF) (
2447 MK_OBJN const fmtobj,
2448 MK_IDNT const id
2449);
2450
2461typedef void (*MkSysExitF) (
2463 int isThread,
2464 int num
2465) MK_NO_RETURN;
2466
2468__parser__(ignore)
2469struct MkLalS {
2491
2500 enum MkErrorE (*SysUSleep) (
2501 MK_OBJN const obj,
2502 unsigned int const usec
2503 );
2512 enum MkErrorE (*SysSleep) (
2513 MK_OBJN const obj,
2514 unsigned int const sec
2515 );
2528 enum MkErrorE (*SysDaemonize) (
2530 MK_OBJN const obj,
2531 MK_STRN pidfile
2532 );
2544 void (*SysAbort) (
2545 void
2546 ) __attribute__((noreturn));
2547
2548 enum MkErrorE (*SysIgnorSIGCHLD) (
2550 MK_OBJ const obj
2551 );
2552
2553 enum MkErrorE (*SysAllowSIGCHLD) (
2555 MK_OBJ const obj
2556 );
2557};
2558
2560__parser__(ignore)
2562
2569__attribute__ ((alloc_size (2, 3)))
2570__parser__(internal)
2573 size_t const nmemb,
2574 size_t const size
2575);
2576
2582__attribute__ ((alloc_size (2)))
2583__parser__(internal)
2586 size_t const size
2587);
2588
2596 MK_STRN const str
2597);
2598
2605__parser__(internal)
2608 MK_STRN const str,
2609 MK_SIZE const len
2610);
2611
2619MK_EXTERN enum MkErrorE MK_DECL MkSysStrNCpy (
2621 MK_STR const to,
2622 MK_STRN const from,
2623 MK_SIZE const len
2624);
2625
2626
2633__attribute__ ((alloc_size (3)))
2634__parser__(internal)
2637 MK_PTR const buf,
2638 size_t const size
2639);
2640
2650__parser__(internal)
2651MK_EXTERN MK_PTR MK_DECL MkSysReCalloc (
2653 MK_PTR const buf,
2654 MK_NUM const oldnum,
2655 MK_NUM const addnum,
2656 size_t const size
2657);
2658
2665__parser__(internal)
2668 MK_PTRN const blck,
2669 size_t const size
2670);
2671
2677__parser__(internal)
2678MK_EXTERN MK_STRN_A MK_DECL MkSysStringArrayDup (
2680 MK_STRN_A const strA
2681);
2682
2687__parser__(internal) void MkSysFree (MK_PTR pointer);
2688#define MkSysFree(pointer) \
2689 do { \
2690 if ( likely((pointer) != (NULL)) ) { \
2691 (*MkLal.SysFree)((MK_PTR)pointer); \
2692 (pointer) = (NULL); \
2693 } \
2694 } while (0)
2695
2696__parser__(internal) void MkSysFreeNonNull (MK_PTR pointer);
2697#define MkSysFreeNonNull(pointer) (*MkLal.SysFree)((MK_PTR)pointer)
2698
2704 MK_PTR data
2705);
2706
2730 MK_I32 skip __parser__(default=0),
2731 MK_I32 const num __parser__(default=-1),
2732 MK_I32 const debug __parser__(default=0),
2733 MK_STRN const callfunc __parser__(default=F#FUNC),
2734 MK_I32 const lvl __parser__(default=0)
2736
2744MK_EXTERN void MK_DECL MkSysPrintProcessMemoryMap_RT (
2747 MK_I32 const debug __parser__(default=0),
2748 MK_STRN const callfunc __parser__(default=F#FUNC),
2749 MK_I32 const lvl __parser__(default=0)
2751
2756 MK_I32 skip __parser__(default=0),
2757 MK_I32 const num __parser__(default=-1),
2758 MK_I32 const debug __parser__(default=0),
2759 MK_STRN const callfunc __parser__(default=F#FUNC),
2760 MK_I32 const lvl __parser__(default=0)
2762
2767__parser__(internal)
2768mk_inline enum MkErrorE MkSysWaitForProcess (
2770 MK_IDNT const id
2771) {
2772 return (*MkLal.MkSysWaitForProcessCB)(fmtobj, id);
2773};
2774
2779__parser__(internal)
2780mk_inline enum MkErrorE MkSysWaitForThread (
2782 MK_IDNT const id
2783) {
2784 return (*MkLal.MkSysWaitForThreadCB)(fmtobj, id);
2785};
2786
2791__parser__(internal)
2792mk_inline enum MkErrorE MkSysUSleep (
2794 useconds_t const usec
2795) {
2796 return (*MkLal.SysUSleep)(fmtobj, usec);
2797};
2798
2805 MK_I32 const sec
2806) {
2807 return (*MkLal.SysSleep)(fmtobj, (unsigned int)sec);
2808};
2809
2818 int isThread,
2819 int num
2820) {
2821 (*MkLal.MkSysExitCB)(MK_RT_CALL isThread,num);
2822};
2823
2838// [MkSysBasename-example]
2841 MK_STRN const pathName,
2842 bool const includeExtension
2844// [MkSysBasename-example]
2845
2860 MK_STRN const pathName
2862
2876 MK_STRN const format,
2877 ...
2879
2886__parser__(internal)
2887MK_EXTERN enum MkErrorE MK_DECL MkSysGetTimeOfDay (
2889 struct mk_timeval * tv_out,
2890 struct mk_timezone * tz_out
2891);
2892
2894__parser__(internal,macro) bool MkSysStringSetNULL_R (MK_STRN const str);
2895#define MkSysStringSetNULL_R(_str) _str[0] = '\0'
2896
2898__parser__(internal,macro) bool MkSysStringSet_R (MK_STRN const str, MK_STRN const other);
2899#define MkSysStringSet_R(_str,_val) strcpy(_str,_val)
2900
2902__parser__(internal,macro) bool MkSysStringIsNULL_R (MK_STRN const str);
2903#define MkSysStringIsNULL_R(_str) (_str[0] == '\0')
2904
2907 return (str == NULL || MkSysStringIsNULL_R(str));
2908};
2909
2912 return (str != NULL && *str != '\0');
2913};
2914
2916__parser__(internal,macro) bool MkSysStringIsEQUAL (MK_STRN const str, MK_STRN const other);
2917#define MkSysStringIsEQUAL(_str,_other) (strcmp(_str,_other) == 0)
2918
2920__parser__(internal,macro) bool MkSysStringIsLenEQUAL (MK_STRN const str, MK_STRN const other, MK_SIZE const len);
2921#define MkSysStringIsLenEQUAL(_str,_other,_len) (strncmp(_str,_other,(size_t)_len) == 0)
2922
2925 return MkSysStringIsNULL(str) ? NULL : str;
2926};
2927
2930 return str == NULL ? "" : str;
2931};
2932
2933__parser__pop__; // internal \}
2934
2974__parser__(keep,doc-no)
2976 MK_STRN key,
2977 MK_NUM length __parser__(default=-1)
2979
2981__parser__(keep,doc-no)
2983 MK_STRN key,
2984 MK_NUM length __parser__(default=-1)
2986
2993__parser__(keep,doc-no)
2996 MK_I32 pid,
2997 MK_I32 signal
2999
3005__parser__(keep,doc-no)
3006MK_EXTERN enum MkErrorE MK_DECL MkSysGetPid (
3008 MK_I32 * pid_out
3010
3011__parser__(ignore)
3012typedef enum MkSysPipeHandlerE {
3014 MK_PIPE_IGNORE = 1
3015} MkSysPipeHandlerE;
3016
3018__parser__(ignore)
3019MK_EXTERN void MK_DECL MkSysPipeHandler (
3020 MkSysPipeHandlerE keepPipe
3022
3024// MkObjectC_Sys_C_API
3025
3108/* ####################################################################### */
3109/* ### ### */
3110/* ### O B J E C T - A P I ### */
3111/* ### ### */
3112/* ####################################################################### */
3113
3147__parser__global__(hide-rx=^Mk\w+Check\M);
3148__parser__global__(hide-rx=^MkObj[A-Z]);
3149__parser__global__(prefix2class:MkObj=MkObjectC);
3150
3153
3154 // TODO !! IMPORTANT INFO ABOUT CHECK !!
3155 // "MqCtxCheck(context)..." check of "context" create "MkDisasterEvent" after "fDecrSelf" etc…
3156 // Problem in PERL (and propably other too) after "fDecrSelf" the "context" becomes INVALID.
3157 // There are TWO phases of INVALID:
3158 // 1. INVALID but still readable -> "MqCtxCheck" works
3159 // 2. INVALID but NOT readable -> "MqCtxCheck" create "MkDisasterEvent"
3160 // It seems that "2." becomes more likely as "context" becomes bigger. "context" becomes bigger
3161 // if more prealloc space is used in "context". seems that if all references to ACTIVE memory is
3162 // gone an entire memory-page becomes "2." -> with other words:
3163 // -> It is not guaranteed that the "MqCtxCheck" technology will work.
3164
3165#define __MkCheckTO(t,o) (((*o).signature & (*t).objmask) == (*t).objsig)
3166#define _MkCheckTO(t,o) ((o) && __MkCheckTO((t),(o)))
3167#define __MkCheckO(cls,o) (((*o).signature & cls##_MASK) == cls##_SIGNATURE)
3168#define _MkCheckO(cls,o) ((o) && __MkCheckO(cls,(o)))
3169#define __MkCheckX(cls,x) __MkCheckO(cls,(cls##_X2obj(x)))
3170#define _MkCheckX(cls,x) ((x) && __MkCheckO(cls,(cls##_X2obj(x))))
3171#define __MkCheckM(cls,m) __MkCheckO(cls,((MK_OBJ)(m)))
3172#define _MkCheckM(cls,m) ((m) && __MkCheckM(cls,m))
3173
3174#define MkCheckNN(cls,x) __MkCheckO(cls,(cls##_X2obj(x)))
3175
3176#ifdef __SANITIZE_ADDRESS__
3177 //#define MkSanitizeCheck(_root,_m) _root##_Check(_m)
3178 #define MkSanitizeCheck(_root,_m) _MkCheckM(_root,_m)
3179 #define MkSanitizeCheckO(_root,_o) _MkCheckO(_root,_o)
3180#else
3181 #define MkSanitizeCheck(_root,_m) _MkCheckM(_root,_m)
3182 #define MkSanitizeCheckO(_root,_o) _MkCheckO(_root,_o)
3183#endif
3184
3187#define MkAssertO(cls,o) assert(o==NULL?true:__MkCheckO(cls,o)) // NULL == true
3188#define MkAssertX(cls,x) assert(x==NULL?true:__MkCheckX(cls,o)) // NULL == true
3190
3192#define MkAssertCastM(cls,m) ({MK_OBJ o=(MK_OBJ)(m);MkAssertO(cls,o);(cls##_type)(o);})
3193
3194#define toTT(_type) (MkTYP(_type))
3195
3197
3199#define MK_NULL_SIGNATURE 0
3200
3219
3236
3238 //bool onDelete;
3239
3244
3249
3250#if defined(META_USE_SELF_REFCOUNT)
3260#endif
3261
3264
3267
3270 struct MkObjectProtectS obj_protect;
3271
3272 // attention !!
3273 // an additional "attribute" have to be initialized in: MkObjInit
3274 // also update : theKernel/cs/libmkkernel.cs
3275};
3276
3277// BEGIN-MkObjectS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3278
3282 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
3283
3284// Signature --------------------------------------------------------------
3287
3288 #define MkObjectC_SIGNATURE (0x59B3u<<16)
3289 #define MkObjectC_MASK (((1u<<16)-1)<<16)
3290
3292
3293// CompileTimeCast --------------------------------------------------------------
3296
3297 #define MkObjectC_X2obj(x) (x)
3298
3300
3301// TypeDef --------------------------------------------------------------
3304
3306 __parser__(ignore) typedef struct MkObjectS MkObjectCR;
3308 __parser__(ignore) typedef const struct MkObjectS MkObjectCNR;
3310 #define MkObjectC_T (&MK_RT_REF._MkObjectC_T)
3312 #define MkObjectC_TT (MkTYP(MkObjectC_T))
3314 #define MkObjectST MkObjectC_T
3316 #define MkObjectSTT (MkTYP(MkObjectST))
3318 #define MkObjectC_type MK_OBJ
3320 #define MkObjectCT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
3322 #define MkObjectCTT_X(instance) (MkOBJ_R(instance).type)
3324 #define MkObjectCT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
3326 #define MkObjectC_NS MK
3328 #define MkObjectCTT MkObjectCTT
3330 #define MkObjectCT ( (struct MkSuperTypeS *) MkObjectCTT )
3331
3333
3334// TypeCheck --------------------------------------------------------------
3337
3338 #pragma GCC diagnostic push
3339 #pragma GCC diagnostic ignored "-Wattributes"
3340
3343 __parser__(class=MkObjectC,static,hide)
3346 return MkSanitizeCheck(MkObjectC,mng);
3347 }
3348
3351 __parser__(class=MkObjectC,static,hide)
3354 return MkSanitizeCheckO(MkObjectC,obj);
3355 }
3356
3357 #pragma GCC diagnostic pop
3358 #define MkObjectC_Check(mng) MkObjCheck(mng)
3359
3361
3362// RunTimeCast --------------------------------------------------------------
3365
3367 __parser__(class=MkObjectC,hide,static)
3368 META_ATTRIBUTE_SANITIZE
3371 return (MkObjCheck(mng) ? (MK_OBJ)mng : NULL);
3372 }
3373
3375 __parser__(class=MkObjectC,hide,static)
3376 META_ATTRIBUTE_SANITIZE
3379 return (MkObjCheck(mng) ? (MK_OBJN)mng : NULL);
3380 }
3381
3383 #define MkObjRaise(_obj) if (!_MkCheckX(MkObjectC,_obj)) { \
3384 MkErrorSetC_1E("'MkObjectC' hdl is NULL"); \
3385 goto error ; \
3386 }
3387
3389 #define MkOBJ_R(x) (*(x)).super.obj
3391 #define MkOBJ(x) (&MkOBJ_R(x))
3392
3394
3397// MkObjectC_Class_Define_C_API
3398
3399// END-MkObjectS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3400
3401// =========================================================================
3402// OVERLOAD
3403
3406
3409__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkObjectC,no-rpc);
3410
3418
3421 return ((MK_HDL)obj->signature);
3422}
3423
3424#define MkObjectHandleGetOfType_1X(x) MkObjectHandleGetOfType(MkOBJ(x))
3425
3431 MK_OBJ const obj __parser__(null-allowed)
3433
3442 MK_OBJ const obj __parser__(null-allowed)
3444
3446
3449
3450// =========================================================================
3451// BEGIN-MkObjectS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3452
3455
3458
3459__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkObjectC);
3460
3478 MK_OBJ const obj __parser__(null-allowed)
3480
3481#define MkObjectHandleGet_1X(x) MkObjectHandleGet(x?MkOBJ(x):NULL)
3482
3493 MK_HDL const netHdl
3495
3505#define MkObjectHandleResolve_e(netHdl) ({ \
3506 MK_HDL tmpHdl=netHdl; \
3507 MK_OBJ tmp; \
3508 if (tmpHdl==0) { \
3509 tmp=NULL; \
3510 } else { \
3511 tmp=MkObjectHandleResolve(tmpHdl); \
3512 if (tmp==NULL) { \
3513 MkErrorSetC_1_NULL("ERROR: 'MkObjectC' handle is 'NULL'"); \
3514 goto error; \
3515 }; \
3516 }; \
3517 tmp; \
3518})
3519
3524 MK_HDL const netHdl
3525);
3526
3531 MK_OBJ const netObj
3532);
3533
3535
3537// Class export & import
3538
3542 __parser__(doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkObjectC,null-return-allow)
3545 return (MK_OBJ)MK_NULL;
3546 }
3548// MkObjectC - Misc - function
3549
3551// MkObjectC_Class_C_API
3552
3553// END-MkObjectS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3554
3557typedef MK_OBJ (*MkConstructorF) ( MK_RT_ARGS MK_TYP type, MK_PTR nat, MK_PTR lnk);
3558typedef void (*MkDestructorF) ( MK_RT_ARGS MK_OBJ const obj);
3559typedef MK_OBJ (*MkDupF) ( MK_RT_ARGS MK_OBJ const obj);
3560typedef MK_OBJ (*MkDup2F) ( MK_RT_ARGS MK_OBJ const obj, MK_STRN const ident);
3561typedef MK_OBJ (*MkMergeF) ( MK_RT_ARGS MK_OBJ const obj);
3562typedef MK_OBJ (*MkCopyF) ( MK_RT_ARGS MK_OBJ const obj, MK_OBJN const src);
3563typedef MK_OBJ (*MkResetF) ( MK_RT_ARGS MK_OBJ const obj);
3564__parser__(flags=public-internal)
3565typedef MK_PTR (*MkSelfCreateF) ( MK_RT_ARGS MK_OBJ const obj, MK_PTR const env);
3566__parser__(flags=public-internal)
3567typedef void (*MkSelfDeleteF) ( MK_RT_ARGS MK_PTR self, MK_PTR const env);
3568__parser__(flags=public-internal)
3569typedef void (*MkSelfUnlinkF) ( MK_RT_ARGS MK_PTR self, MK_PTR const env);
3570typedef void (*MkLogF) ( MK_RT_ARGS MK_OBJN const obj, MK_OBJN fmt, MK_I32 const debug,
3571 MK_STRN const prefix, MK_I32 const lvl);
3572typedef MK_STRN (*MkToStringF) ( MK_RT_ARGS MK_OBJN const obj);
3573typedef MK_PTR (*MkAllocCreateFLT) ( MK_RT_ARGS MK_TYP const type);
3574typedef void (*MkAllocDeleteF) ( MK_RT_ARGS MK_TYP const type, MK_PTR ptr);
3575typedef void (*MkTypeInitF) ( MK_RT_ARGS MK_TYP const type);
3576typedef bool (*MkLogFormatF) ( MK_RT_ARGS char* header, MK_SIZE const headerSize, MK_OBJN const obj,
3577 MK_STRN const caller, MK_I32 const debug, MK_STRN const fmt);
3579
3591__parser__(ignore)
3597
3598
3600// MkObjectC_C_API
3601
3602/* ####################################################################### */
3603/* ### ### */
3604/* ### T Y P E - A P I ### */
3605/* ### ### */
3606/* ####################################################################### */
3607
3747__parser__(internal)
3748struct MkTypeS {
3749 // BEGIN-MkTypeS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3750
3751 union {
3752 struct MkObjectS obj; // instance-base MkObjectS
3753 } super;
3754
3755 // END-MkTypeS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3756
3757 // instance attributes
3758 #define MkTypeS_name_size 32
3762 bool noSelf;
3764 size_t objsize;
3765 size_t typsize;
3766
3769
3770 // slots
3784
3786
3787 struct MkAllocDefS objalloc;
3789};
3790
3791// BEGIN-MkTypeS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3792
3796 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
3797
3798// Signature --------------------------------------------------------------
3801
3802 #define MkTypeC_SIGNATURE (MkObjectC_SIGNATURE ^ (10u<<10))
3803 #define MkTypeC_MASK (((1u<<22)-1)<<10)
3804
3806
3807// CompileTimeCast --------------------------------------------------------------
3810
3811 #define MkTypeC_X2typ(x) (x)
3812 #define MkTypeC_X2obj(x) MkOBJ(x)
3813
3815
3816// TypeDef --------------------------------------------------------------
3819
3821 __parser__(ignore) typedef struct MkTypeS MkTypeCR;
3823 __parser__(ignore) typedef const struct MkTypeS MkTypeCNR;
3825 #define MkTypeSTT (&MK_RT_REF._MkTypeC_TT)
3827 #define MkTypeC_TT (&MK_RT_REF._MkTypeC_TT)
3829 #define MkTypeC_type MK_TYP
3831 #define MkTypeCT_X(instance) ( (struct MkTypeS *) (MkOBJ_R(instance).type) )
3833 #define MkTypeCTT_X(instance) (MkOBJ_R(instance).type)
3835 #define MkTypeCT_TT(typ) ( (struct MkTypeS *) (typ) )
3837 #define MkTypeC_NS MK
3839 #define MkTypeCTT MkTypeCTT
3841 #define MkTypeCT ( (struct MkTypeS *) MkTypeCTT )
3842
3844
3845// TypeCheck --------------------------------------------------------------
3848
3849 #pragma GCC diagnostic push
3850 #pragma GCC diagnostic ignored "-Wattributes"
3851
3854 __parser__(class=MkTypeC,static,ignore)
3857 return MkSanitizeCheck(MkTypeC,mng);
3858 }
3859
3862 __parser__(class=MkTypeC,static,ignore)
3865 return MkSanitizeCheckO(MkTypeC,obj);
3866 }
3867
3868 #pragma GCC diagnostic pop
3869 #define MkTypeC_Check(mng) MkTypCheck(mng)
3870
3872
3875// MkTypeC_Class_Define_C_API
3876
3877// END-MkTypeS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3878
3880__parser__(class=MkObjectC,internal,static)
3881mk_inline MK_TYP MkTyp(const MK_MNG mng) {
3882 if (!MkObjCheck(mng)) return NULL;
3883 MK_OBJ obj = (MK_OBJ) mng;
3884 if (MkTypCheck(obj)) return (MK_TYP)obj;
3885 MK_TYP typ = obj->type;
3886 if (MkTypCheck(typ)) return typ;
3887 return NULL;
3888}
3889
3891__parser__(ignore)
3892mk_inline MK_TYPN MkTypN(const MK_MNGN mng) {
3893 if (!MkObjCheck(mng)) return NULL;
3894 MK_OBJ obj = (MK_OBJ) mng;
3895 if (MkTypCheck(obj)) return (MK_TYPN)obj;
3896 MK_TYPN typ = obj->type;
3897 if (MkTypCheck(typ)) return typ;
3898 return NULL;
3899}
3900
3902#define MkTYP_R(x) (*(x)).super.typ
3904#define MkTYP(x) (&MkTYP_R(x))
3905
3911__parser__(ignore)
3913 // BEGIN-MkSuperTypeS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3914
3915 union {
3916 struct MkObjectS obj; // instance-base MkObjectS
3917 struct MkTypeS typ; // instance-base MkTypeS
3918 } super;
3919
3920 // END-MkSuperTypeS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3921};
3922
3923// BEGIN-MkSuperTypeS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3924
3928 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
3929
3930// Signature --------------------------------------------------------------
3933
3934 #define MkSuperTypeC_SIGNATURE (MkTypeC_SIGNATURE ^ (1u<<6))
3935 #define MkSuperTypeC_MASK (((1u<<26)-1)<<6)
3936
3938
3939// CompileTimeCast --------------------------------------------------------------
3942
3943 #define MkSuperTypeC_X2typ(x) MkTYP(x)
3944 #define MkSuperTypeC_X2obj(x) MkOBJ(x)
3945
3947
3948// TypeDef --------------------------------------------------------------
3951
3953 __parser__(ignore) typedef struct MkSuperTypeS MkSuperTypeCR;
3955 __parser__(ignore) typedef const struct MkSuperTypeS MkSuperTypeCNR;
3957 #define MkSuperTypeSTT (&MK_RT_REF._MkSuperTypeC_TT)
3959 #define MkSuperTypeC_TT (&MK_RT_REF._MkSuperTypeC_TT)
3961 #define MkSuperTypeCT_X(instance) ( (struct MkTypeS *) (MkOBJ_R(instance).type) )
3963 #define MkSuperTypeCTT_X(instance) (MkOBJ_R(instance).type)
3965 #define MkSuperTypeCT_TT(typ) ( (struct MkTypeS *) (typ) )
3967 #define MkSuperTypeC_NS MK
3969 #define MkSuperTypeCTT MkSuperTypeCTT
3971 #define MkSuperTypeCT ( (struct MkTypeS *) MkSuperTypeCTT )
3972
3974
3977// MkSuperTypeC_Class_Define_C_API
3978
3979// END-MkSuperTypeS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3980
3982__parser__(internal)
3983MK_EXTERN MK_PTR MK_DECL MkTypeSlotResolveP(MK_RT_ARGS MK_TYPN const type, size_t const offset, bool const force);
3984
3999#define MkTypeSlotResolve(_tt,fptr,force) ({ \
4000 MK_TYP tt = (_tt) ; /* _tt my be long */ \
4001 tt == NULL ? NULL : /* type not valid */ \
4002 !force && tt->fptr == (MK_PTR) 0x1 ? NULL : /* already resolved, NOT found */ \
4003 tt->fptr > (typeof(tt->fptr)) 0x1 ? tt->fptr : /* already resolved, NOT NULL, found */ \
4004 tt == MkTypeSTT ? NULL : /* already at the ROOT of the type */ \
4005 (typeof(tt->fptr)) MkTypeSlotResolveP(MK_RT_CALL tt, offsetof(struct MkTypeS, fptr), force); \
4006}) \
4007
4008#define MkTypeSlotCall(_tt,fptr,...) do { \
4009 typeof((_tt)->fptr) slot = MkTypeSlotResolve((_tt),fptr,false); \
4010 if (slot) (*slot)(MK_RT_CALL __VA_ARGS__); \
4011} while (false)
4012
4014// MkTypeC_C_API
4015
4016
4017// #######################################################################
4018// -----------------------------------------------------------------------
4024
4025__parser__push__(doc-group=TOR);
4026
4037#if defined(META_USE_SELF_REFCOUNT)
4038 // [MkObjInit2]
4039 #define MkObjInit2(rtmkV,rtExtV,sigV,typeV,refCountV,isLocalV) \
4040 (struct MkObjectS) { \
4041 .signature = sigV, \
4042 .refCount = refCountV, \
4043 .self = NULL, \
4044 .type = typeV, \
4045 .env = NULL, \
4046 .selfCreated = false, \
4047 .selfRefCount = 0, \
4048 .objRt = rtmkV, \
4049 .objRtExt = rtExtV, \
4050 .obj_protect = { \
4051 .isLocal = isLocalV, \
4052 .prev = NULL, \
4053 .next = NULL, \
4054 }, \
4055 }
4056 // [MkObjInit2]
4057#else
4058 #define MkObjInit2(rtmkV,rtExtV,sigV,typeV,refCountV,isLocalV) \
4059 (struct MkObjectS) { \
4060 .signature = sigV, \
4061 .refCount = refCountV, \
4062 .self = NULL, \
4063 .type = typeV, \
4064 .env = NULL, \
4065 .selfCreated = false, \
4066 .objRt = rtmkV, \
4067 .objRtExt = rtExtV, \
4068 .obj_protect = { \
4069 .isLocal = isLocalV, \
4070 .prev = NULL, \
4071 .next = NULL, \
4072 }, \
4073 }
4074#endif
4075
4076#define MkObjInit(rtmkV,rtExtV,cls,refCountV,isLocalV) \
4077 MkObjInit2(rtmkV,rtExtV,cls##_SIGNATURE,cls##_TT,refCountV,isLocalV)
4078
4079// [MkObjInitFromType]
4080#define MkObjInitFromType(typeV,isLocalV) \
4081 MkObjInit2(MK_RT_PTR, NULL, (*typeV).objsig, typeV, 0, isLocalV)
4082// [MkObjInitFromType]
4083
4084#define MkObjInitFromInstance(instV) \
4085 MkObjInit2(MK_RT_PTR, NULL, MkOBJ_R(instV).type->objsig, MkOBJ_R(instV).type, 0, false)
4086
4100__parser__(constructor)
4103 MK_OBJ const srcobj
4105
4117 MK_OBJ const srcmng,
4118 MK_STRN const ident
4120
4136__parser__(constructor)
4137MK_EXTERN MK_OBJ MK_DECL MkObjMerge_RT (
4139 MK_OBJ const obj
4141
4148__parser__(constructor)
4149MK_EXTERN MK_OBJ MK_DECL MkObjCreate_RT (
4151 MK_TYP type __parser__(internal,default=NULL),
4152 MK_PTR nat,
4153 MK_PTR lnk
4155
4156// *******************************************************************************
4157// PUBLIC object API
4158// *******************************************************************************
4159
4178__parser__(destructor,keep-destr)
4179MK_EXTERN void MK_DECL MkObjectDelete_RT (
4181 MK_OBJ obj
4183
4184#define MkObjectDelete_NULL(obj) MkObjectDeleteToNull(MkObjectDelete_RT,MK,obj)
4185#define MkObjectDelete_NULL_X(x) MkObjectDeleteToNull_X(MkObjectDelete_RT,MK,x)
4186#define MkObjectDelete_1X(x) MkObjectDeleteToNull_X(MkObjectDelete_RT,MK,x)
4187
4188#define MkObjectDeleteToNull(fct,NS,x) if (x) { fct (NS##_RT_CALL x); (x) = NULL ; }
4189#define MkObjectDeleteToNull_X(fct,NS,x) if (x) { fct (NS##_RT_CALL MkOBJ(x)); (x) = NULL ; }
4190
4206__parser__(destructor,lng-destr,lng-dispose)
4207MK_EXTERN void MK_DECL MkObjectDispose_RT (
4209 MK_OBJ obj
4211
4212#define MkObjectDispose_NULL(obj) MkObjectDeleteToNull(MkObjectDispose_RT,MK,obj)
4213#define MkObjectDispose_NULL_X(x) MkObjectDeleteToNull_X(MkObjectDispose_RT,MK,x)
4214#define MkObjectDispose_1X(x) MkObjectDispose(MkOBJ(x))
4215
4217#define MkObjectDeleteCallF_CHECK do { \
4218 assert (__data__ != NULL); \
4219} while (0)
4220
4221// [MkObjectDeleteCallF]
4223#define MkObjectDeleteCallF_ARGS \
4224 MK_RT_ARGS \
4225 MK_OBJN const obj __parser__(internal), \
4226 MK_STRN const typeName, \
4227 MK_HDL const typeHdl, \
4228 MK_HDL const objHdl, \
4229 MK_CBP const __data__ \
4230
4231#define MkObjectDeleteCallF_CALL MK_RT_CALL obj, __data__
4232
4277__parser__(flags=public-internal)
4278typedef enum MkErrorE ( MK_DECL *MkObjectDeleteCallF) ( MkObjectDeleteCallF_ARGS ) ;
4279
4281#define MkObjectDeleteFreeF_ARGS MK_RT_ARGS MK_CBP *dataP __parser__(inout)
4282
4283__parser__(flags=public-internal)
4284typedef void ( MK_DECL *MkObjectDeleteFreeF) ( MkObjectDeleteFreeF_ARGS ) ;
4285
4318__parser__(class=MkObjectC,callback-name=ObjectDelete,callback-null)
4319MK_EXTERN enum MkErrorE MK_DECL MkObjectDeleteCallbackSetup_RT (
4321 MK_STRN ident ,
4322 MkObjectDeleteCallF fCall __parser__(callback-call),
4323 MK_CBP callback __parser__(callback-data),
4324 MkObjectDeleteFreeF fFree __parser__(callback-free),
4325 MK_STRN filter __parser__(default=NULL)
4327// [MkObjectDeleteCallF]
4328
4332__parser__(class=MkObjectC)
4333MK_EXTERN void MK_DECL MkObjectDeleteCallbackCleanup_RT (
4335 MK_STRN ident
4337
4338__parser__pop__; // TOR
4339
4341// MkObjectC_TOR_C_API
4342
4343/* ####################################################################### */
4344/* ### ### */
4345/* ### O B J - A P I ### */
4346/* ### ### */
4347/* ####################################################################### */
4348
4363// ***********************************************************************************************
4364
4365
4373 MK_OBJ const tgtmng,
4374 MK_OBJN const srcmng
4376
4380MK_EXTERN MK_OBJ MK_DECL MkObjReset_RT (
4382 MK_OBJ const obj
4384
4385// ****************************************************************************************************
4386
4391
4392__parser__global__(hide-rx=^MkRef);
4393__parser__global__(pattern2prefix:MkRef=MkObj);
4394
4396#define MkRefLOCK 999999
4397
4400__parser__(static)
4402mk_inline void MkRefIncr ( MK_OBJ obj ) {
4403 if (obj) ++(*obj).refCount;
4404}
4405
4406#define MkRefIncr_1X(x) MkRefIncr(MkOBJ(x))
4407#define MkRefIncr_1M(m) MkRefIncr(MkObj(m))
4408
4422#define MkRefIncr_FX(x) MkRefIncr(MkOBJ(x))
4423
4432__parser__(static)
4433MK_EXTERN void MkRefDecr_RT (
4435 MK_OBJ obj
4437
4441#define MkRefDecr_O(o) do { MkRefDecr_RT(MK_RT_CALL o); o=NULL; } while (0)
4445#define MkRefDecr_X(x) do { MkRefDecr_RT(MK_RT_CALL MkOBJ(x)); x=NULL; } while (0)
4447#define MkRefDecr_X_NULL(x) do { MkRefDecr_RT(MK_RT_NULL MkOBJ(x)); x=NULL; } while (0)
4452#define MkRefDecr_M(m) do { MkRefDecr_RT(MK_RT_CALL MkObj(m)); m=NULL; } while (0)
4454#define MkRefDecr_M_NULL(m) do { MkRefDecr_RT(MK_RT_NULL MkObj(m)); m=NULL; } while (0)
4455
4457#define MkRefDecr_FX(x) do { --(MkOBJ_R(x).refCount); } while(0)
4458
4467mk_inline void MkRefIncrSelf( MK_OBJ const obj, MK_PTR const self, MK_PTR const env) {
4468 MK_INSTANCE_HDL(obj);
4469 obj->refCount++;
4470 obj->self = self;
4471 obj->env = env;
4472}
4473
4474#define MkRefIncrSelf_2X(x,s) MkRefIncrSelf(MkOBJ(x),s)
4475
4492 MK_OBJ const obj
4494
4499// 2. \b unlink the \e SELF from \e META using the \RMkRefDecrWithoutSelf call
4511 MK_OBJ const obj
4513
4518__parser__(keep,doc-no)
4521 MK_INSTANCE_HDL(obj);
4522 return (*obj).refCount;
4523}
4524
4525#define MkRefGet_1X(x) MkRefGet(MkOBJ(x))
4526
4531 MK_INSTANCE_HDL(obj);
4532 return (*obj).refCount=MkRefLOCK;
4533}
4534#define MkRefLock_1X(x) MkRefLock(MkOBJ(x))
4535
4540mk_inline bool MkRefIsLocked ( MK_OBJ const obj ) {
4541 MK_INSTANCE_HDL(obj);
4542 return (*obj).refCount >= MkRefLOCK;
4543}
4544#define MkRefIsLocked_1X(x) MkRefIsLocked(MkOBJ(x))
4545
4547#define MkRefSet(target,source) ({ \
4548 if (target != source) { \
4549 typeof(target) targetSave=target; \
4550 target = source;\
4551 MkRefDecr_X(targetSave);\
4552 MkRefIncr_1X(target);\
4553 } \
4554 target;\
4555})
4556
4559
4560#define MkRefCidN_NULL() MkRefCidN_RT(MK_RT_CALL_NULL_ONLY)
4561
4563// MkRef…
4564
4565// *******************************************************************************
4566
4567__parser__global__(hide-rx=^MkSelf);
4568__parser__global__(pattern2prefix:MkSelf=MkObj);
4569
4572
4573typedef void (*MkSelfIncrF) ( MK_RT_ARGS MK_PTR self, MK_PTR const env);
4574typedef void (*MkSelfDecrF) ( MK_RT_ARGS MK_PTR self, MK_PTR const env);
4575
4581mk_inline void MK_DECL MkSelfSet ( MK_OBJ const obj, MK_PTR const self, MK_PTR const env ) {
4582 MK_INSTANCE_HDL(obj);
4583 obj->env = env;
4584 obj->self = (obj->type->noSelf ? NULL : self);
4585}
4586
4587#define MkSelfSet_3X(x,self,env) MkSelfSet(MkOBJ(x),self,env)
4588
4594 // BUG FIX - 1 mar 2023: remove nonnull on obj because C# require this
4595 return obj ? obj->self : NULL;
4596}
4597
4598#define MkSelfGet_1X(x) MkSelfGet(MkOBJ(x))
4599
4624mk_inline enum MkErrorE MK_DECL MkSelfNew_RT (
4626 MK_OBJ obj __parser__(null-allowed),
4627 MK_PTR *self_out,
4628 MK_PTR const env
4629);
4630
4631#define MkSelfNew_3X(x,self_out,env) MkSelfNew(MkOBJ(x),self_out,env)
4632
4644 MK_OBJ const obj,
4645 MK_PTR const env
4646);
4647
4648#define MkSelfCreate_2X(x,env) MkSelfCreate(MkOBJ(x),env)
4649
4658__parser__(static)
4659MK_EXTERN bool MK_DECL MkSelfDelete_RT (
4661 MK_OBJ const obj
4663
4664#define MkSelfDelete_1X(x) MkSelfDelete_RT(MK_RT_CALL MkOBJ(x))
4665
4682__parser__(static)
4683MK_EXTERN bool MK_DECL MkSelfDeleteForce_RT (
4685 MK_OBJ obj
4687
4688#define MkSelfDeleteForce_1X(x) MkSelfDeleteForce(MkOBJ(x))
4689
4706__parser__(static)
4707MK_EXTERN void MK_DECL MkSelfUnlink_RT (
4709 MK_OBJ obj
4711
4712#define MkSelfUnlink_1X(x) MkSelfUnlink(MkOBJ(x))
4713
4717 MK_INSTANCE_HDL(obj);
4718 return obj->self != NULL;
4719}
4720
4721#define MkSelfExists_1X(x) MkSelExists(MkOBJ(x))
4722
4724
4725// addtogroup MkObjectC_Obj_C_API
4727
4728// ****************************************************************************************************
4729
4732
4733//__parser__global__(hide-rx=^MkType);
4734//__parser__global__(prefix2attribute=MkType@internal);
4735//__parser__global__(prefix2attribute=MkType@class=MkTypeC);
4736
4737__parser__push__(internal,class=MkTypeC); // \{ internal
4738
4742__parser__push__(doc-group=TOR);
4743
4830__parser__(macro)
4831MK_TYP MkTypeCreate ( MK_MACRO_TYP const clsV, MK_MACRO_TYP const basicV, MK_STRN const identV);
4832// [MkTypeCreate]
4833#define MkTypeCreate(clsV, basicV, identV) ({ \
4834 MK_TYP ret = MkTypeDup2(basicV ## _TT,identV); \
4835 ret->objsig = clsV ## _SIGNATURE; \
4836 ret->objmask = clsV ## _MASK; \
4837 ret->objsize = sizeof(clsV##R); \
4838 ret ; \
4839})
4840// [MkTypeCreate]
4841
4857 MK_TYPN const typ,
4858 MK_STRN const ident
4860
4873 MK_TYPN const typ
4875
4886 MK_TYPN const typ
4888
4894 MK_TYP const typ
4896
4898
4899// MkTypeC_C_TOR_C_API
4905
4916__parser__(const,class-overload=MkObjectLog)
4917MK_EXTERN void MK_DECL MkTypeLog_RT (
4919 MK_TYPN const typ ,
4921 MK_DBG const debug __parser__(default=0),
4922 MK_STRN const callfunc __parser__(default=F#FUNC),
4923 MK_I32 const lvl __parser__(default=0)
4925
4926
4933#if META_TYPE_DEBUG == 0
4934 #define MkTypeLoop(_cls, _var) \
4935 for (_cls##_type _var = (_cls##_type)_cls##_TT->instances; _var != NULL; \
4936 _var = (_cls##_type)_cls##_X2obj(_var)->obj_protect.next)
4937#else
4938 #define MkTypeLoop(_cls, _var) \
4939 bool _var##_firstB = true; \
4940 _cls##_type _var##_first = (_cls##_type)_cls##_TT->instances; \
4941 for ( \
4942 _cls##_type _var = _var##_first; \
4943 ({ if (!_var##_firstB && _var == _var##_first) { \
4944 MkPanicV_2M(_var,"[MkTypeLoop] INTERNAL ERROR: found 'circle' in 'MkTypeC=%s'", _var->type_name); \
4945 } ; _var##_firstB = false; _var; }); \
4946 _var = (_cls##_type)_cls##_X2obj(_var)->obj_protect.next \
4947 )
4948#endif
4949
4951
4952__parser__pop__; // \}
4953// internal
4954
4955// addtogroup MkTypeC_C_API
4957
4961
4963__parser__(internal,doc-group=Misc)
4964MK_EXTERN MK_BFL MK_DECL MkKernelGetTypeList_RT (
4967
4969
4970// ##################################################################################
4975
4983MK_EXTERN MK_STRN const MK_DECL MkObjectToName_RT (
4985 MK_OBJN const obj
4987
4988#define MkObjectToName_1X(x) MkObjectToName(MkOBJ(x))
4989
5006 MK_OBJN const obj
5008
5009//2021.03.01 ao → #define MkObjectToNameOfType(o) MkObjectToNameOfType((MK_OBJ)(o))
5010#define MkObjectToNameOfType_1X(x) MkObjectToNameOfType(MkOBJ(x))
5011
5022__parser__(template-overload,template-in-c)
5023MK_EXTERN MK_STRN MK_DECL MkObjectToNameOfClass_RT (
5025 MK_OBJ const obj
5027
5028#define MkObjectToNameOfClass_1X(x) MkObjectToNameOfClass_RT(MK_RT_CALL MkOBJ(x))
5029
5042 MK_OBJN const inst __parser__(null-allowed)
5044
5045#define MkObjectToString_1X(x) MkObjectToString(x?MkOBJ(x):NULL)
5046#define MkObjectToString_1M(m) MkObjectToString(m?MkObjN(m):NULL)
5047
5051 MK_OBJ const obj __parser__(null-allowed)
5052) {
5053 return (obj == MK_NULL);
5054}
5055
5057// MkObjectC_Misc_C_API
5058
5059// #######################################################################
5060// -----------------------------------------------------------------------
5086
5087/* ####################################################################### */
5088/* ### ### */
5089/* ### L O G - A P I ### */
5090/* ### ### */
5091/* ####################################################################### */
5092
5106
5107__parser__push__(doc-group=Log);
5108
5124__parser__(no-type-extension)
5125MK_EXTERN void MK_DECL MkLogC_RT (
5128 MK_STRN const message ,
5129 MK_DBG const debug __parser__(default=0),
5130 MK_STRN const callfunc __parser__(default=F#FUNC)
5132
5133#define MkLogC_4X(x,message,debug,callfunc) MkLogC(MkOBJ(x),message,debug,callfunc)
5134#define MkLogC_3X(x,message,debug) MkLogC_3(MkOBJ(x),message,debug)
5135#define MkLogC_2X(x,message) MkLogC_2(MkOBJ(x),message)
5136#define MkLogW(x,callfunc,_debug,message) MkLogC(MkOBJ(x),message,_debug,callfunc)
5137
5150 MK_STRN const callfunc __parser__(default=F#FUNC),
5151 MK_DBG debug __parser__(default=0),
5152 MK_FST const printfmt,
5153 ...
5155
5156#define MkLogV_lvl(x,debug,printfmt,...) MkLogV(MkOBJ(x),__func__,debug,printfmt,__VA_ARGS__)
5157
5158#define MkLogV_4M(x,callfunc,debug,printfmt,...) MkLogV(MkObjN(x),callfunc,debug,printfmt,__VA_ARGS__)
5159#define MkLogV_4X(x,callfunc,debug,printfmt,...) MkLogV(MkOBJ(x),callfunc,debug,printfmt,__VA_ARGS__)
5160#define MkLogV_3X(x,callfunc,printfmt,...) MkLogV_3(MkOBJ(x),callfunc,printfmt,__VA_ARGS__)
5161#define MkLogV_2X(x,printfmt,...) MkLogV_2(MkOBJ(x),printfmt,__VA_ARGS__)
5162
5176 MK_STRN const callfunc __parser__(default=F#FUNC),
5177 MK_DBG debug __parser__(default=0),
5178 MK_FST const printfmt,
5179 va_list var_list
5181
5182#define MkLogVL_5X(fmtobj,callfunc,debug,printfmt,var_list) \
5183 MkLogVL(MkOBJ(fmtobj),callfunc,debug,printfmt,var_list)
5184
5185#if defined(META_DISABLE_LOG)
5186 # define MkDCheck(_debug)
5187 # define MkDLogC(x,_debug,str)
5188 # define MkDLogV(x,_debug,printfmt,...)
5189#else
5190
5191 # define MkDDInit const MK_I32 __dbg = MK_RT_REF.debug
5192 # define MkDDInitNum(n) const MK_I32 __dbg = n
5193
5197# define MkDCheck(_debug) if (unlikely(MK_RT_REF.debug >= _debug))
5198# define MkDDCheck(_debug) if (unlikely(__dbg >= _debug))
5200
5206# define MkDLogC_O(fmtobj,_debug,str) \
5207 if (unlikely(MK_RT_REF.debug >= _debug)) MkLogC(fmtobj,str,_debug,__func__)
5208
5209# define MkDLogC(x,_debug,str) MkDLogC_O(MkOBJ(x),_debug,str)
5210
5211# define MkDDLogC(x,_debug,str) \
5212 if (unlikely(__dbg >= _debug)) MkLogC_4X(x,str,_debug,__func__)
5214
5221# define MkDLogV_O(fmtobj,_debug,printfmt,...) \
5222 if (unlikely(MK_RT_REF.debug >= _debug)) MkLogV(fmtobj,__func__,_debug,printfmt,__VA_ARGS__)
5223
5224# define MkDLogV(x,_debug,printfmt,...) MkDLogV_O(MkOBJ(x),_debug,printfmt,__VA_ARGS__)
5225
5226# define MkDDLogV(fmtobj,_debug,printfmt,...) \
5227 if (unlikely(__dbg >= _debug)) MkLogV_4M(fmtobj,__func__,_debug,printfmt,__VA_ARGS__)
5229
5230#endif
5231
5241 MK_STRN const callfunc __parser__(default=F#FUNC),
5242 MkBinaryR const data
5244
5245#define MkLogHEX_4X(fmtobj,callfunc,data,len) MkLogHEX_RT(MkOBJ(fmtobj),callfunc,data,len)
5246
5257__parser__(const)
5258MK_EXTERN void MK_DECL MkObjectLogSimple_RT (
5260 MK_OBJN const obj ,
5262 MK_DBG const debug __parser__(default=0),
5263 MK_STRN const callfunc __parser__(default=F#FUNC),
5264 MK_I32 const lvl __parser__(default=0)
5266
5267#define MkObjectLogSimple_1X(x) MkObjectLogSimple(MkOBJ(x),NULL,0,__func__,0)
5268
5279__parser__(const)
5280MK_EXTERN void MK_DECL MkObjectLogDetail_RT (
5282 MK_OBJN const obj,
5284 MK_DBG const debug __parser__(default=0),
5285 MK_STRN const callfunc __parser__(default=F#FUNC),
5286 MK_I32 const lvl __parser__(default=0)
5288
5289#define MkObjectLogDetail_1X(x) MkObjectLogDetail(MkOBJ(x),NULL,0,__func__,0)
5290#define MkObjectLogDetail_1M(m) MkObjectLogDetail(MkObj(m),NULL,0,__func__,0)
5291
5370 MK_OBJN const obj,
5372 MK_DBG const debug __parser__(default=0),
5373 MK_STRN const callfunc __parser__(default=F#FUNC),
5374 MK_I32 const lvl __parser__(default=0)
5376
5377#define MkObjectLog_1X(x) MkObjectLog(MkOBJ(x),NULL,0,__func__,0)
5378
5380
5382// MkObjectC_Log_C_API
5383
5384/* ####################################################################### */
5385/* ### ### */
5386/* ### D B G - A P I ### */
5387/* ### ### */
5388/* ####################################################################### */
5389
5397
5398__parser__global__(prefix2class:MkDbg=MkObjectC);
5399
5403__parser__(no-type-extension)
5404MK_EXTERN void MK_DECL MkDbgL_RT (
5407 MK_STRN const message ,
5408 MK_DBG const debug __parser__(default=0),
5409 MK_STRN const callfunc __parser__(default=F#FUNC),
5410 MK_I32 const lvl __parser__(default=0)
5412
5413#define MkDbgL_2M(x,message) MkDbgL(MkObj(x),message,0,__func__,-1)
5414
5418__parser__(no-type-extension,template-overload)
5419MK_EXTERN enum MkErrorE MK_DECL MkDbgDump_RT (
5421 MK_OBJN const obj,
5422 MK_STRN const message __parser__(default=S#"var"),
5423 MK_STRN const callfunc __parser__(default=F#FUNC)
5425
5426#define MkDbgDump_2M(x,message) MkDbgDump_2(MkObj(x),message)
5427
5431 MK_STRN const message ,
5432 MK_DBG const debug __parser__(default=0),
5433 MK_STRN const callfunc __parser__(default=F#FUNC),
5434 MK_I32 const lvl __parser__(default=0)
5436
5438MK_EXTERN void MK_DECL MkDbgSTACK_RT (
5441 MK_I32 const skip __parser__(default=0),
5442 MK_I32 const num __parser__(default=-1),
5443 MK_STRN const callfunc __parser__(default=F#FUNC)
5445
5446#define MkDbgSTACK_3X(x,num,callfunc) MkDbgSTACK_3(MkOBJ(x),num,callfunc)
5447
5455__parser__(no-type-extension)
5456MK_EXTERN void MK_DECL MkDbgO_RT (
5458 MK_OBJN const obj,
5459 MK_STRN const callfunc __parser__(default=F#FUNC)
5461
5462#define MkDbgO_2X(x,callfunc) MkDbgO(MkObj(x),callfunc)
5463#define MkDbgO_1X(x) MkDbgO_2X(x,__func__)
5464#define MkDbgO_1O(x) MkDbgO(x,__func__)
5465
5467__parser__(no-type-extension)
5468MK_EXTERN void MK_DECL MkDbgLogC_RT (
5470 MK_OBJN const obj,
5471 MK_STRN const callfunc __parser__(default=F#FUNC)
5473
5475#define MkDbgLogC_2X(x,callfunc) MkDbgLogC_2(MkOBJ(x),callfunc)
5476
5478// MkObjectC_Dbg_C_API
5479
5480/* MARK_B ################################################################ */
5481/* ### ### */
5482/* ### B U F F E R - A P I ### */
5483/* ### ### */
5484/* ####################################################################### */
5485
5510
5512#define MkBufferS_ils_size (0)
5513
5537// [MkBufferS_example]
5539 // BEGIN-MkBufferS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5540
5541 union {
5542 struct MkObjectS obj; // instance-base MkObjectS
5543 } super;
5544
5545 // END-MkBufferS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5546
5547 // instance attributes
5548 struct {
5551 } var;
5552 // instance storage
5553 struct {
5554 union MkBufferU first;
5557 } storage;
5564};
5565
5566// BEGIN-MkBufferS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5567
5571 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
5572
5573// Signature --------------------------------------------------------------
5576
5577 #define MkBufferC_SIGNATURE (MkObjectC_SIGNATURE ^ (1u<<10))
5578 #define MkBufferC_MASK (((1u<<22)-1)<<10)
5579
5581
5582// CompileTimeCast --------------------------------------------------------------
5585
5586 #define MkBufferC_X2buf(x) (x)
5587 #define MkBufferC_X2obj(x) MkOBJ(x)
5588
5590
5591// TypeDef --------------------------------------------------------------
5594
5596 __parser__(ignore) typedef struct MkBufferS MkBufferCR;
5598 __parser__(ignore) typedef const struct MkBufferS MkBufferCNR;
5600 #define MkBufferC_T (&MK_RT_REF._MkBufferC_T)
5602 #define MkBufferC_TT (MkTYP(MkBufferC_T))
5604 #define MkBufferST MkBufferC_T
5606 #define MkBufferSTT (MkTYP(MkBufferST))
5608 #define MkBufferC_type MK_BUF
5610 #define MkBufferCT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
5612 #define MkBufferCTT_X(instance) (MkOBJ_R(instance).type)
5614 #define MkBufferCT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
5616 #define MkBufferC_NS MK
5618 #define MkBufferCTT MkBufferCTT
5620 #define MkBufferCT ( (struct MkSuperTypeS *) MkBufferCTT )
5621
5623
5624// TypeCheck --------------------------------------------------------------
5627
5628 #pragma GCC diagnostic push
5629 #pragma GCC diagnostic ignored "-Wattributes"
5630
5633 __parser__(class=MkBufferC,static,hide)
5636 return MkSanitizeCheck(MkBufferC,mng);
5637 }
5638
5641 __parser__(class=MkBufferC,static,hide)
5644 return MkSanitizeCheckO(MkBufferC,obj);
5645 }
5646
5647 #pragma GCC diagnostic pop
5648 #define MkBufferC_Check(mng) MkBufCheck(mng)
5649
5651
5652// RunTimeCast --------------------------------------------------------------
5655
5657 __parser__(class=MkBufferC,hide,static)
5658 META_ATTRIBUTE_SANITIZE
5661 return (MkBufCheck(mng) ? (MK_BUF)mng : NULL);
5662 }
5663
5665 __parser__(class=MkBufferC,hide,static)
5666 META_ATTRIBUTE_SANITIZE
5669 return (MkBufCheck(mng) ? (MK_BUFN)mng : NULL);
5670 }
5671
5673 #define MkBufRaise(_buf) if (!_MkCheckX(MkBufferC,_buf)) { \
5674 MkErrorSetC_1E("'MkBufferC' hdl is NULL"); \
5675 goto error ; \
5676 }
5677
5679 #define MkBUF_R(x) (*(x)).super.buf
5681 #define MkBUF(x) (&MkBUF_R(x))
5682
5684
5687// MkBufferC_Class_Define_C_API
5688
5689// END-MkBufferS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5690// [MkBufferS_example]
5691
5693// MkBufferC_C_API
5694
5695// =========================================================================
5696// BEGIN-MkBufferS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5697
5700
5703
5704__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkBufferC);
5705
5721__parser__(class-overload=MkObjectHandleGet)
5725 MK_BUF const buf __parser__(null-allowed)
5726) {
5727 return MkObjectHandleGet(buf?MkOBJ(buf):NULL);
5728}
5729
5738__parser__(flags=new)
5740mk_inline MK_BUF MkBufferHandleResolve_RT (
5742 MK_HDL const netHdl
5743) {
5744 return MkBuf(MkObjectHandleResolve(netHdl));
5745}
5746
5756#define MkBufferHandleResolve_e(netHdl) ({ \
5757 MK_HDL tmpHdl=netHdl; \
5758 MK_BUF tmp; \
5759 if (tmpHdl==0) { \
5760 tmp=NULL; \
5761 } else { \
5762 tmp=MkBufferHandleResolve(tmpHdl); \
5763 if (tmp==NULL) { \
5764 MkErrorSetC_1_NULL("ERROR: 'MkBufferC' handle is 'NULL'"); \
5765 goto error; \
5766 }; \
5767 }; \
5768 tmp; \
5769})
5770
5772
5774// Class export & import
5775
5779 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkBufferC,null-return-allow)
5782 return (MK_BUF)MK_NULL;
5783 }
5785// MkBufferC - Misc - function
5786
5788// MkBufferC_Class_C_API
5789
5790// END-MkBufferS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5791
5792// #######################################################################
5793// -----------------------------------------------------------------------
5805
5807#define MkBuffer64S_ils_size (64)
5808
5812__parser__(ignore)
5814 // BEGIN-MkBuffer64S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5815
5816 union {
5817 struct MkObjectS obj; // instance-base MkObjectS
5818 struct MkBufferS buf; // instance-base MkBufferS
5819 } super;
5820
5821 // END-MkBuffer64S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5822
5823 // instance attributes
5825};
5826
5827// BEGIN-MkBuffer64S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5828
5832 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
5833
5834// Signature --------------------------------------------------------------
5837
5838 #define MkBuffer64C_SIGNATURE (MkBufferC_SIGNATURE ^ (1u<<6))
5839 #define MkBuffer64C_MASK (((1u<<26)-1)<<6)
5840
5842
5843// CompileTimeCast --------------------------------------------------------------
5846
5847 #define MkBuffer64C_X2buf(x) MkBUF(x)
5848 #define MkBuffer64C_X2obj(x) MkOBJ(x)
5849
5851
5852// TypeDef --------------------------------------------------------------
5855
5857 __parser__(ignore) typedef struct MkBuffer64S MkBuffer64CR;
5859 __parser__(ignore) typedef const struct MkBuffer64S MkBuffer64CNR;
5861 #define MkBuffer64C_T (&MK_RT_REF._MkBuffer64C_T)
5863 #define MkBuffer64C_TT (MkTYP(MkBuffer64C_T))
5865 #define MkBuffer64ST MkBuffer64C_T
5867 #define MkBuffer64STT (MkTYP(MkBuffer64ST))
5869 #define MkBuffer64CT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
5871 #define MkBuffer64CTT_X(instance) (MkOBJ_R(instance).type)
5873 #define MkBuffer64CT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
5875 #define MkBuffer64C_NS MK
5877 #define MkBuffer64CTT MkBuffer64CTT
5879 #define MkBuffer64CT ( (struct MkSuperTypeS *) MkBuffer64CTT )
5880
5882
5885// MkBuffer64C_Class_Define_C_API
5886
5887// END-MkBuffer64S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5888
5890// MkBuffer64C_C_API
5891
5892// #######################################################################
5893// -----------------------------------------------------------------------
5899
5901#define MkBuffer256S_ils_size (256)
5902
5906__parser__(ignore)
5908 // BEGIN-MkBuffer256S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5909
5910 union {
5911 struct MkObjectS obj; // instance-base MkObjectS
5912 struct MkBufferS buf; // instance-base MkBufferS
5913 } super;
5914
5915 // END-MkBuffer256S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5916
5917 // instance attributes
5919};
5920
5921// BEGIN-MkBuffer256S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5922
5926 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
5927
5928// Signature --------------------------------------------------------------
5931
5932 #define MkBuffer256C_SIGNATURE (MkBufferC_SIGNATURE ^ (2u<<6))
5933 #define MkBuffer256C_MASK (((1u<<26)-1)<<6)
5934
5936
5937// CompileTimeCast --------------------------------------------------------------
5940
5941 #define MkBuffer256C_X2buf(x) MkBUF(x)
5942 #define MkBuffer256C_X2obj(x) MkOBJ(x)
5943
5945
5946// TypeDef --------------------------------------------------------------
5949
5951 __parser__(ignore) typedef struct MkBuffer256S MkBuffer256CR;
5953 __parser__(ignore) typedef const struct MkBuffer256S MkBuffer256CNR;
5955 #define MkBuffer256C_T (&MK_RT_REF._MkBuffer256C_T)
5957 #define MkBuffer256C_TT (MkTYP(MkBuffer256C_T))
5959 #define MkBuffer256ST MkBuffer256C_T
5961 #define MkBuffer256STT (MkTYP(MkBuffer256ST))
5963 #define MkBuffer256CT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
5965 #define MkBuffer256CTT_X(instance) (MkOBJ_R(instance).type)
5967 #define MkBuffer256CT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
5969 #define MkBuffer256C_NS MK
5971 #define MkBuffer256CTT MkBuffer256CTT
5973 #define MkBuffer256CT ( (struct MkSuperTypeS *) MkBuffer256CTT )
5974
5976
5979// MkBuffer256C_Class_Define_C_API
5980
5981// END-MkBuffer256S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5982
5984// MkBuffer256C_C_API
5985
5986// #######################################################################
5987// -----------------------------------------------------------------------
5993
5995#define MkBuffer1024S_ils_size (1024)
5996
6000__parser__(ignore)
6002 // BEGIN-MkBuffer1024S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6003
6004 union {
6005 struct MkObjectS obj; // instance-base MkObjectS
6006 struct MkBufferS buf; // instance-base MkBufferS
6007 } super;
6008
6009 // END-MkBuffer1024S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6010
6011 // instance attributes
6013};
6014
6015// BEGIN-MkBuffer1024S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6016
6020 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
6021
6022// Signature --------------------------------------------------------------
6025
6026 #define MkBuffer1024C_SIGNATURE (MkBufferC_SIGNATURE ^ (3u<<6))
6027 #define MkBuffer1024C_MASK (((1u<<26)-1)<<6)
6028
6030
6031// CompileTimeCast --------------------------------------------------------------
6034
6035 #define MkBuffer1024C_X2buf(x) MkBUF(x)
6036 #define MkBuffer1024C_X2obj(x) MkOBJ(x)
6037
6039
6040// TypeDef --------------------------------------------------------------
6043
6047 __parser__(ignore) typedef const struct MkBuffer1024S MkBuffer1024CNR;
6049 #define MkBuffer1024C_T (&MK_RT_REF._MkBuffer1024C_T)
6051 #define MkBuffer1024C_TT (MkTYP(MkBuffer1024C_T))
6053 #define MkBuffer1024ST MkBuffer1024C_T
6055 #define MkBuffer1024STT (MkTYP(MkBuffer1024ST))
6057 #define MkBuffer1024CT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
6059 #define MkBuffer1024CTT_X(instance) (MkOBJ_R(instance).type)
6061 #define MkBuffer1024CT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
6063 #define MkBuffer1024C_NS MK
6065 #define MkBuffer1024CTT MkBuffer1024CTT
6067 #define MkBuffer1024CT ( (struct MkSuperTypeS *) MkBuffer1024CTT )
6068
6070
6073// MkBuffer1024C_Class_Define_C_API
6074
6075// END-MkBuffer1024S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6076
6078// MkBuffer1024C_C_API
6079
6080#ifndef __has_parser__
6081
6091#define MkBuf2XXXfast(buf) (*(buf)->storage.first.A)
6092
6093#define MkBuf2BOLfast(buf) MkBuf2XXXfast(buf).BOL
6094#define MkBuf2I8fast(buf) MkBuf2XXXfast(buf).I8
6095#define MkBuf2I16fast(buf) MkBuf2XXXfast(buf).I16
6096#define MkBuf2I32fast(buf) MkBuf2XXXfast(buf).I32
6097#define MkBuf2I64fast(buf) MkBuf2XXXfast(buf).I64
6098#define MkBuf2FLTfast(buf) MkBuf2XXXfast(buf).FLT
6099#define MkBuf2DBLfast(buf) MkBuf2XXXfast(buf).DBL
6101
6108#define MkBuf2XXX(xxx,len,buf) ({MK_##xxx __tmp; memcpy(&__tmp,buf->storage.first.B,len); __tmp;})
6109
6110#define MkBuf2BOL(buf) MkBuf2XXX(BOL,1,buf)
6111#define MkBuf2I8(buf) MkBuf2XXX(I8,1,buf)
6112#define MkBuf2I16(buf) MkBuf2XXX(I16,2,buf)
6113#define MkBuf2I32(buf) MkBuf2XXX(I32,4,buf)
6114#define MkBuf2I64(buf) MkBuf2XXX(I64,8,buf)
6115#define MkBuf2FLT(buf) MkBuf2XXX(FLT,4,buf)
6116#define MkBuf2DBL(buf) MkBuf2XXX(DBL,8,buf)
6117
6118#define MkBuf2Ptr(len,ptr,buf) memcpy((void*)ptr,buf->storage.first.B,len)
6119#define MkBuf2BOL_P(ptr,buf) MkBuf2Ptr(1,ptr,buf)
6120#define MkBuf2I8_P(ptr,buf) MkBuf2Ptr(1,ptr,buf)
6121#define MkBuf2I16_P(ptr,buf) MkBuf2Ptr(2,ptr,buf)
6122#define MkBuf2I32_P(ptr,buf) MkBuf2Ptr(4,ptr,buf)
6123#define MkBuf2I64_P(ptr,buf) MkBuf2Ptr(8,ptr,buf)
6124#define MkBuf2FLT_P(ptr,buf) MkBuf2Ptr(4,ptr,buf)
6125#define MkBuf2DBL_P(ptr,buf) MkBuf2Ptr(8,ptr,buf)
6126
6127#define MkBuf2Ptr_A(l,a,b) memcpy(a.B##l,b->storage.first.B,l)
6128#define MkBuf2BOL_A(ato,buf) MkBuf2Ptr_A(1,ato,buf)
6129#define MkBuf2I8_A(ato,buf) MkBuf2Ptr_A(1,ato,buf)
6130#define MkBuf2I16_A(ato,buf) MkBuf2Ptr_A(2,ato,buf)
6131#define MkBuf2I32_A(ato,buf) MkBuf2Ptr_A(4,ato,buf)
6132#define MkBuf2I64_A(ato,buf) MkBuf2Ptr_A(8,ato,buf)
6133#define MkBuf2FLT_A(ato,buf) MkBuf2Ptr_A(4,ato,buf)
6134#define MkBuf2DBL_A(ato,buf) MkBuf2Ptr_A(8,ato,buf)
6135
6137// MkBuf2TT
6138
6139#endif // !__has_parser__
6140
6141__parser__push__(hide,overload-c-no);
6142
6156
6160 MK_STRN const str,
6161 MK_NUM const length,
6162 MK_BOL *val_out
6164
6165#define MkString2O(s,l,r) MkString2BOL_RT(MK_RT_CALL s,l,r)
6166
6169 MK_STRN const str,
6170 MK_NUM const length,
6171 MK_I8 *val_out
6173
6174#define MkString2Y(s,l,r) MkString2I8_RT(MK_RT_CALL s,l,r)
6175
6178 MK_STRN const str,
6179 MK_NUM const length,
6180 MK_I16 *val_out
6182
6183#define MkString2S(s,l,r) MkString2I16_RT(MK_RT_CALL s,l,r)
6184
6187 MK_STRN const str,
6188 MK_NUM const length,
6189 MK_U16 *val_out
6191
6192#define MkString2US(s,l,r) MkString2U16_RT(MK_RT_CALL s,l,r)
6193
6196 MK_STRN const str,
6197 MK_NUM const length,
6198 MK_I32 *val_out
6200
6201#define MkString2I(s,l,r) MkString2I32_RT(MK_RT_CALL s,l,r)
6202
6205 MK_STRN const str,
6206 MK_NUM const length,
6207 MK_U32 *val_out
6209
6210#define MkString2UI(s,l,r) MkString2U32_RT(MK_RT_CALL s,l,r)
6211
6214 MK_STRN const str,
6215 MK_NUM const length,
6216 MK_I64 *val_out
6218
6219#define MkString2W(s,l,r) MkString2I64_RT(MK_RT_CALL s,l,r)
6220
6221/*
6222MK_EXTERN enum MkErrorE MK_DECL MkString2LLG_RT (
6223 MK_PARSER_RT
6224 MK_STRN const str,
6225 MK_NUM const length,
6226 MK_LLG *val_out
6227) MK_ATTR_RT_STATIC;
6228
6229#define MkString2X(s,l,r) MkString2LLG_RT(MK_RT_CALL s,l,r)
6230*/
6231
6234 MK_STRN const str,
6235 MK_NUM const length,
6236 MK_FLT *val_out
6238
6239#define MkString2F(s,l,r) MkString2FLT_RT(MK_RT_CALL s,l,r)
6240
6243 MK_STRN const str,
6244 MK_NUM const length,
6245 MK_DBL *val_out
6247
6248#define MkString2D(s,l,r) MkString2DBL_RT(MK_RT_CALL s,l,r)
6249
6252 MK_STRN const str,
6253 MK_NUM const length,
6254 MK_LONG *val_out
6256
6259 MK_STRN const str,
6260 MK_NUM const length,
6261 MK_BOOL *val_out
6263
6264__parser__(internal)
6265MK_EXTERN enum MkErrorE MK_DECL MkString2ATO_RT (
6267 MK_STRN const str,
6268 MK_NUM const length,
6269 enum MkTypeE type,
6270 MK_ATO *val_out
6272
6273MK_EXTERN enum MkErrorE MK_DECL MkString2HDL_RT (
6275 MK_STRN const str,
6276 MK_NUM const length,
6277 MK_HDL *val_out
6279
6281
6283// MkString2TT
6285// MkBufferC_C_API
6286
6287// #######################################################################
6288// -----------------------------------------------------------------------
6293
6294__parser__push__(doc-group=TOR);
6295
6308// [MkBufferCreate]
6309__parser__(constructor,lng-constr)
6310MK_EXTERN MK_BUF MK_DECL MkBufferCreate_RT (
6312 MK_TYP type __parser__(internal,default=NULL),
6313 MK_NUM const size __parser__(default=0)
6315// [MkBufferCreate]
6316
6318__parser__(constructor,doc-sort=ils0)
6319MK_EXTERN MK_BUF MK_DECL MkBufferCreate64_RT (
6321 MK_NUM const size __parser__(default=0)
6323
6325__parser__(constructor,doc-sort=ils1)
6326MK_EXTERN MK_BUF MK_DECL MkBufferCreate256_RT (
6328 MK_NUM const size __parser__(default=0)
6330
6332__parser__(constructor,doc-sort=ils2)
6333MK_EXTERN MK_BUF MK_DECL MkBufferCreate1024_RT (
6335 MK_NUM const size __parser__(default=0)
6337
6338__parser__(constructor,macro,doc-sort=tmpl0)
6352// [MkBufferCreateTLS_T]
6353#define MkBufferCreateTLS_T(cls,name,size) \
6354 static MkThreadLocal cls##R name##R = {0}; \
6355 MK_BUF name = MkBUF(&name##R); \
6356 if (unlikely(!__MkCheckX(cls,&name##R))) { \
6357 MkBufferInit(name,cls##_TT,size); \
6358 MkRefIncr_1X(name); \
6359 } else if (MkBUF_R(&name##R).var.cursize) { \
6360 MkBufferReset(name); \
6361 }
6362// [MkBufferCreateTLS_T]
6363
6364__parser__(constructor,macro,doc-sort=tmpl1)
6372// [MkBufferCreateTLS_inout_T]
6373#define MkBufferCreateTLS_inout_T(cls,name,inout) \
6374 static MkThreadLocal struct MkBufferS __hidden_##name##R = {0}; \
6375 MK_BUF name = *inout != NULL ? *inout : &__hidden_##name##R; \
6376 if (likely(!__MkCheckX(MkBufferC,name))) { \
6377 MkBufferInit(name,cls##_TT,0); \
6378 MkRefIncr_1X(name); \
6379 } else if (name->var.cursize) { \
6380 MkBufferReset(name); \
6381 } \
6382// [MkBufferCreateTLS_inout_T]
6383
6384__parser__(constructor,macro,doc-sort=tmpl2)
6399// [MkBufferCreateLOCAL_T]
6400#define MkBufferCreateLOCAL_T(cls,name,size) \
6401 cls##R name##R = {0}; \
6402 struct MkBufferS * const name = MkBUF(&name##R); \
6403 MkBufferInit(name,cls##_TT,size)
6404// [MkBufferCreateLOCAL_T]
6405
6414__parser__(constructor)
6415MK_EXTERN MK_BUF MK_DECL MkBufferCreateI8_RT (
6417 MK_I8 const val
6419
6422__parser__(constructor)
6423MK_EXTERN MK_BUF MK_DECL MkBufferCreateBOL_RT (
6425 MK_BOL const val
6427
6430__parser__(constructor)
6431MK_EXTERN MK_BUF MK_DECL MkBufferCreateI16_RT (
6433 MK_I16 const val
6435
6438__parser__(constructor)
6439MK_EXTERN MK_BUF MK_DECL MkBufferCreateI32_RT (
6441 MK_I32 const val
6443
6446__parser__(constructor)
6447MK_EXTERN MK_BUF MK_DECL MkBufferCreateFLT_RT (
6449 MK_FLT const val
6451
6454__parser__(constructor)
6455MK_EXTERN MK_BUF MK_DECL MkBufferCreateI64_RT (
6457 MK_I64 const val
6459
6462__parser__(constructor)
6463MK_EXTERN MK_BUF MK_DECL MkBufferCreateDBL_RT (
6465 MK_DBL const val
6467
6470__parser__(constructor)
6471MK_EXTERN MK_BUF MK_DECL MkBufferCreateSTR_RT (
6473 MK_STRN const val
6475
6478__parser__(constructor)
6479MK_EXTERN MK_BUF MK_DECL MkBufferCreateBIN_RT (
6481 MkBinaryR const val
6483
6496__parser__(doc-sort=b0)
6497MK_EXTERN MK_BUF MK_DECL MkBufferCreateTLS_RT (
6499 MK_STRN const tlsName ,
6500 bool const resetB __parser__(default=true)
6502
6505__parser__(constructor,static,doc-sort=b1)
6506MK_EXTERN MK_BUF MK_DECL MkBufferCreateBUF_RT (
6508 MK_BUFN const val
6510
6531__parser__(internal)
6532MK_EXTERN void MK_DECL MkBufferFree_RT (
6534 MK_BUF const buf
6536
6541// [MkBufferInit]
6542__parser__(internal)
6543MK_EXTERN void MK_DECL MkBufferInit_RT (
6545 MK_BUF const buf,
6546 MK_TYP type __parser__(internal,default=NULL),
6547 MK_NUM const size __parser__(default=0)
6549// [MkBufferInit]
6550
6556__parser__(destructor)
6557MK_EXTERN void MK_DECL MkBufferDelete_RT (
6559 MK_BUF const buf
6561
6571__parser__(constructor)
6572MK_EXTERN MK_BUF MK_DECL MkBufferDup_RT (
6574 MK_BUFN const buf
6576
6592__parser__(constructor)
6593MK_EXTERN MK_BUF MK_DECL MkBufferMerge_RT (
6595 MK_BUF const buf
6597
6598__parser__pop__; // TOR
6599
6601// MkBufferC_TOR_C_API
6602
6603// #######################################################################
6604// -----------------------------------------------------------------------
6609
6610__parser__global__(prefix2doc:MkBufferGet=Get);
6611
6623MK_EXTERN enum MkErrorE MK_DECL MkBufferGetI8_RT (
6625 MK_BUFN const buf,
6626 MK_I8 * const val_out
6628
6631MK_EXTERN enum MkErrorE MK_DECL MkBufferGetBOL_RT (
6633 MK_BUFN const buf,
6634 MK_BOL * const val_out
6636
6639MK_EXTERN enum MkErrorE MK_DECL MkBufferGetI16_RT (
6641 MK_BUFN const buf,
6642 MK_I16 * const val_out
6644
6647__parser__(internal)
6648MK_EXTERN enum MkErrorE MK_DECL MkBufferGetU16_RT (
6650 MK_BUFN const buf,
6651 MK_U16 * const val_out
6653
6656MK_EXTERN enum MkErrorE MK_DECL MkBufferGetI32_RT (
6658 MK_BUFN const buf,
6659 MK_I32 * const val_out
6661
6664__parser__(internal)
6665MK_EXTERN enum MkErrorE MK_DECL MkBufferGetU32_RT (
6667 MK_BUFN const buf,
6668 MK_U32 * const val_out
6670
6673MK_EXTERN enum MkErrorE MK_DECL MkBufferGetFLT_RT (
6675 MK_BUFN const buf,
6676 MK_FLT * const val_out
6678
6681MK_EXTERN enum MkErrorE MK_DECL MkBufferGetI64_RT (
6683 MK_BUFN const buf,
6684 MK_I64 * const val_out
6686
6687/*
6690__parser__(internal)
6691MK_EXTERN enum MkErrorE MK_DECL MkBufferGetLL_RT (
6692 MK_PARSER_RT
6693 MK_BUFN const buf,
6694 MK_LLG * const val_out
6695) MK_ATTR_RT_INSTANCE;
6696
6697#define MkBufferGetLLG(b,o) MkBufferGetLL(b,o)
6698*/
6699
6702MK_EXTERN enum MkErrorE MK_DECL MkBufferGetDBL_RT (
6704 MK_BUFN const buf,
6705 MK_DBL * const val_out
6707
6712MK_EXTERN enum MkErrorE MK_DECL MkBufferGetBIN_RT (
6714 MK_BUFN const buf,
6715 MkBinaryR * const val_out
6717
6721// [__parser__out__]
6722MK_EXTERN enum MkErrorE MK_DECL MkBufferGetSTR_RT (
6724 MK_BUFN const buf,
6725 MK_STRN * const val_out
6727// [__parser__out__]
6728
6733MK_EXTERN enum MkErrorE MK_DECL MkBufferGetStringR_RT (
6735 MK_BUFN const buf,
6736 MkStringR * const val_out
6738
6742MK_EXTERN enum MkErrorE MK_DECL MkBufferGetBUF_RT (
6744 MK_BUF const buf,
6745 MK_BUF * const val_out
6747
6757__parser__(no-static)
6758MK_EXTERN enum MkErrorE MK_DECL MkBufferGetBFL_RT (
6760 MK_BUFN const buf,
6761 MK_BFL * const val_inout
6763
6766__parser__(internal)
6767MK_EXTERN enum MkErrorE MK_DECL MkBufferGetLONG_RT (
6769 MK_BUFN const buf,
6770 MK_LONG * const val_out
6772
6775__parser__(internal)
6776MK_EXTERN enum MkErrorE MK_DECL MkBufferGetBOOL_RT (
6778 MK_BUFN const buf,
6779 MK_BOOL * const val_out
6781
6783// MkBufferC_Get_C_API
6784
6785
6786// #######################################################################
6787// -----------------------------------------------------------------------
6792
6793__parser__global__(prefix2doc:MkBufferSet=Set);
6794
6804MK_EXTERN MK_BUF MK_DECL MkBufferSetI8_RT (
6806 MK_BUF const buf,
6807 MK_I8 const val
6809
6812MK_EXTERN MK_BUF MK_DECL MkBufferSetBOL_RT (
6814 MK_BUF const buf,
6815 MK_BOL const val
6817
6820MK_EXTERN MK_BUF MK_DECL MkBufferSetI16_RT (
6822 MK_BUF const buf,
6823 MK_I16 const val
6825
6828MK_EXTERN MK_BUF MK_DECL MkBufferSetI32_RT (
6830 MK_BUF const buf,
6831 MK_I32 const val
6833
6836MK_EXTERN MK_BUF MK_DECL MkBufferSetFLT_RT (
6838 MK_BUF const buf,
6839 MK_FLT const val
6841
6844MK_EXTERN MK_BUF MK_DECL MkBufferSetI64_RT (
6846 MK_BUF const buf,
6847 MK_I64 const val
6849
6852MK_EXTERN MK_BUF MK_DECL MkBufferSetDBL_RT (
6854 MK_BUF const buf,
6855 MK_DBL const val
6857
6860MK_EXTERN MK_BUF MK_DECL MkBufferSetSTR_RT (
6862 MK_BUF const buf,
6863 MK_STRN const val
6865
6868MK_EXTERN MK_BUF MK_DECL MkBufferSetBIN_RT (
6870 MK_BUF const buf,
6871 MkBinaryR const val
6873
6876MK_EXTERN MK_BUF MK_DECL MkBufferSetBUF_RT (
6878 MK_BUF const buf,
6879 MK_BUFN const val
6881
6886MK_EXTERN MK_BUF MK_DECL MkBufferSetVL_RT (
6888 MK_BUF const buf,
6889 MK_FST const val,
6890 va_list var_list
6892
6896MK_EXTERN MK_BUF MK_DECL MkBufferSetV_RT (
6898 MK_BUF const buf,
6899 MK_FST const val,
6900 ...
6902
6905MK_EXTERN MK_BUF MK_DECL MkBufferSetBinaryR_RT (
6907 MK_BUF const buf,
6908 MkBinaryR const val
6910
6913MK_EXTERN MK_BUF MK_DECL MkBufferSetStringR_RT (
6915 MK_BUF const buf,
6916 MkStringR const val
6918
6920// MkBufferC_Set_C_API
6921
6922// #######################################################################
6923// -----------------------------------------------------------------------
6928
6929__parser__push__(doc-group=Info);
6930
6934__parser__(no-rpc)
6935MK_EXTERN MK_STRB MK_DECL MkBufferGetType1_RT (
6937 MK_BUFN const buf
6939
6943MK_EXTERN enum MkTypeE MK_DECL MkBufferGetType2_RT (
6945 MK_BUFN const buf
6947
6951MK_EXTERN MK_STRN MK_DECL MkBufferGetType3_RT (
6953 MK_BUFN const buf
6955
6961MK_EXTERN bool MK_DECL MkBufferIsLocal_RT (
6963 MK_BUFN const buf
6965
6976__parser__(const,class-overload=MkObjectLog)
6977MK_EXTERN void MK_DECL MkBufferLog_RT (
6979 MK_BUFN const buf,
6981 MK_DBG const debug __parser__(default=0),
6982 MK_STRN const callfunc __parser__(default=F#FUNC),
6983 MK_I32 const lvl __parser__(default=0)
6985
6993__parser__(internal)
6994MK_EXTERN void MK_DECL MkBufferLogSS_RT (
6996 MK_BUFN const buf,
6997 MK_STRN const varname __parser__(default=S#"buf"),
6999 MK_STRN const callfunc __parser__(default=F#FUNC)
7001
7011 MK_BUFN const buf,
7012 MK_STRN const varname __parser__(default=S#"buf"),
7014 MK_STRN const callfunc __parser__(default=F#FUNC)
7016
7017#define MkBufferLogS_2V(buf,fmt) MkBufferLogS_3(buf,#fmt,MkOBJ(fmt))
7018
7020
7022// MkBufferC_Info_C_API
7023
7024
7025// #######################################################################
7026// -----------------------------------------------------------------------
7031
7044 MK_BUFN const buf1,
7045 MK_BUFN const buf2
7047
7057 MK_BUF const buf, // TODO: special case update buffer should be default return
7058 enum MkTypeE const typ
7060
7062__parser__(class-overload=MkObjectToString)
7066 MK_BUFN const inst
7068
7079 MK_BUF const buf,
7080 MK_NUM const size
7082
7092 MK_BUF const buf,
7093 MK_NUM const size
7095
7103 MK_BUF const buf
7105
7115 MK_BUF const buf
7117
7124__parser__(const)
7125MK_EXTERN MK_BUF MK_DECL MkBufferCopy_RT (
7127 MK_BUF const buf,
7128 MK_BUFN const srce
7130
7143__parser__(no-static)
7144MK_EXTERN MK_BUF MK_DECL MkBufferTemp_RT (
7146 MK_BUFN const buf
7148
7150// MkBufferC_Misc_C_API
7151
7152
7153// #######################################################################
7154// -----------------------------------------------------------------------
7159
7160__parser__push__(doc-group=Access);
7161
7170__parser__(no-type-extension)
7171MK_EXTERN MK_BUF MK_DECL MkBufferAppendSTR_RT (
7173 MK_BUF const buf,
7174 MK_STRN const val
7176
7185__parser__(no-type-extension)
7186MK_EXTERN MK_BUF MK_DECL MkBufferAppendStringR_RT (
7188 MK_BUF const buf,
7189 MkStringR const val
7191
7199MK_EXTERN MK_I32 MK_DECL MkBufferAppendVL_RT (
7201 MK_BUF const buf,
7202 MK_FST const printfmt,
7203 va_list var_list
7205
7212MK_EXTERN MK_I32 MK_DECL MkBufferAppendV_RT (
7214 MK_BUF const buf,
7215 MK_FST const printfmt,
7216 ...
7218
7226MK_EXTERN MK_NUM MK_DECL MkBufferPush_RT (
7228 MK_BUF const buf,
7229 MK_STRN const val
7231
7239MK_EXTERN MK_NUM MK_DECL MkBufferPop_RT (
7241 MK_BUF const buf,
7242 MK_STRN const val
7244
7246__parser__(template-required,no-rpc,keep,no-static)
7247MK_EXTERN enum MkErrorE MK_DECL MkBufferToObject_RT (
7249 MK_BUF const buf,
7250 MK_NAT_OBJECT * obj_out
7252
7254
7256// MkBufferC_Access_C_API
7257
7258/* MARK_S ################################################################ */
7259/* ### ### */
7260/* ### B U F F E R - S T R E A M - A P I ### */
7261/* ### ### */
7262/* ####################################################################### */
7263
7279
7298
7299struct MkBufferStreamSaveS;
7300
7302#define MkBufferStreamS_ils_size (0)
7303
7331// [MkBufferStreamS_example]
7333 // BEGIN-MkBufferStreamS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7334
7335 union {
7336 struct MkObjectS obj; // instance-base MkObjectS
7337 struct MkBufferS buf; // instance-base MkBufferS
7338 } super;
7339
7340 // END-MkBufferStreamS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7341
7342 // instance attributes
7343 struct {
7344 MK_NUM numItems; // the number of items in the package
7345 MK_I32 undo; // \e undo last operation: read=+1 < no=0 < write=-1)
7346 // \note The \e endian_is_wrong attribute is required if a \RMkBufferStreamC is send to
7347 // an other host. The \e sender-endian is part of the \e package-header and the \e reader is using
7348 // the information from the \e package-header to setup the \e endian_is_wrong attribute.
7349 // \li \b false (0) if the endian is the \b same as the local endian.
7350 // \li \b true (1) if the endian is \b not the same as the local endian.
7351 // If \e endian_is_wrong is \b true the package header transform the native-binary-package-data
7352 // to the local endian as part of the \RDocMqA{ReadTT} and \RDocNsA{BufferStreamReadTT} methods.
7353 // The transformation of native data is \b only done if required, just \e routing of a package
7354 // does \b not require a transformation.
7355 bool endian_is_wrong; // the value: \e TRUE if endian of storage != \c MK_ENDIAN_MY
7356 } var; // variable part of the \e instance-data
7357 struct {
7363 union MkBufferU cur;
7364 } storage; // storage part of the \e instance-data
7365
7366 // BUG FIX don't put busRef into "var" -> the pMkBusReadL_END will "overwrite" the data including the
7367 // "self" pointer
7368 struct MkBuffer64S busRef; // pBusReadNextWord will fill this
7369
7370 struct MkCacheS saveCache; // cache to support recursion in LST sub-package
7371 struct MkBufferStreamSaveS * busWriteSave; // if \b not NULL than an active LST-WRITE is ongoing
7372 struct MkBufferStreamSaveS * busReadSave; // if \b not NULL than an active LST-READ is ongoing
7373
7374 MK_BINB ils_data[MkBufferStreamS_ils_size]; // \e ILS storage
7375};
7376// [MkBufferStreamS_example]
7377
7378// BEGIN-MkBufferStreamS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7379
7383 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
7384
7385// Signature --------------------------------------------------------------
7388
7389 #define MkBufferStreamC_SIGNATURE (MkBufferC_SIGNATURE ^ (4u<<6))
7390 #define MkBufferStreamC_MASK (((1u<<26)-1)<<6)
7391
7393
7394// CompileTimeCast --------------------------------------------------------------
7397
7398 #define MkBufferStreamC_X2bus(x) (x)
7399 #define MkBufferStreamC_X2buf(x) MkBUF(x)
7400 #define MkBufferStreamC_X2obj(x) MkOBJ(x)
7401
7403
7404// TypeDef --------------------------------------------------------------
7407
7411 __parser__(ignore) typedef const struct MkBufferStreamS MkBufferStreamCNR;
7413 #define MkBufferStreamC_T (&MK_RT_REF._MkBufferStreamC_T)
7415 #define MkBufferStreamC_TT (MkTYP(MkBufferStreamC_T))
7417 #define MkBufferStreamST MkBufferStreamC_T
7419 #define MkBufferStreamSTT (MkTYP(MkBufferStreamST))
7421 #define MkBufferStreamC_type MK_BUS
7423 #define MkBufferStreamCT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
7425 #define MkBufferStreamCTT_X(instance) (MkOBJ_R(instance).type)
7427 #define MkBufferStreamCT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
7429 #define MkBufferStreamC_NS MK
7431 #define MkBufferStreamCTT MkBufferStreamCTT
7433 #define MkBufferStreamCT ( (struct MkSuperTypeS *) MkBufferStreamCTT )
7434
7436
7437// TypeCheck --------------------------------------------------------------
7440
7441 #pragma GCC diagnostic push
7442 #pragma GCC diagnostic ignored "-Wattributes"
7443
7446 __parser__(class=MkBufferStreamC,static,hide)
7449 return MkSanitizeCheck(MkBufferStreamC,mng);
7450 }
7451
7454 __parser__(class=MkBufferStreamC,static,hide)
7457 return MkSanitizeCheckO(MkBufferStreamC,obj);
7458 }
7459
7460 #pragma GCC diagnostic pop
7461 #define MkBufferStreamC_Check(mng) MkBusCheck(mng)
7462
7464
7465// RunTimeCast --------------------------------------------------------------
7468
7470 __parser__(class=MkBufferStreamC,hide,static)
7471 META_ATTRIBUTE_SANITIZE
7474 return (MkBusCheck(mng) ? (MK_BUS)mng : NULL);
7475 }
7476
7478 __parser__(class=MkBufferStreamC,hide,static)
7479 META_ATTRIBUTE_SANITIZE
7482 return (MkBusCheck(mng) ? (MK_BUSN)mng : NULL);
7483 }
7484
7486 #define MkBusRaise(_bus) if (!_MkCheckX(MkBufferStreamC,_bus)) { \
7487 MkErrorSetC_1E("'MkBufferStreamC' hdl is NULL"); \
7488 goto error ; \
7489 }
7490
7492 #define MkBUS_R(x) (*(x)).super.bus
7494 #define MkBUS(x) (&MkBUS_R(x))
7495
7497
7500// MkBufferStreamC_Class_Define_C_API
7501
7502// END-MkBufferStreamS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7503
7504// =========================================================================
7505// BEGIN-MkBufferStreamS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7506
7509
7512
7513__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkBufferStreamC);
7514
7530__parser__(class-overload=MkObjectHandleGet)
7534 MK_BUS const bus __parser__(null-allowed)
7535) {
7536 return MkObjectHandleGet(bus?MkOBJ(bus):NULL);
7537}
7538
7547__parser__(flags=new)
7549mk_inline MK_BUS MkBufferStreamHandleResolve_RT (
7551 MK_HDL const netHdl
7552) {
7553 return MkBus(MkObjectHandleResolve(netHdl));
7554}
7555
7565#define MkBufferStreamHandleResolve_e(netHdl) ({ \
7566 MK_HDL tmpHdl=netHdl; \
7567 MK_BUS tmp; \
7568 if (tmpHdl==0) { \
7569 tmp=NULL; \
7570 } else { \
7571 tmp=MkBufferStreamHandleResolve(tmpHdl); \
7572 if (tmp==NULL) { \
7573 MkErrorSetC_1_NULL("ERROR: 'MkBufferStreamC' handle is 'NULL'"); \
7574 goto error; \
7575 }; \
7576 }; \
7577 tmp; \
7578})
7579
7581
7583// Class export & import
7584
7588 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkBufferStreamC,null-return-allow)
7591 return (MK_BUS)MK_NULL;
7592 }
7594// MkBufferStreamC - Misc - function
7595
7597// MkBufferStreamC_Class_C_API
7598
7599// END-MkBufferStreamS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7600
7601// #######################################################################
7602// -----------------------------------------------------------------------
7608
7610#define MkBufferStream64_ils_size (64)
7611
7615__parser__(ignore)
7617 // BEGIN-MkBufferStream64S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7618
7619 union {
7620 struct MkObjectS obj; // instance-base MkObjectS
7621 struct MkBufferS buf; // instance-base MkBufferS
7622 struct MkBufferStreamS bus; // instance-base MkBufferStreamS
7623 } super;
7624
7625 // END-MkBufferStream64S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7626
7627 // instance attributes
7629};
7630
7631// BEGIN-MkBufferStream64S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7632
7636 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
7637
7638// Signature --------------------------------------------------------------
7641
7642 #define MkBufferStream64C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (3u<<3))
7643 #define MkBufferStream64C_MASK (((1u<<29)-1)<<3)
7644
7646
7647// CompileTimeCast --------------------------------------------------------------
7650
7651 #define MkBufferStream64C_X2bus(x) MkBUS(x)
7652 #define MkBufferStream64C_X2buf(x) MkBUF(x)
7653 #define MkBufferStream64C_X2obj(x) MkOBJ(x)
7654
7656
7657// TypeDef --------------------------------------------------------------
7660
7666 #define MkBufferStream64C_T (&MK_RT_REF._MkBufferStream64C_T)
7668 #define MkBufferStream64C_TT (MkTYP(MkBufferStream64C_T))
7670 #define MkBufferStream64ST MkBufferStream64C_T
7672 #define MkBufferStream64STT (MkTYP(MkBufferStream64ST))
7674 #define MkBufferStream64CT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
7676 #define MkBufferStream64CTT_X(instance) (MkOBJ_R(instance).type)
7678 #define MkBufferStream64CT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
7680 #define MkBufferStream64C_NS MK
7682 #define MkBufferStream64CTT MkBufferStream64CTT
7684 #define MkBufferStream64CT ( (struct MkSuperTypeS *) MkBufferStream64CTT )
7685
7687
7690// MkBufferStream64C_Class_Define_C_API
7691
7692// END-MkBufferStream64S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7693
7695
7696// #######################################################################
7697// -----------------------------------------------------------------------
7703
7705#define MkBufferStream256S_ils_size (256)
7706
7710__parser__(ignore)
7712 // BEGIN-MkBufferStream256S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7713
7714 union {
7715 struct MkObjectS obj; // instance-base MkObjectS
7716 struct MkBufferS buf; // instance-base MkBufferS
7717 struct MkBufferStreamS bus; // instance-base MkBufferStreamS
7718 } super;
7719
7720 // END-MkBufferStream256S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7721
7722 // instance attributes
7724};
7725
7726// BEGIN-MkBufferStream256S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7727
7731 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
7732
7733// Signature --------------------------------------------------------------
7736
7737 #define MkBufferStream256C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (2u<<3))
7738 #define MkBufferStream256C_MASK (((1u<<29)-1)<<3)
7739
7741
7742// CompileTimeCast --------------------------------------------------------------
7745
7746 #define MkBufferStream256C_X2bus(x) MkBUS(x)
7747 #define MkBufferStream256C_X2buf(x) MkBUF(x)
7748 #define MkBufferStream256C_X2obj(x) MkOBJ(x)
7749
7751
7752// TypeDef --------------------------------------------------------------
7755
7761 #define MkBufferStream256C_T (&MK_RT_REF._MkBufferStream256C_T)
7763 #define MkBufferStream256C_TT (MkTYP(MkBufferStream256C_T))
7765 #define MkBufferStream256ST MkBufferStream256C_T
7767 #define MkBufferStream256STT (MkTYP(MkBufferStream256ST))
7769 #define MkBufferStream256CT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
7771 #define MkBufferStream256CTT_X(instance) (MkOBJ_R(instance).type)
7773 #define MkBufferStream256CT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
7775 #define MkBufferStream256C_NS MK
7777 #define MkBufferStream256CTT MkBufferStream256CTT
7779 #define MkBufferStream256CT ( (struct MkSuperTypeS *) MkBufferStream256CTT )
7780
7782
7785// MkBufferStream256C_Class_Define_C_API
7786
7787// END-MkBufferStream256S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7788
7790
7791// #######################################################################
7792// -----------------------------------------------------------------------
7798
7800#define MkBufferStream1024_ils_size (1024)
7801
7805__parser__(ignore)
7807 // BEGIN-MkBufferStream1024S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7808
7809 union {
7810 struct MkObjectS obj; // instance-base MkObjectS
7811 struct MkBufferS buf; // instance-base MkBufferS
7812 struct MkBufferStreamS bus; // instance-base MkBufferStreamS
7813 } super;
7814
7815 // END-MkBufferStream1024S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7816
7817 // instance attributes
7819};
7820
7821// BEGIN-MkBufferStream1024S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7822
7826 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
7827
7828// Signature --------------------------------------------------------------
7831
7832 #define MkBufferStream1024C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (4u<<3))
7833 #define MkBufferStream1024C_MASK (((1u<<29)-1)<<3)
7834
7836
7837// CompileTimeCast --------------------------------------------------------------
7840
7841 #define MkBufferStream1024C_X2bus(x) MkBUS(x)
7842 #define MkBufferStream1024C_X2buf(x) MkBUF(x)
7843 #define MkBufferStream1024C_X2obj(x) MkOBJ(x)
7844
7846
7847// TypeDef --------------------------------------------------------------
7850
7856 #define MkBufferStream1024C_T (&MK_RT_REF._MkBufferStream1024C_T)
7858 #define MkBufferStream1024C_TT (MkTYP(MkBufferStream1024C_T))
7860 #define MkBufferStream1024ST MkBufferStream1024C_T
7862 #define MkBufferStream1024STT (MkTYP(MkBufferStream1024ST))
7864 #define MkBufferStream1024CT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
7866 #define MkBufferStream1024CTT_X(instance) (MkOBJ_R(instance).type)
7868 #define MkBufferStream1024CT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
7870 #define MkBufferStream1024C_NS MK
7872 #define MkBufferStream1024CTT MkBufferStream1024CTT
7874 #define MkBufferStream1024CT ( (struct MkSuperTypeS *) MkBufferStream1024CTT )
7875
7877
7880// MkBufferStream1024C_Class_Define_C_API
7881
7882// END-MkBufferStream1024S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7883
7885
7886// #######################################################################
7887// -----------------------------------------------------------------------
7893
7895#define MkBufferStream16384S_ils_size (16384)
7896
7900__parser__(ignore)
7902 // BEGIN-MkBufferStream16384S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7903
7904 union {
7905 struct MkObjectS obj; // instance-base MkObjectS
7906 struct MkBufferS buf; // instance-base MkBufferS
7907 struct MkBufferStreamS bus; // instance-base MkBufferStreamS
7908 } super;
7909
7910 // END-MkBufferStream16384S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7911
7912 // instance attributes
7914};
7915
7916// BEGIN-MkBufferStream16384S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7917
7921 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
7922
7923// Signature --------------------------------------------------------------
7926
7927 #define MkBufferStream16384C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (1u<<3))
7928 #define MkBufferStream16384C_MASK (((1u<<29)-1)<<3)
7929
7931
7932// CompileTimeCast --------------------------------------------------------------
7935
7936 #define MkBufferStream16384C_X2bus(x) MkBUS(x)
7937 #define MkBufferStream16384C_X2buf(x) MkBUF(x)
7938 #define MkBufferStream16384C_X2obj(x) MkOBJ(x)
7939
7941
7942// TypeDef --------------------------------------------------------------
7945
7951 #define MkBufferStream16384C_T (&MK_RT_REF._MkBufferStream16384C_T)
7953 #define MkBufferStream16384C_TT (MkTYP(MkBufferStream16384C_T))
7955 #define MkBufferStream16384ST MkBufferStream16384C_T
7957 #define MkBufferStream16384STT (MkTYP(MkBufferStream16384ST))
7959 #define MkBufferStream16384CT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
7961 #define MkBufferStream16384CTT_X(instance) (MkOBJ_R(instance).type)
7963 #define MkBufferStream16384CT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
7965 #define MkBufferStream16384C_NS MK
7967 #define MkBufferStream16384CTT MkBufferStream16384CTT
7969 #define MkBufferStream16384CT ( (struct MkSuperTypeS *) MkBufferStream16384CTT )
7970
7972
7975// MkBufferStream16384C_Class_Define_C_API
7976
7977// END-MkBufferStream16384S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7978
7980__parser__(ignore)
7982
7984
7985/* ####################################################################### */
7986/* ### ### */
7987/* ### BufferStream - T O R - Api ### */
7988/* ### ### */
7989/* ####################################################################### */
7990
7997__parser__push__(doc-group=TOR);
7998
8007__parser__(constructor,lng-constr)
8008MK_EXTERN MK_BUS MK_DECL MkBufferStreamCreate_RT (
8010 MK_TYP type __parser__(internal,default=NULL),
8011 MK_NUM const size __parser__(default=0)
8013
8014#define MkBufferStreamCreate_1(size) MkBufferStreamCreate(NULL,size)
8015
8017__parser__(constructor)
8018MK_EXTERN MK_BUS MK_DECL MkBufferStreamCreate64_RT (
8020 MK_NUM const size __parser__(default=0)
8022
8024__parser__(constructor)
8025MK_EXTERN MK_BUS MK_DECL MkBufferStreamCreate256_RT (
8027 MK_NUM const size __parser__(default=0)
8029
8031__parser__(constructor)
8032MK_EXTERN MK_BUS MK_DECL MkBufferStreamCreate1024_RT (
8034 MK_NUM const size __parser__(default=0)
8036
8038__parser__(constructor)
8039MK_EXTERN MK_BUS MK_DECL MkBufferStreamCreate16384_RT (
8041 MK_NUM const size __parser__(default=0)
8043
8058MK_EXTERN MK_BUS MK_DECL MkBufferStreamCreateTLS_RT (
8060 MK_STRN const tlsName ,
8061 bool const resetB __parser__(default=true)
8063
8064__parser__(constructor,macro)
8075// [MkBufferStreamCreateLOCAL_T]
8076#define MkBufferStreamCreateLOCAL_T(cls,name,size) \
8077 cls##R name##R = {0}; \
8078 struct MkBufferStreamS * const name = cls##_X2bus(&name##R); \
8079 MkBufferStreamInit(name,cls##_TT,size)
8080// [MkBufferStreamCreateLOCAL_T]
8081
8082__parser__(constructor,macro)
8091// [MkBufferStreamCreateSTATIC_T]
8092#define MkBufferStreamCreateSTATIC_T(cls,name) \
8093 static cls##R name##R = {0}; \
8094 struct MkBufferStreamS * const name = cls##_X2bus(&name##R); \
8095 if (__MkCheckX(cls,&name##R)) { \
8096 MkBufferStreamReset(name); \
8097 } else { \
8098 MkBufferStreamInit(name,cls##TT,0); \
8099 } \
8100// [MkBufferStreamCreateSTATIC_T]
8101
8102__parser__(constructor,macro)
8111// [MkBufferStreamCreateTLS_T]
8112#define MkBufferStreamCreateTLS_T(cls,name) \
8113 static MkThreadLocal cls##R name##R = {0}; \
8114 struct MkBufferStreamS * const name = cls##_X2bus(&name##R); \
8115 if (__MkCheckX(cls,&name##R)) { \
8116 MkBufferStreamReset(name); \
8117 } else { \
8118 MkBufferStreamInit(name,cls##_TT,0); \
8119 } \
8120// [MkBufferStreamCreateTLS_T]
8121
8152__parser__(internal)
8153MK_EXTERN void MK_DECL MkBufferStreamFree_RT (
8155 MK_BUS const bus
8157
8161__parser__(internal)
8162MK_EXTERN void MK_DECL MkBufferStreamInit_RT (
8164 MK_BUS const bus,
8165 MK_TYP type __parser__(internal,default=NULL),
8166 MK_NUM const size __parser__(default=0)
8168
8174__parser__(destructor)
8175MK_EXTERN void MK_DECL MkBufferStreamDelete_RT (
8177 MK_BUS const bus
8179
8195__parser__(constructor)
8196MK_EXTERN MK_BUS MK_DECL MkBufferStreamMerge_RT (
8198 MK_BUS const bus
8200
8208__parser__(constructor)
8209MK_EXTERN MK_BUS MK_DECL MkBufferStreamDup_RT (
8211 MK_BUSN const src
8213
8215
8217// MkBufferStreamC_TOR_C_API
8218
8219/* ####################################################################### */
8220/* ### ### */
8221/* ### BufferStream - M I S C - Api ### */
8222/* ### ### */
8223/* ####################################################################### */
8224
8230
8231__parser__push__(doc-group=Misc);
8232
8239__parser__(const)
8240MK_EXTERN MK_BUS MK_DECL MkBufferStreamCopy_RT (
8242 MK_BUS const bus,
8243 MK_BUSN const src
8245
8252MK_EXTERN MK_BUS MK_DECL MkBufferStreamReset_RT (
8254 MK_BUS const bus
8256
8265MK_EXTERN void MK_DECL MkBufferStreamResetFull_RT (
8267 MK_BUS const bus
8269
8270__parser__(internal)
8271MK_EXTERN void MK_DECL MkBufferStreamLogS_RT (
8273 MK_BUS const bus ,
8274 MK_OBJ fmtobj __parser__(default=NULL),
8275 MK_STRN const callfunc __parser__(default=F#FUNC)
8277
8286// [MkBufferStreamLog_RT]
8287__parser__(const,class-overload=MkObjectLog)
8288MK_EXTERN void MK_DECL MkBufferStreamLog_RT (
8290 MK_BUS const bus ,
8292 MK_DBG const debug __parser__(default=0),
8293 MK_STRN const callfunc __parser__(default=F#FUNC),
8294 MK_I32 const lvl __parser__(default=0)
8296
8297#define MkBufferStreamLog_5F(bus,fmt,...) MkBufferStreamLog(bus,MkObj(fmt),__VA_ARGS__)
8298#define MkBufferStreamLog_2F(bus,fmt) MkBufferStreamLog_5F(bus,fmt,0,__func__,0)
8299#define MkBufferStreamLog_3F(bus,fmt,pfx) MkBufferStreamLog_5F(bus,fmt,0,pfx,0)
8300// [MkBufferStreamLog_RT]
8301
8305 MK_BUS const bus
8307
8309__parser__(class-overload=MkObjectToString)
8310MK_EXTERN MK_STRN MK_DECL MkBufferStreamToString_RT (
8312 MK_BUSN const inst
8314
8321MK_EXTERN MK_BFL MK_DECL MkBufferStreamToBFL_RT (
8323 MK_BUSN const bus
8325
8326__parser__pop__; // Misc
8327
8329// MkBufferStreamC_Misc_C_API
8330
8331/* ####################################################################### */
8332/* ### ### */
8333/* ### BufferStream - W R I T E - Api ### */
8334/* ### ### */
8335/* ####################################################################### */
8336
8347__parser__push__(doc-group=Write);
8348
8358MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteI8_RT (
8360 MK_BUS const bus,
8361 MK_I8 const val
8363
8366MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteBOL_RT (
8368 MK_BUS const bus,
8369 MK_BOL const val
8371
8374MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteI32_RT (
8376 MK_BUS const bus,
8377 MK_I32 const val
8379
8382MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteFLT_RT (
8384 MK_BUS const bus,
8385 MK_FLT const val
8387
8390MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteI64_RT (
8392 MK_BUS const bus,
8393 MK_I64 const val
8395
8398MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteDBL_RT (
8400 MK_BUS const bus,
8401 MK_DBL const val
8403
8407MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteSTR_RT (
8409 MK_BUS const bus,
8410 MK_STRN const val,
8411 MK_NUM const len __parser__(default=-1)
8413
8416MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteBIN_RT (
8418 MK_BUS const bus,
8419 MkBinaryR const val
8421
8424MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteBUF_RT (
8426 MK_BUS const bus,
8427 MK_BUFN const val
8429
8433MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteHDL_RT (
8435 MK_BUS const bus,
8436 MK_I32 const val
8438
8450MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteLONG_RT (
8452 MK_BUS const bus,
8453 MK_LONG const val
8455
8457MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteVL_RT (
8459 MK_BUS const bus,
8460 MK_STRN const fmt,
8461 va_list ap
8463
8465MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteV_RT (
8467 MK_BUS const bus,
8468 MK_STRN const fmt,
8469 ...
8471
8486MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteBFL_RT (
8488 MK_BUS const bus,
8489 MK_BFLN const bfl
8491
8510MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteL_FLAT_RT (
8512 MK_BUS const bus,
8513 MK_BFL const bfl
8515
8517MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteL_START_RT (
8519 MK_BUS const bus
8521
8523MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteL_END_RT (
8525 MK_BUS const bus
8527
8537MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteBUS_FLAT_RT (
8539 MK_BUS const bus,
8540 MK_BUSN const add
8542
8543__parser__pop__; // Write
8544
8546// MkBufferStreamC_Write_C_API
8547
8548/* ####################################################################### */
8549/* ### ### */
8550/* ### BufferStream - R E A D - Api ### */
8551/* ### ### */
8552/* ####################################################################### */
8553
8563__parser__push__(doc-group=Read);
8564
8571MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadL_START_RT (
8573 MK_BUS const bus,
8574 MK_BUF buf __parser__(default=NULL)
8576
8578MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadL_END_RT (
8580 MK_BUS const bus
8582
8591MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadALL_RT (
8593 MK_BUS const bus,
8594 MK_BFL * const val_inout
8596
8616MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadBFL_RT (
8618 MK_BUS const bus,
8619 MK_BFL * const val_out
8621
8622__parser__(ignore)
8623MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadLIST_RT (
8625 MK_BUS const bus,
8626 MK_NAT_LIST * const val_out
8628
8629__parser__(ignore)
8630MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadNEXT_RT (
8632 MK_BUS const bus,
8633 MK_NAT_OBJECT * const val_out
8635
8647MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadLONG_RT (
8649 MK_BUS const bus,
8650 MK_LONG * const val_out
8652
8653// *******
8654
8668MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadI8_RT (
8670 MK_BUS const bus,
8671 MK_I8 * const val_out
8673
8676MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadBOL_RT (
8678 MK_BUS const bus,
8679 MK_BOL * const val_out
8681
8684MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadI32_RT (
8686 MK_BUS const bus,
8687 MK_I32 * const val_out
8689
8692MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadFLT_RT (
8694 MK_BUS const bus,
8695 MK_FLT * const val_out
8697
8700MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadI64_RT (
8702 MK_BUS const bus,
8703 MK_I64 * const val_out
8705
8708MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadDBL_RT (
8710 MK_BUS const bus,
8711 MK_DBL * const val_out
8713
8716MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadSTR_RT (
8718 MK_BUS const bus,
8719 MK_STRN * const val_out
8721
8726MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadBIN_RT (
8728 MK_BUS const bus,
8729 MkBinaryR * const val_out
8731
8734MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadBUF_RT (
8736 MK_BUS const bus,
8737 MK_BUF*const val_out
8739
8745MK_EXTERN bool MK_DECL MkBufferStreamReadItemExists_RT (
8747 MK_BUSN const bus
8749
8755MK_EXTERN enum MkTypeE MK_DECL MkBufferStreamReadGetNextType_RT (
8757 MK_BUSN const bus
8759
8765MK_EXTERN MK_NUM MK_DECL MkBufferStreamReadGetNumItems_RT (
8767 MK_BUSN const bus
8769
8778MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadUndo_RT (
8780 MK_BUS const bus
8782
8783__parser__pop__; // Read
8784
8786// MkBufferStreamC_Read_C_API
8787
8789// MkBufferStreamC_C_API
8790
8791/* MARK_L ################################################################ */
8792/* ### ### */
8793/* ### B U F F E R - L I S T - A P I ### */
8794/* ### ### */
8795/* ####################################################################### */
8796
8798#include "MkBufferListC_def_mk.h"
8800
8801/* ####################################################################### */
8802/* ### ### */
8803/* ### L O G - F I L E - A P I ### */
8804/* ### ### */
8805/* ####################################################################### */
8806
8827
8829struct MkLogFileS {
8830 // BEGIN-MkLogFileS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
8831
8832 union {
8833 struct MkObjectS obj; // instance-base MkObjectS
8834 } super;
8835
8836 // END-MkLogFileS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
8837
8838 // object body
8839 MK_STRN filename;
8840 FILE * FH;
8841};
8842
8843// BEGIN-MkLogFileS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
8844
8848 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
8849
8850// Signature --------------------------------------------------------------
8854 #define MkLogFileC_SIGNATURE (MkObjectC_SIGNATURE ^ (3u<<10))
8855 #define MkLogFileC_MASK (((1u<<22)-1)<<10)
8856
8858
8859// CompileTimeCast --------------------------------------------------------------
8862
8863 #define MkLogFileC_X2lfl(x) (x)
8864 #define MkLogFileC_X2obj(x) MkOBJ(x)
8865
8867
8868// TypeDef --------------------------------------------------------------
8871
8873 __parser__(ignore) typedef struct MkLogFileS MkLogFileCR;
8875 __parser__(ignore) typedef const struct MkLogFileS MkLogFileCNR;
8877 #define MkLogFileC_T (&MK_RT_REF._MkLogFileC_T)
8879 #define MkLogFileC_TT (MkTYP(MkLogFileC_T))
8881 #define MkLogFileST MkLogFileC_T
8883 #define MkLogFileSTT (MkTYP(MkLogFileST))
8885 #define MkLogFileC_type MK_LFL
8887 #define MkLogFileCT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
8889 #define MkLogFileCTT_X(instance) (MkOBJ_R(instance).type)
8891 #define MkLogFileCT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
8893 #define MkLogFileC_NS MK
8895 #define MkLogFileCTT MkLogFileCTT
8897 #define MkLogFileCT ( (struct MkSuperTypeS *) MkLogFileCTT )
8898
8900
8901// TypeCheck --------------------------------------------------------------
8904
8905 #pragma GCC diagnostic push
8906 #pragma GCC diagnostic ignored "-Wattributes"
8910 __parser__(class=MkLogFileC,static,hide)
8912 mk_inline bool MkLflCheck (MK_MNGN mng) {
8913 return MkSanitizeCheck(MkLogFileC,mng);
8914 }
8915
8918 __parser__(class=MkLogFileC,static,hide)
8920 mk_inline bool MkLflCheckO (MK_OBJN obj) {
8921 return MkSanitizeCheckO(MkLogFileC,obj);
8922 }
8923
8924 #pragma GCC diagnostic pop
8925 #define MkLogFileC_Check(mng) MkLflCheck(mng)
8928
8929// RunTimeCast --------------------------------------------------------------
8932
8934 __parser__(class=MkLogFileC,hide,static)
8935 META_ATTRIBUTE_SANITIZE
8937 mk_inline MK_LFL MkLfl(MK_MNG mng) {
8938 return (MkLflCheck(mng) ? (MK_LFL)mng : NULL);
8940
8942 __parser__(class=MkLogFileC,hide,static)
8943 META_ATTRIBUTE_SANITIZE
8945 mk_inline MK_LFLN MkLflN(MK_MNGN mng) {
8946 return (MkLflCheck(mng) ? (MK_LFLN)mng : NULL);
8947 }
8948
8950 #define MkLflRaise(_lfl) if (!_MkCheckX(MkLogFileC,_lfl)) { \
8951 MkErrorSetC_1E("'MkLogFileC' hdl is NULL"); \
8952 goto error ; \
8953 }
8954
8956 #define MkLFL_R(x) (*(x)).super.lfl
8958 #define MkLFL(x) (&MkLFL_R(x))
8961
8964// MkLogFileC_Class_Define_C_API
8965
8966// END-MkLogFileS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
8967
8968// =========================================================================
8969// BEGIN-MkLogFileS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
8973
8976
8977__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkLogFileC);
8978
8994__parser__(class-overload=MkObjectHandleGet)
8996mk_inline MK_HDL MK_DECL MkLogFileHandleGet_RT (
8998 MK_LFL const lfl __parser__(null-allowed)
8999) {
9000 return MkObjectHandleGet(lfl?MkOBJ(lfl):NULL);
9001}
9002
9011__parser__(flags=new)
9013mk_inline MK_LFL MkLogFileHandleResolve_RT (
9015 MK_HDL const netHdl
9016) {
9017 return MkLfl(MkObjectHandleResolve(netHdl));
9018}
9019
9029#define MkLogFileHandleResolve_e(netHdl) ({ \
9030 MK_HDL tmpHdl=netHdl; \
9031 MK_LFL tmp; \
9032 if (tmpHdl==0) { \
9033 tmp=NULL; \
9034 } else { \
9035 tmp=MkLogFileHandleResolve(tmpHdl); \
9036 if (tmp==NULL) { \
9037 MkErrorSetC_1_NULL("ERROR: 'MkLogFileC' handle is 'NULL'"); \
9038 goto error; \
9039 }; \
9040 }; \
9041 tmp; \
9042})
9045
9047// Class export & import
9048
9052 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkLogFileC,null-return-allow)
9054 mk_inline MK_LFL MkLogFileGetNull ( void ) {
9055 return (MK_LFL)MK_NULL;
9056 }
9058// MkLogFileC - Misc - function
9059
9061// MkLogFileC_Class_C_API
9062
9063// END-MkLogFileS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9064
9065// #######################################################################
9066// -----------------------------------------------------------------------
9072
9073__parser__push__(doc-group=TOR);
9074
9085__parser__(constructor,lng-constr)
9089 MK_OBJ errfmt __parser__(argument,default=NULL),
9090 MK_STRN const file,
9091 MK_LFL * lfh_out
9093
9099__parser__(destructor)
9102 MK_LFL lfh
9104
9105__parser__pop__; // TOR
9106
9108// MkLogFileC_TOR_C_API
9109
9110// #######################################################################
9111// -----------------------------------------------------------------------
9116
9117__parser__push__(doc-group=Write);
9118
9129 MK_LFLN lfl,
9130 MK_FST printfmt,
9131 va_list var_list
9133
9143 MK_LFLN lfl,
9144 MK_FST printfmt,
9145 ...
9147
9154__parser__(no-type-extension)
9156MkLogFileWriteC_RT (
9158 MK_LFLN lfl,
9159 MK_STRN text
9161
9169MkLogFileGetFile_RT (
9171 MK_LFLN lfl,
9172 MK_STRN *file_out
9174
9175__parser__pop__; // Write
9176
9178// MkLogFileC_Write_C_API
9179
9181// MkLogFileC_C_API
9182
9183/* MARK_X ################################################################ */
9184/* ### ### */
9185/* ### E X T E N S I O N - A P I ### */
9186/* ### ### */
9187/* ####################################################################### */
9188
9196
9197__parser__push__(doc-group=_ignore_);
9198
9199__parser__(internal)
9201typedef struct MkExtensionS {
9202 // BEGIN-MkExtensionS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9203
9204 union {
9205 struct MkObjectS obj; // instance-base MkObjectS
9206 } super;
9207
9208 // END-MkExtensionS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9209
9210 // instance attributes
9211 struct MkExtensionS *next, *prev;
9212} MkExtensionS;
9213
9214// BEGIN-MkExtensionS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9219 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
9221// Signature --------------------------------------------------------------
9224
9225 #define MkExtensionC_SIGNATURE (MkObjectC_SIGNATURE ^ (8u<<10))
9226 #define MkExtensionC_MASK (((1u<<22)-1)<<10)
9227
9229
9230// CompileTimeCast --------------------------------------------------------------
9233
9234 #define MkExtensionC_X2ext(x) (x)
9235 #define MkExtensionC_X2obj(x) MkOBJ(x)
9236
9238
9239// TypeDef --------------------------------------------------------------
9242
9244 __parser__(ignore) typedef struct MkExtensionS MkExtensionCR;
9246 __parser__(ignore) typedef const struct MkExtensionS MkExtensionCNR;
9248 #define MkExtensionC_T (&MK_RT_REF._MkExtensionC_T)
9250 #define MkExtensionC_TT (MkTYP(MkExtensionC_T))
9252 #define MkExtensionST MkExtensionC_T
9254 #define MkExtensionSTT (MkTYP(MkExtensionST))
9256 #define MkExtensionC_type MK_EXT
9258 #define MkExtensionCT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
9260 #define MkExtensionCTT_X(instance) (MkOBJ_R(instance).type)
9262 #define MkExtensionCT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
9264 #define MkExtensionC_NS MK
9266 #define MkExtensionCTT MkExtensionCTT
9268 #define MkExtensionCT ( (struct MkSuperTypeS *) MkExtensionCTT )
9269
9271
9272// TypeCheck --------------------------------------------------------------
9275
9276 #pragma GCC diagnostic push
9277 #pragma GCC diagnostic ignored "-Wattributes"
9281 __parser__(class=MkExtensionC,static,ignore)
9283 mk_inline bool MkExtCheck (MK_MNGN mng) {
9284 return MkSanitizeCheck(MkExtensionC,mng);
9285 }
9286
9289 __parser__(class=MkExtensionC,static,ignore)
9291 mk_inline bool MkExtCheckO (MK_OBJN obj) {
9292 return MkSanitizeCheckO(MkExtensionC,obj);
9293 }
9294
9295 #pragma GCC diagnostic pop
9296 #define MkExtensionC_Check(mng) MkExtCheck(mng)
9299
9300// RunTimeCast --------------------------------------------------------------
9303
9305 __parser__(class=MkExtensionC,ignore,static)
9306 META_ATTRIBUTE_SANITIZE
9308 mk_inline MK_EXT MkExt(MK_MNG mng) {
9309 return (MkExtCheck(mng) ? (MK_EXT)mng : NULL);
9311
9313 __parser__(class=MkExtensionC,ignore,static)
9314 META_ATTRIBUTE_SANITIZE
9316 mk_inline MK_EXTN MkExtN(MK_MNGN mng) {
9317 return (MkExtCheck(mng) ? (MK_EXTN)mng : NULL);
9318 }
9319
9321 #define MkExtRaise(_ext) if (!_MkCheckX(MkExtensionC,_ext)) { \
9322 MkErrorSetC_1E("'MkExtensionC' hdl is NULL"); \
9323 goto error ; \
9324 }
9325
9327 #define MkEXT_R(x) (*(x)).super.ext
9329 #define MkEXT(x) (&MkEXT_R(x))
9332
9335// MkExtensionC_Class_Define_C_API
9336
9337// END-MkExtensionS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9338
9342#define MkExtension_size 64
9344__parser__(internal)
9345MK_EXTERN bool MK_DECL MkExtensionDeleteAll_RT (
9347 MK_EXT head
9349
9351__parser__(internal)
9352MK_EXTERN MK_EXT MK_DECL MkExtensionAdd_RT (
9354 MK_EXT head,
9355 MK_EXT add
9357
9359__parser__(internal)
9360MK_EXTERN MK_EXT MK_DECL MkExtensionDel_RT (
9362 MK_EXT head,
9363 MK_EXT del
9365
9367//__parser__(internal)
9368//MK_EXTERN MK_EXT MK_DECL MkExtensionSearch (MK_EXT head, MK_TYP typ);
9369*/
9370
9371__parser__pop__; // __parser__push__(doc-group=_ignore_);
9372
9374// MkExtensionC_C_API
9375
9376/* MARK_E ################################################################ */
9377/* ### ### */
9378/* ### E R R O R - A P I ### */
9379/* ### ### */
9380/* ####################################################################### */
9381
9409
9413struct MkErrorS {
9414 // BEGIN-MkErrorS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9415
9416 union {
9417 struct MkObjectS obj; // instance-base MkObjectS
9418 } super;
9419
9420 // END-MkErrorS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9421
9422 // instance attributes
9423 enum MkErrorE code;
9424 struct MkBuffer1024S text;
9425 MK_I32 num;
9426 bool append;
9427 bool noRaise;
9428
9429 MK_OBJN format_of_error;
9430 MK_MNGN source_of_error;
9432 MK_ERREXT mkErrExt;
9433};
9434
9435// BEGIN-MkErrorS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9436
9440 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
9442// Signature --------------------------------------------------------------
9445
9446 #define MkErrorC_SIGNATURE (MkObjectC_SIGNATURE ^ (4u<<10))
9447 #define MkErrorC_MASK (((1u<<22)-1)<<10)
9448
9450
9451// CompileTimeCast --------------------------------------------------------------
9454
9455 #define MkErrorC_X2err(x) (x)
9456 #define MkErrorC_X2obj(x) MkOBJ(x)
9457
9459
9460// TypeDef --------------------------------------------------------------
9463
9465 __parser__(ignore) typedef struct MkErrorS MkErrorCR;
9467 __parser__(ignore) typedef const struct MkErrorS MkErrorCNR;
9469 #define MkErrorC_T (&MK_RT_REF._MkErrorC_T)
9471 #define MkErrorC_TT (MkTYP(MkErrorC_T))
9473 #define MkErrorST MkErrorC_T
9475 #define MkErrorSTT (MkTYP(MkErrorST))
9477 #define MkErrorC_type MK_ERR
9479 #define MkErrorCT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
9481 #define MkErrorCTT_X(instance) (MkOBJ_R(instance).type)
9483 #define MkErrorCT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
9485 #define MkErrorC_NS MK
9487 #define MkErrorCTT MkErrorCTT
9489 #define MkErrorCT ( (struct MkSuperTypeS *) MkErrorCTT )
9490
9492
9493// TypeCheck --------------------------------------------------------------
9496
9497 #pragma GCC diagnostic push
9498 #pragma GCC diagnostic ignored "-Wattributes"
9502 __parser__(class=MkErrorC,static,hide)
9504 mk_inline bool MkErrCheck (MK_MNGN mng) {
9505 return MkSanitizeCheck(MkErrorC,mng);
9506 }
9507
9510 __parser__(class=MkErrorC,static,hide)
9512 mk_inline bool MkErrCheckO (MK_OBJN obj) {
9513 return MkSanitizeCheckO(MkErrorC,obj);
9514 }
9515
9516 #pragma GCC diagnostic pop
9517
9519
9520// RunTimeCast --------------------------------------------------------------
9523
9525 __parser__(class=MkErrorC,hide,static)
9526 META_ATTRIBUTE_SANITIZE
9528 mk_inline MK_ERR MkErr(MK_MNG mng) {
9529 return (MkErrCheck(mng) ? (MK_ERR)mng : NULL);
9530 }
9531
9533 __parser__(class=MkErrorC,hide,static)
9534 META_ATTRIBUTE_SANITIZE
9536 mk_inline MK_ERRN MkErrN(MK_MNGN mng) {
9537 return (MkErrCheck(mng) ? (MK_ERRN)mng : NULL);
9538 }
9539
9541 #define MkErrRaise(_err) if (!_MkCheckX(MkErrorC,_err)) { \
9542 MkErrorSetC_1E("'MkErrorC' hdl is NULL"); \
9543 goto error ; \
9544 }
9545
9547 #define MkERR_R(x) (*(x)).super.err
9549 #define MkERR(x) (&MkERR_R(x))
9552
9555// MkErrorC_Class_Define_C_API
9556
9557// END-MkErrorS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9558
9560// MkErrorC_C_API
9562// =========================================================================
9563// BEGIN-MkErrorS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9564
9567
9570
9571__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkErrorC);
9572
9588__parser__(class-overload=MkObjectHandleGet)
9590mk_inline MK_HDL MK_DECL MkErrorHandleGet_RT (
9592 MK_ERR const err __parser__(null-allowed)
9593) {
9594 return MkObjectHandleGet(err?MkOBJ(err):NULL);
9595}
9596
9605__parser__(flags=new)
9607mk_inline MK_ERR MkErrorHandleResolve_RT (
9609 MK_HDL const netHdl
9610) {
9611 return MkErr(MkObjectHandleResolve(netHdl));
9612}
9613
9623#define MkErrorHandleResolve_e(netHdl) ({ \
9624 MK_HDL tmpHdl=netHdl; \
9625 MK_ERR tmp; \
9626 if (tmpHdl==0) { \
9627 tmp=NULL; \
9628 } else { \
9629 tmp=MkErrorHandleResolve(tmpHdl); \
9630 if (tmp==NULL) { \
9631 MkErrorSetC_1_NULL("ERROR: 'MkErrorC' handle is 'NULL'"); \
9632 goto error; \
9633 }; \
9634 }; \
9635 tmp; \
9636})
9639
9641// Class export & import
9642
9646 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkErrorC,null-return-allow)
9648 mk_inline MK_ERR MkErrorGetNull ( void ) {
9649 return (MK_ERR)MK_NULL;
9650 }
9652// MkErrorC - Misc - function
9653
9655// MkErrorC_Class_C_API
9656
9657// END-MkErrorS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9658
9659// #######################################################################
9660// -----------------------------------------------------------------------
9667
9668#define MK_ERREXT_ARGS MK_RT_ARGS MK_ERR const mkerr, MK_ERREXT const errext
9669#define MK_ERREXT_CALL MK_RT_CALL err, errext
9670
9671#define MK_ERREXT_ARGS_N MK_RT_ARGS MK_ERRN const mkerr, MK_ERREXT const errext
9672#define MK_ERREXT_CALL_N MK_RT_CALL err, errext
9673
9674__parser__(ignore)
9675typedef bool (*MkErrorAppendFLT) (MK_ERREXT_ARGS, MK_OBJN const fmtobj);
9676
9677__parser__(ignore)
9678typedef void (*MkErrorResetF) (MK_ERREXT_ARGS, MK_OBJN const fmtobj);
9679
9680__parser__(ignore)
9681typedef bool (*MkErrorResetOnExitF) (MK_ERREXT_ARGS, MK_OBJN const fmtobj);
9684__parser__(ignore)
9685typedef void (*MkErrorPanikF) (MK_ERREXT_ARGS_N, MK_OBJN const errobj, MK_STRN const prefix,
9686 MK_I32 const errnum, MK_STRN const fmt, va_list ap);
9687
9688__parser__(ignore)
9689typedef void (*MkErrorLogF) (MK_ERREXT_ARGS_N, MK_OBJN const, MK_DBG const, MK_STRN const,
9690 MK_I32 const, MK_STRN const, MK_OBJ const);
9691
9693typedef MK_OBJN (*MkErrorFormatOfF) (MK_ERREXT_ARGS_N, int const dummy);
9694
9696typedef void (*MkErrorSetRF) (MK_ERREXT_ARGS, MK_MNGN const errctx, MK_OBJN const fmtobj);
9697
9698__parser__(ignore)
9699typedef void (*MkErrorSetEF) (MK_ERREXT_ARGS, MK_ERREXT const newerr, MK_OBJN const fmtobj);
9700
9701__parser__(ignore)
9702typedef bool (*MkErrorSetVLF) (MK_ERREXT_ARGS, MK_OBJN const fmtobj, MK_STRN const);
9704__parser__(ignore)
9705typedef void (*MkErrorInit) (MK_ERREXT_ARGS, MK_OBJN const fmtobj);
9706
9708__parser__(ignore)
9709struct MkErrExtS {
9710 // BEGIN-MkErrExtS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9711
9712 union {
9713 struct MkObjectS obj; // instance-base MkObjectS
9714 struct MkExtensionS ext; // instance-base MkExtensionS
9715 } super;
9717 // END-MkErrExtS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9718
9719 MK_ERR mkerrhead;
9720
9722 MkErrorAppendFLT fErrorAppend;
9725 MkErrorResetF fErrorReset;
9726
9728 MkErrorResetOnExitF fErrorResetOnExit;
9731 MkErrorPanikF fErrorPanik;
9732
9734 MkErrorLogF fErrorLog;
9735
9737 MkErrorFormatOfF fErrorFormatOf;
9738
9740 MkErrorSetRF fErrorSetR;
9741
9743 MkErrorSetEF fErrorSetE;
9744
9746 MkErrorSetVLF fErrorSetVL;
9747
9749 MkErrorInit fErrorInit;
9750};
9752// BEGIN-MkErrExtS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9753
9757 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
9758
9759// Signature --------------------------------------------------------------
9762
9763 #define MkErrExtC_SIGNATURE (MkExtensionC_SIGNATURE ^ (1u<<6))
9764 #define MkErrExtC_MASK (((1u<<26)-1)<<6)
9765
9767
9768// CompileTimeCast --------------------------------------------------------------
9771
9772 #define MkErrExtC_X2errext(x) (x)
9773 #define MkErrExtC_X2ext(x) MkEXT(x)
9774 #define MkErrExtC_X2obj(x) MkOBJ(x)
9775
9778// TypeDef --------------------------------------------------------------
9781
9783 __parser__(ignore) typedef struct MkErrExtS MkErrExtCR;
9785 __parser__(ignore) typedef const struct MkErrExtS MkErrExtCNR;
9787 #define MkErrExtC_T (&MK_RT_REF._MkErrExtC_T)
9789 #define MkErrExtC_TT (MkTYP(MkErrExtC_T))
9791 #define MkErrExtST MkErrExtC_T
9793 #define MkErrExtSTT (MkTYP(MkErrExtST))
9795 #define MkErrExtC_type MK_ERREXT
9797 #define MkErrExtCT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
9799 #define MkErrExtCTT_X(instance) (MkOBJ_R(instance).type)
9801 #define MkErrExtCT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
9803 #define MkErrExtC_NS MK
9805 #define MkErrExtCTT MkErrExtCTT
9807 #define MkErrExtCT ( (struct MkSuperTypeS *) MkErrExtCTT )
9808
9810
9811// TypeCheck --------------------------------------------------------------
9814
9815 #pragma GCC diagnostic push
9816 #pragma GCC diagnostic ignored "-Wattributes"
9820 __parser__(class=MkErrExtC,static,ignore)
9822 mk_inline bool MkErrExtCheck (MK_MNGN mng) {
9823 return MkSanitizeCheck(MkErrExtC,mng);
9824 }
9825
9828 __parser__(class=MkErrExtC,static,ignore)
9830 mk_inline bool MkErrExtCheckO (MK_OBJN obj) {
9831 return MkSanitizeCheckO(MkErrExtC,obj);
9832 }
9833
9834 #pragma GCC diagnostic pop
9835 #define MkErrExtC_Check(mng) MkErrExtCheck(mng)
9838
9839// RunTimeCast --------------------------------------------------------------
9842
9844 __parser__(class=MkErrExtC,ignore,static)
9845 META_ATTRIBUTE_SANITIZE
9847 mk_inline MK_ERREXT MkErrExt(MK_MNG mng) {
9848 return (MkErrExtCheck(mng) ? (MK_ERREXT)mng : NULL);
9850
9852 __parser__(class=MkErrExtC,ignore,static)
9853 META_ATTRIBUTE_SANITIZE
9855 mk_inline MK_ERREXTN MkErrExtN(MK_MNGN mng) {
9856 return (MkErrExtCheck(mng) ? (MK_ERREXTN)mng : NULL);
9857 }
9858
9860 #define MkErrExtRaise(_errext) if (!_MkCheckX(MkErrExtC,_errext)) { \
9861 MkErrorSetC_1E("'MkErrExtC' hdl is NULL"); \
9862 goto error ; \
9863 }
9864
9866 #define MkERREXT_R(x) (*(x)).super.errext
9868 #define MkERREXT(x) (&MkERREXT_R(x))
9871
9874// MkErrExtC_Class_Define_C_API
9875
9876// END-MkErrExtS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9877
9878#define MkErrExtAdd(_mkerrR,add) do { \
9879 (_mkerrR).mkErrExt = (typeof((_mkerrR).mkErrExt)) MkExtensionAdd(MkEXT((_mkerrR).mkErrExt),MkEXT(add)); \
9880 /* printV("MkErrExtAdd = %p, mkrt=%p\n", &(_mkerrR).mkErrExt, MK_RT_PTR); */ \
9881 MkERREXT_R(add).mkerrhead = &(_mkerrR); \
9882} while (0) \
9883
9884#define MkErrExtDel(_mkerrR,del) do { \
9885 /* printV("MkErrExtDel = %p, mkrt=%p\n", &(_mkerrR).mkErrExt, MK_RT_PTR); */ \
9886 (_mkerrR).mkErrExt = (typeof((_mkerrR).mkErrExt)) MkExtensionDel(MkEXT((_mkerrR).mkErrExt),MkEXT(del)); \
9887 MkERREXT_R(del).mkerrhead = NULL; \
9888} while (0) \
9889
9891// MkErrExtC_C_API
9893// #######################################################################
9894// -----------------------------------------------------------------------
9902
9904__parser__(ignore)
9905struct MkErrorPanicS {
9906 // BEGIN-MkErrorPanicS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9907
9908 union {
9909 struct MkObjectS obj; // instance-base MkObjectS
9910 } super;
9911
9912 // END-MkErrorPanicS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9913};
9914
9915// BEGIN-MkErrorPanicS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9916
9920 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
9921
9922// Signature --------------------------------------------------------------
9925
9926 #define MkErrorPanicC_SIGNATURE (MkObjectC_SIGNATURE ^ (7u<<10))
9927 #define MkErrorPanicC_MASK (((1u<<22)-1)<<10)
9928
9930
9931// CompileTimeCast --------------------------------------------------------------
9934
9935 #define MkErrorPanicC_X2obj(x) MkOBJ(x)
9936
9938
9939// TypeDef --------------------------------------------------------------
9942
9944 __parser__(ignore) typedef struct MkErrorPanicS MkErrorPanicCR;
9946 __parser__(ignore) typedef const struct MkErrorPanicS MkErrorPanicCNR;
9948 #define MkErrorPanicC_T (&MK_RT_REF._MkErrorPanicC_T)
9950 #define MkErrorPanicC_TT (MkTYP(MkErrorPanicC_T))
9952 #define MkErrorPanicST MkErrorPanicC_T
9954 #define MkErrorPanicSTT (MkTYP(MkErrorPanicST))
9956 #define MkErrorPanicCT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
9958 #define MkErrorPanicCTT_X(instance) (MkOBJ_R(instance).type)
9960 #define MkErrorPanicCT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
9962 #define MkErrorPanicC_NS MK
9964 #define MkErrorPanicCTT MkErrorPanicCTT
9966 #define MkErrorPanicCT ( (struct MkSuperTypeS *) MkErrorPanicCTT )
9967
9969
9972// MkErrorPanicC_Class_Define_C_API
9973
9974// END-MkErrorPanicS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9975
9977// MkErrorPanicS_C_API
9979// #######################################################################
9980// -----------------------------------------------------------------------
9988
9990__parser__(ignore)
9991struct MkErrorIgnoreS {
9992 // BEGIN-MkErrorIgnoreS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9993
9994 union {
9995 struct MkObjectS obj; // instance-base MkObjectS
9996 } super;
9997
9998 // END-MkErrorIgnoreS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9999};
10000
10001// BEGIN-MkErrorIgnoreS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10002
10006 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
10007
10008// Signature --------------------------------------------------------------
10011
10012 #define MkErrorIgnoreC_SIGNATURE (MkObjectC_SIGNATURE ^ (5u<<10))
10013 #define MkErrorIgnoreC_MASK (((1u<<22)-1)<<10)
10014
10016
10017// CompileTimeCast --------------------------------------------------------------
10020
10021 #define MkErrorIgnoreC_X2obj(x) MkOBJ(x)
10022
10024
10025// TypeDef --------------------------------------------------------------
10028
10030 __parser__(ignore) typedef struct MkErrorIgnoreS MkErrorIgnoreCR;
10032 __parser__(ignore) typedef const struct MkErrorIgnoreS MkErrorIgnoreCNR;
10034 #define MkErrorIgnoreC_T (&MK_RT_REF._MkErrorIgnoreC_T)
10036 #define MkErrorIgnoreC_TT (MkTYP(MkErrorIgnoreC_T))
10038 #define MkErrorIgnoreST MkErrorIgnoreC_T
10040 #define MkErrorIgnoreSTT (MkTYP(MkErrorIgnoreST))
10042 #define MkErrorIgnoreCT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
10044 #define MkErrorIgnoreCTT_X(instance) (MkOBJ_R(instance).type)
10046 #define MkErrorIgnoreCT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
10048 #define MkErrorIgnoreC_NS MK
10050 #define MkErrorIgnoreCTT MkErrorIgnoreCTT
10052 #define MkErrorIgnoreCT ( (struct MkSuperTypeS *) MkErrorIgnoreCTT )
10053
10055
10058// MkErrorIgnoreC_Class_Define_C_API
10059
10060// END-MkErrorIgnoreS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10061
10063// MkErrorIgnoreC_C_API
10065// #######################################################################
10066// -----------------------------------------------------------------------
10073
10076__parser__(ignore)
10077struct MkErrorPrintS {
10078 // BEGIN-MkErrorPrintS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10079
10080 union {
10081 struct MkObjectS obj; // instance-base MkObjectS
10082 } super;
10083
10084 // END-MkErrorPrintS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10085};
10086
10087// BEGIN-MkErrorPrintS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10088
10092 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
10093
10094// Signature --------------------------------------------------------------
10097
10098 #define MkErrorPrintC_SIGNATURE (MkObjectC_SIGNATURE ^ (6u<<10))
10099 #define MkErrorPrintC_MASK (((1u<<22)-1)<<10)
10100
10102
10103// CompileTimeCast --------------------------------------------------------------
10106
10107 #define MkErrorPrintC_X2obj(x) MkOBJ(x)
10108
10110
10111// TypeDef --------------------------------------------------------------
10114
10116 __parser__(ignore) typedef struct MkErrorPrintS MkErrorPrintCR;
10118 __parser__(ignore) typedef const struct MkErrorPrintS MkErrorPrintCNR;
10120 #define MkErrorPrintC_T (&MK_RT_REF._MkErrorPrintC_T)
10122 #define MkErrorPrintC_TT (MkTYP(MkErrorPrintC_T))
10124 #define MkErrorPrintST MkErrorPrintC_T
10126 #define MkErrorPrintSTT (MkTYP(MkErrorPrintST))
10128 #define MkErrorPrintCT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
10130 #define MkErrorPrintCTT_X(instance) (MkOBJ_R(instance).type)
10132 #define MkErrorPrintCT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
10134 #define MkErrorPrintC_NS MK
10136 #define MkErrorPrintCTT MkErrorPrintCTT
10138 #define MkErrorPrintCT ( (struct MkSuperTypeS *) MkErrorPrintCTT )
10139
10141
10144// MkErrorPrintC_Class_Define_C_API
10145
10146// END-MkErrorPrintS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10147
10149//MkErrorPrintC_C_API
10151// #######################################################################
10152// -----------------------------------------------------------------------
10159
10166__parser__(ignore)
10167struct MkErrorDefaultS {
10168 // BEGIN-MkErrorDefaultS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10169
10170 union {
10171 struct MkObjectS obj; // instance-base MkObjectS
10172 struct MkErrorS err; // instance-base MkErrorS
10173 } super;
10174
10175 // END-MkErrorDefaultS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10176};
10177
10178// BEGIN-MkErrorDefaultS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10179
10183 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
10184
10185// Signature --------------------------------------------------------------
10188
10189 #define MkErrorDefaultC_SIGNATURE (MkErrorC_SIGNATURE ^ (1u<<6))
10190 #define MkErrorDefaultC_MASK (((1u<<26)-1)<<6)
10191
10193
10194// CompileTimeCast --------------------------------------------------------------
10197
10198 #define MkErrorDefaultC_X2err(x) MkERR(x)
10199 #define MkErrorDefaultC_X2obj(x) MkOBJ(x)
10200
10202
10203// TypeDef --------------------------------------------------------------
10206
10208 __parser__(ignore) typedef struct MkErrorDefaultS MkErrorDefaultCR;
10210 __parser__(ignore) typedef const struct MkErrorDefaultS MkErrorDefaultCNR;
10212 #define MkErrorDefaultC_T (&MK_RT_REF._MkErrorDefaultC_T)
10214 #define MkErrorDefaultC_TT (MkTYP(MkErrorDefaultC_T))
10216 #define MkErrorDefaultST MkErrorDefaultC_T
10218 #define MkErrorDefaultSTT (MkTYP(MkErrorDefaultST))
10220 #define MkErrorDefaultCT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
10222 #define MkErrorDefaultCTT_X(instance) (MkOBJ_R(instance).type)
10224 #define MkErrorDefaultCT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
10226 #define MkErrorDefaultC_NS MK
10228 #define MkErrorDefaultCTT MkErrorDefaultCTT
10230 #define MkErrorDefaultCT ( (struct MkSuperTypeS *) MkErrorDefaultCTT )
10231
10233
10236// MkErrorDefaultC_Class_Define_C_API
10237
10238// END-MkErrorDefaultS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10239
10241// MkErrorDefaultC_C_API
10243// #######################################################################
10244// -----------------------------------------------------------------------
10249
10250__parser__push__(doc-group=System,class=MkErrorC);
10251
10255#define MkERROR_R(r) ((*r).error_mk)
10256#define MkERROR MkERROR_R(&MK_RT_REF)
10257#define MkERROR_RT MkERROR_R(&MK_RT_REF)
10258#define MkERROR_O(o) MkERROR_R(MkRT_O(o))
10259#define MkERROR_X(x) MkERROR_R(MkRT_X(x))
10260#define MkERROR_XN(x) MkERROR_R(MkRT_XN(x))
10261#define MkERROR_NULL MkERROR_R(&MkRuntimeRLS)
10263
10267
10269#define MK_ERROR_DEFAULT_R(r) MkOBJ(&(*r).error_mk)
10270#define MK_ERROR_DEFAULT MK_ERROR_DEFAULT_R(&MK_RT_REF)
10271#define MK_ERROR_DEFAULT_X(x) MK_ERROR_DEFAULT_R(MkRT_X(x))
10272#define MK_ERROR_DEFAULT_NULL MK_ERROR_DEFAULT_R(&MkRuntimeRLS)
10280mk_inline MK_ERR MkErrorDEFAULT_RT ( MK_PARSER_RT_ONLY );
10281
10283// END: MkErrorDEFAULT
10288
10289#define MK_ERROR_PANIC_R(r) MkOBJ(&(*r).error_panic)
10290#define MK_ERROR_PANIC MK_ERROR_PANIC_R(&MK_RT_REF)
10291#define MK_ERROR_PANIC_X(x) MK_ERROR_PANIC_R(MkRT_X(x))
10293#define MK_ERROR_PANIC_NULL MK_ERROR_PANIC_R(&MkRuntimeRLS)
10294
10310__parser__(hide)
10311mk_inline MK_ERR MkErrorPANIC_RT ( MK_PARSER_RT_ONLY );
10312
10314// END: MkErrorPanik
10315
10319
10320#define MK_ERROR_IGNORE_R(r) MkOBJ(&(*r).error_ignore)
10321#define MK_ERROR_IGNORE MK_ERROR_IGNORE_R(&MK_RT_REF)
10322#define MK_ERROR_IGNORE_X(x) MK_ERROR_IGNORE_R(MkRT_X(x))
10323#define MK_ERROR_IGNORE_XN(x) MK_ERROR_IGNORE_R(MkRT_XN(x))
10325#define MK_ERROR_IGNORE_NULL MK_ERROR_IGNORE_R(&MkRuntimeRLS)
10326
10351mk_inline MK_ERR MkErrorIGNORE_RT ( MK_PARSER_RT_ONLY );
10352
10354// MkErrorIgnore
10355
10359
10360#define MK_ERROR_PRINT_R(r) MkOBJ(&(*r).error_print)
10361#define MK_ERROR_PRINT MK_ERROR_PRINT_R(&MK_RT_REF)
10362#define MK_ERROR_PRINT_X(x) MK_ERROR_PRINT_R(MkRT_X(x))
10364#define MK_ERROR_PRINT_NULL MK_ERROR_PRINT_R(&MkRuntimeRLS)
10365
10379mk_inline MK_ERR MkErrorPRINT_RT ( MK_PARSER_RT_ONLY );
10380
10382// MkErrorPrintln
10383
10387
10388#define MK_ERROR_FORMAT_R(r) ((*r).error_mk.format_of_error ? (*r).error_mk.format_of_error : \
10389 MkObjN((*r).error_mk.source_of_error) ? MkObjN((*r).error_mk.source_of_error) : \
10390 MK_ERROR_DEFAULT_R(r))
10391#define MK_ERROR_FORMAT MK_ERROR_FORMAT_R(&MK_RT_REF)
10392#define MK_ERROR_FORMAT_X(x) MK_ERROR_FORMAT_R(MkRT_X(x))
10394#define MK_ERROR_FORMAT_NULL MK_ERROR_FORMAT_R(&MkRuntimeRLS)
10395
10413MK_EXTERN MK_ERR MK_DECL MkErrorFORMAT (
10416
10417#define MkErrorFORMAT_1M(m) MkErrorFORMAT(MkObjN(m))
10418#define MkErrorFORMAT_1X(x) MkErrorFORMAT(MkOBJ(x))
10419#define MkErrorFORMAT_1O(o) MkErrorFORMAT(o)
10420
10422__parser__(internal)
10423MK_EXTERN MK_ERR MK_DECL MkErrorFORMAT_EO (
10426
10428
10430
10432// END: MkErrorC_System_C_API
10434// #######################################################################
10435// -----------------------------------------------------------------------
10440
10441__parser__push__(doc-group=TOR);
10442
10448__parser__(destructor)
10449MK_EXTERN void MK_DECL MkErrorDelete_RT (
10451 MK_ERR err
10453
10461__parser__(constructor)
10462MK_EXTERN MK_ERR MK_DECL MkErrorDup_RT (
10464 MK_ERRN const srce
10466
10467__parser__pop__; // TOR
10468
10470// MkErrorC_TOR_C_API
10471
10472// #######################################################################
10473// -----------------------------------------------------------------------
10478
10479__parser__push__(doc-group=Get);
10480
10482__parser__(error-ignore,inline=MkErrorGetCodeI)
10484 MK_ERRN const err
10486
10488#define MkErrorGetCodeI(e) ((*e).code)
10490#define MkErrorGetCodeE_NULL() (MkERROR_NULL.code)
10492#define MkErrorGetCode_O(o) (MkERROR_O(o).code)
10493
10497 MK_ERRN const err
10499
10501#define MkErrorGetTextI(e) (MkBUF_R(&(*e).text).storage.first.C)
10505MK_EXTERN MK_SIZE MK_DECL MkErrorGetSize (
10506 MK_ERRN const err
10508
10510#define MkErrorGetSizeI(e) ((MK_SIZE)MkBUF_R(&(*e).text).var.cursize)
10511
10515 MK_ERRN const err
10517
10519#define MkErrorGetNumI(e) ((*e).num)
10520
10522
10524// MkErrorC_Get_C_API
10525
10526/*****************************************************************************/
10527/* */
10528/* error set */
10529/* */
10530/*****************************************************************************/
10531
10532// #######################################################################
10533// -----------------------------------------------------------------------
10539
10540__parser__push__(doc-group=Signal);
10541
10543MK_EXTERN void MK_DECL MkErrorSetCONTINUE_RT (
10545 MK_ERR const err
10547
10548#define MkErrorSetCONTINUE_0E() MkErrorSetCONTINUE(&MkERROR)
10549
10565MK_EXTERN enum MkErrorE MK_DECL MkErrorSetEXIT_RT (
10567 MK_ERR const err,
10568 MK_STRN const callfunc __parser__(default=F#FUNC)
10570
10572MK_EXTERN enum MkErrorE MK_DECL MkErrorSetSOCKET_RT (
10574 MK_ERR const err,
10575 MK_STRN const detail __parser__(default=S#"UNKNOWN"),
10576 MK_STRN const callfunc __parser__(default=F#FUNC)
10578
10585MK_EXTERN enum MkErrorE MK_DECL MkErrorSetABORT_RT (
10587 MK_ERR const err,
10588 MK_STRN const detail __parser__(default=S#"UNKNOWN"),
10589 MK_STRN const callfunc __parser__(default=F#FUNC)
10591
10595 MK_ERR const err,
10596 enum MkErrorE code
10598
10601 MK_ERRN const err
10603
10606 MK_ERRN const err
10608
10610MK_EXTERN bool MK_DECL MkErrorIsTIMEOUT (
10611 MK_ERRN const err
10613
10639MK_EXTERN bool MK_DECL MkErrorIsEXIT (
10640 MK_ERR const err
10642
10643__parser__pop__; // Signal
10644
10646// MkErrorC_Signal_C_API
10647
10648/*****************************************************************************/
10649/* */
10650/* error_is/check */
10651/* */
10652/*****************************************************************************/
10661
10663#define MkErrorCheckI(err) ((err) >= MK_ERROR)
10667#define MkErrorCheckE_0E() (MkErrorCheckI(MkErrorGetCode_0E()))
10668#define MkErrorCheckE_NULL() (MkErrorCheckI(MkErrorGetCodeE_NULL()))
10669#define MkErrorCheckE_O(o) (MkErrorCheckI(MkErrorGetCode_O(o)))
10670#define MkErrorCheckE_X(x) MkErrorCheckE_O(MkOBJ(x))
10673#define MkErrorCheck(err) if (MkErrorCheckI(err)) goto error
10675#define MkErrorE_Check(err) if (MkErrorCheckI(err)) goto error
10677#define MkErrorCheck_0E() if (MkErrorCheckE_0E()) goto error
10679#define MkErrorBreak(err) if (MkErrorCheckI(err)) break
10681#define MkContinueCheck(err) switch (err) { \
10682case MK_OK: break; case MK_CONTINUE: goto cont; case MK_ERROR: goto error;\
10686#define MkErrorSwitch(PROC) switch (PROC) {\
10687case MK_OK: break; case MK_ERROR: goto error; case MK_CONTINUE: return MK_CONTINUE;\
10688}
10690/*
10691OLD and unused
10692
10694#define MkErrorReturnAppend(PROC) \
10695if (MkErrorCheckI(PROC)) { \
10696 return MkErrorStack_0E (); \
10697} else if (MkErrorCheckE_0E()) { \
10698 return MkErrorReset_0E (); \
10699} else { \
10700 return MkERROR.code; \
10701}
10702*/
10704#define MkErrorReturn_2X(mngx,PROC) switch (PROC) {\
10705case MK_OK: return MK_OK; case MK_CONTINUE: return MK_CONTINUE; default: return MkErrorStack_1X (mngx);\
10706};
10708#define MkErrorReturn_1(PROC) switch (PROC) {\
10709case MK_OK: return MK_OK; case MK_CONTINUE: return MK_CONTINUE; default: return MkErrorStack_0E ();\
10710};
10712#define MkErrorReturn(PROC) MkErrorReturn_2X(META_CONTEXT_S,PROC)
10714#define check_MkErrorE(PROC) if (MkErrorCheckI(PROC))
10715
10717#define MkErrorReturnLabel(mng) \
10718 return MK_OK; \
10719error: \
10720 return MkErrorStack_1M(mng);
10721
10723// MkErrorCheck...
10724
10725// #######################################################################
10726// -----------------------------------------------------------------------
10733
10734__parser__global__(prefix2class:MkPanic=MkErrorC);
10735__parser__push__(doc-group=Raise);
10736
10747MK_EXTERN void MK_DECL MkPanicVL_RT (
10749 MK_OBJN const errfmt __parser__(default=F#ERROR_FORMAT),
10750 MK_STRN const callfunc __parser__(default=F#FUNC),
10751 MK_I32 const errnum __parser__(default=-1),
10752 MK_FST const printfmt,
10753 va_list var_list
10754) MK_ATTR_RT_INSTANCE __attribute__((noreturn));
10755
10756#define MkPanicVL_5M(errobj,callfunc,errnum,printfmt,var_list) \
10757 MkPanicVL(MkObj(errobj),callfunc,errnum,printfmt,var_list)
10758
10768MK_EXTERN void MK_DECL MkPanicV_RT (
10770 MK_OBJN const errfmt __parser__(default=F#ERROR_FORMAT),
10771 MK_STRN const callfunc __parser__(default=F#FUNC),
10772 MK_I32 const errnum __parser__(default=-1),
10773 MK_FST const printfmt,
10774 ...
10775) MK_ATTR_RT_INSTANCE MK_RT_ATTR_FORMAT_4 __attribute__((noreturn));
10776
10777#define MkPanicV_4M(errobj,callfunc,errnum,printfmt,...) \
10778 MkPanicV(MkObj(errobj),callfunc,errnum,printfmt,__VA_ARGS__)
10779
10780#define MkPanicV_2M(x,printfmt,...) \
10781 MkPanicV_2(MkObj(x),printfmt,__VA_ARGS__)
10792__parser__(no-type-extension,no-rpc)
10795 MK_OBJN const errfmt __parser__(default=F#ERROR_FORMAT),
10796 MK_STRN const callfunc __parser__(default=F#FUNC),
10797 MK_I32 const errnum __parser__(default=-1),
10798 MK_STRN const message
10799) MK_ATTR_RT_INSTANCE __attribute__ ((noreturn));
10800
10801#define MkPanicC_4M(errobj,callfunc,errnum,message) \
10802 MkPanicC(MkObj(errobj),callfunc,errnum,message)
10803
10804#define MkPanicC_2M(x,message) MkPanicC_2(MkObj(x),message)
10805
10810#define MkPanicSYS(mngx) do { \
10811 MkLogC_2X(mngx,"internal ERROR, please contact your local support\n"); \
10812 MkDisasterSignal(-1); \
10813} while (0)
10814
10820__parser__(internal,overload-c-no)
10821MK_EXTERN void MK_DECL MkDisasterSignal (
10822 MK_I32 signal __parser__(default=-1) // NO signal
10823) __attribute__ ((noreturn));
10831MK_EXTERN void MK_DECL MkErrorAppendVL_RT (
10833 MK_ERR const err,
10834 MK_FST const printfmt,
10835 va_list var_list
10837
10843__parser__(no-type-extension)
10844MK_EXTERN void MK_DECL MkErrorAppendV_RT (
10846 MK_ERR const err,
10847 MK_FST const printfmt,
10848 ...
10850
10856__parser__(no-type-extension)
10857MK_EXTERN void MK_DECL MkErrorAppendC_RT (
10859 MK_ERR const err,
10860 MK_STRN const message
10862
10881__parser__(doc-group=Raise)
10882MK_EXTERN MK_ERR MK_DECL MkErrorNoRaise_RT (
10884 MK_ERR const err
10886
10907__parser__(internal)
10908MK_EXTERN enum MkErrorE MK_DECL MkErrorSetR_RT (
10910 MK_ERR const err,
10911 MK_STRN const message,
10912 enum MkErrorE const errcode __parser__(default=F#MK_ERROR),
10913 MK_I32 const errnum __parser__(default=-1),
10914 MK_MNG const errctx __parser__(default=NULL)
10916
10925__parser__(hide)
10928 MK_ERR const err,
10929 MK_ERR const newerr
10931
10943__parser__(no-type-extension)
10946 MK_ERR err,
10947 MK_STRN const message,
10948 MK_STRN const callfunc __parser__(default=F#FUNC),
10949 MK_I32 const errnum __parser__(default=-1)
10951
10952#define MkErrorSetC_1XS(message) MkErrorSetC_4M(META_CONTEXT_S,message,__func__,-1)
10953#define MkErrorSetC_2E_E(caller,message) MkErrorCheck(MkErrorSetC_2E(message,caller))
10954
10955#define MkErrorSetC_4_NULL(...) MkErrorSetC_RT(MK_RT_NULL __VA_ARGS__)
10956#define MkErrorSetC_3_NULL(...) MkErrorSetC_4_NULL(&MkERROR_NULL,__VA_ARGS__)
10957#define MkErrorSetC_2_NULL(msg,pfx) MkErrorSetC_3_NULL(msg,pfx,-1)
10958#define MkErrorSetC_1_NULL(msg) MkErrorSetC_3_NULL(msg,__func__,-1)
10959
10960#define MkErrorSetC_4M_NULL(m,...) MkErrorSetC_4_NULL(MkErrorFORMAT_1M(m),__VA_ARGS__)
10961#define MkErrorSetC_3M_NULL(m,msg,pfx) MkErrorSetC_4M_NULL(m,msg,pfx,-1)
10962#define MkErrorSetC_2M_NULL(m,msg) MkErrorSetC_4M_NULL(m,msg,__func__,-1)
10963
10977__parser__(no-type-extension)
10980 MK_ERR err,
10981 MK_STRN const callfunc __parser__(default=F#FUNC),
10982 MK_I32 const errnum __parser__(default=-1),
10983 MK_FST const printfmt,
10984 va_list var_list
10986
10999__parser__(no-type-extension)
11002 MK_ERR err,
11003 MK_STRN const callfunc __parser__(default=F#FUNC),
11004 MK_I32 const errnum __parser__(default=-1),
11005 MK_FST const printfmt,
11006 ...
11008
11009#define MkErrorSetV_4EO_NULL(o,...) MkErrorSetV_NULL(MkErrorFORMAT_EO(o), __VA_ARGS__)
11010#define MkErrorSetV_4M_NULL(m,...) MkErrorSetV_NULL(MkErrorFORMAT_1M(m),__VA_ARGS__)
11011#define MkErrorSetV_2M_NULL(m,...) MkErrorSetV_4M_NULL(m,__func__,-1,__VA_ARGS__)
11012#define MkErrorSetV_2X(x,...) MkErrorSetV(MkErrorFORMAT_1X(x),__func__,-1,__VA_ARGS__)
11013
11014#define MkErrorSetV_1_NULL(printfmt,...) \
11015 MkErrorSetV_NULL(&MkERROR_NULL,__func__,-1,printfmt,__VA_ARGS__)
11016
11017#define MkErrorSetV_1XS(printfmt,...) \
11018 MkErrorSetV_4M(META_CONTEXT_S,__func__,-1,printfmt,__VA_ARGS__)
11019
11020#define MkErrorSetV_2E_E(caller,printfmt,...) \
11021 MkErrorCheck(MkErrorSetV_2E(caller,printfmt,__VA_ARGS__))
11022
11023#define MkErrorSet_ObjectIsNullError(m,printfmt,...) \
11024 MkErrorSetV_4M(m,"ObjectIsNullError",-1,printfmt,__VA_ARGS__)
11026#define MkErrorSysO(obj,cmd) \
11027 MkErrorSetV_4EO_NULL (obj, __func__, errno, \
11028 "can not '%s' -> ERR<%s>", MK_CPPXSTR(cmd), strerror (errno))
11029
11030__parser__pop__; // Raise
11033// MkErrorC_Raise_C_API
11035// #######################################################################
11036// -----------------------------------------------------------------------
11041
11042__parser__push__(doc-group=Misc);
11043
11048MK_EXTERN void MK_DECL MkErrorPrintln_RT (
11050 MK_ERR const err
11052
11053#define MkErrorPrintln_0() MkErrorPrintln_0E()
11054
11065__parser__(const,class-overload=MkObjectLog)
11066MK_EXTERN void MK_DECL MkErrorLog_RT (
11068 MK_ERRN const err ,
11070 MK_DBG const debug __parser__(default=0),
11071 MK_STRN const callfunc __parser__(default=F#FUNC),
11072 MK_I32 const lvl __parser__(default=0)
11074
11075#define MkErrorLog_1EF_NULL(fmt) MkErrorLog(&MkERROR_NULL,MkObj(fmt),0,__func__,0)
11076
11094__parser__(no-rpc,template-overload)
11095MK_EXTERN MK_ERR MK_DECL MkErrorCatch_RT (
11097 MK_ERR const err,
11098 MK_EXP const exception __parser__(default=NULL,has-reference),
11099 MK_STRN const callfunc __parser__(default=F#FUNC)
11101
11127__parser__(no-rpc,template-overload)
11128MK_EXTERN MK_ERR MK_DECL MkObjectErrorCatch_RT (
11130 MK_OBJN const obj,
11131 MK_EXP const exception __parser__(default=NULL,has-reference),
11132 MK_STRN const callfunc __parser__(default=F#FUNC)
11134
11136#define MkObjectErrorCatch_3X(x,...) MkObjectErrorCatch(MkOBJ(x),__VA_ARGS__)
11137
11145__parser__(doc-group=Raise)
11146MK_EXTERN enum MkErrorE MK_DECL MkErrorRaise_RT (
11148 MK_ERRN const err
11159// [MkErrorReset-example]
11162 MK_ERR const err,
11163 MK_STRN const callfunc __parser__(default=F#FUNC),
11164 MK_I32 const callline __parser__(default=F#LINE),
11165 bool const force __parser__(default=B#false)
11167
11168#define MkErrorReset_0M() MkErrorReset_4M(NULL,__func__,__LINE__,0);
11169#define MkErrorResetFORCE(m) MkErrorReset_4M(m,__func__,__LINE__,1);
11170
11171#define MkErrorReset_4X(x,...) MkErrorReset(MkErrorFORMAT_1X(x),__VA_ARGS__)
11172#define MkErrorReset_1X(x) MkErrorReset_4X(x,__func__,__LINE__,0)
11173// [MkErrorReset-example]
11183MK_DECL MkErrorStackFormat_RT (
11185 MK_ERR const err,
11186 MK_STRN callfunc __parser__(default=F#FUNC),
11187 MK_STRN callfile __parser__(default=F#FILE),
11188 MK_I32 const callline __parser__(default=F#LINE)
11190
11199__parser__(error-ignore,no-rpc)
11200MK_EXTERN enum MkErrorE
11201MK_DECL MkErrorStack_RT (
11203 MK_ERR const err __parser__(default=NULL),
11204 MK_STRN const callfunc __parser__(default=F#FUNC),
11205 MK_STRN const callfile __parser__(default=F#FILE),
11206 MK_I32 const callline __parser__(default=F#LINE)
11208
11209#define MkErrorStack_1M_Check(m) (MkErrorCheckE_0E() ? MkErrorStack_1M(m) : MkErrorGetCode_0E())
11210#define MkErrorStack_0E_Check() (MkErrorCheckE_0E() ? MkErrorStack_0E() : MkErrorGetCode_0E())
11211
11212#define MkErrorStack_4X(x,...) MkErrorStack_RT(MK_RT_CALL MkErrorFORMAT_1X(x),__VA_ARGS__)
11213#define MkErrorStack_3X(...) MkErrorStack_4X(__VA_ARGS__,__LINE__)
11214#define MkErrorStack_2X(...) MkErrorStack_4X(__VA_ARGS__,__FILE__,__LINE__)
11215#define MkErrorStack_1X(...) MkErrorStack_4X(__VA_ARGS__,__func__,__FILE__,__LINE__)
11216
11217#define MkErrorStack_0_NULL() MkErrorStack_NULL(&MkERROR_NULL,__func__,__FILE__,__LINE__)
11218
11219#define MkErrorStack_4X_NULL(x,...) MkErrorStack_NULL(MkErrorFORMAT_1X(x),__VA_ARGS__)
11220#define MkErrorStack_3X_NULL(...) MkErrorStack_4X_NULL(__VA_ARGS__,__LINE__)
11221#define MkErrorStack_2X_NULL(...) MkErrorStack_4X_NULL(__VA_ARGS__,__FILE__,__LINE__)
11222#define MkErrorStack_1X_NULL(...) MkErrorStack_4X_NULL(__VA_ARGS__,__func__,__FILE__,__LINE__)
11224#define MkErrorStack_NUM 50
11225#define MkErrorStack_STR "50"
11230MK_DECL MkErrorToString_RT (
11232 MK_ERRN const inst
11238// MkErrorC_Misc_C_API
11240// #######################################################################
11241// -----------------------------------------------------------------------
11267
11278__parser__(class=MkExceptionC,ignore)
11279bool MkExceptionCheck (MK_EXP exception);
11280
11286__parser__(class=MkExceptionC,ignore)
11287void MkExceptionRaise (
11288 MK_MNG const expobj,
11289 MK_STRN const callfunc,
11290 MK_I32 const callline
11291) ;
11292
11300__parser__(class=MkExceptionC,ignore)
11301MK_ERR MkExceptionCatch (
11302 MK_MNG const expobj,
11303 MK_EXP const exception,
11304 MK_STRN const callfunc
11305) ;
11306
11308// MkException_C_API
11309
11310// #######################################################################
11311// -----------------------------------------------------------------------
11317
11319__parser__(ignore)
11320struct MkRtExtS {
11321 // BEGIN-MkRtExtS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
11322
11323 union {
11324 struct MkObjectS obj; // instance-base MkObjectS
11325 struct MkExtensionS ext; // instance-base MkExtensionS
11326 } super;
11327
11328 // END-MkRtExtS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
11329
11330 MK_RT mkrtHead;
11331};
11332
11333// BEGIN-MkRtExtS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
11338 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
11340// Signature --------------------------------------------------------------
11343
11344 #define MkRtExtC_SIGNATURE (MkExtensionC_SIGNATURE ^ (2u<<6))
11345 #define MkRtExtC_MASK (((1u<<26)-1)<<6)
11346
11348
11349// CompileTimeCast --------------------------------------------------------------
11352
11353 #define MkRtExtC_X2rtext(x) (x)
11354 #define MkRtExtC_X2ext(x) MkEXT(x)
11355 #define MkRtExtC_X2obj(x) MkOBJ(x)
11356
11359// TypeDef --------------------------------------------------------------
11362
11364 __parser__(ignore) typedef struct MkRtExtS MkRtExtCR;
11366 __parser__(ignore) typedef const struct MkRtExtS MkRtExtCNR;
11368 #define MkRtExtC_T (&MK_RT_REF._MkRtExtC_T)
11370 #define MkRtExtC_TT (MkTYP(MkRtExtC_T))
11372 #define MkRtExtST MkRtExtC_T
11374 #define MkRtExtSTT (MkTYP(MkRtExtST))
11376 #define MkRtExtC_type MK_RTEXT
11378 #define MkRtExtCT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
11380 #define MkRtExtCTT_X(instance) (MkOBJ_R(instance).type)
11382 #define MkRtExtCT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
11384 #define MkRtExtC_NS MK
11386 #define MkRtExtCTT MkRtExtCTT
11388 #define MkRtExtCT ( (struct MkSuperTypeS *) MkRtExtCTT )
11389
11391
11392// TypeCheck --------------------------------------------------------------
11395
11396 #pragma GCC diagnostic push
11397 #pragma GCC diagnostic ignored "-Wattributes"
11401 __parser__(class=MkRtExtC,static,ignore)
11403 mk_inline bool MkRtExtCheck (MK_MNGN mng) {
11404 return MkSanitizeCheck(MkRtExtC,mng);
11405 }
11406
11409 __parser__(class=MkRtExtC,static,ignore)
11411 mk_inline bool MkRtExtCheckO (MK_OBJN obj) {
11412 return MkSanitizeCheckO(MkRtExtC,obj);
11413 }
11414
11415 #pragma GCC diagnostic pop
11416 #define MkRtExtC_Check(mng) MkRtExtCheck(mng)
11419
11420// RunTimeCast --------------------------------------------------------------
11423
11425 __parser__(class=MkRtExtC,ignore,static)
11426 META_ATTRIBUTE_SANITIZE
11428 mk_inline MK_RTEXT MkRtExt(MK_MNG mng) {
11429 return (MkRtExtCheck(mng) ? (MK_RTEXT)mng : NULL);
11431
11433 __parser__(class=MkRtExtC,ignore,static)
11434 META_ATTRIBUTE_SANITIZE
11436 mk_inline MK_RTEXTN MkRtExtN(MK_MNGN mng) {
11437 return (MkRtExtCheck(mng) ? (MK_RTEXTN)mng : NULL);
11438 }
11439
11441 #define MkRtExtRaise(_rtext) if (!_MkCheckX(MkRtExtC,_rtext)) { \
11442 MkErrorSetC_1E("'MkRtExtC' hdl is NULL"); \
11443 goto error ; \
11444 }
11445
11447 #define MkRTEXT_R(x) (*(x)).super.rtext
11449 #define MkRTEXT(x) (&MkRTEXT_R(x))
11452
11455// MkRtExtC_Class_Define_C_API
11456
11457// END-MkRtExtS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
11458
11459#define MkRtExtAdd(_mkrtR,add,id) do { \
11460 (_mkrtR).mkRtExt = (typeof((_mkrtR).mkRtExt)) MkExtensionAdd(MkEXT((_mkrtR).mkRtExt),MkEXT(add)); \
11461 MkRTEXT_R(add).mkrtHead = &(_mkrtR); \
11462 (_mkrtR).mkRtExtAry[id] = MkRTEXT(add); \
11463} while (0) \
11464
11465#define MkRtExtDel(_mkrtR,del,id) do { \
11466 (_mkrtR).mkRtExt = (typeof((_mkrtR).mkRtExt)) MkExtensionDel(MkEXT((_mkrtR).mkRtExt),MkEXT(del)); \
11467 MkRTEXT_R(del).mkrtHead = NULL; \
11468 (_mkrtR).mkRtExtAry[id] = NULL; \
11469} while (0) \
11470
11472// MkRtExtC_C_API
11474// #######################################################################
11475// -----------------------------------------------------------------------
11476//
11477// \addtogroup MqExceptionC_C_API
11478// \{
11479// \brief target-language class to 'set' and 'raise' an error …
11480//
11481// \}
11482// MqExceptionC_C_API
11483
11484/* MARK_R ################################################################ */
11485/* ### ### */
11486/* ### R U N T I M E - A P I ### */
11487/* ### ### */
11488/* ####################################################################### */
11489
11490__parser__global__(prefix2class:MkRuntime=MkRuntimeC);
11491
11538#pragma GCC diagnostic push
11539#pragma GCC diagnostic ignored "-Wlto-type-mismatch"
11540
11541#if defined(MK_C_BUILD_DLL)
11542
11543 #define META_SECTION_DEFINE
11544 #include "MkRuntimeS_mk.h"
11545 #undef META_SECTION_DEFINE
11546
11547#else
11548
11550struct MkRuntimeS {
11551
11552 // ======================================================================================
11553 // PUBLIC variables -> sync with MkRuntimeS_mk.h !!
11554
11555 // !!! sync with MkRuntimeS_mk.h
11556
11567
11568 // BEGIN-MkRuntimeS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
11569
11570 union {
11571 struct MkObjectS obj; // instance-base MkObjectS
11572 } super;
11573
11574 // END-MkRuntimeS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
11575
11577 struct MkErrorS error_mk;
11578
11580 struct MkErrorPanicS error_panic;
11581
11583 struct MkErrorIgnoreS error_ignore;
11584
11586 struct MkErrorPrintS error_print;
11587
11588 // instance attributes
11589 MK_RTEXT rtHead;
11590
11595
11600 bool isSilent;
11601
11603 bool noDeco;
11604
11611 MK_I32 debug;
11612
11614 FILE *logFILE;
11615
11617 MK_STR logfile;
11618 bool logfileLOCK;
11619
11621
11623 struct MkBuffer64S bud;
11624
11626 MK_PTR threadData;
11627
11629 MK_RTEXT mkRtExt;
11634 MkSelfIncrF fSelfIncr;
11635
11637 MkSelfDecrF fSelfDecr;
11638
11648 bool MkSelfIncrOnCacheB;
11649
11650 // ======================================================================================
11651 // TYPES
11652
11653 // BEGIN-rtDef - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
11654
11655 struct MkSuperTypeS _MkObjectC_T ;
11656 struct MkSuperTypeS _MkBufferC_T ;
11657 struct MkSuperTypeS _MkBuffer64C_T ;
11658 struct MkSuperTypeS _MkBuffer256C_T ;
11659 struct MkSuperTypeS _MkBuffer1024C_T ;
11660 struct MkSuperTypeS _MkBufferStreamC_T ;
11661 struct MkSuperTypeS _MkBufferStream16384C_T ;
11662 struct MkSuperTypeS _MkBufferStream256C_T ;
11663 struct MkSuperTypeS _MkBufferStream64C_T ;
11664 struct MkSuperTypeS _MkBufferStream1024C_T ;
11665 struct MkSuperTypeS _MkBufferListC_T ;
11666 struct MkSuperTypeS _MkLogFileC_T ;
11667 struct MkSuperTypeS _MkErrorC_T ;
11668 struct MkSuperTypeS _MkErrorDefaultC_T ;
11669 struct MkSuperTypeS _MkErrorIgnoreC_T ;
11670 struct MkSuperTypeS _MkErrorPrintC_T ;
11671 struct MkSuperTypeS _MkErrorPanicC_T ;
11672 struct MkSuperTypeS _MkExtensionC_T ;
11673 struct MkSuperTypeS _MkErrExtC_T ;
11674 struct MkSuperTypeS _MkRtExtC_T ;
11675 struct MkSuperTypeS _MkRuntimeC_T ;
11676 struct MkTypeS _MkTypeC_TT ;
11677 struct MkTypeS _MkSuperTypeC_TT ;
11679 // END-rtDef - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
11681 // offset calculated by "Nhi1InternalSize"
11682 MK_BINB private_variables[12986];
11685#endif
11687#pragma GCC diagnostic pop
11689// BEGIN-MkRuntimeS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
11694 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
11695
11696// Signature --------------------------------------------------------------
11699
11700 #define MkRuntimeC_SIGNATURE (MkObjectC_SIGNATURE ^ (9u<<10))
11701 #define MkRuntimeC_MASK (((1u<<22)-1)<<10)
11702
11704
11705// CompileTimeCast --------------------------------------------------------------
11708
11709 #define MkRuntimeC_X2rt(x) (x)
11710 #define MkRuntimeC_X2obj(x) MkOBJ(x)
11711
11713
11714// TypeDef --------------------------------------------------------------
11717
11719 __parser__(ignore) typedef struct MkRuntimeS MkRuntimeCR;
11721 __parser__(ignore) typedef const struct MkRuntimeS MkRuntimeCNR;
11723 #define MkRuntimeC_T (&MK_RT_REF._MkRuntimeC_T)
11725 #define MkRuntimeC_TT (MkTYP(MkRuntimeC_T))
11727 #define MkRuntimeST MkRuntimeC_T
11729 #define MkRuntimeSTT (MkTYP(MkRuntimeST))
11731 #define MkRuntimeC_type MK_RT
11733 #define MkRuntimeCT_X(instance) ( (struct MkSuperTypeS *) (MkOBJ_R(instance).type) )
11735 #define MkRuntimeCTT_X(instance) (MkOBJ_R(instance).type)
11737 #define MkRuntimeCT_TT(typ) ( (struct MkSuperTypeS *) (typ) )
11739 #define MkRuntimeC_NS MK
11741 #define MkRuntimeCTT MkRuntimeCTT
11743 #define MkRuntimeCT ( (struct MkSuperTypeS *) MkRuntimeCTT )
11744
11746
11747// TypeCheck --------------------------------------------------------------
11750
11751 #pragma GCC diagnostic push
11752 #pragma GCC diagnostic ignored "-Wattributes"
11756 __parser__(class=MkRuntimeC,static,hide)
11758 mk_inline bool MkRtCheck (MK_MNGN mng) {
11759 return MkSanitizeCheck(MkRuntimeC,mng);
11760 }
11761
11764 __parser__(class=MkRuntimeC,static,hide)
11766 mk_inline bool MkRtCheckO (MK_OBJN obj) {
11767 return MkSanitizeCheckO(MkRuntimeC,obj);
11768 }
11769
11770 #pragma GCC diagnostic pop
11771 #define MkRuntimeC_Check(mng) MkRtCheck(mng)
11774
11775// RunTimeCast --------------------------------------------------------------
11778
11780 __parser__(class=MkRuntimeC,hide,static)
11781 META_ATTRIBUTE_SANITIZE
11783 mk_inline MK_RT MkRt(MK_MNG mng) {
11784 return (MkRtCheck(mng) ? (MK_RT)mng : NULL);
11786
11788 __parser__(class=MkRuntimeC,hide,static)
11789 META_ATTRIBUTE_SANITIZE
11791 mk_inline MK_RTN MkRtN(MK_MNGN mng) {
11792 return (MkRtCheck(mng) ? (MK_RTN)mng : NULL);
11793 }
11794
11796 #define MkRtRaise(_rt) if (!_MkCheckX(MkRuntimeC,_rt)) { \
11797 MkErrorSetC_1E("'MkRuntimeC' hdl is NULL"); \
11798 goto error ; \
11799 }
11800
11802
11805// MkRuntimeC_Class_Define_C_API
11806
11807// END-MkRuntimeS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
11808
11810// MkRuntime_C_API
11811
11812// =========================================================================
11813// BEGIN-MkRuntimeS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
11814
11817
11820
11821__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkRuntimeC);
11822
11838__parser__(class-overload=MkObjectHandleGet)
11840mk_inline MK_HDL MK_DECL MkRuntimeHandleGet_RT (
11842 MK_RT const rt __parser__(null-allowed)
11843) {
11844 return MkObjectHandleGet(rt?MkOBJ(rt):NULL);
11845}
11846
11855__parser__(flags=new)
11857mk_inline MK_RT MkRuntimeHandleResolve_RT (
11859 MK_HDL const netHdl
11860) {
11861 return MkRt(MkObjectHandleResolve(netHdl));
11862}
11863
11873#define MkRuntimeHandleResolve_e(netHdl) ({ \
11874 MK_HDL tmpHdl=netHdl; \
11875 MK_RT tmp; \
11876 if (tmpHdl==0) { \
11877 tmp=NULL; \
11878 } else { \
11879 tmp=MkRuntimeHandleResolve(tmpHdl); \
11880 if (tmp==NULL) { \
11881 MkErrorSetC_1_NULL("ERROR: 'MkRuntimeC' handle is 'NULL'"); \
11882 goto error; \
11883 }; \
11884 }; \
11885 tmp; \
11886})
11889
11891// Class export & import
11892
11896 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkRuntimeC,null-return-allow)
11898 mk_inline MK_RT MkRuntimeGetNull ( void ) {
11899 return (MK_RT)MK_NULL;
11900 }
11902// MkRuntimeC - Misc - function
11903
11905// MkRuntimeC_Class_C_API
11906
11907// END-MkRuntimeS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
11908
11911__parser__global__(MkRuntimeGetNull:hide);
11913// #######################################################################
11914// -----------------------------------------------------------------------
11918
11921
11922#define MkRT (&MkRuntimeRLS)
11923#define MkRT_R (MkRuntimeRLS)
11924
11925#if META_HAS_THREAD
11926 #define MkRT_O(o) ((o) && (*o).objRt ? (*o).objRt : MkRuntimeGet())
11927 #define MkRT_X(x) ((x) && MkOBJ_R(x).objRt ? MkOBJ_R(x).objRt : MkRuntimeGet())
11928 #define MkRT_ONN(o) ((*o).objRt)
11929 #define MkRT_ON(o) ( (*o).objRt ? (*o).objRt : MkRuntimeGet())
11930 #define MkRT_XN(x) ( MkOBJ_R(x).objRt ? MkOBJ_R(x).objRt : MkRuntimeGet())
11931#else
11932 #define MkRT_O(o) MkRT
11933 #define MkRT_X(x) MkRT
11934 #define MkRT_ONN(o) MkRT
11935 #define MkRT_ON(o) MkRT
11936 #define MkRT_XN(x) MkRT
11937#endif
11938
11939#if META_HAS_THREAD
11940 #define MkRtSetup_O(o) MK_RT_UNUSED MK_RT const mkrt = MkRT_O(o)
11941 #define MkRtSetup_X(x) MK_RT_UNUSED MK_RT const mkrt = MkRT_X(x)
11942 #define MkRtSetup_XN(x) MK_RT_UNUSED MK_RT const mkrt = MkRT_XN(x)
11943 #define MkRtSetup_ON(o) MK_RT_UNUSED MK_RT const mkrt = MkRT_ON(o)
11944 #define MkRtSetup_NULL MK_RT_UNUSED MK_RT const mkrt = MkRuntimeGet()
11945 #define MkRtSetup_RT(r) MK_RT_UNUSED MK_RT const mkrt = r
11946 #define MkRtSetupFromRtExt(rtx) MK_RT_UNUSED MK_RT const mkrt = MkRTEXT_R(rtx).mkrtHead
11947
11948// check "rt" on NULL if available as argument (MK_RT_ARGS).
11949 #define MkRtSetup_O_RT(o) if (mkrt == NULL) mkrt = MkRT_O(o)
11950 #define MkRtSetup_ON_RT(o) if (mkrt == NULL) mkrt = MkRT_ON(o)
11951 #define MkRtSetup_X_RT(x) if (mkrt == NULL) mkrt = MkRT_X(x)
11952 #define MkRtSetup_XN_RT(x) if (mkrt == NULL) mkrt = MkRT_XN(x)
11953 #define MkRtSetup_NULL_RT if (mkrt == NULL) mkrt = MkRuntimeGet()
11955 #define AllRtSetup_O(o) MkRtSetup_O(o)
11956 #define AllRtSetup_ON(o) MkRtSetup_ON(o)
11957 #define AllRtSetup_X(x) MkRtSetup_X(x)
11958 #define AllRtSetup_XN(x) MkRtSetup_XN(x)
11959 #define AllRtSetup_NULL MkRtSetup_NULL
11960#else
11961 #define MkRtSetup_O(o)
11962 #define MkRtSetup_X(x)
11963 #define MkRtSetup_XN(x)
11964 #define MkRtSetup_ON(o)
11965 #define MkRtSetup_NULL
11966 #define MkRtSetup_RT(r)
11968 #define MkRtSetup_O_RT(o)
11969 #define MkRtSetup_X_RT(x)
11970 #define MkRtSetup_XN_RT(x)
11971 #define MkRtSetup_ON_RT(o)
11972 #define MkRtSetup_NULL_RT
11974 #define AllRtSetup_O(o)
11975 #define AllRtSetup_ON(o)
11976 #define AllRtSetup_X(x)
11977 #define AllRtSetup_XN(x)
11978 #define AllRtSetup_NULL
11979#endif
11980
11982
11988typedef void ( MK_DECL *MkRuntimeInitF) ( MK_RT_ARGS_ONLY );
11989
12038__parser__(ignore)
12039typedef struct MkRuntimeCallbackS {
12040 MkRuntimeInitF cb ;
12041
12042 #define MkRuntimeCallbackS_ident_size 30
12043 MK_STRB ident[MkRuntimeCallbackS_ident_size+1];
12044
12045 // private
12046 bool inUse ;
12047 size_t rtId_plus_1 ;
12048
12049 // CDL list
12050 struct MkRuntimeCallbackS *prev ;
12051 struct MkRuntimeCallbackS *next ;
12122__parser__(ignore)
12125 MkRuntimeCallbackS * cbdata,
12126 MkRuntimeInitF rt_callback,
12127 MK_STRN ident
12128);
12129
12132__parser__(ignore)
12134
12136// - MkRuntimeCallback
12139__parser__(ignore)
12142
12149__parser__(ignore)
12151
12157__parser__(ignore)
12159
12161MK_ATTR_STATIC __parser__(hide,doc-group=Config)
12163{
12164 return __MkCheckX(MkRuntimeC,&MkRuntimeRLS) ? MkRT : MkRuntimeSetup( MkRT );
12165}
12166
12168MK_ATTR_STATIC __parser__(hide,doc-group=Config)
12169mk_inline MK_RT MkRuntimeGetFromObj (
12170 MK_OBJ obj __parser__(null-allowed)
12171) {
12172 return MkRT_O(obj);
12173}
12174
12176// - MkRuntimeC_Interface_C_API
12177
12178// #######################################################################
12179// -----------------------------------------------------------------------
12189
12190__parser__push__(doc-group=Config);
12191
12194mk_inline bool MkRuntimeGetIsSilent ( void ) {
12195 return MkRuntimeRLS.isSilent;
12196}
12197
12200mk_inline void MkRuntimeSetIsSilent_RT ( MK_PARSER_RT bool silent );
12201
12204mk_inline MK_I32 MkRuntimeGetDebug ( void ) {
12205 return MkRuntimeRLS.debug;
12206}
12207
12210mk_inline void MkRuntimeSetDebug ( MK_I32 dbg ) {
12211 MkRuntimeRLS.debug = dbg;
12212}
12213
12221
12227MK_EXTERN enum MkErrorE MK_DECL MkRuntimeSetLogfile_RT (
12229 MK_STRN logfile
12230) ;
12231
12233__parser__(hide)
12234MK_EXTERN void MK_DECL MkRuntimeSetCID (MK_OBJ const cid) MK_ATTR_STATIC ;
12235
12237MK_ATTR_RT_STATIC __parser__(error-ignore)
12238mk_inline enum MkErrorE MkRuntimeGetErrorCode_RT (
12240) {
12242 return MkERROR_RT.code;
12243}
12244
12246
12248// - MkRuntimeC_Config_C_API
12249
12250// #######################################################################
12251// -----------------------------------------------------------------------
12256
12257__parser__push__(doc-group=Info);
12258
12269__parser__(const,class-overload=MkObjectLog)
12272 MK_RTN const rt __parser__(default=NULL),
12274 MK_DBG const debug __parser__(default=0),
12275 MK_STRN const callfunc __parser__(default=F#FUNC),
12276 MK_I32 const lvl __parser__(default=0)
12278
12280
12282// - MkRuntimeC_Config_C_API
12283
12284/* ####################################################################### */
12285/* ### ### */
12286/* ### P A C K A G E - A P I ### */
12287/* ### ### */
12288/* ####################################################################### */
12289
12345// #######################################################################
12346// -----------------------------------------------------------------------
12512#ifndef MK_EMBEDDED
12514 #define MK_EMBEDDED(type,call,...) ({ \
12515 type ret = (type) 0; \
12516 if (MkErrorCheckI(call (__VA_ARGS__,&ret))) goto error; \
12517 ret; \
12518 })
12519#endif
12520
12521#ifndef MK_EMBEDDED_REF
12523 #define MK_EMBEDDED_REF(type,call,...) ({ \
12524 type ret = {0}; \
12525 if (MkErrorCheckI(call (__VA_ARGS__,&ret))) goto error; \
12526 ret; \
12527 })
12528#endif
12529
12531// MkKernel_Overload_C_API
12532
12533/*****************************************************************************/
12534/* */
12535/* doc functions */
12536/* */
12537/*****************************************************************************/
12538
12539// -----------------------------------------------------------------------
12554
12555// -----------------------------------------------------------------------
12556// BEGIN-Class-Doc-Order - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
12557
12558// external
12564
12565// external
12571
12572// internal
12579
12580// external
12586
12587// internal
12594
12595// external
12601
12602// external
12608
12609// internal
12616
12617// external
12623
12624// internal
12631
12632// END-Class-Doc-Order - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
12633
12634/*****************************************************************************/
12635/* */
12636/* inline functions */
12637/* */
12638/*****************************************************************************/
12639
12640// BEGIN-Class-Introspection - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
12641
12646
12647__parser__push__(doc-name=Introspection,doc-index=Class,class=MkBufferListC,no-rpc,null-return-allow,flags=new);
12648
12654 return (MK_BFL)MkBufferListC_TT->instances;
12655}
12656
12659mk_inline MK_BFL MkBufferListNext(MK_BFL const bfl) {
12660 MK_INSTANCE_HDL(bfl);
12661 return (MK_BFL)MkBufferListC_X2obj(bfl)->obj_protect.next;
12662}
12663
12667 MK_INSTANCE_HDL(bfl);
12668 return (MK_BFL)MkBufferListC_X2obj(bfl)->obj_protect.prev;
12669}
12670
12672
12675// MkBufferListC_Class_C_API
12676
12681
12682__parser__push__(doc-name=Introspection,doc-index=Class,class=MkBufferC,no-rpc,null-return-allow,flags=new);
12683
12687mk_inline MK_BUF MkBufferInstances_RT( MK_PARSER_RT_ONLY ) {
12689 return (MK_BUF)MkBufferC_TT->instances;
12690}
12691
12694mk_inline MK_BUF MkBufferNext(MK_BUF const buf) {
12695 MK_INSTANCE_HDL(buf);
12696 return (MK_BUF)MkBufferC_X2obj(buf)->obj_protect.next;
12697}
12698
12702 MK_INSTANCE_HDL(buf);
12703 return (MK_BUF)MkBufferC_X2obj(buf)->obj_protect.prev;
12704}
12705
12707
12710// MkBufferC_Class_C_API
12711
12716
12717__parser__push__(doc-name=Introspection,doc-index=Class,class=MkBufferStreamC,no-rpc,null-return-allow,flags=new);
12718
12722mk_inline MK_BUS MkBufferStreamInstances_RT( MK_PARSER_RT_ONLY ) {
12724 return (MK_BUS)MkBufferStreamC_TT->instances;
12725}
12726
12729mk_inline MK_BUS MkBufferStreamNext(MK_BUS const bus) {
12730 MK_INSTANCE_HDL(bus);
12731 return (MK_BUS)MkBufferStreamC_X2obj(bus)->obj_protect.next;
12732}
12733
12737 MK_INSTANCE_HDL(bus);
12738 return (MK_BUS)MkBufferStreamC_X2obj(bus)->obj_protect.prev;
12739}
12740
12742
12745// MkBufferStreamC_Class_C_API
12746
12751
12752__parser__push__(doc-name=Introspection,doc-index=Class,class=MkErrorC,no-rpc,null-return-allow,flags=new);
12753
12757mk_inline MK_ERR MkErrorInstances_RT( MK_PARSER_RT_ONLY ) {
12759 return (MK_ERR)MkErrorC_TT->instances;
12760}
12761
12764mk_inline MK_ERR MkErrorNext(MK_ERR const err) {
12765 MK_INSTANCE_HDL(err);
12766 return (MK_ERR)MkErrorC_X2obj(err)->obj_protect.next;
12767}
12768
12772 MK_INSTANCE_HDL(err);
12773 return (MK_ERR)MkErrorC_X2obj(err)->obj_protect.prev;
12774}
12775
12777
12780// MkErrorC_Class_C_API
12781
12786
12787__parser__push__(doc-name=Introspection,doc-index=Class,class=MkLogFileC,no-rpc,null-return-allow,flags=new);
12788
12792mk_inline MK_LFL MkLogFileInstances_RT( MK_PARSER_RT_ONLY ) {
12794 return (MK_LFL)MkLogFileC_TT->instances;
12795}
12796
12799mk_inline MK_LFL MkLogFileNext(MK_LFL const lfl) {
12800 MK_INSTANCE_HDL(lfl);
12801 return (MK_LFL)MkLogFileC_X2obj(lfl)->obj_protect.next;
12802}
12803
12807 MK_INSTANCE_HDL(lfl);
12808 return (MK_LFL)MkLogFileC_X2obj(lfl)->obj_protect.prev;
12809}
12810
12812
12815// MkLogFileC_Class_C_API
12816
12821
12822__parser__push__(doc-name=Introspection,doc-index=Class,class=MkObjectC,no-rpc,null-return-allow);
12823
12827mk_inline MK_OBJ MkObjectInstances_RT( MK_PARSER_RT_ONLY ) {
12829 return (MK_OBJ)MkObjectC_TT->instances;
12830}
12831
12834mk_inline MK_OBJ MkObjectNext(MK_OBJ const obj) {
12835 MK_INSTANCE_HDL(obj);
12836 return (MK_OBJ)MkObjectC_X2obj(obj)->obj_protect.next;
12837}
12838
12842 MK_INSTANCE_HDL(obj);
12843 return (MK_OBJ)MkObjectC_X2obj(obj)->obj_protect.prev;
12844}
12845
12847
12850// MkObjectC_Class_C_API
12851
12856
12857__parser__push__(doc-name=Introspection,doc-index=Class,class=MkRuntimeC,no-rpc,null-return-allow,flags=new);
12858
12862mk_inline MK_RT MkRuntimeInstances_RT( MK_PARSER_RT_ONLY ) {
12864 return (MK_RT)MkRuntimeC_TT->instances;
12865}
12866
12869mk_inline MK_RT MkRuntimeNext(MK_RT const rt) {
12870 MK_INSTANCE_HDL(rt);
12871 return (MK_RT)MkRuntimeC_X2obj(rt)->obj_protect.next;
12872}
12873
12877 MK_INSTANCE_HDL(rt);
12878 return (MK_RT)MkRuntimeC_X2obj(rt)->obj_protect.prev;
12879}
12880
12882
12885// MkRuntimeC_Class_C_API
12886
12887// END-Class-Introspection - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
12888
12890__parser__global__(MkRuntimeNext:hide);
12891__parser__global__(MkRuntimePrev:hide);
12892
12895__parser__(internal)
12897 // TODO replace loop by hash
12898 MkTypeLoop(MkTypeC,typ) {
12899 if ((*typ).objsig == typeSIG) return (*typ).instances;
12900 }
12901 return NULL;
12902}
12903
12904/*
12905mk_inline MK_SIG MkObjectRpcHdlGet(MK_OBJ obj) {
12906 return (*obj).rpcHdl;
12907}
12908*/
12909
12910// =============================================================================================================
12911
12917 return &MkERROR;
12918}
12919
12922mk_inline MK_ERR MkErrorIGNORE_RT ( MK_PARSER_RT_ONLY ) {
12925 return &MkERROR;
12926}
12927
12933 return &MkERROR;
12934}
12935
12941 return &MkERROR;
12942}
12943
12948 MK_OBJ obj,
12949 MK_PTR *self_out,
12950 MK_PTR const env
12951) {
12952 assert(self_out != NULL);
12953
12954 if (obj == NULL) {
12955 *self_out = NULL;
12956 return MK_OK;
12957 }
12958 MkRtSetup_ON_RT(obj);
12959
12960 enum MkErrorE ret = MK_OK;
12961 MK_PTR self = MkSelfGet(obj);
12962 if (self != NULL) {
12963 if (MkRefGet(obj) <= 0) {
12964 MkErrorSetV_2M(obj, "RefCount Error: object '%s' has 'self' but 'refCout <= 0", obj->type->type_name);
12965 goto error;
12966 } else {
12967 ret = MK_CONTINUE;
12968 if (MK_RT_REF.MkSelfIncrOnCacheB && MK_RT_REF.fSelfIncr) (*MK_RT_REF.fSelfIncr)(MK_RT_CALL self, env);
12969 goto end;
12970 }
12971 }
12972 self = MkSelfCreate(obj, env);
12973 if (self == NULL) {
12974 MkErrorSetV_2M(obj, "Error: '%s->SelfCreate' return a NULL pointer", obj->type->type_name);
12975 goto error;
12976 }
12977end:
12978 *self_out = self;
12979 return ret;
12980error:
12981 *self_out = NULL;
12982 return MK_ERROR;
12983}
12984
12987
12999 MK_OBJ const obj
13000) {
13001 MK_INSTANCE_RT_O(obj);
13002 return MkErrorFORMAT_1O(obj);
13003}
13004
13005#define MkObjectToError_1X(obj) MkObjectToError(MkOBJ(obj))
13006
13008// MkObjectC_Misc_C_API
13009
13012
13014mk_inline MkBinaryR MkBinaryDup_RT ( MK_PARSER_RT const MkBinaryR bin ) {
13016 return MkBinaryCreate(bin.size,(MK_BIN)MkSysMemDup(MK_ERROR_PANIC,bin.data,(size_t)bin.size));
13017}
13018
13020mk_inline void MkBinaryLog_RT ( MK_PARSER_RT const MkBinaryR bin ) {
13022 MkLogV(MK_ERROR_FORMAT,__func__,0,"MkBinaryR: size=%li, data=%p\n", bin.size, bin.data);
13023}
13024
13026
13029
13031mk_inline MkStringR MkStringDup_RT ( MK_PARSER_RT MkStringR const str ) {
13033 return MkStringCreate(str.len,(MK_STRN)MkSysMemDup(MK_ERROR_PANIC,str.ptr,(size_t)str.len));
13035
13038mk_inline void MkStringLog_RT ( MK_PARSER_RT MkStringR const str, MK_STRN func ) {
13040 MkLogV(MK_ERROR_FORMAT,func,0,"MkStringR: len=%i -> %.*s\n", str.len, str.len, str.ptr);
13041}
13042
13044
13047mk_inline void MkRuntimeSetIsSilent_RT ( MK_PARSER_RT bool silent ) {
13049 MkLogC(MK_ERROR_FORMAT, "Attention: set 'silient'\n", 1, __func__);
13050 MkSysPrintTrace(MK_ERROR_FORMAT,0,-1,1,__func__,0);
13051 MkRuntimeRLS.isSilent = silent;
13053
13054// end c++ save definition
13056// END: BEGIN_MK_C_DECLS
13057
13058#endif // KERNEL_MK_H
13059
13060// vim:nowrap
#define MkCacheS_MkCacheItemS_size
#define MkCacheS_name_size
#define META_TIMEOUT_REF
#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.
#define MkBuffer256S_ils_size
256 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBuffer64S_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
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 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 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) …
static MK_BUF MkBufferGetNull(void)
Null-Slot - return a MkBufferC typed NULL instance …
static MK_HDL MkBufferHandleGet_RT(MK_RT mkrt, MK_BUF const buf)
Handle-Get-Slot - returns a export-hdl to the MkBufferC useable for external storage
static MK_BUF MkBufferPrev(MK_BUF const buf)
get previous instance from linked-list of MkBufferS type
static MK_BUF MkBufferNext(MK_BUF const buf)
get next instance from linked-list of MkBufferS type
static MK_BUF MkBuf(MK_MNG mng)
cast a unknown-object into an MkBufferS pointer or NULL if not possible
#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 …
#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) …
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 …
#define MkBufferCreateLOCAL_T(cls, name, size)
create an new MkBufferC object as L)ocal S)torage…
#define MkBufferCreateTLS_inout_T(cls, name, inout)
Constructs a MkBufferC instance as T)hread L)ocal S)torage OR reuse inout if possible…
#define MkBufferCreateTLS_T(cls, name, size)
create an new MkBufferC object as T)hread L)ocal S)torage…
static MK_BFL MkBufferListPrev(MK_BFL const bfl)
get previous instance from linked-list of MkBufferListS type
static MK_BFL MkBufferListInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkBufferListS type …
#define MkBufferListC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MkBufferListC_X2obj(x)
#define MkBufferStream1024_ils_size
1024 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBufferStream16384S_ils_size
16384 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBufferStream256S_ils_size
256 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBufferStream64_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBufferStreamS_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
static MK_HDL MkBufferStreamHandleGet_RT(MK_RT mkrt, MK_BUS const bus)
Handle-Get-Slot - returns a export-hdl to the MkBufferStreamC useable for external storage
static MK_BUS 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
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)
static bool MkBusCheck(MK_MNGN mng)
check MkBufferStreamS -> libmkkernel::MkObjectS::signature …
#define MkBufferStreamC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
static bool MkBusCheckO(MK_OBJN obj)
check MkBufferStreamS -> libmkkernel::MkObjectS::signature …
void MkBufferStreamPosToStart_RT(MK_RT mkrt, MK_BUS const bus)
set the current-access-position to the start of MkBufferStreamC …
#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 …
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)
#define MK_ERREXT_ARGS
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)
#define MK_ERREXT_ARGS_N
const struct MkErrExtS * MK_ERREXTN
class-shortcut for const struct MkErrExtS *, all const shortcut using the XX_YYYC syntax (only for pu...
static bool MkErrExtCheckO(MK_OBJN obj)
check MkErrExtS -> libmkkernel::MkObjectS::signature …
static bool MkErrExtCheck(MK_MNGN mng)
check MkErrExtS -> libmkkernel::MkObjectS::signature …
static MK_ERR MkErrorNext(MK_ERR const err)
get next instance from linked-list of MkErrorS type
struct MkErrorS * MK_ERR
class-shortcut for struct MkErrorS *, all shortcut using the XX_YYY syntax (only for public API) …
static MK_ERR MkErrorPrev(MK_ERR const err)
get previous instance from linked-list of MkErrorS type
#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 …
static bool MkErrCheck(MK_MNGN mng)
check MkErrorS -> libmkkernel::MkObjectS::signature …
enum MkErrorE MkErrorGetCode(MK_ERRN const err)
get the value of MkErrorS::code …
#define MkErrorGetSizeI(e)
get the error-message-size from the exception-object …
#define MkErrorGetCodeI(e)
get the value of MkErrorS::code …
MK_STRN MkErrorGetText(MK_ERRN const err)
get the MkErrorS::text …
#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 …
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 …
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 MkPanicC_RT(MK_RT mkrt, MK_OBJN const errfmt, MK_STRN const callfunc, MK_I32 const errnum, MK_STRN const message)
do a panic with string 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 MkErrorIsSOCKET(MK_ERRN const err)
check on SOCKET-DOWN error …
void MkErrorSetCode_RT(MK_RT mkrt, MK_ERR const err, enum MkErrorE code)
set the MkErrorS::code value …
bool MkErrorIsABORT(MK_ERRN const err)
check on ABORT signal …
#define MkERROR
#define MK_ERROR_PRINT
static MK_ERR MkErrorPRINT_RT(MK_RT mkrt)
ignore-system-error - print the next error into MkLogFileC …
#define MK_ERROR_DEFAULT
#define MkErrorFORMAT_1O(o)
#define MkERROR_RT
#define MK_ERROR_PANIC
static MK_ERR MkErrorPANIC_RT(MK_RT mkrt)
panic-system-error - panic on next error …
#define MK_ERROR_IGNORE
#define MK_ERROR_FORMAT
static MK_ERR MkErrorDEFAULT_RT(MK_RT mkrt)
default-system-error - default-error …
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 …
#define MkExtension_size
maximum number of runtime-extensions useable in a theKernel software.
const struct MkExtensionS * MK_EXTN
class-shortcut for const struct MkExtensionS *, all const shortcut using the XX_YYYC syntax (only for...
static bool MkExtCheck(MK_MNGN mng)
check MkExtensionS -> libmkkernel::MkObjectS::signature …
static bool MkExtCheckO(MK_OBJN obj)
check MkExtensionS -> libmkkernel::MkObjectS::signature …
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 BEGIN_MK_C_DECLS
#define MK_NULL_STR
the string "MK_NULL" value as MK_NULL_STR …
#define MK_PARSER_fmtobj
use param_fmtobj for documentation
#define MK_NO_RETURN
dosable "MK_NO_RETURN" because C# require "return" from "MqExit" for thread-pool support
#define MK_DECL
#define mk_inline
#define MK_EXTERN_DATA
#define MK_EXTERN
static library
#define END_MK_C_DECLS
#define mk_timeval
#define MK_ATTR_HOT
#define MK_UNUSED
mark unnused variables and functions
#define mk_timezone
#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 …
#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) …
MkTimeoutE
Predefined Timeout values …
#define MK_TYPE_IS_2_I8E
the type is native and has a size of 2 bytes …
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 …
MkBoolE
the internal boolean …
#define MK_TYPE_IS_8_I8E
the type is native and has a size of 8 bytes …
MkErrorE
collection for the different error-codes …
#define MK_TYPE_IS_4_I8E
the type is native and has a size of 4 bytes …
@ 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_NORMAL
normal timeout in sec (90 sec) …
@ MK_TIMEOUT_DEFAULT
request the default timeout value …
@ MK_TIMEOUT_SOCKET
shorter timeout in sec (10 sec) … This TIMEOUT is used for socket connection with 'connect'
@ MK_TIMEOUT_SHORT
short timeout in sec (20 sec) …
@ MK_TIMEOUT_INIT
maximum timeout in sec (900 sec) …
@ MK_TIMEOUT_VERYSHORT
very short timeout in sec (5 sec) …
@ MK_TIMEOUT_MAX
request the maximum possible (infinite) timeout value …
@ MK_TIMEOUT_USER
request the user defined timeout value from the –timeout configuration value …
@ 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_YES
boolean YES
@ MK_NO
boolean NO
@ 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.
#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
unsigned char MK_U8
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
signed char MK_I8
1 byte byte data-type
MK_PTRB * MK_CBP
generic pointer to call-back data
unsigned long MK_ULN
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 …
unsigned int MK_U32
signed int MK_I32
4 byte integer data-type
MK_STRB * MK_STR
string pointer data-type with UTF8 ecoding (MK_STR)
unsigned int MK_SIG
signature datatype
MK_PTRB * MK_PTR
generic pointer data-type
unsigned short MK_U16
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 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
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 …
#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 …
enum MkErrorE MkLogFileOpen_RT(MK_RT mkrt, MK_OBJ errfmt, 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 …
MK_STRN(* MkToStringF)(MK_RT mkrt, MK_OBJN const obj)
MK_OBJ(* MkDup2F)(MK_RT mkrt, MK_OBJ const obj, MK_STRN const ident)
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)
#define MkSanitizeCheck(_root, _m)
MK_PTR(* MkSelfCreateF)(MK_RT mkrt, MK_OBJ const obj, MK_PTR const env)
void(* MkLogF)(MK_RT mkrt, MK_OBJN const obj, MK_OBJN fmt, MK_I32 const debug, MK_STRN const prefix, MK_I32 const lvl)
bool(* MkLogFormatF)(MK_RT mkrt, char *header, MK_SIZE const headerSize, MK_OBJN const obj, MK_STRN const caller, MK_I32 const debug, MK_STRN const fmt)
MK_OBJ(* MkMergeF)(MK_RT mkrt, MK_OBJ const obj)
void(* MkAllocDeleteF)(MK_RT mkrt, MK_TYP const type, MK_PTR ptr)
MK_OBJ(* MkConstructorF)(MK_RT mkrt, MK_TYP type, MK_PTR nat, MK_PTR lnk)
MK_OBJ(* MkDupF)(MK_RT mkrt, MK_OBJ const obj)
#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(...)
#define MkObjectHandleGet(...)
const struct MkObjectS * MK_OBJN
class-shortcut for const struct MkObjectS *, all const shortcut using the XX_YYYC syntax (only for pu...
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)
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 …
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) …
#define MkObjectLog(...)
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 …
#define MkLogC(...)
#define MkLogV(...)
static bool MkObjectIsNull(MK_OBJ const obj)
ckeck if the object is MK_NULL
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
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_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 MQ.
MK_OBJ MkRefDecrWithoutSelf_RT(MK_RT mkrt, MK_OBJ const obj)
ATOMIC operation -> unlink self with reference-count.
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
void(* MkSysExitF)(MK_RT mkrt, int isThread, int num) MK_NO_RETURN
exit syscall with ccmkkernel error plugin
MK_PTR(* MkSysCallocF)(size_t, size_t)
calloc syscall …
MK_PTR(* MkSysMallocF)(size_t)
malloc syscall …
#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
void MkSysPrintTrace_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_I32 skip, MK_I32 const num, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl)
backtrace syscall with ccmkkernel error plugin
MK_STRN MkSysGetTrace_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_I32 skip, MK_I32 const num, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl)
same as MkSysPrintTrace but return an string…
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 …
static bool MkSysStringIsNULL(MK_STRN str)
test if string is NULL or EMPTY …
#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)
static bool MkSysStringIsNotNULL(MK_STRN str)
test if string is NOT NULL or EMPTY …
#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
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_NO_RETURN void MkSysExit(MK_RT mkrt, int isThread, int num)
exit syscall with ccmkkernel error plugin
#define MkSysPrintTrace(...)
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
#define MkObjectDeleteCallF_ARGS
the libmkkernel::MkObjectDeleteCallF arguments with default names
#define MkObjectDeleteFreeF_ARGS
the libmkkernel::MkObjectDeleteFreeF arguments with default names
const struct MkRtExtS * MK_RTEXTN
class-shortcut for const struct MkRtExtS *, all const shortcut using the XX_YYYC syntax (only for pub...
static bool MkRtExtCheck(MK_MNGN mng)
check MkRtExtS -> libmkkernel::MkObjectS::signature …
static bool MkRtExtCheckO(MK_OBJN obj)
check MkRtExtS -> libmkkernel::MkObjectS::signature …
#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 MkRuntimeNext(MK_RT const rt)
get next instance from linked-list of MkRuntimeS type
#define MkRuntimeInstances()
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) …
#define MkRuntimeC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
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)
static bool MkRtCheckO(MK_OBJN obj)
check MkRuntimeS -> libmkkernel::MkObjectS::signature …
static void MkRuntimeSetIsSilent_RT(MK_RT mkrt, bool silent)
set the MkRuntimeS::isSilent value …
static bool MkRuntimeGetIsSilent(void)
get the MkRuntimeS::isSilent value …
static void MkRuntimeSetDebug(MK_I32 dbg)
set the MkRuntimeS::debug value …
static MK_STRN MkRuntimeGetLogfile(void)
get the MkRuntimeS::logfile value …
void MkRuntimeLog_RT(MK_RT mkrt, MK_RTN const rt, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the MkRuntimeC …
static MK_RT MkRuntimeGet(void)
return a initialized MkRuntimeRLS …
#define MkRT
#define MkRtSetup_ON_RT(o)
#define MK_ATTR_STATIC
#define MK_ATTR_RT_INSTANCE
#define MK_ATTR_INSTANCE
MK_RT MkRuntimeSetup(MK_RT const mkrt)
initialize MkRuntimeRLS …
#define MkThreadLocal
#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_PARSER_RT
#define MK_RT_ATTR_FORMAT_1
#define MK_RT_ATTR_FORMAT_2
#define MK_RT_CALL
void MkRuntimeCallbackDel(MkRuntimeCallbackS *cbdata)
delete a callback from the runtime …
#define MK_PARSER_RT_ONLY
#define MK_ATTR_RT_STATIC
struct libmkkernel::MkRuntimeCallbackS MkRuntimeCallbackS
keep callback related data …
#define MK_RT_ARGS
__thread struct MkRuntimeS MkRuntimeRLS
RLS …
#define MK_STATIC_RT
#define MK_RT_ARGS_ONLY
#define MK_INSTANCE_HDL(x)
#define MK_RT_REF
#define MkRT_O(o)
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)
MK_TYP MkTypeResolve_RT(MK_RT mkrt, MK_TYPN const typ)
resolve a new type
MK_TYP MkTypeDup2_RT(MK_RT mkrt, MK_TYPN const typ, MK_STRN const ident)
duplicate a type-type as duplicate from an existing type but with a new name …
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_OBJ MkObjectInstancesOfType_RT(MK_RT mkrt, MK_SIG typeSIG)
return the head-instance from a specific type defined by signature typeSIG …
array of libmkkernel::MK_STRN values …
define the storage-allocator function
MK_PTR alloc_data
data use for alloc_createF and alloc_deleteF
MkAllocCreateFLT alloc_createF
"calloc" the memory of the object
MkAllocDeleteF alloc_deleteF
"free" the memory of the object
binary data default format …
MK_BINN data
pointer to the binary data
MK_SIZE size
size of the data pointer
the final class of MkBufferS with 1024 byte ILS-Size …
the final class of MkBufferS with 256 byte ILS-Size …
the final class of MkBufferS with 64 byte ILS-Size …
The CLASS used to store a list of MkBufferS items into a flat array…
instance storage predefined
MK_NUM size
size of the MkBufferS::ils_data
MK_NUM offset
offset from start of MkBufferS to the start of MkBufferS::ils_data
The ABSTRACT-CLASS used to store a native-type-data-item defined by PRIMITIVE TYPE …
MK_NUM cursize
currently used size (always: cursize < size)
bool doBufferFree
should the data be freed? -> example: pBufferRefInit
MK_NUM size
the size of the data-segment
enum MkTypeE type
type of the item stored into the data-segment
the final class of MkBufferStreamS with 1024 byte ILS-Size …
the final class of MkBufferStreamS with 16384 byte ILS-Size …
the final class of MkBufferStreamS with 256 byte ILS-Size …
the final class of MkBufferStreamS with 64 byte ILS-Size …
The ABSTRACT-CLASS MkBufferStreamS is used for package-based serialized IO …
struct MkBufferStreamSaveS * busReadSave
struct MkBufferStreamSaveS * busWriteSave
a linked-list to opearate a storage of data items
MK_SIG signature
check if item is valid or not
struct MkCacheItemS * prev
link to the prev item
struct MkCacheItemS * next
link to the next item
bool doFree
should the item be freed?
MK_PTR data
data to cache
This is an circel storage of a linked-list connected with a "lock" at libmkkernel::MkCacheS …
struct MkCacheItemS * used
used cache items
MkCacheDF deleteF
function to delete 'data'
struct MkCacheItemS * free_last
free last cache item
MK_NUM num
MIN num items in cache.
MkCacheCF createF
function to create 'data'
MK_PTR createD
additional create data item
struct MkCacheItemS * free_first
free first cache item
MK_RT runtime
link to the runtime
extension-slot for MkErrorS …
signal-slot for print on error …
The data-type to store and handle the error-condition …
MK_OBJN format_of_error
used to format the error-message and as input for source_of_error
Base class for the extension technologie …
data type for process/thread identification …
bool ioIsPipe
startet in PIPE mode: client @ server @ ... and NOT in server --thread|spawn|fork
MK_IDNT val
process or thread handle
enum MkIdSE type
signal type of val data
Interface between ccmkkernel and the Operating-System …
MkSysWaitF MkSysWaitForThreadCB
wait for process to finish syscall with ccmkkernel error plugin
MkSysCallocF SysCalloc
calloc syscall …
MkSysWaitF MkSysWaitForProcessCB
wait for process to finish syscall with ccmkkernel error plugin
MkSysFreeF SysFree
free syscall …
MkSysReallocF SysRealloc
realloc syscall …
MkSysStrNDupF SysStrNDup
strndup syscall …
MkSysStrDupF SysStrDup
strdup syscall …
MkSysStrNCpyF SysStrNCpy
strdup strncpy …
enum MkErrorE(* SysSleep)(MK_OBJN const obj, unsigned int const sec)
sleep syscall with ccmkkernel error plugin
MkSysForkF SysFork
fork syscall …
MkSysMallocF SysMalloc
malloc syscall …
enum MkErrorE(* SysUSleep)(MK_OBJN const obj, unsigned int const usec)
usleep syscall with ccmkkernel error plugin
MkSysExitF MkSysExitCB
exit syscall with ccmkkernel error plugin
define a MkLogFileC object …
the protect is used to "protect" data set by pAllocCreate if the new object is later initialized with...
bool isLocal
has the object a local reference? - has been created by TLS or MkBufferCreateREF ?...
MK_TYP type
link to the object type
MK_RTEXT objRtExt
link to the kernel-runtime-extension the instance was created in …
MK_I32 selfRefCount
Delete the MkObjectS::self at the same MkObjectS::refCount as was created …
MK_I32 refCount
is THIS object in use?
MK_SIG signature
should be the SIGNATURE
MK_PTR self
link between the managed object and the object in the target-programming-language
MK_RT objRt
link to the kernel-runtime the instance was created in …
MK_PTR env
link to the object "runtime", set by selfCreate …
bool selfCreated
if the self was created by selfCreate than it is an INTERNAL object …
MK_HDL netHdl
if not-null the object was exported with MkObjectHandleGet
bool deleteCallbackCalled
Activate if object is on delete.
MkRtExtS - extend the MkRuntimeC with a library specific feature …
keep callback related data …
The MkRuntimeS provide a per-thread environment for ccmkkernel …
bool isSilent
write (false) or don't write (true) any message to MkLogFileC (default: stderr) (default: false) …
MK_I32 debug
set the debug-level of the context … Valid values are 0 <= debug-level <= 9 using 0 for no-debug and ...
MK_STR logfile
append to logfile, valid values are: stderr, stdout or a filename (default: stderr)
string data default format …
MK_NUM len
len of the string data
MK_STRN ptr
pointer to the string data
super-class-base, the MkTypeS using the super-macro-syntax for all non specific types …
MkTypeS - class known as typ or type is used as class-base for a Managed-Object-Technology (MOT) type...
MkLogF log
"log" object data to MkLogFileC (default: stderr)
MkSelfCreateF selfCreate
"create" the "self" pointer
bool noSelf
do NOT use the self feature -> used by MqFactoryS
MK_I32 delCbCnt
number of callback registered for this type
size_t typsize
the size of the this type self, used in MkTypeDup2
MkDestructorF destructor
delete an object
MK_SIG objmask
public object signatur-mask of the type-instance
MK_OBJ instances
linked list of instances belong to type
MK_I32 type_id
default "0" but "MkFactoryTypeAdd" need more
MkLogFormatF fLogFormat
format the log message of an object, used in "sLogVL_O"
MkDupF dup
"dup" constructor
MkMergeF merge
"merge" constructor
MkSelfUnlinkF selfUnlink
"unlink" the "self" pointer from MQ, example RUBY
MkSelfDeleteF selfDelete
"delete" the "self" pointer
MkDup2F dup2
"dup" constructor with "ident" initialisation
MkTypeInitF type_init
initializer for new type
size_t objsize
the size of the new object created with this type, used in malloc
MkResetF reset
"reset" the object to the "initial" state
MkToStringF toString
get the string representation
MK_SIG objsig
public st signatur of the type-instance
MkConstructorF constructor
create an object
union used to set or modify native data from an MkBufferS object …
MK_BOL BOL
1 byte boolean data
MK_DBL DBL
8 byte double data
MK_I32 I32
4 byte integer data
MK_I16 I16
2 byte short data
MK_I64 I64
8 byte integer data
MK_FLT FLT
4 byte float data
MK_I8 I8
1 byte byte data
a union for all data items supported by MkBufferS …
MK_ATO * A
atom for native data-types
MK_BIN B
arbitrary byte-array data
MK_LST L
list object type data
MK_STR S
C string like data (e.g. with a \0 at the end)
MK_STRN C
const C string like data (e.g. with a \0 at the end)