theKernel 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard - theLib
c - tcl - atl - 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// MARK_D ################################################################
18// -----------------------------------------------------------------------
19// documentation order
38
55
62
76
90
103
114
121
137
146
147// =========================================================================================
148// Config: configure definitions
149
150// define: META_HAS_THREAD
151// source: nhi1_config.h - set with the "configure" script
152// default: depend on how the LNG and libmkkernel was compiled
153// definition: 1. if defined the T)hread L)ocal S)torage is used.
154// 2. the "runtime" command-line-artgumen "mkrt" as FIRST parameter is set
155// 3. if "libmkkernel" was compiled with META_HAS_THREAD this have to be set as well.
156
157#ifndef META_HAS_THREAD
158 #error "META_HAS_THREAD was NOT defined, require 1 or 0, forget to include 'theKernel/c/compiler.mk' ?"
159#endif
160
161// =========================================================================================
162// Makefile: CPPFLAGS definitions
163
164// define: META_IGNORE_EXTERN
165// source: Makefile
166// default: not set
167// definition: If the source-code is direct used in an external library (example: C++)
168// (without dynamic linking) and this library should *not* export
169// the symbol's of libmsgque then the flag META_IGNORE_EXTERN have
170// to be set
171
172// define: META_COMPILE_AS_CC
173// source: Makefile, CPPFLAGS=-DMETA_COMPILE_AS_CC
174// target: "C" main header file like 'kernel_mk.h'
175// default: only set by "ccXXX" to compile "C" code as "C++" code with "namespace" support
176// definition: The preprocessor flag "META_COMPILE_AS_CC" is ONLY used together with the C++ compiler.
177// If the "META_COMPILE_AS_CC" flag is set, the C-code is not compiled into an independent library,
178// but translated directly into the C++ library together with the additional C++ code as C++ code in
179// the "libmkkernel" namespace. The difference is that the C code is additionally validated as "C++"
180// syntax and supports the C++ calling convention. Without "META_COMPILE_AS_CC" the C code is
181// compiled with "extern C" in the C++ compiler.
182//
183// The following changes are done:
184// 1. libmkkernel -> compile the code into "namespace libmkkernel"
185// 2. libmqmsgque -> compile the code into "namespace libmqmsgque"
186// 3. liblcconfig -> compile the code into "namespace liblcconfig"
187// 4. libsq3lite -> compile the code into "namespace libsq3lite"
188
189// =========================================================================================
190// Header: build control
191
192// define: MK_C_BUILD_DLL
193// source: Makefile
194// target: api-header and kernel_mk.h
195// default: set at build of the 'libmkkernel' library but NOT set for other libraries
196// definition: this define has two porpose:
197// 1. set the MK_EXTERN and MK_EXTERN_DATA to export of definition
198// 2. use the private definition of partly public struct's
199
200// =========================================================================================
201// Header: api definition
202
203// define: META_TIMEOUT_REF
204// source: api-header or Makefile
205// default: 900sec
206// definition: base timeout value - all other timeout will be calulated relative to this timeout
207
208#define META_TIMEOUT_REF 900 //< reference value for timeout… default: 15 min
209
210// define: META_HDL_USE__NONNULL__GCC_ATTRIBUTE
211// source: api-header or Makefile
212// target: api-header, check_mk.h
213// default: do NOT use "nonnull" attribute
214
215#define META_HDL_USE__NONNULL__GCC_ATTRIBUTE 0
216
217// define: META_ATTRIBUTE_SANITIZE
218// source: api-header or Makefile
219// target: msgque_mq.h
220// default: __attribute__((no_sanitize("address")))
221// definition: The C2GO compiler does NOT understand the 'no_sanitize("address")' attribute
222// -> use "-DMETA_ATTRIBUTE_SANITIZE=" at "env-build.sh: CGO_CFLAGS" to ignore it
223// The "sanitize" is set at "configure" with the "NHI1_SANITIZE" makefile definition and env-Variable
224#if !defined(META_ATTRIBUTE_SANITIZE)
225# define META_ATTRIBUTE_SANITIZE __attribute__((no_sanitize("address")))
226#endif
227
228// define: META_LOG_CLICKS
229// target: libmkkernel internal, logging additional clicks-timestamp
230// default: not set = no clicks-timestamp
231// action: add clicks-timestamp to output
232// definition: libmkkernel is using an verbose logging prefix to help debbugging
233// multi-thread/proc software - with META_LOG_CLICKS an additional
234// column with "clicks" data is added
235// attention: debug_mk.h also needs the "META_LOG_CLICKS", but is usually loaded before msgque_mq.h
236
237//#if !defined(META_LOG_CLICKS)
238// #define META_LOG_CLICKS
239//#endif
240
241// define: META_PERF_DEBUG
242// target: libmkkernel internal, disable some inline to create better code for callgrind
243// default: not set = no performance debugging
244// action: add performance debugging features
245// definition: inline code is embedded into calling code, this is faster BUT make it impossible
246// to analyse a single inlined function for performance optimization
247
248//#define META_PERF_DEBUG
249
250// define: META_DISABLE_LOG
251// target: command-line definition for compiling
252// default: not set = show logging based on MkDLogC and MkDLogV
253// action: hide logging macros
254// definition: logging is done using so called logging-macros. if META_DISABLE_LOG is defined the logging-macros
255// will dissappear.
256
257//#define META_DISABLE_LOG
258
259// define: META_DOXYGEN_USE_C_PRIVAT
260// target: the doxygen configuration files.
261// default: yes=1 - on compillation, no=0 on documentation if NOT defined as 1
262// action: add / hide code and documentation
263// definition: use/hide private code/documentation from doxygen docu and compilation
264// the private code/documentation is only use in "C" compiling and documantation,
265// use this switch to hide this code/documentation from non "C" languages
266
267#ifndef META_DOXYGEN_USE_C_PRIVAT
268# ifdef META_DOXYGEN_SHOULD_SKIP_THIS
269# define META_DOXYGEN_USE_C_PRIVAT 0
270# else
271# define META_DOXYGEN_USE_C_PRIVAT 1
272# endif
273#endif
274
275// define: META_STATIC
276// target: build and target, library and executable
277// default: not set -> do NOT force static linking
278// action: build (static) internal and external library
279// definition: ...
280
281#ifdef META_STATIC
282# undef MK_C_BUILD_DLL
283# define MK_C_BUILD_DLL
284# undef META_IGNORE_EXTERN
285# define META_IGNORE_EXTERN
286#endif
287
288/* ############################################################### */
289/* ### MARK_U ### */
290/* ### DEBUGGING ### */
291/* ### ### */
292/* ############################################################### */
293
294#define META_DEBUG_ALL -1 /* The C standard guarantees that assigning -1 sets all bits. */
295#define META_DEBUG_DEFAULT (1<<1)
296#define META_DEBUG_CACHE (1<<2)
297#define META_DEBUG_TYPE (1<<3)
298 // define: META_DEBUG_TYPE
299 // target: meta library with type support
300 // default: depend on META_DEBUG -> add simple type debug code
301 // action: add extra type debug code
302 // definition: META_DEBUG == 0 -> NO debug
303 // META_DEBUG != 0 -> ADD debug but invisible
304 // META_DEBUG == META_DEBUG_TYPE -> ADD debug AND add extra logging, (only for a type debugging session)
305#define META_DEBUG_SOCKET (1<<4)
306#define META_DEBUG_EVENT (1<<5)
307#define META_DEBUG_MEM (1<<6)
308 // define: META_DEBUG_MEM
309 // target: libmkkernel internal, cache_mq.c etc
310 // default: not set = use the cache
311 // action: disable reuse of memory
312 // definition: libmkkernel is using the CACHE to reuse a deleted instance and memory.
313 // To debug the memory this "reuse" is a problem.
314#define META_DEBUG_REFCOUNT (1<<7)
315#define META_DEBUG_ERROR (1<<8)
316
317// set META_DEBUG
318//#undef META_DEBUG
319//#define META_DEBUG META_DEBUG_TYPE
320
321#if META_DEBUG & META_DEBUG_TYPE
322# define META_DEBUG_TYPE__printV(...) printV(__VA_ARGS__)
323#else
324# define META_DEBUG_TYPE__printV(...)
325#endif
326
328#if META_DEBUG & META_DEBUG_ERROR
329# define META_DEBUG_ERROR_check() META_DEBUG_ERROR_checkO(NULL)
330# define META_DEBUG_ERROR_checkX(x) META_DEBUG_ERROR_checkO(MkOBJ(x))
331# define META_DEBUG_ERROR_checkO(o) if (MkErrorCheckE_0E()) MkDbgError_RT(MK_RT_CALL o, __func__);
332#else
333# define META_DEBUG_ERROR_check()
334# define META_DEBUG_ERROR_checkX(x)
335# define META_DEBUG_ERROR_checkO(o)
336#endif
337
338#if !defined(PARSE_C_HEADER_TO_META) && META_DEBUG
339# include "debug_mk.h"
340#endif
341
344#if defined(META_DISABLE_LOG)
345 # define MkDCheck(_debug)
346 # define MkDLogC(x,_debug,str)
347 # define MkDLogV(x,_debug,printfmt,...)
348 # define MkDProtect(_debug) if (MK_RT_REF.debug < _debug) return
349 # define MkDProtect2(_debug,_call) if (MK_RT_REF.debug < _debug) return
350#else
351
352 # define MkDDInit const MK_I32 __dbg = MK_RT_REF.debug
353 # define MkDDInitNum(n) const MK_I32 __dbg = n
354
358# define MkDCheck(_debug) if (unlikely(MK_RT_REF.debug >= _debug))
359# define MkDDCheck(_debug) if (unlikely(__dbg >= _debug))
361
367# define MkDLogC_O(fmtobj,_debug,str) \
368 if (unlikely(MK_RT_REF.debug >= _debug)) MkLogC(fmtobj,str,_debug,__func__)
369
370# define MkDLogC(x,_debug,str) MkDLogC_O(MkOBJ(x),_debug,str)
371
372# define MkDDLogC(x,_debug,str) \
373 if (unlikely(__dbg >= _debug)) MkLogC_4X(x,str,_debug,__func__)
375
382# define MkDLogV_O(fmtobj,_debug,printfmt,...) \
383 if (unlikely(MK_RT_REF.debug >= _debug)) MkLogV(fmtobj,__func__,_debug,printfmt,__VA_ARGS__)
384
385# define MkDLogV(x,_debug,printfmt,...) MkDLogV_O(MkOBJ(x),_debug,printfmt,__VA_ARGS__)
386
387# define MkDDLogV(fmtobj,_debug,printfmt,...) \
388 if (unlikely(__dbg >= _debug)) MkLogV_4M(fmtobj,__func__,_debug,printfmt,__VA_ARGS__)
390
391 # define MkDProtect(_debug) if (MK_RT_REF.debug < _debug) { \
392 MkLogV_2(fmtobj,MK_COLOR_ORANGE "Warning: ignore call to '%s' with '%d'" MK_COLOR_RESET "\n", __func__, debug); \
393 printSTACK_1(fmtobj); \
394 return; \
395 }
396 # define MkDProtect2(_debug,_call) if (MK_RT_REF.debug < _debug) { \
397 MkLogV_2(fmtobj,MK_COLOR_ORANGE "Warning: ignore call to '%s' from '%s' with '%d'" \
398 MK_COLOR_RESET "\n", __func__, _call, debug); \
399 printSTACK_1(fmtobj); \
400 return; \
401 }
402#endif
404// MkObjectC_Log_C_API
405
406/*****************************************************************************/
407/* */
408/* add feature - used to compile 'libmkkernel' library itself */
409/* */
410/*****************************************************************************/
411
412// DOKU: MkObjectS->selfRefCount
413#define META_USE_SELF_REFCOUNT
414
415/* ############################################################### */
416/* ### ### */
417/* ### PARSER ### */
418/* ### ### */
419/* ############################################################### */
420
421// META_P
425
426// [__parser__]
427#ifndef __has_parser__
428
434
436# define __parser__(...)
438# define __parser__define__(...)
440
442# define __parser__push__(...)
444# define __parser__pop__
445
447// END: local attributes
448
454
456# define __parser__global__(...)
458# define __parser__global__define__(...)
462# define __parser__global__push__(...)
464# define __parser__global__pop__
465
467// END: global attributes
468
469#else
470# include "parser_mk.h"
471#endif
472// END: !__has_parser__
473// [__parser__]
474
476// MkKernel_Parser_C_API
477
478/* ############################################################### */
479/* ### ### */
480/* ### START ### */
481/* ### ### */
482/* ############################################################### */
483
487
488// =========================================================================
491
492__parser__(library=MkKernel@internal@Mk);
493
494// GLOBAL: all "fmtobj" arguments become attribute "formatter"
495__parser__global__(formatter=fmtobj);
497#define MK_PARSER_fmtobj MK_OBJN fmtobj __parser__(default=NULL)
498
499// GLOBAL: all "macros" become hide
500__parser__global__(hide-rx=^Mk\w+_T$);
501
503// END: global __parser__ definition
504
507#if defined(_MSC_VER)
508
509 // Visual C++ Express-Edition
510
511 # define __attribute__(dummy)
512 # define __func__ __FUNCTION__
513 # define MK_CLRCALL __clrcall
514 # define MK_STDCALL __stdcall
515 # define MK_CDECL __cdecl
516
517 // helper
518 # ifndef PARSE_C_HEADER_TO_META
519 # define mk_inline static inline
520 # endif
521 //# define bool int
522 # define mk_unlink _unlink
523 # define mk_snprintf _snprintf
524
525 # define MK_ATTR_HOT ???
526 # define MK_ATTR_COLD ???
527
528#else // !_MSC_VER
529
530 // GCC
531
532 # define MK_CLRCALL
533 # define MK_STDCALL
534 # define MK_CDECL
535
536 // helper
537 # ifndef PARSE_C_HEADER_TO_META
538 # define mk_inline static inline
539 # endif
540 # define mk_unlink unlink
541 # define mk_snprintf snprintf
542
543 # define MK_ATTR_HOT __attribute__((hot))
544 # define MK_ATTR_COLD __attribute__((cold))
545
546#endif // _MSC_VER
547
548#if defined(_MANAGED)
549 # define MK_DECL MK_CLRCALL
550#elif defined(META_COMPILE_AS_CC)
551 # define MK_DECL MK_STDCALL
552#else
553 # define MK_DECL MK_CDECL
554#endif
555
556/* BEGIN_MK_C_DECLS should be used at the beginning of your declarations,
557 so that C++ compilers don't mangle their names. Use END_MK_C_DECLS at
558 the end of C declarations. */
559
560#undef BEGIN_MK_C_DECLS
561#undef END_MK_C_DECLS
562#if defined(META_COMPILE_AS_CC)
563# define BEGIN_MK_C_DECLS namespace libmkkernel {
564# define END_MK_C_DECLS }
565#elif defined(__cplusplus)
566# define BEGIN_MK_C_DECLS extern "C" {
567# define END_MK_C_DECLS }
568#else
569# define BEGIN_MK_C_DECLS /* empty */
570# define END_MK_C_DECLS /* empty */
571#endif
572
573/* Somewhere in the middle of the GCC 2.96 development cycle, we implemented
574 a mechanism by which the user can annotate likely branch directions and
575 expect the blocks to be reordered appropriately. Define __builtin_expect
576 to nothing for earlier compilers. */
577
578#if defined(_MSC_VER) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
579 #define likely(x) !!(x)
580 #define unlikely(x) !!(x)
581 #else
582 #define likely(x) __builtin_expect((x),1)
583 #define unlikely(x) __builtin_expect((x),0)
584#endif
585
586#ifndef PARSE_C_HEADER_TO_META
587 # ifndef _MSC_VER
588 # include <inttypes.h>
589 # endif
590 # ifdef __CYGWIN__
591 # include <windef.h>
592 # endif
593 # include <stdarg.h>
594 # include <string.h>
595 # include <stdio.h>
596 # include <time.h>
597 # ifndef _MSC_VER
598 # include <unistd.h>
599 # include <stdbool.h>
600 # endif
601#endif
602
603#if defined(_WIN32) && !defined(__CYGWIN__)
604 # ifndef PARSE_C_HEADER_TO_META
605 # include <winsock2.h>
606 # endif
607
609 # define mk_timeval timeval
610
612 struct mk_timezone {
613 int tz_minuteswest;
614 int tz_dsttime;
615 };
616
617#else
618 # define mk_timeval timeval
619 # define mk_timezone timezone
620 struct mk_timeval;
621 struct mk_timezone;
622#endif
623
625#define MK_UNUSED __attribute__((unused))
627#define MK_NO_RETURN __attribute__((noreturn))
628#define MK_UNREACHABLE __builtin_unreachable()
629// https://stackoverflow.com/questions/20110291/use-cases-of-the-gcc-artificial-function-attribute
630#define MK_ARTIFICIAL __attribute__((__artificial__))
631// used for "pseudo" function declarartion (to support tags-file magic)
632#define MK_DEPRECATED __attribute__ ((deprecated))
633// disable optimization to get better code for debugging
634#define MK_OPTIMIZE_0 __attribute__((optimize("O0")))
635
636#ifndef PARSE_C_HEADER_TO_META
637 # include <assert.h>
638#endif
639
641// END: native compiler definition
642
644// END: MkKernel_Compiler_C_API
645
646// Namespace for the 'ccmkkernel' API …
648
649// ==============================================================================================
652
654typedef void* MK_MACRO_TYP;
655
661
694__parser__(ignore)
695#define MK_NULL NULL
696
698#define MK_NULL_YES true
699
701#define MK_NULL_NO false
702
706__parser__(ignore)
707#define MK_NULL_STR "MK_NULL"
708
712__parser__(ignore)
713#define MK_NULL_STR_LEN strlen(MK_NULL_STR)
714
722__parser__(ignore)
723mk_inline bool MK_NULL_STR_CHECK(char const * const __str, const long int __len) {
724 return ((__str) ? ( (__len) == MK_NULL_STR_LEN && strcmp((__str),MK_NULL_STR)==0 ) : true);
725}
726
728__parser__(ignore)
729mk_inline bool MK_NULL_STR_CHECK_1(char const * const __str) {
730 return ((__str) ? strcmp((__str),MK_NULL_STR)==0 : true);
731}
732
734__parser__(ignore)
735mk_inline bool MK_NULL_STR_OR_EMPTY_CHECK_1(char const * const __str) {
736 return ((__str) ? (__str)[0] == '\0' || strcmp((__str),MK_NULL_STR)==0 : true);
737}
738
740// name: MK_NULL
741
743// MkKernel_Compiler_C_API
744
745// ==============================================================================================
889#if META_HAS_THREAD
892 # define MkThreadLocal __thread
893 # define MK_RT_SHIFT 1
894 # define MK_RT_ARGS_ONLY MK_RT mkrt
895 # define MK_RT_ARGS MK_RT_ARGS_ONLY,
896 # define MK_RT_CALL_ONLY mkrt
897 # define MK_RT_CALL MK_RT_CALL_ONLY,
898 # define MK_RT_CALL_O(o) MkRT_O(o),
899 # define MK_RT_CALL_X(x) MkRT_X(x),
900 # define MK_RT_CALL_NULL_ONLY MkRT
901 # define MK_RT_CALL_NULL MK_RT_CALL_NULL_ONLY,
902 # define MK_RT_NULL NULL,
903 # define MK_RT_PTR mkrt
904 # define MK_RT_REF (*mkrt)
905 # define MK_RT_REF_NULL (MkRuntimeRLS)
906 # define MK_RT_UNUSED MK_UNUSED
907 # define MK_RT_CALL_RT(ptr) ptr,
908 # define MK_PARSER_RT_ONLY MK_RT_ARGS_ONLY __parser__(internal,default=N#RUNTIME)
909 # define MK_PARSER_RT MK_PARSER_RT_ONLY,
911#else
914 # define MkThreadLocal
915 # define MK_RT_SHIFT 0
916 # define MK_RT_ARGS_ONLY void
917 # define MK_RT_ARGS
918 # define MK_RT_CALL_ONLY
919 # define MK_RT_CALL
920 # define MK_RT_CALL_O(o)
921 # define MK_RT_CALL_X(x)
922 # define MK_RT_CALL_NULL_ONLY
923 # define MK_RT_CALL_NULL
924 # define MK_RT_NULL
925 # define MK_RT_PTR (&MkRuntimeRLS)
926 # define MK_RT_REF (MkRuntimeRLS)
927 # define MK_RT_REF_NULL (MkRuntimeRLS)
928 # define MK_RT_UNUSED
929 # define MK_RT_CALL_RT(ptr)
930 # define MK_PARSER_RT_ONLY void
931 # define MK_PARSER_RT
933#endif
934
935# define MK_RT_ATTR_FORMAT_1 __attribute__((format (printf, 1+MK_RT_SHIFT, 2+MK_RT_SHIFT)));
936# define MK_RT_ATTR_FORMAT_2 __attribute__((format (printf, 2+MK_RT_SHIFT, 3+MK_RT_SHIFT)))
937# define MK_RT_ATTR_FORMAT_4 __attribute__((format (printf, 4+MK_RT_SHIFT, 5+MK_RT_SHIFT)))
938
939// nonnull for runtime yesORno? → problem is C# (and propably go), because runtime is a C feature and getting a nonnull C Pointer
940// for every API call in C# is expensive. solution? → allow NULL and resolve the mkrt pointer in C
941# define __MK_ATTR_RT_RUNTIME // empty
942
943#if META_HDL_USE__NONNULL__GCC_ATTRIBUTE == 1
944 // with "nonnull" on HDL the assert disable itself
945 # define __MK_ATTR_RT_INSTANCE __attribute__((nonnull(1+MK_RT_SHIFT)))
946 # define __MK_ATTR_INSTANCE __attribute__((nonnull(1)))
947 # define MK_INSTANCE_HDL(x)
948#else
949 # define __MK_ATTR_RT_INSTANCE
950 # define __MK_ATTR_INSTANCE
951 # define MK_INSTANCE_HDL(x) assert(x!=NULL)
952#endif
953
954// ".h" file
955#define MK_ATTR_INSTANCE __MK_ATTR_INSTANCE
956#define MK_ATTR_RT_INSTANCE __MK_ATTR_RT_RUNTIME __MK_ATTR_RT_INSTANCE
957#define MK_ATTR_STATIC __parser__(static)
958#define MK_ATTR_RT_STATIC __MK_ATTR_RT_RUNTIME __parser__(static) // in func: MQ_STATIC_RT
959
960// ".c" file
961#define MK_INSTANCE_RT_X(x) MK_INSTANCE_HDL(x); MkRtSetup_XN_RT(x); META_DEBUG_ERROR_checkX(x)
962#define MK_INSTANCE_RT_X_NULL(x) MkRtSetup_X_RT(x); META_DEBUG_ERROR_checkX(x)
963#define MK_INSTANCE_RT_O(o) MK_INSTANCE_HDL(o); MkRtSetup_ON_RT(o); META_DEBUG_ERROR_checkO(o)
964#define MK_INSTANCE_RT_O_NULL(o) MkRtSetup_O_RT(o); META_DEBUG_ERROR_checkO(o)
965#define MK_DESTRUCTOR_RT_X(c,x) MK_INSTANCE_HDL(x); \
966 if (!MkCheckNN(c,x)) return; /* do NOT delete an invalid pointer */ \
967 MkRtSetup_XN_RT(x); META_DEBUG_ERROR_check()
968#define MK_STATIC_RT MkRtSetup_NULL_RT; META_DEBUG_ERROR_check()
969
970// example: probably future enhancement on class/method definition
971// #define MK_INLINE_RT_STATIC(func,...) mk_inline MK_ATTR_RT_STATIC func##_RT (MK_PARSER_RT __VA_ARGS__)
972
974// MkRuntimeC_Interface_C_API
975
976// MARK_O
977#ifndef PARSE_C_HEADER_TO_META
978 # include "gen/kernel_overload_mk.h"
979#endif
980
1047/*****************************************************************************/
1048/* */
1049/* compiler and os definition */
1050/* */
1051/*****************************************************************************/
1052
1055
1056// on windows using the 'native' compiler 'cl.exe' we have to define some missing symbols
1057#if defined(_MSC_VER) && defined(_DLL)
1058 # undef PIC
1059 # define PIC
1060 # undef DLL_EXPORT
1061 # define DLL_EXPORT
1062#endif
1063
1064#ifdef META_IS_WINDOWS
1065 # define META_DIR_SEPARATOR '\\'
1066 # define META_EOL "\r\n"
1067#else
1068 # define META_DIR_SEPARATOR '/'
1069 # define META_EOL "\n"
1070#endif
1071
1072// BEGIN-HEADER - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1073
1074// If the source of libmkkernel is direct used in an external library
1075// (without dynamic linking) and this library should *not* export
1076// the symbol's of libmkkernel then the flag META_IGNORE_EXTERN have
1077// to be set
1078#undef MK_EXTERN
1079#if defined(META_IGNORE_EXTERN)
1080# define MK_EXTERN
1081#elif defined(PIC)
1082 // does we build a DLL ?
1083# if defined(DLL_EXPORT)
1084 // does we build the libmkkernel library ?
1085# if defined(MK_C_BUILD_DLL)
1086# define MK_EXTERN __declspec(dllexport)
1087# else
1088# define MK_EXTERN __declspec(dllimport)
1089# endif
1090# else
1091 // no DLL - architecture specific extern specifier
1092# define MK_EXTERN __attribute__ ((visibility("default")))
1093# endif
1094#else
1096# define MK_EXTERN
1097#endif
1098
1099// external data lookup
1100#undef MK_EXTERN_DATA
1101#if defined(META_PRIVATE)
1102# define MK_EXTERN_DATA extern
1103#elif defined(META_IGNORE_EXTERN)
1104# define MK_EXTERN_DATA extern
1105#elif defined(PIC)
1106 // does we build a DLL ?
1107# if defined(DLL_EXPORT)
1108 // does we build the libmkkernel library ?
1109# if defined(MK_C_BUILD_DLL)
1110# define MK_EXTERN_DATA __declspec(dllexport)
1111# else
1112# define MK_EXTERN_DATA __declspec(dllimport)
1113# endif
1114# else
1115 // no DLL - architecture specific extern specifier
1116# define MK_EXTERN_DATA __attribute__ ((visibility("default"))) extern
1117# endif
1118#else
1119# define MK_EXTERN_DATA extern
1120#endif
1121
1122// END-HEADER - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1123
1125#define MK_CPPXSTR(s) MK_CPPSTR(s)
1127#define MK_CPPSTR(s) #s
1129#define MK_CONCAT(a,b) a ## b
1130#define MK_CONCAT2(a,b) MK_CONCAT(a,b)
1131#define MK_CONCAT3(a,b,c) a ## b ## c
1132
1134#ifdef HAVE_STPCPY
1135 #define mk_append_fix_str(t,s) t=stpcpy(t,s)
1136#else
1137 #define mk_append_fix_str(t,s) t=strcpy(t,s)+sizeof(s)-1
1138#endif
1139
1141#define mk_bit_compare(t,f) (t&f)==f
1142
1144// MkKernel_Compiler_C_API
1145
1146/* MARK_T ********************************************************************/
1147/* */
1148/* types/generic */
1149/* */
1150/*****************************************************************************/
1151
1155
1156struct MkErrorS;
1157struct MkBufferListS;
1158struct MkBufferS;
1159union MkBufferU;
1160struct MkObjectS;
1161struct MkAllocS;
1162struct MkTypeS;
1163struct MkTypeDefS;
1164
1166#define MK_ALFA '@'
1168#define MK_ALFA_STR ((MkStringR){1,"@"})
1169
1170// ----------------------------------------------------------------------------------
1171
1174
1176__parser__(type=ME_NB1_MK_BOL:"1 byte 'boolean' data-type")
1177typedef unsigned char MK_BOL;
1178
1179// hint: bool into printf %B → https://stackoverflow.com/questions/17307275/what-is-the-printf-format-specifier-for-bool
1181__parser__(type=ME_NB0_MK_BOOL:"'boolean' data-type":primary)
1182typedef bool MK_BOOL;
1183#define bool2str(_bool) (_bool?"true":"false")
1184
1186
1187// ----------------------------------------------------------------------------------
1188
1191
1193__parser__(type=ME_NI1_MK_I8:"1 byte 'byte' data-type")
1194typedef signed char MK_I8;
1196__parser__(type=ME_NI2_MK_I16:"2 byte 'short integer' data-type":primary:int16_t)
1197typedef signed short int MK_I16;
1199__parser__(type=ME_NI4_MK_I32:"4 byte 'integer' data-type":primary:int32_t)
1200typedef signed int MK_I32;
1202#if defined(_MSC_VER)
1203 typedef __int64 MK_I64;
1204 typedef long MK_SIZE;
1205#else
1206 __parser__(type=ME_NI8_MK_I64:"8 byte 'wide integer' data-type":primary:int64_t)
1207 typedef signed long long MK_I64;
1208#endif
1210__parser__(type=ME_NIL_MK_LONG:"4/8 byte 'long' data-type":primary)
1211// TODO → make MK_LONG network save
1212typedef long MK_LONG;
1213
1215
1216// ----------------------------------------------------------------------------------
1217
1220
1221__parser__(type=ME_NU1_MK_U8:"1 byte 'unsigned byte' data-type":primary:uint8_t)
1222typedef unsigned char MK_U8;
1223__parser__(type=ME_NU2_MK_U16:"2 byte 'unsigned short' data-type":primary:uint16_t)
1224typedef unsigned short MK_U16;
1225__parser__(type=ME_NU4_MK_U32:"4 byte 'unsigned integer' data-type":primary:uint32_t)
1226typedef unsigned int MK_U32;
1227__parser__(type=ME_NU8_MK_U64:"8 byte 'unsigned wide' data-type":primary:uint64_t)
1228typedef unsigned long long MK_U64;
1229//__parser__(type=ME_NUX_MK_UXN:"min 8 byte 'unsigned long long' data-type":primary)
1230//typedef unsigned long long MK_UXN;
1231__parser__(type=ME_NUL_MK_ULN:"8 byte 'unsigned long' data-type":primary)
1232typedef unsigned long MK_ULN;
1234
1235// ----------------------------------------------------------------------------------
1236
1239
1241__parser__(type=ME_NF4_MK_FLT:"4 byte 'float' data-type":primary)
1242typedef float MK_FLT;
1244__parser__(type=ME_NF8_MK_DBL:"8 byte 'double' data-type":primary)
1245typedef double MK_DBL;
1246
1248
1249// ----------------------------------------------------------------------------------
1250
1254
1265__parser__(type=ME_NIH_MK_HDL:"handle data-type")
1266// also change: MqHigh_jv.c=jint
1267typedef int32_t MK_HDL;
1268#define MK_HDL_REF_S3(__prefix) __prefix ## NI4
1269#define MK_HDL_REF_S1(__prefix) __prefix ## I32
1270#define MK_HDLT MK_I32T
1271
1272// OLD: internal \b hdl used in uplevel-programming-language-shell to store a pointer:
1273// OLD: \li \e java uses \b jlong equal to \RMKNS{LONG}
1274// OLD: \li \e csharp uses \b IntPtr equal to \RMKNS{PTR}
1275// OLD: typedef MK_PTRB *MK_HDL;
1276
1278
1279// ----------------------------------------------------------------------------------
1280
1283
1284__parser__(type=ME_NIL_MK_SIZE:"long byte 'size' datay-type")
1285// choose "long" because it have to fit a pointer-diff (eg: ptr1-ptr2) without cast
1286typedef long MK_SIZE;
1288__parser__(type=ME_RUA_MkBufferAtomU:"atomic native data buffer type")
1289typedef union MkBufferAtomU MK_ATO;
1293__parser__(type=ME_NI4_MK_NUM)
1294typedef int32_t MK_NUM;
1295#define MK_FORMAT_N "%i"
1296
1298__parser__(type=ME_NI4_MK_DBG:"debug-level data-type")
1299typedef int MK_DBG;
1300
1359__parser__(type=ME_NU4_MK_SIG)
1360typedef unsigned int MK_SIG;
1361
1363
1364// ----------------------------------------------------------------------------------
1365
1369__parser__(type=ME_NIL_MK_TIME_T:"time [sec] data-type")
1370typedef time_t MK_TIME_T;
1371#define MK_FORMAT_TIME "%li"
1372#define MK_TIME ((MK_TIME_T)time(NULL))
1373#define MK_TIME_MAX (365*24*60*60)
1375
1376// ----------------------------------------------------------------------------------
1377
1380
1381// attention: "google go" can not uses nested typedef's -> use "#define" for the basic types
1382
1384__parser__(type=ME_PVB_MK_PTRB:"pointer type data-type")
1385typedef void MK_PTRB;
1386
1388__parser__(type=ME_PVX_MK_PTR:"generic pointer data-type":primary)
1391__parser__(type=ME_PVN_MK_PTRN:"const generic pointer data-type":primary)
1392typedef const MK_PTRB *MK_PTRN;
1394__parser__(type=ME_PCX_MK_CCP:"class constructor/destructor data type")
1397__parser__(type=ME_PAX_MK_CBP:"generic pointer to call-back data")
1400__parser__(type=ME_CXC_MK_MNG:"managed object pointer; datatype will be checked at runtime")
1403__parser__(type=ME_CXN_MK_MNGN:"const - a managed object pointer; datatype will be checked at runtime")
1404typedef const MK_PTRB *MK_MNGN;
1406__parser__(type=ME_PEX_MK_EXP:"target language exception-class-object")
1407typedef MK_PTRB const *MK_EXP;
1409__parser__(type=ME_CXC_MkExceptionC:"target language library-exception-class-object")
1411
1413
1414// ----------------------------------------------------------------------------------
1415
1418
1420__parser__(type=ME_PLB_MK_LSTB:"list type data-type")
1421typedef unsigned char MK_LSTB;
1422
1424__parser__(type=ME_PLX_MK_LST:"list pointer data-type")
1426
1428
1429// ----------------------------------------------------------------------------------
1430
1433
1435__parser__(type=ME_PBB_MK_BINB:"byte-array type data-type")
1436typedef unsigned char MK_BINB;
1437
1439__parser__(type=ME_PBX_MK_BIN:"byte-array pointer data-type":primary)
1441
1443__parser__(type=ME_PBN_MK_BINN:"const byte-array pointer data-type":primary)
1444typedef MK_BINB const *MK_BINN;
1445
1447
1448// ----------------------------------------------------------------------------------
1449
1452
1454__parser__(type=ME_PSB_MK_STRB:"string type data-type")
1455typedef char MK_STRB;
1456
1458__parser__(type=ME_PSX_MK_STR:"string pointer data-type":primary)
1460
1462__parser__(type=ME_PSN_MK_STRN:"constant string pointer data-type":primary)
1463typedef const MK_STRB *MK_STRN;
1464
1466__parser__(type=ME_ASN_MK_STRN_A:"ARRAY of MK_STRN")
1467typedef struct {
1470} MK_STRN_A;
1471
1472__parser__(ignore)
1474
1476__parser__(type=ME_PFX_MK_FST:"constant 'printf' format string")
1477typedef MK_STRB const *MK_FST;
1478
1480
1481// ----------------------------------------------------------------------------------
1482
1485__parser__(type=ME_PVX_MK_NAT_OBJECT:"target language object pointer")
1486typedef void* MK_NAT_OBJECT;
1487__parser__(type=ME_PVX_MK_NAT_LIST:"target language list pointer")
1488typedef void* MK_NAT_LIST;
1490
1491// ----------------------------------------------------------------------------------
1492
1494// MkKernel_Type_C_API
1495
1496/* MARK_C ********************************************************************/
1497/* */
1498/* class types */
1499/* */
1500/*****************************************************************************/
1501
1502// BEGIN-ShortDef - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1503
1507 __parser__(type=ME_CCC_MkObjectC:"MkObjectC class handle":primary)
1508 typedef struct MkObjectS * MK_OBJ;
1510 __parser__(type=ME_CCN_MkObjectC:"const - MkObjectC class handle":primary)
1511 typedef const struct MkObjectS * MK_OBJN;
1513 __parser__(ignore)
1514 typedef struct MkObjectS MK_OBJR;
1516// MkObjectC_Class_C_API
1517
1521 __parser__(type=ME_CCC_MkBufferC:"MkBufferC class handle":primary)
1522 typedef struct MkBufferS * MK_BUF;
1524 __parser__(type=ME_CCN_MkBufferC:"const - MkBufferC class handle":primary)
1525 typedef const struct MkBufferS * MK_BUFN;
1527 __parser__(ignore)
1528 typedef struct MkBufferS MK_BUFR;
1530// MkBufferC_Class_C_API
1531
1535 __parser__(type=ME_CCC_MkBufferStreamC:"MkBufferStreamC class handle":primary)
1536 typedef struct MkBufferStreamS * MK_BUS;
1538 __parser__(type=ME_CCN_MkBufferStreamC:"const - MkBufferStreamC class handle":primary)
1539 typedef const struct MkBufferStreamS * MK_BUSN;
1541 __parser__(ignore)
1542 typedef struct MkBufferStreamS MK_BUSR;
1544// MkBufferStreamC_Class_C_API
1545
1549 __parser__(type=ME_CCC_MkBufferListC:"MkBufferListC class handle":primary)
1550 typedef struct MkBufferListS * MK_BFL;
1552 __parser__(type=ME_CCN_MkBufferListC:"const - MkBufferListC class handle":primary)
1553 typedef const struct MkBufferListS * MK_BFLN;
1555 __parser__(ignore)
1556 typedef struct MkBufferListS MK_BFLR;
1558// MkBufferListC_Class_C_API
1559
1563 __parser__(type=ME_CCC_MkLogFileC:"MkLogFileC class handle":primary)
1564 typedef struct MkLogFileS * MK_LFL;
1566 __parser__(type=ME_CCN_MkLogFileC:"const - MkLogFileC class handle":primary)
1567 typedef const struct MkLogFileS * MK_LFLN;
1569 __parser__(ignore)
1570 typedef struct MkLogFileS MK_LFLR;
1572// MkLogFileC_Class_C_API
1573
1577 __parser__(type=ME_CCC_MkErrorC:"MqErrorC class handle":primary)
1578 typedef struct MkErrorS * MK_ERR;
1580 __parser__(type=ME_CCN_MkErrorC:"const - MqErrorC class handle":primary)
1581 typedef const struct MkErrorS * MK_ERRN;
1583 __parser__(ignore)
1584 typedef struct MkErrorS MK_ERRR;
1586// MkErrorC_Class_C_API
1587
1591 __parser__(internal,type=ME_CCC_MkExtensionC:"abstract class for the extension technology":internal)
1592 typedef struct MkExtensionS * MK_EXT;
1594 __parser__(internal,type=ME_CCN_MkExtensionC:"const - abstract class for the extension technology":internal)
1595 typedef const struct MkExtensionS * MK_EXTN;
1597 __parser__(ignore)
1598 typedef struct MkExtensionS MK_EXTR;
1600// MkExtensionC_Class_C_API
1601
1605 __parser__(internal,type=ME_CCC_MkErrExtC:"final class for the MkErrorS extention technology":internal)
1606 typedef struct MkErrExtS * MK_ERREXT;
1608 __parser__(internal,type=ME_CCN_MkErrExtC:"const - final class for the MkErrorS extention technology":internal)
1609 typedef const struct MkErrExtS * MK_ERREXTN;
1611 __parser__(ignore)
1612 typedef struct MkErrExtS MK_ERREXTR;
1614// MkErrExtC_Class_C_API
1615
1619 __parser__(internal,type=ME_CCC_MkRtExtC:"final class for the MkRuntimeS extention technology":internal)
1620 typedef struct MkRtExtS * MK_RTEXT;
1622 __parser__(internal,type=ME_CCN_MkRtExtC:"const - final class for the MkRuntimeS extention technology":internal)
1623 typedef const struct MkRtExtS * MK_RTEXTN;
1625 __parser__(ignore)
1626 typedef struct MkRtExtS MK_RTEXTR;
1628// MkRtExtC_Class_C_API
1629
1633 __parser__(type=ME_CCC_MkRuntimeC:"runtime singleton class object":primary)
1634 typedef struct MkRuntimeS * MK_RT;
1636 __parser__(type=ME_CCN_MkRuntimeC:"const - runtime singleton class object":primary)
1637 typedef const struct MkRuntimeS * MK_RTN;
1639 __parser__(ignore)
1640 typedef struct MkRuntimeS MK_RTR;
1642// MkRuntimeC_Class_C_API
1643
1647 __parser__(internal,type=ME_CCC_MkTypeC:"a managed object class type !base! pointer":internal)
1648 typedef struct MkTypeS * MK_TYP;
1650 __parser__(internal,type=ME_CCN_MkTypeC:"const - a managed object class type !base! pointer":internal)
1651 typedef const struct MkTypeS * MK_TYPN;
1653 __parser__(ignore)
1654 typedef struct MkTypeS MK_TYPR;
1656// MkTypeC_Class_C_API
1657
1658// END-ShortDef - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1659
1662__parser__(type=ME_CXC_MK_BAC:"a list of 'buffer' as last argument in function")
1663typedef struct MkBufferListS *MK_BAC;
1664
1667__parser__(type=ME_CXN_MK_BAC:"const - a list of 'buffer' as last argument in function")
1668typedef const struct MkBufferListS *MK_BACN;
1669
1670// --------------------------------------------------------------------
1671// binary
1672
1678
1679__parser__push__(hide);
1680
1684__parser__(reference)
1685typedef struct {
1688} MkBinaryR;
1689
1693 return (MkBinaryR) {size, data};
1694}
1695
1699 return bin.data == NULL;
1700}
1701
1705 if (start>bin.size)
1706 return (const MkBinaryR) {0, NULL};
1707 else
1708 return (const MkBinaryR) {start+wide>bin.size?bin.size-start:wide, bin.data+start};
1709}
1710
1714
1718
1722 return bin.data;
1723}
1724
1728 return bin.size;
1729}
1730
1732
1734// MkKernel_Binary_C_API
1735
1741
1742__parser__push__(hide);
1743
1747// [MkStringR]
1748__parser__(reference)
1749typedef struct {
1752} MkStringR;
1753// [MkStringR]
1754
1757mk_inline void MkStringLog_RT ( MK_PARSER_RT MkStringR const str, MK_STRN func ) ;
1758
1762 return (MkStringR) {(len>0?len:(str?(MK_NUM)strlen(str):0)), str};
1763}
1764
1768 return (MkStringR) {str?(MK_NUM)strlen(str):0, str};
1769}
1770
1781 if (len < 0) len = strR.len;
1782 if (start > strR.len) {
1783 return MkStringCreate(0,NULL);
1784 } else if ((start+len) > strR.len) {
1785 return MkStringCreate(strR.len-start,strR.ptr+start);
1786 } else {
1787 return MkStringCreate(len,strR.ptr+start);
1788 }
1789}
1790
1793mk_inline void MkStringSplit ( MkStringR strR, MK_NUM *len_out, MK_STRN *str_out ) {
1794 assert(len_out != NULL);
1795 assert(str_out != NULL);
1796 *len_out = strR.len; *str_out = strR.ptr;
1797}
1798
1802
1806 return str.ptr;
1807}
1808
1812 return str.len;
1813}
1814
1823 return ((strR.ptr) && (strR.len) == MK_NULL_STR_LEN && strcmp((strR.ptr),MK_NULL_STR)==0);
1824}
1825
1827
1829// - MkKernel_String_C_API
1830
1831/*****************************************************************************/
1832/* */
1833/* enum definitions */
1834/* */
1835/*****************************************************************************/
1836
1839
1840__parser__push__(doc-group=Enum);
1841
1844
1851// [MkErrorE]
1857// [MkErrorE]
1858
1859// BEGIN-MkErrorE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1860
1863__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
1865
1868__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
1871 return (MK_I32) value;
1872}
1873
1876__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc)
1877MK_EXTERN enum MkErrorE MkErrorE_FromInt ( MK_I32 const value, enum MkErrorE * value_out ) MK_ATTR_STATIC ;
1878
1879// END-MkErrorE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1880
1881// additional attribute for MkErrorE_FromInt - this function return TWO errors 1) return and 2) the value_out
1882__parser__global__(MkErrorE_FromInt:error-ignore=2);
1883
1885// MkErrorE
1886
1889
1896// [MkTimeoutE]
1897__parser__(enum-accept-integer=long)
1919// [MkTimeoutE]
1920
1921// BEGIN-MkTimeoutE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1922
1925__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
1927
1930__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
1933 return (MK_I32) value;
1934}
1935
1938__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc)
1940
1941// END-MkTimeoutE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1942
1944
1947
1949__parser__(internal)
1951 MK_NO = 0,
1953};
1954
1955// BEGIN-MkBoolE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1956
1959__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
1961
1964__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
1967 return (MK_I32) value;
1968}
1969
1972__parser__(internal,no-rpc,prefix=EnumFunc)
1973MK_EXTERN enum MkErrorE MkBoolE_FromInt ( MK_I32 const value, enum MkBoolE * value_out ) MK_ATTR_STATIC ;
1974
1975// END-MkBoolE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1976
1978
1981
1986// [MkNativeIsE]
1987__parser__(internal)
1994// [MkNativeIsE]
1995
1996// BEGIN-MkNativeIsE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
1997
2000__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
2002
2005__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
2008 return (MK_I32) value;
2009}
2010
2013__parser__(internal,no-rpc,prefix=EnumFunc)
2015
2016// END-MkNativeIsE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
2017
2019// MkNativeIsE
2020
2023
2025#define MK_TYPE_IS_1_I8E (1<<0)
2026
2028#define MK_TYPE_IS_2_I8E (1<<1)
2029
2031#define MK_TYPE_IS_4_I8E (1<<2)
2032
2034#define MK_TYPE_IS_8_I8E (1<<3)
2035
2037#define MK_TYPE_IS_NATIVE ( MK_TYPE_IS_1_I8E | MK_TYPE_IS_2_I8E | \
2038 MK_TYPE_IS_4_I8E | MK_TYPE_IS_8_I8E )
2039
2041#define MK_TYPE_SHIFT 4
2042
2050// [MkTypeE]
2063// [MkTypeE]
2064
2065// BEGIN-MkTypeE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
2066
2069__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
2071
2074__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
2077 return (MK_I32) value;
2078}
2079
2082__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc)
2083MK_EXTERN enum MkErrorE MkTypeE_FromInt ( MK_I32 const value, enum MkTypeE * value_out ) MK_ATTR_STATIC ;
2084
2085// END-MkTypeE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
2086
2088// MkTypeE
2089
2091
2093// MkKernel_Enum_C_API
2094
2152
2154__parser__(ignore)
2163 MK_BINB B[8];
2164 MK_BINB B8[8];
2165 MK_BINB B4[4];
2166 MK_BINB B2[2];
2167 MK_BINB B1[1];
2168
2169#if defined(__cplusplus)
2170 MkBufferAtomU() : I64(0L) {};
2171 MkBufferAtomU(MK_I8 val) : I8(val) {};
2172 MkBufferAtomU(MK_BOL val) : BOL(val) {};
2173 MkBufferAtomU(MK_I16 val) : I16(val) {};
2174 MkBufferAtomU(MK_I32 val) : I32(val) {};
2175 MkBufferAtomU(MK_I64 val) : I64(val) {};
2176 MkBufferAtomU(MK_FLT val) : FLT(val) {};
2177 MkBufferAtomU(MK_DBL val) : DBL(val) {};
2178#endif
2179};
2180
2189__parser__(ignore)
2197
2200#define MkType_O MK_BOL
2201#define MkType_Y MK_I8
2202#define MkType_S MK_I16
2203#define MkType_I MK_I32
2204#define MkType_W MK_I64
2205#define MkType_F MK_FLT
2206#define MkType_D MK_DBL
2207#define MkType_C MK_STRN
2208#define MkType_B MK_BIN
2209#define MkType_U MK_BUF
2210#define MkType_L MK_BFL
2212
2214// MkKernel_PrimitiveType_C_API
2215
2235
2236
2237// =============================================================================================
2238
2241
2243typedef uintptr_t MK_IDNT;
2244
2245// also: theKernel/cs/libmkkernel.cs
2247__parser__(hide)
2253
2254// BEGIN-MkIdSE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
2255
2258__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
2260
2263__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
2266 return (MK_I32) value;
2267}
2268
2271__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc)
2272MK_EXTERN enum MkErrorE MkIdSE_FromInt ( MK_I32 const value, enum MkIdSE * value_out ) MK_ATTR_STATIC ;
2273
2274// END-MkIdSE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
2275
2276// also: theKernel/cs/libmkkernel.cs
2283__parser__(hide)
2290
2292
2293/*****************************************************************************/
2294/* */
2295/* cache */
2296/* */
2297/*****************************************************************************/
2298
2302
2303__parser__(ignore)
2304typedef MK_PTR ( *MkCacheCF) ( MK_RT_ARGS MK_PTR const);
2305__parser__(ignore)
2306typedef void ( *MkCacheDF) ( MK_RT_ARGS MK_PTR * const);
2307
2309__parser__(ignore)
2311 #define MkCacheItemS_signature 0x44196912
2313 bool doFree;
2317};
2318
2326__parser__(ignore)
2343
2345// MkKernel_Cache_C_API
2346
2349__parser__(flags=public-internal)
2350typedef void ( MK_DECL *MkMarkF ) ( MK_RT_ARGS MK_PTR data );
2351
2352/*****************************************************************************/
2353/* */
2354/* create / delete */
2355/* */
2356/*****************************************************************************/
2357
2427__parser__push__(no-rpc,template-overload,doc-group=libmkkernel,doc-index=Setup,prefix=Setup);
2428
2441#ifndef META_COMPILE_AS_CC
2442__attribute__ ((constructor(200)))
2443#endif
2444__parser__(no-inline)
2446
2449
2461#ifndef META_COMPILE_AS_CC
2462__attribute__ ((destructor(200)))
2463#endif
2464__parser__(no-inline)
2466
2468__parser__(ignore)
2470
2471__parser__(internal)
2473
2474__parser__(internal)
2476
2478
2480
2481/* ####################################################################### */
2482/* ### ### */
2483/* ### S Y S T E M - A P I ### */
2484/* ### ### */
2485/* ####################################################################### */
2486
2487// MkObjectC_Sys_C_API: hide all ^MkSys
2488__parser__global__(hide-rx=^MkSys);
2489// MkObjectC_Sys_C_API: default class for MkSys is MkObjectC
2490__parser__global__(prefix2class:MkSys=MkObjectC);
2491
2504
2505__parser__push__(internal); // \{ internal
2506
2510typedef MK_PTR (*MkSysCallocF) (size_t, size_t) __attribute__ ((alloc_size (1, 2)));
2511
2515typedef MK_PTR (*MkSysMallocF) (size_t) __attribute__ ((alloc_size (1)));
2516
2521
2525typedef MK_STR (*MkSysStrNCpyF) (char*,const char*,size_t);
2526
2530typedef MK_STR (*MkSysStrNDupF) (MK_STRN, size_t) __attribute__ ((alloc_size (2)));
2531
2535typedef MK_PTR (*MkSysReallocF) (MK_PTR, size_t);
2536
2540typedef void (*MkSysFreeF) (MK_PTR);
2541
2546typedef pid_t (*MkSysForkF) (void);
2547
2551typedef enum MkErrorE (*MkSysWaitF) (
2552 MK_OBJN const fmtobj,
2553 MK_IDNT const id
2554);
2555
2566typedef int (*MkSysExitF) (
2568 int isThread,
2569 int num
2570);
2571
2572/*
2576typedef void (*MkSysAbortF) (
2577 MK_RT_ARGS
2578 int isThread,
2579 int num
2580) MK_NO_RETURN;
2581*/
2582
2584__parser__(ignore)
2585struct MkLalS {
2607
2616 enum MkErrorE (*SysUSleep) (
2617 MK_OBJN const obj,
2618 unsigned int const usec
2619 );
2628 enum MkErrorE (*SysSleep) (
2629 MK_OBJN const obj,
2630 unsigned int const sec
2631 );
2644 enum MkErrorE (*SysDaemonize) (
2646 MK_OBJN const obj,
2647 MK_STRN pidfile
2648 );
2651
2661 void (*SysAbort) (
2662 void
2663 ) MK_NO_RETURN;
2664
2665 enum MkErrorE (*SysIgnorSIGCHLD) (
2667 MK_OBJ const obj
2668 );
2669
2670 enum MkErrorE (*SysAllowSIGCHLD) (
2672 MK_OBJ const obj
2673 );
2674};
2675
2677__parser__(ignore)
2679
2686__attribute__ ((alloc_size (2, 3)))
2687__parser__(internal)
2690 size_t const nmemb,
2691 size_t const size
2692);
2693
2699__attribute__ ((alloc_size (2)))
2700__parser__(internal)
2703 size_t const size
2704);
2705
2713 MK_STRN const str
2714);
2715
2722__parser__(internal)
2725 MK_STRN const str,
2726 MK_SIZE const len
2727);
2728
2738 MK_STR const to,
2739 MK_STRN const from,
2740 MK_SIZE const len
2741);
2742
2743
2750__attribute__ ((alloc_size (3)))
2751__parser__(internal)
2754 MK_PTR const buf,
2755 size_t const size
2756);
2757
2767__parser__(internal)
2770 MK_PTR const buf,
2771 MK_NUM const oldnum,
2772 MK_NUM const addnum,
2773 size_t const size
2774);
2775
2782__parser__(internal)
2785 MK_PTRN const blck,
2786 size_t const size
2787);
2788
2794__parser__(internal)
2797 MK_STRN_A const strA
2798);
2799
2804__parser__(internal) void MkSysFree (MK_PTR pointer);
2805#define MkSysFree(pointer) \
2806 do { \
2807 if ( likely((pointer) != (NULL)) ) { \
2808 (*MkLal.SysFree)((MK_PTR)pointer); \
2809 (pointer) = (NULL); \
2810 } \
2811 } while (0)
2812
2813__parser__(internal) void MkSysFreeNonNull (MK_PTR pointer);
2814#define MkSysFreeNonNull(pointer) (*MkLal.SysFree)((MK_PTR)pointer)
2815
2821 MK_PTR data
2822);
2823
2847 MK_I32 const debug __parser__(default=0),
2848 MK_STRN const callfunc __parser__(default=F#FUNC),
2849 MK_I32 const lvl __parser__(default=0),
2850 MK_I32 skip __parser__(default=0),
2851 MK_I32 const num __parser__(default=-1)
2853
2864 MK_I32 const debug __parser__(default=0),
2865 MK_STRN const callfunc __parser__(default=F#FUNC),
2866 MK_I32 const lvl __parser__(default=0)
2868
2873 MK_I32 const debug __parser__(default=0),
2874 MK_STRN const callfunc __parser__(default=F#FUNC),
2875 MK_I32 const lvl __parser__(default=0),
2876 MK_I32 skip __parser__(default=0),
2877 MK_I32 const num __parser__(default=-1)
2879
2884__parser__(internal)
2887 MK_IDNT const id
2888) {
2889 return (*MkLal.MkSysWaitForProcessCB)(fmtobj, id);
2890};
2891
2896__parser__(internal)
2899 MK_IDNT const id
2900) {
2901 return (*MkLal.MkSysWaitForThreadCB)(fmtobj, id);
2902};
2903
2908__parser__(internal)
2911 useconds_t const usec
2912) {
2913 return (*MkLal.SysUSleep)(fmtobj, usec);
2914};
2915
2922 MK_I32 const sec
2923) {
2924 return (*MkLal.SysSleep)(fmtobj, (unsigned int)sec);
2925};
2926
2943 int isThread,
2944 int num
2945) {
2946 if (*MkLal.MkSysExitCB) {
2947 return (*MkLal.MkSysExitCB)(MK_RT_CALL isThread,num);
2948 } else {
2949 return num;
2950 }
2952
2967// [MkSysBasename-example]
2970 MK_STRN const pathName,
2971 bool const includeExtension
2973// [MkSysBasename-example]
2974
2989 MK_STRN const pathName
2991
3005 MK_STRN const format,
3006 ...
3008
3015__parser__(internal)
3018 struct mk_timeval * tv_out,
3019 struct mk_timezone * tz_out
3020);
3021
3023__parser__(internal,macro) bool MkSysStringSetNULL_R (MK_STRN const str);
3024#define MkSysStringSetNULL_R(_str) _str[0] = '\0'
3025
3027__parser__(internal,macro) bool MkSysStringSet_R (MK_STRN const str, MK_STRN const other);
3028#define MkSysStringSet_R(_str,_val) strcpy(_str,_val)
3029
3031__parser__(internal,macro) bool MkSysStringIsNULL_R (MK_STRN const str);
3032#define MkSysStringIsNULL_R(_str) (_str[0] == '\0')
3033
3036 return (str == NULL || MkSysStringIsNULL_R(str));
3037};
3038
3041 return (str != NULL && *str != '\0');
3042};
3043
3045__parser__(internal,macro) bool MkSysStringIsEQUAL (MK_STRN const str, MK_STRN const other);
3046#define MkSysStringIsEQUAL(_str,_other) (strcmp(_str,_other) == 0)
3047
3049__parser__(internal,macro) bool MkSysStringIsLenEQUAL (MK_STRN const str, MK_STRN const other, MK_SIZE const len);
3050#define MkSysStringIsLenEQUAL(_str,_other,_len) (strncmp(_str,_other,(size_t)_len) == 0)
3051
3054 return MkSysStringIsNULL(str) ? NULL : str;
3055};
3056
3059 return str == NULL ? "" : str;
3060};
3061
3062__parser__pop__; // internal \}
3063
3103__parser__(keep,doc-no)
3105 MK_STRN key,
3106 MK_NUM length __parser__(default=-1)
3108
3110__parser__(keep,doc-no)
3112 MK_STRN key,
3113 MK_NUM length __parser__(default=-1)
3115
3122__parser__(keep,doc-no)
3125 MK_I32 pid,
3126 MK_I32 signal
3128
3134__parser__(keep,doc-no)
3137 MK_I32 * pid_out
3139
3140__parser__(ignore)
3145
3148__parser__(ignore)
3150 MkSysPipeHandlerE keepPipe
3152
3154// MkObjectC_Sys_C_API
3155
3238/* ####################################################################### */
3239/* ### ### */
3240/* ### O B J E C T - A P I ### */
3241/* ### ### */
3242/* ####################################################################### */
3243
3277__parser__global__(hide-rx=^Mk\w+Check\M);
3278__parser__global__(hide-rx=^MkObj[A-Z]);
3279__parser__global__(prefix2class:MkObj=MkObjectC);
3280
3283
3284 // TODO !! IMPORTANT INFO ABOUT CHECK !!
3285 // "MqCtxCheck(context)..." check of "context" create "MkDisasterEvent" after "fDecrSelf" etc…
3286 // Problem in PERL (and propably other too) after "fDecrSelf" the "context" becomes INVALID.
3287 // There are TWO phases of INVALID:
3288 // 1. INVALID but still readable -> "MqCtxCheck" works
3289 // 2. INVALID but NOT readable -> "MqCtxCheck" create "MkDisasterEvent"
3290 // It seems that "2." becomes more likely as "context" becomes bigger. "context" becomes bigger
3291 // if more prealloc space is used in "context". seems that if all references to ACTIVE memory is
3292 // gone an entire memory-page becomes "2." -> with other words:
3293 // -> It is not guaranteed that the "MqCtxCheck" technology will work.
3294
3295#define __MkCheckTO(t,o) (((*o).signature & (*t).objmask) == (*t).objsig)
3296#define _MkCheckTO(t,o) ((o) && __MkCheckTO((t),(o)))
3297#define __MkCheckO(cls,o) (((*o).signature & cls##_MASK) == cls##_SIGNATURE)
3298#define _MkCheckO(cls,o) ((o) && __MkCheckO(cls,(o)))
3299#define __MkCheckX(cls,x) __MkCheckO(cls,(cls##_X2obj(x)))
3300#define _MkCheckX(cls,x) ((x) && __MkCheckO(cls,(cls##_X2obj(x))))
3301#define __MkCheckM(cls,m) __MkCheckO(cls,((MK_OBJ)(m)))
3302#define _MkCheckM(cls,m) ((m) && __MkCheckM(cls,m))
3303
3304#define MkCheckNN(cls,x) __MkCheckO(cls,(cls##_X2obj(x)))
3305
3306#ifdef __SANITIZE_ADDRESS__
3307 //#define MkSanitizeCheck(_root,_m) _root##_Check(_m)
3308 #define MkSanitizeCheck(_root,_m) _MkCheckM(_root,_m)
3309 #define MkSanitizeCheckO(_root,_o) _MkCheckO(_root,_o)
3310#else
3311 #define MkSanitizeCheck(_root,_m) _MkCheckM(_root,_m)
3312 #define MkSanitizeCheckO(_root,_o) _MkCheckO(_root,_o)
3313#endif
3314
3317#define MkAssertO(cls,o) assert(o==NULL?true:__MkCheckO(cls,o)) // NULL == true
3318#define MkAssertX(cls,x) assert(x==NULL?true:__MkCheckX(cls,o)) // NULL == true
3320
3322#ifdef NDEBUG
3323# define MkAssertCastM(cls,m) ((cls##_type)(m))
3324#else
3325# define MkAssertCastM(cls,m) ((cls##_type)(({MK_OBJ o=(MK_OBJ)(m);MkAssertO(cls,o);o;})))
3326#endif
3327
3328#define toTT(_type) (MkTYP(_type))
3329
3331
3333#define MK_NULL_SIGNATURE 0
3334
3353
3354#define MkDbgObjInstancesO_2(o,c) \
3355do { \
3356 if (o) { \
3357 mk_dbg_color_ln(c,"MkDbgObjInstances: %s[%p] prev<%p>, next<%p>, var<" #o ">", \
3358 (o)->type->type_name, o, (o)->obj_protect.prev, (o)->obj_protect.next); \
3359 } else { \
3360 mk_dbg_color_ln(c,"MkDbgObjInstances: %s[NULL] var<" #o ">", "unknown"); \
3361 } \
3362} while (0)
3363#define MkDbgObjInstancesX_2(x,c) MkDbgObjInstancesO_2(MkOBJ(x),c)
3364#define MkDbgObjInstancesX(x) MkDbgObjInstancesX_2(x,MK_COLOR_CYAN)
3365#define MkDbgObjInstancesO(o) MkDbgObjInstancesO_2(o,MK_COLOR_CYAN)
3366
3367#if META_DEBUG & META_DEBUG_REFCOUNT
3368
3369 __attribute__ ((visibility("default"))) void
3370 MkDbgDeepWriter(void* mng,const char* ident, const char* func, const char* fmt,...);
3371
3372#else
3373
3374 #define MkDbgDeepWriter(...)
3375
3376#endif
3377
3378#define MkDbgDeepX_4(m,ident,func,fmt,...) MkDbgDeepWriter(m, ident, func, fmt, __VA_ARGS__)
3379#define MkDbgDeepX_3(m,ident,fmt,...) MkDbgDeepX_4(m,ident,__func__,fmt,__VA_ARGS__)
3380#define MkDbgDeepX_2(m,ident) MkDbgDeepX_4(m,ident,__func__,NULL,NULL)
3381
3398
3400 //bool onDelete;
3401
3406
3411
3412#if defined(META_USE_SELF_REFCOUNT)
3422#endif
3423
3426
3429
3433
3434 // attention !!
3435 // an additional "attribute" have to be initialized in: MkObjInit
3436 // also update : theKernel/cs/libmkkernel.cs
3437};
3438
3439// BEGIN-MkObjectS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3440
3444 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
3445
3446// Signature --------------------------------------------------------------
3449
3450 #define MkObjectC_SIGNATURE (0x59B3u<<16)
3451 #define MkObjectC_MASK (((1u<<16)-1)<<16)
3452
3454
3455// CompileTimeCast --------------------------------------------------------------
3458
3459 #define MkObjectC_X2obj(x) (x)
3460
3462
3463// TypeDef --------------------------------------------------------------
3466
3468 __parser__(ignore) typedef struct MkObjectS MkObjectCR;
3470 __parser__(ignore) typedef const struct MkObjectS MkObjectCNR;
3472 #define MkObjectC_T (&MK_RT_REF._MkObjectC_T)
3474 #define MkObjectC_TT (MkTYP(MkObjectC_T))
3476 #define MkObjectST MkObjectC_T
3478 #define MkObjectSTT (MkTYP(MkObjectST))
3480 #define MkObjectC_type MK_OBJ
3482 #define MkObjectCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
3484 #define MkObjectCTT_X(instance) (MkOBJ_R(instance).type)
3486 #define MkObjectCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
3488 #define MkObjectC_NS MK
3490 #define MkObjectCTT MkObjectCTT
3492 #define MkObjectCT ( (struct MkTypeDefS *) MkObjectCTT )
3493
3495
3496// TypeCheck --------------------------------------------------------------
3499
3500 #pragma GCC diagnostic push
3501 #pragma GCC diagnostic ignored "-Wattributes"
3502
3505 __parser__(class=MkObjectC,static,hide)
3508 return MkSanitizeCheck(MkObjectC,mng);
3509 }
3510
3513 __parser__(class=MkObjectC,static,hide)
3516 return MkSanitizeCheckO(MkObjectC,obj);
3517 }
3518
3519 #pragma GCC diagnostic pop
3520 #define MkObjectC_Check(mng) MkObjCheck(mng)
3521
3523
3524// RunTimeCast --------------------------------------------------------------
3527
3529 __parser__(class=MkObjectC,hide,static)
3530 META_ATTRIBUTE_SANITIZE
3533 return (MkObjCheck(mng) ? (MK_OBJ)mng : NULL);
3534 }
3535
3537 __parser__(class=MkObjectC,hide,static)
3538 META_ATTRIBUTE_SANITIZE
3541 return (MkObjCheck(mng) ? (MK_OBJN)mng : NULL);
3542 }
3543
3545 #define MkObjRaise(_obj) if (!_MkCheckX(MkObjectC,_obj)) { \
3546 MkErrorSetC_1E("'MkObjectC' hdl is NULL"); \
3547 goto error ; \
3548 }
3549
3551 #define MkOBJ_R(x) (*(x)).super.obj
3553 #define MkOBJ(x) (&MkOBJ_R(x))
3554
3556
3559// MkObjectC_Class_Define_C_API
3560
3561// END-MkObjectS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3562
3563// =========================================================================
3564// OVERLOAD
3565
3568
3571__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkObjectC,no-rpc);
3572
3580
3583 return ((MK_HDL)obj->signature);
3584}
3585
3586#define MkObjectHandleGetOfType_1X(x) MkObjectHandleGetOfType(MkOBJ(x))
3587
3593 MK_OBJ const obj __parser__(null-allowed)
3595
3604 MK_OBJ const obj __parser__(null-allowed)
3606
3608
3611
3612// =========================================================================
3613// BEGIN-MkObjectS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3614
3617
3620
3621__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkObjectC);
3622
3640 MK_OBJ const obj __parser__(null-allowed)
3642
3643#define MkObjectHandleGet_1X(x) MkObjectHandleGet(x?MkOBJ(x):NULL)
3644
3655 MK_HDL const netHdl
3657
3667#define MkObjectHandleResolve_e(netHdl) ({ \
3668 MK_HDL tmpHdl=netHdl; \
3669 MK_OBJ tmp; \
3670 if (tmpHdl==0) { \
3671 tmp=NULL; \
3672 } else { \
3673 tmp=MkObjectHandleResolve(tmpHdl); \
3674 if (tmp==NULL) { \
3675 MkErrorSetC_1_NULL("ERROR: 'MkObjectC' handle is 'NULL'"); \
3676 goto error; \
3677 }; \
3678 }; \
3679 tmp; \
3680})
3681
3686 MK_HDL const netHdl
3687);
3688
3693 MK_OBJ const netObj
3694);
3695
3697
3699// Class export & import
3700
3704 __parser__(doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkObjectC,null-return-allow)
3707 return (MK_OBJ)MK_NULL;
3708 }
3710// MkObjectC - Misc - function
3711
3713// MkObjectC_Class_C_API
3714
3715// END-MkObjectS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3716
3720typedef void (*MkDestructorF) ( MK_RT_ARGS MK_OBJ const obj);
3721typedef MK_OBJ (*MkDupF) ( MK_RT_ARGS MK_OBJN const obj);
3722typedef MK_OBJ (*MkDup2F) ( MK_RT_ARGS MK_OBJN const obj, MK_STRN const ident);
3723typedef MK_OBJ (*MkMergeF) ( MK_RT_ARGS MK_OBJ const obj);
3724typedef MK_OBJ (*MkCopyF) ( MK_RT_ARGS MK_OBJ const obj, MK_OBJN const src);
3725typedef MK_OBJ (*MkResetF) ( MK_RT_ARGS MK_OBJ const obj);
3726__parser__(flags=public-internal)
3727typedef MK_PTR (*MkSelfCreateF) ( MK_RT_ARGS MK_OBJ const obj, MK_PTR const env);
3728__parser__(flags=public-internal)
3729typedef void (*MkSelfDeleteF) ( MK_RT_ARGS MK_PTR self, MK_PTR const env);
3730__parser__(flags=public-internal)
3731typedef void (*MkSelfUnlinkF) ( MK_RT_ARGS MK_PTR self, MK_PTR const env);
3732typedef void (*MkLogF) ( MK_RT_ARGS MK_OBJN const obj, MK_OBJN fmt, MK_DBG const debug,
3733 MK_STRN const callfunc, MK_I32 const lvl);
3734typedef MK_STRN (*MkToStringF) ( MK_RT_ARGS MK_OBJN const obj);
3736typedef void (*MkAllocDeleteF) ( MK_RT_ARGS MK_TYP const type, MK_PTR ptr);
3737typedef void (*MkTypeInitF) ( MK_RT_ARGS MK_TYP const type);
3738typedef bool (*MkLogFormatF) ( MK_RT_ARGS char* header, MK_SIZE const headerSize, MK_OBJN const obj,
3739 MK_STRN const caller, MK_I32 const debug, MK_STRN const fmt);
3741
3753__parser__(ignore)
3759
3760
3762// MkObjectC_C_API
3763
3764/* ####################################################################### */
3765/* ### ### */
3766/* ### T Y P E - A P I ### */
3767/* ### ### */
3768/* ####################################################################### */
3769
3907#define MkDbgTyp2(t,c) \
3908 mk_dbg_color_ln(c,"MkDbgTyp[%-32s]: typ<ID=%-2d,P=%-14p,RT=%p> type_class<%s:%p>, " #t, \
3909 MK_TRIM_LEFT(32,(t)->type_name), (t)->type_id, t, MkRT_X(t), \
3910 (t)->type_class->type_name, (t)->type_class)
3911#define MkDbgTyp(t) MkDbgTyp2(t,MK_COLOR_LIGHT_CYAN)
3912#define MkDbgTypListAll2(t,c) do { \
3913 MK_OBJ o; \
3914 MkRuntimeLogBufferPush(); \
3915 DL_FOREACH2((t)->type_class->instancesR,o,obj_protect.next) { \
3916 MkDbgTyp2(MkTyp(o),c); \
3917 } \
3918 MkRuntimeLogBufferPop(); \
3919} while (0)
3920#define MkDbgTypListAll(t) MkDbgTypListAll2(t,MK_COLOR_GREEN)
3921
3922#define MkDbgTypInstances_2(t,c) \
3923do { \
3924 MK_TYP _typ = (t); \
3925 if (_typ) { \
3926 mk_dbg_start_2(c,"MkDbgTypInstances: %s[%p] ", _typ->type_name, _typ); \
3927 int max=5; \
3928 for (MK_OBJ obj=MkTypeInstances(_typ); obj; obj=MkObjectNext(obj)) { \
3929 mk_dbg_next_2(c,"%p,",obj); \
3930 max--; \
3931 if(max==0) { \
3932 mk_dbg_next_2(MK_COLOR_RED,"%s", "break"); \
3933 break; \
3934 } \
3935 } \
3936 mk_dbg_end(); \
3937 } else { \
3938 mk_dbg_color_ln(c,"MkDbgTypInstances: %s[%p] ", #t, _typ); \
3939 } \
3940} while (0)
3941
3942#define MkDbgTypInstances(t) MkDbgTypInstances_2(t,MK_COLOR_CYAN)
3943
3944
3946__parser__(internal)
3947struct MkTypeS {
3948 // BEGIN-MkTypeS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3949
3950 union {
3951 struct MkObjectS obj; // instance-base MkObjectS
3952 } super;
3953
3954 // END-MkTypeS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3955
3956 // instance attributes
3957 #define MkTypeS_name_size 32
3961 bool noSelf;
3963 size_t objsize;
3964 size_t typsize;
3965
3968
3969 // slots
3983
3985
3986 struct MkAllocDefS objalloc;
3995};
3996
3997// BEGIN-MkTypeS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
3998
4002 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
4003
4004// Signature --------------------------------------------------------------
4007
4008 #define MkTypeC_SIGNATURE (MkObjectC_SIGNATURE ^ (11u<<10))
4009 #define MkTypeC_MASK (((1u<<22)-1)<<10)
4010
4012
4013// CompileTimeCast --------------------------------------------------------------
4016
4017 #define MkTypeC_X2typ(x) (x)
4018 #define MkTypeC_X2obj(x) MkOBJ(x)
4019
4021
4022// TypeDef --------------------------------------------------------------
4025
4027 __parser__(ignore) typedef struct MkTypeS MkTypeCR;
4029 __parser__(ignore) typedef const struct MkTypeS MkTypeCNR;
4031 #define MkTypeSTT (&MK_RT_REF._MkTypeC_TT)
4033 #define MkTypeC_TT (&MK_RT_REF._MkTypeC_TT)
4035 #define MkTypeC_type MK_TYP
4037 #define MkTypeCT_X(instance) ( (struct MkTypeS *) (MkOBJ_R(instance).type) )
4039 #define MkTypeCTT_X(instance) (MkOBJ_R(instance).type)
4041 #define MkTypeCT_TT(typ) ( (struct MkTypeS *) (typ) )
4043 #define MkTypeC_NS MK
4045 #define MkTypeCTT MkTypeCTT
4047 #define MkTypeCT ( (struct MkTypeS *) MkTypeCTT )
4048
4050
4051// TypeCheck --------------------------------------------------------------
4054
4055 #pragma GCC diagnostic push
4056 #pragma GCC diagnostic ignored "-Wattributes"
4057
4060 __parser__(class=MkTypeC,static,ignore)
4063 return MkSanitizeCheck(MkTypeC,mng);
4064 }
4065
4068 __parser__(class=MkTypeC,static,ignore)
4071 return MkSanitizeCheckO(MkTypeC,obj);
4072 }
4073
4074 #pragma GCC diagnostic pop
4075 #define MkTypeC_Check(mng) MkTypCheck(mng)
4076
4078
4081// MkTypeC_Class_Define_C_API
4082
4083// END-MkTypeS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
4084
4086__parser__(class=MkObjectC,internal,static)
4088 if (!MkObjCheck(mng)) return NULL;
4089 MK_OBJ obj = (MK_OBJ) mng;
4090 if (MkTypCheck(obj)) return (MK_TYP)obj;
4091 MK_TYP typ = obj->type;
4092 if (MkTypCheck(typ)) return typ;
4093 return NULL;
4094}
4095
4097__parser__(ignore)
4099 if (!MkObjCheck(mng)) return NULL;
4100 MK_OBJ obj = (MK_OBJ) mng;
4101 if (MkTypCheck(obj)) return (MK_TYPN)obj;
4102 MK_TYPN typ = obj->type;
4103 if (MkTypCheck(typ)) return typ;
4104 return NULL;
4105}
4106
4108#define MkTYP_R(x) (*(x)).super.typ
4110#define MkTYP(x) (&MkTYP_R(x))
4112#define MkTYP_O(o) (*o).type
4114#define MkTYP_X(x) MkOBJ_R(x).type
4115
4121__parser__(ignore)
4123 // BEGIN-MkTypeDefS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
4124
4125 union {
4126 struct MkObjectS obj; // instance-base MkObjectS
4127 struct MkTypeS typ; // instance-base MkTypeS
4129
4130 // END-MkTypeDefS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
4131};
4132
4133// BEGIN-MkTypeDefS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
4134
4138 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
4139
4140// Signature --------------------------------------------------------------
4143
4144 #define MkTypeDefC_SIGNATURE (MkTypeC_SIGNATURE ^ (1u<<6))
4145 #define MkTypeDefC_MASK (((1u<<26)-1)<<6)
4146
4148
4149// CompileTimeCast --------------------------------------------------------------
4152
4153 #define MkTypeDefC_X2typ(x) MkTYP(x)
4154 #define MkTypeDefC_X2obj(x) MkOBJ(x)
4155
4157
4158// TypeDef --------------------------------------------------------------
4161
4163 __parser__(ignore) typedef struct MkTypeDefS MkTypeDefCR;
4165 __parser__(ignore) typedef const struct MkTypeDefS MkTypeDefCNR;
4167 #define MkTypeDefSTT (&MK_RT_REF._MkTypeDefC_TT)
4169 #define MkTypeDefC_TT (&MK_RT_REF._MkTypeDefC_TT)
4171 #define MkTypeDefCT_X(instance) ( (struct MkTypeS *) (MkOBJ_R(instance).type) )
4173 #define MkTypeDefCTT_X(instance) (MkOBJ_R(instance).type)
4175 #define MkTypeDefCT_TT(typ) ( (struct MkTypeS *) (typ) )
4177 #define MkTypeDefC_NS MK
4179 #define MkTypeDefCTT MkTypeDefCTT
4181 #define MkTypeDefCT ( (struct MkTypeS *) MkTypeDefCTT )
4182
4184
4187// MkTypeDefC_Class_Define_C_API
4188
4189// END-MkTypeDefS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
4190
4192__parser__(internal)
4193MK_EXTERN MK_PTR MK_DECL MkTypeSlotResolveP(MK_RT_ARGS MK_TYPN const type, size_t const offset, bool const force);
4194
4209#define MkTypeSlotResolve(_tt,fptr,force) ({ \
4210 MK_TYP tt = (_tt) ; /* _tt my be long */ \
4211 tt == NULL ? NULL : /* type not valid */ \
4212 !force && tt->fptr == (MK_PTR) 0x1 ? NULL : /* already resolved, NOT found */ \
4213 tt->fptr > (typeof(tt->fptr)) 0x1 ? tt->fptr : /* already resolved, NOT NULL, found */ \
4214 tt == MkTypeSTT ? NULL : /* already at the ROOT of the type */ \
4215 (typeof(tt->fptr)) MkTypeSlotResolveP(MK_RT_CALL tt, offsetof(struct MkTypeS, fptr), force); \
4216}) \
4217
4218#define MkTypeSlotCall(_tt,fptr,...) do { \
4219 typeof((_tt)->fptr) slot = MkTypeSlotResolve((_tt),fptr,false); \
4220 if (slot) (*slot)(MK_RT_CALL __VA_ARGS__); \
4221} while (false)
4222
4224// MkTypeC_C_API
4225
4226
4227// #######################################################################
4228// -----------------------------------------------------------------------
4234
4235__parser__push__(doc-group=TOR);
4236
4247#if defined(META_USE_SELF_REFCOUNT)
4248 // [MkObjInit2]
4249 #define MkObjInit2(rtmkV,rtExtV,sigV,typeV,refCountV,isLocalV) \
4250 (struct MkObjectS) { \
4251 .signature = sigV, \
4252 .refCount = refCountV, \
4253 .self = NULL, \
4254 .type = typeV, \
4255 .env = NULL, \
4256 .selfCreated = false, \
4257 .selfRefCount = 0, \
4258 .objRt = rtmkV, \
4259 .objRtExt = rtExtV, \
4260 .obj_protect = { \
4261 .isLocal = isLocalV, \
4262 .prev = NULL, \
4263 .next = NULL, \
4264 }, \
4265 }
4266 // [MkObjInit2]
4267#else
4268 #define MkObjInit2(rtmkV,rtExtV,sigV,typeV,refCountV,isLocalV) \
4269 (struct MkObjectS) { \
4270 .signature = sigV, \
4271 .refCount = refCountV, \
4272 .self = NULL, \
4273 .type = typeV, \
4274 .env = NULL, \
4275 .selfCreated = false, \
4276 .objRt = rtmkV, \
4277 .objRtExt = rtExtV, \
4278 .obj_protect = { \
4279 .isLocal = isLocalV, \
4280 .prev = NULL, \
4281 .next = NULL, \
4282 }, \
4283 }
4284#endif
4285
4286#define MkObjInit(rtmkV,rtExtV,cls,refCountV,isLocalV) \
4287 MkObjInit2(rtmkV,rtExtV,cls##_SIGNATURE,cls##_TT,refCountV,isLocalV)
4288
4289// [MkObjInitFromType]
4290#define MkObjInitFromType(typeV,isLocalV) \
4291 MkObjInit2(MK_RT_PTR, NULL, (*typeV).objsig, typeV, 0, isLocalV)
4292// [MkObjInitFromType]
4293
4294#define MkObjInitFromInstance(instV) \
4295 MkObjInit2(MK_RT_PTR, NULL, MkOBJ_R(instV).type->objsig, MkOBJ_R(instV).type, 0, false)
4296
4310__parser__(constructor)
4313 MK_OBJ const srcobj
4315
4327 MK_OBJ const srcmng,
4328 MK_STRN const ident
4330
4346__parser__(constructor)
4349 MK_OBJ const obj
4351
4358__parser__(constructor)
4361 MK_TYP type __parser__(internal,default=NULL),
4362 MK_PTR nat,
4363 MK_PTR lnk
4365
4366// *******************************************************************************
4367// PUBLIC object API
4368// *******************************************************************************
4369
4388__parser__(destructor,keep-destr)
4391 MK_OBJ obj
4393
4394#define MkObjectDelete_NULL(obj) MkObjectDeleteToNull(MkObjectDelete_RT,MK,obj)
4395#define MkObjectDelete_NULL_X(x) MkObjectDeleteToNull_X(MkObjectDelete_RT,MK,x)
4396#define MkObjectDelete_1X(x) MkObjectDeleteToNull_X(MkObjectDelete_RT,MK,x)
4397
4398#define MkObjectDeleteToNull(fct,NS,x) if (x) { fct (NS##_RT_CALL x); (x) = NULL ; }
4399#define MkObjectDeleteToNull_X(fct,NS,x) if (x) { fct (NS##_RT_CALL MkOBJ(x)); (x) = NULL ; }
4400
4416__parser__(destructor,lng-destr,lng-dispose)
4419 MK_OBJ obj
4421
4422#define MkObjectDispose_NULL(obj) MkObjectDeleteToNull(MkObjectDispose_RT,MK,obj)
4423#define MkObjectDispose_NULL_X(x) MkObjectDeleteToNull_X(MkObjectDispose_RT,MK,x)
4424#define MkObjectDispose_1X(x) MkObjectDispose(MkOBJ(x))
4425
4427#define MkObjectDeleteCallF_CHECK do { \
4428 assert (__data__ != NULL); \
4429} while (0)
4430
4431// [MkObjectDeleteCallF]
4433#define MkObjectDeleteCallF_ARGS \
4434 MK_RT_ARGS \
4435 MK_OBJN const obj __parser__(internal), \
4436 MK_STRN const typeName, \
4437 MK_HDL const typeHdl, \
4438 MK_HDL const objHdl, \
4439 MK_CBP const __data__ \
4440
4441#define MkObjectDeleteCallF_CALL MK_RT_CALL obj, __data__
4442
4487__parser__(flags=public-internal)
4489
4491#define MkObjectDeleteFreeF_ARGS MK_RT_ARGS MK_CBP *dataP __parser__(inout)
4492
4493__parser__(flags=public-internal)
4495
4528__parser__(class=MkObjectC,callback-name=ObjectDelete,callback-null)
4531 MK_STRN ident ,
4532 MkObjectDeleteCallF fCall __parser__(callback-call),
4533 MK_CBP callback __parser__(callback-data),
4534 MkObjectDeleteFreeF fFree __parser__(callback-free),
4535 MK_STRN filter __parser__(default=NULL)
4537// [MkObjectDeleteCallF]
4538
4542__parser__(class=MkObjectC)
4545 MK_STRN ident
4547
4548__parser__pop__; // TOR
4549
4551// MkObjectC_TOR_C_API
4552
4553/* ####################################################################### */
4554/* ### ### */
4555/* ### O B J - A P I ### */
4556/* ### ### */
4557/* ####################################################################### */
4558
4573// ***********************************************************************************************
4574
4575
4583 MK_OBJ const tgtmng,
4584 MK_OBJN const srcmng
4586
4592 MK_OBJ const obj
4594
4595// ****************************************************************************************************
4596
4601
4602__parser__global__(hide-rx=^MkRef);
4603__parser__global__(pattern2prefix:MkRef=MkObj);
4604
4606#define MkRefLOCK 999999
4607
4610__parser__(static)
4613 if (obj) ++(*obj).refCount;
4614}
4615
4616#define MkRefIncr_1X(x) MkRefIncr(MkOBJ(x))
4617#define MkRefIncr_1M(m) MkRefIncr(MkObj(m))
4618
4632#define MkRefIncr_FX(x) MkRefIncr(MkOBJ(x))
4633
4642__parser__(static)
4645 MK_OBJ obj
4647
4651#define MkRefDecr_O(o) do { MkRefDecr_RT(MK_RT_CALL o); o=NULL; } while (0)
4655#define MkRefDecr_X(x) do { MkRefDecr_RT(MK_RT_CALL MkOBJ(x)); x=NULL; } while (0)
4657#define MkRefDecr_X_NULL(x) do { MkRefDecr_RT(MK_RT_NULL MkOBJ(x)); x=NULL; } while (0)
4662#define MkRefDecr_M(m) do { MkRefDecr_RT(MK_RT_CALL MkObj(m)); m=NULL; } while (0)
4664#define MkRefDecr_M_NULL(m) do { MkRefDecr_RT(MK_RT_NULL MkObj(m)); m=NULL; } while (0)
4665
4667#define MkRefDecr_FX(x) do { --(MkOBJ_R(x).refCount); } while(0)
4668
4677mk_inline void MkRefIncrSelf( MK_OBJ const obj, MK_PTR const self, MK_PTR const env) {
4679 obj->refCount++;
4680 obj->self = (obj->type->noSelf ? NULL : self);
4681 obj->env = env;
4682}
4683
4684#define MkRefIncrSelf_2X(x,s) MkRefIncrSelf(MkOBJ(x),s)
4685
4702 MK_OBJ const obj
4704
4709// 2. \b unlink the \e SELF from \e META using the \RMkRefDecrWithoutSelf call
4721 MK_OBJ const obj
4723
4728__parser__(keep,doc-no)
4732 return (*obj).refCount;
4733}
4734
4735#define MkRefGet_1X(x) MkRefGet(MkOBJ(x))
4736
4742 return (*obj).refCount=MkRefLOCK;
4743}
4744#define MkRefLock_1X(x) MkRefLock(MkOBJ(x))
4745
4752 return (*obj).refCount >= MkRefLOCK;
4753}
4754#define MkRefIsLocked_1X(x) MkRefIsLocked(MkOBJ(x))
4755
4757#define MkRefSet(target,source) ({ \
4758 if (target != source) { \
4759 typeof(target) targetSave=target; \
4760 target = source;\
4761 MkRefDecr_X(targetSave);\
4762 MkRefIncr_1X(target);\
4763 } \
4764 target;\
4765})
4766
4769
4770#define MkRefCidN_NULL() MkRefCidN_RT(MK_RT_CALL_NULL_ONLY)
4771
4773// MkRef…
4774
4775// *******************************************************************************
4776
4777__parser__global__(hide-rx=^MkSelf);
4778__parser__global__(pattern2prefix:MkSelf=MkObj);
4779
4782
4783typedef void (*MkSelfIncrF) ( MK_RT_ARGS MK_PTR self, MK_PTR const env);
4784typedef void (*MkSelfDecrF) ( MK_RT_ARGS MK_PTR self, MK_PTR const env);
4785
4791mk_inline void MK_DECL MkSelfSet ( MK_OBJ const obj, MK_PTR const self, MK_PTR const env ) {
4793 obj->env = env;
4794 obj->self = (obj->type->noSelf ? NULL : self);
4795}
4796
4797#define MkSelfSet_3X(x,self,env) MkSelfSet(MkOBJ(x),self,env)
4798
4804 // BUG FIX - 1 mar 2023: remove nonnull on obj because C# require this
4805 return obj ? obj->self : NULL;
4806}
4807
4808#define MkSelfGet_1X(x) MkSelfGet(MkOBJ(x))
4809
4836 MK_OBJ obj __parser__(null-allowed),
4837 MK_PTR *self_out,
4838 MK_PTR const env
4839);
4840
4841#define MkSelfNew_3X(x,self_out,env) MkSelfNew(MkOBJ(x),self_out,env)
4842
4854 MK_OBJ const obj,
4855 MK_PTR const env
4856);
4857
4858#define MkSelfCreate_2X(x,env) MkSelfCreate(MkOBJ(x),env)
4859
4868__parser__(static)
4871 MK_OBJ const obj
4873
4874#define MkSelfDelete_1X(x) MkSelfDelete_RT(MK_RT_CALL MkOBJ(x))
4875
4892__parser__(static)
4895 MK_OBJ obj
4897
4898#define MkSelfDeleteForce_1X(x) MkSelfDeleteForce(MkOBJ(x))
4899
4917__parser__(static)
4920 MK_OBJ obj
4922
4923#define MkSelfUnlink_1X(x) MkSelfUnlink(MkOBJ(x))
4924
4929 return obj->self != NULL;
4930}
4931
4932#define MkSelfExists_1X(x) MkSelExists(MkOBJ(x))
4933
4935
4936// addtogroup MkObjectC_Obj_C_API
4938
4939// ****************************************************************************************************
4940
4943
4944//__parser__global__(hide-rx=^MkType);
4945//__parser__global__(prefix2attribute=MkType@internal);
4946//__parser__global__(prefix2attribute=MkType@class=MkTypeC);
4947
4948__parser__push__(internal,class=MkTypeC); // \{ internal
4949
4953__parser__push__(doc-group=TOR);
4954
5041__parser__(macro)
5042MK_TYP MkTypeCreate ( MK_MACRO_TYP const clsV, MK_MACRO_TYP const basicV, MK_STRN const identV);
5043// [MkTypeCreate]
5044#define MkTypeCreate(clsV, basicV, identV) ({ \
5045 assert(!MkSysStringIsNULL(identV)); \
5046 MK_TYP ret = MkTypeDup2(basicV ## _TT,identV); \
5047 ret->objsig = clsV ## _SIGNATURE; \
5048 ret->objmask = clsV ## _MASK; \
5049 ret->objsize = sizeof(clsV##R); \
5050 ret->type_base = basicV ## _TT; \
5051 ret->type_class = ret; \
5052 ret ; \
5053})
5054// [MkTypeCreate]
5055
5075 MK_TYPN const typ,
5076 MK_STRN const ident
5078
5091 MK_TYPN const typ
5093
5104 MK_TYPN const typ
5106
5112 MK_TYP const typ
5114
5117 MK_TYP const typ
5118) {
5119 assert(typ != NULL);
5120 assert(typ->type_class != NULL);
5122 // BUG FIX 2 mar 2025
5123 // test: Nhi1Exec int.test --dev-testing --lang-cc --valgrind-server
5124 // analyse: after "Delete" the "prev/next" is NOT proper set if "type" from "Instances->Next"
5125 // and "type" from "ret->type->instances" are NOT in sync
5126 // Fix: pMkTypeDup2 take "sourceTyp->instances"
5127 if (ret) assert(ret->type->type_class == typ->type_class);
5128 return ret;
5129}
5130
5133#define MkTypeForeachInstancesSave(typ) DL_FOREACH_SAFE2((typ)->type_class->instancesR,obj,tmp,obj_protect.next)
5134
5139 return (MK_TYP)MkTypeC_X2obj(typ)->obj_protect.next;
5140}
5141
5143
5144// MkTypeC_C_TOR_C_API
5150
5161__parser__(const,class-overload=MkObjectLog)
5164 MK_TYPN const typ ,
5166 MK_DBG const debug __parser__(default=0),
5167 MK_STRN const callfunc __parser__(default=F#FUNC),
5168 MK_I32 const lvl __parser__(default=0)
5170
5171#define MkTypeLog_2Lvl(t,l,...) MkTypeLog_RT(MK_RT_CALL (t), __VA_ARGS__, (l)
5172
5173
5180#if META_DEBUG & META_DEBUG_TYPE
5181 #define MkTypeLoop(_cls, _var) \
5182 bool _var##_firstB = true; \
5183 _cls##_type _var##_first = (_cls##_type)_cls##_TT->type_class->instancesR; \
5184 for ( \
5185 _cls##_type _var = _var##_first; \
5186 ({ if (!_var##_firstB && _var == _var##_first) { \
5187 MkPanicV_2M(_var,"[MkTypeLoop] INTERNAL ERROR: found 'circle' in 'MkTypeC=%s'", _var->type_name); \
5188 } ; _var##_firstB = false; _var; }); \
5189 _var = (_cls##_type)_cls##_X2obj(_var)->obj_protect.next \
5190 )
5191#else
5192 #define MkTypeLoop(_cls, _var) \
5193 for (_cls##_type _var = (_cls##_type)_cls##_TT->type_class->instancesR; _var != NULL; \
5194 _var = (_cls##_type)_cls##_X2obj(_var)->obj_protect.next)
5195#endif
5196
5198
5199__parser__pop__; // \}
5200// internal
5201
5202// addtogroup MkTypeC_C_API
5204
5208
5210__parser__(internal,doc-group=Misc)
5214
5216
5217// ##################################################################################
5222
5232 MK_OBJN const obj __parser__(null-allowed)
5234
5235#define MkObjectToName_1X(x) MkObjectToName(MkOBJ(x))
5236
5253 MK_OBJN const obj
5255
5256//2021.03.01 ao → #define MkObjectToNameOfType(o) MkObjectToNameOfType((MK_OBJ)(o))
5257#define MkObjectToNameOfType_1X(x) MkObjectToNameOfType(MkOBJ(x))
5258
5269__parser__(template-overload,template-in-c)
5272 MK_OBJ const obj
5274
5275#define MkObjectToNameOfClass_1X(x) MkObjectToNameOfClass_RT(MK_RT_CALL MkOBJ(x))
5276
5289 MK_OBJN const inst __parser__(null-allowed)
5291
5292#define MkObjectToString_1X(x) MkObjectToString(x?MkOBJ(x):NULL)
5293#define MkObjectToString_1M(m) MkObjectToString(m?MkObjN(m):NULL)
5294
5298 MK_OBJ const obj __parser__(null-allowed)
5299) {
5300 return (obj == MK_NULL);
5301}
5302
5304// MkObjectC_Misc_C_API
5305
5306// #######################################################################
5307// -----------------------------------------------------------------------
5333
5334/* ####################################################################### */
5335/* ### ### */
5336/* ### L O G - A P I ### */
5337/* ### ### */
5338/* ####################################################################### */
5339
5353
5354__parser__push__(doc-group=Log);
5355
5371__parser__(no-type-extension)
5375 MK_STRN const message ,
5376 MK_DBG const debug __parser__(default=0),
5377 MK_STRN const callfunc __parser__(default=F#FUNC)
5379
5380#define MkLogC_4X(x,message,debug,callfunc) MkLogC(MkOBJ(x),message,debug,callfunc)
5381#define MkLogC_3X(x,message,debug) MkLogC_3(MkOBJ(x),message,debug)
5382#define MkLogC_2X(x,message) MkLogC_2(MkOBJ(x),message)
5383#define MkLogW(x,callfunc,_debug,message) MkLogC(MkOBJ(x),message,_debug,callfunc)
5384
5394__parser__(ignore)
5398 MK_STRN const callfunc __parser__(default=F#FUNC),
5399 FILE *FH,
5400 MK_FST const printfmt,
5401 ...
5403
5404#define MkDbgV_2X(x,printfmt,...) MkDbgV_RT(MK_RT_CALL MkOBJ(x),__func__,stderr,printfmt,__VA_ARGS__)
5405#define MkDbgV_2O(o,printfmt,...) MkDbgV_RT(MK_RT_CALL o ,__func__,stderr,printfmt,__VA_ARGS__)
5406
5419 MK_STRN const callfunc __parser__(default=F#FUNC),
5420 MK_DBG debug __parser__(default=0),
5421 MK_FST const printfmt,
5422 ...
5424
5425#define MkLogV_lvl(x,debug,printfmt,...) MkLogV(MkOBJ(x),__func__,debug,printfmt,__VA_ARGS__)
5426
5427#define MkLogV_4M(x,callfunc,debug,printfmt,...) MkLogV(MkObjN(x),callfunc,debug,printfmt,__VA_ARGS__)
5428#define MkLogV_4X(x,callfunc,debug,printfmt,...) MkLogV(MkOBJ(x),callfunc,debug,printfmt,__VA_ARGS__)
5429#define MkLogV_3X(x,callfunc,printfmt,...) MkLogV_3(MkOBJ(x),callfunc,printfmt,__VA_ARGS__)
5430#define MkLogV_2X(x,printfmt,...) MkLogV_2(MkOBJ(x),printfmt,__VA_ARGS__)
5431
5445 MK_STRN const callfunc __parser__(default=F#FUNC),
5446 MK_DBG debug __parser__(default=0),
5447 MK_FST const printfmt,
5448 va_list var_list
5450
5451#define MkLogVL_5X(fmtobj,callfunc,debug,printfmt,var_list) \
5452 MkLogVL(MkOBJ(fmtobj),callfunc,debug,printfmt,var_list)
5453
5463 MK_STRN const callfunc __parser__(default=F#FUNC),
5464 MkBinaryR const data
5466
5467#define MkLogHEX_4X(fmtobj,callfunc,data,len) MkLogHEX_RT(MkOBJ(fmtobj),callfunc,data,len)
5468
5479__parser__(const)
5482 MK_OBJN const obj ,
5484 MK_DBG const debug __parser__(default=0),
5485 MK_STRN const callfunc __parser__(default=F#FUNC),
5486 MK_I32 const lvl __parser__(default=0)
5488
5489#define MkObjectLogShort_1X(x) MkObjectLogShort(MkOBJ(x),NULL,0,__func__,0)
5490#define MkObjectLogShort_2Lvl(o,l) MkObjectLogShort(o,NULL,0,__func__,l)
5491
5502__parser__(const)
5505 MK_OBJN const obj ,
5507 MK_DBG const debug __parser__(default=0),
5508 MK_STRN const callfunc __parser__(default=F#FUNC),
5509 MK_I32 const lvl __parser__(default=0)
5511
5512#define MkObjectLogLong_1X(x) MkObjectLogLong(MkOBJ(x),NULL,0,__func__,0)
5513#define MkObjectLogLong_1M(m) MkObjectLogLong(MkObj(m),NULL,0,__func__,0)
5514
5525__parser__(const)
5528 MK_OBJN const obj ,
5530 MK_DBG const debug __parser__(default=0),
5531 MK_STRN const callfunc __parser__(default=F#FUNC),
5532 MK_I32 const lvl __parser__(default=0)
5534
5535#define MkObjectLogLong_1X(x) MkObjectLogLong(MkOBJ(x),NULL,0,__func__,0)
5536#define MkObjectLogLong_1M(m) MkObjectLogLong(MkObj(m),NULL,0,__func__,0)
5537
5616 MK_OBJN const obj ,
5618 MK_DBG const debug __parser__(default=0),
5619 MK_STRN const callfunc __parser__(default=F#FUNC),
5620 MK_I32 const lvl __parser__(default=0)
5622
5623#define MkObjectLog_1X(x) MkObjectLog(MkOBJ(x),NULL,0,__func__,0)
5624#define MkObjectLog_2Lvl(o,l) MkObjectLog(o,NULL,0,__func__,l)
5625
5627
5629// MkObjectC_Log_C_API
5630
5631/* ####################################################################### */
5632/* ### ### */
5633/* ### D B G - A P I ### */
5634/* ### ### */
5635/* ####################################################################### */
5636
5644
5645__parser__global__(prefix2class:MkDbg=MkObjectC);
5646
5650__parser__(no-type-extension)
5654 MK_STRN const message ,
5655 MK_DBG const debug __parser__(default=0),
5656 MK_STRN const callfunc __parser__(default=F#FUNC),
5657 MK_I32 const lvl __parser__(default=0)
5659
5660#define MkDbgL_2M(x,message) MkDbgL(MkObj(x),message,0,__func__,-1)
5661
5665__parser__(no-type-extension,template-overload)
5668 MK_OBJN const obj,
5669 MK_STRN const message __parser__(default=S#"var"),
5670 MK_STRN const callfunc __parser__(default=F#FUNC)
5672
5673#define MkDbgDump_2M(x,message) MkDbgDump_2(MkObj(x),message)
5674
5678 MK_STRN const message ,
5679 MK_DBG const debug __parser__(default=0),
5680 MK_STRN const callfunc __parser__(default=F#FUNC),
5681 MK_I32 const lvl __parser__(default=0)
5683
5688 MK_I32 const skip __parser__(default=0),
5689 MK_I32 const num __parser__(default=-1),
5690 MK_STRN const callfunc __parser__(default=F#FUNC)
5692
5693#define MkDbgSTACK_3X(x,num,callfunc) MkDbgSTACK_3(MkOBJ(x),num,callfunc)
5694
5702__parser__(no-type-extension)
5705 MK_OBJN const obj,
5706 MK_STRN const callfunc __parser__(default=F#FUNC)
5708
5709#define MkDbgO_2X(x,callfunc) MkDbgO(MkObj(x),callfunc)
5710#define MkDbgO_1X(x) MkDbgO_2X(x,__func__)
5711#define MkDbgO_1O(x) MkDbgO(x,__func__)
5712
5714__parser__(no-type-extension)
5717 MK_OBJN const obj,
5718 MK_STRN const callfunc __parser__(default=F#FUNC)
5720
5722#define MkDbgLogC_2X(x,callfunc) MkDbgLogC_2(MkOBJ(x),callfunc)
5723
5725// MkObjectC_Dbg_C_API
5726
5727/* MARK_B ################################################################ */
5728/* ### ### */
5729/* ### B U F F E R - A P I ### */
5730/* ### ### */
5731/* ####################################################################### */
5732
5757
5759#define MkBufferS_ils_size (0)
5760
5784// [MkBufferS_example]
5786 // BEGIN-MkBufferS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5787
5788 union {
5789 struct MkObjectS obj; // instance-base MkObjectS
5791
5792 // END-MkBufferS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5793
5794 // instance attributes
5795 struct {
5799 // instance storage
5800 struct {
5811};
5812
5813// BEGIN-MkBufferS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5814
5818 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
5819
5820// Signature --------------------------------------------------------------
5823
5824 #define MkBufferC_SIGNATURE (MkObjectC_SIGNATURE ^ (1u<<10))
5825 #define MkBufferC_MASK (((1u<<22)-1)<<10)
5826
5828
5829// CompileTimeCast --------------------------------------------------------------
5832
5833 #define MkBufferC_X2buf(x) (x)
5834 #define MkBufferC_X2obj(x) MkOBJ(x)
5835
5837
5838// TypeDef --------------------------------------------------------------
5841
5843 __parser__(ignore) typedef struct MkBufferS MkBufferCR;
5845 __parser__(ignore) typedef const struct MkBufferS MkBufferCNR;
5847 #define MkBufferC_T (&MK_RT_REF._MkBufferC_T)
5849 #define MkBufferC_TT (MkTYP(MkBufferC_T))
5851 #define MkBufferST MkBufferC_T
5853 #define MkBufferSTT (MkTYP(MkBufferST))
5855 #define MkBufferC_type MK_BUF
5857 #define MkBufferCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
5859 #define MkBufferCTT_X(instance) (MkOBJ_R(instance).type)
5861 #define MkBufferCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
5863 #define MkBufferC_NS MK
5865 #define MkBufferCTT MkBufferCTT
5867 #define MkBufferCT ( (struct MkTypeDefS *) MkBufferCTT )
5868
5870
5871// TypeCheck --------------------------------------------------------------
5874
5875 #pragma GCC diagnostic push
5876 #pragma GCC diagnostic ignored "-Wattributes"
5877
5880 __parser__(class=MkBufferC,static,hide)
5883 return MkSanitizeCheck(MkBufferC,mng);
5884 }
5885
5888 __parser__(class=MkBufferC,static,hide)
5891 return MkSanitizeCheckO(MkBufferC,obj);
5892 }
5893
5894 #pragma GCC diagnostic pop
5895 #define MkBufferC_Check(mng) MkBufCheck(mng)
5896
5898
5899// RunTimeCast --------------------------------------------------------------
5902
5904 __parser__(class=MkBufferC,hide,static)
5905 META_ATTRIBUTE_SANITIZE
5908 return (MkBufCheck(mng) ? (MK_BUF)mng : NULL);
5909 }
5910
5912 __parser__(class=MkBufferC,hide,static)
5913 META_ATTRIBUTE_SANITIZE
5916 return (MkBufCheck(mng) ? (MK_BUFN)mng : NULL);
5917 }
5918
5920 #define MkBufRaise(_buf) if (!_MkCheckX(MkBufferC,_buf)) { \
5921 MkErrorSetC_1E("'MkBufferC' hdl is NULL"); \
5922 goto error ; \
5923 }
5924
5926 #define MkBUF_R(x) (*(x)).super.buf
5928 #define MkBUF(x) (&MkBUF_R(x))
5929
5931
5934// MkBufferC_Class_Define_C_API
5935
5936// END-MkBufferS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5937// [MkBufferS_example]
5938
5940// MkBufferC_C_API
5941
5942// =========================================================================
5943// BEGIN-MkBufferS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
5944
5947
5950
5951__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkBufferC);
5952
5968__parser__(class-overload=MkObjectHandleGet)
5972 MK_BUF const buf __parser__(null-allowed)
5973) {
5974 return MkObjectHandleGet(buf?MkOBJ(buf):NULL);
5975}
5976
5985__parser__(flags=new)
5989 MK_HDL const netHdl
5990) {
5991 return MkBuf(MkObjectHandleResolve(netHdl));
5992}
5993
6003#define MkBufferHandleResolve_e(netHdl) ({ \
6004 MK_HDL tmpHdl=netHdl; \
6005 MK_BUF tmp; \
6006 if (tmpHdl==0) { \
6007 tmp=NULL; \
6008 } else { \
6009 tmp=MkBufferHandleResolve(tmpHdl); \
6010 if (tmp==NULL) { \
6011 MkErrorSetC_1_NULL("ERROR: 'MkBufferC' handle is 'NULL'"); \
6012 goto error; \
6013 }; \
6014 }; \
6015 tmp; \
6016})
6017
6019
6021// Class export & import
6022
6026 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkBufferC,null-return-allow)
6029 return (MK_BUF)MK_NULL;
6030 }
6032// MkBufferC - Misc - function
6033
6035// MkBufferC_Class_C_API
6036
6037// END-MkBufferS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6038
6039// #######################################################################
6040// -----------------------------------------------------------------------
6052
6054#define MkBuffer64S_ils_size (64)
6055
6059__parser__(ignore)
6061 // BEGIN-MkBuffer64S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6062
6063 union {
6064 struct MkObjectS obj; // instance-base MkObjectS
6065 struct MkBufferS buf; // instance-base MkBufferS
6067
6068 // END-MkBuffer64S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6069
6070 // instance attributes
6072};
6073
6074// BEGIN-MkBuffer64S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6075
6079 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
6080
6081// Signature --------------------------------------------------------------
6084
6085 #define MkBuffer64C_SIGNATURE (MkBufferC_SIGNATURE ^ (1u<<6))
6086 #define MkBuffer64C_MASK (((1u<<26)-1)<<6)
6087
6089
6090// CompileTimeCast --------------------------------------------------------------
6093
6094 #define MkBuffer64C_X2buf(x) MkBUF(x)
6095 #define MkBuffer64C_X2obj(x) MkOBJ(x)
6096
6098
6099// TypeDef --------------------------------------------------------------
6102
6104 __parser__(ignore) typedef struct MkBuffer64S MkBuffer64CR;
6106 __parser__(ignore) typedef const struct MkBuffer64S MkBuffer64CNR;
6108 #define MkBuffer64C_T (&MK_RT_REF._MkBuffer64C_T)
6110 #define MkBuffer64C_TT (MkTYP(MkBuffer64C_T))
6112 #define MkBuffer64ST MkBuffer64C_T
6114 #define MkBuffer64STT (MkTYP(MkBuffer64ST))
6116 #define MkBuffer64CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
6118 #define MkBuffer64CTT_X(instance) (MkOBJ_R(instance).type)
6120 #define MkBuffer64CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
6122 #define MkBuffer64C_NS MK
6124 #define MkBuffer64CTT MkBuffer64CTT
6126 #define MkBuffer64CT ( (struct MkTypeDefS *) MkBuffer64CTT )
6127
6129
6132// MkBuffer64C_Class_Define_C_API
6133
6134// END-MkBuffer64S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6135
6137// MkBuffer64C_C_API
6138
6139// #######################################################################
6140// -----------------------------------------------------------------------
6146
6148#define MkBuffer256S_ils_size (256)
6149
6153__parser__(ignore)
6155 // BEGIN-MkBuffer256S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6156
6157 union {
6158 struct MkObjectS obj; // instance-base MkObjectS
6159 struct MkBufferS buf; // instance-base MkBufferS
6161
6162 // END-MkBuffer256S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6163
6164 // instance attributes
6166};
6167
6168// BEGIN-MkBuffer256S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6169
6173 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
6174
6175// Signature --------------------------------------------------------------
6178
6179 #define MkBuffer256C_SIGNATURE (MkBufferC_SIGNATURE ^ (2u<<6))
6180 #define MkBuffer256C_MASK (((1u<<26)-1)<<6)
6181
6183
6184// CompileTimeCast --------------------------------------------------------------
6187
6188 #define MkBuffer256C_X2buf(x) MkBUF(x)
6189 #define MkBuffer256C_X2obj(x) MkOBJ(x)
6190
6192
6193// TypeDef --------------------------------------------------------------
6196
6198 __parser__(ignore) typedef struct MkBuffer256S MkBuffer256CR;
6200 __parser__(ignore) typedef const struct MkBuffer256S MkBuffer256CNR;
6202 #define MkBuffer256C_T (&MK_RT_REF._MkBuffer256C_T)
6204 #define MkBuffer256C_TT (MkTYP(MkBuffer256C_T))
6206 #define MkBuffer256ST MkBuffer256C_T
6208 #define MkBuffer256STT (MkTYP(MkBuffer256ST))
6210 #define MkBuffer256CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
6212 #define MkBuffer256CTT_X(instance) (MkOBJ_R(instance).type)
6214 #define MkBuffer256CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
6216 #define MkBuffer256C_NS MK
6218 #define MkBuffer256CTT MkBuffer256CTT
6220 #define MkBuffer256CT ( (struct MkTypeDefS *) MkBuffer256CTT )
6221
6223
6226// MkBuffer256C_Class_Define_C_API
6227
6228// END-MkBuffer256S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6229
6231// MkBuffer256C_C_API
6232
6233// #######################################################################
6234// -----------------------------------------------------------------------
6240
6242#define MkBuffer1024S_ils_size (1024)
6243
6247__parser__(ignore)
6249 // BEGIN-MkBuffer1024S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6250
6251 union {
6252 struct MkObjectS obj; // instance-base MkObjectS
6253 struct MkBufferS buf; // instance-base MkBufferS
6255
6256 // END-MkBuffer1024S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6257
6258 // instance attributes
6260};
6261
6262// BEGIN-MkBuffer1024S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6263
6267 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
6268
6269// Signature --------------------------------------------------------------
6272
6273 #define MkBuffer1024C_SIGNATURE (MkBufferC_SIGNATURE ^ (3u<<6))
6274 #define MkBuffer1024C_MASK (((1u<<26)-1)<<6)
6275
6277
6278// CompileTimeCast --------------------------------------------------------------
6281
6282 #define MkBuffer1024C_X2buf(x) MkBUF(x)
6283 #define MkBuffer1024C_X2obj(x) MkOBJ(x)
6284
6286
6287// TypeDef --------------------------------------------------------------
6290
6294 __parser__(ignore) typedef const struct MkBuffer1024S MkBuffer1024CNR;
6296 #define MkBuffer1024C_T (&MK_RT_REF._MkBuffer1024C_T)
6298 #define MkBuffer1024C_TT (MkTYP(MkBuffer1024C_T))
6300 #define MkBuffer1024ST MkBuffer1024C_T
6302 #define MkBuffer1024STT (MkTYP(MkBuffer1024ST))
6304 #define MkBuffer1024CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
6306 #define MkBuffer1024CTT_X(instance) (MkOBJ_R(instance).type)
6308 #define MkBuffer1024CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
6310 #define MkBuffer1024C_NS MK
6312 #define MkBuffer1024CTT MkBuffer1024CTT
6314 #define MkBuffer1024CT ( (struct MkTypeDefS *) MkBuffer1024CTT )
6315
6317
6320// MkBuffer1024C_Class_Define_C_API
6321
6322// END-MkBuffer1024S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
6323
6325// MkBuffer1024C_C_API
6326
6327#ifndef __has_parser__
6328
6338#define MkBuf2XXXfast(buf) (*(buf)->storage.first.A)
6339
6340#define MkBuf2BOLfast(buf) MkBuf2XXXfast(buf).BOL
6341#define MkBuf2I8fast(buf) MkBuf2XXXfast(buf).I8
6342#define MkBuf2I16fast(buf) MkBuf2XXXfast(buf).I16
6343#define MkBuf2I32fast(buf) MkBuf2XXXfast(buf).I32
6344#define MkBuf2I64fast(buf) MkBuf2XXXfast(buf).I64
6345#define MkBuf2FLTfast(buf) MkBuf2XXXfast(buf).FLT
6346#define MkBuf2DBLfast(buf) MkBuf2XXXfast(buf).DBL
6348
6355#define MkBuf2XXX(xxx,len,buf) ({MK_##xxx __tmp; memcpy(&__tmp,buf->storage.first.B,len); __tmp;})
6356
6357#define MkBuf2BOL(buf) MkBuf2XXX(BOL,1,buf)
6358#define MkBuf2I8(buf) MkBuf2XXX(I8,1,buf)
6359#define MkBuf2I16(buf) MkBuf2XXX(I16,2,buf)
6360#define MkBuf2I32(buf) MkBuf2XXX(I32,4,buf)
6361#define MkBuf2I64(buf) MkBuf2XXX(I64,8,buf)
6362#define MkBuf2FLT(buf) MkBuf2XXX(FLT,4,buf)
6363#define MkBuf2DBL(buf) MkBuf2XXX(DBL,8,buf)
6364
6365#define MkBuf2Ptr(len,ptr,buf) memcpy((void*)ptr,buf->storage.first.B,len)
6366#define MkBuf2BOL_P(ptr,buf) MkBuf2Ptr(1,ptr,buf)
6367#define MkBuf2I8_P(ptr,buf) MkBuf2Ptr(1,ptr,buf)
6368#define MkBuf2I16_P(ptr,buf) MkBuf2Ptr(2,ptr,buf)
6369#define MkBuf2I32_P(ptr,buf) MkBuf2Ptr(4,ptr,buf)
6370#define MkBuf2I64_P(ptr,buf) MkBuf2Ptr(8,ptr,buf)
6371#define MkBuf2FLT_P(ptr,buf) MkBuf2Ptr(4,ptr,buf)
6372#define MkBuf2DBL_P(ptr,buf) MkBuf2Ptr(8,ptr,buf)
6373
6374#define MkBuf2Ptr_A(l,a,b) memcpy(a.B##l,b->storage.first.B,l)
6375#define MkBuf2BOL_A(ato,buf) MkBuf2Ptr_A(1,ato,buf)
6376#define MkBuf2I8_A(ato,buf) MkBuf2Ptr_A(1,ato,buf)
6377#define MkBuf2I16_A(ato,buf) MkBuf2Ptr_A(2,ato,buf)
6378#define MkBuf2I32_A(ato,buf) MkBuf2Ptr_A(4,ato,buf)
6379#define MkBuf2I64_A(ato,buf) MkBuf2Ptr_A(8,ato,buf)
6380#define MkBuf2FLT_A(ato,buf) MkBuf2Ptr_A(4,ato,buf)
6381#define MkBuf2DBL_A(ato,buf) MkBuf2Ptr_A(8,ato,buf)
6382
6384// MkBuf2TT
6385
6386#endif // !__has_parser__
6387
6388__parser__push__(hide,overload-c-no);
6389
6403
6407 MK_STRN const str,
6408 MK_NUM const length,
6409 MK_BOL *val_out
6411
6412#define MkString2O(s,l,r) MkString2BOL_RT(MK_RT_CALL s,l,r)
6413
6416 MK_STRN const str,
6417 MK_NUM const length,
6418 MK_I8 *val_out
6420
6421#define MkString2Y(s,l,r) MkString2I8_RT(MK_RT_CALL s,l,r)
6422
6425 MK_STRN const str,
6426 MK_NUM const length,
6427 MK_I16 *val_out
6429
6430#define MkString2S(s,l,r) MkString2I16_RT(MK_RT_CALL s,l,r)
6431
6434 MK_STRN const str,
6435 MK_NUM const length,
6436 MK_U16 *val_out
6438
6439#define MkString2US(s,l,r) MkString2U16_RT(MK_RT_CALL s,l,r)
6440
6443 MK_STRN const str,
6444 MK_NUM const length,
6445 MK_I32 *val_out
6447
6448#define MkString2I(s,l,r) MkString2I32_RT(MK_RT_CALL s,l,r)
6449
6452 MK_STRN const str,
6453 MK_NUM const length,
6454 MK_U32 *val_out
6456
6457#define MkString2UI(s,l,r) MkString2U32_RT(MK_RT_CALL s,l,r)
6458
6461 MK_STRN const str,
6462 MK_NUM const length,
6463 MK_I64 *val_out
6465
6466#define MkString2W(s,l,r) MkString2I64_RT(MK_RT_CALL s,l,r)
6467
6468/*
6469MK_EXTERN enum MkErrorE MK_DECL MkString2LLG_RT (
6470 MK_PARSER_RT
6471 MK_STRN const str,
6472 MK_NUM const length,
6473 MK_LLG *val_out
6474) MK_ATTR_RT_STATIC;
6475
6476#define MkString2X(s,l,r) MkString2LLG_RT(MK_RT_CALL s,l,r)
6477*/
6478
6481 MK_STRN const str,
6482 MK_NUM const length,
6483 MK_FLT *val_out
6485
6486#define MkString2F(s,l,r) MkString2FLT_RT(MK_RT_CALL s,l,r)
6487
6490 MK_STRN const str,
6491 MK_NUM const length,
6492 MK_DBL *val_out
6494
6495#define MkString2D(s,l,r) MkString2DBL_RT(MK_RT_CALL s,l,r)
6496
6499 MK_STRN const str,
6500 MK_NUM const length,
6501 MK_LONG *val_out
6503
6506 MK_STRN const str,
6507 MK_NUM const length,
6508 MK_BOOL *val_out
6510
6511__parser__(internal)
6514 MK_STRN const str,
6515 MK_NUM const length,
6516 enum MkTypeE type,
6517 MK_ATO *val_out
6519
6522 MK_STRN const str,
6523 MK_NUM const length,
6524 MK_HDL *val_out
6526
6528
6530// MkString2TT
6532// MkBufferC_C_API
6533
6534// #######################################################################
6535// -----------------------------------------------------------------------
6540
6541__parser__push__(doc-group=TOR);
6542
6555// [MkBufferCreate]
6556__parser__(constructor,lng-constr)
6559 MK_TYP type __parser__(internal,default=NULL),
6560 MK_NUM const size __parser__(default=0)
6562// [MkBufferCreate]
6563
6565__parser__(constructor,doc-sort=ils0)
6568 MK_NUM const size __parser__(default=0)
6570
6572__parser__(constructor,doc-sort=ils1)
6575 MK_NUM const size __parser__(default=0)
6577
6579__parser__(constructor,doc-sort=ils2)
6582 MK_NUM const size __parser__(default=0)
6584
6585__parser__(constructor,macro,doc-sort=tmpl0)
6599// [MkBufferCreateTLS_T]
6600#define MkBufferCreateTLS_T(cls,name,size) \
6601 static MkThreadLocal cls##R name##R = {0}; \
6602 MK_BUF name = MkBUF(&name##R); \
6603 if (unlikely(!__MkCheckX(cls,&name##R))) { \
6604 MkBufferInit(name,cls##_TT,size); \
6605 MkRefIncr_1X(name); \
6606 } else if (MkBUF_R(&name##R).var.cursize) { \
6607 MkBufferReset(name); \
6608 }
6609// [MkBufferCreateTLS_T]
6610
6611__parser__(constructor,macro,doc-sort=tmpl1)
6619// [MkBufferCreateTLS_inout_T]
6620#define MkBufferCreateTLS_inout_T(cls,name,inout) \
6621 static MkThreadLocal struct MkBufferS __hidden_##name##R = {0}; \
6622 MK_BUF name = *inout != NULL ? *inout : &__hidden_##name##R; \
6623 if (likely(!__MkCheckX(MkBufferC,name))) { \
6624 MkBufferInit(name,cls##_TT,0); \
6625 MkRefIncr_1X(name); \
6626 } else if (name->var.cursize) { \
6627 MkBufferReset(name); \
6628 } \
6629// [MkBufferCreateTLS_inout_T]
6630
6631__parser__(constructor,macro,doc-sort=tmpl2)
6646// [MkBufferCreateLOCAL_T]
6647#define MkBufferCreateLOCAL_T(cls,name,size) \
6648 cls##R name##R = {0}; \
6649 struct MkBufferS * const name = MkBUF(&name##R); \
6650 MkBufferInit(name,cls##_TT,size)
6651// [MkBufferCreateLOCAL_T]
6652
6661__parser__(constructor)
6664 MK_I8 const val
6666
6669__parser__(constructor)
6672 MK_BOL const val
6674
6677__parser__(constructor)
6680 MK_I16 const val
6682
6685__parser__(constructor)
6688 MK_I32 const val
6690
6693__parser__(constructor)
6696 MK_FLT const val
6698
6701__parser__(constructor)
6704 MK_I64 const val
6706
6709__parser__(constructor)
6712 MK_DBL const val
6714
6717__parser__(constructor)
6720 MK_STRN const val
6722
6725__parser__(constructor)
6728 MkBinaryR const val
6730
6743__parser__(doc-sort=b0)
6746 MK_STRN const tlsName ,
6747 bool const resetB __parser__(default=true)
6749
6752__parser__(constructor,static,doc-sort=b1)
6755 MK_BUFN const val
6757
6778__parser__(internal)
6781 MK_BUF const buf
6783
6788// [MkBufferInit]
6789__parser__(internal)
6792 MK_BUF const buf,
6793 MK_TYP type __parser__(internal,default=NULL),
6794 MK_NUM const size __parser__(default=0)
6796// [MkBufferInit]
6797
6803__parser__(destructor)
6806 MK_BUF const buf
6808
6818__parser__(constructor)
6821 MK_BUFN const buf
6823
6839__parser__(constructor)
6842 MK_BUF const buf
6844
6845__parser__pop__; // TOR
6846
6848// MkBufferC_TOR_C_API
6849
6850// #######################################################################
6851// -----------------------------------------------------------------------
6856
6857__parser__global__(prefix2doc:MkBufferGet=Get);
6858
6872 MK_BUFN const buf,
6873 MK_I8 * const val_out
6875
6880 MK_BUFN const buf,
6881 MK_BOL * const val_out
6883
6888 MK_BUFN const buf,
6889 MK_I16 * const val_out
6891
6894__parser__(internal)
6897 MK_BUFN const buf,
6898 MK_U16 * const val_out
6900
6905 MK_BUFN const buf,
6906 MK_I32 * const val_out
6908
6911__parser__(internal)
6914 MK_BUFN const buf,
6915 MK_U32 * const val_out
6917
6922 MK_BUFN const buf,
6923 MK_FLT * const val_out
6925
6930 MK_BUFN const buf,
6931 MK_I64 * const val_out
6933
6934/*
6937__parser__(internal)
6938MK_EXTERN enum MkErrorE MK_DECL MkBufferGetLL_RT (
6939 MK_PARSER_RT
6940 MK_BUFN const buf,
6941 MK_LLG * const val_out
6942) MK_ATTR_RT_INSTANCE;
6943
6944#define MkBufferGetLLG(b,o) MkBufferGetLL(b,o)
6945*/
6946
6951 MK_BUFN const buf,
6952 MK_DBL * const val_out
6954
6961 MK_BUFN const buf,
6962 MkBinaryR * const val_out
6964
6968// [__parser__out__]
6971 MK_BUFN const buf,
6972 MK_STRN * const val_out
6974// [__parser__out__]
6975
6982 MK_BUFN const buf,
6983 MkStringR * const val_out
6985
6991 MK_BUF const buf,
6992 MK_BUF * const val_out
6994
7004__parser__(no-static)
7007 MK_BUFN const buf,
7008 MK_BFL * const val_inout
7010
7013__parser__(internal)
7016 MK_BUFN const buf,
7017 MK_LONG * const val_out
7019
7022__parser__(internal)
7025 MK_BUFN const buf,
7026 MK_BOOL * const val_out
7028
7030// MkBufferC_Get_C_API
7031
7032
7033// #######################################################################
7034// -----------------------------------------------------------------------
7039
7040__parser__global__(prefix2doc:MkBufferSet=Set);
7041
7053 MK_BUF const buf,
7054 MK_I8 const val
7056
7061 MK_BUF const buf,
7062 MK_BOL const val
7064
7069 MK_BUF const buf,
7070 MK_I16 const val
7072
7077 MK_BUF const buf,
7078 MK_I32 const val
7080
7085 MK_BUF const buf,
7086 MK_FLT const val
7088
7093 MK_BUF const buf,
7094 MK_I64 const val
7096
7101 MK_BUF const buf,
7102 MK_DBL const val
7104
7109 MK_BUF const buf,
7110 MK_STRN const val
7112
7117 MK_BUF const buf,
7118 MkBinaryR const val
7120
7125 MK_BUF const buf,
7126 MK_BUFN const val
7128
7135 MK_BUF const buf,
7136 MK_FST const val,
7137 va_list var_list
7139
7145 MK_BUF const buf,
7146 MK_FST const val,
7147 ...
7149
7154 MK_BUF const buf,
7155 MkBinaryR const val
7157
7162 MK_BUF const buf,
7163 MkStringR const val
7165
7167// MkBufferC_Set_C_API
7168
7169// #######################################################################
7170// -----------------------------------------------------------------------
7175
7176__parser__push__(doc-group=Info);
7177
7181__parser__(no-rpc)
7184 MK_BUFN const buf
7186
7192 MK_BUFN const buf
7194
7200 MK_BUFN const buf
7202
7210 MK_BUFN const buf
7212
7223__parser__(const,class-overload=MkObjectLog)
7226 MK_BUFN const buf ,
7228 MK_DBG const debug __parser__(default=0),
7229 MK_STRN const callfunc __parser__(default=F#FUNC),
7230 MK_I32 const lvl __parser__(default=0)
7232
7240__parser__(internal)
7243 MK_BUFN const buf,
7244 MK_STRN const varname __parser__(default=S#"buf"),
7246 MK_STRN const callfunc __parser__(default=F#FUNC)
7248
7258 MK_BUFN const buf,
7259 MK_STRN const varname __parser__(default=S#"buf"),
7261 MK_STRN const callfunc __parser__(default=F#FUNC)
7263
7264#define MkBufferLogS_2V(buf,fmt) MkBufferLogS_3(buf,#fmt,MkOBJ(fmt))
7265
7267
7269// MkBufferC_Info_C_API
7270
7271
7272// #######################################################################
7273// -----------------------------------------------------------------------
7278
7291 MK_BUFN const buf1,
7292 MK_BUFN const buf2
7294
7304 MK_BUF const buf, // TODO: special case update buffer should be default return
7305 enum MkTypeE const typ
7307
7309__parser__(class-overload=MkObjectToString)
7313 MK_BUFN const inst
7315
7326 MK_BUF const buf,
7327 MK_NUM const size
7329
7339 MK_BUF const buf,
7340 MK_NUM const size
7342
7350 MK_BUF const buf
7352
7362 MK_BUF const buf
7364
7371__parser__(const)
7374 MK_BUF const buf,
7375 MK_BUFN const srce
7377
7390__parser__(no-static)
7393 MK_BUFN const buf
7395
7397// MkBufferC_Misc_C_API
7398
7399
7400// #######################################################################
7401// -----------------------------------------------------------------------
7406
7407__parser__push__(doc-group=Access);
7408
7417__parser__(no-type-extension)
7420 MK_BUF const buf,
7421 MK_STRN const val
7423
7432__parser__(no-type-extension)
7435 MK_BUF const buf,
7436 MkStringR const val
7438
7448 MK_BUF const buf,
7449 MK_FST const printfmt,
7450 va_list var_list
7452
7461 MK_BUF const buf,
7462 MK_FST const printfmt,
7463 ...
7465
7475 MK_BUF const buf,
7476 MK_STRN const val
7478
7488 MK_BUF const buf,
7489 MK_STRN const val
7491
7493__parser__(template-required,no-rpc,keep,no-static)
7496 MK_BUF const buf,
7497 MK_NAT_OBJECT * obj_out
7499
7501
7503// MkBufferC_Access_C_API
7504
7505/* MARK_S ################################################################ */
7506/* ### ### */
7507/* ### B U F F E R - S T R E A M - A P I ### */
7508/* ### ### */
7509/* ####################################################################### */
7510
7526
7545
7546struct MkBufferStreamSaveS;
7547
7549#define MkBufferStreamS_ils_size (0)
7550
7578// [MkBufferStreamS_example]
7580 // BEGIN-MkBufferStreamS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7581
7582 union {
7583 struct MkObjectS obj; // instance-base MkObjectS
7584 struct MkBufferS buf; // instance-base MkBufferS
7586
7587 // END-MkBufferStreamS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7588
7589 // instance attributes
7590 struct {
7591 MK_NUM numItems; // the number of items in the package
7592 MK_I32 undo; // \e undo last operation: read=+1 < no=0 < write=-1)
7593 // \note The \e endian_is_wrong attribute is required if a \RMkBufferStreamC is send to
7594 // an other host. The \e sender-endian is part of the \e package-header and the \e reader is using
7595 // the information from the \e package-header to setup the \e endian_is_wrong attribute.
7596 // \li \b false (0) if the endian is the \b same as the local endian.
7597 // \li \b true (1) if the endian is \b not the same as the local endian.
7598 // If \e endian_is_wrong is \b true the package header transform the native-binary-package-data
7599 // to the local endian as part of the \RDocMqA{ReadTT} and \RDocNsA{BufferStreamReadTT} methods.
7600 // The transformation of native data is \b only done if required, just \e routing of a package
7601 // does \b not require a transformation.
7602 bool endian_is_wrong; // the value: \e TRUE if endian of storage != \c MK_ENDIAN_MY
7603 } var; // variable part of the \e instance-data
7604 struct {
7611 } storage; // storage part of the \e instance-data
7612
7613 // BUG FIX don't put busRef into "var" -> the pMkBusReadL_END will "overwrite" the data including the
7614 // "self" pointer
7615 struct MkBuffer64S busRef; // pBusReadNextWord will fill this
7616
7617 struct MkCacheS saveCache; // cache to support recursion in LST sub-package
7618 struct MkBufferStreamSaveS * busWriteSave; // if \b not NULL than an active LST-WRITE is ongoing
7619 struct MkBufferStreamSaveS * busReadSave; // if \b not NULL than an active LST-READ is ongoing
7620
7622};
7623// [MkBufferStreamS_example]
7624
7625// BEGIN-MkBufferStreamS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7626
7630 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
7631
7632// Signature --------------------------------------------------------------
7635
7636 #define MkBufferStreamC_SIGNATURE (MkBufferC_SIGNATURE ^ (4u<<6))
7637 #define MkBufferStreamC_MASK (((1u<<26)-1)<<6)
7638
7640
7641// CompileTimeCast --------------------------------------------------------------
7644
7645 #define MkBufferStreamC_X2bus(x) (x)
7646 #define MkBufferStreamC_X2buf(x) MkBUF(x)
7647 #define MkBufferStreamC_X2obj(x) MkOBJ(x)
7648
7650
7651// TypeDef --------------------------------------------------------------
7654
7658 __parser__(ignore) typedef const struct MkBufferStreamS MkBufferStreamCNR;
7660 #define MkBufferStreamC_T (&MK_RT_REF._MkBufferStreamC_T)
7662 #define MkBufferStreamC_TT (MkTYP(MkBufferStreamC_T))
7664 #define MkBufferStreamST MkBufferStreamC_T
7666 #define MkBufferStreamSTT (MkTYP(MkBufferStreamST))
7668 #define MkBufferStreamC_type MK_BUS
7670 #define MkBufferStreamCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
7672 #define MkBufferStreamCTT_X(instance) (MkOBJ_R(instance).type)
7674 #define MkBufferStreamCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
7676 #define MkBufferStreamC_NS MK
7678 #define MkBufferStreamCTT MkBufferStreamCTT
7680 #define MkBufferStreamCT ( (struct MkTypeDefS *) MkBufferStreamCTT )
7681
7683
7684// TypeCheck --------------------------------------------------------------
7687
7688 #pragma GCC diagnostic push
7689 #pragma GCC diagnostic ignored "-Wattributes"
7690
7693 __parser__(class=MkBufferStreamC,static,hide)
7696 return MkSanitizeCheck(MkBufferStreamC,mng);
7697 }
7698
7701 __parser__(class=MkBufferStreamC,static,hide)
7704 return MkSanitizeCheckO(MkBufferStreamC,obj);
7705 }
7706
7707 #pragma GCC diagnostic pop
7708 #define MkBufferStreamC_Check(mng) MkBusCheck(mng)
7709
7711
7712// RunTimeCast --------------------------------------------------------------
7715
7717 __parser__(class=MkBufferStreamC,hide,static)
7718 META_ATTRIBUTE_SANITIZE
7721 return (MkBusCheck(mng) ? (MK_BUS)mng : NULL);
7722 }
7723
7725 __parser__(class=MkBufferStreamC,hide,static)
7726 META_ATTRIBUTE_SANITIZE
7729 return (MkBusCheck(mng) ? (MK_BUSN)mng : NULL);
7730 }
7731
7733 #define MkBusRaise(_bus) if (!_MkCheckX(MkBufferStreamC,_bus)) { \
7734 MkErrorSetC_1E("'MkBufferStreamC' hdl is NULL"); \
7735 goto error ; \
7736 }
7737
7739 #define MkBUS_R(x) (*(x)).super.bus
7741 #define MkBUS(x) (&MkBUS_R(x))
7742
7744
7747// MkBufferStreamC_Class_Define_C_API
7748
7749// END-MkBufferStreamS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7750
7751// =========================================================================
7752// BEGIN-MkBufferStreamS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7753
7756
7759
7760__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkBufferStreamC);
7761
7777__parser__(class-overload=MkObjectHandleGet)
7781 MK_BUS const bus __parser__(null-allowed)
7782) {
7783 return MkObjectHandleGet(bus?MkOBJ(bus):NULL);
7784}
7785
7794__parser__(flags=new)
7798 MK_HDL const netHdl
7799) {
7800 return MkBus(MkObjectHandleResolve(netHdl));
7801}
7802
7812#define MkBufferStreamHandleResolve_e(netHdl) ({ \
7813 MK_HDL tmpHdl=netHdl; \
7814 MK_BUS tmp; \
7815 if (tmpHdl==0) { \
7816 tmp=NULL; \
7817 } else { \
7818 tmp=MkBufferStreamHandleResolve(tmpHdl); \
7819 if (tmp==NULL) { \
7820 MkErrorSetC_1_NULL("ERROR: 'MkBufferStreamC' handle is 'NULL'"); \
7821 goto error; \
7822 }; \
7823 }; \
7824 tmp; \
7825})
7826
7828
7830// Class export & import
7831
7835 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkBufferStreamC,null-return-allow)
7838 return (MK_BUS)MK_NULL;
7839 }
7841// MkBufferStreamC - Misc - function
7842
7844// MkBufferStreamC_Class_C_API
7845
7846// END-MkBufferStreamS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7847
7848// #######################################################################
7849// -----------------------------------------------------------------------
7855
7857#define MkBufferStream64_ils_size (64)
7858
7862__parser__(ignore)
7864 // BEGIN-MkBufferStream64S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7865
7866 union {
7867 struct MkObjectS obj; // instance-base MkObjectS
7868 struct MkBufferS buf; // instance-base MkBufferS
7869 struct MkBufferStreamS bus; // instance-base MkBufferStreamS
7871
7872 // END-MkBufferStream64S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7873
7874 // instance attributes
7876};
7877
7878// BEGIN-MkBufferStream64S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7879
7883 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
7884
7885// Signature --------------------------------------------------------------
7888
7889 #define MkBufferStream64C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (3u<<3))
7890 #define MkBufferStream64C_MASK (((1u<<29)-1)<<3)
7891
7893
7894// CompileTimeCast --------------------------------------------------------------
7897
7898 #define MkBufferStream64C_X2bus(x) MkBUS(x)
7899 #define MkBufferStream64C_X2buf(x) MkBUF(x)
7900 #define MkBufferStream64C_X2obj(x) MkOBJ(x)
7901
7903
7904// TypeDef --------------------------------------------------------------
7907
7913 #define MkBufferStream64C_T (&MK_RT_REF._MkBufferStream64C_T)
7915 #define MkBufferStream64C_TT (MkTYP(MkBufferStream64C_T))
7917 #define MkBufferStream64ST MkBufferStream64C_T
7919 #define MkBufferStream64STT (MkTYP(MkBufferStream64ST))
7921 #define MkBufferStream64CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
7923 #define MkBufferStream64CTT_X(instance) (MkOBJ_R(instance).type)
7925 #define MkBufferStream64CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
7927 #define MkBufferStream64C_NS MK
7929 #define MkBufferStream64CTT MkBufferStream64CTT
7931 #define MkBufferStream64CT ( (struct MkTypeDefS *) MkBufferStream64CTT )
7932
7934
7937// MkBufferStream64C_Class_Define_C_API
7938
7939// END-MkBufferStream64S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7940
7942
7943// #######################################################################
7944// -----------------------------------------------------------------------
7950
7952#define MkBufferStream256S_ils_size (256)
7953
7957__parser__(ignore)
7959 // BEGIN-MkBufferStream256S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7960
7961 union {
7962 struct MkObjectS obj; // instance-base MkObjectS
7963 struct MkBufferS buf; // instance-base MkBufferS
7964 struct MkBufferStreamS bus; // instance-base MkBufferStreamS
7966
7967 // END-MkBufferStream256S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7968
7969 // instance attributes
7971};
7972
7973// BEGIN-MkBufferStream256S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
7974
7978 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
7979
7980// Signature --------------------------------------------------------------
7983
7984 #define MkBufferStream256C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (2u<<3))
7985 #define MkBufferStream256C_MASK (((1u<<29)-1)<<3)
7986
7988
7989// CompileTimeCast --------------------------------------------------------------
7992
7993 #define MkBufferStream256C_X2bus(x) MkBUS(x)
7994 #define MkBufferStream256C_X2buf(x) MkBUF(x)
7995 #define MkBufferStream256C_X2obj(x) MkOBJ(x)
7996
7998
7999// TypeDef --------------------------------------------------------------
8002
8008 #define MkBufferStream256C_T (&MK_RT_REF._MkBufferStream256C_T)
8010 #define MkBufferStream256C_TT (MkTYP(MkBufferStream256C_T))
8012 #define MkBufferStream256ST MkBufferStream256C_T
8014 #define MkBufferStream256STT (MkTYP(MkBufferStream256ST))
8016 #define MkBufferStream256CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
8018 #define MkBufferStream256CTT_X(instance) (MkOBJ_R(instance).type)
8020 #define MkBufferStream256CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
8022 #define MkBufferStream256C_NS MK
8024 #define MkBufferStream256CTT MkBufferStream256CTT
8026 #define MkBufferStream256CT ( (struct MkTypeDefS *) MkBufferStream256CTT )
8027
8029
8032// MkBufferStream256C_Class_Define_C_API
8033
8034// END-MkBufferStream256S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
8035
8037
8038// #######################################################################
8039// -----------------------------------------------------------------------
8045
8047#define MkBufferStream1024_ils_size (1024)
8048
8052__parser__(ignore)
8054 // BEGIN-MkBufferStream1024S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
8055
8056 union {
8057 struct MkObjectS obj; // instance-base MkObjectS
8058 struct MkBufferS buf; // instance-base MkBufferS
8059 struct MkBufferStreamS bus; // instance-base MkBufferStreamS
8061
8062 // END-MkBufferStream1024S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
8063
8064 // instance attributes
8066};
8067
8068// BEGIN-MkBufferStream1024S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
8069
8073 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
8074
8075// Signature --------------------------------------------------------------
8078
8079 #define MkBufferStream1024C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (4u<<3))
8080 #define MkBufferStream1024C_MASK (((1u<<29)-1)<<3)
8081
8083
8084// CompileTimeCast --------------------------------------------------------------
8087
8088 #define MkBufferStream1024C_X2bus(x) MkBUS(x)
8089 #define MkBufferStream1024C_X2buf(x) MkBUF(x)
8090 #define MkBufferStream1024C_X2obj(x) MkOBJ(x)
8091
8093
8094// TypeDef --------------------------------------------------------------
8097
8103 #define MkBufferStream1024C_T (&MK_RT_REF._MkBufferStream1024C_T)
8105 #define MkBufferStream1024C_TT (MkTYP(MkBufferStream1024C_T))
8107 #define MkBufferStream1024ST MkBufferStream1024C_T
8109 #define MkBufferStream1024STT (MkTYP(MkBufferStream1024ST))
8111 #define MkBufferStream1024CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
8113 #define MkBufferStream1024CTT_X(instance) (MkOBJ_R(instance).type)
8115 #define MkBufferStream1024CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
8117 #define MkBufferStream1024C_NS MK
8119 #define MkBufferStream1024CTT MkBufferStream1024CTT
8121 #define MkBufferStream1024CT ( (struct MkTypeDefS *) MkBufferStream1024CTT )
8122
8124
8127// MkBufferStream1024C_Class_Define_C_API
8128
8129// END-MkBufferStream1024S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
8130
8132
8133// #######################################################################
8134// -----------------------------------------------------------------------
8140
8142#define MkBufferStream16384S_ils_size (16384)
8143
8147__parser__(ignore)
8149 // BEGIN-MkBufferStream16384S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
8150
8151 union {
8152 struct MkObjectS obj; // instance-base MkObjectS
8153 struct MkBufferS buf; // instance-base MkBufferS
8154 struct MkBufferStreamS bus; // instance-base MkBufferStreamS
8156
8157 // END-MkBufferStream16384S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
8158
8159 // instance attributes
8161};
8162
8163// BEGIN-MkBufferStream16384S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
8164
8168 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
8169
8170// Signature --------------------------------------------------------------
8173
8174 #define MkBufferStream16384C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (1u<<3))
8175 #define MkBufferStream16384C_MASK (((1u<<29)-1)<<3)
8176
8178
8179// CompileTimeCast --------------------------------------------------------------
8182
8183 #define MkBufferStream16384C_X2bus(x) MkBUS(x)
8184 #define MkBufferStream16384C_X2buf(x) MkBUF(x)
8185 #define MkBufferStream16384C_X2obj(x) MkOBJ(x)
8186
8188
8189// TypeDef --------------------------------------------------------------
8192
8198 #define MkBufferStream16384C_T (&MK_RT_REF._MkBufferStream16384C_T)
8200 #define MkBufferStream16384C_TT (MkTYP(MkBufferStream16384C_T))
8202 #define MkBufferStream16384ST MkBufferStream16384C_T
8204 #define MkBufferStream16384STT (MkTYP(MkBufferStream16384ST))
8206 #define MkBufferStream16384CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
8208 #define MkBufferStream16384CTT_X(instance) (MkOBJ_R(instance).type)
8210 #define MkBufferStream16384CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
8212 #define MkBufferStream16384C_NS MK
8214 #define MkBufferStream16384CTT MkBufferStream16384CTT
8216 #define MkBufferStream16384CT ( (struct MkTypeDefS *) MkBufferStream16384CTT )
8217
8219
8222// MkBufferStream16384C_Class_Define_C_API
8223
8224// END-MkBufferStream16384S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
8225
8227__parser__(ignore)
8229
8231
8232/* ####################################################################### */
8233/* ### ### */
8234/* ### BufferStream - T O R - Api ### */
8235/* ### ### */
8236/* ####################################################################### */
8237
8244__parser__push__(doc-group=TOR);
8245
8254__parser__(constructor,lng-constr)
8257 MK_TYP type __parser__(internal,default=NULL),
8258 MK_NUM const size __parser__(default=0)
8260
8261#define MkBufferStreamCreate_1(size) MkBufferStreamCreate(NULL,size)
8262
8264__parser__(constructor)
8267 MK_NUM const size __parser__(default=0)
8269
8271__parser__(constructor)
8274 MK_NUM const size __parser__(default=0)
8276
8278__parser__(constructor)
8281 MK_NUM const size __parser__(default=0)
8283
8285__parser__(constructor)
8288 MK_NUM const size __parser__(default=0)
8290
8307 MK_STRN const tlsName ,
8308 bool const resetB __parser__(default=true)
8310
8311__parser__(constructor,macro)
8322// [MkBufferStreamCreateLOCAL_T]
8323#define MkBufferStreamCreateLOCAL_T(cls,name,size) \
8324 cls##R name##R = {0}; \
8325 struct MkBufferStreamS * const name = cls##_X2bus(&name##R); \
8326 MkBufferStreamInit(name,cls##_TT,size)
8327// [MkBufferStreamCreateLOCAL_T]
8328
8329__parser__(constructor,macro)
8338// [MkBufferStreamCreateSTATIC_T]
8339#define MkBufferStreamCreateSTATIC_T(cls,name) \
8340 static cls##R name##R = {0}; \
8341 struct MkBufferStreamS * const name = cls##_X2bus(&name##R); \
8342 if (__MkCheckX(cls,&name##R)) { \
8343 MkBufferStreamReset(name); \
8344 } else { \
8345 MkBufferStreamInit(name,cls##TT,0); \
8346 } \
8347// [MkBufferStreamCreateSTATIC_T]
8348
8349__parser__(constructor,macro)
8358// [MkBufferStreamCreateTLS_T]
8359#define MkBufferStreamCreateTLS_T(cls,name) \
8360 static MkThreadLocal cls##R name##R = {0}; \
8361 struct MkBufferStreamS * const name = cls##_X2bus(&name##R); \
8362 if (__MkCheckX(cls,&name##R)) { \
8363 MkBufferStreamReset(name); \
8364 } else { \
8365 MkBufferStreamInit(name,cls##_TT,0); \
8366 } \
8367// [MkBufferStreamCreateTLS_T]
8368
8399__parser__(internal)
8402 MK_BUS const bus
8404
8408__parser__(internal)
8411 MK_BUS const bus,
8412 MK_TYP type __parser__(internal,default=NULL),
8413 MK_NUM const size __parser__(default=0)
8415
8421__parser__(destructor)
8424 MK_BUS const bus
8426
8442__parser__(constructor)
8445 MK_BUS const bus
8447
8455__parser__(constructor)
8458 MK_BUSN const src
8460
8462
8464// MkBufferStreamC_TOR_C_API
8465
8466/* ####################################################################### */
8467/* ### ### */
8468/* ### BufferStream - M I S C - Api ### */
8469/* ### ### */
8470/* ####################################################################### */
8471
8477
8478__parser__push__(doc-group=Misc);
8479
8486__parser__(const)
8489 MK_BUS const bus,
8490 MK_BUSN const src
8492
8501 MK_BUS const bus
8503
8514 MK_BUS const bus
8516
8517__parser__(internal)
8520 MK_BUS const bus ,
8521 MK_OBJ fmtobj __parser__(default=NULL),
8522 MK_STRN const callfunc __parser__(default=F#FUNC)
8524
8533// [MkBufferStreamLog_RT]
8534__parser__(const,class-overload=MkObjectLog)
8537 MK_BUS const bus ,
8539 MK_DBG const debug __parser__(default=0),
8540 MK_STRN const callfunc __parser__(default=F#FUNC),
8541 MK_I32 const lvl __parser__(default=0)
8543
8544#define MkBufferStreamLog_5F(bus,fmt,...) MkBufferStreamLog(bus,MkObj(fmt),__VA_ARGS__)
8545#define MkBufferStreamLog_2F(bus,fmt) MkBufferStreamLog_5F(bus,fmt,0,__func__,0)
8546#define MkBufferStreamLog_3F(bus,fmt,pfx) MkBufferStreamLog_5F(bus,fmt,0,pfx,0)
8547// [MkBufferStreamLog_RT]
8548
8552 MK_BUS const bus
8554
8556__parser__(class-overload=MkObjectToString)
8559 MK_BUSN const inst
8561
8570 MK_BUSN const bus
8572
8573__parser__pop__; // Misc
8574
8576// MkBufferStreamC_Misc_C_API
8577
8578/* ####################################################################### */
8579/* ### ### */
8580/* ### BufferStream - W R I T E - Api ### */
8581/* ### ### */
8582/* ####################################################################### */
8583
8594__parser__push__(doc-group=Write);
8595
8607 MK_BUS const bus,
8608 MK_I8 const val
8610
8615 MK_BUS const bus,
8616 MK_BOL const val
8618
8623 MK_BUS const bus,
8624 MK_I32 const val
8626
8631 MK_BUS const bus,
8632 MK_FLT const val
8634
8639 MK_BUS const bus,
8640 MK_I64 const val
8642
8647 MK_BUS const bus,
8648 MK_DBL const val
8650
8656 MK_BUS const bus,
8657 MK_STRN const val,
8658 MK_NUM const len __parser__(default=-1)
8660
8665 MK_BUS const bus,
8666 MkBinaryR const val
8668
8673 MK_BUS const bus,
8674 MK_BUFN const val
8676
8682 MK_BUS const bus,
8683 MK_I32 const val
8685
8699 MK_BUS const bus,
8700 MK_LONG const val
8702
8706 MK_BUS const bus,
8707 MK_STRN const fmt,
8708 va_list ap
8710
8714 MK_BUS const bus,
8715 MK_STRN const fmt,
8716 ...
8718
8735 MK_BUS const bus,
8736 MK_BFLN const bfl
8738
8759 MK_BUS const bus,
8760 MK_BFL const bfl
8762
8766 MK_BUS const bus
8768
8772 MK_BUS const bus
8774
8786 MK_BUS const bus,
8787 MK_BUSN const add
8789
8790__parser__pop__; // Write
8791
8793// MkBufferStreamC_Write_C_API
8794
8795/* ####################################################################### */
8796/* ### ### */
8797/* ### BufferStream - R E A D - Api ### */
8798/* ### ### */
8799/* ####################################################################### */
8800
8810__parser__push__(doc-group=Read);
8811
8820 MK_BUS const bus,
8821 MK_BUF buf __parser__(default=NULL)
8823
8827 MK_BUS const bus
8829
8840 MK_BUS const bus,
8841 MK_BFL * const val_inout
8843
8865 MK_BUS const bus,
8866 MK_BFL * const val_out
8868
8869__parser__(ignore)
8872 MK_BUS const bus,
8873 MK_NAT_LIST * const val_out
8875
8876__parser__(ignore)
8879 MK_BUS const bus,
8880 MK_NAT_OBJECT * const val_out
8882
8896 MK_BUS const bus,
8897 MK_LONG * const val_out
8899
8900// *******
8901
8917 MK_BUS const bus,
8918 MK_I8 * const val_out
8920
8925 MK_BUS const bus,
8926 MK_BOL * const val_out
8928
8933 MK_BUS const bus,
8934 MK_I32 * const val_out
8936
8941 MK_BUS const bus,
8942 MK_FLT * const val_out
8944
8949 MK_BUS const bus,
8950 MK_I64 * const val_out
8952
8957 MK_BUS const bus,
8958 MK_DBL * const val_out
8960
8965 MK_BUS const bus,
8966 MK_STRN * const val_out
8968
8975 MK_BUS const bus,
8976 MkBinaryR * const val_out
8978
8983 MK_BUS const bus,
8984 MK_BUF*const val_out
8986
8994 MK_BUSN const bus
8996
9004 MK_BUSN const bus
9006
9014 MK_BUSN const bus
9016
9027 MK_BUS const bus
9029
9030__parser__pop__; // Read
9031
9033// MkBufferStreamC_Read_C_API
9034
9036// MkBufferStreamC_C_API
9037
9038/* MARK_L ################################################################ */
9039/* ### ### */
9040/* ### B U F F E R - L I S T - A P I ### */
9041/* ### ### */
9042/* ####################################################################### */
9043
9045#include "MkBufferListC_def_mk.h"
9047
9048/* ####################################################################### */
9049/* ### ### */
9050/* ### L O G - F I L E - A P I ### */
9051/* ### ### */
9052/* ####################################################################### */
9053
9074
9075#define MkDbgLogData(d) \
9076 MkDbgV_2O(MK_ERROR_FORMAT,MK_COLOR_LIGHT_CYAN "FROM=%s -> TO=%s [%d]" MK_COLOR_RESET "\n", \
9077 MK_RT_REF.log.logNAME, (d), MK_RT_REF.log.logREF);
9078
9080__parser__(ignore)
9081typedef struct MkLogDataS {
9082
9083 #if defined(__cplusplus)
9084 #define MkLogDataEA(e) MkLogDataS::e
9085 #else
9086 #define MkLogDataEA(e) e
9087 #endif
9088
9097 FILE *logFILE;
9099 #define MkLogDataS_LogNAME_size 256
9104 char *logBUF;
9106 size_t logSIZE;
9110
9113 // BEGIN-MkLogFileS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9114
9115 union {
9116 struct MkObjectS obj; // instance-base MkObjectS
9118
9119 // END-MkLogFileS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9120
9121 // object body
9123};
9124
9125// BEGIN-MkLogFileS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9126
9130 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
9131
9132// Signature --------------------------------------------------------------
9135
9136 #define MkLogFileC_SIGNATURE (MkObjectC_SIGNATURE ^ (3u<<10))
9137 #define MkLogFileC_MASK (((1u<<22)-1)<<10)
9138
9140
9141// CompileTimeCast --------------------------------------------------------------
9144
9145 #define MkLogFileC_X2lfl(x) (x)
9146 #define MkLogFileC_X2obj(x) MkOBJ(x)
9147
9149
9150// TypeDef --------------------------------------------------------------
9153
9155 __parser__(ignore) typedef struct MkLogFileS MkLogFileCR;
9157 __parser__(ignore) typedef const struct MkLogFileS MkLogFileCNR;
9159 #define MkLogFileC_T (&MK_RT_REF._MkLogFileC_T)
9161 #define MkLogFileC_TT (MkTYP(MkLogFileC_T))
9163 #define MkLogFileST MkLogFileC_T
9165 #define MkLogFileSTT (MkTYP(MkLogFileST))
9167 #define MkLogFileC_type MK_LFL
9169 #define MkLogFileCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
9171 #define MkLogFileCTT_X(instance) (MkOBJ_R(instance).type)
9173 #define MkLogFileCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
9175 #define MkLogFileC_NS MK
9177 #define MkLogFileCTT MkLogFileCTT
9179 #define MkLogFileCT ( (struct MkTypeDefS *) MkLogFileCTT )
9180
9182
9183// TypeCheck --------------------------------------------------------------
9186
9187 #pragma GCC diagnostic push
9188 #pragma GCC diagnostic ignored "-Wattributes"
9189
9192 __parser__(class=MkLogFileC,static,hide)
9195 return MkSanitizeCheck(MkLogFileC,mng);
9196 }
9197
9200 __parser__(class=MkLogFileC,static,hide)
9203 return MkSanitizeCheckO(MkLogFileC,obj);
9204 }
9205
9206 #pragma GCC diagnostic pop
9207 #define MkLogFileC_Check(mng) MkLflCheck(mng)
9208
9210
9211// RunTimeCast --------------------------------------------------------------
9214
9216 __parser__(class=MkLogFileC,hide,static)
9217 META_ATTRIBUTE_SANITIZE
9220 return (MkLflCheck(mng) ? (MK_LFL)mng : NULL);
9221 }
9222
9224 __parser__(class=MkLogFileC,hide,static)
9225 META_ATTRIBUTE_SANITIZE
9228 return (MkLflCheck(mng) ? (MK_LFLN)mng : NULL);
9229 }
9230
9232 #define MkLflRaise(_lfl) if (!_MkCheckX(MkLogFileC,_lfl)) { \
9233 MkErrorSetC_1E("'MkLogFileC' hdl is NULL"); \
9234 goto error ; \
9235 }
9236
9238 #define MkLFL_R(x) (*(x)).super.lfl
9240 #define MkLFL(x) (&MkLFL_R(x))
9241
9243
9246// MkLogFileC_Class_Define_C_API
9247
9248// END-MkLogFileS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9249
9250// =========================================================================
9251// BEGIN-MkLogFileS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9252
9255
9258
9259__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkLogFileC);
9260
9276__parser__(class-overload=MkObjectHandleGet)
9280 MK_LFL const lfl __parser__(null-allowed)
9281) {
9282 return MkObjectHandleGet(lfl?MkOBJ(lfl):NULL);
9283}
9284
9293__parser__(flags=new)
9297 MK_HDL const netHdl
9298) {
9299 return MkLfl(MkObjectHandleResolve(netHdl));
9300}
9301
9311#define MkLogFileHandleResolve_e(netHdl) ({ \
9312 MK_HDL tmpHdl=netHdl; \
9313 MK_LFL tmp; \
9314 if (tmpHdl==0) { \
9315 tmp=NULL; \
9316 } else { \
9317 tmp=MkLogFileHandleResolve(tmpHdl); \
9318 if (tmp==NULL) { \
9319 MkErrorSetC_1_NULL("ERROR: 'MkLogFileC' handle is 'NULL'"); \
9320 goto error; \
9321 }; \
9322 }; \
9323 tmp; \
9324})
9325
9327
9329// Class export & import
9330
9334 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkLogFileC,null-return-allow)
9337 return (MK_LFL)MK_NULL;
9338 }
9340// MkLogFileC - Misc - function
9341
9343// MkLogFileC_Class_C_API
9344
9345// END-MkLogFileS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9346
9347// #######################################################################
9348// -----------------------------------------------------------------------
9354
9355__parser__push__(doc-group=TOR,class=MkLogFileC);
9356
9367__parser__(constructor,lng-constr)
9372 MK_STRN const file,
9373 MK_LFL * lfh_out
9375
9381__parser__(destructor)
9384 MK_LFL lfh
9386
9387__parser__pop__; // TOR
9388
9390// MkLogFileC_TOR_C_API
9391
9392// #######################################################################
9393// -----------------------------------------------------------------------
9398
9399__parser__push__(doc-group=Write);
9400
9411 MK_LFLN lfl __parser__(null-allowed),
9412 MK_FST printfmt,
9413 va_list var_list
9415
9425 MK_LFLN lfl __parser__(null-allowed),
9426 MK_FST printfmt,
9427 ...
9429
9436__parser__(no-type-extension)
9440 MK_LFLN lfl __parser__(null-allowed),
9441 MK_STRN text
9443
9453 MK_LFLN lfl,
9454 MK_STRN *file_out
9456
9457__parser__pop__; // Write
9458
9460// MkLogFileC_Write_C_API
9461
9463// MkLogFileC_C_API
9464
9465/* MARK_X ################################################################ */
9466/* ### ### */
9467/* ### E X T E N S I O N - A P I ### */
9468/* ### ### */
9469/* ####################################################################### */
9470
9478
9479#define MkDbgMkExt2(c,x) mk_dbg_color_ln(c,"MkExtensionS: ptr<%p>, next<%p>, prev<%p>", (x), (x)->next, (x)->prev)
9480#define MkDbgMkExt(x) MkDbgMkExt2(MK_COLOR_CYAN,x)
9481
9482__parser__push__(doc-group=_ignore_);
9483
9484__parser__(internal)
9486typedef struct MkExtensionS {
9487 // BEGIN-MkExtensionS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9488
9489 union {
9490 struct MkObjectS obj; // instance-base MkObjectS
9491 } super;
9492
9493 // END-MkExtensionS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9494
9495 // instance attributes
9498
9499// BEGIN-MkExtensionS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9500
9504 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
9505
9506// Signature --------------------------------------------------------------
9509
9510 #define MkExtensionC_SIGNATURE (MkObjectC_SIGNATURE ^ (9u<<10))
9511 #define MkExtensionC_MASK (((1u<<22)-1)<<10)
9512
9514
9515// CompileTimeCast --------------------------------------------------------------
9518
9519 #define MkExtensionC_X2ext(x) (x)
9520 #define MkExtensionC_X2obj(x) MkOBJ(x)
9521
9523
9524// TypeDef --------------------------------------------------------------
9527
9529 __parser__(ignore) typedef struct MkExtensionS MkExtensionCR;
9531 __parser__(ignore) typedef const struct MkExtensionS MkExtensionCNR;
9533 #define MkExtensionC_T (&MK_RT_REF._MkExtensionC_T)
9535 #define MkExtensionC_TT (MkTYP(MkExtensionC_T))
9537 #define MkExtensionST MkExtensionC_T
9539 #define MkExtensionSTT (MkTYP(MkExtensionST))
9541 #define MkExtensionC_type MK_EXT
9543 #define MkExtensionCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
9545 #define MkExtensionCTT_X(instance) (MkOBJ_R(instance).type)
9547 #define MkExtensionCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
9549 #define MkExtensionC_NS MK
9551 #define MkExtensionCTT MkExtensionCTT
9553 #define MkExtensionCT ( (struct MkTypeDefS *) MkExtensionCTT )
9554
9556
9557// TypeCheck --------------------------------------------------------------
9560
9561 #pragma GCC diagnostic push
9562 #pragma GCC diagnostic ignored "-Wattributes"
9563
9566 __parser__(class=MkExtensionC,static,ignore)
9569 return MkSanitizeCheck(MkExtensionC,mng);
9570 }
9571
9574 __parser__(class=MkExtensionC,static,ignore)
9577 return MkSanitizeCheckO(MkExtensionC,obj);
9578 }
9579
9580 #pragma GCC diagnostic pop
9581 #define MkExtensionC_Check(mng) MkExtCheck(mng)
9582
9584
9585// RunTimeCast --------------------------------------------------------------
9588
9590 __parser__(class=MkExtensionC,ignore,static)
9591 META_ATTRIBUTE_SANITIZE
9594 return (MkExtCheck(mng) ? (MK_EXT)mng : NULL);
9595 }
9596
9598 __parser__(class=MkExtensionC,ignore,static)
9599 META_ATTRIBUTE_SANITIZE
9602 return (MkExtCheck(mng) ? (MK_EXTN)mng : NULL);
9603 }
9604
9606 #define MkExtRaise(_ext) if (!_MkCheckX(MkExtensionC,_ext)) { \
9607 MkErrorSetC_1E("'MkExtensionC' hdl is NULL"); \
9608 goto error ; \
9609 }
9610
9612 #define MkEXT_R(x) (*(x)).super.ext
9614 #define MkEXT(x) (&MkEXT_R(x))
9615
9617
9620// MkExtensionC_Class_Define_C_API
9621
9622// END-MkExtensionS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9623
9627#define MkExtension_size 64
9628
9629__parser__(internal)
9632 MK_EXT head
9634
9636__parser__(internal)
9639 MK_EXT head,
9640 MK_EXT add
9642
9644__parser__(internal)
9647 MK_EXT head,
9648 MK_EXT del
9650
9651/*
9652//__parser__(internal)
9653//MK_EXTERN MK_EXT MK_DECL MkExtensionSearch (MK_EXT head, MK_TYP typ);
9654*/
9655
9656__parser__pop__; // __parser__push__(doc-group=_ignore_);
9657
9659// MkExtensionC_C_API
9660
9661/* MARK_E ################################################################ */
9662/* ### ### */
9663/* ### E R R O R - A P I ### */
9664/* ### ### */
9665/* ####################################################################### */
9666
9694
9695#define MkDbgErr_2(err,col) \
9696 mk_dbg_color_ln(col,"MkDbgErr[%p]: check<%d>, mkrt<%s>, isLocal<%d>, format_of_error<%p>", \
9697 err, MkErrCheck(err), MkDbgRtChkX(err), MkOBJ(err)->obj_protect.isLocal, err->format_of_error)
9698#define MkDbgErr(err) MkDbgErr_2(err,MK_COLOR_WHITE)
9699
9700#if META_DEBUG & META_DEBUG_ERROR
9701__parser__(ignore)
9702MK_EXTERN void MK_DECL MkDbgError_RT (
9705 MK_STRN const callfunc __parser__(default=F#FUNC)
9707#endif
9708
9712struct MkErrorS {
9713 // BEGIN-MkErrorS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9714
9715 union {
9716 struct MkObjectS obj; // instance-base MkObjectS
9718
9719 // END-MkErrorS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9720
9721 // instance attributes
9725 bool append;
9726 bool noRaise;
9727
9730
9732};
9733
9734// BEGIN-MkErrorS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9735
9739 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
9740
9741// Signature --------------------------------------------------------------
9744
9745 #define MkErrorC_SIGNATURE (MkObjectC_SIGNATURE ^ (4u<<10))
9746 #define MkErrorC_MASK (((1u<<22)-1)<<10)
9747
9749
9750// CompileTimeCast --------------------------------------------------------------
9753
9754 #define MkErrorC_X2err(x) (x)
9755 #define MkErrorC_X2obj(x) MkOBJ(x)
9756
9758
9759// TypeDef --------------------------------------------------------------
9762
9764 __parser__(ignore) typedef struct MkErrorS MkErrorCR;
9766 __parser__(ignore) typedef const struct MkErrorS MkErrorCNR;
9768 #define MkErrorC_T (&MK_RT_REF._MkErrorC_T)
9770 #define MkErrorC_TT (MkTYP(MkErrorC_T))
9772 #define MkErrorST MkErrorC_T
9774 #define MkErrorSTT (MkTYP(MkErrorST))
9776 #define MkErrorC_type MK_ERR
9778 #define MkErrorCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
9780 #define MkErrorCTT_X(instance) (MkOBJ_R(instance).type)
9782 #define MkErrorCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
9784 #define MkErrorC_NS MK
9786 #define MkErrorCTT MkErrorCTT
9788 #define MkErrorCT ( (struct MkTypeDefS *) MkErrorCTT )
9789
9791
9792// TypeCheck --------------------------------------------------------------
9795
9796 #pragma GCC diagnostic push
9797 #pragma GCC diagnostic ignored "-Wattributes"
9798
9801 __parser__(class=MkErrorC,static,hide)
9804 return MkSanitizeCheck(MkErrorC,mng);
9805 }
9806
9809 __parser__(class=MkErrorC,static,hide)
9812 return MkSanitizeCheckO(MkErrorC,obj);
9813 }
9814
9815 #pragma GCC diagnostic pop
9816
9818
9819// RunTimeCast --------------------------------------------------------------
9822
9824 __parser__(class=MkErrorC,hide,static)
9825 META_ATTRIBUTE_SANITIZE
9828 return (MkErrCheck(mng) ? (MK_ERR)mng : NULL);
9829 }
9830
9832 __parser__(class=MkErrorC,hide,static)
9833 META_ATTRIBUTE_SANITIZE
9836 return (MkErrCheck(mng) ? (MK_ERRN)mng : NULL);
9837 }
9838
9840 #define MkErrRaise(_err) if (!_MkCheckX(MkErrorC,_err)) { \
9841 MkErrorSetC_1E("'MkErrorC' hdl is NULL"); \
9842 goto error ; \
9843 }
9844
9846 #define MkERR_R(x) (*(x)).super.err
9848 #define MkERR(x) (&MkERR_R(x))
9849
9851
9854// MkErrorC_Class_Define_C_API
9855
9856// END-MkErrorS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9857
9859// MkErrorC_C_API
9860
9861// =========================================================================
9862// BEGIN-MkErrorS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9863
9866
9869
9870__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkErrorC);
9871
9887__parser__(class-overload=MkObjectHandleGet)
9891 MK_ERR const err __parser__(null-allowed)
9892) {
9893 return MkObjectHandleGet(err?MkOBJ(err):NULL);
9894}
9895
9904__parser__(flags=new)
9908 MK_HDL const netHdl
9909) {
9910 return MkErr(MkObjectHandleResolve(netHdl));
9911}
9912
9922#define MkErrorHandleResolve_e(netHdl) ({ \
9923 MK_HDL tmpHdl=netHdl; \
9924 MK_ERR tmp; \
9925 if (tmpHdl==0) { \
9926 tmp=NULL; \
9927 } else { \
9928 tmp=MkErrorHandleResolve(tmpHdl); \
9929 if (tmp==NULL) { \
9930 MkErrorSetC_1_NULL("ERROR: 'MkErrorC' handle is 'NULL'"); \
9931 goto error; \
9932 }; \
9933 }; \
9934 tmp; \
9935})
9936
9938
9940// Class export & import
9941
9945 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkErrorC,null-return-allow)
9948 return (MK_ERR)MK_NULL;
9949 }
9951// MkErrorC - Misc - function
9952
9954// MkErrorC_Class_C_API
9955
9956// END-MkErrorS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
9957
9958// #######################################################################
9959// -----------------------------------------------------------------------
9966
9967#define MK_ERREXT_ARGS MK_RT_ARGS MK_ERR const mkerr, MK_ERREXT const errext
9968#define MK_ERREXT_CALL MK_RT_CALL err, errext
9969
9970#define MK_ERREXT_ARGS_N MK_RT_ARGS MK_ERRN const mkerr, MK_ERREXT const errext
9971#define MK_ERREXT_CALL_N MK_RT_CALL err, errext
9972
9973__parser__(ignore)
9974typedef bool (*MkErrorAppendFLT) (MK_ERREXT_ARGS, MK_OBJN const fmtobj);
9975
9976__parser__(ignore)
9977typedef void (*MkErrorResetF) (MK_ERREXT_ARGS, MK_OBJN const fmtobj);
9978
9979__parser__(ignore)
9980typedef bool (*MkErrorResetOnExitF) (MK_ERREXT_ARGS, MK_OBJN const fmtobj);
9981
9983__parser__(ignore)
9984typedef void (*MkErrorPanikF) (MK_ERREXT_ARGS_N, MK_OBJN const errobj, MK_STRN const prefix,
9985 MK_I32 const errnum, MK_STRN const fmt, va_list ap);
9986
9987__parser__(ignore)
9988typedef void (*MkErrorLogF) (MK_ERREXT_ARGS_N, MK_OBJN const, MK_DBG const, MK_STRN const,
9989 MK_I32 const, MK_STRN const, MK_OBJ const);
9990
9991__parser__(ignore)
9992typedef MK_OBJN (*MkErrorFormatOfF) (MK_ERREXT_ARGS_N, int const dummy);
9993
9994__parser__(ignore)
9995typedef void (*MkErrorSetRF) (MK_ERREXT_ARGS, MK_MNGN const errctx, MK_OBJN const fmtobj);
9996
9997__parser__(ignore)
9998typedef void (*MkErrorSetEF) (MK_ERREXT_ARGS, MK_ERREXT const newerr, MK_OBJN const fmtobj);
9999
10000__parser__(ignore)
10001typedef bool (*MkErrorSetVLF) (MK_ERREXT_ARGS, MK_OBJN const fmtobj, MK_STRN const);
10002
10003__parser__(ignore)
10004typedef void (*MkErrorInit) (MK_ERREXT_ARGS, MK_OBJN const fmtobj);
10005
10007__parser__(ignore)
10009 // BEGIN-MkErrExtS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10010
10011 union {
10012 struct MkObjectS obj; // instance-base MkObjectS
10013 struct MkExtensionS ext; // instance-base MkExtensionS
10015
10016 // END-MkErrExtS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10017
10019
10022
10025
10028
10031
10034
10037
10040
10043
10046
10049};
10050
10051// BEGIN-MkErrExtS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10052
10056 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
10057
10058// Signature --------------------------------------------------------------
10061
10062 #define MkErrExtC_SIGNATURE (MkExtensionC_SIGNATURE ^ (1u<<6))
10063 #define MkErrExtC_MASK (((1u<<26)-1)<<6)
10064
10066
10067// CompileTimeCast --------------------------------------------------------------
10070
10071 #define MkErrExtC_X2errext(x) (x)
10072 #define MkErrExtC_X2ext(x) MkEXT(x)
10073 #define MkErrExtC_X2obj(x) MkOBJ(x)
10074
10076
10077// TypeDef --------------------------------------------------------------
10080
10082 __parser__(ignore) typedef struct MkErrExtS MkErrExtCR;
10084 __parser__(ignore) typedef const struct MkErrExtS MkErrExtCNR;
10086 #define MkErrExtC_T (&MK_RT_REF._MkErrExtC_T)
10088 #define MkErrExtC_TT (MkTYP(MkErrExtC_T))
10090 #define MkErrExtST MkErrExtC_T
10092 #define MkErrExtSTT (MkTYP(MkErrExtST))
10094 #define MkErrExtC_type MK_ERREXT
10096 #define MkErrExtCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
10098 #define MkErrExtCTT_X(instance) (MkOBJ_R(instance).type)
10100 #define MkErrExtCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
10102 #define MkErrExtC_NS MK
10104 #define MkErrExtCTT MkErrExtCTT
10106 #define MkErrExtCT ( (struct MkTypeDefS *) MkErrExtCTT )
10107
10109
10110// TypeCheck --------------------------------------------------------------
10113
10114 #pragma GCC diagnostic push
10115 #pragma GCC diagnostic ignored "-Wattributes"
10116
10119 __parser__(class=MkErrExtC,static,ignore)
10122 return MkSanitizeCheck(MkErrExtC,mng);
10123 }
10124
10127 __parser__(class=MkErrExtC,static,ignore)
10130 return MkSanitizeCheckO(MkErrExtC,obj);
10131 }
10132
10133 #pragma GCC diagnostic pop
10134 #define MkErrExtC_Check(mng) MkErrExtCheck(mng)
10135
10137
10138// RunTimeCast --------------------------------------------------------------
10141
10143 __parser__(class=MkErrExtC,ignore,static)
10144 META_ATTRIBUTE_SANITIZE
10147 return (MkErrExtCheck(mng) ? (MK_ERREXT)mng : NULL);
10148 }
10149
10151 __parser__(class=MkErrExtC,ignore,static)
10152 META_ATTRIBUTE_SANITIZE
10155 return (MkErrExtCheck(mng) ? (MK_ERREXTN)mng : NULL);
10156 }
10157
10159 #define MkErrExtRaise(_errext) if (!_MkCheckX(MkErrExtC,_errext)) { \
10160 MkErrorSetC_1E("'MkErrExtC' hdl is NULL"); \
10161 goto error ; \
10162 }
10163
10165 #define MkERREXT_R(x) (*(x)).super.errext
10167 #define MkERREXT(x) (&MkERREXT_R(x))
10168
10170
10173// MkErrExtC_Class_Define_C_API
10174
10175// END-MkErrExtS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10176
10177#define MkErrExtAdd(_mkerrR,add) do { \
10178 (_mkerrR).mkErrExt = (typeof((_mkerrR).mkErrExt)) MkExtensionAdd(MkEXT((_mkerrR).mkErrExt),MkEXT(add)); \
10179 /* printV("MkErrExtAdd = %p, mkrt=%p", &(_mkerrR).mkErrExt, MK_RT_PTR); */ \
10180 MkERREXT_R(add).mkerrhead = &(_mkerrR); \
10181} while (0) \
10182
10183#define MkErrExtDel(_mkerrR,del) do { \
10184 /* printV("MkErrExtDel = %p, mkrt=%p", &(_mkerrR).mkErrExt, MK_RT_PTR); */ \
10185 (_mkerrR).mkErrExt = (typeof((_mkerrR).mkErrExt)) MkExtensionDel(MkEXT((_mkerrR).mkErrExt),MkEXT(del)); \
10186 MkERREXT_R(del).mkerrhead = NULL; \
10187} while (0) \
10188
10190// MkErrExtC_C_API
10191
10192// #######################################################################
10193// -----------------------------------------------------------------------
10201
10203__parser__(ignore)
10205 // BEGIN-MkErrorPanicS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10206
10207 union {
10208 struct MkObjectS obj; // instance-base MkObjectS
10209 } super;
10210
10211 // END-MkErrorPanicS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10212};
10213
10214// BEGIN-MkErrorPanicS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10215
10219 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
10220
10221// Signature --------------------------------------------------------------
10224
10225 #define MkErrorPanicC_SIGNATURE (MkObjectC_SIGNATURE ^ (7u<<10))
10226 #define MkErrorPanicC_MASK (((1u<<22)-1)<<10)
10227
10229
10230// CompileTimeCast --------------------------------------------------------------
10233
10234 #define MkErrorPanicC_X2obj(x) MkOBJ(x)
10235
10237
10238// TypeDef --------------------------------------------------------------
10241
10245 __parser__(ignore) typedef const struct MkErrorPanicS MkErrorPanicCNR;
10247 #define MkErrorPanicC_T (&MK_RT_REF._MkErrorPanicC_T)
10249 #define MkErrorPanicC_TT (MkTYP(MkErrorPanicC_T))
10251 #define MkErrorPanicST MkErrorPanicC_T
10253 #define MkErrorPanicSTT (MkTYP(MkErrorPanicST))
10255 #define MkErrorPanicCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
10257 #define MkErrorPanicCTT_X(instance) (MkOBJ_R(instance).type)
10259 #define MkErrorPanicCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
10261 #define MkErrorPanicC_NS MK
10263 #define MkErrorPanicCTT MkErrorPanicCTT
10265 #define MkErrorPanicCT ( (struct MkTypeDefS *) MkErrorPanicCTT )
10266
10268
10271// MkErrorPanicC_Class_Define_C_API
10272
10273// END-MkErrorPanicS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10274
10276// MkErrorPanicS_C_API
10277
10278// #######################################################################
10279// -----------------------------------------------------------------------
10287
10289__parser__(ignore)
10291 // BEGIN-MkErrorExitS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10292
10293 union {
10294 struct MkObjectS obj; // instance-base MkObjectS
10295 } super;
10296
10297 // END-MkErrorExitS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10298};
10299
10300// BEGIN-MkErrorExitS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10301
10305 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
10306
10307// Signature --------------------------------------------------------------
10310
10311 #define MkErrorExitC_SIGNATURE (MkObjectC_SIGNATURE ^ (8u<<10))
10312 #define MkErrorExitC_MASK (((1u<<22)-1)<<10)
10313
10315
10316// CompileTimeCast --------------------------------------------------------------
10319
10320 #define MkErrorExitC_X2obj(x) MkOBJ(x)
10321
10323
10324// TypeDef --------------------------------------------------------------
10327
10329 __parser__(ignore) typedef struct MkErrorExitS MkErrorExitCR;
10331 __parser__(ignore) typedef const struct MkErrorExitS MkErrorExitCNR;
10333 #define MkErrorExitC_T (&MK_RT_REF._MkErrorExitC_T)
10335 #define MkErrorExitC_TT (MkTYP(MkErrorExitC_T))
10337 #define MkErrorExitST MkErrorExitC_T
10339 #define MkErrorExitSTT (MkTYP(MkErrorExitST))
10341 #define MkErrorExitCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
10343 #define MkErrorExitCTT_X(instance) (MkOBJ_R(instance).type)
10345 #define MkErrorExitCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
10347 #define MkErrorExitC_NS MK
10349 #define MkErrorExitCTT MkErrorExitCTT
10351 #define MkErrorExitCT ( (struct MkTypeDefS *) MkErrorExitCTT )
10352
10354
10357// MkErrorExitC_Class_Define_C_API
10358
10359// END-MkErrorExitS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10360
10362// MkErrorExitS_C_API
10363
10364// #######################################################################
10365// -----------------------------------------------------------------------
10373
10375__parser__(ignore)
10377 // BEGIN-MkErrorIgnoreS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10378
10379 union {
10380 struct MkObjectS obj; // instance-base MkObjectS
10381 } super;
10382
10383 // END-MkErrorIgnoreS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10384};
10385
10386// BEGIN-MkErrorIgnoreS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10387
10391 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
10392
10393// Signature --------------------------------------------------------------
10396
10397 #define MkErrorIgnoreC_SIGNATURE (MkObjectC_SIGNATURE ^ (5u<<10))
10398 #define MkErrorIgnoreC_MASK (((1u<<22)-1)<<10)
10399
10401
10402// CompileTimeCast --------------------------------------------------------------
10405
10406 #define MkErrorIgnoreC_X2obj(x) MkOBJ(x)
10407
10409
10410// TypeDef --------------------------------------------------------------
10413
10417 __parser__(ignore) typedef const struct MkErrorIgnoreS MkErrorIgnoreCNR;
10419 #define MkErrorIgnoreC_T (&MK_RT_REF._MkErrorIgnoreC_T)
10421 #define MkErrorIgnoreC_TT (MkTYP(MkErrorIgnoreC_T))
10423 #define MkErrorIgnoreST MkErrorIgnoreC_T
10425 #define MkErrorIgnoreSTT (MkTYP(MkErrorIgnoreST))
10427 #define MkErrorIgnoreCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
10429 #define MkErrorIgnoreCTT_X(instance) (MkOBJ_R(instance).type)
10431 #define MkErrorIgnoreCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
10433 #define MkErrorIgnoreC_NS MK
10435 #define MkErrorIgnoreCTT MkErrorIgnoreCTT
10437 #define MkErrorIgnoreCT ( (struct MkTypeDefS *) MkErrorIgnoreCTT )
10438
10440
10443// MkErrorIgnoreC_Class_Define_C_API
10444
10445// END-MkErrorIgnoreS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10446
10448// MkErrorIgnoreC_C_API
10449
10450// #######################################################################
10451// -----------------------------------------------------------------------
10458
10461__parser__(ignore)
10463 // BEGIN-MkErrorPrintS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10464
10465 union {
10466 struct MkObjectS obj; // instance-base MkObjectS
10467 } super;
10468
10469 // END-MkErrorPrintS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10470};
10471
10472// BEGIN-MkErrorPrintS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10473
10477 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
10478
10479// Signature --------------------------------------------------------------
10482
10483 #define MkErrorPrintC_SIGNATURE (MkObjectC_SIGNATURE ^ (6u<<10))
10484 #define MkErrorPrintC_MASK (((1u<<22)-1)<<10)
10485
10487
10488// CompileTimeCast --------------------------------------------------------------
10491
10492 #define MkErrorPrintC_X2obj(x) MkOBJ(x)
10493
10495
10496// TypeDef --------------------------------------------------------------
10499
10503 __parser__(ignore) typedef const struct MkErrorPrintS MkErrorPrintCNR;
10505 #define MkErrorPrintC_T (&MK_RT_REF._MkErrorPrintC_T)
10507 #define MkErrorPrintC_TT (MkTYP(MkErrorPrintC_T))
10509 #define MkErrorPrintST MkErrorPrintC_T
10511 #define MkErrorPrintSTT (MkTYP(MkErrorPrintST))
10513 #define MkErrorPrintCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
10515 #define MkErrorPrintCTT_X(instance) (MkOBJ_R(instance).type)
10517 #define MkErrorPrintCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
10519 #define MkErrorPrintC_NS MK
10521 #define MkErrorPrintCTT MkErrorPrintCTT
10523 #define MkErrorPrintCT ( (struct MkTypeDefS *) MkErrorPrintCTT )
10524
10526
10529// MkErrorPrintC_Class_Define_C_API
10530
10531// END-MkErrorPrintS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10532
10534//MkErrorPrintC_C_API
10535
10536// #######################################################################
10537// -----------------------------------------------------------------------
10544
10551__parser__(ignore)
10553 // BEGIN-MkErrorDefaultS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10554
10555 union {
10556 struct MkObjectS obj; // instance-base MkObjectS
10557 struct MkErrorS err; // instance-base MkErrorS
10559
10560 // END-MkErrorDefaultS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10561};
10562
10563// BEGIN-MkErrorDefaultS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10564
10568 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
10569
10570// Signature --------------------------------------------------------------
10573
10574 #define MkErrorDefaultC_SIGNATURE (MkErrorC_SIGNATURE ^ (1u<<6))
10575 #define MkErrorDefaultC_MASK (((1u<<26)-1)<<6)
10576
10578
10579// CompileTimeCast --------------------------------------------------------------
10582
10583 #define MkErrorDefaultC_X2err(x) MkERR(x)
10584 #define MkErrorDefaultC_X2obj(x) MkOBJ(x)
10585
10587
10588// TypeDef --------------------------------------------------------------
10591
10595 __parser__(ignore) typedef const struct MkErrorDefaultS MkErrorDefaultCNR;
10597 #define MkErrorDefaultC_T (&MK_RT_REF._MkErrorDefaultC_T)
10599 #define MkErrorDefaultC_TT (MkTYP(MkErrorDefaultC_T))
10601 #define MkErrorDefaultST MkErrorDefaultC_T
10603 #define MkErrorDefaultSTT (MkTYP(MkErrorDefaultST))
10605 #define MkErrorDefaultCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
10607 #define MkErrorDefaultCTT_X(instance) (MkOBJ_R(instance).type)
10609 #define MkErrorDefaultCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
10611 #define MkErrorDefaultC_NS MK
10613 #define MkErrorDefaultCTT MkErrorDefaultCTT
10615 #define MkErrorDefaultCT ( (struct MkTypeDefS *) MkErrorDefaultCTT )
10616
10618
10621// MkErrorDefaultC_Class_Define_C_API
10622
10623// END-MkErrorDefaultS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
10624
10626// MkErrorDefaultC_C_API
10627
10628// #######################################################################
10629// -----------------------------------------------------------------------
10634
10635__parser__push__(doc-group=System,class=MkErrorC);
10636
10640#define MkERROR_R(r) ((*r).error_mk)
10641#define MkERROR MkERROR_R(&MK_RT_REF)
10642#define MkERROR_RT MkERROR_R(&MK_RT_REF)
10643#define MkERROR_O(o) MkERROR_R(MkRT_O(o))
10644#define MkERROR_X(x) MkERROR_R(MkRT_X(x))
10645#define MkERROR_XN(x) MkERROR_R(MkRT_XN(x))
10646#define MkERROR_NULL MkERROR_R(&MkRuntimeRLS)
10648
10652
10654#define MK_ERROR_DEFAULT_R(r) MkOBJ(&(*r).error_mk)
10655#define MK_ERROR_DEFAULT MK_ERROR_DEFAULT_R(&MK_RT_REF)
10656#define MK_ERROR_DEFAULT_X(x) MK_ERROR_DEFAULT_R(MkRT_X(x))
10657#define MK_ERROR_DEFAULT_NULL MK_ERROR_DEFAULT_R(&MkRuntimeRLS)
10658
10666
10668// END: MkErrorDEFAULT
10669
10673
10674#define MK_ERROR_PANIC_R(r) MkOBJ(&(*r).error_panic)
10675#define MK_ERROR_PANIC MK_ERROR_PANIC_R(&MK_RT_REF)
10676#define MK_ERROR_PANIC_X(x) MK_ERROR_PANIC_R(MkRT_X(x))
10678#define MK_ERROR_PANIC_NULL MK_ERROR_PANIC_R(&MkRuntimeRLS)
10679
10695__parser__(hide)
10697
10699// END: MkErrorPanik
10700
10704
10705#define MK_ERROR_EXIT_R(r) MkOBJ(&(*r).error_exit)
10706#define MK_ERROR_EXIT MK_ERROR_EXIT_R(&MK_RT_REF)
10707#define MK_ERROR_EXIT_X(x) MK_ERROR_EXIT_R(MkRT_X(x))
10709#define MK_ERROR_EXIT_NULL MK_ERROR_EXIT_R(&MkRuntimeRLS)
10710
10726__parser__(hide)
10728
10730// END: MkErrorExit
10731
10735
10736#define MK_ERROR_IGNORE_R(r) MkOBJ(&(*r).error_ignore)
10737#define MK_ERROR_IGNORE MK_ERROR_IGNORE_R(&MK_RT_REF)
10738#define MK_ERROR_IGNORE_X(x) MK_ERROR_IGNORE_R(MkRT_X(x))
10739#define MK_ERROR_IGNORE_XN(x) MK_ERROR_IGNORE_R(MkRT_XN(x))
10741#define MK_ERROR_IGNORE_NULL MK_ERROR_IGNORE_R(&MkRuntimeRLS)
10742
10768
10770// MkErrorIgnore
10771
10775
10776#define MK_ERROR_PRINT_R(r) MkOBJ(&(*r).error_print)
10777#define MK_ERROR_PRINT MK_ERROR_PRINT_R(&MK_RT_REF)
10778#define MK_ERROR_PRINT_X(x) MK_ERROR_PRINT_R(MkRT_X(x))
10780#define MK_ERROR_PRINT_NULL MK_ERROR_PRINT_R(&MkRuntimeRLS)
10781
10796
10798// MkErrorPrintln
10799
10803
10804#define MK_ERROR_FORMAT_R(r) ((*r).error_mk.format_of_error ? (*r).error_mk.format_of_error : \
10805 MkObjN((*r).error_mk.source_of_error) ? MkObjN((*r).error_mk.source_of_error) : \
10806 MK_ERROR_DEFAULT_R(r))
10807#define MK_ERROR_FORMAT MK_ERROR_FORMAT_R(&MK_RT_REF)
10808#define MK_ERROR_FORMAT_X(x) MK_ERROR_FORMAT_R(MkRT_X(x))
10810#define MK_ERROR_FORMAT_NULL MK_ERROR_FORMAT_R(&MkRuntimeRLS)
10811
10832
10833#define MkErrorFORMAT_1M(m) MkErrorFORMAT(MkObjN(m))
10834#define MkErrorFORMAT_1X(x) MkErrorFORMAT(MkOBJ(x))
10835#define MkErrorFORMAT_1O(o) MkErrorFORMAT(o)
10836
10838__parser__(internal)
10842
10844
10846
10848// END: MkErrorC_System_C_API
10849
10850// #######################################################################
10851// -----------------------------------------------------------------------
10856
10857__parser__push__(doc-group=TOR);
10858
10864__parser__(destructor)
10867 MK_ERR err
10869
10877__parser__(constructor)
10880 MK_ERRN const srce
10882
10888 MK_ERR dest,
10889 MK_ERRN const srce
10891
10892__parser__pop__; // TOR
10893
10895// MkErrorC_TOR_C_API
10896
10897// #######################################################################
10898// -----------------------------------------------------------------------
10903
10904__parser__push__(doc-group=Get);
10905
10907__parser__(error-ignore,inline=MkErrorGetCodeI)
10909 MK_ERRN const err
10911
10913#define MkErrorGetCodeI(e) ((*e).code)
10915#define MkErrorGetCodeE_NULL() (MkERROR_NULL.code)
10917#define MkErrorGetCode_O(o) (MkERROR_O(o).code)
10918
10922 MK_ERRN const err
10924
10926#define MkErrorGetTextI(e) (MkBUF_R(&(*e).text).storage.first.C)
10927
10931 MK_ERRN const err
10933
10935#define MkErrorGetSizeI(e) ((MK_SIZE)MkBUF_R(&(*e).text).var.cursize)
10936
10940 MK_ERRN const err
10942
10944#define MkErrorGetNumI(e) ((*e).num)
10945
10947
10949// MkErrorC_Get_C_API
10950
10951/*****************************************************************************/
10952/* */
10953/* error set */
10954/* */
10955/*****************************************************************************/
10956
10957// #######################################################################
10958// -----------------------------------------------------------------------
10964
10965__parser__push__(doc-group=Signal);
10966
10970 MK_ERR const err
10972
10973#define MkErrorSetCONTINUE_0E() MkErrorSetCONTINUE(&MkERROR)
10974
10992 MK_ERR const err,
10993 MK_STRN const callfunc __parser__(default=F#FUNC)
10995
10999 MK_ERR const err,
11000 MK_STRN const detail __parser__(default=S#"UNKNOWN"),
11001 MK_STRN const callfunc __parser__(default=F#FUNC)
11003
11012 MK_ERR const err,
11013 MK_STRN const detail __parser__(default=S#"UNKNOWN"),
11014 MK_STRN const callfunc __parser__(default=F#FUNC)
11016
11020 MK_ERR const err,
11021 enum MkErrorE code
11023
11026 MK_ERRN const err
11028
11031 MK_ERRN const err
11033
11036 MK_ERRN const err
11038
11065 MK_ERR const err
11067
11068__parser__pop__; // Signal
11069
11071// MkErrorC_Signal_C_API
11072
11073/*****************************************************************************/
11074/* */
11075/* error_is/check */
11076/* */
11077/*****************************************************************************/
11078
11086
11088#define MkErrorCheckI(err) ((err) >= MK_ERROR)
11092#define MkErrorCheckE_0E() (MkErrorCheckI(MkErrorGetCode_0E()))
11093#define MkErrorCheckE_NULL() (MkErrorCheckI(MkErrorGetCodeE_NULL()))
11094#define MkErrorCheckE_O(o) (MkErrorCheckI(MkErrorGetCode_O(o)))
11095#define MkErrorCheckE_X(x) MkErrorCheckE_O(MkOBJ(x))
11096#define MkErrorCheckE_E(e) (MkErrorCheckI((e)->code))
11099#define MkErrorCheck(err) if (MkErrorCheckI(err)) goto error
11101#define MkErrorE_Check(err) if (MkErrorCheckI(err)) goto error
11103#define MkErrorCheck_0E() if (MkErrorCheckE_0E()) goto error
11105#define MkErrorBreak(err) if (MkErrorCheckI(err)) break
11107#define MkContinueCheck(err) switch (err) { \
11108case MK_OK: break; case MK_CONTINUE: goto cont; case MK_ERROR: goto error;\
11109};
11110
11112#define MkErrorSwitch(PROC) switch (PROC) {\
11113case MK_OK: break; case MK_ERROR: goto error; case MK_CONTINUE: return MK_CONTINUE;\
11114}
11115
11116/*
11117OLD and unused
11118
11120#define MkErrorReturnAppend(PROC) \
11121if (MkErrorCheckI(PROC)) { \
11122 return MkErrorStack_0E (); \
11123} else if (MkErrorCheckE_0E()) { \
11124 return MkErrorReset_0E (); \
11125} else { \
11126 return MkERROR.code; \
11127}
11128*/
11130#define MkErrorReturn_2X(mngx,PROC) switch (PROC) {\
11131case MK_OK: return MK_OK; case MK_CONTINUE: return MK_CONTINUE; default: return MkErrorStack_1X (mngx);\
11132};
11134#define MkErrorReturn_1(PROC) switch (PROC) {\
11135case MK_OK: return MK_OK; case MK_CONTINUE: return MK_CONTINUE; default: return MkErrorStack_0E ();\
11136};
11138#define MkErrorReturn(PROC) MkErrorReturn_2X(META_CONTEXT_S,PROC)
11140#define check_MkErrorE(PROC) if (MkErrorCheckI(PROC))
11141
11143#define MkErrorReturnLabel(mng) \
11144 return MK_OK; \
11145error: \
11146 return MkErrorStack_1M(mng);
11147
11149// MkErrorCheck...
11150
11151// #######################################################################
11152// -----------------------------------------------------------------------
11159
11160__parser__global__(prefix2class:MkPanic=MkErrorC);
11161__parser__push__(doc-group=Raise);
11162
11176 MK_STRN const callfunc __parser__(default=F#FUNC),
11177 MK_I32 const errnum __parser__(default=-1),
11178 MK_FST const printfmt,
11179 va_list var_list
11180) MK_ATTR_RT_INSTANCE __attribute__((noreturn));
11181
11182#define MkPanicVL_5M(errobj,callfunc,errnum,printfmt,var_list) \
11183 MkPanicVL(MkObj(errobj),callfunc,errnum,printfmt,var_list)
11184
11197 MK_STRN const callfunc __parser__(default=F#FUNC),
11198 MK_I32 const errnum __parser__(default=-1),
11199 MK_FST const printfmt,
11200 ...
11201) MK_ATTR_RT_INSTANCE MK_RT_ATTR_FORMAT_4 __attribute__((noreturn));
11202
11203#define MkPanicV_4M(errobj,callfunc,errnum,printfmt,...) \
11204 MkPanicV(MkObj(errobj),callfunc,errnum,printfmt,__VA_ARGS__)
11205
11206#define MkPanicV_2M(x,printfmt,...) \
11207 MkPanicV_2(MkObj(x),printfmt,__VA_ARGS__)
11208
11218__parser__(no-type-extension,no-rpc)
11222 MK_STRN const callfunc __parser__(default=F#FUNC),
11223 MK_I32 const errnum __parser__(default=-1),
11224 MK_STRN const message
11225) MK_ATTR_RT_INSTANCE __attribute__ ((noreturn));
11226
11227#define MkPanicC_4M(errobj,callfunc,errnum,message) \
11228 MkPanicC(MkObj(errobj),callfunc,errnum,message)
11229
11230#define MkPanicC_2M(x,message) MkPanicC_2(MkObj(x),message)
11231
11239__parser__(no-rpc)
11243 MK_STRN const callfunc __parser__(default=F#FUNC)
11245
11246#define MkPanicDEFAULT_2M(errobj,...) MkPanicDEFAULT(MkObj(errobj),__VA_ARGS__)
11247#define MkPanicDEFAULT_1M(x) MkPanicDEFAULT_1(MkObj(x))
11248
11253#define MkPanicSYS(mngx) do { \
11254 MkLogC_2X(mngx,"internal ERROR, please contact your local support\n"); \
11255 MkDisasterSignal(-1); \
11256} while (0)
11257
11263__parser__(internal,overload-c-no)
11265 MK_I32 signal __parser__(default=-1) // NO signal
11266) __attribute__ ((noreturn));
11267
11276 MK_ERR const err,
11277 MK_FST const printfmt,
11278 va_list var_list
11280
11286__parser__(no-type-extension)
11289 MK_ERR const err,
11290 MK_FST const printfmt,
11291 ...
11293
11299__parser__(no-type-extension)
11302 MK_ERR const err,
11303 MK_STRN const message
11305
11324__parser__(doc-group=Raise)
11327 MK_ERR const err
11329
11350__parser__(internal)
11353 MK_ERR const err,
11354 MK_STRN const message,
11355 enum MkErrorE const errcode __parser__(default=F#MK_ERROR),
11356 MK_I32 const errnum __parser__(default=-1),
11357 MK_MNG const errctx __parser__(default=NULL)
11359
11368__parser__(hide)
11371 MK_ERR const err,
11372 MK_ERR const newerr
11374
11386__parser__(no-type-extension)
11389 MK_ERR err,
11390 MK_STRN const message,
11391 MK_STRN const callfunc __parser__(default=F#FUNC),
11392 MK_I32 const errnum __parser__(default=-1)
11394
11395#define MkErrorSetC_1XS(message) MkErrorSetC_4M(META_CONTEXT_S,message,__func__,-1)
11396#define MkErrorSetC_2E_E(caller,message) MkErrorCheck(MkErrorSetC_2E(message,caller))
11397
11398#define MkErrorSetC_4_NULL(...) MkErrorSetC_RT(MK_RT_NULL __VA_ARGS__)
11399#define MkErrorSetC_3_NULL(...) MkErrorSetC_4_NULL(&MkERROR_NULL,__VA_ARGS__)
11400#define MkErrorSetC_2_NULL(msg,pfx) MkErrorSetC_3_NULL(msg,pfx,-1)
11401#define MkErrorSetC_1_NULL(msg) MkErrorSetC_3_NULL(msg,__func__,-1)
11402
11403#define MkErrorSetC_4M_NULL(m,...) MkErrorSetC_4_NULL(MkErrorFORMAT_1M(m),__VA_ARGS__)
11404#define MkErrorSetC_3M_NULL(m,msg,pfx) MkErrorSetC_4M_NULL(m,msg,pfx,-1)
11405#define MkErrorSetC_2M_NULL(m,msg) MkErrorSetC_4M_NULL(m,msg,__func__,-1)
11406
11420__parser__(no-type-extension)
11423 MK_ERR err,
11424 MK_STRN const callfunc __parser__(default=F#FUNC),
11425 MK_I32 const errnum __parser__(default=-1),
11426 MK_FST const printfmt,
11427 va_list var_list
11429
11442__parser__(no-type-extension)
11445 MK_ERR err,
11446 MK_STRN const callfunc __parser__(default=F#FUNC),
11447 MK_I32 const errnum __parser__(default=-1),
11448 MK_FST const printfmt,
11449 ...
11451
11452#define MkErrorSetV_4EO_NULL(o,...) MkErrorSetV_NULL(MkErrorFORMAT_EO(o), __VA_ARGS__)
11453#define MkErrorSetV_4M_NULL(m,...) MkErrorSetV_NULL(MkErrorFORMAT_1M(m),__VA_ARGS__)
11454#define MkErrorSetV_2M_NULL(m,...) MkErrorSetV_4M_NULL(m,__func__,-1,__VA_ARGS__)
11455#define MkErrorSetV_2X(x,...) MkErrorSetV(MkErrorFORMAT_1X(x),__func__,-1,__VA_ARGS__)
11456
11457#define MkErrorSetV_1_NULL(printfmt,...) \
11458 MkErrorSetV_NULL(&MkERROR_NULL,__func__,-1,printfmt,__VA_ARGS__)
11459
11460#define MkErrorSetV_1XS(printfmt,...) \
11461 MkErrorSetV_4M(META_CONTEXT_S,__func__,-1,printfmt,__VA_ARGS__)
11462
11463#define MkErrorSetV_2E_E(caller,printfmt,...) \
11464 MkErrorCheck(MkErrorSetV_2E(caller,printfmt,__VA_ARGS__))
11465
11466#define MkErrorSet_ObjectIsNullError(m,printfmt,...) \
11467 MkErrorSetV_4M(m,"ObjectIsNullError",-1,printfmt,__VA_ARGS__)
11468
11469#define MkErrorSysO(obj,cmd) \
11470 MkErrorSetV_4EO_NULL (obj, __func__, errno, \
11471 "can not '%s' -> ERR<%s>", MK_CPPXSTR(cmd), strerror (errno))
11472
11473__parser__pop__; // Raise
11474
11476// MkErrorC_Raise_C_API
11477
11478// #######################################################################
11479// -----------------------------------------------------------------------
11484
11485__parser__push__(doc-group=Misc);
11486
11507 MK_ERR const err,
11508 MK_STRN const callfunc __parser__(default=F#FUNC),
11509 MK_I32 const callline __parser__(default=F#LINE)
11511
11521 MK_ERR const err,
11522 MK_STRN const msg __parser__(default=S#""),
11523 MK_STRN const callfunc __parser__(default=F#FUNC),
11524 MK_I32 const callline __parser__(default=F#LINE)
11526
11527#define MkErrorPrintln_0() MkErrorPrintln_0E()
11528
11539__parser__(const,class-overload=MkObjectLog)
11542 MK_ERRN const err ,
11544 MK_DBG const debug __parser__(default=0),
11545 MK_STRN const callfunc __parser__(default=F#FUNC),
11546 MK_I32 const lvl __parser__(default=0)
11548
11549#define MkErrorLog_1EF_NULL(fmt) MkErrorLog(&MkERROR_NULL,fmt,0,__func__,0)
11550#define MkErrorLog_1EF(fmt) MkErrorLog_4E(fmt,0,__func__,0)
11551
11569__parser__(no-rpc,template-overload)
11572 MK_ERR const err,
11573 MK_EXP const exception __parser__(default=NULL,has-reference),
11574 MK_STRN const callfunc __parser__(default=F#FUNC)
11576
11602__parser__(no-rpc,template-overload)
11605 MK_OBJN const obj,
11606 MK_EXP const exception __parser__(default=NULL,has-reference),
11607 MK_STRN const callfunc __parser__(default=F#FUNC)
11609
11611#define MkObjectErrorCatch_3X(x,...) MkObjectErrorCatch(MkOBJ(x),__VA_ARGS__)
11612
11620__parser__(doc-group=Raise)
11623 MK_ERRN const err
11625
11634// [MkErrorReset-example]
11637 MK_ERR const err,
11638 MK_STRN const callfunc __parser__(default=F#FUNC),
11639 MK_I32 const callline __parser__(default=F#LINE),
11640 bool const force __parser__(default=B#false)
11642
11643#define MkErrorReset_0M() MkErrorReset_4M(NULL,__func__,__LINE__,0);
11644#define MkErrorResetFORCE_1(m) MkErrorReset_4M(m,__func__,__LINE__,1);
11645#define MkErrorResetFORCE_0() MkErrorReset_4M(NULL,__func__,__LINE__,1);
11646
11647#define MkErrorReset_4X(x,...) MkErrorReset(MkErrorFORMAT_1X(x),__VA_ARGS__)
11648#define MkErrorReset_1X(x) MkErrorReset_4X(x,__func__,__LINE__,0)
11649// [MkErrorReset-example]
11650
11658MK_EXTERN void
11661 MK_ERR const err,
11662 MK_STRN callfunc __parser__(default=F#FUNC),
11663 MK_STRN callfile __parser__(default=F#FILE),
11664 MK_I32 const callline __parser__(default=F#LINE)
11666
11675__parser__(error-ignore,no-rpc)
11679 MK_ERR const err __parser__(default=NULL),
11680 MK_STRN const callfunc __parser__(default=F#FUNC),
11681 MK_STRN const callfile __parser__(default=F#FILE),
11682 MK_I32 const callline __parser__(default=F#LINE)
11684
11685#define MkErrorStack_1M_Check(m) (MkErrorCheckE_0E() ? MkErrorStack_1M(m) : MkErrorGetCode_0E())
11686#define MkErrorStack_0E_Check() (MkErrorCheckE_0E() ? MkErrorStack_0E() : MkErrorGetCode_0E())
11687
11688#define MkErrorStack_4X(x,...) MkErrorStack_RT(MK_RT_CALL MkErrorFORMAT_1X(x),__VA_ARGS__)
11689#define MkErrorStack_3X(...) MkErrorStack_4X(__VA_ARGS__,__LINE__)
11690#define MkErrorStack_2X(...) MkErrorStack_4X(__VA_ARGS__,__FILE__,__LINE__)
11691#define MkErrorStack_1X(...) MkErrorStack_4X(__VA_ARGS__,__func__,__FILE__,__LINE__)
11692
11693#define MkErrorStack_0_NULL() MkErrorStack_NULL(&MkERROR_NULL,__func__,__FILE__,__LINE__)
11694
11695#define MkErrorStack_4X_NULL(x,...) MkErrorStack_NULL(MkErrorFORMAT_1X(x),__VA_ARGS__)
11696#define MkErrorStack_3X_NULL(...) MkErrorStack_4X_NULL(__VA_ARGS__,__LINE__)
11697#define MkErrorStack_2X_NULL(...) MkErrorStack_4X_NULL(__VA_ARGS__,__FILE__,__LINE__)
11698#define MkErrorStack_1X_NULL(...) MkErrorStack_4X_NULL(__VA_ARGS__,__func__,__FILE__,__LINE__)
11699
11700#define MkErrorStack_NUM 50
11701#define MkErrorStack_STR "50"
11702
11704__parser__(class-overload=MkObjectToString)
11708 MK_ERRN const inst
11710
11711__parser__pop__; // Misc
11712
11714// MkErrorC_Misc_C_API
11715
11716// #######################################################################
11717// -----------------------------------------------------------------------
11743
11754__parser__(class=MkExceptionC,ignore)
11755bool MkExceptionCheck (MK_EXP exception);
11756
11762__parser__(class=MkExceptionC,ignore)
11764 MK_MNG const expobj,
11765 MK_STRN const callfunc,
11766 MK_I32 const callline
11767) ;
11768
11776__parser__(class=MkExceptionC,ignore)
11778 MK_MNG const expobj,
11779 MK_EXP const exception,
11780 MK_STRN const callfunc
11781) ;
11782
11784// MkException_C_API
11785
11786// #######################################################################
11787// -----------------------------------------------------------------------
11793
11795__parser__(ignore)
11796struct MkRtExtS {
11797 // BEGIN-MkRtExtS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
11798
11799 union {
11800 struct MkObjectS obj; // instance-base MkObjectS
11801 struct MkExtensionS ext; // instance-base MkExtensionS
11803
11804 // END-MkRtExtS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
11805
11807};
11808
11809// BEGIN-MkRtExtS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
11810
11814 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
11815
11816// Signature --------------------------------------------------------------
11819
11820 #define MkRtExtC_SIGNATURE (MkExtensionC_SIGNATURE ^ (2u<<6))
11821 #define MkRtExtC_MASK (((1u<<26)-1)<<6)
11822
11824
11825// CompileTimeCast --------------------------------------------------------------
11828
11829 #define MkRtExtC_X2rtext(x) (x)
11830 #define MkRtExtC_X2ext(x) MkEXT(x)
11831 #define MkRtExtC_X2obj(x) MkOBJ(x)
11832
11834
11835// TypeDef --------------------------------------------------------------
11838
11840 __parser__(ignore) typedef struct MkRtExtS MkRtExtCR;
11842 __parser__(ignore) typedef const struct MkRtExtS MkRtExtCNR;
11844 #define MkRtExtC_T (&MK_RT_REF._MkRtExtC_T)
11846 #define MkRtExtC_TT (MkTYP(MkRtExtC_T))
11848 #define MkRtExtST MkRtExtC_T
11850 #define MkRtExtSTT (MkTYP(MkRtExtST))
11852 #define MkRtExtC_type MK_RTEXT
11854 #define MkRtExtCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
11856 #define MkRtExtCTT_X(instance) (MkOBJ_R(instance).type)
11858 #define MkRtExtCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
11860 #define MkRtExtC_NS MK
11862 #define MkRtExtCTT MkRtExtCTT
11864 #define MkRtExtCT ( (struct MkTypeDefS *) MkRtExtCTT )
11865
11867
11868// TypeCheck --------------------------------------------------------------
11871
11872 #pragma GCC diagnostic push
11873 #pragma GCC diagnostic ignored "-Wattributes"
11874
11877 __parser__(class=MkRtExtC,static,ignore)
11880 return MkSanitizeCheck(MkRtExtC,mng);
11881 }
11882
11885 __parser__(class=MkRtExtC,static,ignore)
11888 return MkSanitizeCheckO(MkRtExtC,obj);
11889 }
11890
11891 #pragma GCC diagnostic pop
11892 #define MkRtExtC_Check(mng) MkRtExtCheck(mng)
11893
11895
11896// RunTimeCast --------------------------------------------------------------
11899
11901 __parser__(class=MkRtExtC,ignore,static)
11902 META_ATTRIBUTE_SANITIZE
11905 return (MkRtExtCheck(mng) ? (MK_RTEXT)mng : NULL);
11906 }
11907
11909 __parser__(class=MkRtExtC,ignore,static)
11910 META_ATTRIBUTE_SANITIZE
11913 return (MkRtExtCheck(mng) ? (MK_RTEXTN)mng : NULL);
11914 }
11915
11917 #define MkRtExtRaise(_rtext) if (!_MkCheckX(MkRtExtC,_rtext)) { \
11918 MkErrorSetC_1E("'MkRtExtC' hdl is NULL"); \
11919 goto error ; \
11920 }
11921
11923 #define MkRTEXT_R(x) (*(x)).super.rtext
11925 #define MkRTEXT(x) (&MkRTEXT_R(x))
11926
11928
11931// MkRtExtC_Class_Define_C_API
11932
11933// END-MkRtExtS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
11934
11935#define MkRtExtAdd(_mkrtR,add,id) do { \
11936 (_mkrtR).mkRtExt = (typeof((_mkrtR).mkRtExt)) MkExtensionAdd(MkEXT((_mkrtR).mkRtExt),MkEXT(add)); \
11937 MkRTEXT_R(add).mkrtHead = &(_mkrtR); \
11938 (_mkrtR).mkRtExtAry[id] = MkRTEXT(add); \
11939} while (0) \
11940
11941#define MkRtExtDel(_mkrtR,del,id) do { \
11942 (_mkrtR).mkRtExt = (typeof((_mkrtR).mkRtExt)) MkExtensionDel(MkEXT((_mkrtR).mkRtExt),MkEXT(del)); \
11943 MkRTEXT_R(del).mkrtHead = NULL; \
11944 (_mkrtR).mkRtExtAry[id] = NULL; \
11945} while (0) \
11946
11948// MkRtExtC_C_API
11949
11950// #######################################################################
11951// -----------------------------------------------------------------------
11952//
11953// \addtogroup MqExceptionC_C_API
11954// \{
11955// \brief target-language class to 'set' and 'raise' an error …
11956//
11957// \}
11958// MqExceptionC_C_API
11959
11960/* MARK_R ################################################################ */
11961/* ### ### */
11962/* ### R U N T I M E - A P I ### */
11963/* ### ### */
11964/* ####################################################################### */
11965
11966__parser__global__(prefix2class:MkRuntime=MkRuntimeC);
11967
12014#define MkDbgRt_1(c) mk_dbg_color_ln(c,"mkrt<%p>, MkRT<%p>", mkrt, MkRT)
12015#define MkDbgRt() MkDbgRt_1(MK_COLOR_PURPLE)
12016#define MkDbgRtChkX(x) (MkRT_X(x)==MkRT?"ok":"wrong")
12017
12018__parser__(ignore)
12023
12026
12027#pragma GCC diagnostic push
12028#pragma GCC diagnostic ignored "-Wlto-type-mismatch"
12029
12030#if defined(MK_C_BUILD_DLL)
12031
12032 #define META_SECTION_DEFINE
12033 #include "MkRuntimeS_mk.h"
12034 #undef META_SECTION_DEFINE
12035
12036#else
12037
12040
12041 // ======================================================================================
12042 // PUBLIC variables -> sync with MkRuntimeS_mk.h !!
12043
12044 // !!! sync with MkRuntimeS_mk.h
12045
12056
12057 // BEGIN-MkRuntimeS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
12058
12059 union {
12060 struct MkObjectS obj; // instance-base MkObjectS
12062
12063 // END-MkRuntimeS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
12064
12067
12070
12073
12076
12079
12084
12090
12093
12101
12104
12106
12109
12112
12117
12120
12123
12134
12135 // ======================================================================================
12136 // TYPES
12137
12138 // BEGIN-rtDef - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
12139
12164
12165 // END-rtDef - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
12166
12167 // offset calculated by "Nhi1InternalSize"
12169};
12170
12171#endif
12172
12173#pragma GCC diagnostic pop
12174
12175// BEGIN-MkRuntimeS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
12176
12180 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
12181
12182// Signature --------------------------------------------------------------
12185
12186 #define MkRuntimeC_SIGNATURE (MkObjectC_SIGNATURE ^ (10u<<10))
12187 #define MkRuntimeC_MASK (((1u<<22)-1)<<10)
12188
12190
12191// CompileTimeCast --------------------------------------------------------------
12194
12195 #define MkRuntimeC_X2rt(x) (x)
12196 #define MkRuntimeC_X2obj(x) MkOBJ(x)
12197
12199
12200// TypeDef --------------------------------------------------------------
12203
12205 __parser__(ignore) typedef struct MkRuntimeS MkRuntimeCR;
12207 __parser__(ignore) typedef const struct MkRuntimeS MkRuntimeCNR;
12209 #define MkRuntimeC_T (&MK_RT_REF._MkRuntimeC_T)
12211 #define MkRuntimeC_TT (MkTYP(MkRuntimeC_T))
12213 #define MkRuntimeST MkRuntimeC_T
12215 #define MkRuntimeSTT (MkTYP(MkRuntimeST))
12217 #define MkRuntimeC_type MK_RT
12219 #define MkRuntimeCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
12221 #define MkRuntimeCTT_X(instance) (MkOBJ_R(instance).type)
12223 #define MkRuntimeCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
12225 #define MkRuntimeC_NS MK
12227 #define MkRuntimeCTT MkRuntimeCTT
12229 #define MkRuntimeCT ( (struct MkTypeDefS *) MkRuntimeCTT )
12230
12232
12233// TypeCheck --------------------------------------------------------------
12236
12237 #pragma GCC diagnostic push
12238 #pragma GCC diagnostic ignored "-Wattributes"
12239
12242 __parser__(class=MkRuntimeC,static,hide)
12245 return MkSanitizeCheck(MkRuntimeC,mng);
12246 }
12247
12250 __parser__(class=MkRuntimeC,static,hide)
12253 return MkSanitizeCheckO(MkRuntimeC,obj);
12254 }
12255
12256 #pragma GCC diagnostic pop
12257 #define MkRuntimeC_Check(mng) MkRtCheck(mng)
12258
12260
12261// RunTimeCast --------------------------------------------------------------
12264
12266 __parser__(class=MkRuntimeC,hide,static)
12267 META_ATTRIBUTE_SANITIZE
12270 return (MkRtCheck(mng) ? (MK_RT)mng : NULL);
12271 }
12272
12274 __parser__(class=MkRuntimeC,hide,static)
12275 META_ATTRIBUTE_SANITIZE
12278 return (MkRtCheck(mng) ? (MK_RTN)mng : NULL);
12279 }
12280
12282 #define MkRtRaise(_rt) if (!_MkCheckX(MkRuntimeC,_rt)) { \
12283 MkErrorSetC_1E("'MkRuntimeC' hdl is NULL"); \
12284 goto error ; \
12285 }
12286
12288
12291// MkRuntimeC_Class_Define_C_API
12292
12293// END-MkRuntimeS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
12294
12296// MkRuntime_C_API
12297
12298// =========================================================================
12299// BEGIN-MkRuntimeS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
12300
12303
12306
12307__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkRuntimeC);
12308
12324__parser__(class-overload=MkObjectHandleGet)
12328 MK_RT const rt __parser__(null-allowed)
12329) {
12330 return MkObjectHandleGet(rt?MkOBJ(rt):NULL);
12331}
12332
12341__parser__(flags=new)
12345 MK_HDL const netHdl
12346) {
12347 return MkRt(MkObjectHandleResolve(netHdl));
12348}
12349
12359#define MkRuntimeHandleResolve_e(netHdl) ({ \
12360 MK_HDL tmpHdl=netHdl; \
12361 MK_RT tmp; \
12362 if (tmpHdl==0) { \
12363 tmp=NULL; \
12364 } else { \
12365 tmp=MkRuntimeHandleResolve(tmpHdl); \
12366 if (tmp==NULL) { \
12367 MkErrorSetC_1_NULL("ERROR: 'MkRuntimeC' handle is 'NULL'"); \
12368 goto error; \
12369 }; \
12370 }; \
12371 tmp; \
12372})
12373
12375
12377// Class export & import
12378
12382 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkRuntimeC,null-return-allow)
12385 return (MK_RT)MK_NULL;
12386 }
12388// MkRuntimeC - Misc - function
12389
12391// MkRuntimeC_Class_C_API
12392
12393// END-MkRuntimeS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
12394
12398
12399// #######################################################################
12400// -----------------------------------------------------------------------
12404
12407
12408#define MkRT (&MkRuntimeRLS)
12409#define MkRT_R (MkRuntimeRLS)
12410
12411#if META_HAS_THREAD
12412 #define MkRT_O(o) ((o) && (*o).objRt ? (*o).objRt : MkRuntimeGet())
12413 #define MkRT_X(x) ((x) && MkOBJ_R(x).objRt ? MkOBJ_R(x).objRt : MkRuntimeGet())
12414 #define MkRT_ONN(o) ((*o).objRt)
12415 #define MkRT_ON(o) ( (*o).objRt ? (*o).objRt : MkRuntimeGet())
12416 #define MkRT_XN(x) ( MkOBJ_R(x).objRt ? MkOBJ_R(x).objRt : MkRuntimeGet())
12417#else
12418 #define MkRT_O(o) MkRT
12419 #define MkRT_X(x) MkRT
12420 #define MkRT_ONN(o) MkRT
12421 #define MkRT_ON(o) MkRT
12422 #define MkRT_XN(x) MkRT
12423#endif
12424
12425#if META_HAS_THREAD
12426 #define MkRtSetup_O(o) MK_RT_UNUSED MK_RT const mkrt = MkRT_O(o)
12427 #define MkRtSetup_X(x) MK_RT_UNUSED MK_RT const mkrt = MkRT_X(x)
12428 #define MkRtSetup_XN(x) MK_RT_UNUSED MK_RT const mkrt = MkRT_XN(x)
12429 #define MkRtSetup_ON(o) MK_RT_UNUSED MK_RT const mkrt = MkRT_ON(o)
12430 #define MkRtSetup_NULL MK_RT_UNUSED MK_RT const mkrt = MkRuntimeGet()
12431 #define MkRtSetup_RT(r) MK_RT_UNUSED MK_RT const mkrt = r
12432 #define MkRtSetupFromRtExt(rtx) MK_RT_UNUSED MK_RT const mkrt = MkRTEXT_R(rtx).mkrtHead
12433
12434// check "rt" on NULL if available as argument (MK_RT_ARGS).
12435 #define MkRtSetup_O_RT(o) if (mkrt == NULL) mkrt = MkRT_O(o)
12436 #define MkRtSetup_ON_RT(o) if (mkrt == NULL) mkrt = MkRT_ON(o)
12437 #define MkRtSetup_X_RT(x) if (mkrt == NULL) mkrt = MkRT_X(x)
12438 #define MkRtSetup_XN_RT(x) if (mkrt == NULL) mkrt = MkRT_XN(x)
12439 #define MkRtSetup_NULL_RT if (mkrt == NULL) mkrt = MkRuntimeGet()
12440
12441 #define AllRtSetup_O(o) MkRtSetup_O(o)
12442 #define AllRtSetup_ON(o) MkRtSetup_ON(o)
12443 #define AllRtSetup_X(x) MkRtSetup_X(x)
12444 #define AllRtSetup_XN(x) MkRtSetup_XN(x)
12445 #define AllRtSetup_NULL MkRtSetup_NULL
12446#else
12447 #define MkRtSetup_O(o)
12448 #define MkRtSetup_X(x)
12449 #define MkRtSetup_XN(x)
12450 #define MkRtSetup_ON(o)
12451 #define MkRtSetup_NULL
12452 #define MkRtSetup_RT(r)
12453
12454 #define MkRtSetup_O_RT(o)
12455 #define MkRtSetup_X_RT(x)
12456 #define MkRtSetup_XN_RT(x)
12457 #define MkRtSetup_ON_RT(o)
12458 #define MkRtSetup_NULL_RT
12459
12460 #define AllRtSetup_O(o)
12461 #define AllRtSetup_ON(o)
12462 #define AllRtSetup_X(x)
12463 #define AllRtSetup_XN(x)
12464 #define AllRtSetup_NULL
12465#endif
12466
12468
12475
12524__parser__(ignore)
12525typedef struct MkRuntimeCallbackS {
12527
12529
12530 #define MkRuntimeCallbackS_ident_size 30
12532
12533 // private
12535
12536 // CDL list
12540
12609__parser__(ignore)
12612 MkRuntimeCallbackS * cbdata,
12613 MkRuntimeInitF rt_callback,
12615);
12616
12619__parser__(ignore)
12622 MkRuntimeCallbackS * cbdata
12623);
12624
12626// - MkRuntimeCallback
12627
12629__parser__(ignore)
12632
12639__parser__(ignore)
12641
12647__parser__(ignore)
12649
12651MK_ATTR_STATIC __parser__(hide,doc-group=Config)
12653{
12654 return __MkCheckX(MkRuntimeC,&MkRuntimeRLS) ? MkRT : MkRuntimeSetup( MkRT );
12655}
12656
12658MK_ATTR_STATIC __parser__(hide,doc-group=Config)
12660 MK_OBJ obj __parser__(null-allowed)
12661) {
12662 return MkRT_O(obj);
12663}
12664
12666// - MkRuntimeC_Interface_C_API
12667
12668// #######################################################################
12669// -----------------------------------------------------------------------
12679
12680__parser__push__(doc-group=Config);
12681
12685 return MkRuntimeRLS.isSilent;
12686}
12687
12691
12695 return MkRuntimeRLS.debug;
12696}
12697
12701 MkRuntimeRLS.debug = dbg;
12702}
12703
12711
12719 MK_STRN logTgt
12720) ;
12721
12728) ;
12729
12733 MK_STRN logTgt
12734) ;
12735
12736#define MkRuntimeLogBufferPush() MkLogDataS saveLogTarget = MkRuntimeLogTargetPush_RT(MK_RT_CALL "BUFFER")
12737//#define MkRuntimeLogBufferPush()
12738
12742 MkLogDataS logOld
12743) ;
12744
12745#define MkRuntimeLogBufferPop() MkRuntimeLogTargetPop_RT(MK_RT_CALL saveLogTarget)
12746//#define MkRuntimeLogBufferPop()
12747
12749__parser__(hide)
12751
12753MK_ATTR_RT_STATIC __parser__(error-ignore)
12756) {
12758 return MkERROR_RT.code;
12759}
12760
12762
12764// - MkRuntimeC_Config_C_API
12765
12766// #######################################################################
12767// -----------------------------------------------------------------------
12772
12773__parser__push__(doc-group=Info);
12774
12784__parser__(const)
12788 MK_DBG const debug __parser__(default=0),
12789 MK_STRN const callfunc __parser__(default=F#FUNC),
12790 MK_I32 const lvl __parser__(default=0)
12792
12794
12796// - MkRuntimeC_Config_C_API
12797
12798/* ####################################################################### */
12799/* ### ### */
12800/* ### P A C K A G E - A P I ### */
12801/* ### ### */
12802/* ####################################################################### */
12803
12859// #######################################################################
12860// -----------------------------------------------------------------------
13026#ifndef MK_EMBEDDED
13028 #define MK_EMBEDDED(type,call,...) ({ \
13029 type ret = (type) 0; \
13030 if (MkErrorCheckI(call (__VA_ARGS__,&ret))) goto error; \
13031 ret; \
13032 })
13033#endif
13034
13035#ifndef MK_EMBEDDED_REF
13037 #define MK_EMBEDDED_REF(type,call,...) ({ \
13038 type ret = {0}; \
13039 if (MkErrorCheckI(call (__VA_ARGS__,&ret))) goto error; \
13040 ret; \
13041 })
13042#endif
13043
13045// MkKernel_Overload_C_API
13046
13047/*****************************************************************************/
13048/* */
13049/* doc functions */
13050/* */
13051/*****************************************************************************/
13052
13053// -----------------------------------------------------------------------
13068
13069// -----------------------------------------------------------------------
13070// BEGIN-Class-Doc-Order - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
13071
13072// external
13078
13079// external
13085
13086// internal
13093
13094// external
13100
13101// internal
13108
13109// external
13115
13116// external
13122
13123// internal
13130
13131// external
13137
13138// internal
13145
13146// END-Class-Doc-Order - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
13147
13148/*****************************************************************************/
13149/* */
13150/* inline functions */
13151/* */
13152/*****************************************************************************/
13153
13154// BEGIN-Class-Introspection - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
13155
13160
13161__parser__push__(doc-name=Introspection,doc-index=Class,class=MkBufferListC,no-rpc,null-return-allow,flags=new);
13162
13170
13174 MK_INSTANCE_HDL(bfl);
13175 return (MK_BFL)MkBufferListC_X2obj(bfl)->obj_protect.next;
13176}
13177
13181 MK_INSTANCE_HDL(bfl);
13182 return (MK_BFL)MkBufferListC_X2obj(bfl)->obj_protect.prev;
13183}
13184
13186
13189// MkBufferListC_Class_C_API
13190
13195
13196__parser__push__(doc-name=Introspection,doc-index=Class,class=MkBufferC,no-rpc,null-return-allow,flags=new);
13197
13205
13209 MK_INSTANCE_HDL(buf);
13210 return (MK_BUF)MkBufferC_X2obj(buf)->obj_protect.next;
13211}
13212
13216 MK_INSTANCE_HDL(buf);
13217 return (MK_BUF)MkBufferC_X2obj(buf)->obj_protect.prev;
13218}
13219
13221
13224// MkBufferC_Class_C_API
13225
13230
13231__parser__push__(doc-name=Introspection,doc-index=Class,class=MkBufferStreamC,no-rpc,null-return-allow,flags=new);
13232
13240
13244 MK_INSTANCE_HDL(bus);
13245 return (MK_BUS)MkBufferStreamC_X2obj(bus)->obj_protect.next;
13246}
13247
13251 MK_INSTANCE_HDL(bus);
13252 return (MK_BUS)MkBufferStreamC_X2obj(bus)->obj_protect.prev;
13253}
13254
13256
13259// MkBufferStreamC_Class_C_API
13260
13265
13266__parser__push__(doc-name=Introspection,doc-index=Class,class=MkErrorC,no-rpc,null-return-allow,flags=new);
13267
13275
13279 MK_INSTANCE_HDL(err);
13280 return (MK_ERR)MkErrorC_X2obj(err)->obj_protect.next;
13281}
13282
13286 MK_INSTANCE_HDL(err);
13287 return (MK_ERR)MkErrorC_X2obj(err)->obj_protect.prev;
13288}
13289
13291
13294// MkErrorC_Class_C_API
13295
13300
13301__parser__push__(doc-name=Introspection,doc-index=Class,class=MkLogFileC,no-rpc,null-return-allow,flags=new);
13302
13310
13314 MK_INSTANCE_HDL(lfl);
13315 return (MK_LFL)MkLogFileC_X2obj(lfl)->obj_protect.next;
13316}
13317
13321 MK_INSTANCE_HDL(lfl);
13322 return (MK_LFL)MkLogFileC_X2obj(lfl)->obj_protect.prev;
13323}
13324
13326
13329// MkLogFileC_Class_C_API
13330
13335
13336__parser__push__(doc-name=Introspection,doc-index=Class,class=MkObjectC,no-rpc,null-return-allow);
13337
13345
13349 MK_INSTANCE_HDL(obj);
13350 return (MK_OBJ)MkObjectC_X2obj(obj)->obj_protect.next;
13351}
13352
13356 MK_INSTANCE_HDL(obj);
13357 return (MK_OBJ)MkObjectC_X2obj(obj)->obj_protect.prev;
13358}
13359
13361
13364// MkObjectC_Class_C_API
13365
13370
13371__parser__push__(doc-name=Introspection,doc-index=Class,class=MkRuntimeC,no-rpc,null-return-allow,flags=new);
13372
13380
13384 MK_INSTANCE_HDL(rt);
13385 return (MK_RT)MkRuntimeC_X2obj(rt)->obj_protect.next;
13386}
13387
13391 MK_INSTANCE_HDL(rt);
13392 return (MK_RT)MkRuntimeC_X2obj(rt)->obj_protect.prev;
13393}
13394
13396
13399// MkRuntimeC_Class_C_API
13400
13401// END-Class-Introspection - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
13402
13406
13409__parser__(internal)
13411 // TODO replace loop by hash
13412 MkTypeLoop(MkTypeC,typ) {
13413 if ((*typ).objsig == typeSIG) return MkTypeInstances(typ);
13414 }
13415 return NULL;
13416}
13417
13418/*
13419mk_inline MK_SIG MkObjectRpcHdlGet(MK_OBJ obj) {
13420 return (*obj).rpcHdl;
13421}
13422*/
13423
13424// =============================================================================================================
13425
13433
13441
13449
13457
13465
13470 MK_OBJ obj,
13471 MK_PTR *self_out,
13472 MK_PTR const env
13473) {
13474 assert(self_out != NULL);
13475
13476 if (obj == NULL) {
13477 *self_out = NULL;
13478 return MK_OK;
13479 }
13480 MkRtSetup_ON_RT(obj);
13481
13482 enum MkErrorE ret = MK_OK;
13483 MK_PTR self = MkSelfGet(obj);
13484 if (self != NULL) {
13485 if (MkRefGet(obj) <= 0) {
13486 MkErrorSetV_2M(obj, "RefCount Error: object '%s' has 'self' but 'refCout <= 0", obj->type->type_name);
13487 goto error;
13488 } else {
13489 ret = MK_CONTINUE;
13490 if (MK_RT_REF.MkSelfIncrOnCacheB && MK_RT_REF.fSelfIncr) (*MK_RT_REF.fSelfIncr)(MK_RT_CALL self, env);
13491 goto end;
13492 }
13493 }
13494 self = MkSelfCreate(obj, env);
13495 if (self == NULL) {
13496 MkErrorSetV_2M(obj, "Error: '%s->SelfCreate' return a NULL pointer", obj->type->type_name);
13497 goto error;
13498 }
13499end:
13500 *self_out = self;
13501 return ret;
13502error:
13503 *self_out = NULL;
13504 return MK_ERROR;
13505}
13506
13509
13521 MK_OBJ const obj
13522) {
13523 MK_INSTANCE_RT_O(obj);
13524 return MkErrorFORMAT_1O(obj);
13525}
13526
13527#define MkObjectToError_1X(obj) MkObjectToError(MkOBJ(obj))
13528
13530// MkObjectC_Misc_C_API
13531
13534
13538 return MkBinaryCreate(bin.size,(MK_BIN)MkSysMemDup(MK_ERROR_PANIC,bin.data,(size_t)bin.size));
13539}
13540
13544 MkLogV(MK_ERROR_FORMAT,__func__,0,"MkBinaryR: size=%li, data=%p\n", bin.size, bin.data);
13545}
13546
13548
13551
13555 return MkStringCreate(str.len,(MK_STRN)MkSysMemDup(MK_ERROR_PANIC,str.ptr,(size_t)str.len));
13556}
13557
13562 MkLogV(MK_ERROR_FORMAT,func,0,"MkStringR: len=%i -> %.*s\n", str.len, str.len, str.ptr);
13563}
13564
13566
13571 MkDCheck(1) {
13573 MkLogC(MK_ERROR_FORMAT, "Attention: set 'silient'\n", 1, __func__);
13576 }
13577 MkRuntimeRLS.isSilent = silent;
13578};
13579
13584 MkRuntimeRLS.noDeco = noDeco;
13585};
13586
13587// end c++ save definition
13589// END: BEGIN_MK_C_DECLS
13590
13591#endif // KERNEL_MK_H
13592
13593// vim:nowrap
#define MkLogDataS_LogNAME_size
append to logFILE, valid values are: stderr, stdout or a filename (default: stderr)
#define MkCacheS_MkCacheItemS_size
#define MkCacheS_name_size
#define META_TIMEOUT_REF
#define MkTypeS_name_size
static MK_OBJ MkObjectInstancesOfType_RT(MK_RT mkrt, MK_SIG typeSIG)
return the head-instance from a specific type defined by signature typeSIG …
#define MkRuntimeCallbackS_ident_size
#define MkBuffer1024S_ils_size
1024 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBuffer256S_ils_size
256 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBuffer64S_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
MK_NUM MkBufferPush_RT(MK_RT mkrt, MK_BUF const buf, MK_STRN const val)
add str to the MkBufferC …
enum MkErrorE MkBufferToObject_RT(MK_RT mkrt, MK_BUF const buf, MK_NAT_OBJECT *obj_out)
return the native language object from a MkBufferC …
MK_BUF MkBufferAppendC_RT(MK_RT mkrt, MK_BUF const buf, MK_STRN const val)
append a single string to a MkBufferC object …
MK_I32 MkBufferAppendV_RT(MK_RT mkrt, MK_BUF const buf, MK_FST const printfmt,...)
append a single string with format and ... arguments to a MkBuffer64S …
MK_I32 MkBufferAppendVL_RT(MK_RT mkrt, MK_BUF const buf, MK_FST const printfmt, va_list var_list)
append a single string with format and var_list arguments to a MkBuffer64S …
MK_BUF MkBufferAppendStringR_RT(MK_RT mkrt, MK_BUF const buf, MkStringR const val)
append a single string to a MkBufferC object …
MK_NUM MkBufferPop_RT(MK_RT mkrt, MK_BUF const buf, MK_STRN const val)
delete str from the MkBufferC …
#define MkBufferS_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
static MK_BUF MkBufferNext(MK_BUF const buf)
get next instance from linked-list of MkBufferS type
static MK_BUF MkBufferInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkBufferS type …
static MK_BUF MkBufferGetNull(void)
Null-Slot - return a MkBufferC typed NULL instance …
static MK_BUF MkBufferHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkBufferC from netHdl or MK_NULL if invalid…
static MK_HDL MkBufferHandleGet_RT(MK_RT mkrt, MK_BUF const buf)
Handle-Get-Slot - returns a export-hdl to the MkBufferC useable for external storage
static MK_BUF MkBufferPrev(MK_BUF const buf)
get previous instance from linked-list of MkBufferS type
static MK_BUF MkBuf(MK_MNG mng)
cast a unknown-object into an MkBufferS pointer or NULL if not possible
static bool MkBufCheckO(MK_OBJN obj)
check MkBufferS -> MkObjectS::signature …
#define MkBufferC_X2obj(x)
static bool MkBufCheck(MK_MNGN mng)
check MkBufferS -> MkObjectS::signature …
#define MkBufferC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
static MK_BUFN MkBufN(MK_MNGN mng)
(const) cast a unknown-object into an MkBufferS pointer or NULL if not possible
enum MkErrorE MkBufferGetI64_RT(MK_RT mkrt, MK_BUFN const buf, MK_I64 *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetDBL_RT(MK_RT mkrt, MK_BUFN const buf, MK_DBL *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetBOOL_RT(MK_RT mkrt, MK_BUFN const buf, MK_BOOL *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetFLT_RT(MK_RT mkrt, MK_BUFN const buf, MK_FLT *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetBIN_RT(MK_RT mkrt, MK_BUFN const buf, MkBinaryR *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetSTR_RT(MK_RT mkrt, MK_BUFN const buf, MK_STRN *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetBOL_RT(MK_RT mkrt, MK_BUFN const buf, MK_BOL *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetU32_RT(MK_RT mkrt, MK_BUFN const buf, MK_U32 *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetI32_RT(MK_RT mkrt, MK_BUFN const buf, MK_I32 *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetLONG_RT(MK_RT mkrt, MK_BUFN const buf, MK_LONG *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetI8_RT(MK_RT mkrt, MK_BUFN const buf, MK_I8 *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetU16_RT(MK_RT mkrt, MK_BUFN const buf, MK_U16 *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetI16_RT(MK_RT mkrt, MK_BUFN const buf, MK_I16 *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetBUF_RT(MK_RT mkrt, MK_BUF const buf, MK_BUF *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetStringR_RT(MK_RT mkrt, MK_BUFN const buf, MkStringR *const val_out)
get a val_out from a MkBufferC …
enum MkErrorE MkBufferGetBFL_RT(MK_RT mkrt, MK_BUFN const buf, MK_BFL *const val_inout)
function to read an MkBufferListC from an MkBufferC object …
bool MkBufferIsLocal_RT(MK_RT mkrt, MK_BUFN const buf)
Check if the MkBufferC is local (temporary), not local mean global …
enum MkTypeE MkBufferGetType2_RT(MK_RT mkrt, MK_BUFN const buf)
return the MkTypeE from a MkBufferC …
void MkBufferLog_RT(MK_RT mkrt, MK_BUFN const buf, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the MkBufferC …
MK_STRB MkBufferGetType1_RT(MK_RT mkrt, MK_BUFN const buf)
return the type from a MkBufferC as single character value …
MK_STRN MkBufferGetType3_RT(MK_RT mkrt, MK_BUFN const buf)
return the type from a MkBufferC as single character string …
void MkBufferLogSS_RT(MK_RT mkrt, MK_BUFN const buf, MK_STRN const varname, MK_OBJN fmtobj, MK_STRN const callfunc)
log the whole MkBufferC object to the MkLogFileC (default: stderr) …
void MkBufferLogS_RT(MK_RT mkrt, MK_BUFN const buf, MK_STRN const varname, MK_OBJN fmtobj, MK_STRN const callfunc)
log the short MkBufferC object data to the MkLogFileC (default: stderr) …
enum MkErrorE MkBufferCastTo_RT(MK_RT mkrt, MK_BUF const buf, enum MkTypeE const typ)
change the type of an MkBufferC to type …
MK_I32 MkBufferCmp_RT(MK_RT mkrt, MK_BUFN const buf1, MK_BUFN const buf2)
compare TWO MkBufferC objects like strcmp do it for strings …
MK_STRN MkBufferToString_RT(MK_RT mkrt, MK_BUFN const inst)
String-Slot - returns the string representation of the inst …
MK_BUF MkBufferTemp_RT(MK_RT mkrt, MK_BUFN const buf)
create a temporary copy of the MkBufferC buf …
MK_BUF MkBufferSizeNew_RT(MK_RT mkrt, MK_BUF const buf, MK_NUM const size)
alloc min size storage to the buf …
void MkBufferResetFull_RT(MK_RT mkrt, MK_BUF const buf)
reset a MkBufferC to the length zero and free allocated storage…
MK_BUF MkBufferCopy_RT(MK_RT mkrt, MK_BUF const buf, MK_BUFN const srce)
copy the MkBufferC from srce to dest …
MK_BUF MkBufferReset_RT(MK_RT mkrt, MK_BUF const buf)
reset a MkBufferC to the length zero …
MK_BUF MkBufferSizeAdd_RT(MK_RT mkrt, MK_BUF const buf, MK_NUM const size)
add size storage to the buf …
MK_BUF MkBufferSetI8_RT(MK_RT mkrt, MK_BUF const buf, MK_I8 const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetBinaryR_RT(MK_RT mkrt, MK_BUF const buf, MkBinaryR const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetV_RT(MK_RT mkrt, MK_BUF const buf, MK_FST const val,...)
set the MkBufferC using a ... value …
MK_BUF MkBufferSetI16_RT(MK_RT mkrt, MK_BUF const buf, MK_I16 const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetSTR_RT(MK_RT mkrt, MK_BUF const buf, MK_STRN const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetBIN_RT(MK_RT mkrt, MK_BUF const buf, MkBinaryR const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetDBL_RT(MK_RT mkrt, MK_BUF const buf, MK_DBL const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetFLT_RT(MK_RT mkrt, MK_BUF const buf, MK_FLT const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetI32_RT(MK_RT mkrt, MK_BUF const buf, MK_I32 const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetVL_RT(MK_RT mkrt, MK_BUF const buf, MK_FST const val, va_list var_list)
set the MkBufferC using a va_list value …
MK_BUF MkBufferSetBOL_RT(MK_RT mkrt, MK_BUF const buf, MK_BOL const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetStringR_RT(MK_RT mkrt, MK_BUF const buf, MkStringR const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetI64_RT(MK_RT mkrt, MK_BUF const buf, MK_I64 const val)
Set the MkBufferC to the val …
MK_BUF MkBufferSetBUF_RT(MK_RT mkrt, MK_BUF const buf, MK_BUFN const val)
Set the MkBufferC to the val …
MK_BUF MkBufferMerge_RT(MK_RT mkrt, MK_BUF const buf)
Merge-Constructor - create a new MkBufferC as a merge from an existing object …
MK_BUF MkBufferCreateSTR_RT(MK_RT mkrt, MK_STRN const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreateI8_RT(MK_RT mkrt, MK_I8 const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
#define MkBufferCreateLOCAL_T(cls, name, size)
create an new MkBufferC object as L)ocal S)torage…
MK_BUF MkBufferCreateBOL_RT(MK_RT mkrt, MK_BOL const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreateI64_RT(MK_RT mkrt, MK_I64 const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreateI32_RT(MK_RT mkrt, MK_I32 const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreate64_RT(MK_RT mkrt, MK_NUM const size)
call the BufferCreate with default type MkBuffer64S (64 byte) …
#define MkBufferCreateTLS_inout_T(cls, name, inout)
Constructs a MkBufferC instance as T)hread L)ocal S)torage OR reuse inout if possible…
MK_BUF MkBufferCreate256_RT(MK_RT mkrt, MK_NUM const size)
call the BufferCreate with default type MkBuffer256S (256 byte) …
MK_BUF MkBufferCreate_RT(MK_RT mkrt, MK_TYP type, MK_NUM const size)
Constructor - create a new MkBufferC with minimum size of internal storage …
MK_BUF MkBufferCreateI16_RT(MK_RT mkrt, MK_I16 const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
void MkBufferInit_RT(MK_RT mkrt, MK_BUF const buf, MK_TYP type, MK_NUM const size)
initialize or free an MkBufferC reference-instance …
#define MkBufferCreateTLS_T(cls, name, size)
create an new MkBufferC object as T)hread L)ocal S)torage…
MK_BUF MkBufferDup_RT(MK_RT mkrt, MK_BUFN const buf)
Dup-Constructor - create a new MkBufferC instance as copy from an existing MkBufferC instance
MK_BUF MkBufferCreateDBL_RT(MK_RT mkrt, MK_DBL const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
void MkBufferFree_RT(MK_RT mkrt, MK_BUF const buf)
initialize or free an MkBufferC reference-instance …
MK_BUF MkBufferCreateFLT_RT(MK_RT mkrt, MK_FLT const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreateTLS_RT(MK_RT mkrt, MK_STRN const tlsName, bool const resetB)
same as BufferCreate but require no cleanup
void MkBufferDelete_RT(MK_RT mkrt, MK_BUF const buf)
Destructor - delete a MkBufferC instance …
MK_BUF MkBufferCreateBIN_RT(MK_RT mkrt, MkBinaryR const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreate1024_RT(MK_RT mkrt, MK_NUM const size)
call the BufferCreate with default type MkBuffer1024S (1024 byte) …
MK_BUF MkBufferCreateBUF_RT(MK_RT mkrt, MK_BUFN const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
static MK_BFL MkBufferListNext(MK_BFL const bfl)
get next instance from linked-list of MkBufferListS type
static MK_BFL MkBufferListPrev(MK_BFL const bfl)
get previous instance from linked-list of MkBufferListS type
static MK_BFL MkBufferListInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkBufferListS type …
#define MkBufferListC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MkBufferListC_X2obj(x)
#define MkBufferStream1024_ils_size
1024 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBufferStream16384S_ils_size
16384 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBufferStream256S_ils_size
256 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBufferStream64_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
#define MkBufferStreamS_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
static MK_HDL MkBufferStreamHandleGet_RT(MK_RT mkrt, MK_BUS const bus)
Handle-Get-Slot - returns a export-hdl to the MkBufferStreamC useable for external storage
static MK_BUS MkBufferStreamNext(MK_BUS const bus)
get next instance from linked-list of MkBufferStreamS type
static MK_BUS MkBufferStreamGetNull(void)
Null-Slot - return a MkBufferStreamC typed NULL instance …
static MK_BUS MkBufferStreamInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkBufferStreamS type …
static MK_BUS MkBufferStreamPrev(MK_BUS const bus)
get previous instance from linked-list of MkBufferStreamS type
static MK_BUS MkBufferStreamHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkBufferStreamC from netHdl or MK_NULL if invalid…
static MK_BUS MkBus(MK_MNG mng)
cast a unknown-object into an MkBufferStreamS pointer or NULL if not possible
#define MkBufferStreamC_X2obj(x)
static MK_BUSN MkBusN(MK_MNGN mng)
(const) cast a unknown-object into an MkBufferStreamS pointer or NULL if not possible
static bool MkBusCheck(MK_MNGN mng)
check MkBufferStreamS -> MkObjectS::signature …
#define MkBufferStreamC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
static bool MkBusCheckO(MK_OBJN obj)
check MkBufferStreamS -> MkObjectS::signature …
MK_BFL MkBufferStreamToBFL_RT(MK_RT mkrt, MK_BUSN const bus)
convert the bus into a MkBufferListC …
MK_BUS MkBufferStreamCopy_RT(MK_RT mkrt, MK_BUS const bus, MK_BUSN const src)
copy the MkBufferStreamC from src to bus …
MK_BUS MkBufferStreamReset_RT(MK_RT mkrt, MK_BUS const bus)
reset a MkBufferStreamC to the length zero …
void MkBufferStreamLog_RT(MK_RT mkrt, MK_BUS const bus, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the MkBufferStreamC …
void MkBufferStreamPosToStart_RT(MK_RT mkrt, MK_BUS const bus)
set the current-access-position to the start of MkBufferStreamC …
void MkBufferStreamResetFull_RT(MK_RT mkrt, MK_BUS const bus)
reset a MkBufferStreamC to the length zero and free allocated storage…
void MkBufferStreamLogS_RT(MK_RT mkrt, MK_BUS const bus, MK_OBJ fmtobj, MK_STRN const callfunc)
MK_STRN MkBufferStreamToString_RT(MK_RT mkrt, MK_BUSN const inst)
String-Slot - returns the string representation of the inst …
enum MkErrorE MkBufferStreamReadI8_RT(MK_RT mkrt, MK_BUS const bus, MK_I8 *const val_out)
read a val_out from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadI64_RT(MK_RT mkrt, MK_BUS const bus, MK_I64 *const val_out)
read a val_out from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadBUF_RT(MK_RT mkrt, MK_BUS const bus, MK_BUF *const val_out)
read a val_out from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadI32_RT(MK_RT mkrt, MK_BUS const bus, MK_I32 *const val_out)
read a val_out from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadFLT_RT(MK_RT mkrt, MK_BUS const bus, MK_FLT *const val_out)
read a val_out from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadLONG_RT(MK_RT mkrt, MK_BUS const bus, MK_LONG *const val_out)
read the long native object from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadBFL_RT(MK_RT mkrt, MK_BUS const bus, MK_BFL *const val_out)
read a MkBufferListC from the MkBufferStreamC …
enum MkTypeE MkBufferStreamReadGetNextType_RT(MK_RT mkrt, MK_BUSN const bus)
get the type (MkTypeE) of the next Item in the MkBufferStreamC or "0" if not available
enum MkErrorE MkBufferStreamReadSTR_RT(MK_RT mkrt, MK_BUS const bus, MK_STRN *const val_out)
read a val_out from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadUndo_RT(MK_RT mkrt, MK_BUS const bus)
undo the last MkBufferStreamC READ function call …
bool MkBufferStreamReadItemExists_RT(MK_RT mkrt, MK_BUSN const bus)
check if an item exists in the read-data-package …
enum MkErrorE MkBufferStreamReadNEXT_RT(MK_RT mkrt, MK_BUS const bus, MK_NAT_OBJECT *const val_out)
enum MkErrorE MkBufferStreamReadL_START_RT(MK_RT mkrt, MK_BUS const bus, MK_BUF buf)
START read a list-item-type from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadBIN_RT(MK_RT mkrt, MK_BUS const bus, MkBinaryR *const val_out)
read a val_out from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadL_END_RT(MK_RT mkrt, MK_BUS const bus)
END read a list-item-type from the MkBufferStreamC …
MK_NUM MkBufferStreamReadGetNumItems_RT(MK_RT mkrt, MK_BUSN const bus)
get the number of items left in the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadDBL_RT(MK_RT mkrt, MK_BUS const bus, MK_DBL *const val_out)
read a val_out from the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadALL_RT(MK_RT mkrt, MK_BUS const bus, MK_BFL *const val_inout)
get a temporary MkBufferListC from all data in the MkBufferStreamC …
enum MkErrorE MkBufferStreamReadLIST_RT(MK_RT mkrt, MK_BUS const bus, MK_NAT_LIST *const val_out)
enum MkErrorE MkBufferStreamReadBOL_RT(MK_RT mkrt, MK_BUS const bus, MK_BOL *const val_out)
read a val_out from the MkBufferStreamC …
MK_BUS MkBufferStreamCreate1024_RT(MK_RT mkrt, MK_NUM const size)
call the BufferStreamCreate with default type MkBufferStream1024S (1024 byte) …
MK_BUS MkBufferStreamDup_RT(MK_RT mkrt, MK_BUSN const src)
Dup-Constructor - create a new MkBufferStreamC instance as copy from an existing MkBufferStreamC inst...
void MkBufferStreamDelete_RT(MK_RT mkrt, MK_BUS const bus)
Destructor - delete a MkBufferStreamC instance …
MK_BUS MkBufferStreamCreate64_RT(MK_RT mkrt, MK_NUM const size)
call the BufferStreamCreate with default type MkBufferStream64S (64 byte) …
MK_BUS MkBufferStreamCreate16384_RT(MK_RT mkrt, MK_NUM const size)
call the BufferStreamCreate with default type MkBufferStream16384S (16384 byte) …
MK_BUS MkBufferStreamMerge_RT(MK_RT mkrt, MK_BUS const bus)
Merge-Constructor - create a new MkBufferStreamC as a merge from an existing object …
void MkBufferStreamInit_RT(MK_RT mkrt, MK_BUS const bus, MK_TYP type, MK_NUM const size)
init and free a MkBufferStreamS reference
MK_BUS MkBufferStreamCreate_RT(MK_RT mkrt, MK_TYP type, MK_NUM const size)
create and initialize an MkBufferStreamC instance …
#define MkBufferStreamCreateSTATIC_T(cls, name)
Constructs a MkBufferStreamC instance as S)tatic S)torage …
MK_BUS MkBufferStreamCreateTLS_RT(MK_RT mkrt, MK_STRN const tlsName, bool const resetB)
same as BufferStreamCreate but require no cleanup …
void MkBufferStreamFree_RT(MK_RT mkrt, MK_BUS const bus)
init and free a MkBufferStreamS reference
#define MkBufferStreamCreateTLS_T(cls, name)
Constructs a MkBufferStreamC instance as T)hread L)ocal S)torage …
MK_BUS MkBufferStreamCreate256_RT(MK_RT mkrt, MK_NUM const size)
call the BufferStreamCreate with default type MkBufferStream256S (256 byte) …
#define MkBufferStreamCreateLOCAL_T(cls, name, size)
Constructs a MkBufferStreamC instance as L)ocal S)torage …
enum MkErrorE MkBufferStreamWriteL_FLAT_RT(MK_RT mkrt, MK_BUS const bus, MK_BFL const bfl)
write a MkBufferListC FLAT into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteBIN_RT(MK_RT mkrt, MK_BUS const bus, MkBinaryR const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteI32_RT(MK_RT mkrt, MK_BUS const bus, MK_I32 const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteDBL_RT(MK_RT mkrt, MK_BUS const bus, MK_DBL const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteL_END_RT(MK_RT mkrt, MK_BUS const bus)
END write a list-item-type into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteFLT_RT(MK_RT mkrt, MK_BUS const bus, MK_FLT const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteHDL_RT(MK_RT mkrt, MK_BUS const bus, MK_I32 const val)
write the handle into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteV_RT(MK_RT mkrt, MK_BUS const bus, MK_STRN const fmt,...)
write format-string into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteVL_RT(MK_RT mkrt, MK_BUS const bus, MK_STRN const fmt, va_list ap)
write format-string into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteBOL_RT(MK_RT mkrt, MK_BUS const bus, MK_BOL const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteL_START_RT(MK_RT mkrt, MK_BUS const bus)
START write a list-item-type into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteBFL_RT(MK_RT mkrt, MK_BUS const bus, MK_BFLN const bfl)
write a MkBufferListC into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteLONG_RT(MK_RT mkrt, MK_BUS const bus, MK_LONG const val)
write the long native object into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteSTR_RT(MK_RT mkrt, MK_BUS const bus, MK_STRN const val, MK_NUM const len)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteBUS_FLAT_RT(MK_RT mkrt, MK_BUS const bus, MK_BUSN const add)
write a MkBufferStreamC into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteI64_RT(MK_RT mkrt, MK_BUS const bus, MK_I64 const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteBUF_RT(MK_RT mkrt, MK_BUS const bus, MK_BUFN const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteI8_RT(MK_RT mkrt, MK_BUS const bus, MK_I8 const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
MK_OBJN(* MkErrorFormatOfF)(MK_ERREXT_ARGS_N, int const dummy)
void(* MkErrorPanikF)(MK_ERREXT_ARGS_N, MK_OBJN const errobj, MK_STRN const prefix, MK_I32 const errnum, MK_STRN const fmt, va_list ap)
MK_OBJN const errobj because of MK_ERROR_FORMAT value.
bool(* MkErrorSetVLF)(MK_ERREXT_ARGS, MK_OBJN const fmtobj, MK_STRN const)
void(* MkErrorLogF)(MK_ERREXT_ARGS_N, MK_OBJN const, MK_DBG const, MK_STRN const, MK_I32 const, MK_STRN const, MK_OBJ const)
#define MK_ERREXT_ARGS
bool(* MkErrorAppendFLT)(MK_ERREXT_ARGS, MK_OBJN const fmtobj)
void(* MkErrorResetF)(MK_ERREXT_ARGS, MK_OBJN const fmtobj)
bool(* MkErrorResetOnExitF)(MK_ERREXT_ARGS, MK_OBJN const fmtobj)
void(* MkErrorSetRF)(MK_ERREXT_ARGS, MK_MNGN const errctx, MK_OBJN const fmtobj)
void(* MkErrorSetEF)(MK_ERREXT_ARGS, MK_ERREXT const newerr, MK_OBJN const fmtobj)
void(* MkErrorInit)(MK_ERREXT_ARGS, MK_OBJN const fmtobj)
#define MK_ERREXT_ARGS_N
static MK_ERREXTN MkErrExtN(MK_MNGN mng)
(const) cast a unknown-object into an MkErrExtS pointer or NULL if not possible
static bool MkErrExtCheckO(MK_OBJN obj)
check MkErrExtS -> MkObjectS::signature …
static MK_ERREXT MkErrExt(MK_MNG mng)
cast a unknown-object into an MkErrExtS pointer or NULL if not possible
static bool MkErrExtCheck(MK_MNGN mng)
check MkErrExtS -> MkObjectS::signature …
static MK_ERR MkErrorNext(MK_ERR const err)
get next instance from linked-list of MkErrorS type
static MK_ERR MkErrorGetNull(void)
Null-Slot - return a MkErrorC typed NULL instance …
static MK_ERR MkErrorPrev(MK_ERR const err)
get previous instance from linked-list of MkErrorS type
static MK_ERR MkErrorHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkErrorC from netHdl or MK_NULL if invalid…
static MK_HDL MkErrorHandleGet_RT(MK_RT mkrt, MK_ERR const err)
Handle-Get-Slot - returns a export-hdl to the MkErrorC useable for external storage
static MK_ERR MkErrorInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkErrorS type …
#define MkErrorC_X2obj(x)
static MK_ERRN MkErrN(MK_MNGN mng)
(const) cast a unknown-object into an MkErrorS pointer or NULL if not possible
static bool MkErrCheck(MK_MNGN mng)
check MkErrorS -> MkObjectS::signature …
static MK_ERR MkErr(MK_MNG mng)
cast a unknown-object into an MkErrorS pointer or NULL if not possible
static bool MkErrCheckO(MK_OBJN obj)
check MkErrorS -> MkObjectS::signature …
#define MkErrorC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
MK_I32 MkErrorGetNum(MK_ERRN const err)
get the MkErrorS::num. The number can be used as exit-code …
#define MkErrorGetSizeI(e)
get the error-message-size from the exception-object …
#define MkErrorGetCodeI(e)
get the value of MkErrorS::code …
MK_STRN MkErrorGetText(MK_ERRN const err)
get the MkErrorS::text …
MK_SIZE MkErrorGetSize(MK_ERRN const err)
get the error-message-size from the exception-object …
#define MkErrorGetTextI(e)
get the MkErrorS::text …
#define MkErrorGetNumI(e)
get the MkErrorS::num. The number can be used as exit-code …
enum MkErrorE MkErrorGetCode(MK_ERRN const err)
get the value of MkErrorS::code …
void MkErrorStackFormat_RT(MK_RT mkrt, MK_ERR const err, MK_STRN callfunc, MK_STRN callfile, MK_I32 const callline)
append an ensemble of func, file and line to the error-message …
void MkErrorCleanup_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const callfunc, MK_I32 const callline)
cleanup and print unwanted active error …
void MkErrorPrintln_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const msg, MK_STRN const callfunc, MK_I32 const callline)
print the default-error to the MkLogFileC (default: stderr) and clear the error afterwards …
MK_STRN MkErrorToString_RT(MK_RT mkrt, MK_ERRN const inst)
String-Slot - returns the string representation of the inst …
enum MkErrorE MkErrorReset_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const callfunc, MK_I32 const callline, bool const force)
This function clears the err and resets to MK_OK …
void MkErrorLog_RT(MK_RT mkrt, MK_ERRN const err, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the error to MkLogFileC (default: stderr) …
MK_ERR MkErrorCatch_RT(MK_RT mkrt, MK_ERR const err, MK_EXP const exception, MK_STRN const callfunc)
convert a programming-language-error into an libmkkernel error …
enum MkErrorE MkErrorStack_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const callfunc, MK_STRN const callfile, MK_I32 const callline)
check on error and if yes append an ErrorStackFormat to the error-message …
enum MkErrorE MkErrorRaise_RT(MK_RT mkrt, MK_ERRN const err)
convert an libmkkernel error into an programming-language-error and raise afterwards....
MK_ERR MkErrorNoRaise_RT(MK_RT mkrt, MK_ERR const err)
ignore the next return of MK_ERROR and do not raise an target-language-exception …
void MkDisasterSignal(MK_I32 signal)
called if something get REALLY wrong …
void MkPanicC_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MK_I32 const errnum, MK_STRN const message)
do a panic with string as argument …
enum MkErrorE MkErrorSetVL_RT(MK_RT mkrt, MK_ERR err, MK_STRN const callfunc, MK_I32 const errnum, MK_FST const printfmt, va_list var_list)
'set' and 'raise' the MkErrorC using a vararg-list message …
enum MkErrorE MkErrorSetE_RT(MK_RT mkrt, MK_ERR const err, MK_ERR const newerr)
set the MkErrorC from a MkErrorC copy and raise an error …
#define MkErrorSetV_2M(err, printfmt,...)
enum MkErrorE MkErrorSetC_RT(MK_RT mkrt, MK_ERR err, MK_STRN const message, MK_STRN const callfunc, MK_I32 const errnum)
'set' and 'raise' the MkErrorC using a string-message and a errnum-number …
enum MkErrorE MkErrorSetV_RT(MK_RT mkrt, MK_ERR err, MK_STRN const callfunc, MK_I32 const errnum, MK_FST const printfmt,...)
set the MkErrorS object using a format string argument list and raise an error …
void MkErrorAppendC_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const message)
append the message to the MkErrorS::text …
void MkPanicV_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MK_I32 const errnum, MK_FST const printfmt,...)
do a panic with a vararg as argument …
void MkErrorAppendV_RT(MK_RT mkrt, MK_ERR const err, MK_FST const printfmt,...)
append a vararg string to the MkErrorC …
void MkErrorAppendVL_RT(MK_RT mkrt, MK_ERR const err, MK_FST const printfmt, va_list var_list)
append a va_list string to the MkErrorC …
void MkPanicVL_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MK_I32 const errnum, MK_FST const printfmt, va_list var_list)
do a panic with a vararg-list as argument …
enum MkErrorE MkErrorSetR_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const message, enum MkErrorE const errcode, MK_I32 const errnum, MK_MNG const errctx)
set the MkErrorC and raise the error …
void MkPanicDEFAULT_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc) MK_NO_RETURN
make panic from MkErrorDEFAULT_RT …
bool MkErrorIsSOCKET(MK_ERRN const err)
check on SOCKET-DOWN error …
bool MkErrorIsABORT(MK_ERRN const err)
check on ABORT signal …
enum MkErrorE MkErrorSetEXIT_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const callfunc)
finish the current callback, return to toplevel and MqExit the application …
enum MkErrorE MkErrorSetSOCKET_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const detail, MK_STRN const callfunc)
create SOCKET-DOWN error …
bool MkErrorIsEXIT(MK_ERR const err)
check on APPLICATION-EXIT error …
void MkErrorSetCONTINUE_RT(MK_RT mkrt, MK_ERR const err)
signal end of processing in an MqMqEventIF callback …
bool MkErrorIsTIMEOUT(MK_ERRN const err)
check on TIMEOUT error …
enum MkErrorE MkErrorSetABORT_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const detail, MK_STRN const callfunc)
send the ABORT signal to the calling stack…
void MkErrorSetCode_RT(MK_RT mkrt, MK_ERR const err, enum MkErrorE code)
set the MkErrorS::code value …
#define MkERROR
#define MK_ERROR_PRINT
#define MK_ERROR_DEFAULT
static MK_ERR MkErrorPANIC_RT(MK_RT mkrt)
panic-system-error - panic on next error …
#define MK_ERROR_EXIT
static MK_ERR MkErrorDEFAULT_RT(MK_RT mkrt)
default-system-error - default-error …
#define MkErrorFORMAT_1O(o)
#define MkERROR_RT
#define MK_ERROR_PANIC
static MK_ERR MkErrorPRINT_RT(MK_RT mkrt)
ignore-system-error - print the next error into MkLogFileC …
MK_ERR MkErrorFORMAT(MK_OBJN fmtobj)
system-error-format - format and return the default-error …
#define MK_ERROR_IGNORE
static MK_ERR MkErrorIGNORE_RT(MK_RT mkrt)
ignore-system-error - ignore the next error …
#define MK_ERROR_FORMAT
static MK_ERR MkErrorEXIT_RT(MK_RT mkrt)
panic-system-error - panic on next error …
MK_ERR MkErrorFORMAT_EO(MK_OBJN fmtobj)
same as (static,runtime) MK_ERR MkErrorDEFAULT() but do not set the MkERROR.format_of_error attribute...
void MkErrorDelete_RT(MK_RT mkrt, MK_ERR err)
Destructor - delete a MkErrorS object …
MK_ERR MkErrorDup_RT(MK_RT mkrt, MK_ERRN const srce)
Dup-Constructor - create a new MkErrorC instance as copy from an existing MkErrorC instance …
void MkErrorCopy_RT(MK_RT mkrt, MK_ERR dest, MK_ERRN const srce)
Copy-Constructor - sync an existing MkErrorC instance with the values from an existing MkErrorC insta...
MK_ERR MkExceptionCatch(MK_MNG const expobj, MK_EXP const exception, MK_STRN const callfunc)
convert an Target-Programming-Language (TPL) exception into an MkErrorC …
void MkExceptionRaise(MK_MNG const expobj, MK_STRN const callfunc, MK_I32 const callline)
convert an MkErrorC into a Target-Programming-Language (TPL) exception …
bool MkExceptionCheck(MK_EXP exception)
Checks if Exception is of type MkExceptionC and returns MK_YES or MK_NO …
#define MkExtension_size
maximum number of runtime-extensions useable in a theKernel software.
MK_EXT MkExtensionDel_RT(MK_RT mkrt, MK_EXT head, MK_EXT del)
this is an update to head, use: head = MkExtensionDel(head, del)
struct MkExtensionS MkExtensionS
Base class for the extension technologie …
bool MkExtensionDeleteAll_RT(MK_RT mkrt, MK_EXT head)
MK_EXT MkExtensionAdd_RT(MK_RT mkrt, MK_EXT head, MK_EXT add)
this is an update to head, use: head = MkExtensionAdd(head, add)
static bool MkExtCheck(MK_MNGN mng)
check MkExtensionS -> MkObjectS::signature …
static MK_EXT MkExt(MK_MNG mng)
cast a unknown-object into an MkExtensionS pointer or NULL if not possible
static MK_EXTN MkExtN(MK_MNGN mng)
(const) cast a unknown-object into an MkExtensionS pointer or NULL if not possible
static bool MkExtCheckO(MK_OBJN obj)
check MkExtensionS -> MkObjectS::signature …
static MK_SIZE MkBinaryGetSize(const MkBinaryR bin)
get size from the binary ...
static MK_BINN MkBinaryGetData(const MkBinaryR bin)
get data pointer from the binary ...
static MkBinaryR MkBinaryDup_RT(MK_RT mkrt, const MkBinaryR bin)
create a binary as duplicate from an already existsing MkBinaryR ...
static bool MkBinaryIsNull(const MkBinaryR bin)
check if binary is NULL ...
static void MkBinaryLog_RT(MK_RT mkrt, const MkBinaryR bin)
get size from the binary ...
static MkBinaryR MkBinaryCreate(MK_SIZE size, MK_BINN data)
create a binary from data and size ...
static const MkBinaryR MkBinaryCreateSlice(const MkBinaryR bin, MK_SIZE start, MK_SIZE wide)
create a binary slice ...
MK_PTR(* MkCacheCF)(MK_RT mkrt, MK_PTR const)
void(* MkCacheDF)(MK_RT mkrt, MK_PTR *const)
#define BEGIN_MK_C_DECLS
void * MK_MACRO_TYP
helper-type used to declare a prototype for a macro
#define MK_NULL_STR
the string "MK_NULL" value as MK_NULL_STR …
#define MK_PARSER_fmtobj
use param_fmtobj for documentation
#define MK_NO_RETURN
dosable "MK_NO_RETURN" because C# require "return" from "MqExit" for thread-pool support
static bool MK_NULL_STR_OR_EMPTY_CHECK_1(char const *const __str)
same as MK_NULL_STR_CHECK together with "" check but without len parameter
#define MK_DECL
#define mk_inline
static bool MK_NULL_STR_CHECK_1(char const *const __str)
same as MK_NULL_STR_CHECK but without len parameter
#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
static bool MK_NULL_STR_CHECK(char const *const __str, const long int __len)
check if __str is MK_NULL_STR return true or false …
#define MK_NULL
The Programming-Language-Micro-Kernel (PLMK) NULL value as MK_NULL in C …
#define MK_NULL_STR_LEN
the integer strlen("MK_NULL") value as MK_NULL_STR_LEN …
MK_STRN MkTimeoutE_ToString(enum MkTimeoutE value)
return the MkTimeoutE as string …
MkTimeoutE
Predefined Timeout values …
MkBoolE
the internal boolean …
#define MK_TYPE_IS_1_I8E
the type is native and has a size of 1 byte …
enum MkErrorE MkIdSE_FromInt(MK_I32 const value, enum MkIdSE *value_out)
return the MkIdSE from integer …
static MK_I32 MkTypeE_ToInt(enum MkTypeE value)
return the MkTypeE as integer …
enum MkErrorE MkNativeIsE_FromInt(MK_I32 const value, enum MkNativeIsE *value_out)
return the MkNativeIsE from integer …
#define MK_TYPE_IS_2_I8E
the type is native and has a size of 2 bytes …
static MK_I32 MkErrorE_ToInt(enum MkErrorE value)
return the MkErrorE as integer …
#define MK_TYPE_SHIFT
FIXED: type is only 8bit -> 4 bit=15 for type and 4 bit for flag …
MK_STRN MkNativeIsE_ToString(enum MkNativeIsE value)
return the MkNativeIsE as string …
static MK_I32 MkTimeoutE_ToInt(enum MkTimeoutE value)
return the MkTimeoutE as integer …
enum MkErrorE MkTypeE_FromInt(MK_I32 const value, enum MkTypeE *value_out)
return the MkTypeE from integer …
static MK_I32 MkBoolE_ToInt(enum MkBoolE value)
return the MkBoolE as integer …
MK_STRN MkBoolE_ToString(enum MkBoolE value)
return the MkBoolE as string …
#define MK_TYPE_IS_8_I8E
the type is native and has a size of 8 bytes …
MK_STRN MkIdSE_ToString(enum MkIdSE value)
return the MkIdSE as string …
static MK_I32 MkIdSE_ToInt(enum MkIdSE value)
return the MkIdSE as integer …
enum MkErrorE MkErrorE_FromInt(MK_I32 const value, enum MkErrorE *value_out)
return the MkErrorE from integer …
enum MkErrorE MkTimeoutE_FromInt(MK_I32 const value, enum MkTimeoutE *value_out)
return the MkTimeoutE from integer …
static MK_I32 MkNativeIsE_ToInt(enum MkNativeIsE value)
return the MkNativeIsE as integer …
#define MK_TYPE_IS_4_I8E
the type is native and has a size of 4 bytes …
MK_STRN MkTypeE_ToString(enum MkTypeE value)
return the MkTypeE as string …
MkErrorE
collection for the different error-codes …
MkNativeIsE
define if data is string or little or big endian …
enum MkErrorE MkBoolE_FromInt(MK_I32 const value, enum MkBoolE *value_out)
return the MkBoolE from integer …
MkTypeE
basic data-types supported by Programming-Language-Micro-Kernel (PLMK) …
MK_STRN MkErrorE_ToString(enum MkErrorE value)
return the MkErrorE as string …
@ MK_TIMEOUT_LONG
long timeout in sec (180 sec) …
@ MK_TIMEOUT_VERYSHORT
very short timeout in sec (5 sec) …
@ MK_TIMEOUT_INIT
maximum timeout in sec (900 sec) …
@ MK_TIMEOUT_MAX
request the maximum possible (infinite) timeout value …
@ MK_TIMEOUT_NORMAL
normal timeout in sec (90 sec) …
@ MK_TIMEOUT_USER
request the user defined timeout value from the –timeout configuration value …
@ MK_TIMEOUT_SOCKET
shorter timeout in sec (10 sec) … This TIMEOUT is used for socket connection with 'connect'
@ MK_TIMEOUT_SHORT
short timeout in sec (20 sec) …
@ MK_TIMEOUT_DEFAULT
request the default timeout value …
@ MK_YES
boolean YES
@ MK_NO
boolean NO
@ MK_ERROR
(persistent) raise an error-event, the calling-fucntion is interrupted.
@ MK_CONTINUE
(transient) raise an continue-event, the calling-function must handle this.
@ MK_OK
(persistent) everything is OK.
@ MK_NATIVE_IS_INITIAL
0 = initial value
@ MK_NATIVE_IS_STRING
S = using of the string protocol.
@ MK_NATIVE_IS_LITTLE
L = using if the binary protocoll, data in little-edian.
@ MK_NATIVE_IS_BIG
B = using if the binary protocoll, data in big-endian.
@ MK_I8T
Y: 1 byte 'byte' type.
@ MK_I64T
W: 8 byte 'long long int' type.
@ MK_FLTT
F: 4 byte 'float' type.
@ MK_BINT
B: X byte 'byte-array' type.
@ MK_I16T
S: 2 byte 'short' type.
@ MK_BOLT
O: 1 byte 'boolean' type.
@ MK_DBLT
D: 8 byte 'double' type.
@ MK_I32T
I: 4 byte 'int' type.
@ MK_STRT
C: X byte 'string' type (e.g. with a \0 at the end)
@ MK_LSTT
L: X byte 'list' type.
MK_BFL MkKernelGetTypeList_RT(MK_RT mkrt)
return a list of all types defind in the Programming-Language-Micro-Kernel (PLMK) …
#define __parser__global__(...)
parser: apply an attribute to a dunction in global scope …
#define __parser__pop__
parser: stop apply a list of local attributes to a block of code …
#define __parser__push__(...)
parser: start apply a list of local attributes to a block of code …
#define __parser__(...)
parser: apply an attribute to an object in local scope …
void MkSetup(void)
setup libmkkernel internal memory …
bool MkHasFork(void)
void MkCleanup(void)
cleanup libmkkernel internal memory …
bool MkHasThread(void)
bool MkCleanupActive
signal that code was triggert by MkCleanup
static void MkStringSplit(MkStringR strR, MK_NUM *len_out, MK_STRN *str_out)
split a str into ptr and len …
enum MkErrorE MkString2U16_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_U16 *val_out)
enum MkErrorE MkString2BOOL_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_BOOL *val_out)
static MK_STRN MkStringGetData(MkStringR const str)
get ptr pointer from the string ...
enum MkErrorE MkString2I8_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_I8 *val_out)
enum MkErrorE MkString2I16_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_I16 *val_out)
enum MkErrorE MkString2ATO_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, enum MkTypeE type, MK_ATO *val_out)
enum MkErrorE MkString2I64_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_I64 *val_out)
enum MkErrorE MkString2LONG_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_LONG *val_out)
enum MkErrorE MkString2FLT_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_FLT *val_out)
static MkStringR MkStringSlice(MkStringR strR, MK_NUM start, MK_NUM len)
create a slice of strR start at start with max len bytes …
enum MkErrorE MkString2HDL_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_HDL *val_out)
static MkStringR MkStringCreate_1(MK_STRN str)
create a str from ptr use MK_NULL as end-of-string ...
static MkStringR MkStringDup_RT(MK_RT mkrt, MkStringR const str)
create a string as duplicate from an already existsing MkBinaryR ...
enum MkErrorE MkString2U32_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_U32 *val_out)
static MkStringR MkStringCreate(MK_NUM len, MK_STRN str)
create a str from ptr and len ...
enum MkErrorE MkString2DBL_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_DBL *val_out)
enum MkErrorE MkString2I32_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_I32 *val_out)
static void MkStringLog_RT(MK_RT mkrt, MkStringR const str, MK_STRN func)
log the string ...
static MK_NUM MkStringGetSize(MkStringR const str)
get len from the string ...
static bool MkStringIsNULL(MkStringR const strR)
check if strR is MK_NULL_STR return true or false …
enum MkErrorE MkString2BOL_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_BOL *val_out)
convert a string into a native
const MK_PTRB * MK_MNGN
const - a managed object pointer, datatype will be checked at runtime
int32_t MK_NUM
array size data-type ('num' items in array …
float MK_FLT
4 byte float data-type
MK_PTRB * MK_PTR
generic pointer data-type
const MK_STRB * MK_STRN
constant string pointer data-type
MK_LSTB * MK_LST
list pointer data-type
MK_PTRB * MK_MNG
managed object pointer, datatype will be checked at runtime
MK_PTRB const * MK_EXP
exception object pointer
void * MK_NAT_OBJECT
const MK_PTRB * MK_PTRN
const generic pointer data-type
unsigned int MK_SIG
signature datatype
MK_STRB const * MK_FST
const format string pointer data-type
char MK_STRB
string type data-type
unsigned long long MK_U64
MK_PTRB * MK_CBP
generic pointer to call-back data
MK_UNUSED static const MK_STRN_A MK_STRN_A_NULL
MK_BINB * MK_BIN
byte-array pointer data-type with binary encoding (MK_BINN)
signed char MK_I8
1 byte byte data-type
MK_PTRB * MK_MXP
MkExceptionC object pointer.
unsigned char MK_BINB
byte-array type data-type
unsigned char MK_LSTB
list type data-type
signed long long MK_I64
8 byte wide integer data-type
bool MK_BOOL
real bool data-type
unsigned long MK_ULN
MK_STRB * MK_STR
string pointer data-type with UTF8 ecoding (MK_STR)
void * MK_NAT_LIST
unsigned char MK_BOL
1 byte boolean data-type
void MK_PTRB
pointer type data-type
unsigned int MK_U32
long MK_SIZE
MK_PTRB * MK_CCP
class constructor/destructor data type
void(* MkMarkF)(MK_RT mkrt, MK_PTR data)
prototype for a Garbage-Collection mark function …
unsigned char MK_U8
long MK_LONG
4/8 byte long data-type
unsigned short MK_U16
signed short int MK_I16
2 byte short data-type
double MK_DBL
8 byte double data-type
time_t MK_TIME_T
int32_t MK_HDL
4 byte int handle data-type
MK_BINB const * MK_BINN
const byte-array pointer data-type
signed int MK_I32
4 byte integer data-type
int MK_DBG
debug-level data-type …
struct MkLogDataS MkLogDataS
struct to hold the mkrt-logging-data …
static MK_HDL MkLogFileHandleGet_RT(MK_RT mkrt, MK_LFL const lfl)
Handle-Get-Slot - returns a export-hdl to the MkLogFileC useable for external storage
static MK_LFL MkLogFilePrev(MK_LFL const lfl)
get previous instance from linked-list of MkLogFileS type
static MK_LFL MkLogFileInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkLogFileS type …
static MK_LFL MkLogFileHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkLogFileC from netHdl or MK_NULL if invalid…
static MK_LFL MkLogFileNext(MK_LFL const lfl)
get next instance from linked-list of MkLogFileS type
static MK_LFL MkLogFileGetNull(void)
Null-Slot - return a MkLogFileC typed NULL instance …
#define MkLogFileC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MkLogFileC_X2obj(x)
static MK_LFLN MkLflN(MK_MNGN mng)
(const) cast a unknown-object into an MkLogFileS pointer or NULL if not possible
static bool MkLflCheckO(MK_OBJN obj)
check MkLogFileS -> MkObjectS::signature …
static MK_LFL MkLfl(MK_MNG mng)
cast a unknown-object into an MkLogFileS pointer or NULL if not possible
static bool MkLflCheck(MK_MNGN mng)
check MkLogFileS -> MkObjectS::signature …
void MkLogFileClose_RT(MK_RT mkrt, MK_LFL lfh)
Destructor - delete a MkLogFileC instance …
enum MkErrorE MkLogFileOpen_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const file, MK_LFL *lfh_out)
open the log-file in append mode …
enum MkErrorE MkLogFileWriteVL_RT(MK_RT mkrt, MK_LFLN lfl, MK_FST printfmt, va_list var_list)
write to log-file …
enum MkErrorE MkLogFileGetFile_RT(MK_RT mkrt, MK_LFLN lfl, MK_STRN *file_out)
get the log-file …
enum MkErrorE MkLogFileWriteV_RT(MK_RT mkrt, MK_LFLN lfl, MK_FST printfmt,...)
write to log-file …
enum MkErrorE MkLogFileWriteC_RT(MK_RT mkrt, MK_LFLN lfl, MK_STRN text)
write to log-file …
void(* MkTypeInitF)(MK_RT mkrt, MK_TYP const type)
MK_OBJ(* MkDup2F)(MK_RT mkrt, MK_OBJN const obj, MK_STRN const ident)
void(* MkSelfDeleteF)(MK_RT mkrt, MK_PTR self, MK_PTR const env)
MK_OBJ(* MkResetF)(MK_RT mkrt, MK_OBJ const obj)
void(* MkSelfUnlinkF)(MK_RT mkrt, MK_PTR self, MK_PTR const env)
MK_OBJ(* MkCopyF)(MK_RT mkrt, MK_OBJ const obj, MK_OBJN const src)
MK_PTR(* MkAllocCreateFLT)(MK_RT mkrt, MK_TYP const type)
void(* MkAllocDeleteF)(MK_RT mkrt, MK_TYP const type, MK_PTR ptr)
#define __MkCheckX(cls, x)
MK_OBJ(* MkDupF)(MK_RT mkrt, MK_OBJN const obj)
MK_STRN(* MkToStringF)(MK_RT mkrt, MK_OBJN const obj)
MK_OBJ(* MkMergeF)(MK_RT mkrt, MK_OBJ const obj)
void(* MkDestructorF)(MK_RT mkrt, MK_OBJ const obj)
MK_OBJ(* MkConstructorF)(MK_RT mkrt, MK_TYP type, MK_PTR nat, MK_PTR lnk)
void(* MkLogF)(MK_RT mkrt, MK_OBJN const obj, MK_OBJN fmt, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
bool(* MkLogFormatF)(MK_RT mkrt, char *header, MK_SIZE const headerSize, MK_OBJN const obj, MK_STRN const caller, MK_I32 const debug, MK_STRN const fmt)
#define MkSanitizeCheck(_root, _m)
#define MkDbgDeepWriter(...)
MK_PTR(* MkSelfCreateF)(MK_RT mkrt, MK_OBJ const obj, MK_PTR const env)
#define MkSanitizeCheckO(_root, _o)
MK_OBJ MkObjectHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkObjectC from netHdl or MK_NULL if invalid…
void MkObjectHandleDeleteByNetHdl_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Delete-Slot - delete a netHdl from handle-storage …
#define MkObjectHandleResolve(...)
#define MkObjectHandleGet(...)
static MK_HDL MkObjectHandleGetOfType(MK_OBJ const obj)
Export-Slot - returns typeHdl of the obj .
static MK_OBJ MkObjectGetNull(void)
Null-Slot - return a MkObjectC typed NULL instance …
static MK_OBJ MkObjectPrev(MK_OBJ const obj)
get previous instance from linked-list of MkObjectS type
static MK_OBJ MkObjectNext(MK_OBJ const obj)
get next instance from linked-list of MkObjectS type
static MK_OBJ MkObjectInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkObjectS type …
void MkObjectHandleDelete_RT(MK_RT mkrt, MK_OBJ const netObj)
Handle-Delete-Slot - delete a netObj from handle-storage …
struct MkObjectS * MK_OBJ
class-shortcut for struct MkObjectS *, all shortcut using the XX_YYY syntax (only for public API) …
MK_HDL MkObjectHandleGet_RT(MK_RT mkrt, MK_OBJ const obj)
Handle-Get-Slot - returns a export-hdl to the MkObjectC useable for external storage
MK_HDL MkObjectHandleGetOr0(MK_OBJ const obj)
return export-hdl or 0 in not created…
bool MkObjectHandleExists(MK_OBJ const obj)
check if obj has already a handle defined…
static MK_OBJN MkObjN(MK_MNGN mng)
(const) cast a unknown-object into an MkObjectS pointer or NULL if not possible
static bool MkObjCheckO(MK_OBJN obj)
check MkObjectS -> MkObjectS::signature …
#define MkObjectC_X2obj(x)
#define MkOBJ(x)
cast a known-object into an MkObjectS pointer
#define MkObjectC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
static bool MkObjCheck(MK_MNGN mng)
check MkObjectS -> MkObjectS::signature …
static MK_OBJ MkObj(MK_MNG mng)
cast a unknown-object into an MkObjectS pointer or NULL if not possible
void MkDbgLogC_RT(MK_RT mkrt, MK_OBJN const obj, MK_STRN const callfunc)
debug: write a short-obj-summary to MkLogFileC (default: stderr) …
void MkDbgM_RT(MK_RT mkrt, MK_STRN const message, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
debug: write a static-marker to the MkLogFileC (default: stderr) …
enum MkErrorE MkDbgDump_RT(MK_RT mkrt, MK_OBJN const obj, MK_STRN const message, MK_STRN const callfunc)
debug: Dump a instance to stderr with LNG and MQ internal data…
void MkDbgL_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const message, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
debug: write a instance-marker to the MkLogFileC (default: stderr) using the fmtobj as prefix …
void MkDbgSTACK_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_I32 const skip, MK_I32 const num, MK_STRN const callfunc)
debug: write the stack-trace to MkLogFileC (default: stderr) …
void MkDbgO_RT(MK_RT mkrt, MK_OBJN const obj, MK_STRN const callfunc)
debug: write the object-details to MkLogFileC (default: stderr) …
void MkDbgV_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, FILE *FH, MK_FST const printfmt,...)
write a printf style debug-message to FH using the internal format …
#define MkDCheck(_debug)
void MkLogHEX_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MkBinaryR const data)
log binaray data as HEX into the MkLogFileC (default: stderr) …
void MkLogV_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MK_DBG debug, MK_FST const printfmt,...)
write a printf style logging-message to MkLogFileC (default: stderr) using the internal format …
#define MkObjectLog(...)
void MkObjectLog_RT(MK_RT mkrt, MK_OBJN const obj, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
Log-Slot - log a summary of an object to the MkLogFileC (default: stderr) target …
void MkObjectLogType_RT(MK_RT mkrt, MK_OBJN const obj, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the tyoe of the MkObjectS into the MkLogFileC (default: stderr) …
void MkObjectLogShort_RT(MK_RT mkrt, MK_OBJN const obj, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the MkObjectS into the MkLogFileC (default: stderr) …
void MkLogC_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const message, MK_DBG const debug, MK_STRN const callfunc)
write a logging-message to MkLogFileC (default: stderr) using the internal format …
#define MkLogC(...)
#define MkLogV(...)
void MkLogVL_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MK_DBG debug, MK_FST const printfmt, va_list var_list)
write a vprintf style logging-message to MkLogFileC using the internal format …
void MkObjectLogLong_RT(MK_RT mkrt, MK_OBJN const obj, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the MkObjectS verbose into the MkLogFileC (default: stderr) …
MK_STRN MkObjectToString_RT(MK_RT mkrt, MK_OBJN const inst)
String-Slot - returns the string representation of the inst …
static MK_ERR MkObjectToError_RT(MK_RT mkrt, MK_OBJ const obj)
Error-Slot - return an error-object pre initialized with obj data.
MK_ERR MkObjectErrorCatch_RT(MK_RT mkrt, MK_OBJN const obj, MK_EXP const exception, MK_STRN const callfunc)
convert a programming-language-error into an libmkkernel error …
static bool MkObjectIsNull(MK_OBJ const obj)
ckeck if the object is MK_NULL
MK_STRN MkObjectToNameOfType_RT(MK_RT mkrt, MK_OBJN const obj)
Type-Slot - returns the LibMkKernel-Type-Name of the obj as a string
MK_STRN const MkObjectToName_RT(MK_RT mkrt, MK_OBJN const obj)
Info-Slot - returns brief information about the obj as a string
#define MkObjectToString(...)
MK_STRN MkObjectToNameOfClass_RT(MK_RT mkrt, MK_OBJ const obj)
Class-Slot - returns the C-Class-Name of the obj as string
MK_NUM MkRefCidN_RT(MK_RT mkrt)
return the reference-count-recursion-level
MK_OBJ MkObjCopy_RT(MK_RT mkrt, MK_OBJ const tgtmng, MK_OBJN const srcmng)
call the copy from the object
bool MkSelfDeleteForce_RT(MK_RT mkrt, MK_OBJ obj)
force delete an instance, last step in instance-destructor
void(* MkSelfIncrF)(MK_RT mkrt, MK_PTR self, MK_PTR const env)
#define MkSelfCreate(...)
static MK_ATTR_HOT enum MkErrorE MkSelfNew_RT(MK_RT mkrt, MK_OBJ obj, MK_PTR *self_out, MK_PTR const env)
return the self pointer for a given obj …
static void MkSelfSet(MK_OBJ const obj, MK_PTR const self, MK_PTR const env)
set the MkObjectS::self value
MK_OBJ MkRefDecrWithoutSelf_RT(MK_RT mkrt, MK_OBJ const obj)
ATOMIC operation -> unlink self with reference-count.
static bool MkSelfExists(MK_OBJN obj)
Check if the MkObjectS::self exists …
static void MkRefIncr(MK_OBJ obj)
increment the reference-count
#define MkRefLOCK
unchangeable reference
static MK_I32 MkRefLock(MK_OBJ const obj)
lock the object
void MkRefDecr_RT(MK_RT mkrt, MK_OBJ obj)
decrement the reference-count
void MkSelfUnlink_RT(MK_RT mkrt, MK_OBJ obj)
Run the MkTypeS::selfUnlink slot from the instance...
MK_OBJ MkObjReset_RT(MK_RT mkrt, MK_OBJ const obj)
free the internal memory of an object and initialize the local variables to default values
MK_PTR MkSelfCreate_RT(MK_RT mkrt, MK_OBJ const obj, MK_PTR const env)
create the MkObjectS::self value
static bool MkRefIsLocked(MK_OBJ const obj)
check if object is locked
void(* MkSelfDecrF)(MK_RT mkrt, MK_PTR self, MK_PTR const env)
static MK_PTR MkSelfGet(MK_OBJ const obj)
get the MkObjectS::self value
MK_OBJ MkRefDecrWithUnlinkSelf_RT(MK_RT mkrt, MK_OBJ const obj)
ATOMIC operation -> unlink self from META und decr-ref-count in META.
bool MkSelfDelete_RT(MK_RT mkrt, MK_OBJ const obj)
delete the MkObjectS::self value
static MK_I32 MkRefGet(MK_OBJ const obj)
get the reference-count
static void MkRefIncrSelf(MK_OBJ const obj, MK_PTR const self, MK_PTR const env)
ATOMIC operation -> link self with reference-count.
MK_PTR(* MkSysCallocF)(size_t, size_t)
calloc syscall …
MkIdSE
signal type of the MkIdS data val …
void MkSysPrintStackTrace_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl, MK_I32 skip, MK_I32 const num)
backtrace syscall with libmkkernel error plugin
#define MkSysPrintStackTrace_2(fmtobj, debug)
#define MkSysStringIsLenEQUAL(_str, _other, _len)
static enum MkErrorE MkSysWaitForProcess(MK_OBJN fmtobj, MK_IDNT const id)
wait for process to finish syscall with libmkkernel error plugin
MkSysPipeHandlerE
MK_STR(* MkSysStrNCpyF)(char *, const char *, size_t)
strdup strncpy …
static enum MkErrorE MkSysUSleep(MK_OBJN fmtobj, useconds_t const usec)
usleep syscall with libmkkernel error plugin
MK_STR MkSysStrNDup(MK_OBJN fmtobj, MK_STRN const str, MK_SIZE const len)
strndup syscall with libmkkernel error plugin
MK_PTR(* MkSysMallocF)(size_t)
malloc syscall …
void MkSysPrintProcessMemoryMap_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl)
write the memory-map to MkLogFileC used at MkDisasterSignal …
enum MkErrorE MkSysKill(MK_OBJN fmtobj, MK_I32 pid, MK_I32 signal)
kill syscall with libmkkernel error plugin
void MkSysPipeHandler(MkSysPipeHandlerE keepPipe)
internal support for pipe ignore
MK_PTR MkSysRealloc(MK_OBJN fmtobj, MK_PTR const buf, size_t const size)
realloc syscall with libmkkernel error plugin
enum MkErrorE MkSysGetPid(MK_OBJN fmtobj, MK_I32 *pid_out)
getpid syscall with libmkkernel error plugin
MK_PTR MkSysCalloc(MK_OBJN fmtobj, size_t const nmemb, size_t const size)
calloc syscall with libmkkernel error plugin
enum MkErrorE MkSysStrNCpy(MK_OBJN fmtobj, MK_STR const to, MK_STRN const from, MK_SIZE const len)
strncpy syscall with libmkkernel error plugin
pid_t(* MkSysForkF)(void)
fork syscall …
#define MkSysFree(pointer)
static enum MkErrorE MkSysWaitForThread(MK_OBJN fmtobj, MK_IDNT const id)
wait for thread to finish syscall with libmkkernel error plugin
MK_STRN MkSysHashSTR(MK_STRN key, MK_NUM length)
compute the HASH from a string …
static bool MkSysStringIsNotNULL(MK_STRN str)
test if string is NOT NULL or EMPTY …
#define MkSysStringSetNULL_R(_str)
MK_STR MkSysBasename_RT(MK_RT mkrt, MK_STRN const pathName, bool const includeExtension)
basename syscall with libmkkernel error plugin
void MkSysFreeP(MK_PTR data)
free syscall with libmkkernel error plugin
enum MkErrorE(* MkSysWaitF)(MK_OBJN const fmtobj, MK_IDNT const id)
wait for process to finish syscall with libmkkernel error plugin
MK_PTR MkSysMemDup(MK_OBJN fmtobj, MK_PTRN const blck, size_t const size)
memdup syscall with libmkkernel error plugin
MK_PTR MkSysReCalloc(MK_OBJN fmtobj, MK_PTR const buf, MK_NUM const oldnum, MK_NUM const addnum, size_t const size)
realloc syscall with libmkkernel error plugin
#define MkSysStringIsNULL_R(_str)
#define MkSysStringSet_R(_str, _val)
enum MkErrorE MkSysGetTimeOfDay(MK_OBJN fmtobj, struct mk_timeval *tv_out, struct mk_timezone *tz_out)
gettimeofday syscall with libmkkernel error plugin
#define MkSysStringIsEQUAL(_str, _other)
MK_PTR MkSysMalloc(MK_OBJN fmtobj, size_t const size)
malloc syscall with libmkkernel error plugin
static int MkSysExit_RT(MK_RT mkrt, int isThread, int num)
exit syscall with libmkkernel error plugin
MK_STR(* MkSysStrNDupF)(MK_STRN, size_t)
strndup syscall …
MK_STRN_A MkSysStringArrayDup(MK_OBJN fmtobj, MK_STRN_A const strA)
strdup syscall with libmkkernel error plugin
struct MkLalS MkLal
Language Abstraction Layer in duty.
#define MkSysFreeNonNull(pointer)
MK_STR MkSysPrintF_RT(MK_RT mkrt, MK_STRN const format,...)
sprintf syscall with libmkkernel error plugin
MK_STR(* MkSysStrDupF)(MK_STRN)
strdup syscall …
void(* MkSysFreeF)(MK_PTR)
free syscall …
MK_STRN MkSysGetTrace_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl, MK_I32 skip, MK_I32 const num)
same as MkSysPrintStackTrace but return a string…
static MK_STRN MkSysStringGetNoNULL(MK_STRN str)
get string "" or VALUE …
MK_PTR(* MkSysReallocF)(MK_PTR, size_t)
realloc syscall …
static MK_STRN MkSysStringGet(MK_STRN str)
get string NULL or VALUE …
MK_STR MkSysStrDup(MK_OBJN fmtobj, MK_STRN const str)
strdup syscall with libmkkernel error plugin
uintptr_t MK_IDNT
process or thread identifier …
static enum MkErrorE MkSysSleep(MK_OBJN fmtobj, MK_I32 const sec)
sleep syscall with libmkkernel error plugin
MK_STR MkSysDirname_RT(MK_RT mkrt, MK_STRN const pathName)
dirname syscall with libmkkernel error plugin
int(* MkSysExitF)(MK_RT mkrt, int isThread, int num)
static bool MkSysStringIsNULL(MK_STRN str)
test if string is NULL or EMPTY …
MK_I32 MkSysHashI32(MK_STRN key, MK_NUM length)
same as MkSysHashSTR but return MK_I32 …
@ MK_ID_THREAD
val has a thread handle
@ MK_ID_PROCESS
val has a process handle
@ MK_ID_UNUSED
empty struct
@ MK_PIPE_KEEP
@ MK_PIPE_IGNORE
enum MkErrorE MkObjectDeleteCallbackSetup_RT(MK_RT mkrt, MK_STRN ident, MkObjectDeleteCallF fCall, MK_CBP callback, MkObjectDeleteFreeF fFree, MK_STRN filter)
Create/Delete the instance-delete-callback …
void MkObjectDeleteCallbackCleanup_RT(MK_RT mkrt, MK_STRN ident)
cleanup the DeleteCallback installed with MkObjectDeleteCallbackSetup …
void(* MkObjectDeleteFreeF)(MkObjectDeleteFreeF_ARGS)
void MkObjectDispose_RT(MK_RT mkrt, MK_OBJ obj)
Dispose-Slot - untie the connection between the Native-C-Instance and the libmkkernel-Instance.
MK_OBJ MkObjMerge_RT(MK_RT mkrt, MK_OBJ const obj)
Constructor - create a new object as a merge from an existing object
#define MkObjectDeleteCallF_ARGS
the MkObjectDeleteCallF arguments with default names
MK_OBJ MkObjCreate_RT(MK_RT mkrt, MK_TYP type, MK_PTR nat, MK_PTR lnk)
call the Constructor from the object
MK_OBJ MkObjDup2_RT(MK_RT mkrt, MK_OBJ const srcmng, MK_STRN const ident)
call the Dup2-Constructor from the object
#define MkObjectDeleteFreeF_ARGS
the MkObjectDeleteFreeF arguments with default names
void MkObjectDelete_RT(MK_RT mkrt, MK_OBJ obj)
Delete-Slot - delete an instance.
MK_OBJ MkObjDup_RT(MK_RT mkrt, MK_OBJ const srcobj)
call the Dup-Constructor from the object
enum MkErrorE(* MkObjectDeleteCallF)(MK_RT mkrt, MK_OBJN const obj, MK_STRN const typeName, MK_HDL const typeHdl, MK_HDL const objHdl, MK_CBP const __data__)
static callback to delete an obj …
static bool MkRtExtCheckO(MK_OBJN obj)
check MkRtExtS -> MkObjectS::signature …
static MK_RTEXTN MkRtExtN(MK_MNGN mng)
(const) cast a unknown-object into an MkRtExtS pointer or NULL if not possible
static bool MkRtExtCheck(MK_MNGN mng)
check MkRtExtS -> MkObjectS::signature …
static MK_RTEXT MkRtExt(MK_MNG mng)
cast a unknown-object into an MkRtExtS pointer or NULL if not possible
struct MkThreadDataS MkThreadDataS
bool MkRuntimeSysPipeHandlerUse
block SIGPIPE ignore handlern default=MK_YES, Java require this
static MK_HDL MkRuntimeHandleGet_RT(MK_RT mkrt, MK_RT const rt)
Handle-Get-Slot - returns a export-hdl to the MkRuntimeC useable for external storage
static MK_RT MkRuntimePrev(MK_RT const rt)
get previous instance from linked-list of MkRuntimeS type
static MK_RT MkRuntimeNext(MK_RT const rt)
get next instance from linked-list of MkRuntimeS type
#define MkRuntimeHandleResolve(...)
#define MkRuntimeHandleGet(...)
static MK_RT MkRuntimeGetNull(void)
Null-Slot - return a MkRuntimeC typed NULL instance …
static MK_RT MkRuntimeHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkRuntimeC from netHdl or MK_NULL if invalid…
#define MkRuntimeInstances()
static MK_RT MkRuntimeInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkRuntimeS type …
#define MkRuntimeC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
static MK_RTN MkRtN(MK_MNGN mng)
(const) cast a unknown-object into an MkRuntimeS pointer or NULL if not possible
#define MkRuntimeC_X2obj(x)
static MK_RT MkRt(MK_MNG mng)
cast a unknown-object into an MkRuntimeS pointer or NULL if not possible
static bool MkRtCheckO(MK_OBJN obj)
check MkRuntimeS -> MkObjectS::signature …
static bool MkRtCheck(MK_MNGN mng)
check MkRuntimeS -> MkObjectS::signature …
void MkRuntimeLogTargetPop_RT(MK_RT mkrt, MkLogDataS logOld)
static void MkRuntimeDebugSet(MK_I32 dbg)
set the MkRuntimeS::debug value …
enum MkErrorE MkRuntimeLogTargetSet_RT(MK_RT mkrt, MK_STRN logTgt)
set the MkRuntimeS::log value and cleanup old value …
static enum MkErrorE MkRuntimeErrorGetCode_RT(MK_RT mkrt)
return MkErrorS::code from a given MkRuntimeC …
static bool MkRuntimeIsSilentGet(void)
get the MkRuntimeS::isSilent value …
static void MkRuntimeIsSilentSet_RT(MK_RT mkrt, bool silent)
set the MkRuntimeS::isSilent value …
void MkRuntimeSetCID(MK_OBJ const cid)
CID == context-in-duty.
static MK_I32 MkRuntimeDebugGet(void)
get the MkRuntimeS::debug value …
MkLogDataS MkRuntimeLogTargetPush_RT(MK_RT mkrt, MK_STRN logTgt)
#define MkRuntimeLogBufferPush()
static void MkRuntimeNoDecoSet_RT(MK_RT mkrt, bool noDeco)
static MK_STRN MkRuntimeLogTargetGet(void)
get the MkLogDataS::logNAME value …
enum MkErrorE MkRuntimeLogTargetReset_RT(MK_RT mkrt)
set the MkRuntimeS::log value to the DEFAULT value …
#define MkRuntimeLogBufferPop()
void MkRuntimeLog0_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the MkRuntimeC …
#define MkRT
void MkRuntimeCleanup(MK_RT mkrt)
cleanup MkRuntimeRLS …
#define MkRtSetup_ON_RT(o)
#define MK_ATTR_STATIC
size_t MkRuntimeCallbackAdd(MK_RT mkrt, MkRuntimeCallbackS *cbdata, MkRuntimeInitF rt_callback, MK_STRN ident)
add a callback to the runtime …
static MK_RT MkRuntimeGetFromObj(MK_OBJ obj)
return the initialized MkRuntimeRLS from an obj …
#define MK_ATTR_RT_INSTANCE
#define MK_ATTR_INSTANCE
struct MkRuntimeCallbackS MkRuntimeCallbackS
keep callback related data …
__thread struct MkRuntimeS MkRuntimeRLS
RLS …
#define MkThreadLocal
#define MK_RT_ATTR_FORMAT_4
MK_RT MkRuntimeSetup(MK_RT const mkrt)
initialize MkRuntimeRLS …
#define MK_INSTANCE_RT_O(o)
#define MK_PARSER_RT
void MkRuntimeCallbackDel(MK_RT mkrt, MkRuntimeCallbackS *cbdata)
delete a callback from the runtime …
#define MK_RT_ATTR_FORMAT_1
#define MK_RT_ATTR_FORMAT_2
#define MK_RT_CALL
#define MK_PARSER_RT_ONLY
#define MK_ATTR_RT_STATIC
void(* MkRuntimeInitF)(MK_RT mkrt)
additional runtime initialization function …
static MK_RT MkRuntimeGet(void)
return a initialized MkRuntimeRLS …
#define MK_RT_ARGS
#define MK_STATIC_RT
#define MK_RT_ARGS_ONLY
#define MK_INSTANCE_HDL(x)
#define MK_RT_REF
#define MkRT_O(o)
MK_PTR MkTypeSlotResolveP(MK_RT mkrt, MK_TYPN const type, size_t const offset, bool const force)
hidden function for MkTypeSlotResolve
static MK_TYP MkTyp(const MK_MNG mng)
type-check and cast a unknown-managed-object into an MkTypeS pointer or MK_NULL if not possible
static MK_TYPN MkTypN(const MK_MNGN mng)
type-check and cast a unknown-managed-object into an MkTypeS pointer or MK_NULL if not possible
static bool MkTypCheckO(MK_OBJN obj)
check MkTypeS -> MkObjectS::signature …
#define MkTypeC_X2obj(x)
static bool MkTypCheck(MK_MNGN mng)
check MkTypeS -> MkObjectS::signature …
#define MkTypeLoop(_cls, _var)
void MkTypeLog_RT(MK_RT mkrt, MK_TYPN const typ, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the MkTypeS …
void MkTypeDelete_RT(MK_RT mkrt, MK_TYP const typ)
delete a type object
static MK_OBJ MkTypeInstances(MK_TYP const typ)
access the instance attribute of the type…
MK_TYP MkTypeDup2_RT(MK_RT mkrt, MK_TYPN const typ, MK_STRN const ident)
duplicate typ to create a lightweight-type …
MK_TYP MkTypeResolve_RT(MK_RT mkrt, MK_TYPN const typ)
resolve a new type
static MK_TYPN MkTypeNextN(MK_TYPN const typ)
get next instance from linked-list of MkObjectS type
MK_OBJ MkTypeAlloc_RT(MK_RT mkrt, MK_TYPN const typ)
alloc instance-memory for MkTypeS …
#define MkTypeCreate(clsV, basicV, identV)
kernel_overload_mk.h - 17 Mar 2025 - aotto1968
parser_mk.h - 11 Apr 2025 - aotto1968
array of MK_STRN values …
MK_STRN * data
define the storage-allocator function
MkAllocDeleteF alloc_deleteF
"free" the memory of the object
MkAllocCreateFLT alloc_createF
"calloc" the memory of the object
MK_PTR alloc_data
data use for alloc_createF and alloc_deleteF
binary data default format …
MK_SIZE size
size of the data pointer
MK_BINN data
pointer to the binary data
the final class of MkBufferS with 1024 byte ILS-Size …
struct MkBufferS buf
the final class of MkBufferS with 256 byte ILS-Size …
struct MkObjectS obj
struct MkBufferS buf
the final class of MkBufferS with 64 byte ILS-Size …
struct MkBufferS buf
struct MkObjectS obj
The CLASS used to store a list of MkBufferS items into a flat array…
instance storage predefined
MK_NUM offset
offset from start of MkBufferS to the start of MkBufferS::ils_data
MK_NUM size
size of the MkBufferS::ils_data
The ABSTRACT-CLASS used to store a native-type-data-item defined by PRIMITIVE TYPE …
struct MkObjectS obj
union MkBufferU first
POINTER to native data representation (ILS or malloc)
struct MkBufferS::ilsS ils
ILS = predefined storage used for MkBufferS::storage->first.
MK_BINB ils_data[MkBufferS_ils_size]
ILS storage
struct MkBufferS::@5 storage
MK_NUM size
the size of the data-segment
bool doBufferFree
should the data be freed? -> example: pBufferRefInit
struct MkBufferS::@4 var
variable part of the instance-data
union MkBufferS::@3 super
MK_NUM cursize
currently used size (always: cursize < size)
enum MkTypeE type
type of the item stored into the data-segment
the final class of MkBufferStreamS with 1024 byte ILS-Size …
struct MkBufferStreamS bus
struct MkObjectS obj
struct MkBufferS buf
the final class of MkBufferStreamS with 16384 byte ILS-Size …
struct MkBufferS buf
struct MkBufferStreamS bus
the final class of MkBufferStreamS with 256 byte ILS-Size …
struct MkObjectS obj
struct MkBufferS buf
struct MkBufferStreamS bus
the final class of MkBufferStreamS with 64 byte ILS-Size …
struct MkBufferS buf
struct MkObjectS obj
struct MkBufferStreamS bus
The ABSTRACT-CLASS MkBufferStreamS is used for package-based serialized IO …
struct MkBuffer64S busRef
union MkBufferU cur
point to current position in the package, used for write-to or read-from .
struct MkBufferStreamS::@11 storage
struct MkBufferStreamSaveS * busReadSave
struct MkObjectS obj
MK_BINB ils_data[MkBufferStreamS_ils_size]
struct MkBufferS buf
struct MkBufferStreamSaveS * busWriteSave
struct MkCacheS saveCache
union MkBufferStreamS::@9 super
struct MkBufferStreamS::@10 var
a linked-list to opearate a storage of data items
MK_PTR data
data to cache
MK_SIG signature
check if item is valid or not
bool doFree
should the item be freed?
struct MkCacheItemS * prev
link to the prev item
struct MkCacheItemS * next
link to the next item
This is an circel storage of a linked-list connected with a "lock" at MkCacheS …
MK_NUM num
MIN num items in cache.
MkCacheCF createF
function to create 'data'
struct MkCacheItemS * free_first
free first cache item
MK_PTR createD
additional create data item
MkCacheDF deleteF
function to delete 'data'
MK_NUM MkCacheItemS_N
struct MkCacheItemS * used
used cache items
struct MkCacheItemS * free_last
free last cache item
MK_RT runtime
link to the runtime
extension-slot for MkErrorS …
MkErrorFormatOfF fErrorFormatOf
plugin for sErr2Fmt …
MkErrorSetRF fErrorSetR
plugin for MkErrorSetR …
MkErrorResetF fErrorReset
plugin for MkErrorReset …
MkErrorPanikF fErrorPanik
plugin for MkPanicVL …
MkErrorSetEF fErrorSetE
plugin for MkErrorSetE …
MkErrorLogF fErrorLog
plugin for MkErrorLog …
MkErrorResetOnExitF fErrorResetOnExit
plugin for MkErrorReset …
MkErrorAppendFLT fErrorAppend
plugin for MkErrorAppendVL …
MkErrorSetVLF fErrorSetVL
plugin for MkErrorSetVL …
struct MkObjectS obj
MkErrorInit fErrorInit
plugin for MkErrorSetVL …
signal-slot for raise an error …
struct MkObjectS obj
struct MkErrorS err
signal-slot for panic on error …
struct MkObjectS obj
signal-slot for ignore on error …
struct MkObjectS obj
signal-slot for panic on error …
struct MkObjectS obj
signal-slot for print on error …
struct MkObjectS obj
The data-type to store and handle the error-condition …
MK_OBJN format_of_error
used to format the error-message and as input for source_of_error
bool noRaise
do not return MK_ERROR and do not raise an target-language-exception
MK_ERREXT mkErrExt
package specific error extension goes into this double linked list
MK_I32 num
the error number also used as exit code
enum MkErrorE code
the error code
bool append
allow to append? -> true or false
struct MkBuffer1024S text
the error message
union MkErrorS::@18 super
MK_MNGN source_of_error
source of the error, NULL = current context
struct MkObjectS obj
Base class for the extension technologie …
union MkExtensionS::@17 super
struct MkObjectS obj
struct MkExtensionS * next
struct MkExtensionS * prev
the double-linked-list (utlist_mk.h) needs this
data type for process/thread identification …
bool setByExtern
vales of val was set by extern source
MK_IDNT val
process or thread handle
bool ioIsPipe
startet in PIPE mode: client @ server @ ... and NOT in server --thread|spawn|fork
enum MkIdSE type
signal type of val data
Interface between libmkkernel and the Operating-System …
MkSysStrDupF SysStrDup
strdup syscall …
MkSysStrNCpyF SysStrNCpy
strdup strncpy …
MkSysExitF MkSysExitCB
MkSysWaitF MkSysWaitForProcessCB
wait for process to finish syscall with libmkkernel error plugin
MkSysWaitF MkSysWaitForThreadCB
wait for process to finish syscall with libmkkernel error plugin
MkSysCallocF SysCalloc
calloc syscall …
enum MkErrorE(* SysUSleep)(MK_OBJN const obj, unsigned int const usec)
usleep syscall with libmkkernel error plugin
MkSysReallocF SysRealloc
realloc syscall …
MkSysMallocF SysMalloc
malloc syscall …
MkSysFreeF SysFree
free syscall …
MkSysStrNDupF SysStrNDup
strndup syscall …
MK_PTR SysForkData
MkSysForkF SysFork
fork syscall …
enum MkErrorE(* SysSleep)(MK_OBJN const obj, unsigned int const sec)
sleep syscall with libmkkernel error plugin
struct to hold the mkrt-logging-data …
char logNAME[MkLogDataS_LogNAME_size]
FILE * logFILE
logging target… open MkLogDataS::logFILE (default: stderr)
bool logLOCK
indicate if log was set (true) or has the default (false)
char * logBUF
buffer data
int logREF
protect "BUFFER" against recursion
size_t logSIZE
size of logBUF
define a MkLogFileC object …
MkLogDataS logData
struct MkObjectS obj
union MkLogFileS::@16 super
the protect is used to "protect" data set by pAllocCreate if the new object is later initialized with...
bool isLocal
has the object a local reference? - has been created by TLS or MkBufferCreateREF ?...
MK_OBJ prev
previous
object header …
bool selfCreated
if the self was created by selfCreate than it is an INTERNAL object …
struct MkObjectProtectS obj_protect
the protect is used to "protect" data set by pAllocCreate if the new object is later initialized with...
MK_SIG signature
should be the SIGNATURE
MK_RT objRt
link to the kernel-runtime the instance was created in …
MK_PTR env
link to the object "runtime", set by selfCreate …
MK_I32 selfRefCount
Delete the MkObjectS::self at the same MkObjectS::refCount as was created …
MK_RTEXT objRtExt
link to the kernel-runtime-extension the instance was created in …
MK_TYP type
link to the object type
bool deleteCallbackCalled
Activate if object is on delete.
MK_HDL netHdl
if not-null the object was exported with MkObjectHandleGet
MK_PTR self
link between the managed object and the object in the target-programming-language
MK_I32 refCount
is THIS object in use?
MkRtExtS - extend the MkRuntimeC with a library specific feature …
struct MkObjectS obj
keep callback related data …
struct MkRuntimeCallbackS * next
MkRuntimeInitF cb
required data
MK_STRB ident[MkRuntimeCallbackS_ident_size+1]
required data
struct MkRuntimeCallbackS * prev
The MkRuntimeS provide a per-thread environment for libmkkernel …
struct MkTypeDefS _MkErrorIgnoreC_T
struct MkTypeDefS _MkRtExtC_T
struct MkTypeDefS _MkErrorDefaultC_T
struct MkTypeDefS _MkBufferStreamC_T
struct MkTypeDefS _MkExtensionC_T
struct MkTypeDefS _MkBuffer256C_T
struct MkTypeDefS _MkErrorPanicC_T
MkThreadDataS mkThreadData
application specific thread data …
struct MkTypeDefS _MkErrExtC_T
bool MkSelfIncrOnCacheB
incr refCount on self at MkSelfNew …
MkLogDataS log
struct to hold the mkrt-logging-data …
struct MkTypeDefS _MkLogFileC_T
struct MkObjectS obj
struct MkTypeDefS _MkRuntimeC_T
struct MkTypeS _MkTypeC_TT
struct MkTypeDefS _MkErrorC_T
struct MkErrorPanicS error_panic
panic-system-error - panic on next error …
MkSelfDecrF fSelfDecr
"decr" Self pointer if pointer stored INTERNAL (MkObjectHandleDelete)
bool isSilent
write (MK_NO) or don't write (MK_YES) any message to MkLogFileC (default: stderr) (default: MK_NO) …
MK_I32 debug
set the debug-level of the context … Valid values are 0 <= debug-level <= 9 using 0 for no-debug and ...
struct MkErrorIgnoreS error_ignore
ignore-system-error - ignore the next error …
struct MkTypeDefS _MkBufferC_T
struct MkTypeDefS _MkErrorExitC_T
struct MkTypeDefS _MkBuffer1024C_T
struct MkTypeDefS _MkBufferStream64C_T
MK_RTEXT mkRtExt
package specific runtime extension …
struct MkBuffer64S tbuf
runtime local buffer (RLS) for misc tasks …
bool noDeco
do not use decoration to generate log messages (default: use decoration) …
struct MkTypeDefS _MkBufferListC_T
struct MkTypeDefS _MkBuffer64C_T
MkSelfIncrF fSelfIncr
"incr" Self pointer if pointer stored INTERNAL (MkObjectHandleGet)
struct MkTypeDefS _MkBufferStream1024C_T
struct MkErrorS error_mk
default-system-error - default-error …
struct MkErrorPrintS error_print
ignore-system-error - print the next error into MkLogFileC …
struct MkTypeDefS _MkErrorPrintC_T
struct MkTypeDefS _MkBufferStream16384C_T
struct MkTypeS _MkTypeDefC_TT
MK_BINB private_variables[12986]
struct MkTypeDefS _MkObjectC_T
struct MkErrorPanicS error_exit
panic-system-error - panic on next error …
struct MkTypeDefS _MkBufferStream256C_T
union MkRuntimeS::@26 super
is the MkRuntimeS initialized? …
MK_RTEXT mkRtExtAry[MkExtension_size]
package specific runtime extension - fast access by …
string data default format …
MK_STRN ptr
pointer to the string data
MK_NUM len
len of the string data
super-class-base, the MkTypeS using the super-macro-syntax for all non specific types …
struct MkTypeS typ
struct MkObjectS obj
MkTypeS - class known as typ or type is used as class-base for a Managed-Object-Technology (MOT) type...
MkSelfUnlinkF selfUnlink
"unlink" the "self" pointer from META-Kernel
MkSelfDeleteF selfDelete
"delete" the "self" pointer
bool noSelf
do NOT use the self feature -> used by MqFactoryS
MkLogF log
"log" object data to MkLogFileC (default: stderr)
MkCopyF copy
"copy"
MkLogFormatF fLogFormat
format the log message of an object, used in "sLogVL_O"
MkToStringF toString
get the string representation
MkSelfCreateF selfCreate
"create" the "self" pointer
size_t typsize
the size of the this type self, used in MkTypeDup2
MK_TYP type_class
point to the instancesR linked list of the class-type
MkConstructorF constructor
create an object
struct MkObjectS obj
MkTypeInitF type_init
initializer for new type
MkDup2F dup2
"dup" constructor with "ident" initialisation
size_t objsize
the size of the new object created with this type, used in malloc
MkResetF reset
"reset" the object to the "initial" state
MkDupF dup
"dup" constructor
MkDestructorF destructor
delete an object
MK_I32 delCbCnt
number of callback registered for this type
MK_SIG objsig
type-instance: signature as unsinged integer (32bit)
union MkTypeS::@1 super
MK_SIG objmask
type-instance: mask to filter out the valid part of the signatur
MkMergeF merge
"merge" constructor
MK_OBJ instancesR
MK_TYP type_base
base type
MK_I32 type_id
default "0" but "MkFactoryTypeAdd" need more
union used to set or modify native data from an MkBufferS object …
MK_I8 I8
1 byte byte data
MK_BOL BOL
1 byte boolean data
MK_I64 I64
8 byte integer data
MK_DBL DBL
8 byte double data
MK_I16 I16
2 byte short data
MK_FLT FLT
4 byte float data
MK_I32 I32
4 byte integer data
a union for all data items supported by MkBufferS …
MK_STRN C
const C string like data (e.g. with a \0 at the end)
MK_ATO * A
atom for native data-types
MK_LST L
list object type data
MK_STR S
C string like data (e.g. with a \0 at the end)
MK_BIN B
arbitrary byte-array data