theKernel 10.0
Loading...
Searching...
No Matches
MkRuntimeC_Config_C_API

MkRuntimeC - various functions to configure the MkRuntimeRLS (only C) … More...

+ Collaboration diagram for MkRuntimeC_Config_C_API:

Macros

#define MkRuntimeLogBufferPush()
 
#define MkRuntimeLogBufferPop()
 

Functions

static bool libmkkernel::MkRuntimeIsSilentGet (void)
 get the MkRuntimeS::isSilent value …
 
static void libmkkernel::MkRuntimeIsSilentSet_RT (MK_RT mkrt, bool silent)
 set the MkRuntimeS::isSilent value …
 
static void libmkkernel::MkRuntimeNoDecoSet_RT (MK_RT mkrt, bool noDeco)
 set the MkRuntimeS::noDeco value …
 
static MK_I32 libmkkernel::MkRuntimeDebugGet (void)
 get the MkRuntimeS::debug value …
 
static void libmkkernel::MkRuntimeDebugSet (MK_I32 dbg)
 set the MkRuntimeS::debug value …
 
static MK_STRN libmkkernel::MkRuntimeLogTargetGet (void)
 get the MkLogDataS::logNAME value …
 
enum MkErrorE libmkkernel::MkRuntimeLogTargetSet_RT (MK_RT mkrt, MK_STRN logTgt)
 set the MkRuntimeS::log value and cleanup old value …
 
enum MkErrorE libmkkernel::MkRuntimeLogTargetReset_RT (MK_RT mkrt)
 set the MkRuntimeS::log value to the DEFAULT value …
 
MkLogDataS libmkkernel::MkRuntimeLogTargetPush_RT (MK_RT mkrt, MK_STRN logTgt)
 
void libmkkernel::MkRuntimeLogTargetPop_RT (MK_RT mkrt, MkLogDataS logOld)
 
void libmkkernel::MkRuntimeSetCID (MK_OBJ const cid)
 CID == context-in-duty.
 
static enum MkErrorE libmkkernel::MkRuntimeErrorGetCode_RT (MK_RT mkrt)
 return libmkkernel::MkErrorS::code from a given MkRuntimeC
 

MkRuntimeC - MkRuntimeC_Config_C_API - overload

#define MkRuntimeErrorGetCode_NULL()
 
#define MkRuntimeErrorGetCode()
 
#define MkRuntimeErrorGetCode_E(...)
 
#define MkRuntimeErrorGetCode_C(...)
 
#define MkRuntimeIsSilentSet_NULL(...)
 
#define MkRuntimeIsSilentSet(...)
 
#define MkRuntimeLogTargetReset_NULL()
 
#define MkRuntimeLogTargetReset()
 
#define MkRuntimeLogTargetReset_E(...)
 
#define MkRuntimeLogTargetReset_C(...)
 
#define MkRuntimeLogTargetSet_NULL(...)
 
#define MkRuntimeLogTargetSet(...)
 
#define MkRuntimeLogTargetSet_E(...)
 
#define MkRuntimeLogTargetSet_C(...)
 
#define MkRuntimeNoDecoSet_NULL(...)
 
#define MkRuntimeNoDecoSet(...)
 

Detailed Description

MkRuntimeC - various functions to configure the MkRuntimeRLS (only C) …

The MkRuntimeRLS-configuration belongs to a single MkRuntimeRLS. In a threadable application, each thread has its own MkRuntimeRLS and therefore its own configuration.

A function ending in 'I' is the inline variant of the function without the 'I' and is preferred in C.

Macro Definition Documentation

◆ MkRuntimeErrorGetCode

#define MkRuntimeErrorGetCode ( )
Value:
MkRuntimeErrorGetCode_RT(MK_RT_CALL_ONLY)
#define MK_RT_CALL_ONLY

Definition at line 1856 of file kernel_overload_mk.h.

◆ MkRuntimeErrorGetCode_C

#define MkRuntimeErrorGetCode_C ( ...)
Value:
#define MkErrorCheckI(err)
#define MkRuntimeErrorGetCode()

Definition at line 1858 of file kernel_overload_mk.h.

◆ MkRuntimeErrorGetCode_E

#define MkRuntimeErrorGetCode_E ( ...)
Value:
#define MkErrorCheck(err)
check return-code and goto error on error …

Definition at line 1857 of file kernel_overload_mk.h.

◆ MkRuntimeErrorGetCode_NULL

#define MkRuntimeErrorGetCode_NULL ( )
Value:
MkRuntimeErrorGetCode_RT(MK_RT_CALL_NULL_ONLY)
#define MK_RT_CALL_NULL_ONLY

Definition at line 1855 of file kernel_overload_mk.h.

◆ MkRuntimeIsSilentSet

#define MkRuntimeIsSilentSet ( ...)
Value:
MkRuntimeIsSilentSet_RT(MK_RT_CALL __VA_ARGS__)
#define MK_RT_CALL

Definition at line 1860 of file kernel_overload_mk.h.

◆ MkRuntimeIsSilentSet_NULL

#define MkRuntimeIsSilentSet_NULL ( ...)
Value:
MkRuntimeIsSilentSet_RT(MK_RT_CALL_NULL __VA_ARGS__)
#define MK_RT_CALL_NULL

Definition at line 1859 of file kernel_overload_mk.h.

◆ MkRuntimeLogBufferPop

#define MkRuntimeLogBufferPop ( )
Value:
MkRuntimeLogTargetPop_RT(MK_RT_CALL saveLogTarget)

Definition at line 12775 of file LibMkKernel_mk.h.

◆ MkRuntimeLogBufferPush

#define MkRuntimeLogBufferPush ( )
Value:
MkLogDataS saveLogTarget = MkRuntimeLogTargetPush_RT(MK_RT_CALL "BUFFER")

Definition at line 12766 of file LibMkKernel_mk.h.

◆ MkRuntimeLogTargetReset

#define MkRuntimeLogTargetReset ( )
Value:
MkRuntimeLogTargetReset_RT(MK_RT_CALL_ONLY)

Definition at line 1862 of file kernel_overload_mk.h.

◆ MkRuntimeLogTargetReset_C

#define MkRuntimeLogTargetReset_C ( ...)
Value:
#define MkRuntimeLogTargetReset()

Definition at line 1864 of file kernel_overload_mk.h.

◆ MkRuntimeLogTargetReset_E

#define MkRuntimeLogTargetReset_E ( ...)
Value:

Definition at line 1863 of file kernel_overload_mk.h.

◆ MkRuntimeLogTargetReset_NULL

#define MkRuntimeLogTargetReset_NULL ( )
Value:
MkRuntimeLogTargetReset_RT(MK_RT_CALL_NULL_ONLY)

Definition at line 1861 of file kernel_overload_mk.h.

◆ MkRuntimeLogTargetSet

#define MkRuntimeLogTargetSet ( ...)
Value:
MkRuntimeLogTargetSet_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1866 of file kernel_overload_mk.h.

◆ MkRuntimeLogTargetSet_C

#define MkRuntimeLogTargetSet_C ( ...)
Value:
#define MkRuntimeLogTargetSet(...)

Definition at line 1868 of file kernel_overload_mk.h.

◆ MkRuntimeLogTargetSet_E

#define MkRuntimeLogTargetSet_E ( ...)
Value:

Definition at line 1867 of file kernel_overload_mk.h.

◆ MkRuntimeLogTargetSet_NULL

#define MkRuntimeLogTargetSet_NULL ( ...)
Value:
MkRuntimeLogTargetSet_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1865 of file kernel_overload_mk.h.

◆ MkRuntimeNoDecoSet

#define MkRuntimeNoDecoSet ( ...)
Value:
MkRuntimeNoDecoSet_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1870 of file kernel_overload_mk.h.

◆ MkRuntimeNoDecoSet_NULL

#define MkRuntimeNoDecoSet_NULL ( ...)
Value:
MkRuntimeNoDecoSet_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1869 of file kernel_overload_mk.h.

Function Documentation

◆ MkRuntimeDebugGet()

static MK_I32 libmkkernel::MkRuntimeDebugGet ( void )
inlinestatic

get the MkRuntimeS::debug value …

Definition at line 12724 of file LibMkKernel_mk.h.

12724 {
12725 return MkRuntimeRLS.log.logNAME;
12726}
__thread struct MkRuntimeS MkRuntimeRLS
RLS …
char logNAME[MkLogDataS_LogNAME_size]
MkLogDataS log
struct to hold the mkrt-logging-data …
+ Here is the caller graph for this function:

◆ MkRuntimeDebugSet()

static void libmkkernel::MkRuntimeDebugSet ( MK_I32 dbg)
inlinestatic

set the MkRuntimeS::debug value …

Definition at line 12730 of file LibMkKernel_mk.h.

+ Here is the caller graph for this function:

◆ MkRuntimeErrorGetCode_RT()

static enum MkErrorE libmkkernel::MkRuntimeErrorGetCode_RT ( MK_RT mkrt)
inlinestatic

return libmkkernel::MkErrorS::code from a given MkRuntimeC

Definition at line 12784 of file LibMkKernel_mk.h.

◆ MkRuntimeIsSilentGet()

static bool libmkkernel::MkRuntimeIsSilentGet ( void )
inlinestatic

get the MkRuntimeS::isSilent value …

Definition at line 12710 of file LibMkKernel_mk.h.

12710 {
12711 return MkRuntimeRLS.debug;
12712}
MK_I32 debug
set the debug-level of the context … Valid values are 0 <= debug-level <= 9 using 0 for no-debug and ...
+ Here is the caller graph for this function:

◆ MkRuntimeIsSilentSet_RT()

static void libmkkernel::MkRuntimeIsSilentSet_RT ( MK_RT mkrt,
bool silent )
inlinestatic

set the MkRuntimeS::isSilent value …

Definition at line 13599 of file LibMkKernel_mk.h.

◆ MkRuntimeLogTargetGet()

static MK_STRN libmkkernel::MkRuntimeLogTargetGet ( void )
inlinestatic

get the MkLogDataS::logNAME value …

Attention
the string is owned by ccmkkernel -> do not free !!

Definition at line 12738 of file LibMkKernel_mk.h.

+ Here is the caller graph for this function:

◆ MkRuntimeLogTargetPop_RT()

void libmkkernel::MkRuntimeLogTargetPop_RT ( MK_RT mkrt,
MkLogDataS logOld )

◆ MkRuntimeLogTargetPush_RT()

MkLogDataS libmkkernel::MkRuntimeLogTargetPush_RT ( MK_RT mkrt,
MK_STRN logTgt )

◆ MkRuntimeLogTargetReset_RT()

enum MkErrorE libmkkernel::MkRuntimeLogTargetReset_RT ( MK_RT mkrt)

set the MkRuntimeS::log value to the DEFAULT value …

See also
MkRuntimeLogTargetSet

◆ MkRuntimeLogTargetSet_RT()

enum MkErrorE libmkkernel::MkRuntimeLogTargetSet_RT ( MK_RT mkrt,
MK_STRN logTgt )

set the MkRuntimeS::log value and cleanup old value …

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]logTgtone of: STDERR ("",NULL,default), STDOUT, BUFFER, filename

◆ MkRuntimeNoDecoSet_RT()

static void libmkkernel::MkRuntimeNoDecoSet_RT ( MK_RT mkrt,
bool noDeco )
inlinestatic

set the MkRuntimeS::noDeco value …

Definition at line 13612 of file LibMkKernel_mk.h.

14000 { \
14001 MkLogV_2(fmtobj,MK_COLOR_ORANGE "Warning: ignore call to '%s' with '%d'" MK_COLOR_RESET "\n", __func__, debug); \
14002 printSTACK_1(fmtobj); \
14003 return; \
14004 }
14005 # define MkDProtect2(_debug,_call) if (MK_RT_REF.debug < _debug) { \
14006 MkLogV_2(fmtobj,MK_COLOR_ORANGE "Warning: ignore call to '%s' from '%s' with '%d'" \
14007 MK_COLOR_RESET "\n", __func__, _call, debug); \
14008 printSTACK_1(fmtobj); \
14009 return; \
14010 }
14011#endif
14013// MkObjectC_Log_C_API
14014
14015/*****************************************************************************/
14016/* */
14017/* add feature - used to compile 'libmkkernel' library itself */
14018/* */
14019/*****************************************************************************/
14020
14021// DOKU: MkObjectS->selfRefCount
14022#define META_USE_SELF_REFCOUNT
14023
14024/* ############################################################### */
14025/* ### ### */
14026/* ### PARSER ### */
14027/* ### ### */
14028/* ############################################################### */
14029
14030// META_P
14034
14035// [__parser__]
14036#ifndef __has_parser__
14037
14043
14045# define __parser__(...)
14047# define __parser__define__(...)
14049
14051# define __parser__push__(...)
14053# define __parser__pop__
14054
14056// END: local attributes
14057
14063
14065# define __parser__global__(...)
14067# define __parser__global__define__(...)
14071# define __parser__global__push__(...)
14073# define __parser__global__pop__
14074
14076// END: global attributes
14077
14078#else
14079# include "parser_mk.h"
14080#endif
14081// END: !__has_parser__
14082// [__parser__]
14083
14085// MkKernel_Parser_C_API
14086
14087/* ############################################################### */
14088/* ### ### */
14089/* ### START ### */
14090/* ### ### */
14091/* ############################################################### */
14092
14096
14097// =========================================================================
14100
14101__parser__(library=MkKernel@internal@Mk);
14102
14103// GLOBAL: all "fmtobj" arguments become attribute "formatter"
14104__parser__global__(formatter=fmtobj);
14106#define MK_PARSER_fmtobj MK_OBJN fmtobj __parser__(default=NULL)
14107
14108// GLOBAL: all "macros" become hide
14109__parser__global__(hide-rx=^Mk\w+_T$);
14110
14112// END: global __parser__ definition
14113
14116#if defined(_MSC_VER)
14117
14118 // Visual C++ Express-Edition
14119
14120 # define __attribute__(dummy)
14121 # define __func__ __FUNCTION__
14122 # define MK_CLRCALL __clrcall
14123 # define MK_STDCALL __stdcall
14124 # define MK_CDECL __cdecl
14125
14126 // helper
14127 # ifndef PARSE_C_HEADER_TO_META
14128 # define mk_inline static inline
14129 # endif
14130 //# define bool int
14131 # define mk_unlink _unlink
14132 # define mk_snprintf _snprintf
14133
14134 # define MK_ATTR_HOT ???
14135 # define MK_ATTR_COLD ???
14136
14137#else // !_MSC_VER
14138
14139 // GCC
14140
14141 # define MK_CLRCALL
14142 # define MK_STDCALL
14143 # define MK_CDECL
14144
14145 // helper
14146 # ifndef PARSE_C_HEADER_TO_META
14147 # define mk_inline static inline
14148 # endif
14149 # define mk_unlink unlink
14150 # define mk_snprintf snprintf
14151
14152 # define MK_ATTR_HOT __attribute__((hot))
14153 # define MK_ATTR_COLD __attribute__((cold))
14154
14155#endif // _MSC_VER
14156
14157#if defined(_MANAGED)
14158 # define MK_DECL MK_CLRCALL
14159#elif defined(META_COMPILE_AS_CC)
14160 # define MK_DECL MK_STDCALL
14161#else
14162 # define MK_DECL MK_CDECL
14163#endif
14164
14165/* BEGIN_MK_C_DECLS should be used at the beginning of your declarations,
14166 so that C++ compilers don't mangle their names. Use END_MK_C_DECLS at
14167 the end of C declarations. */
14168
14169#undef BEGIN_MK_C_DECLS
14170#undef END_MK_C_DECLS
14171#if defined(META_COMPILE_AS_CC)
14172# define BEGIN_MK_C_DECLS namespace libmkkernel {
14173# define END_MK_C_DECLS }
14174#elif defined(__cplusplus)
14175# define BEGIN_MK_C_DECLS extern "C" {
14176# define END_MK_C_DECLS }
14177#else
14178# define BEGIN_MK_C_DECLS /* empty */
14179# define END_MK_C_DECLS /* empty */
14180#endif
14181
14182/* Somewhere in the middle of the GCC 2.96 development cycle, we implemented
14183 a mechanism by which the user can annotate likely branch directions and
14184 expect the blocks to be reordered appropriately. Define __builtin_expect
14185 to nothing for earlier compilers. */
14186
14187#if defined(_MSC_VER) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
14188 #define likely(x) !!(x)
14189 #define unlikely(x) !!(x)
14190 #else
14191 #define likely(x) __builtin_expect((x),1)
14192 #define unlikely(x) __builtin_expect((x),0)
14193#endif
14194
14195#ifndef PARSE_C_HEADER_TO_META
14196 # ifndef _MSC_VER
14197 # include <inttypes.h>
14198 # endif
14199 # ifdef __CYGWIN__
14200 # include <windef.h>
14201 # endif
14202 # include <stdarg.h>
14203 # include <string.h>
14204 # include <stdio.h>
14205 # include <time.h>
14206 # ifndef _MSC_VER
14207 # include <unistd.h>
14208 # include <stdbool.h>
14209 # endif
14210#endif
14211
14212#if defined(_WIN32) && !defined(__CYGWIN__)
14213 # ifndef PARSE_C_HEADER_TO_META
14214 # include <winsock2.h>
14215 # endif
14216
14218 # define mk_timeval timeval
14219
14221 struct mk_timezone {
14222 int tz_minuteswest;
14223 int tz_dsttime;
14224 };
14225
14226#else
14227 # define mk_timeval timeval
14228 # define mk_timezone timezone
14229 struct mk_timeval;
14230 struct mk_timezone;
14231#endif
14232
14234#define MK_UNUSED __attribute__((unused))
14236#define MK_NO_RETURN __attribute__((noreturn))
14237#define MK_UNREACHABLE __builtin_unreachable()
14238// https://stackoverflow.com/questions/20110291/use-cases-of-the-gcc-artificial-function-attribute
14239#define MK_ARTIFICIAL __attribute__((__artificial__))
14240// used for "pseudo" function declarartion (to support tags-file magic)
14241#define MK_DEPRECATED __attribute__ ((deprecated))
14242// disable optimization to get better code for debugging
14243#define MK_OPTIMIZE_0 __attribute__((optimize("O0")))
14244
14245#ifndef PARSE_C_HEADER_TO_META
14246 # include <assert.h>
14247#endif
14248
14250// END: native compiler definition
14251
14253// END: MkKernel_Compiler_C_API
14254
14255// Namespace for the 'ccmkkernel' API …
14257
14258// ==============================================================================================
14261
14263typedef void* MK_MACRO_TYP;
14264
14270
14303__parser__(ignore)
14304#define MK_NULL NULL
14305
14307#define MK_NULL_YES true
14308
14310#define MK_NULL_NO false
14311
14315__parser__(ignore)
14316#define MK_NULL_STR "MK_NULL"
14317
14321__parser__(ignore)
14322#define MK_NULL_STR_LEN strlen(MK_NULL_STR)
14323
14331__parser__(ignore)
14332mk_inline bool MK_NULL_STR_CHECK(char const * const __str, const long int __len) {
14333 return ((__str) ? ( (__len) == MK_NULL_STR_LEN && strcmp((__str),MK_NULL_STR)==0 ) : true);
14334}
14335
14337__parser__(ignore)
14338mk_inline bool MK_NULL_STR_CHECK_1(char const * const __str) {
14339 return ((__str) ? strcmp((__str),MK_NULL_STR)==0 : true);
14340}
14341
14343__parser__(ignore)
14344mk_inline bool MK_NULL_STR_OR_EMPTY_CHECK_1(char const * const __str) {
14345 return ((__str) ? (__str)[0] == '\0' || strcmp((__str),MK_NULL_STR)==0 : true);
14346}
14347
14349// name: MK_NULL
14350
14352// MkKernel_Compiler_C_API
14353
14354// ==============================================================================================
14498#if META_HAS_THREAD
14501 # define MkThreadLocal __thread
14502 # define MK_RT_SHIFT 1
14503 # define MK_RT_ARGS_ONLY MK_RT mkrt
14504 # define MK_RT_ARGS MK_RT_ARGS_ONLY,
14505 # define MK_RT_CALL_ONLY mkrt
14506 # define MK_RT_CALL MK_RT_CALL_ONLY,
14507 # define MK_RT_CALL_O(o) MkRT_O(o),
14508 # define MK_RT_CALL_X(x) MkRT_X(x),
14509 # define MK_RT_CALL_NULL_ONLY MkRT
14510 # define MK_RT_CALL_NULL MK_RT_CALL_NULL_ONLY,
14511 # define MK_RT_NULL NULL,
14512 # define MK_RT_PTR mkrt
14513 # define MK_RT_REF (*mkrt)
14514 # define MK_RT_REF_NULL (MkRuntimeRLS)
14515 # define MK_RT_UNUSED MK_UNUSED
14516 # define MK_RT_CALL_RT(ptr) ptr,
14517 # define MK_PARSER_RT_ONLY MK_RT_ARGS_ONLY __parser__(internal,default=N#RUNTIME)
14518 # define MK_PARSER_RT MK_PARSER_RT_ONLY,
14520#else
14523 # define MkThreadLocal
14524 # define MK_RT_SHIFT 0
14525 # define MK_RT_ARGS_ONLY void
14526 # define MK_RT_ARGS
14527 # define MK_RT_CALL_ONLY
14528 # define MK_RT_CALL
14529 # define MK_RT_CALL_O(o)
14530 # define MK_RT_CALL_X(x)
14531 # define MK_RT_CALL_NULL_ONLY
14532 # define MK_RT_CALL_NULL
14533 # define MK_RT_NULL
14534 # define MK_RT_PTR (&MkRuntimeRLS)
14535 # define MK_RT_REF (MkRuntimeRLS)
14536 # define MK_RT_REF_NULL (MkRuntimeRLS)
14537 # define MK_RT_UNUSED
14538 # define MK_RT_CALL_RT(ptr)
14539 # define MK_PARSER_RT_ONLY void
14540 # define MK_PARSER_RT
14542#endif
14543
14544# define MK_RT_ATTR_FORMAT_1 __attribute__((format (printf, 1+MK_RT_SHIFT, 2+MK_RT_SHIFT)));
14545# define MK_RT_ATTR_FORMAT_2 __attribute__((format (printf, 2+MK_RT_SHIFT, 3+MK_RT_SHIFT)))
14546# define MK_RT_ATTR_FORMAT_4 __attribute__((format (printf, 4+MK_RT_SHIFT, 5+MK_RT_SHIFT)))
14547
14548// nonnull for runtime yesORno? → problem is C# (and propably go), because runtime is a C feature and getting a nonnull C Pointer
14549// for every API call in C# is expensive. solution? → allow NULL and resolve the mkrt pointer in C
14550# define __MK_ATTR_RT_RUNTIME // empty
14551
14552#if META_HDL_USE__NONNULL__GCC_ATTRIBUTE == 1
14553 // with "nonnull" on HDL the assert disable itself
14554 # define __MK_ATTR_RT_INSTANCE __attribute__((nonnull(1+MK_RT_SHIFT)))
14555 # define __MK_ATTR_INSTANCE __attribute__((nonnull(1)))
14556 # define MK_INSTANCE_HDL(x)
14557#else
14558 # define __MK_ATTR_RT_INSTANCE
14559 # define __MK_ATTR_INSTANCE
14560 # define MK_INSTANCE_HDL(x) assert(x!=NULL)
14561#endif
14562
14563// ".h" file
14564#define MK_ATTR_INSTANCE __MK_ATTR_INSTANCE
14565#define MK_ATTR_RT_INSTANCE __MK_ATTR_RT_RUNTIME __MK_ATTR_RT_INSTANCE
14566#define MK_ATTR_STATIC __parser__(static)
14567#define MK_ATTR_RT_STATIC __MK_ATTR_RT_RUNTIME __parser__(static) // in func: MQ_STATIC_RT
14568
14569// ".c" file
14570#define MK_INSTANCE_RT_X(x) MK_INSTANCE_HDL(x); MkRtSetup_XN_RT(x); META_DEBUG_ERROR_checkX(x)
14571#define MK_INSTANCE_RT_X_NULL(x) MkRtSetup_X_RT(x); META_DEBUG_ERROR_checkX(x)
14572#define MK_INSTANCE_RT_O(o) MK_INSTANCE_HDL(o); MkRtSetup_ON_RT(o); META_DEBUG_ERROR_checkO(o)
14573#define MK_INSTANCE_RT_O_NULL(o) MkRtSetup_O_RT(o); META_DEBUG_ERROR_checkO(o)
14574#define MK_DESTRUCTOR_RT_X(c,x) MK_INSTANCE_HDL(x); \
14575 if (!MkCheckNN(c,x)) return; /* do NOT delete an invalid pointer */ \
14576 MkRtSetup_XN_RT(x); META_DEBUG_ERROR_check()
14577#define MK_STATIC_RT MkRtSetup_NULL_RT; META_DEBUG_ERROR_check()
14578
14579// example: probably future enhancement on class/method definition
14580// #define MK_INLINE_RT_STATIC(func,...) mk_inline MK_ATTR_RT_STATIC func##_RT (MK_PARSER_RT __VA_ARGS__)
14581
14583// MkRuntimeC_Interface_C_API
14584
14585// MARK_O
14586#ifndef PARSE_C_HEADER_TO_META
14587 # include "gen/kernel_overload_mk.h"
14588#endif
14589
14656/*****************************************************************************/
14657/* */
14658/* compiler and os definition */
14659/* */
14660/*****************************************************************************/
14661
14664
14665// on windows using the 'native' compiler 'cl.exe' we have to define some missing symbols
14666#if defined(_MSC_VER) && defined(_DLL)
14667 # undef PIC
14668 # define PIC
14669 # undef DLL_EXPORT
14670 # define DLL_EXPORT
14671#endif
14672
14673#ifdef META_IS_WINDOWS
14674 # define META_DIR_SEPARATOR '\\'
14675 # define META_EOL "\r\n"
14676#else
14677 # define META_DIR_SEPARATOR '/'
14678 # define META_EOL "\n"
14679#endif
14680
14681// BEGIN-HEADER - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
14682
14683// If the source of libmkkernel is direct used in an external library
14684// (without dynamic linking) and this library should *not* export
14685// the symbol's of libmkkernel then the flag META_IGNORE_EXTERN have
14686// to be set
14687#undef MK_EXTERN
14688#if defined(META_IGNORE_EXTERN)
14689# define MK_EXTERN
14690#elif defined(PIC)
14691 // does we build a DLL ?
14692# if defined(DLL_EXPORT)
14693 // does we build the libmkkernel library ?
14694# if defined(MK_C_BUILD_DLL)
14695# define MK_EXTERN __declspec(dllexport)
14696# else
14697# define MK_EXTERN __declspec(dllimport)
14698# endif
14699# else
14700 // no DLL - architecture specific extern specifier
14701# define MK_EXTERN __attribute__ ((visibility("default")))
14702# endif
14703#else
14705# define MK_EXTERN
14706#endif
14707
14708// external data lookup
14709#undef MK_EXTERN_DATA
14710#if defined(META_PRIVATE)
14711# define MK_EXTERN_DATA extern
14712#elif defined(META_IGNORE_EXTERN)
14713# define MK_EXTERN_DATA extern
14714#elif defined(PIC)
14715 // does we build a DLL ?
14716# if defined(DLL_EXPORT)
14717 // does we build the libmkkernel library ?
14718# if defined(MK_C_BUILD_DLL)
14719# define MK_EXTERN_DATA __declspec(dllexport)
14720# else
14721# define MK_EXTERN_DATA __declspec(dllimport)
14722# endif
14723# else
14724 // no DLL - architecture specific extern specifier
14725# define MK_EXTERN_DATA __attribute__ ((visibility("default"))) extern
14726# endif
14727#else
14728# define MK_EXTERN_DATA extern
14729#endif
14730
14731// END-HEADER - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
14732
14734#define MK_CPPXSTR(s) MK_CPPSTR(s)
14736#define MK_CPPSTR(s) #s
14738#define MK_CONCAT(a,b) a ## b
14739#define MK_CONCAT2(a,b) MK_CONCAT(a,b)
14740#define MK_CONCAT3(a,b,c) a ## b ## c
14741
14743#ifdef HAVE_STPCPY
14744 #define mk_append_fix_str(t,s) t=stpcpy(t,s)
14745#else
14746 #define mk_append_fix_str(t,s) t=strcpy(t,s)+sizeof(s)-1
14747#endif
14748
14750#define mk_bit_compare(t,f) (t&f)==f
14751
14753// MkKernel_Compiler_C_API
14754
14755/* MARK_T ********************************************************************/
14756/* */
14757/* types/generic */
14758/* */
14759/*****************************************************************************/
14760
14764
14765struct MkErrorS;
14766struct MkBufferListS;
14767struct MkBufferS;
14768union MkBufferU;
14769struct MkObjectS;
14770struct MkAllocS;
14771struct MkTypeS;
14772struct MkTypeDefS;
14773
14775#define MK_ALFA '@'
14777#define MK_ALFA_STR ((MkStringR){1,"@"})
14778
14779// ----------------------------------------------------------------------------------
14780
14783
14785__parser__(type=ME_NB1_MK_BOL:"1 byte 'boolean' data-type")
14786typedef unsigned char MK_BOL;
14787
14788// hint: bool into printf %B → https://stackoverflow.com/questions/17307275/what-is-the-printf-format-specifier-for-bool
14790__parser__(type=ME_NB0_MK_BOOL:"'boolean' data-type":primary)
14791typedef bool MK_BOOL;
14792#define bool2str(_bool) (_bool?"true":"false")
14793
14795
14796// ----------------------------------------------------------------------------------
14797
14800
14802__parser__(type=ME_NI1_MK_I8:"1 byte 'byte' data-type")
14803typedef signed char MK_I8;
14805__parser__(type=ME_NI2_MK_I16:"2 byte 'short integer' data-type":primary:int16_t)
14806typedef signed short int MK_I16;
14808__parser__(type=ME_NI4_MK_I32:"4 byte 'integer' data-type":primary:int32_t)
14809typedef signed int MK_I32;
14811#if defined(_MSC_VER)
14812 typedef __int64 MK_I64;
14813 typedef long MK_SIZE;
14814#else
14815 __parser__(type=ME_NI8_MK_I64:"8 byte 'wide integer' data-type":primary:int64_t)
14816 typedef signed long long MK_I64;
14817#endif
14819__parser__(type=ME_NIL_MK_LONG:"4/8 byte 'long' data-type":primary)
14820// TODO → make MK_LONG network save
14821typedef long MK_LONG;
14822
14824
14825// ----------------------------------------------------------------------------------
14826
14829
14830__parser__(type=ME_NU1_MK_U8:"1 byte 'unsigned byte' data-type":primary:uint8_t)
14831typedef unsigned char MK_U8;
14832__parser__(type=ME_NU2_MK_U16:"2 byte 'unsigned short' data-type":primary:uint16_t)
14833typedef unsigned short MK_U16;
14834__parser__(type=ME_NU4_MK_U32:"4 byte 'unsigned integer' data-type":primary:uint32_t)
14835typedef unsigned int MK_U32;
14836__parser__(type=ME_NU8_MK_U64:"8 byte 'unsigned wide' data-type":primary:uint64_t)
14837typedef unsigned long long MK_U64;
14838//__parser__(type=ME_NUX_MK_UXN:"min 8 byte 'unsigned long long' data-type":primary)
14839//typedef unsigned long long MK_UXN;
14840__parser__(type=ME_NUL_MK_ULN:"8 byte 'unsigned long' data-type":primary)
14841typedef unsigned long MK_ULN;
14843
14844// ----------------------------------------------------------------------------------
14845
14848
14850__parser__(type=ME_NF4_MK_FLT:"4 byte 'float' data-type":primary)
14851typedef float MK_FLT;
14853__parser__(type=ME_NF8_MK_DBL:"8 byte 'double' data-type":primary)
14854typedef double MK_DBL;
14855
14857
14858// ----------------------------------------------------------------------------------
14859
14863
14874__parser__(type=ME_NIH_MK_HDL:"handle data-type")
14875// also change: MqHigh_jv.c=jint
14876typedef int32_t MK_HDL;
14877#define MK_HDL_REF_S3(__prefix) __prefix ## NI4
14878#define MK_HDL_REF_S1(__prefix) __prefix ## I32
14879#define MK_HDLT MK_I32T
14880
14881// OLD: internal \b hdl used in uplevel-programming-language-shell to store a pointer:
14882// OLD: \li \e java uses \b jlong equal to \RMKNS{LONG}
14883// OLD: \li \e csharp uses \b IntPtr equal to \RMKNS{PTR}
14884// OLD: typedef MK_PTRB *MK_HDL;
14885
14887
14888// ----------------------------------------------------------------------------------
14889
14892
14893__parser__(type=ME_NIL_MK_SIZE:"long byte 'size' datay-type")
14894// choose "long" because it have to fit a pointer-diff (eg: ptr1-ptr2) without cast
14895typedef long MK_SIZE;
14897__parser__(type=ME_RUA_MkBufferAtomU:"atomic native data buffer type")
14898typedef union MkBufferAtomU MK_ATO;
14902__parser__(type=ME_NI4_MK_NUM)
14903typedef int32_t MK_NUM;
14904#define MK_FORMAT_N "%i"
14905
14907__parser__(type=ME_NI4_MK_DBG:"debug-level data-type")
14908typedef int MK_DBG;
14909
14968__parser__(type=ME_NU4_MK_SIG)
14969typedef unsigned int MK_SIG;
14970
14972
14973// ----------------------------------------------------------------------------------
14974
14978__parser__(type=ME_NIL_MK_TIME_T:"time [sec] data-type")
14979typedef time_t MK_TIME_T;
14980#define MK_FORMAT_TIME "%li"
14981#define MK_TIME ((MK_TIME_T)time(NULL))
14982#define MK_TIME_MAX (365*24*60*60)
14984
14985// ----------------------------------------------------------------------------------
14986
14989
14990// attention: "google go" can not uses nested typedef's -> use "#define" for the basic types
14991
14993__parser__(type=ME_PVB_MK_PTRB:"pointer type data-type")
14994typedef void MK_PTRB;
14995
14997__parser__(type=ME_PVX_MK_PTR:"generic pointer data-type":primary)
14998typedef MK_PTRB *MK_PTR;
15000__parser__(type=ME_PVN_MK_PTRN:"const generic pointer data-type":primary)
15001typedef const MK_PTRB *MK_PTRN;
15003__parser__(type=ME_PCX_MK_CCP:"class constructor/destructor data type")
15004typedef MK_PTRB *MK_CCP;
15006__parser__(type=ME_PAX_MK_CBP:"generic pointer to call-back data")
15007typedef MK_PTRB *MK_CBP;
15009__parser__(type=ME_CXC_MK_MNG:"managed object pointer; datatype will be checked at runtime")
15010typedef MK_PTRB *MK_MNG;
15012__parser__(type=ME_CXN_MK_MNGN:"const - a managed object pointer; datatype will be checked at runtime")
15013typedef const MK_PTRB *MK_MNGN;
15015__parser__(type=ME_PEX_MK_EXP:"target language exception-class-object")
15016typedef MK_PTRB const *MK_EXP;
15018__parser__(type=ME_CXC_MkExceptionC:"target language library-exception-class-object")
15019typedef MK_PTRB *MK_MXP;
15020
15022
15023// ----------------------------------------------------------------------------------
15024
15027
15029__parser__(type=ME_PLB_MK_LSTB:"list type data-type")
15030typedef unsigned char MK_LSTB;
15031
15033__parser__(type=ME_PLX_MK_LST:"list pointer data-type")
15034typedef MK_LSTB *MK_LST;
15035
15037
15038// ----------------------------------------------------------------------------------
15039
15042
15044__parser__(type=ME_PBB_MK_BINB:"byte-array type data-type")
15045typedef unsigned char MK_BINB;
15046
15048__parser__(type=ME_PBX_MK_BIN:"byte-array pointer data-type":primary)
15049typedef MK_BINB *MK_BIN;
15050
15052__parser__(type=ME_PBN_MK_BINN:"const byte-array pointer data-type":primary)
15053typedef MK_BINB const *MK_BINN;
15054
15056
15057// ----------------------------------------------------------------------------------
15058
15061
15063__parser__(type=ME_PSB_MK_STRB:"string type data-type")
15064typedef char MK_STRB;
15065
15067__parser__(type=ME_PSX_MK_STR:"string pointer data-type":primary)
15068typedef MK_STRB *MK_STR;
15069
15071__parser__(type=ME_PSN_MK_STRN:"constant string pointer data-type":primary)
15072typedef const MK_STRB *MK_STRN;
15073
15075__parser__(type=ME_ASN_MK_STRN_A:"ARRAY of MK_STRN")
15076typedef struct {
15077 MK_NUM size;
15078 MK_STRN *data;
15079} MK_STRN_A;
15080
15081__parser__(ignore)
15082MK_UNUSED const static MK_STRN_A MK_STRN_A_NULL = (MK_STRN_A) {0,0};
15083
15085__parser__(type=ME_PFX_MK_FST:"constant 'printf' format string")
15086typedef MK_STRB const *MK_FST;
15087
15089
15090// ----------------------------------------------------------------------------------
15091
15094__parser__(type=ME_PVX_MK_NAT_OBJECT:"target language object pointer")
15095typedef void* MK_NAT_OBJECT;
15096__parser__(type=ME_PVX_MK_NAT_LIST:"target language list pointer")
15097typedef void* MK_NAT_LIST;
15099
15100// ----------------------------------------------------------------------------------
15101
15103// MkKernel_Type_C_API
15104
15105/* MARK_C ********************************************************************/
15106/* */
15107/* class types */
15108/* */
15109/*****************************************************************************/
15110
15111// BEGIN-ShortDef - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
15112
15116 __parser__(type=ME_CCC_MkObjectC:"MkObjectC class handle":primary)
15117 typedef struct MkObjectS * MK_OBJ;
15119 __parser__(type=ME_CCN_MkObjectC:"const - MkObjectC class handle":primary)
15120 typedef const struct MkObjectS * MK_OBJN;
15122 __parser__(ignore)
15123 typedef struct MkObjectS MK_OBJR;
15125// MkObjectC_Class_C_API
15126
15130 __parser__(type=ME_CCC_MkBufferC:"MkBufferC class handle":primary)
15131 typedef struct MkBufferS * MK_BUF;
15133 __parser__(type=ME_CCN_MkBufferC:"const - MkBufferC class handle":primary)
15134 typedef const struct MkBufferS * MK_BUFN;
15136 __parser__(ignore)
15137 typedef struct MkBufferS MK_BUFR;
15139// MkBufferC_Class_C_API
15140
15144 __parser__(type=ME_CCC_MkBufferStreamC:"MkBufferStreamC class handle":primary)
15145 typedef struct MkBufferStreamS * MK_BUS;
15147 __parser__(type=ME_CCN_MkBufferStreamC:"const - MkBufferStreamC class handle":primary)
15148 typedef const struct MkBufferStreamS * MK_BUSN;
15150 __parser__(ignore)
15151 typedef struct MkBufferStreamS MK_BUSR;
15153// MkBufferStreamC_Class_C_API
15154
15158 __parser__(type=ME_CCC_MkBufferListC:"MkBufferListC class handle":primary)
15159 typedef struct MkBufferListS * MK_BFL;
15161 __parser__(type=ME_CCN_MkBufferListC:"const - MkBufferListC class handle":primary)
15162 typedef const struct MkBufferListS * MK_BFLN;
15164 __parser__(ignore)
15165 typedef struct MkBufferListS MK_BFLR;
15167// MkBufferListC_Class_C_API
15168
15172 __parser__(type=ME_CCC_MkLogFileC:"MkLogFileC class handle":primary)
15173 typedef struct MkLogFileS * MK_LFL;
15175 __parser__(type=ME_CCN_MkLogFileC:"const - MkLogFileC class handle":primary)
15176 typedef const struct MkLogFileS * MK_LFLN;
15178 __parser__(ignore)
15179 typedef struct MkLogFileS MK_LFLR;
15181// MkLogFileC_Class_C_API
15182
15186 __parser__(type=ME_CCC_MkErrorC:"MqErrorC class handle":primary)
15187 typedef struct MkErrorS * MK_ERR;
15189 __parser__(type=ME_CCN_MkErrorC:"const - MqErrorC class handle":primary)
15190 typedef const struct MkErrorS * MK_ERRN;
15192 __parser__(ignore)
15193 typedef struct MkErrorS MK_ERRR;
15195// MkErrorC_Class_C_API
15196
15200 __parser__(internal,type=ME_CCC_MkExtensionC:"abstract class for the extension technology":internal)
15201 typedef struct MkExtensionS * MK_EXT;
15203 __parser__(internal,type=ME_CCN_MkExtensionC:"const - abstract class for the extension technology":internal)
15204 typedef const struct MkExtensionS * MK_EXTN;
15206 __parser__(ignore)
15207 typedef struct MkExtensionS MK_EXTR;
15209// MkExtensionC_Class_C_API
15210
15214 __parser__(internal,type=ME_CCC_MkErrExtC:"final class for the MkErrorS extention technology":internal)
15215 typedef struct MkErrExtS * MK_ERREXT;
15217 __parser__(internal,type=ME_CCN_MkErrExtC:"const - final class for the MkErrorS extention technology":internal)
15218 typedef const struct MkErrExtS * MK_ERREXTN;
15220 __parser__(ignore)
15221 typedef struct MkErrExtS MK_ERREXTR;
15223// MkErrExtC_Class_C_API
15224
15228 __parser__(internal,type=ME_CCC_MkRtExtC:"final class for the MkRuntimeS extention technology":internal)
15229 typedef struct MkRtExtS * MK_RTEXT;
15231 __parser__(internal,type=ME_CCN_MkRtExtC:"const - final class for the MkRuntimeS extention technology":internal)
15232 typedef const struct MkRtExtS * MK_RTEXTN;
15234 __parser__(ignore)
15235 typedef struct MkRtExtS MK_RTEXTR;
15237// MkRtExtC_Class_C_API
15238
15242 __parser__(type=ME_CCC_MkRuntimeC:"runtime singleton class object":primary)
15243 typedef struct MkRuntimeS * MK_RT;
15245 __parser__(type=ME_CCN_MkRuntimeC:"const - runtime singleton class object":primary)
15246 typedef const struct MkRuntimeS * MK_RTN;
15248 __parser__(ignore)
15249 typedef struct MkRuntimeS MK_RTR;
15251// MkRuntimeC_Class_C_API
15252
15256 __parser__(internal,type=ME_CCC_MkTypeC:"a managed object class type !base! pointer":internal)
15257 typedef struct MkTypeS * MK_TYP;
15259 __parser__(internal,type=ME_CCN_MkTypeC:"const - a managed object class type !base! pointer":internal)
15260 typedef const struct MkTypeS * MK_TYPN;
15262 __parser__(ignore)
15263 typedef struct MkTypeS MK_TYPR;
15265// MkTypeC_Class_C_API
15266
15267// END-ShortDef - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
15268
15271__parser__(type=ME_CXC_MK_BAC:"a list of 'buffer' as last argument in function")
15272typedef struct MkBufferListS *MK_BAC;
15273
15276__parser__(type=ME_CXN_MK_BAC:"const - a list of 'buffer' as last argument in function")
15277typedef const struct MkBufferListS *MK_BACN;
15278
15279// --------------------------------------------------------------------
15280// binary
15281
15287
15288__parser__push__(hide);
15289
15293__parser__(reference)
15294typedef struct {
15295 MK_SIZE size;
15296 MK_BINN data;
15297} MkBinaryR;
15298
15301mk_inline MkBinaryR MkBinaryCreate ( MK_SIZE size, MK_BINN data ) {
15302 return (MkBinaryR) {size, data};
15303}
15304
15307mk_inline bool MkBinaryIsNull ( const MkBinaryR bin ) {
15308 return bin.data == NULL;
15309}
15310
15313mk_inline const MkBinaryR MkBinaryCreateSlice ( const MkBinaryR bin, MK_SIZE start, MK_SIZE wide ) {
15314 if (start>bin.size)
15315 return (const MkBinaryR) {0, NULL};
15316 else
15317 return (const MkBinaryR) {start+wide>bin.size?bin.size-start:wide, bin.data+start};
15318}
15319
15322mk_inline MkBinaryR MkBinaryDup_RT ( MK_PARSER_RT const MkBinaryR bin );
15323
15326mk_inline void MkBinaryLog_RT ( MK_PARSER_RT const MkBinaryR bin );
15327
15330mk_inline MK_BINN MkBinaryGetData ( const MkBinaryR bin ) {
15331 return bin.data;
15332}
15333
15336mk_inline MK_SIZE MkBinaryGetSize ( const MkBinaryR bin ) {
15337 return bin.size;
15338}
15339
15341
15343// MkKernel_Binary_C_API
15344
15350
15351__parser__push__(hide);
15352
15356// [MkStringR]
15357__parser__(reference)
15358typedef struct {
15359 MK_NUM len;
15360 MK_STRN ptr;
15361} MkStringR;
15362// [MkStringR]
15363
15366mk_inline void MkStringLog_RT ( MK_PARSER_RT MkStringR const str, MK_STRN func ) ;
15367
15370mk_inline MkStringR MkStringCreate ( MK_NUM len, MK_STRN str ) {
15371 return (MkStringR) {(len>0?len:(str?(MK_NUM)strlen(str):0)), str};
15372}
15373
15376mk_inline MkStringR MkStringCreate_1 ( MK_STRN str ) {
15377 return (MkStringR) {str?(MK_NUM)strlen(str):0, str};
15378}
15379
15389mk_inline MkStringR MkStringSlice ( MkStringR strR, MK_NUM start, MK_NUM len ) {
15390 if (len < 0) len = strR.len;
15391 if (start > strR.len) {
15392 return MkStringCreate(0,NULL);
15393 } else if ((start+len) > strR.len) {
15394 return MkStringCreate(strR.len-start,strR.ptr+start);
15395 } else {
15396 return MkStringCreate(len,strR.ptr+start);
15397 }
15398}
15399
15402mk_inline void MkStringSplit ( MkStringR strR, MK_NUM *len_out, MK_STRN *str_out ) {
15403 assert(len_out != NULL);
15404 assert(str_out != NULL);
15405 *len_out = strR.len; *str_out = strR.ptr;
15406}
15407
15410mk_inline MkStringR MkStringDup_RT ( MK_PARSER_RT MkStringR const str );
15411
15414mk_inline MK_STRN MkStringGetData ( MkStringR const str ) {
15415 return str.ptr;
15416}
15417
15420mk_inline MK_NUM MkStringGetSize ( MkStringR const str ) {
15421 return str.len;
15422}
15423
15431mk_inline bool MkStringIsNULL(MkStringR const strR) {
15432 return ((strR.ptr) && (strR.len) == MK_NULL_STR_LEN && strcmp((strR.ptr),MK_NULL_STR)==0);
15433}
15434
15436
15438// - MkKernel_String_C_API
15439
15440/*****************************************************************************/
15441/* */
15442/* enum definitions */
15443/* */
15444/*****************************************************************************/
15445
15448
15449__parser__push__(doc-group=Enum);
15450
15453
15460// [MkErrorE]
15461enum MkErrorE {
15462 MK_OK = 0,
15463 MK_CONTINUE = 1,
15464 MK_ERROR = 2,
15465};
15466// [MkErrorE]
15467
15468// BEGIN-MkErrorE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
15469
15472__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
15474
15477__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
15479mk_inline MK_I32 MkErrorE_ToInt ( enum MkErrorE value ) {
15480 return (MK_I32) value;
15481}
15482
15485__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc)
15486MK_EXTERN enum MkErrorE MkErrorE_FromInt ( MK_I32 const value, enum MkErrorE * value_out ) MK_ATTR_STATIC ;
15487
15488// END-MkErrorE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
15489
15490// additional attribute for MkErrorE_FromInt - this function return TWO errors 1) return and 2) the value_out
15491__parser__global__(MkErrorE_FromInt:error-ignore=2);
15492
15494// MkErrorE
15495
15498
15505// [MkTimeoutE]
15506__parser__(enum-accept-integer=long)
15507enum MkTimeoutE {
15513 MK_TIMEOUT_NORMAL = (META_TIMEOUT_REF/10 < 1 ? 1 : META_TIMEOUT_REF/10),
15518 MK_TIMEOUT_SOCKET = (META_TIMEOUT_REF/90 < 1 ? 1 : META_TIMEOUT_REF/90),
15522 MK_TIMEOUT_DEFAULT = -1,
15524 MK_TIMEOUT_USER = -2,
15526 MK_TIMEOUT_MAX = -3,
15527};
15528// [MkTimeoutE]
15529
15530// BEGIN-MkTimeoutE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
15531
15534__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
15536
15539__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
15541mk_inline MK_I32 MkTimeoutE_ToInt ( enum MkTimeoutE value ) {
15542 return (MK_I32) value;
15543}
15544
15547__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc)
15548MK_EXTERN enum MkErrorE MkTimeoutE_FromInt ( MK_I32 const value, enum MkTimeoutE * value_out ) MK_ATTR_STATIC ;
15549
15550// END-MkTimeoutE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
15551
15553
15556
15558__parser__(internal)
15559enum MkBoolE {
15560 MK_NO = 0,
15561 MK_YES = 1,
15562};
15563
15564// BEGIN-MkBoolE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
15565
15568__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
15570
15573__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
15575mk_inline MK_I32 MkBoolE_ToInt ( enum MkBoolE value ) {
15576 return (MK_I32) value;
15577}
15578
15581__parser__(internal,no-rpc,prefix=EnumFunc)
15582MK_EXTERN enum MkErrorE MkBoolE_FromInt ( MK_I32 const value, enum MkBoolE * value_out ) MK_ATTR_STATIC ;
15583
15584// END-MkBoolE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
15585
15587
15590
15595// [MkNativeIsE]
15596__parser__(internal)
15597enum MkNativeIsE {
15599 MK_NATIVE_IS_STRING = 'S',
15600 MK_NATIVE_IS_LITTLE = 'L',
15601 MK_NATIVE_IS_BIG = 'B',
15602};
15603// [MkNativeIsE]
15604
15605// BEGIN-MkNativeIsE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
15606
15609__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
15610MK_EXTERN MK_STRN MK_DECL MkNativeIsE_ToString ( enum MkNativeIsE value ) MK_ATTR_STATIC ;
15611
15614__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
15616mk_inline MK_I32 MkNativeIsE_ToInt ( enum MkNativeIsE value ) {
15617 return (MK_I32) value;
15618}
15619
15622__parser__(internal,no-rpc,prefix=EnumFunc)
15623MK_EXTERN enum MkErrorE MkNativeIsE_FromInt ( MK_I32 const value, enum MkNativeIsE * value_out ) MK_ATTR_STATIC ;
15624
15625// END-MkNativeIsE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
15626
15628// MkNativeIsE
15629
15632
15634#define MK_TYPE_IS_1_I8E (1<<0)
15635
15637#define MK_TYPE_IS_2_I8E (1<<1)
15638
15640#define MK_TYPE_IS_4_I8E (1<<2)
15641
15643#define MK_TYPE_IS_8_I8E (1<<3)
15644
15646#define MK_TYPE_IS_NATIVE ( MK_TYPE_IS_1_I8E | MK_TYPE_IS_2_I8E | \
15647 MK_TYPE_IS_4_I8E | MK_TYPE_IS_8_I8E )
15648
15650#define MK_TYPE_SHIFT 4
15651
15659// [MkTypeE]
15660enum MkTypeE {
15661 MK_I8T = ((1 << MK_TYPE_SHIFT) | MK_TYPE_IS_1_I8E ),
15662 MK_BOLT = ((2 << MK_TYPE_SHIFT) | MK_TYPE_IS_1_I8E ),
15663 MK_I16T = ((3 << MK_TYPE_SHIFT) | MK_TYPE_IS_2_I8E ),
15664 MK_I32T = ((4 << MK_TYPE_SHIFT) | MK_TYPE_IS_4_I8E ),
15665 MK_FLTT = ((5 << MK_TYPE_SHIFT) | MK_TYPE_IS_4_I8E ),
15666 MK_I64T = ((6 << MK_TYPE_SHIFT) | MK_TYPE_IS_8_I8E ),
15667 MK_DBLT = ((7 << MK_TYPE_SHIFT) | MK_TYPE_IS_8_I8E ),
15668 MK_BINT = ((8 << MK_TYPE_SHIFT) ),
15669 MK_STRT = ((9 << MK_TYPE_SHIFT) ),
15670 MK_LSTT = ((10 << MK_TYPE_SHIFT) ),
15671};
15672// [MkTypeE]
15673
15674// BEGIN-MkTypeE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
15675
15678__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
15680
15683__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
15685mk_inline MK_I32 MkTypeE_ToInt ( enum MkTypeE value ) {
15686 return (MK_I32) value;
15687}
15688
15691__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc)
15692MK_EXTERN enum MkErrorE MkTypeE_FromInt ( MK_I32 const value, enum MkTypeE * value_out ) MK_ATTR_STATIC ;
15693
15694// END-MkTypeE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
15695
15697// MkTypeE
15698
15700
15702// MkKernel_Enum_C_API
15703
15761
15763__parser__(ignore)
15764union MkBufferAtomU {
15765 MK_I8 I8;
15766 MK_BOL BOL;
15767 MK_I16 I16;
15768 MK_I32 I32;
15769 MK_FLT FLT;
15770 MK_I64 I64;
15771 MK_DBL DBL;
15772 MK_BINB B[8];
15773 MK_BINB B8[8];
15774 MK_BINB B4[4];
15775 MK_BINB B2[2];
15776 MK_BINB B1[1];
15777
15778#if defined(__cplusplus)
15779 MkBufferAtomU() : I64(0L) {};
15780 MkBufferAtomU(MK_I8 val) : I8(val) {};
15781 MkBufferAtomU(MK_BOL val) : BOL(val) {};
15782 MkBufferAtomU(MK_I16 val) : I16(val) {};
15783 MkBufferAtomU(MK_I32 val) : I32(val) {};
15784 MkBufferAtomU(MK_I64 val) : I64(val) {};
15785 MkBufferAtomU(MK_FLT val) : FLT(val) {};
15786 MkBufferAtomU(MK_DBL val) : DBL(val) {};
15787#endif
15788};
15789
15798__parser__(ignore)
15799union MkBufferU {
15800 MK_ATO *A;
15801 MK_BIN B;
15802 MK_STRN C;
15803 MK_STR S;
15804 MK_LST L;
15805};
15806
15809#define MkType_O MK_BOL
15810#define MkType_Y MK_I8
15811#define MkType_S MK_I16
15812#define MkType_I MK_I32
15813#define MkType_W MK_I64
15814#define MkType_F MK_FLT
15815#define MkType_D MK_DBL
15816#define MkType_C MK_STRN
15817#define MkType_B MK_BIN
15818#define MkType_U MK_BUF
15819#define MkType_L MK_BFL
15821
15823// MkKernel_PrimitiveType_C_API
15824
15844
15845
15846// =============================================================================================
15847
15850
15852typedef uintptr_t MK_IDNT;
15853
15854// also: theKernel/cs/libmkkernel.cs
15856__parser__(hide)
15857enum MkIdSE {
15858 MK_ID_UNUSED = 0,
15859 MK_ID_PROCESS = 1,
15860 MK_ID_THREAD = 2
15861};
15862
15863// BEGIN-MkIdSE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
15864
15867__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
15869
15872__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc,return-type-default-no)
15874mk_inline MK_I32 MkIdSE_ToInt ( enum MkIdSE value ) {
15875 return (MK_I32) value;
15876}
15877
15880__parser__(doc-group=Enum,doc-index=_ignore_,class=MkKernel,no-rpc,prefix=EnumFunc)
15881MK_EXTERN enum MkErrorE MkIdSE_FromInt ( MK_I32 const value, enum MkIdSE * value_out ) MK_ATTR_STATIC ;
15882
15883// END-MkIdSE - created by 'c_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
15884
15885// also: theKernel/cs/libmkkernel.cs
15892__parser__(hide)
15893struct MkIdS {
15894 enum MkIdSE type;
15895 MK_IDNT val;
15896 bool ioIsPipe;
15897 bool setByExtern;
15898};
15899
15901
15902/*****************************************************************************/
15903/* */
15904/* cache */
15905/* */
15906/*****************************************************************************/
15907
15911
15912__parser__(ignore)
15913typedef MK_PTR ( *MkCacheCF) ( MK_RT_ARGS MK_PTR const);
15914__parser__(ignore)
15915typedef void ( *MkCacheDF) ( MK_RT_ARGS MK_PTR * const);
15916
15918__parser__(ignore)
15919struct MkCacheItemS {
15920 #define MkCacheItemS_signature 0x44196912
15921 MK_SIG signature;
15922 bool doFree;
15923 struct MkCacheItemS * prev;
15924 struct MkCacheItemS * next;
15925 MK_PTR data;
15926};
15927
15935__parser__(ignore)
15936struct MkCacheS {
15937 MK_RT runtime;
15938#define MkCacheS_name_size 32
15940 struct MkCacheItemS * used;
15941 struct MkCacheItemS * free_first;
15942 struct MkCacheItemS * free_last;
15943 MkCacheCF createF;
15944 MkCacheDF deleteF;
15945 MK_PTR createD;
15946 MK_NUM num;
15947
15948#define MkCacheS_MkCacheItemS_size 8
15949 struct MkCacheItemS MkCacheItemS_A[MkCacheS_MkCacheItemS_size];
15950 MK_NUM MkCacheItemS_N;
15951};
15952
15954// MkKernel_Cache_C_API
15955
15958__parser__(flags=public-internal)
15959typedef void ( MK_DECL *MkMarkF ) ( MK_RT_ARGS MK_PTR data );
15960
15961/*****************************************************************************/
15962/* */
15963/* create / delete */
15964/* */
15965/*****************************************************************************/
15966
16036__parser__push__(no-rpc,template-overload,doc-group=libmkkernel,doc-index=Setup,prefix=Setup);
16037
16050#ifndef META_COMPILE_AS_CC
16051__attribute__ ((constructor(200)))
16052#endif
16053__parser__(no-inline)
16054MK_EXTERN void MK_DECL MkSetup (void) MK_ATTR_STATIC ;
16055
16058
16070#ifndef META_COMPILE_AS_CC
16071__attribute__ ((destructor(200)))
16072#endif
16073__parser__(no-inline)
16074MK_EXTERN void MK_DECL MkCleanup (void) MK_ATTR_STATIC ;
16075
16077__parser__(ignore)
16078MK_EXTERN_DATA bool MkCleanupActive;
16079
16080__parser__(internal)
16081MK_EXTERN bool MK_DECL MkHasThread (void);
16082
16083__parser__(internal)
16084MK_EXTERN bool MK_DECL MkHasFork (void);
16085
16087
16089
16090/* ####################################################################### */
16091/* ### ### */
16092/* ### S Y S T E M - A P I ### */
16093/* ### ### */
16094/* ####################################################################### */
16095
16096// MkObjectC_Sys_C_API: hide all ^MkSys
16097__parser__global__(hide-rx=^MkSys);
16098// MkObjectC_Sys_C_API: default class for MkSys is MkObjectC
16099__parser__global__(prefix2class:MkSys=MkObjectC);
16100
16113
16114__parser__push__(internal); // \{ internal
16115
16119typedef MK_PTR (*MkSysCallocF) (size_t, size_t) __attribute__ ((alloc_size (1, 2)));
16120
16124typedef MK_PTR (*MkSysMallocF) (size_t) __attribute__ ((alloc_size (1)));
16125
16129typedef MK_STR (*MkSysStrDupF) (MK_STRN);
16130
16134typedef MK_STR (*MkSysStrNCpyF) (char*,const char*,size_t);
16135
16139typedef MK_STR (*MkSysStrNDupF) (MK_STRN, size_t) __attribute__ ((alloc_size (2)));
16140
16144typedef MK_PTR (*MkSysReallocF) (MK_PTR, size_t);
16145
16149typedef void (*MkSysFreeF) (MK_PTR);
16150
16155typedef pid_t (*MkSysForkF) (void);
16156
16160typedef enum MkErrorE (*MkSysWaitF) (
16161 MK_OBJN const fmtobj,
16162 MK_IDNT const id
16163);
16164
16175typedef int (*MkSysExitF) (
16177 int isThread,
16178 int num
16179);
16180
16181/*
16185typedef void (*MkSysAbortF) (
16186 MK_RT_ARGS
16187 int isThread,
16188 int num
16189) MK_NO_RETURN;
16190*/
16191
16193__parser__(ignore)
16194struct MkLalS {
16196 MkSysCallocF SysCalloc;
16198 MkSysMallocF SysMalloc;
16200 MkSysReallocF SysRealloc;
16202 MkSysStrNDupF SysStrNDup;
16204 MkSysStrDupF SysStrDup;
16206 MkSysStrNCpyF SysStrNCpy;
16208 MkSysFreeF SysFree;
16210 MkSysForkF SysFork;
16211 MK_PTR SysForkData;
16213 MkSysWaitF MkSysWaitForProcessCB;
16215 MkSysWaitF MkSysWaitForThreadCB;
16216
16225 enum MkErrorE (*SysUSleep) (
16226 MK_OBJN const obj,
16227 unsigned int const usec
16228 );
16237 enum MkErrorE (*SysSleep) (
16238 MK_OBJN const obj,
16239 unsigned int const sec
16240 );
16253 enum MkErrorE (*SysDaemonize) (
16255 MK_OBJN const obj,
16256 MK_STRN pidfile
16257 );
16259 MkSysExitF MkSysExitCB;
16260
16270 void (*SysAbort) (
16271 void
16272 ) MK_NO_RETURN;
16273
16274 enum MkErrorE (*SysIgnorSIGCHLD) (
16276 MK_OBJ const obj
16277 );
16278
16279 enum MkErrorE (*SysAllowSIGCHLD) (
16281 MK_OBJ const obj
16282 );
16283};
16284
16286__parser__(ignore)
16287MK_EXTERN_DATA struct MkLalS MkLal;
16288
16295__attribute__ ((alloc_size (2, 3)))
16296__parser__(internal)
16297MK_EXTERN MK_PTR MK_DECL MkSysCalloc (
16299 size_t const nmemb,
16300 size_t const size
16301);
16302
16308__attribute__ ((alloc_size (2)))
16309__parser__(internal)
16310MK_EXTERN MK_PTR MK_DECL MkSysMalloc (
16312 size_t const size
16313);
16314
16320MK_EXTERN MK_STR MK_DECL MkSysStrDup (
16322 MK_STRN const str
16323);
16324
16331__parser__(internal)
16332MK_EXTERN MK_STR MK_DECL MkSysStrNDup (
16334 MK_STRN const str,
16335 MK_SIZE const len
16336);
16337
16345MK_EXTERN enum MkErrorE MK_DECL MkSysStrNCpy (
16347 MK_STR const to,
16348 MK_STRN const from,
16349 MK_SIZE const len
16350);
16351
16352
16359__attribute__ ((alloc_size (3)))
16360__parser__(internal)
16361MK_EXTERN MK_PTR MK_DECL MkSysRealloc (
16363 MK_PTR const buf,
16364 size_t const size
16365);
16366
16376__parser__(internal)
16377MK_EXTERN MK_PTR MK_DECL MkSysReCalloc (
16379 MK_PTR const buf,
16380 MK_NUM const oldnum,
16381 MK_NUM const addnum,
16382 size_t const size
16383);
16384
16391__parser__(internal)
16392MK_EXTERN MK_PTR MK_DECL MkSysMemDup (
16394 MK_PTRN const blck,
16395 size_t const size
16396);
16397
16403__parser__(internal)
16404MK_EXTERN MK_STRN_A MK_DECL MkSysStringArrayDup (
16406 MK_STRN_A const strA
16407);
16408
16413__parser__(internal) void MkSysFree (MK_PTR pointer);
16414#define MkSysFree(pointer) \
16415 do { \
16416 if ( likely((pointer) != (NULL)) ) { \
16417 (*MkLal.SysFree)((MK_PTR)pointer); \
16418 (pointer) = (NULL); \
16419 } \
16420 } while (0)
16421
16422__parser__(internal) void MkSysFreeNonNull (MK_PTR pointer);
16423#define MkSysFreeNonNull(pointer) (*MkLal.SysFree)((MK_PTR)pointer)
16424
16430 MK_PTR data
16431);
16432
16456 MK_I32 const debug __parser__(default=0),
16457 MK_STRN const callfunc __parser__(default=F#FUNC),
16458 MK_I32 const lvl __parser__(default=0),
16459 MK_I32 skip __parser__(default=0),
16460 MK_I32 const num __parser__(default=-1)
16462
16470MK_EXTERN void MK_DECL MkSysPrintProcessMemoryMap_RT (
16473 MK_I32 const debug __parser__(default=0),
16474 MK_STRN const callfunc __parser__(default=F#FUNC),
16475 MK_I32 const lvl __parser__(default=0)
16477
16482 MK_I32 const debug __parser__(default=0),
16483 MK_STRN const callfunc __parser__(default=F#FUNC),
16484 MK_I32 const lvl __parser__(default=0),
16485 MK_I32 skip __parser__(default=0),
16486 MK_I32 const num __parser__(default=-1)
16488
16493__parser__(internal)
16494mk_inline enum MkErrorE MkSysWaitForProcess (
16496 MK_IDNT const id
16497) {
16498 return (*MkLal.MkSysWaitForProcessCB)(fmtobj, id);
16499};
16500
16505__parser__(internal)
16508 MK_IDNT const id
16509) {
16510 return (*MkLal.MkSysWaitForThreadCB)(fmtobj, id);
16511};
16512
16517__parser__(internal)
16520 useconds_t const usec
16521) {
16522 return (*MkLal.SysUSleep)(fmtobj, usec);
16523};
16524
16531 MK_I32 const sec
16532) {
16533 return (*MkLal.SysSleep)(fmtobj, (unsigned int)sec);
16534};
16535
16552 int isThread,
16553 int num
16554) {
16555 if (*MkLal.MkSysExitCB) {
16556 return (*MkLal.MkSysExitCB)(MK_RT_CALL isThread,num);
16557 } else {
16558 return num;
16559 }
16561
16576// [MkSysBasename-example]
16579 MK_STRN const pathName,
16580 bool const includeExtension
16582// [MkSysBasename-example]
16583
16598 MK_STRN const pathName
16600
16614 MK_STRN const format,
16615 ...
16617
16624__parser__(internal)
16625MK_EXTERN enum MkErrorE MK_DECL MkSysGetTimeOfDay (
16627 struct mk_timeval * tv_out,
16628 struct mk_timezone * tz_out
16629);
16630
16632__parser__(internal,macro) bool MkSysStringSetNULL_R (MK_STRN const str);
16633#define MkSysStringSetNULL_R(_str) _str[0] = '\0'
16634
16636__parser__(internal,macro) bool MkSysStringSet_R (MK_STRN const str, MK_STRN const other);
16637#define MkSysStringSet_R(_str,_val) strcpy(_str,_val)
16638
16640__parser__(internal,macro) bool MkSysStringIsNULL_R (MK_STRN const str);
16641#define MkSysStringIsNULL_R(_str) (_str[0] == '\0')
16642
16644mk_inline bool MkSysStringIsNULL (MK_STRN str) {
16645 return (str == NULL || MkSysStringIsNULL_R(str));
16646};
16647
16649mk_inline bool MkSysStringIsNotNULL (MK_STRN str) {
16650 return (str != NULL && *str != '\0');
16651};
16652
16654__parser__(internal,macro) bool MkSysStringIsEQUAL (MK_STRN const str, MK_STRN const other);
16655#define MkSysStringIsEQUAL(_str,_other) (strcmp(_str,_other) == 0)
16656
16658__parser__(internal,macro) bool MkSysStringIsLenEQUAL (MK_STRN const str, MK_STRN const other, MK_SIZE const len);
16659#define MkSysStringIsLenEQUAL(_str,_other,_len) (strncmp(_str,_other,(size_t)_len) == 0)
16660
16662mk_inline MK_STRN MkSysStringGet (MK_STRN str) {
16663 return MkSysStringIsNULL(str) ? NULL : str;
16664};
16665
16668 return str == NULL ? "" : str;
16669};
16670
16671__parser__pop__; // internal \}
16672
16712__parser__(keep,doc-no)
16714 MK_STRN key,
16715 MK_NUM length __parser__(default=-1)
16717
16719__parser__(keep,doc-no)
16720MK_EXTERN MK_I32 MK_DECL MkSysHashI32 (
16721 MK_STRN key,
16722 MK_NUM length __parser__(default=-1)
16724
16731__parser__(keep,doc-no)
16732MK_EXTERN enum MkErrorE MK_DECL MkSysKill (
16734 MK_I32 pid,
16735 MK_I32 signal
16737
16743__parser__(keep,doc-no)
16744MK_EXTERN enum MkErrorE MK_DECL MkSysGetPid (
16746 MK_I32 * pid_out
16748
16749__parser__(ignore)
16750typedef enum MkSysPipeHandlerE {
16751 MK_PIPE_KEEP = 0,
16752 MK_PIPE_IGNORE = 1
16754
16757__parser__(ignore)
16759 MkSysPipeHandlerE keepPipe
16761
16763// MkObjectC_Sys_C_API
16764
16847/* ####################################################################### */
16848/* ### ### */
16849/* ### O B J E C T - A P I ### */
16850/* ### ### */
16851/* ####################################################################### */
16852
16886__parser__global__(hide-rx=^Mk\w+Check\M);
16887__parser__global__(hide-rx=^MkObj[A-Z]);
16888__parser__global__(prefix2class:MkObj=MkObjectC);
16889
16892
16893 // TODO !! IMPORTANT INFO ABOUT CHECK !!
16894 // "MqCtxCheck(context)..." check of "context" create "MkDisasterEvent" after "fDecrSelf" etc…
16895 // Problem in PERL (and propably other too) after "fDecrSelf" the "context" becomes INVALID.
16896 // There are TWO phases of INVALID:
16897 // 1. INVALID but still readable -> "MqCtxCheck" works
16898 // 2. INVALID but NOT readable -> "MqCtxCheck" create "MkDisasterEvent"
16899 // It seems that "2." becomes more likely as "context" becomes bigger. "context" becomes bigger
16900 // if more prealloc space is used in "context". seems that if all references to ACTIVE memory is
16901 // gone an entire memory-page becomes "2." -> with other words:
16902 // -> It is not guaranteed that the "MqCtxCheck" technology will work.
16903
16904#define __MkCheckTO(t,o) (((*o).signature & (*t).objmask) == (*t).objsig)
16905#define _MkCheckTO(t,o) ((o) && __MkCheckTO((t),(o)))
16906#define __MkCheckO(cls,o) (((*o).signature & cls##_MASK) == cls##_SIGNATURE)
16907#define _MkCheckO(cls,o) ((o) && __MkCheckO(cls,(o)))
16908#define __MkCheckX(cls,x) __MkCheckO(cls,(cls##_X2obj(x)))
16909#define _MkCheckX(cls,x) ((x) && __MkCheckO(cls,(cls##_X2obj(x))))
16910#define __MkCheckM(cls,m) __MkCheckO(cls,((MK_OBJ)(m)))
16911#define _MkCheckM(cls,m) ((m) && __MkCheckM(cls,m))
16912
16913#define MkCheckNN(cls,x) __MkCheckO(cls,(cls##_X2obj(x)))
16914
16915#ifdef __SANITIZE_ADDRESS__
16916 //#define MkSanitizeCheck(_root,_m) _root##_Check(_m)
16917 #define MkSanitizeCheck(_root,_m) _MkCheckM(_root,_m)
16918 #define MkSanitizeCheckO(_root,_o) _MkCheckO(_root,_o)
16919#else
16920 #define MkSanitizeCheck(_root,_m) _MkCheckM(_root,_m)
16921 #define MkSanitizeCheckO(_root,_o) _MkCheckO(_root,_o)
16922#endif
16923
16926#define MkAssertO(cls,o) assert(o==NULL?true:__MkCheckO(cls,o)) // NULL == true
16927#define MkAssertX(cls,x) assert(x==NULL?true:__MkCheckX(cls,o)) // NULL == true
16929
16931#ifdef NDEBUG
16932# define MkAssertCastM(cls,m) ((cls##_type)(m))
16933#else
16934# define MkAssertCastM(cls,m) ((cls##_type)(({MK_OBJ o=(MK_OBJ)(m);MkAssertO(cls,o);o;})))
16935#endif
16936
16937#define toTT(_type) (MkTYP(_type))
16938
16940
16942#define MK_NULL_SIGNATURE 0
16943
16946struct MkObjectProtectS {
16957 bool isLocal;
16958
16959 MK_OBJ prev;
16960 MK_OBJ next;
16961};
16962
16963#define MkDbgObjInstancesO_2(o,c) \
16964do { \
16965 if (o) { \
16966 mk_dbg_color_ln(c,"MkDbgObjInstances: %s[%p] prev<%p>, next<%p>, var<" #o ">", \
16967 (o)->type->type_name, o, (o)->obj_protect.prev, (o)->obj_protect.next); \
16968 } else { \
16969 mk_dbg_color_ln(c,"MkDbgObjInstances: %s[NULL] var<" #o ">", "unknown"); \
16970 } \
16971} while (0)
16972#define MkDbgObjInstancesX_2(x,c) MkDbgObjInstancesO_2(MkOBJ(x),c)
16973#define MkDbgObjInstancesX(x) MkDbgObjInstancesX_2(x,MK_COLOR_CYAN)
16974#define MkDbgObjInstancesO(o) MkDbgObjInstancesO_2(o,MK_COLOR_CYAN)
16975
16976#if META_DEBUG & META_DEBUG_REFCOUNT
16977
16978 __attribute__ ((visibility("default"))) void
16979 MkDbgDeepWriter(void* mng,const char* ident, const char* func, const char* fmt,...);
16980
16981#else
16982
16983 #define MkDbgDeepWriter(...)
16984
16985#endif
16986
16987#define MkDbgDeepX_4(m,ident,func,fmt,...) MkDbgDeepWriter(m, ident, func, fmt, __VA_ARGS__)
16988#define MkDbgDeepX_3(m,ident,fmt,...) MkDbgDeepX_4(m,ident,__func__,fmt,__VA_ARGS__)
16989#define MkDbgDeepX_2(m,ident) MkDbgDeepX_4(m,ident,__func__,NULL,NULL)
16990
16992struct MkObjectS {
16994 MK_SIG signature;
16996 MK_HDL netHdl;
16998 MK_I32 refCount;
17000 MK_PTR self;
17002 MK_TYP type;
17006 MK_PTR env;
17007
17009 //bool onDelete;
17010
17014 bool deleteCallbackCalled;
17015
17019 bool selfCreated;
17020
17021#if defined(META_USE_SELF_REFCOUNT)
17030 MK_I32 selfRefCount;
17031#endif
17032
17034 MK_RT objRt;
17035
17037 MK_RTEXT objRtExt;
17038
17041 struct MkObjectProtectS obj_protect;
17042
17043 // attention !!
17044 // an additional "attribute" have to be initialized in: MkObjInit
17045 // also update : theKernel/cs/libmkkernel.cs
17046};
17047
17048// BEGIN-MkObjectS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
17049
17053 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
17054
17055// Signature --------------------------------------------------------------
17058
17059 #define MkObjectC_SIGNATURE (0x59B3u<<16)
17060 #define MkObjectC_MASK (((1u<<16)-1)<<16)
17061
17063
17064// CompileTimeCast --------------------------------------------------------------
17067
17068 #define MkObjectC_X2obj(x) (x)
17069
17071
17072// TypeDef --------------------------------------------------------------
17075
17077 __parser__(ignore) typedef struct MkObjectS MkObjectCR;
17079 __parser__(ignore) typedef const struct MkObjectS MkObjectCNR;
17081 #define MkObjectC_T (&MK_RT_REF._MkObjectC_T)
17083 #define MkObjectC_TT (MkTYP(MkObjectC_T))
17085 #define MkObjectST MkObjectC_T
17087 #define MkObjectSTT (MkTYP(MkObjectST))
17089 #define MkObjectC_type MK_OBJ
17091 #define MkObjectCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
17093 #define MkObjectCTT_X(instance) (MkOBJ_R(instance).type)
17095 #define MkObjectCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
17097 #define MkObjectC_NS MK
17099 #define MkObjectCTT MkObjectCTT
17101 #define MkObjectCT ( (struct MkTypeDefS *) MkObjectCTT )
17102
17104
17105// TypeCheck --------------------------------------------------------------
17108
17109 #pragma GCC diagnostic push
17110 #pragma GCC diagnostic ignored "-Wattributes"
17111
17114 __parser__(class=MkObjectC,static,hide)
17116 mk_inline bool MkObjCheck (MK_MNGN mng) {
17117 return MkSanitizeCheck(MkObjectC,mng);
17118 }
17119
17122 __parser__(class=MkObjectC,static,hide)
17124 mk_inline bool MkObjCheckO (MK_OBJN obj) {
17125 return MkSanitizeCheckO(MkObjectC,obj);
17126 }
17127
17128 #pragma GCC diagnostic pop
17129 #define MkObjectC_Check(mng) MkObjCheck(mng)
17130
17132
17133// RunTimeCast --------------------------------------------------------------
17136
17138 __parser__(class=MkObjectC,hide,static)
17139 META_ATTRIBUTE_SANITIZE
17141 mk_inline MK_OBJ MkObj(MK_MNG mng) {
17142 return (MkObjCheck(mng) ? (MK_OBJ)mng : NULL);
17143 }
17144
17146 __parser__(class=MkObjectC,hide,static)
17147 META_ATTRIBUTE_SANITIZE
17149 mk_inline MK_OBJN MkObjN(MK_MNGN mng) {
17150 return (MkObjCheck(mng) ? (MK_OBJN)mng : NULL);
17151 }
17152
17154 #define MkObjRaise(_obj) if (!_MkCheckX(MkObjectC,_obj)) { \
17155 MkErrorSetC_1E("'MkObjectC' hdl is NULL"); \
17156 goto error ; \
17157 }
17158
17160 #define MkOBJ_R(x) (*(x)).super.obj
17162 #define MkOBJ(x) (&MkOBJ_R(x))
17163
17165
17168// MkObjectC_Class_Define_C_API
17169
17170// END-MkObjectS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
17171
17172// =========================================================================
17173// OVERLOAD
17174
17177
17180__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkObjectC,no-rpc);
17181
17189
17191mk_inline MK_HDL MK_DECL MkObjectHandleGetOfType ( MK_OBJ const obj ) {
17192 return ((MK_HDL)obj->signature);
17193}
17194
17195#define MkObjectHandleGetOfType_1X(x) MkObjectHandleGetOfType(MkOBJ(x))
17196
17202 MK_OBJ const obj __parser__(null-allowed)
17204
17213 MK_OBJ const obj __parser__(null-allowed)
17215
17217
17220
17221// =========================================================================
17222// BEGIN-MkObjectS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
17223
17226
17229
17230__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkObjectC);
17231
17249 MK_OBJ const obj __parser__(null-allowed)
17251
17252#define MkObjectHandleGet_1X(x) MkObjectHandleGet(x?MkOBJ(x):NULL)
17253
17264 MK_HDL const netHdl
17266
17276#define MkObjectHandleResolve_e(netHdl) ({ \
17277 MK_HDL tmpHdl=netHdl; \
17278 MK_OBJ tmp; \
17279 if (tmpHdl==0) { \
17280 tmp=NULL; \
17281 } else { \
17282 tmp=MkObjectHandleResolve(tmpHdl); \
17283 if (tmp==NULL) { \
17284 MkErrorSetC_1_NULL("ERROR: 'MkObjectC' handle is 'NULL'"); \
17285 goto error; \
17286 }; \
17287 }; \
17288 tmp; \
17289})
17290
17295 MK_HDL const netHdl
17296);
17297
17302 MK_OBJ const netObj
17303);
17304
17306
17308// Class export & import
17309
17313 __parser__(doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkObjectC,null-return-allow)
17316 return (MK_OBJ)MK_NULL;
17317 }
17319// MkObjectC - Misc - function
17320
17322// MkObjectC_Class_C_API
17323
17324// END-MkObjectS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
17325
17328typedef MK_OBJ (*MkConstructorF) ( MK_RT_ARGS MK_TYP type, MK_PTR nat, MK_PTR lnk);
17329typedef void (*MkDestructorF) ( MK_RT_ARGS MK_OBJ const obj);
17330typedef MK_OBJ (*MkDupF) ( MK_RT_ARGS MK_OBJN const obj);
17331typedef MK_OBJ (*MkDup2F) ( MK_RT_ARGS MK_OBJN const obj, MK_STRN const ident);
17332typedef MK_OBJ (*MkMergeF) ( MK_RT_ARGS MK_OBJ const obj);
17333typedef MK_OBJ (*MkCopyF) ( MK_RT_ARGS MK_OBJ const obj, MK_OBJN const src);
17334typedef MK_OBJ (*MkResetF) ( MK_RT_ARGS MK_OBJ const obj);
17335__parser__(flags=public-internal)
17336typedef MK_PTR (*MkSelfCreateF) ( MK_RT_ARGS MK_OBJ const obj, MK_PTR const env);
17337__parser__(flags=public-internal)
17338typedef void (*MkSelfDeleteF) ( MK_RT_ARGS MK_PTR self, MK_PTR const env);
17339__parser__(flags=public-internal)
17340typedef void (*MkSelfUnlinkF) ( MK_RT_ARGS MK_PTR self, MK_PTR const env);
17341typedef void (*MkLogF) ( MK_RT_ARGS MK_OBJN const obj, MK_OBJN fmt, MK_DBG const debug,
17342 MK_STRN const callfunc, MK_I32 const lvl);
17343typedef MK_STRN (*MkToStringF) ( MK_RT_ARGS MK_OBJN const obj);
17344typedef MK_PTR (*MkAllocCreateFLT) ( MK_RT_ARGS MK_TYP const type);
17345typedef void (*MkAllocDeleteF) ( MK_RT_ARGS MK_TYP const type, MK_PTR ptr);
17346typedef void (*MkTypeInitF) ( MK_RT_ARGS MK_TYP const type);
17347typedef bool (*MkLogFormatF) ( MK_RT_ARGS char* header, MK_SIZE const headerSize, MK_OBJN const obj,
17348 MK_STRN const caller, MK_I32 const debug, MK_STRN const fmt);
17350
17362__parser__(ignore)
17363struct MkAllocDefS {
17364 MK_PTR alloc_data;
17365 MkAllocCreateFLT alloc_createF;
17366 MkAllocDeleteF alloc_deleteF;
17367};
17368
17369
17371// MkObjectC_C_API
17372
17373/* ####################################################################### */
17374/* ### ### */
17375/* ### T Y P E - A P I ### */
17376/* ### ### */
17377/* ####################################################################### */
17378
17516#define MkDbgTyp2(t,c) \
17517 mk_dbg_color_ln(c,"MkDbgTyp[%-32s]: typ<ID=%-2d,P=%-14p,RT=%p> type_class<%s:%p>, " #t, \
17518 MK_TRIM_LEFT(32,(t)->type_name), (t)->type_id, t, MkRT_X(t), \
17519 (t)->type_class->type_name, (t)->type_class)
17520#define MkDbgTyp(t) MkDbgTyp2(t,MK_COLOR_LIGHT_CYAN)
17521#define MkDbgTypListAll2(t,c) do { \
17522 MK_OBJ o; \
17523 MkRuntimeLogBufferPush(); \
17524 DL_FOREACH2((t)->type_class->instancesR,o,obj_protect.next) { \
17525 MkDbgTyp2(MkTyp(o),c); \
17526 } \
17527 MkRuntimeLogBufferPop(); \
17528} while (0)
17529#define MkDbgTypListAll(t) MkDbgTypListAll2(t,MK_COLOR_GREEN)
17530
17531#define MkDbgTypInstances_2(t,c) \
17532do { \
17533 MK_TYP _typ = (t); \
17534 if (_typ) { \
17535 mk_dbg_start_2(c,"MkDbgTypInstances: %s[%p] ", _typ->type_name, _typ); \
17536 int max=5; \
17537 for (MK_OBJ obj=MkTypeInstances(_typ); obj; obj=MkObjectNext(obj)) { \
17538 mk_dbg_next_2(c,"%p,",obj); \
17539 max--; \
17540 if(max==0) { \
17541 mk_dbg_next_2(MK_COLOR_RED,"%s", "break"); \
17542 break; \
17543 } \
17544 } \
17545 mk_dbg_end(); \
17546 } else { \
17547 mk_dbg_color_ln(c,"MkDbgTypInstances: %s[%p] ", #t, _typ); \
17548 } \
17549} while (0)
17550
17551#define MkDbgTypInstances(t) MkDbgTypInstances_2(t,MK_COLOR_CYAN)
17552
17553
17555__parser__(internal)
17556struct MkTypeS {
17557 // BEGIN-MkTypeS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
17558
17559 union {
17560 struct MkObjectS obj; // instance-base MkObjectS
17561 } super;
17562
17563 // END-MkTypeS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
17564
17565 // instance attributes
17566 #define MkTypeS_name_size 32
17567 MK_STRB type_name[MkTypeS_name_size];
17568 MK_SIG objsig;
17569 MK_SIG objmask;
17570 bool noSelf;
17571 MK_TYP type_base;
17572 size_t objsize;
17573 size_t typsize;
17574
17575 MK_I32 type_id;
17576 MkTypeInitF type_init;
17577
17578 // slots
17579 MkToStringF toString;
17580 MkLogF log;
17581 MkConstructorF constructor;
17582 MkDestructorF destructor;
17583 MkDupF dup;
17584 MkDup2F dup2;
17585 MkMergeF merge;
17586 MkCopyF copy;
17587 MkResetF reset;
17588 MkSelfCreateF selfCreate;
17589 MkSelfDeleteF selfDelete;
17590 MkSelfUnlinkF selfUnlink;
17591 MkLogFormatF fLogFormat;
17592
17593 MK_I32 delCbCnt;
17594
17595 struct MkAllocDefS objalloc;
17596 MK_OBJ instancesR;
17603 MK_TYP type_class;
17604};
17605
17606// BEGIN-MkTypeS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
17607
17611 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
17612
17613// Signature --------------------------------------------------------------
17616
17617 #define MkTypeC_SIGNATURE (MkObjectC_SIGNATURE ^ (11u<<10))
17618 #define MkTypeC_MASK (((1u<<22)-1)<<10)
17619
17621
17622// CompileTimeCast --------------------------------------------------------------
17625
17626 #define MkTypeC_X2typ(x) (x)
17627 #define MkTypeC_X2obj(x) MkOBJ(x)
17628
17630
17631// TypeDef --------------------------------------------------------------
17634
17636 __parser__(ignore) typedef struct MkTypeS MkTypeCR;
17638 __parser__(ignore) typedef const struct MkTypeS MkTypeCNR;
17640 #define MkTypeSTT (&MK_RT_REF._MkTypeC_TT)
17642 #define MkTypeC_TT (&MK_RT_REF._MkTypeC_TT)
17644 #define MkTypeC_type MK_TYP
17646 #define MkTypeCT_X(instance) ( (struct MkTypeS *) (MkOBJ_R(instance).type) )
17648 #define MkTypeCTT_X(instance) (MkOBJ_R(instance).type)
17650 #define MkTypeCT_TT(typ) ( (struct MkTypeS *) (typ) )
17652 #define MkTypeC_NS MK
17654 #define MkTypeCTT MkTypeCTT
17656 #define MkTypeCT ( (struct MkTypeS *) MkTypeCTT )
17657
17659
17660// TypeCheck --------------------------------------------------------------
17663
17664 #pragma GCC diagnostic push
17665 #pragma GCC diagnostic ignored "-Wattributes"
17666
17669 __parser__(class=MkTypeC,static,ignore)
17671 mk_inline bool MkTypCheck (MK_MNGN mng) {
17672 return MkSanitizeCheck(MkTypeC,mng);
17673 }
17674
17677 __parser__(class=MkTypeC,static,ignore)
17679 mk_inline bool MkTypCheckO (MK_OBJN obj) {
17680 return MkSanitizeCheckO(MkTypeC,obj);
17681 }
17682
17683 #pragma GCC diagnostic pop
17684 #define MkTypeC_Check(mng) MkTypCheck(mng)
17685
17687
17690// MkTypeC_Class_Define_C_API
17691
17692// END-MkTypeS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
17693
17695__parser__(class=MkObjectC,internal,static)
17696mk_inline MK_TYP MkTyp(const MK_MNG mng) {
17697 if (!MkObjCheck(mng)) return NULL;
17698 MK_OBJ obj = (MK_OBJ) mng;
17699 if (MkTypCheck(obj)) return (MK_TYP)obj;
17700 MK_TYP typ = obj->type;
17701 if (MkTypCheck(typ)) return typ;
17702 return NULL;
17703}
17704
17706__parser__(ignore)
17707mk_inline MK_TYPN MkTypN(const MK_MNGN mng) {
17708 if (!MkObjCheck(mng)) return NULL;
17709 MK_OBJ obj = (MK_OBJ) mng;
17710 if (MkTypCheck(obj)) return (MK_TYPN)obj;
17711 MK_TYPN typ = obj->type;
17712 if (MkTypCheck(typ)) return typ;
17713 return NULL;
17714}
17715
17717#define MkTYP_R(x) (*(x)).super.typ
17719#define MkTYP(x) (&MkTYP_R(x))
17721#define MkTYP_O(o) (*o).type
17723#define MkTYP_X(x) MkOBJ_R(x).type
17724
17730__parser__(ignore)
17731struct MkTypeDefS {
17732 // BEGIN-MkTypeDefS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
17733
17734 union {
17735 struct MkObjectS obj; // instance-base MkObjectS
17736 struct MkTypeS typ; // instance-base MkTypeS
17737 } super;
17738
17739 // END-MkTypeDefS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
17740};
17741
17742// BEGIN-MkTypeDefS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
17743
17747 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
17748
17749// Signature --------------------------------------------------------------
17752
17753 #define MkTypeDefC_SIGNATURE (MkTypeC_SIGNATURE ^ (1u<<6))
17754 #define MkTypeDefC_MASK (((1u<<26)-1)<<6)
17755
17757
17758// CompileTimeCast --------------------------------------------------------------
17761
17762 #define MkTypeDefC_X2typ(x) MkTYP(x)
17763 #define MkTypeDefC_X2obj(x) MkOBJ(x)
17764
17766
17767// TypeDef --------------------------------------------------------------
17770
17772 __parser__(ignore) typedef struct MkTypeDefS MkTypeDefCR;
17774 __parser__(ignore) typedef const struct MkTypeDefS MkTypeDefCNR;
17776 #define MkTypeDefSTT (&MK_RT_REF._MkTypeDefC_TT)
17778 #define MkTypeDefC_TT (&MK_RT_REF._MkTypeDefC_TT)
17780 #define MkTypeDefCT_X(instance) ( (struct MkTypeS *) (MkOBJ_R(instance).type) )
17782 #define MkTypeDefCTT_X(instance) (MkOBJ_R(instance).type)
17784 #define MkTypeDefCT_TT(typ) ( (struct MkTypeS *) (typ) )
17786 #define MkTypeDefC_NS MK
17788 #define MkTypeDefCTT MkTypeDefCTT
17790 #define MkTypeDefCT ( (struct MkTypeS *) MkTypeDefCTT )
17791
17793
17796// MkTypeDefC_Class_Define_C_API
17797
17798// END-MkTypeDefS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
17799
17801__parser__(internal)
17802MK_EXTERN MK_PTR MK_DECL MkTypeSlotResolveP(MK_RT_ARGS MK_TYPN const type, size_t const offset, bool const force);
17803
17818#define MkTypeSlotResolve(_tt,fptr,force) ({ \
17819 MK_TYP tt = (_tt) ; /* _tt my be long */ \
17820 tt == NULL ? NULL : /* type not valid */ \
17821 !force && tt->fptr == (MK_PTR) 0x1 ? NULL : /* already resolved, NOT found */ \
17822 tt->fptr > (typeof(tt->fptr)) 0x1 ? tt->fptr : /* already resolved, NOT NULL, found */ \
17823 tt == MkTypeSTT ? NULL : /* already at the ROOT of the type */ \
17824 (typeof(tt->fptr)) MkTypeSlotResolveP(MK_RT_CALL tt, offsetof(struct MkTypeS, fptr), force); \
17825}) \
17826
17827#define MkTypeSlotCall(_tt,fptr,...) do { \
17828 typeof((_tt)->fptr) slot = MkTypeSlotResolve((_tt),fptr,false); \
17829 if (slot) (*slot)(MK_RT_CALL __VA_ARGS__); \
17830} while (false)
17831
17833// MkTypeC_C_API
17834
17835
17836// #######################################################################
17837// -----------------------------------------------------------------------
17843
17844__parser__push__(doc-group=TOR);
17845
17856#if defined(META_USE_SELF_REFCOUNT)
17857 // [MkObjInit2]
17858 #define MkObjInit2(rtmkV,rtExtV,sigV,typeV,refCountV,isLocalV) \
17859 (struct MkObjectS) { \
17860 .signature = sigV, \
17861 .refCount = refCountV, \
17862 .self = NULL, \
17863 .type = typeV, \
17864 .env = NULL, \
17865 .selfCreated = false, \
17866 .selfRefCount = 0, \
17867 .objRt = rtmkV, \
17868 .objRtExt = rtExtV, \
17869 .obj_protect = { \
17870 .isLocal = isLocalV, \
17871 .prev = NULL, \
17872 .next = NULL, \
17873 }, \
17874 }
17875 // [MkObjInit2]
17876#else
17877 #define MkObjInit2(rtmkV,rtExtV,sigV,typeV,refCountV,isLocalV) \
17878 (struct MkObjectS) { \
17879 .signature = sigV, \
17880 .refCount = refCountV, \
17881 .self = NULL, \
17882 .type = typeV, \
17883 .env = NULL, \
17884 .selfCreated = false, \
17885 .objRt = rtmkV, \
17886 .objRtExt = rtExtV, \
17887 .obj_protect = { \
17888 .isLocal = isLocalV, \
17889 .prev = NULL, \
17890 .next = NULL, \
17891 }, \
17892 }
17893#endif
17894
17895#define MkObjInit(rtmkV,rtExtV,cls,refCountV,isLocalV) \
17896 MkObjInit2(rtmkV,rtExtV,cls##_SIGNATURE,cls##_TT,refCountV,isLocalV)
17897
17898// [MkObjInitFromType]
17899#define MkObjInitFromType(typeV,isLocalV) \
17900 MkObjInit2(MK_RT_PTR, NULL, (*typeV).objsig, typeV, 0, isLocalV)
17901// [MkObjInitFromType]
17902
17903#define MkObjInitFromInstance(instV) \
17904 MkObjInit2(MK_RT_PTR, NULL, MkOBJ_R(instV).type->objsig, MkOBJ_R(instV).type, 0, false)
17905
17919__parser__(constructor)
17922 MK_OBJ const srcobj
17924
17936 MK_OBJ const srcmng,
17937 MK_STRN const ident
17939
17955__parser__(constructor)
17958 MK_OBJ const obj
17960
17967__parser__(constructor)
17970 MK_TYP type __parser__(internal,default=NULL),
17971 MK_PTR nat,
17972 MK_PTR lnk
17974
17975// *******************************************************************************
17976// PUBLIC object API
17977// *******************************************************************************
17978
17997__parser__(destructor,keep-destr)
18000 MK_OBJ obj
18002
18003#define MkObjectDelete_NULL(obj) MkObjectDeleteToNull(MkObjectDelete_RT,MK,obj)
18004#define MkObjectDelete_NULL_X(x) MkObjectDeleteToNull_X(MkObjectDelete_RT,MK,x)
18005#define MkObjectDelete_1X(x) MkObjectDeleteToNull_X(MkObjectDelete_RT,MK,x)
18006
18007#define MkObjectDeleteToNull(fct,NS,x) if (x) { fct (NS##_RT_CALL x); (x) = NULL ; }
18008#define MkObjectDeleteToNull_X(fct,NS,x) if (x) { fct (NS##_RT_CALL MkOBJ(x)); (x) = NULL ; }
18009
18025__parser__(destructor,lng-destr,lng-dispose)
18028 MK_OBJ obj
18030
18031#define MkObjectDispose_NULL(obj) MkObjectDeleteToNull(MkObjectDispose_RT,MK,obj)
18032#define MkObjectDispose_NULL_X(x) MkObjectDeleteToNull_X(MkObjectDispose_RT,MK,x)
18033#define MkObjectDispose_1X(x) MkObjectDispose(MkOBJ(x))
18034
18036#define MkObjectDeleteCallF_CHECK do { \
18037 assert (__data__ != NULL); \
18038} while (0)
18039
18040// [MkObjectDeleteCallF]
18042#define MkObjectDeleteCallF_ARGS \
18043 MK_RT_ARGS \
18044 MK_OBJN const obj __parser__(internal), \
18045 MK_STRN const typeName, \
18046 MK_HDL const typeHdl, \
18047 MK_HDL const objHdl, \
18048 MK_CBP const __data__ \
18049
18050#define MkObjectDeleteCallF_CALL MK_RT_CALL obj, __data__
18051
18096__parser__(flags=public-internal)
18097typedef enum MkErrorE ( MK_DECL *MkObjectDeleteCallF) ( MkObjectDeleteCallF_ARGS ) ;
18098
18100#define MkObjectDeleteFreeF_ARGS MK_RT_ARGS MK_CBP *dataP __parser__(inout)
18101
18102__parser__(flags=public-internal)
18103typedef void ( MK_DECL *MkObjectDeleteFreeF) ( MkObjectDeleteFreeF_ARGS ) ;
18104
18137__parser__(class=MkObjectC,callback-name=ObjectDelete,callback-null)
18140 MK_STRN ident ,
18141 MkObjectDeleteCallF fCall __parser__(callback-call),
18142 MK_CBP callback __parser__(callback-data),
18143 MkObjectDeleteFreeF fFree __parser__(callback-free),
18144 MK_STRN filter __parser__(default=NULL)
18146// [MkObjectDeleteCallF]
18147
18151__parser__(class=MkObjectC)
18154 MK_STRN ident
18156
18157__parser__pop__; // TOR
18158
18160// MkObjectC_TOR_C_API
18161
18162/* ####################################################################### */
18163/* ### ### */
18164/* ### O B J - A P I ### */
18165/* ### ### */
18166/* ####################################################################### */
18167
18182// ***********************************************************************************************
18183
18184
18192 MK_OBJ const tgtmng,
18193 MK_OBJN const srcmng
18195
18201 MK_OBJ const obj
18203
18204// ****************************************************************************************************
18205
18210
18211__parser__global__(hide-rx=^MkRef);
18212__parser__global__(pattern2prefix:MkRef=MkObj);
18213
18215#define MkRefLOCK 999999
18216
18219__parser__(static)
18221mk_inline void MkRefIncr ( MK_OBJ obj ) {
18222 if (obj) ++(*obj).refCount;
18223}
18224
18225#define MkRefIncr_1X(x) MkRefIncr(MkOBJ(x))
18226#define MkRefIncr_1M(m) MkRefIncr(MkObj(m))
18227
18241#define MkRefIncr_FX(x) MkRefIncr(MkOBJ(x))
18242
18251__parser__(static)
18252MK_EXTERN void MkRefDecr_RT (
18254 MK_OBJ obj
18256
18260#define MkRefDecr_O(o) do { MkRefDecr_RT(MK_RT_CALL o); o=NULL; } while (0)
18264#define MkRefDecr_X(x) do { MkRefDecr_RT(MK_RT_CALL MkOBJ(x)); x=NULL; } while (0)
18266#define MkRefDecr_X_NULL(x) do { MkRefDecr_RT(MK_RT_NULL MkOBJ(x)); x=NULL; } while (0)
18271#define MkRefDecr_M(m) do { MkRefDecr_RT(MK_RT_CALL MkObj(m)); m=NULL; } while (0)
18273#define MkRefDecr_M_NULL(m) do { MkRefDecr_RT(MK_RT_NULL MkObj(m)); m=NULL; } while (0)
18274
18276#define MkRefDecr_FX(x) do { --(MkOBJ_R(x).refCount); } while(0)
18277
18286mk_inline void MkRefIncrSelf( MK_OBJ const obj, MK_PTR const self, MK_PTR const env) {
18287 MK_INSTANCE_HDL(obj);
18288 obj->refCount++;
18289 obj->self = (obj->type->noSelf ? NULL : self);
18290 obj->env = env;
18291}
18292
18293#define MkRefIncrSelf_2X(x,s) MkRefIncrSelf(MkOBJ(x),s)
18294
18311 MK_OBJ const obj
18313
18318// 2. \b unlink the \e SELF from \e META using the \RMkRefDecrWithoutSelf call
18330 MK_OBJ const obj
18332
18337__parser__(keep,doc-no)
18339mk_inline MK_I32 MkRefGet ( MK_OBJ const obj ) {
18340 MK_INSTANCE_HDL(obj);
18341 return (*obj).refCount;
18342}
18343
18344#define MkRefGet_1X(x) MkRefGet(MkOBJ(x))
18345
18349mk_inline MK_I32 MkRefLock ( MK_OBJ const obj ) {
18350 MK_INSTANCE_HDL(obj);
18351 return (*obj).refCount=MkRefLOCK;
18352}
18353#define MkRefLock_1X(x) MkRefLock(MkOBJ(x))
18354
18359mk_inline bool MkRefIsLocked ( MK_OBJ const obj ) {
18360 MK_INSTANCE_HDL(obj);
18361 return (*obj).refCount >= MkRefLOCK;
18362}
18363#define MkRefIsLocked_1X(x) MkRefIsLocked(MkOBJ(x))
18364
18366#define MkRefSet(target,source) ({ \
18367 if (target != source) { \
18368 typeof(target) targetSave=target; \
18369 target = source;\
18370 MkRefDecr_X(targetSave);\
18371 MkRefIncr_1X(target);\
18372 } \
18373 target;\
18374})
18375
18378
18379#define MkRefCidN_NULL() MkRefCidN_RT(MK_RT_CALL_NULL_ONLY)
18380
18382// MkRef…
18383
18384// *******************************************************************************
18385
18386__parser__global__(hide-rx=^MkSelf);
18387__parser__global__(pattern2prefix:MkSelf=MkObj);
18388
18391
18392typedef void (*MkSelfIncrF) ( MK_RT_ARGS MK_PTR self, MK_PTR const env);
18393typedef void (*MkSelfDecrF) ( MK_RT_ARGS MK_PTR self, MK_PTR const env);
18394
18400mk_inline void MK_DECL MkSelfSet ( MK_OBJ const obj, MK_PTR const self, MK_PTR const env ) {
18401 MK_INSTANCE_HDL(obj);
18402 obj->env = env;
18403 obj->self = (obj->type->noSelf ? NULL : self);
18404}
18405
18406#define MkSelfSet_3X(x,self,env) MkSelfSet(MkOBJ(x),self,env)
18407
18412mk_inline MK_PTR MK_DECL MkSelfGet ( MK_OBJ const obj ) {
18413 // BUG FIX - 1 mar 2023: remove nonnull on obj because C# require this
18414 return obj ? obj->self : NULL;
18415}
18416
18417#define MkSelfGet_1X(x) MkSelfGet(MkOBJ(x))
18418
18445 MK_OBJ obj __parser__(null-allowed),
18446 MK_PTR *self_out,
18447 MK_PTR const env
18448);
18449
18450#define MkSelfNew_3X(x,self_out,env) MkSelfNew(MkOBJ(x),self_out,env)
18451
18463 MK_OBJ const obj,
18464 MK_PTR const env
18465);
18466
18467#define MkSelfCreate_2X(x,env) MkSelfCreate(MkOBJ(x),env)
18468
18477__parser__(static)
18478MK_EXTERN bool MK_DECL MkSelfDelete_RT (
18480 MK_OBJ const obj
18482
18483#define MkSelfDelete_1X(x) MkSelfDelete_RT(MK_RT_CALL MkOBJ(x))
18484
18501__parser__(static)
18502MK_EXTERN bool MK_DECL MkSelfDeleteForce_RT (
18504 MK_OBJ obj
18506
18507#define MkSelfDeleteForce_1X(x) MkSelfDeleteForce(MkOBJ(x))
18508
18526__parser__(static)
18527MK_EXTERN void MK_DECL MkSelfUnlink_RT (
18529 MK_OBJ obj
18531
18532#define MkSelfUnlink_1X(x) MkSelfUnlink(MkOBJ(x))
18533
18536mk_inline bool MkSelfExists ( MK_OBJN obj ) {
18537 MK_INSTANCE_HDL(obj);
18538 return obj->self != NULL;
18539}
18540
18541#define MkSelfExists_1X(x) MkSelExists(MkOBJ(x))
18542
18544
18545// addtogroup MkObjectC_Obj_C_API
18547
18548// ****************************************************************************************************
18549
18552
18553//__parser__global__(hide-rx=^MkType);
18554//__parser__global__(prefix2attribute=MkType@internal);
18555//__parser__global__(prefix2attribute=MkType@class=MkTypeC);
18556
18557__parser__push__(internal,class=MkTypeC); // \{ internal
18558
18562__parser__push__(doc-group=TOR);
18563
18650__parser__(macro)
18651MK_TYP MkTypeCreate ( MK_MACRO_TYP const clsV, MK_MACRO_TYP const basicV, MK_STRN const identV);
18652// [MkTypeCreate]
18653#define MkTypeCreate(clsV, basicV, identV) ({ \
18654 assert(!MkSysStringIsNULL(identV)); \
18655 MK_TYP ret = MkTypeDup2(basicV ## _TT,identV); \
18656 ret->objsig = clsV ## _SIGNATURE; \
18657 ret->objmask = clsV ## _MASK; \
18658 ret->objsize = sizeof(clsV##R); \
18659 ret->type_base = basicV ## _TT; \
18660 ret->type_class = ret; \
18661 ret ; \
18662})
18663// [MkTypeCreate]
18664
18684 MK_TYPN const typ,
18685 MK_STRN const ident
18687
18700 MK_TYPN const typ
18702
18713 MK_TYPN const typ
18715
18721 MK_TYP const typ
18723
18726 MK_TYP const typ
18727) {
18728 assert(typ != NULL);
18729 assert(typ->type_class != NULL);
18730 MK_OBJ ret = typ->type_class->instancesR;
18731 // BUG FIX 2 mar 2025
18732 // test: Nhi1Exec int.test --dev-testing --lang-cc --valgrind-server
18733 // analyse: after "Delete" the "prev/next" is NOT proper set if "type" from "Instances->Next"
18734 // and "type" from "ret->type->instances" are NOT in sync
18735 // Fix: pMkTypeDup2 take "sourceTyp->instances"
18736 if (ret) assert(ret->type->type_class == typ->type_class);
18737 return ret;
18738}
18739
18742#define MkTypeForeachInstancesSave(typ) DL_FOREACH_SAFE2((typ)->type_class->instancesR,obj,tmp,obj_protect.next)
18743
18746mk_inline MK_TYPN MkTypeNextN(MK_TYPN const typ) {
18747 MK_INSTANCE_HDL(typ);
18748 return (MK_TYP)MkTypeC_X2obj(typ)->obj_protect.next;
18749}
18750
18752
18753// MkTypeC_C_TOR_C_API
18759
18770__parser__(const,class-overload=MkObjectLog)
18773 MK_TYPN const typ ,
18775 MK_DBG const debug __parser__(default=0),
18776 MK_STRN const callfunc __parser__(default=F#FUNC),
18777 MK_I32 const lvl __parser__(default=0)
18779
18780#define MkTypeLog_2Lvl(t,l,...) MkTypeLog_RT(MK_RT_CALL (t), __VA_ARGS__, (l)
18781
18782
18789#if META_DEBUG & META_DEBUG_TYPE
18790 #define MkTypeLoop(_cls, _var) \
18791 bool _var##_firstB = true; \
18792 _cls##_type _var##_first = (_cls##_type)_cls##_TT->type_class->instancesR; \
18793 for ( \
18794 _cls##_type _var = _var##_first; \
18795 ({ if (!_var##_firstB && _var == _var##_first) { \
18796 MkPanicV_2M(_var,"[MkTypeLoop] INTERNAL ERROR: found 'circle' in 'MkTypeC=%s'", _var->type_name); \
18797 } ; _var##_firstB = false; _var; }); \
18798 _var = (_cls##_type)_cls##_X2obj(_var)->obj_protect.next \
18799 )
18800#else
18801 #define MkTypeLoop(_cls, _var) \
18802 for (_cls##_type _var = (_cls##_type)_cls##_TT->type_class->instancesR; _var != NULL; \
18803 _var = (_cls##_type)_cls##_X2obj(_var)->obj_protect.next)
18804#endif
18805
18807
18808__parser__pop__; // \}
18809// internal
18810
18811// addtogroup MkTypeC_C_API
18813
18817
18819__parser__(internal,doc-group=Misc)
18823
18825
18826// ##################################################################################
18831
18841 MK_OBJN const obj __parser__(null-allowed)
18843
18844#define MkObjectToName_1X(x) MkObjectToName(MkOBJ(x))
18845
18862 MK_OBJN const obj
18864
18865//2021.03.01 ao → #define MkObjectToNameOfType(o) MkObjectToNameOfType((MK_OBJ)(o))
18866#define MkObjectToNameOfType_1X(x) MkObjectToNameOfType(MkOBJ(x))
18867
18878__parser__(template-overload,template-in-c)
18881 MK_OBJ const obj
18883
18884#define MkObjectToNameOfClass_1X(x) MkObjectToNameOfClass_RT(MK_RT_CALL MkOBJ(x))
18885
18898 MK_OBJN const inst __parser__(null-allowed)
18900
18901#define MkObjectToString_1X(x) MkObjectToString(x?MkOBJ(x):NULL)
18902#define MkObjectToString_1M(m) MkObjectToString(m?MkObjN(m):NULL)
18903
18907 MK_OBJ const obj __parser__(null-allowed)
18908) {
18909 return (obj == MK_NULL);
18910}
18911
18913// MkObjectC_Misc_C_API
18914
18915// #######################################################################
18916// -----------------------------------------------------------------------
18942
18943/* ####################################################################### */
18944/* ### ### */
18945/* ### L O G - A P I ### */
18946/* ### ### */
18947/* ####################################################################### */
18948
18962
18963__parser__push__(doc-group=Log);
18964
18980__parser__(no-type-extension)
18984 MK_STRN const message ,
18985 MK_DBG const debug __parser__(default=0),
18986 MK_STRN const callfunc __parser__(default=F#FUNC)
18988
18989#define MkLogC_4X(x,message,debug,callfunc) MkLogC(MkOBJ(x),message,debug,callfunc)
18990#define MkLogC_3X(x,message,debug) MkLogC_3(MkOBJ(x),message,debug)
18991#define MkLogC_2X(x,message) MkLogC_2(MkOBJ(x),message)
18992#define MkLogW(x,callfunc,_debug,message) MkLogC(MkOBJ(x),message,_debug,callfunc)
18993
19003__parser__(ignore)
19007 MK_STRN const callfunc __parser__(default=F#FUNC),
19008 FILE *FH,
19009 MK_FST const printfmt,
19010 ...
19012
19013#define MkDbgV_2X(x,printfmt,...) MkDbgV_RT(MK_RT_CALL MkOBJ(x),__func__,stderr,printfmt,__VA_ARGS__)
19014#define MkDbgV_2O(o,printfmt,...) MkDbgV_RT(MK_RT_CALL o ,__func__,stderr,printfmt,__VA_ARGS__)
19015
19028 MK_STRN const callfunc __parser__(default=F#FUNC),
19029 MK_DBG debug __parser__(default=0),
19030 MK_FST const printfmt,
19031 ...
19033
19034#define MkLogV_lvl(x,debug,printfmt,...) MkLogV(MkOBJ(x),__func__,debug,printfmt,__VA_ARGS__)
19035
19036#define MkLogV_4M(x,callfunc,debug,printfmt,...) MkLogV(MkObjN(x),callfunc,debug,printfmt,__VA_ARGS__)
19037#define MkLogV_4X(x,callfunc,debug,printfmt,...) MkLogV(MkOBJ(x),callfunc,debug,printfmt,__VA_ARGS__)
19038#define MkLogV_3X(x,callfunc,printfmt,...) MkLogV_3(MkOBJ(x),callfunc,printfmt,__VA_ARGS__)
19039#define MkLogV_2X(x,printfmt,...) MkLogV_2(MkOBJ(x),printfmt,__VA_ARGS__)
19040
19054 MK_STRN const callfunc __parser__(default=F#FUNC),
19055 MK_DBG debug __parser__(default=0),
19056 MK_FST const printfmt,
19057 va_list var_list
19059
19060#define MkLogVL_5X(fmtobj,callfunc,debug,printfmt,var_list) \
19061 MkLogVL(MkOBJ(fmtobj),callfunc,debug,printfmt,var_list)
19062
19072 MK_STRN const callfunc __parser__(default=F#FUNC),
19073 MkBinaryR const data
19075
19076#define MkLogHEX_4X(fmtobj,callfunc,data,len) MkLogHEX_RT(MkOBJ(fmtobj),callfunc,data,len)
19077
19088__parser__(const)
19089MK_EXTERN void MK_DECL MkObjectLogShort_RT (
19091 MK_OBJN const obj ,
19093 MK_DBG const debug __parser__(default=0),
19094 MK_STRN const callfunc __parser__(default=F#FUNC),
19095 MK_I32 const lvl __parser__(default=0)
19097
19098#define MkObjectLogShort_1X(x) MkObjectLogShort(MkOBJ(x),NULL,0,__func__,0)
19099#define MkObjectLogShort_2Lvl(o,l) MkObjectLogShort(o,NULL,0,__func__,l)
19100
19111__parser__(const)
19112MK_EXTERN void MK_DECL MkObjectLogLong_RT (
19114 MK_OBJN const obj ,
19116 MK_DBG const debug __parser__(default=0),
19117 MK_STRN const callfunc __parser__(default=F#FUNC),
19118 MK_I32 const lvl __parser__(default=0)
19120
19121#define MkObjectLogLong_1X(x) MkObjectLogLong(MkOBJ(x),NULL,0,__func__,0)
19122#define MkObjectLogLong_1M(m) MkObjectLogLong(MkObj(m),NULL,0,__func__,0)
19123
19134__parser__(const)
19135MK_EXTERN void MK_DECL MkObjectLogType_RT (
19137 MK_OBJN const obj ,
19139 MK_DBG const debug __parser__(default=0),
19140 MK_STRN const callfunc __parser__(default=F#FUNC),
19141 MK_I32 const lvl __parser__(default=0)
19143
19144#define MkObjectLogLong_1X(x) MkObjectLogLong(MkOBJ(x),NULL,0,__func__,0)
19145#define MkObjectLogLong_1M(m) MkObjectLogLong(MkObj(m),NULL,0,__func__,0)
19146
19225 MK_OBJN const obj ,
19227 MK_DBG const debug __parser__(default=0),
19228 MK_STRN const callfunc __parser__(default=F#FUNC),
19229 MK_I32 const lvl __parser__(default=0)
19231
19232#define MkObjectLog_1X(x) MkObjectLog(MkOBJ(x),NULL,0,__func__,0)
19233#define MkObjectLog_2Lvl(o,l) MkObjectLog(o,NULL,0,__func__,l)
19234
19236
19238// MkObjectC_Log_C_API
19239
19240/* ####################################################################### */
19241/* ### ### */
19242/* ### D B G - A P I ### */
19243/* ### ### */
19244/* ####################################################################### */
19245
19253
19254__parser__global__(prefix2class:MkDbg=MkObjectC);
19255
19259__parser__(no-type-extension)
19263 MK_STRN const message ,
19264 MK_DBG const debug __parser__(default=0),
19265 MK_STRN const callfunc __parser__(default=F#FUNC),
19266 MK_I32 const lvl __parser__(default=0)
19268
19269#define MkDbgL_2M(x,message) MkDbgL(MkObj(x),message,0,__func__,-1)
19270
19274__parser__(no-type-extension,template-overload)
19277 MK_OBJN const obj,
19278 MK_STRN const message __parser__(default=S#"var"),
19279 MK_STRN const callfunc __parser__(default=F#FUNC)
19281
19282#define MkDbgDump_2M(x,message) MkDbgDump_2(MkObj(x),message)
19283
19287 MK_STRN const message ,
19288 MK_DBG const debug __parser__(default=0),
19289 MK_STRN const callfunc __parser__(default=F#FUNC),
19290 MK_I32 const lvl __parser__(default=0)
19292
19294MK_EXTERN void MK_DECL MkDbgSTACK_RT (
19297 MK_I32 const skip __parser__(default=0),
19298 MK_I32 const num __parser__(default=-1),
19299 MK_STRN const callfunc __parser__(default=F#FUNC)
19301
19302#define MkDbgSTACK_3X(x,num,callfunc) MkDbgSTACK_3(MkOBJ(x),num,callfunc)
19303
19311__parser__(no-type-extension)
19314 MK_OBJN const obj,
19315 MK_STRN const callfunc __parser__(default=F#FUNC)
19317
19318#define MkDbgO_2X(x,callfunc) MkDbgO(MkObj(x),callfunc)
19319#define MkDbgO_1X(x) MkDbgO_2X(x,__func__)
19320#define MkDbgO_1O(x) MkDbgO(x,__func__)
19321
19323__parser__(no-type-extension)
19326 MK_OBJN const obj,
19327 MK_STRN const callfunc __parser__(default=F#FUNC)
19329
19331#define MkDbgLogC_2X(x,callfunc) MkDbgLogC_2(MkOBJ(x),callfunc)
19332
19334// MkObjectC_Dbg_C_API
19335
19336/* MARK_B ################################################################ */
19337/* ### ### */
19338/* ### B U F F E R - A P I ### */
19339/* ### ### */
19340/* ####################################################################### */
19341
19366
19368#define MkBufferS_ils_size (0)
19369
19393// [MkBufferS_example]
19394struct MkBufferS {
19395 // BEGIN-MkBufferS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19396
19397 union {
19398 struct MkObjectS obj; // instance-base MkObjectS
19399 } super;
19400
19401 // END-MkBufferS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19402
19403 // instance attributes
19404 struct {
19405 MK_NUM cursize;
19406 enum MkTypeE type;
19407 } var;
19408 // instance storage
19409 struct {
19410 union MkBufferU first;
19411 MK_NUM size;
19412 bool doBufferFree;
19413 } storage;
19415 struct ilsS {
19416 MK_NUM size;
19417 MK_NUM offset;
19418 } ils;
19419 MK_BINB ils_data[MkBufferS_ils_size];
19420};
19421
19422// BEGIN-MkBufferS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19423
19427 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
19428
19429// Signature --------------------------------------------------------------
19432
19433 #define MkBufferC_SIGNATURE (MkObjectC_SIGNATURE ^ (1u<<10))
19434 #define MkBufferC_MASK (((1u<<22)-1)<<10)
19435
19437
19438// CompileTimeCast --------------------------------------------------------------
19441
19442 #define MkBufferC_X2buf(x) (x)
19443 #define MkBufferC_X2obj(x) MkOBJ(x)
19444
19446
19447// TypeDef --------------------------------------------------------------
19450
19452 __parser__(ignore) typedef struct MkBufferS MkBufferCR;
19454 __parser__(ignore) typedef const struct MkBufferS MkBufferCNR;
19456 #define MkBufferC_T (&MK_RT_REF._MkBufferC_T)
19458 #define MkBufferC_TT (MkTYP(MkBufferC_T))
19460 #define MkBufferST MkBufferC_T
19462 #define MkBufferSTT (MkTYP(MkBufferST))
19464 #define MkBufferC_type MK_BUF
19466 #define MkBufferCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
19468 #define MkBufferCTT_X(instance) (MkOBJ_R(instance).type)
19470 #define MkBufferCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
19472 #define MkBufferC_NS MK
19474 #define MkBufferCTT MkBufferCTT
19476 #define MkBufferCT ( (struct MkTypeDefS *) MkBufferCTT )
19477
19479
19480// TypeCheck --------------------------------------------------------------
19483
19484 #pragma GCC diagnostic push
19485 #pragma GCC diagnostic ignored "-Wattributes"
19486
19489 __parser__(class=MkBufferC,static,hide)
19491 mk_inline bool MkBufCheck (MK_MNGN mng) {
19492 return MkSanitizeCheck(MkBufferC,mng);
19493 }
19494
19497 __parser__(class=MkBufferC,static,hide)
19499 mk_inline bool MkBufCheckO (MK_OBJN obj) {
19500 return MkSanitizeCheckO(MkBufferC,obj);
19501 }
19502
19503 #pragma GCC diagnostic pop
19504 #define MkBufferC_Check(mng) MkBufCheck(mng)
19505
19507
19508// RunTimeCast --------------------------------------------------------------
19511
19513 __parser__(class=MkBufferC,hide,static)
19514 META_ATTRIBUTE_SANITIZE
19516 mk_inline MK_BUF MkBuf(MK_MNG mng) {
19517 return (MkBufCheck(mng) ? (MK_BUF)mng : NULL);
19518 }
19519
19521 __parser__(class=MkBufferC,hide,static)
19522 META_ATTRIBUTE_SANITIZE
19524 mk_inline MK_BUFN MkBufN(MK_MNGN mng) {
19525 return (MkBufCheck(mng) ? (MK_BUFN)mng : NULL);
19526 }
19527
19529 #define MkBufRaise(_buf) if (!_MkCheckX(MkBufferC,_buf)) { \
19530 MkErrorSetC_1E("'MkBufferC' hdl is NULL"); \
19531 goto error ; \
19532 }
19533
19535 #define MkBUF_R(x) (*(x)).super.buf
19537 #define MkBUF(x) (&MkBUF_R(x))
19538
19540
19543// MkBufferC_Class_Define_C_API
19544
19545// END-MkBufferS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19546// [MkBufferS_example]
19547
19549// MkBufferC_C_API
19550
19551// =========================================================================
19552// BEGIN-MkBufferS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19553
19556
19559
19560__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkBufferC);
19561
19577__parser__(class-overload=MkObjectHandleGet)
19581 MK_BUF const buf __parser__(null-allowed)
19582) {
19583 return MkObjectHandleGet(buf?MkOBJ(buf):NULL);
19584}
19585
19594__parser__(flags=new)
19596mk_inline MK_BUF MkBufferHandleResolve_RT (
19598 MK_HDL const netHdl
19599) {
19600 return MkBuf(MkObjectHandleResolve(netHdl));
19601}
19602
19612#define MkBufferHandleResolve_e(netHdl) ({ \
19613 MK_HDL tmpHdl=netHdl; \
19614 MK_BUF tmp; \
19615 if (tmpHdl==0) { \
19616 tmp=NULL; \
19617 } else { \
19618 tmp=MkBufferHandleResolve(tmpHdl); \
19619 if (tmp==NULL) { \
19620 MkErrorSetC_1_NULL("ERROR: 'MkBufferC' handle is 'NULL'"); \
19621 goto error; \
19622 }; \
19623 }; \
19624 tmp; \
19625})
19626
19628
19630// Class export & import
19631
19635 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkBufferC,null-return-allow)
19638 return (MK_BUF)MK_NULL;
19639 }
19641// MkBufferC - Misc - function
19642
19644// MkBufferC_Class_C_API
19645
19646// END-MkBufferS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19647
19648// #######################################################################
19649// -----------------------------------------------------------------------
19661
19663#define MkBuffer64S_ils_size (64)
19664
19668__parser__(ignore)
19669struct MkBuffer64S {
19670 // BEGIN-MkBuffer64S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19671
19672 union {
19673 struct MkObjectS obj; // instance-base MkObjectS
19674 struct MkBufferS buf; // instance-base MkBufferS
19675 } super;
19676
19677 // END-MkBuffer64S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19678
19679 // instance attributes
19680 MK_BINB ils_data[MkBuffer64S_ils_size];
19681};
19682
19683// BEGIN-MkBuffer64S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19684
19688 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
19689
19690// Signature --------------------------------------------------------------
19693
19694 #define MkBuffer64C_SIGNATURE (MkBufferC_SIGNATURE ^ (1u<<6))
19695 #define MkBuffer64C_MASK (((1u<<26)-1)<<6)
19696
19698
19699// CompileTimeCast --------------------------------------------------------------
19702
19703 #define MkBuffer64C_X2buf(x) MkBUF(x)
19704 #define MkBuffer64C_X2obj(x) MkOBJ(x)
19705
19707
19708// TypeDef --------------------------------------------------------------
19711
19713 __parser__(ignore) typedef struct MkBuffer64S MkBuffer64CR;
19715 __parser__(ignore) typedef const struct MkBuffer64S MkBuffer64CNR;
19717 #define MkBuffer64C_T (&MK_RT_REF._MkBuffer64C_T)
19719 #define MkBuffer64C_TT (MkTYP(MkBuffer64C_T))
19721 #define MkBuffer64ST MkBuffer64C_T
19723 #define MkBuffer64STT (MkTYP(MkBuffer64ST))
19725 #define MkBuffer64CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
19727 #define MkBuffer64CTT_X(instance) (MkOBJ_R(instance).type)
19729 #define MkBuffer64CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
19731 #define MkBuffer64C_NS MK
19733 #define MkBuffer64CTT MkBuffer64CTT
19735 #define MkBuffer64CT ( (struct MkTypeDefS *) MkBuffer64CTT )
19736
19738
19741// MkBuffer64C_Class_Define_C_API
19742
19743// END-MkBuffer64S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19744
19746// MkBuffer64C_C_API
19747
19748// #######################################################################
19749// -----------------------------------------------------------------------
19755
19757#define MkBuffer256S_ils_size (256)
19758
19762__parser__(ignore)
19763struct MkBuffer256S {
19764 // BEGIN-MkBuffer256S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19765
19766 union {
19767 struct MkObjectS obj; // instance-base MkObjectS
19768 struct MkBufferS buf; // instance-base MkBufferS
19769 } super;
19770
19771 // END-MkBuffer256S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19772
19773 // instance attributes
19774 MK_BINB ils_data[MkBuffer256S_ils_size];
19775};
19776
19777// BEGIN-MkBuffer256S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19778
19782 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
19783
19784// Signature --------------------------------------------------------------
19787
19788 #define MkBuffer256C_SIGNATURE (MkBufferC_SIGNATURE ^ (2u<<6))
19789 #define MkBuffer256C_MASK (((1u<<26)-1)<<6)
19790
19792
19793// CompileTimeCast --------------------------------------------------------------
19796
19797 #define MkBuffer256C_X2buf(x) MkBUF(x)
19798 #define MkBuffer256C_X2obj(x) MkOBJ(x)
19799
19801
19802// TypeDef --------------------------------------------------------------
19805
19807 __parser__(ignore) typedef struct MkBuffer256S MkBuffer256CR;
19809 __parser__(ignore) typedef const struct MkBuffer256S MkBuffer256CNR;
19811 #define MkBuffer256C_T (&MK_RT_REF._MkBuffer256C_T)
19813 #define MkBuffer256C_TT (MkTYP(MkBuffer256C_T))
19815 #define MkBuffer256ST MkBuffer256C_T
19817 #define MkBuffer256STT (MkTYP(MkBuffer256ST))
19819 #define MkBuffer256CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
19821 #define MkBuffer256CTT_X(instance) (MkOBJ_R(instance).type)
19823 #define MkBuffer256CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
19825 #define MkBuffer256C_NS MK
19827 #define MkBuffer256CTT MkBuffer256CTT
19829 #define MkBuffer256CT ( (struct MkTypeDefS *) MkBuffer256CTT )
19830
19832
19835// MkBuffer256C_Class_Define_C_API
19836
19837// END-MkBuffer256S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19838
19840// MkBuffer256C_C_API
19841
19842// #######################################################################
19843// -----------------------------------------------------------------------
19849
19851#define MkBuffer1024S_ils_size (1024)
19852
19856__parser__(ignore)
19857struct MkBuffer1024S {
19858 // BEGIN-MkBuffer1024S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19859
19860 union {
19861 struct MkObjectS obj; // instance-base MkObjectS
19862 struct MkBufferS buf; // instance-base MkBufferS
19863 } super;
19864
19865 // END-MkBuffer1024S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19866
19867 // instance attributes
19869};
19870
19871// BEGIN-MkBuffer1024S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19872
19876 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
19877
19878// Signature --------------------------------------------------------------
19881
19882 #define MkBuffer1024C_SIGNATURE (MkBufferC_SIGNATURE ^ (3u<<6))
19883 #define MkBuffer1024C_MASK (((1u<<26)-1)<<6)
19884
19886
19887// CompileTimeCast --------------------------------------------------------------
19890
19891 #define MkBuffer1024C_X2buf(x) MkBUF(x)
19892 #define MkBuffer1024C_X2obj(x) MkOBJ(x)
19893
19895
19896// TypeDef --------------------------------------------------------------
19899
19901 __parser__(ignore) typedef struct MkBuffer1024S MkBuffer1024CR;
19903 __parser__(ignore) typedef const struct MkBuffer1024S MkBuffer1024CNR;
19905 #define MkBuffer1024C_T (&MK_RT_REF._MkBuffer1024C_T)
19907 #define MkBuffer1024C_TT (MkTYP(MkBuffer1024C_T))
19909 #define MkBuffer1024ST MkBuffer1024C_T
19911 #define MkBuffer1024STT (MkTYP(MkBuffer1024ST))
19913 #define MkBuffer1024CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
19915 #define MkBuffer1024CTT_X(instance) (MkOBJ_R(instance).type)
19917 #define MkBuffer1024CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
19919 #define MkBuffer1024C_NS MK
19921 #define MkBuffer1024CTT MkBuffer1024CTT
19923 #define MkBuffer1024CT ( (struct MkTypeDefS *) MkBuffer1024CTT )
19924
19926
19929// MkBuffer1024C_Class_Define_C_API
19930
19931// END-MkBuffer1024S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
19932
19934// MkBuffer1024C_C_API
19935
19936#ifndef __has_parser__
19937
19947#define MkBuf2XXXfast(buf) (*(buf)->storage.first.A)
19948
19949#define MkBuf2BOLfast(buf) MkBuf2XXXfast(buf).BOL
19950#define MkBuf2I8fast(buf) MkBuf2XXXfast(buf).I8
19951#define MkBuf2I16fast(buf) MkBuf2XXXfast(buf).I16
19952#define MkBuf2I32fast(buf) MkBuf2XXXfast(buf).I32
19953#define MkBuf2I64fast(buf) MkBuf2XXXfast(buf).I64
19954#define MkBuf2FLTfast(buf) MkBuf2XXXfast(buf).FLT
19955#define MkBuf2DBLfast(buf) MkBuf2XXXfast(buf).DBL
19957
19964#define MkBuf2XXX(xxx,len,buf) ({MK_##xxx __tmp; memcpy(&__tmp,buf->storage.first.B,len); __tmp;})
19965
19966#define MkBuf2BOL(buf) MkBuf2XXX(BOL,1,buf)
19967#define MkBuf2I8(buf) MkBuf2XXX(I8,1,buf)
19968#define MkBuf2I16(buf) MkBuf2XXX(I16,2,buf)
19969#define MkBuf2I32(buf) MkBuf2XXX(I32,4,buf)
19970#define MkBuf2I64(buf) MkBuf2XXX(I64,8,buf)
19971#define MkBuf2FLT(buf) MkBuf2XXX(FLT,4,buf)
19972#define MkBuf2DBL(buf) MkBuf2XXX(DBL,8,buf)
19973
19974#define MkBuf2Ptr(len,ptr,buf) memcpy((void*)ptr,buf->storage.first.B,len)
19975#define MkBuf2BOL_P(ptr,buf) MkBuf2Ptr(1,ptr,buf)
19976#define MkBuf2I8_P(ptr,buf) MkBuf2Ptr(1,ptr,buf)
19977#define MkBuf2I16_P(ptr,buf) MkBuf2Ptr(2,ptr,buf)
19978#define MkBuf2I32_P(ptr,buf) MkBuf2Ptr(4,ptr,buf)
19979#define MkBuf2I64_P(ptr,buf) MkBuf2Ptr(8,ptr,buf)
19980#define MkBuf2FLT_P(ptr,buf) MkBuf2Ptr(4,ptr,buf)
19981#define MkBuf2DBL_P(ptr,buf) MkBuf2Ptr(8,ptr,buf)
19982
19983#define MkBuf2Ptr_A(l,a,b) memcpy(a.B##l,b->storage.first.B,l)
19984#define MkBuf2BOL_A(ato,buf) MkBuf2Ptr_A(1,ato,buf)
19985#define MkBuf2I8_A(ato,buf) MkBuf2Ptr_A(1,ato,buf)
19986#define MkBuf2I16_A(ato,buf) MkBuf2Ptr_A(2,ato,buf)
19987#define MkBuf2I32_A(ato,buf) MkBuf2Ptr_A(4,ato,buf)
19988#define MkBuf2I64_A(ato,buf) MkBuf2Ptr_A(8,ato,buf)
19989#define MkBuf2FLT_A(ato,buf) MkBuf2Ptr_A(4,ato,buf)
19990#define MkBuf2DBL_A(ato,buf) MkBuf2Ptr_A(8,ato,buf)
19991
19993// MkBuf2TT
19994
19995#endif // !__has_parser__
19996
19997__parser__push__(hide,overload-c-no);
19998
20012
20016 MK_STRN const str,
20017 MK_NUM const length,
20018 MK_BOL *val_out
20020
20021#define MkString2O(s,l,r) MkString2BOL_RT(MK_RT_CALL s,l,r)
20022
20025 MK_STRN const str,
20026 MK_NUM const length,
20027 MK_I8 *val_out
20029
20030#define MkString2Y(s,l,r) MkString2I8_RT(MK_RT_CALL s,l,r)
20031
20034 MK_STRN const str,
20035 MK_NUM const length,
20036 MK_I16 *val_out
20038
20039#define MkString2S(s,l,r) MkString2I16_RT(MK_RT_CALL s,l,r)
20040
20043 MK_STRN const str,
20044 MK_NUM const length,
20045 MK_U16 *val_out
20047
20048#define MkString2US(s,l,r) MkString2U16_RT(MK_RT_CALL s,l,r)
20049
20052 MK_STRN const str,
20053 MK_NUM const length,
20054 MK_I32 *val_out
20056
20057#define MkString2I(s,l,r) MkString2I32_RT(MK_RT_CALL s,l,r)
20058
20061 MK_STRN const str,
20062 MK_NUM const length,
20063 MK_U32 *val_out
20065
20066#define MkString2UI(s,l,r) MkString2U32_RT(MK_RT_CALL s,l,r)
20067
20070 MK_STRN const str,
20071 MK_NUM const length,
20072 MK_I64 *val_out
20074
20075#define MkString2W(s,l,r) MkString2I64_RT(MK_RT_CALL s,l,r)
20076
20077/*
20078MK_EXTERN enum MkErrorE MK_DECL MkString2LLG_RT (
20079 MK_PARSER_RT
20080 MK_STRN const str,
20081 MK_NUM const length,
20082 MK_LLG *val_out
20083) MK_ATTR_RT_STATIC;
20084
20085#define MkString2X(s,l,r) MkString2LLG_RT(MK_RT_CALL s,l,r)
20086*/
20087
20090 MK_STRN const str,
20091 MK_NUM const length,
20092 MK_FLT *val_out
20094
20095#define MkString2F(s,l,r) MkString2FLT_RT(MK_RT_CALL s,l,r)
20096
20099 MK_STRN const str,
20100 MK_NUM const length,
20101 MK_DBL *val_out
20103
20104#define MkString2D(s,l,r) MkString2DBL_RT(MK_RT_CALL s,l,r)
20105
20108 MK_STRN const str,
20109 MK_NUM const length,
20110 MK_LONG *val_out
20112
20115 MK_STRN const str,
20116 MK_NUM const length,
20117 MK_BOOL *val_out
20119
20120__parser__(internal)
20123 MK_STRN const str,
20124 MK_NUM const length,
20125 enum MkTypeE type,
20126 MK_ATO *val_out
20128
20131 MK_STRN const str,
20132 MK_NUM const length,
20133 MK_HDL *val_out
20135
20137
20139// MkString2TT
20141// MkBufferC_C_API
20142
20143// #######################################################################
20144// -----------------------------------------------------------------------
20149
20150__parser__push__(doc-group=TOR);
20151
20164// [MkBufferCreate]
20165__parser__(constructor,lng-constr)
20168 MK_TYP type __parser__(internal,default=NULL),
20169 MK_NUM const size __parser__(default=0)
20171// [MkBufferCreate]
20172
20174__parser__(constructor,doc-sort=ils0)
20175MK_EXTERN MK_BUF MK_DECL MkBufferCreate64_RT (
20177 MK_NUM const size __parser__(default=0)
20179
20181__parser__(constructor,doc-sort=ils1)
20182MK_EXTERN MK_BUF MK_DECL MkBufferCreate256_RT (
20184 MK_NUM const size __parser__(default=0)
20186
20188__parser__(constructor,doc-sort=ils2)
20189MK_EXTERN MK_BUF MK_DECL MkBufferCreate1024_RT (
20191 MK_NUM const size __parser__(default=0)
20193
20194__parser__(constructor,macro,doc-sort=tmpl0)
20195void MkBufferCreateTLS_T(MK_MACRO_TYP cls, MK_MACRO_TYP name, MK_NUM const size) MK_ATTR_STATIC ;
20208// [MkBufferCreateTLS_T]
20209#define MkBufferCreateTLS_T(cls,name,size) \
20210 static MkThreadLocal cls##R name##R = {0}; \
20211 MK_BUF name = MkBUF(&name##R); \
20212 if (unlikely(!__MkCheckX(cls,&name##R))) { \
20213 MkBufferInit(name,cls##_TT,size); \
20214 MkRefIncr_1X(name); \
20215 } else if (MkBUF_R(&name##R).var.cursize) { \
20216 MkBufferReset(name); \
20217 }
20218// [MkBufferCreateTLS_T]
20219
20220__parser__(constructor,macro,doc-sort=tmpl1)
20221void MkBufferCreateTLS_inout_T(MK_MACRO_TYP cls, MK_MACRO_TYP name, MK_BUF * inout) MK_ATTR_STATIC ;
20228// [MkBufferCreateTLS_inout_T]
20229#define MkBufferCreateTLS_inout_T(cls,name,inout) \
20230 static MkThreadLocal struct MkBufferS __hidden_##name##R = {0}; \
20231 MK_BUF name = *inout != NULL ? *inout : &__hidden_##name##R; \
20232 if (likely(!__MkCheckX(MkBufferC,name))) { \
20233 MkBufferInit(name,cls##_TT,0); \
20234 MkRefIncr_1X(name); \
20235 } else if (name->var.cursize) { \
20236 MkBufferReset(name); \
20237 } \
20238// [MkBufferCreateTLS_inout_T]
20239
20240__parser__(constructor,macro,doc-sort=tmpl2)
20241void MkBufferCreateLOCAL_T(MK_MACRO_TYP cls, MK_MACRO_TYP name, MK_NUM const size) MK_ATTR_STATIC ;
20255// [MkBufferCreateLOCAL_T]
20256#define MkBufferCreateLOCAL_T(cls,name,size) \
20257 cls##R name##R = {0}; \
20258 struct MkBufferS * const name = MkBUF(&name##R); \
20259 MkBufferInit(name,cls##_TT,size)
20260// [MkBufferCreateLOCAL_T]
20261
20270__parser__(constructor)
20273 MK_I8 const val
20275
20278__parser__(constructor)
20281 MK_BOL const val
20283
20286__parser__(constructor)
20289 MK_I16 const val
20291
20294__parser__(constructor)
20297 MK_I32 const val
20299
20302__parser__(constructor)
20305 MK_FLT const val
20307
20310__parser__(constructor)
20313 MK_I64 const val
20315
20318__parser__(constructor)
20321 MK_DBL const val
20323
20326__parser__(constructor)
20329 MK_STRN const val
20331
20334__parser__(constructor)
20337 MkBinaryR const val
20339
20352__parser__(doc-sort=b0)
20355 MK_STRN const tlsName ,
20356 bool const resetB __parser__(default=true)
20358
20361__parser__(constructor,static,doc-sort=b1)
20362MK_EXTERN MK_BUF MK_DECL MkBufferCreateBUF_RT (
20364 MK_BUFN const val
20366
20387__parser__(internal)
20388MK_EXTERN void MK_DECL MkBufferFree_RT (
20390 MK_BUF const buf
20392
20397// [MkBufferInit]
20398__parser__(internal)
20399MK_EXTERN void MK_DECL MkBufferInit_RT (
20401 MK_BUF const buf,
20402 MK_TYP type __parser__(internal,default=NULL),
20403 MK_NUM const size __parser__(default=0)
20405// [MkBufferInit]
20406
20412__parser__(destructor)
20413MK_EXTERN void MK_DECL MkBufferDelete_RT (
20415 MK_BUF const buf
20417
20427__parser__(constructor)
20428MK_EXTERN MK_BUF MK_DECL MkBufferDup_RT (
20430 MK_BUFN const buf
20432
20448__parser__(constructor)
20449MK_EXTERN MK_BUF MK_DECL MkBufferMerge_RT (
20451 MK_BUF const buf
20453
20454__parser__pop__; // TOR
20455
20457// MkBufferC_TOR_C_API
20458
20459// #######################################################################
20460// -----------------------------------------------------------------------
20465
20466__parser__global__(prefix2doc:MkBufferGet=Get);
20467
20479MK_EXTERN enum MkErrorE MK_DECL MkBufferGetI8_RT (
20481 MK_BUFN const buf,
20482 MK_I8 * const val_out
20484
20487MK_EXTERN enum MkErrorE MK_DECL MkBufferGetBOL_RT (
20489 MK_BUFN const buf,
20490 MK_BOL * const val_out
20492
20495MK_EXTERN enum MkErrorE MK_DECL MkBufferGetI16_RT (
20497 MK_BUFN const buf,
20498 MK_I16 * const val_out
20500
20503__parser__(internal)
20504MK_EXTERN enum MkErrorE MK_DECL MkBufferGetU16_RT (
20506 MK_BUFN const buf,
20507 MK_U16 * const val_out
20509
20512MK_EXTERN enum MkErrorE MK_DECL MkBufferGetI32_RT (
20514 MK_BUFN const buf,
20515 MK_I32 * const val_out
20517
20520__parser__(internal)
20521MK_EXTERN enum MkErrorE MK_DECL MkBufferGetU32_RT (
20523 MK_BUFN const buf,
20524 MK_U32 * const val_out
20526
20529MK_EXTERN enum MkErrorE MK_DECL MkBufferGetFLT_RT (
20531 MK_BUFN const buf,
20532 MK_FLT * const val_out
20534
20537MK_EXTERN enum MkErrorE MK_DECL MkBufferGetI64_RT (
20539 MK_BUFN const buf,
20540 MK_I64 * const val_out
20542
20543/*
20546__parser__(internal)
20547MK_EXTERN enum MkErrorE MK_DECL MkBufferGetLL_RT (
20548 MK_PARSER_RT
20549 MK_BUFN const buf,
20550 MK_LLG * const val_out
20551) MK_ATTR_RT_INSTANCE;
20552
20553#define MkBufferGetLLG(b,o) MkBufferGetLL(b,o)
20554*/
20555
20558MK_EXTERN enum MkErrorE MK_DECL MkBufferGetDBL_RT (
20560 MK_BUFN const buf,
20561 MK_DBL * const val_out
20563
20568MK_EXTERN enum MkErrorE MK_DECL MkBufferGetBIN_RT (
20570 MK_BUFN const buf,
20571 MkBinaryR * const val_out
20573
20577// [__parser__out__]
20578MK_EXTERN enum MkErrorE MK_DECL MkBufferGetSTR_RT (
20580 MK_BUFN const buf,
20581 MK_STRN * const val_out
20583// [__parser__out__]
20584
20589MK_EXTERN enum MkErrorE MK_DECL MkBufferGetStringR_RT (
20591 MK_BUFN const buf,
20592 MkStringR * const val_out
20594
20598MK_EXTERN enum MkErrorE MK_DECL MkBufferGetBUF_RT (
20600 MK_BUF const buf,
20601 MK_BUF * const val_out
20603
20613__parser__(no-static)
20614MK_EXTERN enum MkErrorE MK_DECL MkBufferGetBFL_RT (
20616 MK_BUFN const buf,
20617 MK_BFL * const val_inout
20619
20622__parser__(internal)
20623MK_EXTERN enum MkErrorE MK_DECL MkBufferGetLONG_RT (
20625 MK_BUFN const buf,
20626 MK_LONG * const val_out
20628
20631__parser__(internal)
20632MK_EXTERN enum MkErrorE MK_DECL MkBufferGetBOOL_RT (
20634 MK_BUFN const buf,
20635 MK_BOOL * const val_out
20637
20639// MkBufferC_Get_C_API
20640
20641
20642// #######################################################################
20643// -----------------------------------------------------------------------
20648
20649__parser__global__(prefix2doc:MkBufferSet=Set);
20650
20660MK_EXTERN MK_BUF MK_DECL MkBufferSetI8_RT (
20662 MK_BUF const buf,
20663 MK_I8 const val
20665
20668MK_EXTERN MK_BUF MK_DECL MkBufferSetBOL_RT (
20670 MK_BUF const buf,
20671 MK_BOL const val
20673
20676MK_EXTERN MK_BUF MK_DECL MkBufferSetI16_RT (
20678 MK_BUF const buf,
20679 MK_I16 const val
20681
20684MK_EXTERN MK_BUF MK_DECL MkBufferSetI32_RT (
20686 MK_BUF const buf,
20687 MK_I32 const val
20689
20692MK_EXTERN MK_BUF MK_DECL MkBufferSetFLT_RT (
20694 MK_BUF const buf,
20695 MK_FLT const val
20697
20700MK_EXTERN MK_BUF MK_DECL MkBufferSetI64_RT (
20702 MK_BUF const buf,
20703 MK_I64 const val
20705
20708MK_EXTERN MK_BUF MK_DECL MkBufferSetDBL_RT (
20710 MK_BUF const buf,
20711 MK_DBL const val
20713
20716MK_EXTERN MK_BUF MK_DECL MkBufferSetSTR_RT (
20718 MK_BUF const buf,
20719 MK_STRN const val
20721
20724MK_EXTERN MK_BUF MK_DECL MkBufferSetBIN_RT (
20726 MK_BUF const buf,
20727 MkBinaryR const val
20729
20732MK_EXTERN MK_BUF MK_DECL MkBufferSetBUF_RT (
20734 MK_BUF const buf,
20735 MK_BUFN const val
20737
20742MK_EXTERN MK_BUF MK_DECL MkBufferSetVL_RT (
20744 MK_BUF const buf,
20745 MK_FST const val,
20746 va_list var_list
20748
20752MK_EXTERN MK_BUF MK_DECL MkBufferSetV_RT (
20754 MK_BUF const buf,
20755 MK_FST const val,
20756 ...
20758
20761MK_EXTERN MK_BUF MK_DECL MkBufferSetBinaryR_RT (
20763 MK_BUF const buf,
20764 MkBinaryR const val
20766
20769MK_EXTERN MK_BUF MK_DECL MkBufferSetStringR_RT (
20771 MK_BUF const buf,
20772 MkStringR const val
20774
20776// MkBufferC_Set_C_API
20777
20778// #######################################################################
20779// -----------------------------------------------------------------------
20784
20785__parser__push__(doc-group=Info);
20786
20790__parser__(no-rpc)
20791MK_EXTERN MK_STRB MK_DECL MkBufferGetType1_RT (
20793 MK_BUFN const buf
20795
20799MK_EXTERN enum MkTypeE MK_DECL MkBufferGetType2_RT (
20801 MK_BUFN const buf
20803
20807MK_EXTERN MK_STRN MK_DECL MkBufferGetType3_RT (
20809 MK_BUFN const buf
20811
20817MK_EXTERN bool MK_DECL MkBufferIsLocal_RT (
20819 MK_BUFN const buf
20821
20832__parser__(const,class-overload=MkObjectLog)
20833MK_EXTERN void MK_DECL MkBufferLog_RT (
20835 MK_BUFN const buf ,
20837 MK_DBG const debug __parser__(default=0),
20838 MK_STRN const callfunc __parser__(default=F#FUNC),
20839 MK_I32 const lvl __parser__(default=0)
20841
20849__parser__(internal)
20852 MK_BUFN const buf,
20853 MK_STRN const varname __parser__(default=S#"buf"),
20855 MK_STRN const callfunc __parser__(default=F#FUNC)
20857
20867 MK_BUFN const buf,
20868 MK_STRN const varname __parser__(default=S#"buf"),
20870 MK_STRN const callfunc __parser__(default=F#FUNC)
20872
20873#define MkBufferLogS_2V(buf,fmt) MkBufferLogS_3(buf,#fmt,MkOBJ(fmt))
20874
20876
20878// MkBufferC_Info_C_API
20879
20880
20881// #######################################################################
20882// -----------------------------------------------------------------------
20887
20900 MK_BUFN const buf1,
20901 MK_BUFN const buf2
20903
20913 MK_BUF const buf, // TODO: special case update buffer should be default return
20914 enum MkTypeE const typ
20916
20918__parser__(class-overload=MkObjectToString)
20922 MK_BUFN const inst
20924
20935 MK_BUF const buf,
20936 MK_NUM const size
20938
20948 MK_BUF const buf,
20949 MK_NUM const size
20951
20959 MK_BUF const buf
20961
20971 MK_BUF const buf
20973
20980__parser__(const)
20981MK_EXTERN MK_BUF MK_DECL MkBufferCopy_RT (
20983 MK_BUF const buf,
20984 MK_BUFN const srce
20986
20999__parser__(no-static)
21000MK_EXTERN MK_BUF MK_DECL MkBufferTemp_RT (
21002 MK_BUFN const buf
21004
21006// MkBufferC_Misc_C_API
21007
21008
21009// #######################################################################
21010// -----------------------------------------------------------------------
21015
21016__parser__push__(doc-group=Access);
21017
21026__parser__(no-type-extension)
21027MK_EXTERN MK_BUF MK_DECL MkBufferAppendC_RT (
21029 MK_BUF const buf,
21030 MK_STRN const val
21032
21041__parser__(no-type-extension)
21042MK_EXTERN MK_BUF MK_DECL MkBufferAppendStringR_RT (
21044 MK_BUF const buf,
21045 MkStringR const val
21047
21055MK_EXTERN MK_I32 MK_DECL MkBufferAppendVL_RT (
21057 MK_BUF const buf,
21058 MK_FST const printfmt,
21059 va_list var_list
21061
21068MK_EXTERN MK_I32 MK_DECL MkBufferAppendV_RT (
21070 MK_BUF const buf,
21071 MK_FST const printfmt,
21072 ...
21074
21082MK_EXTERN MK_NUM MK_DECL MkBufferPush_RT (
21084 MK_BUF const buf,
21085 MK_STRN const val
21087
21095MK_EXTERN MK_NUM MK_DECL MkBufferPop_RT (
21097 MK_BUF const buf,
21098 MK_STRN const val
21100
21102__parser__(template-required,no-rpc,keep,no-static)
21103MK_EXTERN enum MkErrorE MK_DECL MkBufferToObject_RT (
21105 MK_BUF const buf,
21106 MK_NAT_OBJECT * obj_out
21108
21110
21112// MkBufferC_Access_C_API
21113
21114/* MARK_S ################################################################ */
21115/* ### ### */
21116/* ### B U F F E R - S T R E A M - A P I ### */
21117/* ### ### */
21118/* ####################################################################### */
21119
21135
21154
21155struct MkBufferStreamSaveS;
21156
21158#define MkBufferStreamS_ils_size (0)
21159
21187// [MkBufferStreamS_example]
21188struct MkBufferStreamS {
21189 // BEGIN-MkBufferStreamS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21190
21191 union {
21192 struct MkObjectS obj; // instance-base MkObjectS
21193 struct MkBufferS buf; // instance-base MkBufferS
21194 } super;
21195
21196 // END-MkBufferStreamS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21197
21198 // instance attributes
21199 struct {
21200 MK_NUM numItems; // the number of items in the package
21201 MK_I32 undo; // \e undo last operation: read=+1 < no=0 < write=-1)
21202 // \note The \e endian_is_wrong attribute is required if a \RMkBufferStreamC is send to
21203 // an other host. The \e sender-endian is part of the \e package-header and the \e reader is using
21204 // the information from the \e package-header to setup the \e endian_is_wrong attribute.
21205 // \li \b false (0) if the endian is the \b same as the local endian.
21206 // \li \b true (1) if the endian is \b not the same as the local endian.
21207 // If \e endian_is_wrong is \b true the package header transform the native-binary-package-data
21208 // to the local endian as part of the \RDocMqA{ReadTT} and \RDocNsA{BufferStreamReadTT} methods.
21209 // The transformation of native data is \b only done if required, just \e routing of a package
21210 // does \b not require a transformation.
21211 bool endian_is_wrong; // the value: \e TRUE if endian of storage != \c MK_ENDIAN_MY
21212 } var; // variable part of the \e instance-data
21213 struct {
21219 union MkBufferU cur;
21220 } storage; // storage part of the \e instance-data
21221
21222 // BUG FIX don't put busRef into "var" -> the pMkBusReadL_END will "overwrite" the data including the
21223 // "self" pointer
21224 struct MkBuffer64S busRef; // pBusReadNextWord will fill this
21225
21226 struct MkCacheS saveCache; // cache to support recursion in LST sub-package
21227 struct MkBufferStreamSaveS * busWriteSave; // if \b not NULL than an active LST-WRITE is ongoing
21228 struct MkBufferStreamSaveS * busReadSave; // if \b not NULL than an active LST-READ is ongoing
21229
21230 MK_BINB ils_data[MkBufferStreamS_ils_size]; // \e ILS storage
21231};
21232// [MkBufferStreamS_example]
21233
21234// BEGIN-MkBufferStreamS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21235
21239 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
21240
21241// Signature --------------------------------------------------------------
21244
21245 #define MkBufferStreamC_SIGNATURE (MkBufferC_SIGNATURE ^ (4u<<6))
21246 #define MkBufferStreamC_MASK (((1u<<26)-1)<<6)
21247
21249
21250// CompileTimeCast --------------------------------------------------------------
21253
21254 #define MkBufferStreamC_X2bus(x) (x)
21255 #define MkBufferStreamC_X2buf(x) MkBUF(x)
21256 #define MkBufferStreamC_X2obj(x) MkOBJ(x)
21257
21259
21260// TypeDef --------------------------------------------------------------
21263
21265 __parser__(ignore) typedef struct MkBufferStreamS MkBufferStreamCR;
21267 __parser__(ignore) typedef const struct MkBufferStreamS MkBufferStreamCNR;
21269 #define MkBufferStreamC_T (&MK_RT_REF._MkBufferStreamC_T)
21271 #define MkBufferStreamC_TT (MkTYP(MkBufferStreamC_T))
21273 #define MkBufferStreamST MkBufferStreamC_T
21275 #define MkBufferStreamSTT (MkTYP(MkBufferStreamST))
21277 #define MkBufferStreamC_type MK_BUS
21279 #define MkBufferStreamCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
21281 #define MkBufferStreamCTT_X(instance) (MkOBJ_R(instance).type)
21283 #define MkBufferStreamCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
21285 #define MkBufferStreamC_NS MK
21287 #define MkBufferStreamCTT MkBufferStreamCTT
21289 #define MkBufferStreamCT ( (struct MkTypeDefS *) MkBufferStreamCTT )
21290
21292
21293// TypeCheck --------------------------------------------------------------
21296
21297 #pragma GCC diagnostic push
21298 #pragma GCC diagnostic ignored "-Wattributes"
21299
21302 __parser__(class=MkBufferStreamC,static,hide)
21304 mk_inline bool MkBusCheck (MK_MNGN mng) {
21305 return MkSanitizeCheck(MkBufferStreamC,mng);
21306 }
21307
21310 __parser__(class=MkBufferStreamC,static,hide)
21312 mk_inline bool MkBusCheckO (MK_OBJN obj) {
21313 return MkSanitizeCheckO(MkBufferStreamC,obj);
21314 }
21315
21316 #pragma GCC diagnostic pop
21317 #define MkBufferStreamC_Check(mng) MkBusCheck(mng)
21318
21320
21321// RunTimeCast --------------------------------------------------------------
21324
21326 __parser__(class=MkBufferStreamC,hide,static)
21327 META_ATTRIBUTE_SANITIZE
21329 mk_inline MK_BUS MkBus(MK_MNG mng) {
21330 return (MkBusCheck(mng) ? (MK_BUS)mng : NULL);
21331 }
21332
21334 __parser__(class=MkBufferStreamC,hide,static)
21335 META_ATTRIBUTE_SANITIZE
21337 mk_inline MK_BUSN MkBusN(MK_MNGN mng) {
21338 return (MkBusCheck(mng) ? (MK_BUSN)mng : NULL);
21339 }
21340
21342 #define MkBusRaise(_bus) if (!_MkCheckX(MkBufferStreamC,_bus)) { \
21343 MkErrorSetC_1E("'MkBufferStreamC' hdl is NULL"); \
21344 goto error ; \
21345 }
21346
21348 #define MkBUS_R(x) (*(x)).super.bus
21350 #define MkBUS(x) (&MkBUS_R(x))
21351
21353
21356// MkBufferStreamC_Class_Define_C_API
21357
21358// END-MkBufferStreamS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21359
21360// =========================================================================
21361// BEGIN-MkBufferStreamS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21362
21365
21368
21369__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkBufferStreamC);
21370
21386__parser__(class-overload=MkObjectHandleGet)
21390 MK_BUS const bus __parser__(null-allowed)
21391) {
21392 return MkObjectHandleGet(bus?MkOBJ(bus):NULL);
21393}
21394
21403__parser__(flags=new)
21405mk_inline MK_BUS MkBufferStreamHandleResolve_RT (
21407 MK_HDL const netHdl
21408) {
21409 return MkBus(MkObjectHandleResolve(netHdl));
21410}
21411
21421#define MkBufferStreamHandleResolve_e(netHdl) ({ \
21422 MK_HDL tmpHdl=netHdl; \
21423 MK_BUS tmp; \
21424 if (tmpHdl==0) { \
21425 tmp=NULL; \
21426 } else { \
21427 tmp=MkBufferStreamHandleResolve(tmpHdl); \
21428 if (tmp==NULL) { \
21429 MkErrorSetC_1_NULL("ERROR: 'MkBufferStreamC' handle is 'NULL'"); \
21430 goto error; \
21431 }; \
21432 }; \
21433 tmp; \
21434})
21435
21437
21439// Class export & import
21440
21444 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkBufferStreamC,null-return-allow)
21447 return (MK_BUS)MK_NULL;
21448 }
21450// MkBufferStreamC - Misc - function
21451
21453// MkBufferStreamC_Class_C_API
21454
21455// END-MkBufferStreamS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21456
21457// #######################################################################
21458// -----------------------------------------------------------------------
21464
21466#define MkBufferStream64_ils_size (64)
21467
21471__parser__(ignore)
21472struct MkBufferStream64S {
21473 // BEGIN-MkBufferStream64S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21474
21475 union {
21476 struct MkObjectS obj; // instance-base MkObjectS
21477 struct MkBufferS buf; // instance-base MkBufferS
21478 struct MkBufferStreamS bus; // instance-base MkBufferStreamS
21479 } super;
21480
21481 // END-MkBufferStream64S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21482
21483 // instance attributes
21485};
21486
21487// BEGIN-MkBufferStream64S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21488
21492 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
21493
21494// Signature --------------------------------------------------------------
21497
21498 #define MkBufferStream64C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (3u<<3))
21499 #define MkBufferStream64C_MASK (((1u<<29)-1)<<3)
21500
21502
21503// CompileTimeCast --------------------------------------------------------------
21506
21507 #define MkBufferStream64C_X2bus(x) MkBUS(x)
21508 #define MkBufferStream64C_X2buf(x) MkBUF(x)
21509 #define MkBufferStream64C_X2obj(x) MkOBJ(x)
21510
21512
21513// TypeDef --------------------------------------------------------------
21516
21518 __parser__(ignore) typedef struct MkBufferStream64S MkBufferStream64CR;
21520 __parser__(ignore) typedef const struct MkBufferStream64S MkBufferStream64CNR;
21522 #define MkBufferStream64C_T (&MK_RT_REF._MkBufferStream64C_T)
21524 #define MkBufferStream64C_TT (MkTYP(MkBufferStream64C_T))
21526 #define MkBufferStream64ST MkBufferStream64C_T
21528 #define MkBufferStream64STT (MkTYP(MkBufferStream64ST))
21530 #define MkBufferStream64CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
21532 #define MkBufferStream64CTT_X(instance) (MkOBJ_R(instance).type)
21534 #define MkBufferStream64CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
21536 #define MkBufferStream64C_NS MK
21538 #define MkBufferStream64CTT MkBufferStream64CTT
21540 #define MkBufferStream64CT ( (struct MkTypeDefS *) MkBufferStream64CTT )
21541
21543
21546// MkBufferStream64C_Class_Define_C_API
21547
21548// END-MkBufferStream64S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21549
21551
21552// #######################################################################
21553// -----------------------------------------------------------------------
21559
21561#define MkBufferStream256S_ils_size (256)
21562
21566__parser__(ignore)
21567struct MkBufferStream256S {
21568 // BEGIN-MkBufferStream256S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21569
21570 union {
21571 struct MkObjectS obj; // instance-base MkObjectS
21572 struct MkBufferS buf; // instance-base MkBufferS
21573 struct MkBufferStreamS bus; // instance-base MkBufferStreamS
21574 } super;
21575
21576 // END-MkBufferStream256S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21577
21578 // instance attributes
21580};
21581
21582// BEGIN-MkBufferStream256S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21583
21587 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
21588
21589// Signature --------------------------------------------------------------
21592
21593 #define MkBufferStream256C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (2u<<3))
21594 #define MkBufferStream256C_MASK (((1u<<29)-1)<<3)
21595
21597
21598// CompileTimeCast --------------------------------------------------------------
21601
21602 #define MkBufferStream256C_X2bus(x) MkBUS(x)
21603 #define MkBufferStream256C_X2buf(x) MkBUF(x)
21604 #define MkBufferStream256C_X2obj(x) MkOBJ(x)
21605
21607
21608// TypeDef --------------------------------------------------------------
21611
21613 __parser__(ignore) typedef struct MkBufferStream256S MkBufferStream256CR;
21615 __parser__(ignore) typedef const struct MkBufferStream256S MkBufferStream256CNR;
21617 #define MkBufferStream256C_T (&MK_RT_REF._MkBufferStream256C_T)
21619 #define MkBufferStream256C_TT (MkTYP(MkBufferStream256C_T))
21621 #define MkBufferStream256ST MkBufferStream256C_T
21623 #define MkBufferStream256STT (MkTYP(MkBufferStream256ST))
21625 #define MkBufferStream256CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
21627 #define MkBufferStream256CTT_X(instance) (MkOBJ_R(instance).type)
21629 #define MkBufferStream256CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
21631 #define MkBufferStream256C_NS MK
21633 #define MkBufferStream256CTT MkBufferStream256CTT
21635 #define MkBufferStream256CT ( (struct MkTypeDefS *) MkBufferStream256CTT )
21636
21638
21641// MkBufferStream256C_Class_Define_C_API
21642
21643// END-MkBufferStream256S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21644
21646
21647// #######################################################################
21648// -----------------------------------------------------------------------
21654
21656#define MkBufferStream1024_ils_size (1024)
21657
21661__parser__(ignore)
21662struct MkBufferStream1024S {
21663 // BEGIN-MkBufferStream1024S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21664
21665 union {
21666 struct MkObjectS obj; // instance-base MkObjectS
21667 struct MkBufferS buf; // instance-base MkBufferS
21668 struct MkBufferStreamS bus; // instance-base MkBufferStreamS
21669 } super;
21670
21671 // END-MkBufferStream1024S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21672
21673 // instance attributes
21675};
21676
21677// BEGIN-MkBufferStream1024S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21678
21682 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
21683
21684// Signature --------------------------------------------------------------
21687
21688 #define MkBufferStream1024C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (4u<<3))
21689 #define MkBufferStream1024C_MASK (((1u<<29)-1)<<3)
21690
21692
21693// CompileTimeCast --------------------------------------------------------------
21696
21697 #define MkBufferStream1024C_X2bus(x) MkBUS(x)
21698 #define MkBufferStream1024C_X2buf(x) MkBUF(x)
21699 #define MkBufferStream1024C_X2obj(x) MkOBJ(x)
21700
21702
21703// TypeDef --------------------------------------------------------------
21706
21708 __parser__(ignore) typedef struct MkBufferStream1024S MkBufferStream1024CR;
21710 __parser__(ignore) typedef const struct MkBufferStream1024S MkBufferStream1024CNR;
21712 #define MkBufferStream1024C_T (&MK_RT_REF._MkBufferStream1024C_T)
21714 #define MkBufferStream1024C_TT (MkTYP(MkBufferStream1024C_T))
21716 #define MkBufferStream1024ST MkBufferStream1024C_T
21718 #define MkBufferStream1024STT (MkTYP(MkBufferStream1024ST))
21720 #define MkBufferStream1024CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
21722 #define MkBufferStream1024CTT_X(instance) (MkOBJ_R(instance).type)
21724 #define MkBufferStream1024CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
21726 #define MkBufferStream1024C_NS MK
21728 #define MkBufferStream1024CTT MkBufferStream1024CTT
21730 #define MkBufferStream1024CT ( (struct MkTypeDefS *) MkBufferStream1024CTT )
21731
21733
21736// MkBufferStream1024C_Class_Define_C_API
21737
21738// END-MkBufferStream1024S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21739
21741
21742// #######################################################################
21743// -----------------------------------------------------------------------
21749
21751#define MkBufferStream16384S_ils_size (16384)
21752
21756__parser__(ignore)
21757struct MkBufferStream16384S {
21758 // BEGIN-MkBufferStream16384S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21759
21760 union {
21761 struct MkObjectS obj; // instance-base MkObjectS
21762 struct MkBufferS buf; // instance-base MkBufferS
21763 struct MkBufferStreamS bus; // instance-base MkBufferStreamS
21764 } super;
21765
21766 // END-MkBufferStream16384S-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21767
21768 // instance attributes
21770};
21771
21772// BEGIN-MkBufferStream16384S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21773
21777 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
21778
21779// Signature --------------------------------------------------------------
21782
21783 #define MkBufferStream16384C_SIGNATURE (MkBufferStreamC_SIGNATURE ^ (1u<<3))
21784 #define MkBufferStream16384C_MASK (((1u<<29)-1)<<3)
21785
21787
21788// CompileTimeCast --------------------------------------------------------------
21791
21792 #define MkBufferStream16384C_X2bus(x) MkBUS(x)
21793 #define MkBufferStream16384C_X2buf(x) MkBUF(x)
21794 #define MkBufferStream16384C_X2obj(x) MkOBJ(x)
21795
21797
21798// TypeDef --------------------------------------------------------------
21801
21803 __parser__(ignore) typedef struct MkBufferStream16384S MkBufferStream16384CR;
21805 __parser__(ignore) typedef const struct MkBufferStream16384S MkBufferStream16384CNR;
21807 #define MkBufferStream16384C_T (&MK_RT_REF._MkBufferStream16384C_T)
21809 #define MkBufferStream16384C_TT (MkTYP(MkBufferStream16384C_T))
21811 #define MkBufferStream16384ST MkBufferStream16384C_T
21813 #define MkBufferStream16384STT (MkTYP(MkBufferStream16384ST))
21815 #define MkBufferStream16384CT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
21817 #define MkBufferStream16384CTT_X(instance) (MkOBJ_R(instance).type)
21819 #define MkBufferStream16384CT_TT(typ) ( (struct MkTypeDefS *) (typ) )
21821 #define MkBufferStream16384C_NS MK
21823 #define MkBufferStream16384CTT MkBufferStream16384CTT
21825 #define MkBufferStream16384CT ( (struct MkTypeDefS *) MkBufferStream16384CTT )
21826
21828
21831// MkBufferStream16384C_Class_Define_C_API
21832
21833// END-MkBufferStream16384S-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
21834
21836__parser__(ignore)
21837typedef struct MkBufferStream16384S MkBufferStream16384R;
21838
21840
21841/* ####################################################################### */
21842/* ### ### */
21843/* ### BufferStream - T O R - Api ### */
21844/* ### ### */
21845/* ####################################################################### */
21846
21853__parser__push__(doc-group=TOR);
21854
21863__parser__(constructor,lng-constr)
21866 MK_TYP type __parser__(internal,default=NULL),
21867 MK_NUM const size __parser__(default=0)
21869
21870#define MkBufferStreamCreate_1(size) MkBufferStreamCreate(NULL,size)
21871
21873__parser__(constructor)
21876 MK_NUM const size __parser__(default=0)
21878
21880__parser__(constructor)
21881MK_EXTERN MK_BUS MK_DECL MkBufferStreamCreate256_RT (
21883 MK_NUM const size __parser__(default=0)
21885
21887__parser__(constructor)
21888MK_EXTERN MK_BUS MK_DECL MkBufferStreamCreate1024_RT (
21890 MK_NUM const size __parser__(default=0)
21892
21894__parser__(constructor)
21895MK_EXTERN MK_BUS MK_DECL MkBufferStreamCreate16384_RT (
21897 MK_NUM const size __parser__(default=0)
21899
21914MK_EXTERN MK_BUS MK_DECL MkBufferStreamCreateTLS_RT (
21916 MK_STRN const tlsName ,
21917 bool const resetB __parser__(default=true)
21919
21920__parser__(constructor,macro)
21921void MkBufferStreamCreateLOCAL_T (MK_MACRO_TYP cls, MK_MACRO_TYP name, MK_NUM const size) MK_ATTR_STATIC ;
21931// [MkBufferStreamCreateLOCAL_T]
21932#define MkBufferStreamCreateLOCAL_T(cls,name,size) \
21933 cls##R name##R = {0}; \
21934 struct MkBufferStreamS * const name = cls##_X2bus(&name##R); \
21935 MkBufferStreamInit(name,cls##_TT,size)
21936// [MkBufferStreamCreateLOCAL_T]
21937
21938__parser__(constructor,macro)
21939void MkBufferStreamCreateSTATIC_T(MK_MACRO_TYP cls, MK_MACRO_TYP name) MK_ATTR_STATIC ;
21947// [MkBufferStreamCreateSTATIC_T]
21948#define MkBufferStreamCreateSTATIC_T(cls,name) \
21949 static cls##R name##R = {0}; \
21950 struct MkBufferStreamS * const name = cls##_X2bus(&name##R); \
21951 if (__MkCheckX(cls,&name##R)) { \
21952 MkBufferStreamReset(name); \
21953 } else { \
21954 MkBufferStreamInit(name,cls##TT,0); \
21955 } \
21956// [MkBufferStreamCreateSTATIC_T]
21957
21958__parser__(constructor,macro)
21959void MkBufferStreamCreateTLS_T(MK_MACRO_TYP cls, MK_MACRO_TYP name) MK_ATTR_STATIC ;
21967// [MkBufferStreamCreateTLS_T]
21968#define MkBufferStreamCreateTLS_T(cls,name) \
21969 static MkThreadLocal cls##R name##R = {0}; \
21970 struct MkBufferStreamS * const name = cls##_X2bus(&name##R); \
21971 if (__MkCheckX(cls,&name##R)) { \
21972 MkBufferStreamReset(name); \
21973 } else { \
21974 MkBufferStreamInit(name,cls##_TT,0); \
21975 } \
21976// [MkBufferStreamCreateTLS_T]
21977
22008__parser__(internal)
22011 MK_BUS const bus
22013
22017__parser__(internal)
22020 MK_BUS const bus,
22021 MK_TYP type __parser__(internal,default=NULL),
22022 MK_NUM const size __parser__(default=0)
22024
22030__parser__(destructor)
22031MK_EXTERN void MK_DECL MkBufferStreamDelete_RT (
22033 MK_BUS const bus
22035
22051__parser__(constructor)
22052MK_EXTERN MK_BUS MK_DECL MkBufferStreamMerge_RT (
22054 MK_BUS const bus
22056
22064__parser__(constructor)
22065MK_EXTERN MK_BUS MK_DECL MkBufferStreamDup_RT (
22067 MK_BUSN const src
22069
22071
22073// MkBufferStreamC_TOR_C_API
22074
22075/* ####################################################################### */
22076/* ### ### */
22077/* ### BufferStream - M I S C - Api ### */
22078/* ### ### */
22079/* ####################################################################### */
22080
22086
22087__parser__push__(doc-group=Misc);
22088
22095__parser__(const)
22096MK_EXTERN MK_BUS MK_DECL MkBufferStreamCopy_RT (
22098 MK_BUS const bus,
22099 MK_BUSN const src
22101
22108MK_EXTERN MK_BUS MK_DECL MkBufferStreamReset_RT (
22110 MK_BUS const bus
22112
22121MK_EXTERN void MK_DECL MkBufferStreamResetFull_RT (
22123 MK_BUS const bus
22125
22126__parser__(internal)
22127MK_EXTERN void MK_DECL MkBufferStreamLogS_RT (
22129 MK_BUS const bus ,
22130 MK_OBJ fmtobj __parser__(default=NULL),
22131 MK_STRN const callfunc __parser__(default=F#FUNC)
22133
22142// [MkBufferStreamLog_RT]
22143__parser__(const,class-overload=MkObjectLog)
22146 MK_BUS const bus ,
22148 MK_DBG const debug __parser__(default=0),
22149 MK_STRN const callfunc __parser__(default=F#FUNC),
22150 MK_I32 const lvl __parser__(default=0)
22152
22153#define MkBufferStreamLog_5F(bus,fmt,...) MkBufferStreamLog(bus,MkObj(fmt),__VA_ARGS__)
22154#define MkBufferStreamLog_2F(bus,fmt) MkBufferStreamLog_5F(bus,fmt,0,__func__,0)
22155#define MkBufferStreamLog_3F(bus,fmt,pfx) MkBufferStreamLog_5F(bus,fmt,0,pfx,0)
22156// [MkBufferStreamLog_RT]
22157
22161 MK_BUS const bus
22163
22165__parser__(class-overload=MkObjectToString)
22168 MK_BUSN const inst
22170
22179 MK_BUSN const bus
22181
22182__parser__pop__; // Misc
22183
22185// MkBufferStreamC_Misc_C_API
22186
22187/* ####################################################################### */
22188/* ### ### */
22189/* ### BufferStream - W R I T E - Api ### */
22190/* ### ### */
22191/* ####################################################################### */
22192
22203__parser__push__(doc-group=Write);
22204
22216 MK_BUS const bus,
22217 MK_I8 const val
22219
22224 MK_BUS const bus,
22225 MK_BOL const val
22227
22232 MK_BUS const bus,
22233 MK_I32 const val
22235
22240 MK_BUS const bus,
22241 MK_FLT const val
22243
22248 MK_BUS const bus,
22249 MK_I64 const val
22251
22256 MK_BUS const bus,
22257 MK_DBL const val
22259
22265 MK_BUS const bus,
22266 MK_STRN const val,
22267 MK_NUM const len __parser__(default=-1)
22269
22272MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteBIN_RT (
22274 MK_BUS const bus,
22275 MkBinaryR const val
22277
22280MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteBUF_RT (
22282 MK_BUS const bus,
22283 MK_BUFN const val
22285
22289MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteHDL_RT (
22291 MK_BUS const bus,
22292 MK_I32 const val
22294
22306MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteLONG_RT (
22308 MK_BUS const bus,
22309 MK_LONG const val
22311
22313MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteVL_RT (
22315 MK_BUS const bus,
22316 MK_STRN const fmt,
22317 va_list ap
22319
22321MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteV_RT (
22323 MK_BUS const bus,
22324 MK_STRN const fmt,
22325 ...
22327
22342MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteBFL_RT (
22344 MK_BUS const bus,
22345 MK_BFLN const bfl
22347
22366MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteL_FLAT_RT (
22368 MK_BUS const bus,
22369 MK_BFL const bfl
22371
22373MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteL_START_RT (
22375 MK_BUS const bus
22377
22379MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteL_END_RT (
22381 MK_BUS const bus
22383
22393MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamWriteBUS_FLAT_RT (
22395 MK_BUS const bus,
22396 MK_BUSN const add
22398
22399__parser__pop__; // Write
22400
22402// MkBufferStreamC_Write_C_API
22403
22404/* ####################################################################### */
22405/* ### ### */
22406/* ### BufferStream - R E A D - Api ### */
22407/* ### ### */
22408/* ####################################################################### */
22409
22419__parser__push__(doc-group=Read);
22420
22427MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadL_START_RT (
22429 MK_BUS const bus,
22430 MK_BUF buf __parser__(default=NULL)
22432
22434MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadL_END_RT (
22436 MK_BUS const bus
22438
22447MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadALL_RT (
22449 MK_BUS const bus,
22450 MK_BFL * const val_inout
22452
22472MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadBFL_RT (
22474 MK_BUS const bus,
22475 MK_BFL * const val_out
22477
22478__parser__(ignore)
22479MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadLIST_RT (
22481 MK_BUS const bus,
22482 MK_NAT_LIST * const val_out
22484
22485__parser__(ignore)
22486MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadNEXT_RT (
22488 MK_BUS const bus,
22489 MK_NAT_OBJECT * const val_out
22491
22503MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadLONG_RT (
22505 MK_BUS const bus,
22506 MK_LONG * const val_out
22508
22509// *******
22510
22524MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadI8_RT (
22526 MK_BUS const bus,
22527 MK_I8 * const val_out
22529
22532MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadBOL_RT (
22534 MK_BUS const bus,
22535 MK_BOL * const val_out
22537
22540MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadI32_RT (
22542 MK_BUS const bus,
22543 MK_I32 * const val_out
22545
22548MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadFLT_RT (
22550 MK_BUS const bus,
22551 MK_FLT * const val_out
22553
22556MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadI64_RT (
22558 MK_BUS const bus,
22559 MK_I64 * const val_out
22561
22564MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadDBL_RT (
22566 MK_BUS const bus,
22567 MK_DBL * const val_out
22569
22572MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadSTR_RT (
22574 MK_BUS const bus,
22575 MK_STRN * const val_out
22577
22582MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadBIN_RT (
22584 MK_BUS const bus,
22585 MkBinaryR * const val_out
22587
22590MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadBUF_RT (
22592 MK_BUS const bus,
22593 MK_BUF*const val_out
22595
22601MK_EXTERN bool MK_DECL MkBufferStreamReadItemExists_RT (
22603 MK_BUSN const bus
22605
22611MK_EXTERN enum MkTypeE MK_DECL MkBufferStreamReadGetNextType_RT (
22613 MK_BUSN const bus
22615
22621MK_EXTERN MK_NUM MK_DECL MkBufferStreamReadGetNumItems_RT (
22623 MK_BUSN const bus
22625
22634MK_EXTERN enum MkErrorE MK_DECL MkBufferStreamReadUndo_RT (
22636 MK_BUS const bus
22638
22639__parser__pop__; // Read
22640
22642// MkBufferStreamC_Read_C_API
22643
22645// MkBufferStreamC_C_API
22646
22647/* MARK_L ################################################################ */
22648/* ### ### */
22649/* ### B U F F E R - L I S T - A P I ### */
22650/* ### ### */
22651/* ####################################################################### */
22652
22654#include "MkBufferListC_def_mk.h"
22656
22657/* ####################################################################### */
22658/* ### ### */
22659/* ### L O G - F I L E - A P I ### */
22660/* ### ### */
22661/* ####################################################################### */
22662
22683
22684#define MkDbgLogData(d) \
22685 MkDbgV_2O(MK_ERROR_FORMAT,MK_COLOR_LIGHT_CYAN "FROM=%s -> TO=%s [%d]" MK_COLOR_RESET "\n", \
22686 MK_RT_REF.log.logNAME, (d), MK_RT_REF.log.logREF);
22687
22689__parser__(ignore)
22690typedef struct MkLogDataS {
22691
22692 #if defined(__cplusplus)
22693 #define MkLogDataEA(e) MkLogDataS::e
22694 #else
22695 #define MkLogDataEA(e) e
22696 #endif
22697
22698 enum MkLogDataE {
22699 MkLogDataE_UNDEF,
22700 MkLogDataE_STDERR,
22701 MkLogDataE_STDOUT,
22702 MkLogDataE_BUFFER,
22703 MkLogDataE_FILE
22704 } logWHAT;
22706 FILE *logFILE;
22708 #define MkLogDataS_LogNAME_size 256
22709 char logNAME[MkLogDataS_LogNAME_size];
22711 bool logLOCK;
22713 char *logBUF;
22715 size_t logSIZE;
22717 int logREF;
22718} MkLogDataS;
22719
22721struct MkLogFileS {
22722 // BEGIN-MkLogFileS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
22723
22724 union {
22725 struct MkObjectS obj; // instance-base MkObjectS
22726 } super;
22727
22728 // END-MkLogFileS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
22729
22730 // object body
22731 MkLogDataS logData;
22732};
22733
22734// BEGIN-MkLogFileS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
22735
22739 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
22740
22741// Signature --------------------------------------------------------------
22744
22745 #define MkLogFileC_SIGNATURE (MkObjectC_SIGNATURE ^ (3u<<10))
22746 #define MkLogFileC_MASK (((1u<<22)-1)<<10)
22747
22749
22750// CompileTimeCast --------------------------------------------------------------
22753
22754 #define MkLogFileC_X2lfl(x) (x)
22755 #define MkLogFileC_X2obj(x) MkOBJ(x)
22756
22758
22759// TypeDef --------------------------------------------------------------
22762
22764 __parser__(ignore) typedef struct MkLogFileS MkLogFileCR;
22766 __parser__(ignore) typedef const struct MkLogFileS MkLogFileCNR;
22768 #define MkLogFileC_T (&MK_RT_REF._MkLogFileC_T)
22770 #define MkLogFileC_TT (MkTYP(MkLogFileC_T))
22772 #define MkLogFileST MkLogFileC_T
22774 #define MkLogFileSTT (MkTYP(MkLogFileST))
22776 #define MkLogFileC_type MK_LFL
22778 #define MkLogFileCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
22780 #define MkLogFileCTT_X(instance) (MkOBJ_R(instance).type)
22782 #define MkLogFileCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
22784 #define MkLogFileC_NS MK
22786 #define MkLogFileCTT MkLogFileCTT
22788 #define MkLogFileCT ( (struct MkTypeDefS *) MkLogFileCTT )
22789
22791
22792// TypeCheck --------------------------------------------------------------
22795
22796 #pragma GCC diagnostic push
22797 #pragma GCC diagnostic ignored "-Wattributes"
22798
22801 __parser__(class=MkLogFileC,static,hide)
22803 mk_inline bool MkLflCheck (MK_MNGN mng) {
22804 return MkSanitizeCheck(MkLogFileC,mng);
22805 }
22806
22809 __parser__(class=MkLogFileC,static,hide)
22811 mk_inline bool MkLflCheckO (MK_OBJN obj) {
22812 return MkSanitizeCheckO(MkLogFileC,obj);
22813 }
22814
22815 #pragma GCC diagnostic pop
22816 #define MkLogFileC_Check(mng) MkLflCheck(mng)
22817
22819
22820// RunTimeCast --------------------------------------------------------------
22823
22825 __parser__(class=MkLogFileC,hide,static)
22826 META_ATTRIBUTE_SANITIZE
22828 mk_inline MK_LFL MkLfl(MK_MNG mng) {
22829 return (MkLflCheck(mng) ? (MK_LFL)mng : NULL);
22830 }
22831
22833 __parser__(class=MkLogFileC,hide,static)
22834 META_ATTRIBUTE_SANITIZE
22836 mk_inline MK_LFLN MkLflN(MK_MNGN mng) {
22837 return (MkLflCheck(mng) ? (MK_LFLN)mng : NULL);
22838 }
22839
22841 #define MkLflRaise(_lfl) if (!_MkCheckX(MkLogFileC,_lfl)) { \
22842 MkErrorSetC_1E("'MkLogFileC' hdl is NULL"); \
22843 goto error ; \
22844 }
22845
22847 #define MkLFL_R(x) (*(x)).super.lfl
22849 #define MkLFL(x) (&MkLFL_R(x))
22850
22852
22855// MkLogFileC_Class_Define_C_API
22856
22857// END-MkLogFileS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
22858
22859// =========================================================================
22860// BEGIN-MkLogFileS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
22861
22864
22867
22868__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkLogFileC);
22869
22885__parser__(class-overload=MkObjectHandleGet)
22889 MK_LFL const lfl __parser__(null-allowed)
22890) {
22891 return MkObjectHandleGet(lfl?MkOBJ(lfl):NULL);
22892}
22893
22902__parser__(flags=new)
22904mk_inline MK_LFL MkLogFileHandleResolve_RT (
22906 MK_HDL const netHdl
22907) {
22908 return MkLfl(MkObjectHandleResolve(netHdl));
22909}
22910
22920#define MkLogFileHandleResolve_e(netHdl) ({ \
22921 MK_HDL tmpHdl=netHdl; \
22922 MK_LFL tmp; \
22923 if (tmpHdl==0) { \
22924 tmp=NULL; \
22925 } else { \
22926 tmp=MkLogFileHandleResolve(tmpHdl); \
22927 if (tmp==NULL) { \
22928 MkErrorSetC_1_NULL("ERROR: 'MkLogFileC' handle is 'NULL'"); \
22929 goto error; \
22930 }; \
22931 }; \
22932 tmp; \
22933})
22934
22936
22938// Class export & import
22939
22943 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkLogFileC,null-return-allow)
22946 return (MK_LFL)MK_NULL;
22947 }
22949// MkLogFileC - Misc - function
22950
22952// MkLogFileC_Class_C_API
22953
22954// END-MkLogFileS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
22955
22956// #######################################################################
22957// -----------------------------------------------------------------------
22963
22964__parser__push__(doc-group=TOR,class=MkLogFileC);
22965
22976__parser__(constructor,lng-constr)
22981 MK_STRN const file,
22982 MK_LFL * lfh_out
22984
22990__parser__(destructor)
22993 MK_LFL lfh
22995
22996__parser__pop__; // TOR
22997
22999// MkLogFileC_TOR_C_API
23000
23001// #######################################################################
23002// -----------------------------------------------------------------------
23007
23008__parser__push__(doc-group=Write);
23009
23020 MK_LFLN lfl __parser__(null-allowed),
23021 MK_FST printfmt,
23022 va_list var_list
23024
23034 MK_LFLN lfl __parser__(null-allowed),
23035 MK_FST printfmt,
23036 ...
23038
23045__parser__(no-type-extension)
23046MK_EXTERN enum MkErrorE
23047MkLogFileWriteC_RT (
23049 MK_LFLN lfl __parser__(null-allowed),
23050 MK_STRN text
23052
23059MK_EXTERN enum MkErrorE
23060MkLogFileGetFile_RT (
23062 MK_LFLN lfl,
23063 MK_STRN *file_out
23065
23066__parser__pop__; // Write
23067
23069// MkLogFileC_Write_C_API
23070
23072// MkLogFileC_C_API
23073
23074/* MARK_X ################################################################ */
23075/* ### ### */
23076/* ### E X T E N S I O N - A P I ### */
23077/* ### ### */
23078/* ####################################################################### */
23079
23087
23088#define MkDbgMkExt2(c,x) mk_dbg_color_ln(c,"MkExtensionS: ptr<%p>, next<%p>, prev<%p>", (x), (x)->next, (x)->prev)
23089#define MkDbgMkExt(x) MkDbgMkExt2(MK_COLOR_CYAN,x)
23090
23091__parser__push__(doc-group=_ignore_);
23092
23093__parser__(internal)
23095typedef struct MkExtensionS {
23096 // BEGIN-MkExtensionS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23097
23098 union {
23099 struct MkObjectS obj; // instance-base MkObjectS
23100 } super;
23101
23102 // END-MkExtensionS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23103
23104 // instance attributes
23105 struct MkExtensionS *next, *prev;
23106} MkExtensionS;
23107
23108// BEGIN-MkExtensionS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23109
23113 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
23114
23115// Signature --------------------------------------------------------------
23118
23119 #define MkExtensionC_SIGNATURE (MkObjectC_SIGNATURE ^ (9u<<10))
23120 #define MkExtensionC_MASK (((1u<<22)-1)<<10)
23121
23123
23124// CompileTimeCast --------------------------------------------------------------
23127
23128 #define MkExtensionC_X2ext(x) (x)
23129 #define MkExtensionC_X2obj(x) MkOBJ(x)
23130
23132
23133// TypeDef --------------------------------------------------------------
23136
23138 __parser__(ignore) typedef struct MkExtensionS MkExtensionCR;
23140 __parser__(ignore) typedef const struct MkExtensionS MkExtensionCNR;
23142 #define MkExtensionC_T (&MK_RT_REF._MkExtensionC_T)
23144 #define MkExtensionC_TT (MkTYP(MkExtensionC_T))
23146 #define MkExtensionST MkExtensionC_T
23148 #define MkExtensionSTT (MkTYP(MkExtensionST))
23150 #define MkExtensionC_type MK_EXT
23152 #define MkExtensionCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
23154 #define MkExtensionCTT_X(instance) (MkOBJ_R(instance).type)
23156 #define MkExtensionCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
23158 #define MkExtensionC_NS MK
23160 #define MkExtensionCTT MkExtensionCTT
23162 #define MkExtensionCT ( (struct MkTypeDefS *) MkExtensionCTT )
23163
23165
23166// TypeCheck --------------------------------------------------------------
23169
23170 #pragma GCC diagnostic push
23171 #pragma GCC diagnostic ignored "-Wattributes"
23172
23175 __parser__(class=MkExtensionC,static,ignore)
23177 mk_inline bool MkExtCheck (MK_MNGN mng) {
23178 return MkSanitizeCheck(MkExtensionC,mng);
23179 }
23180
23183 __parser__(class=MkExtensionC,static,ignore)
23185 mk_inline bool MkExtCheckO (MK_OBJN obj) {
23186 return MkSanitizeCheckO(MkExtensionC,obj);
23187 }
23188
23189 #pragma GCC diagnostic pop
23190 #define MkExtensionC_Check(mng) MkExtCheck(mng)
23191
23193
23194// RunTimeCast --------------------------------------------------------------
23197
23199 __parser__(class=MkExtensionC,ignore,static)
23200 META_ATTRIBUTE_SANITIZE
23202 mk_inline MK_EXT MkExt(MK_MNG mng) {
23203 return (MkExtCheck(mng) ? (MK_EXT)mng : NULL);
23204 }
23205
23207 __parser__(class=MkExtensionC,ignore,static)
23208 META_ATTRIBUTE_SANITIZE
23210 mk_inline MK_EXTN MkExtN(MK_MNGN mng) {
23211 return (MkExtCheck(mng) ? (MK_EXTN)mng : NULL);
23212 }
23213
23215 #define MkExtRaise(_ext) if (!_MkCheckX(MkExtensionC,_ext)) { \
23216 MkErrorSetC_1E("'MkExtensionC' hdl is NULL"); \
23217 goto error ; \
23218 }
23219
23221 #define MkEXT_R(x) (*(x)).super.ext
23223 #define MkEXT(x) (&MkEXT_R(x))
23224
23226
23229// MkExtensionC_Class_Define_C_API
23230
23231// END-MkExtensionS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23232
23236#define MkExtension_size 64
23237
23238__parser__(internal)
23241 MK_EXT head
23243
23245__parser__(internal)
23248 MK_EXT head,
23249 MK_EXT add
23251
23253__parser__(internal)
23256 MK_EXT head,
23257 MK_EXT del
23259
23260/*
23261//__parser__(internal)
23262//MK_EXTERN MK_EXT MK_DECL MkExtensionSearch (MK_EXT head, MK_TYP typ);
23263*/
23264
23265__parser__pop__; // __parser__push__(doc-group=_ignore_);
23266
23268// MkExtensionC_C_API
23269
23270/* MARK_E ################################################################ */
23271/* ### ### */
23272/* ### E R R O R - A P I ### */
23273/* ### ### */
23274/* ####################################################################### */
23275
23303
23304#define MkDbgErr_2(err,col) \
23305 mk_dbg_color_ln(col,"MkDbgErr[%p]: check<%d>, mkrt<%s>, isLocal<%d>, format_of_error<%p>", \
23306 err, MkErrCheck(err), MkDbgRtChkX(err), MkOBJ(err)->obj_protect.isLocal, err->format_of_error)
23307#define MkDbgErr(err) MkDbgErr_2(err,MK_COLOR_WHITE)
23308
23309#if META_DEBUG & META_DEBUG_ERROR
23310__parser__(ignore)
23311MK_EXTERN void MK_DECL MkDbgError_RT (
23314 MK_STRN const callfunc __parser__(default=F#FUNC)
23316#endif
23317
23321struct MkErrorS {
23322 // BEGIN-MkErrorS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23323
23324 union {
23325 struct MkObjectS obj; // instance-base MkObjectS
23326 } super;
23327
23328 // END-MkErrorS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23329
23330 // instance attributes
23331 enum MkErrorE code;
23332 struct MkBuffer1024S text;
23333 MK_I32 num;
23334 bool append;
23335 bool noRaise;
23336
23337 MK_OBJN format_of_error;
23338 MK_MNGN source_of_error;
23339
23340 MK_ERREXT mkErrExt;
23341};
23342
23343// BEGIN-MkErrorS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23344
23348 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
23349
23350// Signature --------------------------------------------------------------
23353
23354 #define MkErrorC_SIGNATURE (MkObjectC_SIGNATURE ^ (4u<<10))
23355 #define MkErrorC_MASK (((1u<<22)-1)<<10)
23356
23358
23359// CompileTimeCast --------------------------------------------------------------
23362
23363 #define MkErrorC_X2err(x) (x)
23364 #define MkErrorC_X2obj(x) MkOBJ(x)
23365
23367
23368// TypeDef --------------------------------------------------------------
23371
23373 __parser__(ignore) typedef struct MkErrorS MkErrorCR;
23375 __parser__(ignore) typedef const struct MkErrorS MkErrorCNR;
23377 #define MkErrorC_T (&MK_RT_REF._MkErrorC_T)
23379 #define MkErrorC_TT (MkTYP(MkErrorC_T))
23381 #define MkErrorST MkErrorC_T
23383 #define MkErrorSTT (MkTYP(MkErrorST))
23385 #define MkErrorC_type MK_ERR
23387 #define MkErrorCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
23389 #define MkErrorCTT_X(instance) (MkOBJ_R(instance).type)
23391 #define MkErrorCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
23393 #define MkErrorC_NS MK
23395 #define MkErrorCTT MkErrorCTT
23397 #define MkErrorCT ( (struct MkTypeDefS *) MkErrorCTT )
23398
23400
23401// TypeCheck --------------------------------------------------------------
23404
23405 #pragma GCC diagnostic push
23406 #pragma GCC diagnostic ignored "-Wattributes"
23407
23410 __parser__(class=MkErrorC,static,hide)
23412 mk_inline bool MkErrCheck (MK_MNGN mng) {
23413 return MkSanitizeCheck(MkErrorC,mng);
23414 }
23415
23418 __parser__(class=MkErrorC,static,hide)
23420 mk_inline bool MkErrCheckO (MK_OBJN obj) {
23421 return MkSanitizeCheckO(MkErrorC,obj);
23422 }
23423
23424 #pragma GCC diagnostic pop
23425
23427
23428// RunTimeCast --------------------------------------------------------------
23431
23433 __parser__(class=MkErrorC,hide,static)
23434 META_ATTRIBUTE_SANITIZE
23436 mk_inline MK_ERR MkErr(MK_MNG mng) {
23437 return (MkErrCheck(mng) ? (MK_ERR)mng : NULL);
23438 }
23439
23441 __parser__(class=MkErrorC,hide,static)
23442 META_ATTRIBUTE_SANITIZE
23444 mk_inline MK_ERRN MkErrN(MK_MNGN mng) {
23445 return (MkErrCheck(mng) ? (MK_ERRN)mng : NULL);
23446 }
23447
23449 #define MkErrRaise(_err) if (!_MkCheckX(MkErrorC,_err)) { \
23450 MkErrorSetC_1E("'MkErrorC' hdl is NULL"); \
23451 goto error ; \
23452 }
23453
23455 #define MkERR_R(x) (*(x)).super.err
23457 #define MkERR(x) (&MkERR_R(x))
23458
23460
23463// MkErrorC_Class_Define_C_API
23464
23465// END-MkErrorS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23466
23468// MkErrorC_C_API
23469
23470// =========================================================================
23471// BEGIN-MkErrorS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23472
23475
23478
23479__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkErrorC);
23480
23496__parser__(class-overload=MkObjectHandleGet)
23500 MK_ERR const err __parser__(null-allowed)
23501) {
23502 return MkObjectHandleGet(err?MkOBJ(err):NULL);
23503}
23504
23513__parser__(flags=new)
23515mk_inline MK_ERR MkErrorHandleResolve_RT (
23517 MK_HDL const netHdl
23518) {
23519 return MkErr(MkObjectHandleResolve(netHdl));
23520}
23521
23531#define MkErrorHandleResolve_e(netHdl) ({ \
23532 MK_HDL tmpHdl=netHdl; \
23533 MK_ERR tmp; \
23534 if (tmpHdl==0) { \
23535 tmp=NULL; \
23536 } else { \
23537 tmp=MkErrorHandleResolve(tmpHdl); \
23538 if (tmp==NULL) { \
23539 MkErrorSetC_1_NULL("ERROR: 'MkErrorC' handle is 'NULL'"); \
23540 goto error; \
23541 }; \
23542 }; \
23543 tmp; \
23544})
23545
23547
23549// Class export & import
23550
23554 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkErrorC,null-return-allow)
23557 return (MK_ERR)MK_NULL;
23558 }
23560// MkErrorC - Misc - function
23561
23563// MkErrorC_Class_C_API
23564
23565// END-MkErrorS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23566
23567// #######################################################################
23568// -----------------------------------------------------------------------
23575
23576#define MK_ERREXT_ARGS MK_RT_ARGS MK_ERR const mkerr, MK_ERREXT const errext
23577#define MK_ERREXT_CALL MK_RT_CALL err, errext
23578
23579#define MK_ERREXT_ARGS_N MK_RT_ARGS MK_ERRN const mkerr, MK_ERREXT const errext
23580#define MK_ERREXT_CALL_N MK_RT_CALL err, errext
23581
23582__parser__(ignore)
23583typedef bool (*MkErrorAppendFLT) (MK_ERREXT_ARGS, MK_OBJN const fmtobj);
23584
23585__parser__(ignore)
23586typedef void (*MkErrorResetF) (MK_ERREXT_ARGS, MK_OBJN const fmtobj);
23587
23588__parser__(ignore)
23589typedef bool (*MkErrorResetOnExitF) (MK_ERREXT_ARGS, MK_OBJN const fmtobj);
23590
23592__parser__(ignore)
23593typedef void (*MkErrorPanikF) (MK_ERREXT_ARGS_N, MK_OBJN const errobj, MK_STRN const prefix,
23594 MK_I32 const errnum, MK_STRN const fmt, va_list ap);
23595
23596__parser__(ignore)
23597typedef void (*MkErrorLogF) (MK_ERREXT_ARGS_N, MK_OBJN const, MK_DBG const, MK_STRN const,
23598 MK_I32 const, MK_STRN const, MK_OBJ const);
23599
23600__parser__(ignore)
23601typedef MK_OBJN (*MkErrorFormatOfF) (MK_ERREXT_ARGS_N, int const dummy);
23602
23603__parser__(ignore)
23604typedef void (*MkErrorSetRF) (MK_ERREXT_ARGS, MK_MNGN const errctx, MK_OBJN const fmtobj);
23605
23606__parser__(ignore)
23607typedef void (*MkErrorSetEF) (MK_ERREXT_ARGS, MK_ERREXT const newerr, MK_OBJN const fmtobj);
23608
23609__parser__(ignore)
23610typedef bool (*MkErrorSetVLF) (MK_ERREXT_ARGS, MK_OBJN const fmtobj, MK_STRN const);
23611
23612__parser__(ignore)
23613typedef void (*MkErrorInit) (MK_ERREXT_ARGS, MK_OBJN const fmtobj);
23614
23616__parser__(ignore)
23617struct MkErrExtS {
23618 // BEGIN-MkErrExtS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23619
23620 union {
23621 struct MkObjectS obj; // instance-base MkObjectS
23622 struct MkExtensionS ext; // instance-base MkExtensionS
23623 } super;
23624
23625 // END-MkErrExtS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23626
23627 MK_ERR mkerrhead;
23628
23630 MkErrorAppendFLT fErrorAppend;
23631
23633 MkErrorResetF fErrorReset;
23634
23636 MkErrorResetOnExitF fErrorResetOnExit;
23637
23639 MkErrorPanikF fErrorPanik;
23640
23642 MkErrorLogF fErrorLog;
23643
23645 MkErrorFormatOfF fErrorFormatOf;
23646
23648 MkErrorSetRF fErrorSetR;
23649
23651 MkErrorSetEF fErrorSetE;
23652
23654 MkErrorSetVLF fErrorSetVL;
23655
23657 MkErrorInit fErrorInit;
23658};
23659
23660// BEGIN-MkErrExtS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23661
23665 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
23666
23667// Signature --------------------------------------------------------------
23670
23671 #define MkErrExtC_SIGNATURE (MkExtensionC_SIGNATURE ^ (1u<<6))
23672 #define MkErrExtC_MASK (((1u<<26)-1)<<6)
23673
23675
23676// CompileTimeCast --------------------------------------------------------------
23679
23680 #define MkErrExtC_X2errext(x) (x)
23681 #define MkErrExtC_X2ext(x) MkEXT(x)
23682 #define MkErrExtC_X2obj(x) MkOBJ(x)
23683
23685
23686// TypeDef --------------------------------------------------------------
23689
23691 __parser__(ignore) typedef struct MkErrExtS MkErrExtCR;
23693 __parser__(ignore) typedef const struct MkErrExtS MkErrExtCNR;
23695 #define MkErrExtC_T (&MK_RT_REF._MkErrExtC_T)
23697 #define MkErrExtC_TT (MkTYP(MkErrExtC_T))
23699 #define MkErrExtST MkErrExtC_T
23701 #define MkErrExtSTT (MkTYP(MkErrExtST))
23703 #define MkErrExtC_type MK_ERREXT
23705 #define MkErrExtCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
23707 #define MkErrExtCTT_X(instance) (MkOBJ_R(instance).type)
23709 #define MkErrExtCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
23711 #define MkErrExtC_NS MK
23713 #define MkErrExtCTT MkErrExtCTT
23715 #define MkErrExtCT ( (struct MkTypeDefS *) MkErrExtCTT )
23716
23718
23719// TypeCheck --------------------------------------------------------------
23722
23723 #pragma GCC diagnostic push
23724 #pragma GCC diagnostic ignored "-Wattributes"
23725
23728 __parser__(class=MkErrExtC,static,ignore)
23730 mk_inline bool MkErrExtCheck (MK_MNGN mng) {
23731 return MkSanitizeCheck(MkErrExtC,mng);
23732 }
23733
23736 __parser__(class=MkErrExtC,static,ignore)
23738 mk_inline bool MkErrExtCheckO (MK_OBJN obj) {
23739 return MkSanitizeCheckO(MkErrExtC,obj);
23740 }
23741
23742 #pragma GCC diagnostic pop
23743 #define MkErrExtC_Check(mng) MkErrExtCheck(mng)
23744
23746
23747// RunTimeCast --------------------------------------------------------------
23750
23752 __parser__(class=MkErrExtC,ignore,static)
23753 META_ATTRIBUTE_SANITIZE
23755 mk_inline MK_ERREXT MkErrExt(MK_MNG mng) {
23756 return (MkErrExtCheck(mng) ? (MK_ERREXT)mng : NULL);
23757 }
23758
23760 __parser__(class=MkErrExtC,ignore,static)
23761 META_ATTRIBUTE_SANITIZE
23763 mk_inline MK_ERREXTN MkErrExtN(MK_MNGN mng) {
23764 return (MkErrExtCheck(mng) ? (MK_ERREXTN)mng : NULL);
23765 }
23766
23768 #define MkErrExtRaise(_errext) if (!_MkCheckX(MkErrExtC,_errext)) { \
23769 MkErrorSetC_1E("'MkErrExtC' hdl is NULL"); \
23770 goto error ; \
23771 }
23772
23774 #define MkERREXT_R(x) (*(x)).super.errext
23776 #define MkERREXT(x) (&MkERREXT_R(x))
23777
23779
23782// MkErrExtC_Class_Define_C_API
23783
23784// END-MkErrExtS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23785
23786#define MkErrExtAdd(_mkerrR,add) do { \
23787 (_mkerrR).mkErrExt = (typeof((_mkerrR).mkErrExt)) MkExtensionAdd(MkEXT((_mkerrR).mkErrExt),MkEXT(add)); \
23788 /* printV("MkErrExtAdd = %p, mkrt=%p", &(_mkerrR).mkErrExt, MK_RT_PTR); */ \
23789 MkERREXT_R(add).mkerrhead = &(_mkerrR); \
23790} while (0) \
23791
23792#define MkErrExtDel(_mkerrR,del) do { \
23793 /* printV("MkErrExtDel = %p, mkrt=%p", &(_mkerrR).mkErrExt, MK_RT_PTR); */ \
23794 (_mkerrR).mkErrExt = (typeof((_mkerrR).mkErrExt)) MkExtensionDel(MkEXT((_mkerrR).mkErrExt),MkEXT(del)); \
23795 MkERREXT_R(del).mkerrhead = NULL; \
23796} while (0) \
23797
23799// MkErrExtC_C_API
23800
23801// #######################################################################
23802// -----------------------------------------------------------------------
23810
23812__parser__(ignore)
23813struct MkErrorPanicS {
23814 // BEGIN-MkErrorPanicS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23815
23816 union {
23817 struct MkObjectS obj; // instance-base MkObjectS
23818 } super;
23819
23820 // END-MkErrorPanicS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23821};
23822
23823// BEGIN-MkErrorPanicS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23824
23828 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
23829
23830// Signature --------------------------------------------------------------
23833
23834 #define MkErrorPanicC_SIGNATURE (MkObjectC_SIGNATURE ^ (7u<<10))
23835 #define MkErrorPanicC_MASK (((1u<<22)-1)<<10)
23836
23838
23839// CompileTimeCast --------------------------------------------------------------
23842
23843 #define MkErrorPanicC_X2obj(x) MkOBJ(x)
23844
23846
23847// TypeDef --------------------------------------------------------------
23850
23852 __parser__(ignore) typedef struct MkErrorPanicS MkErrorPanicCR;
23854 __parser__(ignore) typedef const struct MkErrorPanicS MkErrorPanicCNR;
23856 #define MkErrorPanicC_T (&MK_RT_REF._MkErrorPanicC_T)
23858 #define MkErrorPanicC_TT (MkTYP(MkErrorPanicC_T))
23860 #define MkErrorPanicST MkErrorPanicC_T
23862 #define MkErrorPanicSTT (MkTYP(MkErrorPanicST))
23864 #define MkErrorPanicCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
23866 #define MkErrorPanicCTT_X(instance) (MkOBJ_R(instance).type)
23868 #define MkErrorPanicCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
23870 #define MkErrorPanicC_NS MK
23872 #define MkErrorPanicCTT MkErrorPanicCTT
23874 #define MkErrorPanicCT ( (struct MkTypeDefS *) MkErrorPanicCTT )
23875
23877
23880// MkErrorPanicC_Class_Define_C_API
23881
23882// END-MkErrorPanicS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23883
23885// MkErrorPanicC_C_API
23886
23887// #######################################################################
23888// -----------------------------------------------------------------------
23896
23898__parser__(ignore)
23899struct MkErrorExitS {
23900 // BEGIN-MkErrorExitS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23901
23902 union {
23903 struct MkObjectS obj; // instance-base MkObjectS
23904 } super;
23905
23906 // END-MkErrorExitS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23907};
23908
23909// BEGIN-MkErrorExitS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23910
23914 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
23915
23916// Signature --------------------------------------------------------------
23919
23920 #define MkErrorExitC_SIGNATURE (MkObjectC_SIGNATURE ^ (8u<<10))
23921 #define MkErrorExitC_MASK (((1u<<22)-1)<<10)
23922
23924
23925// CompileTimeCast --------------------------------------------------------------
23928
23929 #define MkErrorExitC_X2obj(x) MkOBJ(x)
23930
23932
23933// TypeDef --------------------------------------------------------------
23936
23938 __parser__(ignore) typedef struct MkErrorExitS MkErrorExitCR;
23940 __parser__(ignore) typedef const struct MkErrorExitS MkErrorExitCNR;
23942 #define MkErrorExitC_T (&MK_RT_REF._MkErrorExitC_T)
23944 #define MkErrorExitC_TT (MkTYP(MkErrorExitC_T))
23946 #define MkErrorExitST MkErrorExitC_T
23948 #define MkErrorExitSTT (MkTYP(MkErrorExitST))
23950 #define MkErrorExitCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
23952 #define MkErrorExitCTT_X(instance) (MkOBJ_R(instance).type)
23954 #define MkErrorExitCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
23956 #define MkErrorExitC_NS MK
23958 #define MkErrorExitCTT MkErrorExitCTT
23960 #define MkErrorExitCT ( (struct MkTypeDefS *) MkErrorExitCTT )
23961
23963
23966// MkErrorExitC_Class_Define_C_API
23967
23968// END-MkErrorExitS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23969
23971// MkErrorExitC_C_API
23972
23973// #######################################################################
23974// -----------------------------------------------------------------------
23982
23984__parser__(ignore)
23985struct MkErrorIgnoreS {
23986 // BEGIN-MkErrorIgnoreS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23987
23988 union {
23989 struct MkObjectS obj; // instance-base MkObjectS
23990 } super;
23991
23992 // END-MkErrorIgnoreS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23993};
23994
23995// BEGIN-MkErrorIgnoreS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
23996
24000 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
24001
24002// Signature --------------------------------------------------------------
24005
24006 #define MkErrorIgnoreC_SIGNATURE (MkObjectC_SIGNATURE ^ (5u<<10))
24007 #define MkErrorIgnoreC_MASK (((1u<<22)-1)<<10)
24008
24010
24011// CompileTimeCast --------------------------------------------------------------
24014
24015 #define MkErrorIgnoreC_X2obj(x) MkOBJ(x)
24016
24018
24019// TypeDef --------------------------------------------------------------
24022
24024 __parser__(ignore) typedef struct MkErrorIgnoreS MkErrorIgnoreCR;
24026 __parser__(ignore) typedef const struct MkErrorIgnoreS MkErrorIgnoreCNR;
24028 #define MkErrorIgnoreC_T (&MK_RT_REF._MkErrorIgnoreC_T)
24030 #define MkErrorIgnoreC_TT (MkTYP(MkErrorIgnoreC_T))
24032 #define MkErrorIgnoreST MkErrorIgnoreC_T
24034 #define MkErrorIgnoreSTT (MkTYP(MkErrorIgnoreST))
24036 #define MkErrorIgnoreCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
24038 #define MkErrorIgnoreCTT_X(instance) (MkOBJ_R(instance).type)
24040 #define MkErrorIgnoreCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
24042 #define MkErrorIgnoreC_NS MK
24044 #define MkErrorIgnoreCTT MkErrorIgnoreCTT
24046 #define MkErrorIgnoreCT ( (struct MkTypeDefS *) MkErrorIgnoreCTT )
24047
24049
24052// MkErrorIgnoreC_Class_Define_C_API
24053
24054// END-MkErrorIgnoreS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
24055
24057// MkErrorIgnoreC_C_API
24058
24059// #######################################################################
24060// -----------------------------------------------------------------------
24067
24070__parser__(ignore)
24071struct MkErrorPrintS {
24072 // BEGIN-MkErrorPrintS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
24073
24074 union {
24075 struct MkObjectS obj; // instance-base MkObjectS
24076 } super;
24077
24078 // END-MkErrorPrintS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
24079};
24080
24081// BEGIN-MkErrorPrintS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
24082
24086 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
24087
24088// Signature --------------------------------------------------------------
24091
24092 #define MkErrorPrintC_SIGNATURE (MkObjectC_SIGNATURE ^ (6u<<10))
24093 #define MkErrorPrintC_MASK (((1u<<22)-1)<<10)
24094
24096
24097// CompileTimeCast --------------------------------------------------------------
24100
24101 #define MkErrorPrintC_X2obj(x) MkOBJ(x)
24102
24104
24105// TypeDef --------------------------------------------------------------
24108
24110 __parser__(ignore) typedef struct MkErrorPrintS MkErrorPrintCR;
24112 __parser__(ignore) typedef const struct MkErrorPrintS MkErrorPrintCNR;
24114 #define MkErrorPrintC_T (&MK_RT_REF._MkErrorPrintC_T)
24116 #define MkErrorPrintC_TT (MkTYP(MkErrorPrintC_T))
24118 #define MkErrorPrintST MkErrorPrintC_T
24120 #define MkErrorPrintSTT (MkTYP(MkErrorPrintST))
24122 #define MkErrorPrintCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
24124 #define MkErrorPrintCTT_X(instance) (MkOBJ_R(instance).type)
24126 #define MkErrorPrintCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
24128 #define MkErrorPrintC_NS MK
24130 #define MkErrorPrintCTT MkErrorPrintCTT
24132 #define MkErrorPrintCT ( (struct MkTypeDefS *) MkErrorPrintCTT )
24133
24135
24138// MkErrorPrintC_Class_Define_C_API
24139
24140// END-MkErrorPrintS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
24141
24143//MkErrorPrintC_C_API
24144
24145// #######################################################################
24146// -----------------------------------------------------------------------
24153
24160__parser__(ignore)
24161struct MkErrorDefaultS {
24162 // BEGIN-MkErrorDefaultS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
24163
24164 union {
24165 struct MkObjectS obj; // instance-base MkObjectS
24166 struct MkErrorS err; // instance-base MkErrorS
24167 } super;
24168
24169 // END-MkErrorDefaultS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
24170};
24171
24172// BEGIN-MkErrorDefaultS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
24173
24177 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
24178
24179// Signature --------------------------------------------------------------
24182
24183 #define MkErrorDefaultC_SIGNATURE (MkErrorC_SIGNATURE ^ (1u<<6))
24184 #define MkErrorDefaultC_MASK (((1u<<26)-1)<<6)
24185
24187
24188// CompileTimeCast --------------------------------------------------------------
24191
24192 #define MkErrorDefaultC_X2err(x) MkERR(x)
24193 #define MkErrorDefaultC_X2obj(x) MkOBJ(x)
24194
24196
24197// TypeDef --------------------------------------------------------------
24200
24202 __parser__(ignore) typedef struct MkErrorDefaultS MkErrorDefaultCR;
24204 __parser__(ignore) typedef const struct MkErrorDefaultS MkErrorDefaultCNR;
24206 #define MkErrorDefaultC_T (&MK_RT_REF._MkErrorDefaultC_T)
24208 #define MkErrorDefaultC_TT (MkTYP(MkErrorDefaultC_T))
24210 #define MkErrorDefaultST MkErrorDefaultC_T
24212 #define MkErrorDefaultSTT (MkTYP(MkErrorDefaultST))
24214 #define MkErrorDefaultCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
24216 #define MkErrorDefaultCTT_X(instance) (MkOBJ_R(instance).type)
24218 #define MkErrorDefaultCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
24220 #define MkErrorDefaultC_NS MK
24222 #define MkErrorDefaultCTT MkErrorDefaultCTT
24224 #define MkErrorDefaultCT ( (struct MkTypeDefS *) MkErrorDefaultCTT )
24225
24227
24230// MkErrorDefaultC_Class_Define_C_API
24231
24232// END-MkErrorDefaultS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
24233
24235// MkErrorDefaultC_C_API
24236
24237// #######################################################################
24238// -----------------------------------------------------------------------
24243
24244__parser__push__(doc-group=System,class=MkErrorC);
24245
24249#define MkERROR_R(r) ((*r).error_mk)
24250#define MkERROR MkERROR_R(&MK_RT_REF)
24251#define MkERROR_RT MkERROR_R(&MK_RT_REF)
24252#define MkERROR_O(o) MkERROR_R(MkRT_O(o))
24253#define MkERROR_X(x) MkERROR_R(MkRT_X(x))
24254#define MkERROR_XN(x) MkERROR_R(MkRT_XN(x))
24255#define MkERROR_NULL MkERROR_R(&MkRuntimeRLS)
24257
24261
24263#define MK_ERROR_DEFAULT_R(r) MkOBJ(&(*r).error_mk)
24264#define MK_ERROR_DEFAULT MK_ERROR_DEFAULT_R(&MK_RT_REF)
24265#define MK_ERROR_DEFAULT_X(x) MK_ERROR_DEFAULT_R(MkRT_X(x))
24266#define MK_ERROR_DEFAULT_NULL MK_ERROR_DEFAULT_R(&MkRuntimeRLS)
24267
24275
24277// END: MkErrorDEFAULT
24278
24282
24283#define MK_ERROR_PANIC_R(r) MkOBJ(&(*r).error_panic)
24284#define MK_ERROR_PANIC MK_ERROR_PANIC_R(&MK_RT_REF)
24285#define MK_ERROR_PANIC_X(x) MK_ERROR_PANIC_R(MkRT_X(x))
24287#define MK_ERROR_PANIC_NULL MK_ERROR_PANIC_R(&MkRuntimeRLS)
24288
24304__parser__(hide)
24306
24308// END: MkErrorPanik
24309
24313
24314#define MK_ERROR_EXIT_R(r) MkOBJ(&(*r).error_exit)
24315#define MK_ERROR_EXIT MK_ERROR_EXIT_R(&MK_RT_REF)
24316#define MK_ERROR_EXIT_X(x) MK_ERROR_EXIT_R(MkRT_X(x))
24318#define MK_ERROR_EXIT_NULL MK_ERROR_EXIT_R(&MkRuntimeRLS)
24319
24335__parser__(hide)
24337
24339// END: MkErrorExit
24340
24344
24345#define MK_ERROR_IGNORE_R(r) MkOBJ(&(*r).error_ignore)
24346#define MK_ERROR_IGNORE MK_ERROR_IGNORE_R(&MK_RT_REF)
24347#define MK_ERROR_IGNORE_X(x) MK_ERROR_IGNORE_R(MkRT_X(x))
24348#define MK_ERROR_IGNORE_XN(x) MK_ERROR_IGNORE_R(MkRT_XN(x))
24350#define MK_ERROR_IGNORE_NULL MK_ERROR_IGNORE_R(&MkRuntimeRLS)
24351
24377
24379// MkErrorIgnore
24380
24384
24385#define MK_ERROR_PRINT_R(r) MkOBJ(&(*r).error_print)
24386#define MK_ERROR_PRINT MK_ERROR_PRINT_R(&MK_RT_REF)
24387#define MK_ERROR_PRINT_X(x) MK_ERROR_PRINT_R(MkRT_X(x))
24389#define MK_ERROR_PRINT_NULL MK_ERROR_PRINT_R(&MkRuntimeRLS)
24390
24405
24407// MkErrorPrintln
24408
24412
24413#define MK_ERROR_FORMAT_R(r) ((*r).error_mk.format_of_error ? (*r).error_mk.format_of_error : \
24414 MkObjN((*r).error_mk.source_of_error) ? MkObjN((*r).error_mk.source_of_error) : \
24415 MK_ERROR_DEFAULT_R(r))
24416#define MK_ERROR_FORMAT MK_ERROR_FORMAT_R(&MK_RT_REF)
24417#define MK_ERROR_FORMAT_X(x) MK_ERROR_FORMAT_R(MkRT_X(x))
24419#define MK_ERROR_FORMAT_NULL MK_ERROR_FORMAT_R(&MkRuntimeRLS)
24420
24441
24442#define MkErrorFORMAT_1M(m) MkErrorFORMAT(MkObjN(m))
24443#define MkErrorFORMAT_1X(x) MkErrorFORMAT(MkOBJ(x))
24444#define MkErrorFORMAT_1O(o) MkErrorFORMAT(o)
24445
24447__parser__(internal)
24451
24453
24455
24457// END: MkErrorC_System_C_API
24458
24459// #######################################################################
24460// -----------------------------------------------------------------------
24465
24466__parser__push__(doc-group=TOR);
24467
24473__parser__(destructor)
24476 MK_ERR err
24478
24486__parser__(constructor)
24489 MK_ERRN const srce
24491
24497 MK_ERR dest,
24498 MK_ERRN const srce
24500
24501__parser__pop__; // TOR
24502
24504// MkErrorC_TOR_C_API
24505
24506// #######################################################################
24507// -----------------------------------------------------------------------
24512
24513__parser__push__(doc-group=Get);
24514
24516__parser__(error-ignore,inline=MkErrorGetCodeI)
24518 MK_ERRN const err
24520
24522#define MkErrorGetCodeI(e) ((*e).code)
24524#define MkErrorGetCodeE_NULL() (MkERROR_NULL.code)
24526#define MkErrorGetCode_O(o) (MkERROR_O(o).code)
24527
24531 MK_ERRN const err
24533
24535#define MkErrorGetTextI(e) (MkBUF_R(&(*e).text).storage.first.C)
24536
24540 MK_ERRN const err
24542
24544#define MkErrorGetSizeI(e) ((MK_SIZE)MkBUF_R(&(*e).text).var.cursize)
24545
24549 MK_ERRN const err
24551
24553#define MkErrorGetNumI(e) ((*e).num)
24554
24556
24558// MkErrorC_Get_C_API
24559
24560/*****************************************************************************/
24561/* */
24562/* error set */
24563/* */
24564/*****************************************************************************/
24565
24566// #######################################################################
24567// -----------------------------------------------------------------------
24573
24574__parser__push__(doc-group=Signal);
24575
24579 MK_ERR const err
24581
24582#define MkErrorSetCONTINUE_0E() MkErrorSetCONTINUE(&MkERROR)
24583
24605 MK_ERR const err,
24606 MK_STRN const callfunc __parser__(default=F#FUNC)
24608
24617 MK_ERR const err,
24618 MK_STRN const detail __parser__(default=S#"UNKNOWN"),
24619 MK_STRN const callfunc __parser__(default=F#FUNC)
24621
24635 MK_ERR const err,
24636 MK_STRN const detail __parser__(default=S#"UNKNOWN"),
24637 MK_STRN const callfunc __parser__(default=F#FUNC)
24639
24643 MK_ERR const err,
24644 enum MkErrorE code
24646
24649 MK_ERRN const err
24651
24654 MK_ERRN const err
24656
24659 MK_ERRN const err
24661
24688 MK_ERR const err
24690
24691__parser__pop__; // Signal
24692
24694// MkErrorC_Signal_C_API
24695
24696/*****************************************************************************/
24697/* */
24698/* error_is/check */
24699/* */
24700/*****************************************************************************/
24701
24709
24711#define MkErrorCheckI(err) ((err) >= MK_ERROR)
24715#define MkErrorCheckE_0E() (MkErrorCheckI(MkErrorGetCode_0E()))
24716#define MkErrorCheckE_NULL() (MkErrorCheckI(MkErrorGetCodeE_NULL()))
24717#define MkErrorCheckE_O(o) (MkErrorCheckI(MkErrorGetCode_O(o)))
24718#define MkErrorCheckE_X(x) MkErrorCheckE_O(MkOBJ(x))
24719#define MkErrorCheckE_E(e) (MkErrorCheckI((e)->code))
24722#define MkErrorCheck(err) if (MkErrorCheckI(err)) goto error
24724#define MkErrorE_Check(err) if (MkErrorCheckI(err)) goto error
24726#define MkErrorCheck_0E() if (MkErrorCheckE_0E()) goto error
24728#define MkErrorBreak(err) if (MkErrorCheckI(err)) break
24730#define MkContinueCheck(err) switch (err) { \
24731case MK_OK: break; case MK_CONTINUE: goto cont; case MK_ERROR: goto error;\
24732};
24733
24735#define MkErrorSwitch(PROC) switch (PROC) {\
24736case MK_OK: break; case MK_ERROR: goto error; case MK_CONTINUE: return MK_CONTINUE;\
24737}
24738
24739/*
24740OLD and unused
24741
24743#define MkErrorReturnAppend(PROC) \
24744if (MkErrorCheckI(PROC)) { \
24745 return MkErrorStack_0E (); \
24746} else if (MkErrorCheckE_0E()) { \
24747 return MkErrorReset_0E (); \
24748} else { \
24749 return MkERROR.code; \
24750}
24751*/
24753#define MkErrorReturn_2X(mngx,PROC) switch (PROC) {\
24754case MK_OK: return MK_OK; case MK_CONTINUE: return MK_CONTINUE; default: return MkErrorStack_1X (mngx);\
24755};
24757#define MkErrorReturn_1(PROC) switch (PROC) {\
24758case MK_OK: return MK_OK; case MK_CONTINUE: return MK_CONTINUE; default: return MkErrorStack_0E ();\
24759};
24761#define MkErrorReturn(PROC) MkErrorReturn_2X(META_CONTEXT_S,PROC)
24763#define check_MkErrorE(PROC) if (MkErrorCheckI(PROC))
24764
24766#define MkErrorReturnLabel(mng) \
24767 return MK_OK; \
24768error: \
24769 return MkErrorStack_1M(mng);
24770
24772// MkErrorCheck...
24773
24774// #######################################################################
24775// -----------------------------------------------------------------------
24782
24783__parser__global__(prefix2class:MkPanic=MkErrorC);
24784__parser__push__(doc-group=Raise);
24785
24799 MK_STRN const callfunc __parser__(default=F#FUNC),
24800 MK_I32 const errnum __parser__(default=-1),
24801 MK_FST const printfmt,
24802 va_list var_list
24803) MK_ATTR_RT_INSTANCE __attribute__((noreturn));
24804
24805#define MkPanicVL_5M(errobj,callfunc,errnum,printfmt,var_list) \
24806 MkPanicVL(MkObj(errobj),callfunc,errnum,printfmt,var_list)
24807
24820 MK_STRN const callfunc __parser__(default=F#FUNC),
24821 MK_I32 const errnum __parser__(default=-1),
24822 MK_FST const printfmt,
24823 ...
24824) MK_ATTR_RT_INSTANCE MK_RT_ATTR_FORMAT_4 __attribute__((noreturn));
24825
24826#define MkPanicV_4M(errobj,callfunc,errnum,printfmt,...) \
24827 MkPanicV(MkObj(errobj),callfunc,errnum,printfmt,__VA_ARGS__)
24828
24829#define MkPanicV_2M(x,printfmt,...) \
24830 MkPanicV_2(MkObj(x),printfmt,__VA_ARGS__)
24831
24841__parser__(no-type-extension,no-rpc)
24845 MK_STRN const callfunc __parser__(default=F#FUNC),
24846 MK_I32 const errnum __parser__(default=-1),
24847 MK_STRN const message
24848) MK_ATTR_RT_INSTANCE __attribute__ ((noreturn));
24849
24850#define MkPanicC_4M(errobj,callfunc,errnum,message) \
24851 MkPanicC(MkObj(errobj),callfunc,errnum,message)
24852
24853#define MkPanicC_2M(x,message) MkPanicC_2(MkObj(x),message)
24854
24862__parser__(no-rpc)
24866 MK_STRN const callfunc __parser__(default=F#FUNC)
24868
24869#define MkPanicDEFAULT_2M(errobj,...) MkPanicDEFAULT(MkObj(errobj),__VA_ARGS__)
24870#define MkPanicDEFAULT_1M(x) MkPanicDEFAULT_1(MkObj(x))
24871
24876#define MkPanicSYS(mngx) do { \
24877 MkLogC_2X(mngx,"internal ERROR, please contact your local support\n"); \
24878 MkDisasterSignal(-1); \
24879} while (0)
24880
24886__parser__(internal,overload-c-no)
24888 MK_I32 signal __parser__(default=-1) // NO signal
24889) __attribute__ ((noreturn));
24890
24897MK_EXTERN void MK_DECL MkErrorAppendVL_RT (
24899 MK_ERR const err,
24900 MK_FST const printfmt,
24901 va_list var_list
24903
24909__parser__(no-type-extension)
24910MK_EXTERN void MK_DECL MkErrorAppendV_RT (
24912 MK_ERR const err,
24913 MK_FST const printfmt,
24914 ...
24916
24922__parser__(no-type-extension)
24923MK_EXTERN void MK_DECL MkErrorAppendC_RT (
24925 MK_ERR const err,
24926 MK_STRN const message
24928
24947__parser__(doc-group=Raise)
24948MK_EXTERN MK_ERR MK_DECL MkErrorNoRaise_RT (
24950 MK_ERR const err
24952
24973__parser__(internal)
24974MK_EXTERN enum MkErrorE MK_DECL MkErrorSetR_RT (
24976 MK_ERR const err,
24977 MK_STRN const message,
24978 enum MkErrorE const errcode __parser__(default=F#MK_ERROR),
24979 MK_I32 const errnum __parser__(default=-1),
24980 MK_MNG const errctx __parser__(default=NULL)
24982
24991__parser__(hide)
24994 MK_ERR const err,
24995 MK_ERR const newerr
24997
25009__parser__(no-type-extension)
25012 MK_ERR err,
25013 MK_STRN const message,
25014 MK_STRN const callfunc __parser__(default=F#FUNC),
25015 MK_I32 const errnum __parser__(default=-1)
25017
25018#define MkErrorSetC_1XS(message) MkErrorSetC_4M(META_CONTEXT_S,message,__func__,-1)
25019#define MkErrorSetC_2E_E(caller,message) MkErrorCheck(MkErrorSetC_2E(message,caller))
25020
25021#define MkErrorSetC_4_NULL(...) MkErrorSetC_RT(MK_RT_NULL __VA_ARGS__)
25022#define MkErrorSetC_3_NULL(...) MkErrorSetC_4_NULL(&MkERROR_NULL,__VA_ARGS__)
25023#define MkErrorSetC_2_NULL(msg,pfx) MkErrorSetC_3_NULL(msg,pfx,-1)
25024#define MkErrorSetC_1_NULL(msg) MkErrorSetC_3_NULL(msg,__func__,-1)
25025
25026#define MkErrorSetC_4M_NULL(m,...) MkErrorSetC_4_NULL(MkErrorFORMAT_1M(m),__VA_ARGS__)
25027#define MkErrorSetC_3M_NULL(m,msg,pfx) MkErrorSetC_4M_NULL(m,msg,pfx,-1)
25028#define MkErrorSetC_2M_NULL(m,msg) MkErrorSetC_4M_NULL(m,msg,__func__,-1)
25029
25043__parser__(no-type-extension)
25046 MK_ERR err,
25047 MK_STRN const callfunc __parser__(default=F#FUNC),
25048 MK_I32 const errnum __parser__(default=-1),
25049 MK_FST const printfmt,
25050 va_list var_list
25052
25065__parser__(no-type-extension)
25068 MK_ERR err,
25069 MK_STRN const callfunc __parser__(default=F#FUNC),
25070 MK_I32 const errnum __parser__(default=-1),
25071 MK_FST const printfmt,
25072 ...
25074
25075#define MkErrorSetV_4EO_NULL(o,...) MkErrorSetV_NULL(MkErrorFORMAT_EO(o), __VA_ARGS__)
25076#define MkErrorSetV_4M_NULL(m,...) MkErrorSetV_NULL(MkErrorFORMAT_1M(m),__VA_ARGS__)
25077#define MkErrorSetV_2M_NULL(m,...) MkErrorSetV_4M_NULL(m,__func__,-1,__VA_ARGS__)
25078#define MkErrorSetV_2X(x,...) MkErrorSetV(MkErrorFORMAT_1X(x),__func__,-1,__VA_ARGS__)
25079
25080#define MkErrorSetV_1_NULL(printfmt,...) \
25081 MkErrorSetV_NULL(&MkERROR_NULL,__func__,-1,printfmt,__VA_ARGS__)
25082
25083#define MkErrorSetV_1XS(printfmt,...) \
25084 MkErrorSetV_4M(META_CONTEXT_S,__func__,-1,printfmt,__VA_ARGS__)
25085
25086#define MkErrorSetV_2E_E(caller,printfmt,...) \
25087 MkErrorCheck(MkErrorSetV_2E(caller,printfmt,__VA_ARGS__))
25088
25089#define MkErrorSet_ObjectIsNullError(m,printfmt,...) \
25090 MkErrorSetV_4M(m,"ObjectIsNullError",-1,printfmt,__VA_ARGS__)
25091
25092#define MkErrorSysO(obj,cmd) \
25093 MkErrorSetV_4EO_NULL (obj, __func__, errno, \
25094 "can not '%s' -> ERR<%s>", MK_CPPXSTR(cmd), strerror (errno))
25095
25096__parser__pop__; // Raise
25097
25099// MkErrorC_Raise_C_API
25100
25101// #######################################################################
25102// -----------------------------------------------------------------------
25107
25108__parser__push__(doc-group=Misc);
25109
25130 MK_ERR const err,
25131 MK_STRN const callfunc __parser__(default=F#FUNC),
25132 MK_I32 const callline __parser__(default=F#LINE)
25134
25144 MK_ERR const err,
25145 MK_STRN const msg __parser__(default=S#""),
25146 MK_STRN const callfunc __parser__(default=F#FUNC),
25147 MK_I32 const callline __parser__(default=F#LINE)
25149
25150#define MkErrorPrintln_0() MkErrorPrintln_0E()
25151
25162__parser__(const,class-overload=MkObjectLog)
25165 MK_ERRN const err ,
25167 MK_DBG const debug __parser__(default=0),
25168 MK_STRN const callfunc __parser__(default=F#FUNC),
25169 MK_I32 const lvl __parser__(default=0)
25171
25172#define MkErrorLog_1EF_NULL(fmt) MkErrorLog(&MkERROR_NULL,fmt,0,__func__,0)
25173#define MkErrorLog_1EF(fmt) MkErrorLog_4E(fmt,0,__func__,0)
25174
25192__parser__(no-rpc,template-overload)
25195 MK_ERR const err,
25196 MK_EXP const exception __parser__(default=NULL,has-reference),
25197 MK_STRN const callfunc __parser__(default=F#FUNC)
25199
25225__parser__(no-rpc,template-overload)
25228 MK_OBJN const obj,
25229 MK_EXP const exception __parser__(default=NULL,has-reference),
25230 MK_STRN const callfunc __parser__(default=F#FUNC)
25232
25234#define MkObjectErrorCatch_3X(x,...) MkObjectErrorCatch(MkOBJ(x),__VA_ARGS__)
25235
25243__parser__(doc-group=Raise)
25246 MK_ERRN const err
25248
25257// [MkErrorReset-example]
25260 MK_ERR const err,
25261 MK_STRN const callfunc __parser__(default=F#FUNC),
25262 MK_I32 const callline __parser__(default=F#LINE),
25263 bool const force __parser__(default=B#false)
25265
25266#define MkErrorReset_0M() MkErrorReset_4M(NULL,__func__,__LINE__,0);
25267#define MkErrorResetFORCE_1(m) MkErrorReset_4M(m,__func__,__LINE__,1);
25268#define MkErrorResetFORCE_0() MkErrorReset_4M(NULL,__func__,__LINE__,1);
25269
25270#define MkErrorReset_4X(x,...) MkErrorReset(MkErrorFORMAT_1X(x),__VA_ARGS__)
25271#define MkErrorReset_1X(x) MkErrorReset_4X(x,__func__,__LINE__,0)
25272// [MkErrorReset-example]
25273
25281MK_EXTERN void
25284 MK_ERR const err,
25285 MK_STRN callfunc __parser__(default=F#FUNC),
25286 MK_STRN callfile __parser__(default=F#FILE),
25287 MK_I32 const callline __parser__(default=F#LINE)
25289
25298__parser__(error-ignore,no-rpc)
25302 MK_ERR const err __parser__(default=NULL),
25303 MK_STRN const callfunc __parser__(default=F#FUNC),
25304 MK_STRN const callfile __parser__(default=F#FILE),
25305 MK_I32 const callline __parser__(default=F#LINE)
25307
25308#define MkErrorStack_1M_Check(m) (MkErrorCheckE_0E() ? MkErrorStack_1M(m) : MkErrorGetCode_0E())
25309#define MkErrorStack_0E_Check() (MkErrorCheckE_0E() ? MkErrorStack_0E() : MkErrorGetCode_0E())
25310
25311#define MkErrorStack_4X(x,...) MkErrorStack_RT(MK_RT_CALL MkErrorFORMAT_1X(x),__VA_ARGS__)
25312#define MkErrorStack_3X(...) MkErrorStack_4X(__VA_ARGS__,__LINE__)
25313#define MkErrorStack_2X(...) MkErrorStack_4X(__VA_ARGS__,__FILE__,__LINE__)
25314#define MkErrorStack_1X(...) MkErrorStack_4X(__VA_ARGS__,__func__,__FILE__,__LINE__)
25315
25316#define MkErrorStack_0_NULL() MkErrorStack_NULL(&MkERROR_NULL,__func__,__FILE__,__LINE__)
25317
25318#define MkErrorStack_4X_NULL(x,...) MkErrorStack_NULL(MkErrorFORMAT_1X(x),__VA_ARGS__)
25319#define MkErrorStack_3X_NULL(...) MkErrorStack_4X_NULL(__VA_ARGS__,__LINE__)
25320#define MkErrorStack_2X_NULL(...) MkErrorStack_4X_NULL(__VA_ARGS__,__FILE__,__LINE__)
25321#define MkErrorStack_1X_NULL(...) MkErrorStack_4X_NULL(__VA_ARGS__,__func__,__FILE__,__LINE__)
25322
25323#define MkErrorStack_NUM 50
25324#define MkErrorStack_STR "50"
25325
25327__parser__(class-overload=MkObjectToString)
25331 MK_ERRN const inst
25333
25334__parser__pop__; // Misc
25335
25337// MkErrorC_Misc_C_API
25338
25339// #######################################################################
25340// -----------------------------------------------------------------------
25366
25377__parser__(class=MkExceptionC,ignore)
25378bool MkExceptionCheck (MK_EXP exception);
25379
25385__parser__(class=MkExceptionC,ignore)
25386void MkExceptionRaise (
25387 MK_MNG const expobj,
25388 MK_STRN const callfunc,
25389 MK_I32 const callline
25390) ;
25391
25399__parser__(class=MkExceptionC,ignore)
25401 MK_MNG const expobj,
25402 MK_EXP const exception,
25403 MK_STRN const callfunc
25404) ;
25405
25407// MkException_C_API
25408
25409// #######################################################################
25410// -----------------------------------------------------------------------
25416
25418__parser__(ignore)
25419struct MkRtExtS {
25420 // BEGIN-MkRtExtS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
25421
25422 union {
25423 struct MkObjectS obj; // instance-base MkObjectS
25424 struct MkExtensionS ext; // instance-base MkExtensionS
25425 } super;
25426
25427 // END-MkRtExtS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
25428
25429 MK_RT mkrtHead;
25430};
25431
25432// BEGIN-MkRtExtS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
25433
25437 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
25438
25439// Signature --------------------------------------------------------------
25442
25443 #define MkRtExtC_SIGNATURE (MkExtensionC_SIGNATURE ^ (2u<<6))
25444 #define MkRtExtC_MASK (((1u<<26)-1)<<6)
25445
25447
25448// CompileTimeCast --------------------------------------------------------------
25451
25452 #define MkRtExtC_X2rtext(x) (x)
25453 #define MkRtExtC_X2ext(x) MkEXT(x)
25454 #define MkRtExtC_X2obj(x) MkOBJ(x)
25455
25457
25458// TypeDef --------------------------------------------------------------
25461
25463 __parser__(ignore) typedef struct MkRtExtS MkRtExtCR;
25465 __parser__(ignore) typedef const struct MkRtExtS MkRtExtCNR;
25467 #define MkRtExtC_T (&MK_RT_REF._MkRtExtC_T)
25469 #define MkRtExtC_TT (MkTYP(MkRtExtC_T))
25471 #define MkRtExtST MkRtExtC_T
25473 #define MkRtExtSTT (MkTYP(MkRtExtST))
25475 #define MkRtExtC_type MK_RTEXT
25477 #define MkRtExtCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
25479 #define MkRtExtCTT_X(instance) (MkOBJ_R(instance).type)
25481 #define MkRtExtCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
25483 #define MkRtExtC_NS MK
25485 #define MkRtExtCTT MkRtExtCTT
25487 #define MkRtExtCT ( (struct MkTypeDefS *) MkRtExtCTT )
25488
25490
25491// TypeCheck --------------------------------------------------------------
25494
25495 #pragma GCC diagnostic push
25496 #pragma GCC diagnostic ignored "-Wattributes"
25497
25500 __parser__(class=MkRtExtC,static,ignore)
25502 mk_inline bool MkRtExtCheck (MK_MNGN mng) {
25503 return MkSanitizeCheck(MkRtExtC,mng);
25504 }
25505
25508 __parser__(class=MkRtExtC,static,ignore)
25510 mk_inline bool MkRtExtCheckO (MK_OBJN obj) {
25511 return MkSanitizeCheckO(MkRtExtC,obj);
25512 }
25513
25514 #pragma GCC diagnostic pop
25515 #define MkRtExtC_Check(mng) MkRtExtCheck(mng)
25516
25518
25519// RunTimeCast --------------------------------------------------------------
25522
25524 __parser__(class=MkRtExtC,ignore,static)
25525 META_ATTRIBUTE_SANITIZE
25527 mk_inline MK_RTEXT MkRtExt(MK_MNG mng) {
25528 return (MkRtExtCheck(mng) ? (MK_RTEXT)mng : NULL);
25529 }
25530
25532 __parser__(class=MkRtExtC,ignore,static)
25533 META_ATTRIBUTE_SANITIZE
25535 mk_inline MK_RTEXTN MkRtExtN(MK_MNGN mng) {
25536 return (MkRtExtCheck(mng) ? (MK_RTEXTN)mng : NULL);
25537 }
25538
25540 #define MkRtExtRaise(_rtext) if (!_MkCheckX(MkRtExtC,_rtext)) { \
25541 MkErrorSetC_1E("'MkRtExtC' hdl is NULL"); \
25542 goto error ; \
25543 }
25544
25546 #define MkRTEXT_R(x) (*(x)).super.rtext
25548 #define MkRTEXT(x) (&MkRTEXT_R(x))
25549
25551
25554// MkRtExtC_Class_Define_C_API
25555
25556// END-MkRtExtS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
25557
25558#define MkRtExtAdd(_mkrtR,add,id) do { \
25559 (_mkrtR).mkRtExt = (typeof((_mkrtR).mkRtExt)) MkExtensionAdd(MkEXT((_mkrtR).mkRtExt),MkEXT(add)); \
25560 MkRTEXT_R(add).mkrtHead = &(_mkrtR); \
25561 (_mkrtR).mkRtExtAry[id] = MkRTEXT(add); \
25562} while (0) \
25563
25564#define MkRtExtDel(_mkrtR,del,id) do { \
25565 (_mkrtR).mkRtExt = (typeof((_mkrtR).mkRtExt)) MkExtensionDel(MkEXT((_mkrtR).mkRtExt),MkEXT(del)); \
25566 MkRTEXT_R(del).mkrtHead = NULL; \
25567 (_mkrtR).mkRtExtAry[id] = NULL; \
25568} while (0) \
25569
25571// MkRtExtC_C_API
25572
25573// #######################################################################
25574// -----------------------------------------------------------------------
25575//
25576// \addtogroup MqExceptionC_C_API
25577// \{
25578// \brief target-language class to 'set' and 'raise' an error …
25579//
25580// \}
25581// MqExceptionC_C_API
25582
25583/* MARK_R ################################################################ */
25584/* ### ### */
25585/* ### R U N T I M E - A P I ### */
25586/* ### ### */
25587/* ####################################################################### */
25588
25589__parser__global__(prefix2class:MkRuntime=MkRuntimeC);
25590
25637#define MkDbgRt_1(c) mk_dbg_color_ln(c,"mkrt<%p>, MkRT<%p>", mkrt, MkRT)
25638#define MkDbgRt() MkDbgRt_1(MK_COLOR_PURPLE)
25639#define MkDbgRtChkX(x) (MkRT_X(x)==MkRT?"ok":"wrong")
25640
25641__parser__(ignore)
25642typedef struct MkThreadDataS {
25643 MK_STRB name[32];
25644 MK_PTR ptr;
25646
25649
25650#pragma GCC diagnostic push
25651#pragma GCC diagnostic ignored "-Wlto-type-mismatch"
25652
25653#if defined(MK_C_BUILD_DLL)
25654
25655 #define META_SECTION_DEFINE
25656 #include "MkRuntimeS_mk.h"
25657 #undef META_SECTION_DEFINE
25658
25659#else
25660
25662struct MkRuntimeS {
25663
25664 // ======================================================================================
25665 // PUBLIC variables -> sync with MkRuntimeS_mk.h !!
25666
25667 // !!! sync with MkRuntimeS_mk.h
25668
25679
25680 // BEGIN-MkRuntimeS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
25681
25682 union {
25683 struct MkObjectS obj; // instance-base MkObjectS
25684 } super;
25685
25686 // END-MkRuntimeS-super - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
25687
25689 struct MkErrorS error_mk;
25690
25692 struct MkErrorPanicS error_panic;
25693
25695 struct MkErrorPanicS error_exit;
25696
25698 struct MkErrorIgnoreS error_ignore;
25699
25701 struct MkErrorPrintS error_print;
25702
25707
25712 bool isSilent;
25713
25715 bool noDeco;
25716
25723 MK_I32 debug;
25724
25726 MkLogDataS log;
25727
25729
25731 struct MkBuffer64S tbuf;
25732
25734 MkThreadDataS mkThreadData;
25735
25737 MK_RTEXT mkRtExt;
25739 MK_RTEXT mkRtExtAry[MkExtension_size];
25740
25742 MkSelfIncrF fSelfIncr;
25743
25745 MkSelfDecrF fSelfDecr;
25746
25756 bool MkSelfIncrOnCacheB;
25757
25758 // ======================================================================================
25759 // TYPES
25760
25761 // BEGIN-rtDef - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
25762
25763 struct MkTypeDefS _MkObjectC_T ;
25764 struct MkTypeDefS _MkBufferC_T ;
25765 struct MkTypeDefS _MkBuffer64C_T ;
25766 struct MkTypeDefS _MkBuffer256C_T ;
25767 struct MkTypeDefS _MkBuffer1024C_T ;
25768 struct MkTypeDefS _MkBufferStreamC_T ;
25769 struct MkTypeDefS _MkBufferStream16384C_T ;
25770 struct MkTypeDefS _MkBufferStream256C_T ;
25771 struct MkTypeDefS _MkBufferStream64C_T ;
25772 struct MkTypeDefS _MkBufferStream1024C_T ;
25773 struct MkTypeDefS _MkBufferListC_T ;
25774 struct MkTypeDefS _MkLogFileC_T ;
25775 struct MkTypeDefS _MkErrorC_T ;
25776 struct MkTypeDefS _MkErrorDefaultC_T ;
25777 struct MkTypeDefS _MkErrorIgnoreC_T ;
25778 struct MkTypeDefS _MkErrorPrintC_T ;
25779 struct MkTypeDefS _MkErrorPanicC_T ;
25780 struct MkTypeDefS _MkErrorExitC_T ;
25781 struct MkTypeDefS _MkExtensionC_T ;
25782 struct MkTypeDefS _MkErrExtC_T ;
25783 struct MkTypeDefS _MkRtExtC_T ;
25784 struct MkTypeDefS _MkRuntimeC_T ;
25785 struct MkTypeS _MkTypeC_TT ;
25786 struct MkTypeS _MkTypeDefC_TT ;
25787
25788 // END-rtDef - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
25789
25790 // offset calculated by "Nhi1InternalSize"
25791 MK_BINB private_variables[12986];
25792};
25793
25794#endif
25795
25796#pragma GCC diagnostic pop
25797
25798// BEGIN-MkRuntimeS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
25799
25803 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
25804
25805// Signature --------------------------------------------------------------
25808
25809 #define MkRuntimeC_SIGNATURE (MkObjectC_SIGNATURE ^ (10u<<10))
25810 #define MkRuntimeC_MASK (((1u<<22)-1)<<10)
25811
25813
25814// CompileTimeCast --------------------------------------------------------------
25817
25818 #define MkRuntimeC_X2rt(x) (x)
25819 #define MkRuntimeC_X2obj(x) MkOBJ(x)
25820
25822
25823// TypeDef --------------------------------------------------------------
25826
25828 __parser__(ignore) typedef struct MkRuntimeS MkRuntimeCR;
25830 __parser__(ignore) typedef const struct MkRuntimeS MkRuntimeCNR;
25832 #define MkRuntimeC_T (&MK_RT_REF._MkRuntimeC_T)
25834 #define MkRuntimeC_TT (MkTYP(MkRuntimeC_T))
25836 #define MkRuntimeST MkRuntimeC_T
25838 #define MkRuntimeSTT (MkTYP(MkRuntimeST))
25840 #define MkRuntimeC_type MK_RT
25842 #define MkRuntimeCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
25844 #define MkRuntimeCTT_X(instance) (MkOBJ_R(instance).type)
25846 #define MkRuntimeCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
25848 #define MkRuntimeC_NS MK
25850 #define MkRuntimeCTT MkRuntimeCTT
25852 #define MkRuntimeCT ( (struct MkTypeDefS *) MkRuntimeCTT )
25853
25855
25856// TypeCheck --------------------------------------------------------------
25859
25860 #pragma GCC diagnostic push
25861 #pragma GCC diagnostic ignored "-Wattributes"
25862
25865 __parser__(class=MkRuntimeC,static,hide)
25867 mk_inline bool MkRtCheck (MK_MNGN mng) {
25868 return MkSanitizeCheck(MkRuntimeC,mng);
25869 }
25870
25873 __parser__(class=MkRuntimeC,static,hide)
25875 mk_inline bool MkRtCheckO (MK_OBJN obj) {
25876 return MkSanitizeCheckO(MkRuntimeC,obj);
25877 }
25878
25879 #pragma GCC diagnostic pop
25880 #define MkRuntimeC_Check(mng) MkRtCheck(mng)
25881
25883
25884// RunTimeCast --------------------------------------------------------------
25887
25889 __parser__(class=MkRuntimeC,hide,static)
25890 META_ATTRIBUTE_SANITIZE
25892 mk_inline MK_RT MkRt(MK_MNG mng) {
25893 return (MkRtCheck(mng) ? (MK_RT)mng : NULL);
25894 }
25895
25897 __parser__(class=MkRuntimeC,hide,static)
25898 META_ATTRIBUTE_SANITIZE
25900 mk_inline MK_RTN MkRtN(MK_MNGN mng) {
25901 return (MkRtCheck(mng) ? (MK_RTN)mng : NULL);
25902 }
25903
25905 #define MkRtRaise(_rt) if (!_MkCheckX(MkRuntimeC,_rt)) { \
25906 MkErrorSetC_1E("'MkRuntimeC' hdl is NULL"); \
25907 goto error ; \
25908 }
25909
25911
25914// MkRuntimeC_Class_Define_C_API
25915
25916// END-MkRuntimeS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
25917
25919// MkRuntime_C_API
25920
25921// =========================================================================
25922// BEGIN-MkRuntimeS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
25923
25926
25929
25930__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=MkRuntimeC);
25931
25947__parser__(class-overload=MkObjectHandleGet)
25951 MK_RT const rt __parser__(null-allowed)
25952) {
25953 return MkObjectHandleGet(rt?MkOBJ(rt):NULL);
25954}
25955
25964__parser__(flags=new)
25966mk_inline MK_RT MkRuntimeHandleResolve_RT (
25968 MK_HDL const netHdl
25969) {
25970 return MkRt(MkObjectHandleResolve(netHdl));
25971}
25972
25982#define MkRuntimeHandleResolve_e(netHdl) ({ \
25983 MK_HDL tmpHdl=netHdl; \
25984 MK_RT tmp; \
25985 if (tmpHdl==0) { \
25986 tmp=NULL; \
25987 } else { \
25988 tmp=MkRuntimeHandleResolve(tmpHdl); \
25989 if (tmp==NULL) { \
25990 MkErrorSetC_1_NULL("ERROR: 'MkRuntimeC' handle is 'NULL'"); \
25991 goto error; \
25992 }; \
25993 }; \
25994 tmp; \
25995})
25996
25998
26000// Class export & import
26001
26005 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=MkRuntimeC,null-return-allow)
26008 return (MK_RT)MK_NULL;
26009 }
26011// MkRuntimeC - Misc - function
26012
26014// MkRuntimeC_Class_C_API
26015
26016// END-MkRuntimeS-Export - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
26017
26020__parser__global__(MkRuntimeGetNull:hide);
26021
26022// #######################################################################
26023// -----------------------------------------------------------------------
26027
26030
26031#define MkRT (&MkRuntimeRLS)
26032#define MkRT_R (MkRuntimeRLS)
26033
26034#if META_HAS_THREAD
26035 #define MkRT_O(o) ((o) && (*o).objRt ? (*o).objRt : MkRuntimeGet())
26036 #define MkRT_X(x) ((x) && MkOBJ_R(x).objRt ? MkOBJ_R(x).objRt : MkRuntimeGet())
26037 #define MkRT_ONN(o) ((*o).objRt)
26038 #define MkRT_ON(o) ( (*o).objRt ? (*o).objRt : MkRuntimeGet())
26039 #define MkRT_XN(x) ( MkOBJ_R(x).objRt ? MkOBJ_R(x).objRt : MkRuntimeGet())
26040#else
26041 #define MkRT_O(o) MkRT
26042 #define MkRT_X(x) MkRT
26043 #define MkRT_ONN(o) MkRT
26044 #define MkRT_ON(o) MkRT
26045 #define MkRT_XN(x) MkRT
26046#endif
26047
26048#if META_HAS_THREAD
26049 #define MkRtSetup_O(o) MK_RT_UNUSED MK_RT const mkrt = MkRT_O(o)
26050 #define MkRtSetup_X(x) MK_RT_UNUSED MK_RT const mkrt = MkRT_X(x)
26051 #define MkRtSetup_XN(x) MK_RT_UNUSED MK_RT const mkrt = MkRT_XN(x)
26052 #define MkRtSetup_ON(o) MK_RT_UNUSED MK_RT const mkrt = MkRT_ON(o)
26053 #define MkRtSetup_NULL MK_RT_UNUSED MK_RT const mkrt = MkRuntimeGet()
26054 #define MkRtSetup_RT(r) MK_RT_UNUSED MK_RT const mkrt = r
26055 #define MkRtSetupFromRtExt(rtx) MK_RT_UNUSED MK_RT const mkrt = MkRTEXT_R(rtx).mkrtHead
26056
26057// check "rt" on NULL if available as argument (MK_RT_ARGS).
26058 #define MkRtSetup_O_RT(o) if (mkrt == NULL) mkrt = MkRT_O(o)
26059 #define MkRtSetup_ON_RT(o) if (mkrt == NULL) mkrt = MkRT_ON(o)
26060 #define MkRtSetup_X_RT(x) if (mkrt == NULL) mkrt = MkRT_X(x)
26061 #define MkRtSetup_XN_RT(x) if (mkrt == NULL) mkrt = MkRT_XN(x)
26062 #define MkRtSetup_NULL_RT if (mkrt == NULL) mkrt = MkRuntimeGet()
26063
26064 #define AllRtSetup_O(o) MkRtSetup_O(o)
26065 #define AllRtSetup_ON(o) MkRtSetup_ON(o)
26066 #define AllRtSetup_X(x) MkRtSetup_X(x)
26067 #define AllRtSetup_XN(x) MkRtSetup_XN(x)
26068 #define AllRtSetup_NULL MkRtSetup_NULL
26069#else
26070 #define MkRtSetup_O(o)
26071 #define MkRtSetup_X(x)
26072 #define MkRtSetup_XN(x)
26073 #define MkRtSetup_ON(o)
26074 #define MkRtSetup_NULL
26075 #define MkRtSetup_RT(r)
26076
26077 #define MkRtSetup_O_RT(o)
26078 #define MkRtSetup_X_RT(x)
26079 #define MkRtSetup_XN_RT(x)
26080 #define MkRtSetup_ON_RT(o)
26081 #define MkRtSetup_NULL_RT
26082
26083 #define AllRtSetup_O(o)
26084 #define AllRtSetup_ON(o)
26085 #define AllRtSetup_X(x)
26086 #define AllRtSetup_XN(x)
26087 #define AllRtSetup_NULL
26088#endif
26089
26091
26097typedef void ( MK_DECL *MkRuntimeInitF) ( MK_RT_ARGS_ONLY );
26098
26147__parser__(ignore)
26148typedef struct MkRuntimeCallbackS {
26149 MkRuntimeInitF cb ;
26150
26151 MK_RT setupRT ;
26152
26153 #define MkRuntimeCallbackS_ident_size 30
26155
26156 // private
26157 size_t rtId_plus_1 ;
26158
26159 // CDL list
26160 struct MkRuntimeCallbackS *prev ;
26161 struct MkRuntimeCallbackS *next ;
26163
26232__parser__(ignore)
26235 MkRuntimeCallbackS * cbdata,
26236 MkRuntimeInitF rt_callback,
26237 MK_STRN ident
26238);
26239
26242__parser__(ignore)
26245 MkRuntimeCallbackS * cbdata
26246);
26247
26249// - MkRuntimeCallback
26250
26252__parser__(ignore)
26254MK_EXTERN_DATA MkThreadLocal struct MkRuntimeS MkRuntimeRLS ;
26255
26262__parser__(ignore)
26263MK_EXTERN MK_RT MK_DECL MkRuntimeSetup ( MK_RT const mkrt );
26264
26270__parser__(ignore)
26272
26274MK_ATTR_STATIC __parser__(hide,doc-group=Config)
26276{
26277 return __MkCheckX(MkRuntimeC,&MkRuntimeRLS) ? MkRT : MkRuntimeSetup( MkRT );
26278}
26279
26281MK_ATTR_STATIC __parser__(hide,doc-group=Config)
26283 MK_OBJ obj __parser__(null-allowed)
26284) {
26285 return MkRT_O(obj);
26286}
26287
26289// - MkRuntimeC_Interface_C_API
26290
26291// #######################################################################
26292// -----------------------------------------------------------------------
26302
26303__parser__push__(doc-group=Config);
26304
26307mk_inline bool MkRuntimeIsSilentGet ( void ) {
26308 return MkRuntimeRLS.isSilent;
26309}
26310
26314
26317mk_inline void MkRuntimeNoDecoSet_RT ( MK_PARSER_RT bool noDeco );
26318
26322 return MkRuntimeRLS.debug;
26323}
26324
26327mk_inline void MkRuntimeDebugSet ( MK_I32 dbg ) {
26328 MkRuntimeRLS.debug = dbg;
26329}
26330
26336 return MkRuntimeRLS.log.logNAME;
26337}
26338
26346 MK_STRN logTgt
26347) ;
26348
26355) ;
26356
26360 MK_STRN logTgt
26361) ;
26362
26363#define MkRuntimeLogBufferPush() MkLogDataS saveLogTarget = MkRuntimeLogTargetPush_RT(MK_RT_CALL "BUFFER")
26364//#define MkRuntimeLogBufferPush()
26365
26369 MkLogDataS logOld
26370) ;
26371
26372#define MkRuntimeLogBufferPop() MkRuntimeLogTargetPop_RT(MK_RT_CALL saveLogTarget)
26373//#define MkRuntimeLogBufferPop()
26374
26376__parser__(hide)
26377MK_EXTERN void MK_DECL MkRuntimeSetCID (MK_OBJ const cid) MK_ATTR_STATIC ;
26378
26380MK_ATTR_RT_STATIC __parser__(error-ignore)
26383) {
26385 return MkERROR_RT.code;
26386}
26387
26389
26391// - MkRuntimeC_Config_C_API
26392
26393// #######################################################################
26394// -----------------------------------------------------------------------
26399
26400__parser__push__(doc-group=Info);
26401
26411__parser__(const)
26412MK_EXTERN void MK_DECL MkRuntimeLog0_RT (
26415 MK_DBG const debug __parser__(default=0),
26416 MK_STRN const callfunc __parser__(default=F#FUNC),
26417 MK_I32 const lvl __parser__(default=0)
26419
26421
26423// - MkRuntimeC_Config_C_API
26424
26425/* ####################################################################### */
26426/* ### ### */
26427/* ### P A C K A G E - A P I ### */
26428/* ### ### */
26429/* ####################################################################### */
26430
26486// #######################################################################
26487// -----------------------------------------------------------------------
26653#ifndef MK_EMBEDDED
26655 #define MK_EMBEDDED(type,call,...) ({ \
26656 type ret = (type) 0; \
26657 if (MkErrorCheckI(call (__VA_ARGS__,&ret))) goto error; \
26658 ret; \
26659 })
26660#endif
26661
26662#ifndef MK_EMBEDDED_REF
26664 #define MK_EMBEDDED_REF(type,call,...) ({ \
26665 type ret = {0}; \
26666 if (MkErrorCheckI(call (__VA_ARGS__,&ret))) goto error; \
26667 ret; \
26668 })
26669#endif
26670
26672// MkKernel_Overload_C_API
26673
26674/*****************************************************************************/
26675/* */
26676/* doc functions */
26677/* */
26678/*****************************************************************************/
26679
26680// -----------------------------------------------------------------------
26695
26696// -----------------------------------------------------------------------
26697// BEGIN-Class-Doc-Order - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
26698
26699// external
26705
26706// external
26712
26713// internal
26720
26721// external
26727
26728// internal
26735
26736// external
26742
26743// external
26749
26750// internal
26757
26758// external
26764
26765// internal
26772
26773// END-Class-Doc-Order - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
26774
26775/*****************************************************************************/
26776/* */
26777/* inline functions */
26778/* */
26779/*****************************************************************************/
26780
26781// BEGIN-Class-Introspection - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
26782
26787
26788__parser__push__(doc-name=Introspection,doc-index=Class,class=MkBufferListC,no-rpc,null-return-allow,flags=new);
26789
26795 return (MK_BFL)MkTypeInstances(MkBufferListC_TT);
26796}
26797
26800mk_inline MK_BFL MkBufferListNext(MK_BFL const bfl) {
26801 MK_INSTANCE_HDL(bfl);
26802 return (MK_BFL)MkBufferListC_X2obj(bfl)->obj_protect.next;
26803}
26804
26807mk_inline MK_BFL MkBufferListPrev(MK_BFL const bfl) {
26808 MK_INSTANCE_HDL(bfl);
26809 return (MK_BFL)MkBufferListC_X2obj(bfl)->obj_protect.prev;
26810}
26811
26813
26816// MkBufferListC_Class_C_API
26817
26822
26823__parser__push__(doc-name=Introspection,doc-index=Class,class=MkBufferC,no-rpc,null-return-allow,flags=new);
26824
26830 return (MK_BUF)MkTypeInstances(MkBufferC_TT);
26831}
26832
26835mk_inline MK_BUF MkBufferNext(MK_BUF const buf) {
26836 MK_INSTANCE_HDL(buf);
26837 return (MK_BUF)MkBufferC_X2obj(buf)->obj_protect.next;
26838}
26839
26842mk_inline MK_BUF MkBufferPrev(MK_BUF const buf) {
26843 MK_INSTANCE_HDL(buf);
26844 return (MK_BUF)MkBufferC_X2obj(buf)->obj_protect.prev;
26845}
26846
26848
26851// MkBufferC_Class_C_API
26852
26857
26858__parser__push__(doc-name=Introspection,doc-index=Class,class=MkBufferStreamC,no-rpc,null-return-allow,flags=new);
26859
26865 return (MK_BUS)MkTypeInstances(MkBufferStreamC_TT);
26866}
26867
26870mk_inline MK_BUS MkBufferStreamNext(MK_BUS const bus) {
26871 MK_INSTANCE_HDL(bus);
26872 return (MK_BUS)MkBufferStreamC_X2obj(bus)->obj_protect.next;
26873}
26874
26877mk_inline MK_BUS MkBufferStreamPrev(MK_BUS const bus) {
26878 MK_INSTANCE_HDL(bus);
26879 return (MK_BUS)MkBufferStreamC_X2obj(bus)->obj_protect.prev;
26880}
26881
26883
26886// MkBufferStreamC_Class_C_API
26887
26892
26893__parser__push__(doc-name=Introspection,doc-index=Class,class=MkErrorC,no-rpc,null-return-allow,flags=new);
26894
26900 return (MK_ERR)MkTypeInstances(MkErrorC_TT);
26901}
26902
26905mk_inline MK_ERR MkErrorNext(MK_ERR const err) {
26906 MK_INSTANCE_HDL(err);
26907 return (MK_ERR)MkErrorC_X2obj(err)->obj_protect.next;
26908}
26909
26912mk_inline MK_ERR MkErrorPrev(MK_ERR const err) {
26913 MK_INSTANCE_HDL(err);
26914 return (MK_ERR)MkErrorC_X2obj(err)->obj_protect.prev;
26915}
26916
26918
26921// MkErrorC_Class_C_API
26922
26927
26928__parser__push__(doc-name=Introspection,doc-index=Class,class=MkLogFileC,no-rpc,null-return-allow,flags=new);
26929
26935 return (MK_LFL)MkTypeInstances(MkLogFileC_TT);
26936}
26937
26940mk_inline MK_LFL MkLogFileNext(MK_LFL const lfl) {
26941 MK_INSTANCE_HDL(lfl);
26942 return (MK_LFL)MkLogFileC_X2obj(lfl)->obj_protect.next;
26943}
26944
26947mk_inline MK_LFL MkLogFilePrev(MK_LFL const lfl) {
26948 MK_INSTANCE_HDL(lfl);
26949 return (MK_LFL)MkLogFileC_X2obj(lfl)->obj_protect.prev;
26950}
26951
26953
26956// MkLogFileC_Class_C_API
26957
26962
26963__parser__push__(doc-name=Introspection,doc-index=Class,class=MkObjectC,no-rpc,null-return-allow);
26964
26970 return (MK_OBJ)MkTypeInstances(MkObjectC_TT);
26971}
26972
26975mk_inline MK_OBJ MkObjectNext(MK_OBJ const obj) {
26976 MK_INSTANCE_HDL(obj);
26977 return (MK_OBJ)MkObjectC_X2obj(obj)->obj_protect.next;
26978}
26979
26982mk_inline MK_OBJ MkObjectPrev(MK_OBJ const obj) {
26983 MK_INSTANCE_HDL(obj);
26984 return (MK_OBJ)MkObjectC_X2obj(obj)->obj_protect.prev;
26985}
26986
26988
26991// MkObjectC_Class_C_API
26992
26997
26998__parser__push__(doc-name=Introspection,doc-index=Class,class=MkRuntimeC,no-rpc,null-return-allow,flags=new);
26999
27005 return (MK_RT)MkTypeInstances(MkRuntimeC_TT);
27006}
27007
27010mk_inline MK_RT MkRuntimeNext(MK_RT const rt) {
27011 MK_INSTANCE_HDL(rt);
27012 return (MK_RT)MkRuntimeC_X2obj(rt)->obj_protect.next;
27013}
27014
27017mk_inline MK_RT MkRuntimePrev(MK_RT const rt) {
27018 MK_INSTANCE_HDL(rt);
27019 return (MK_RT)MkRuntimeC_X2obj(rt)->obj_protect.prev;
27020}
27021
27023
27026// MkRuntimeC_Class_C_API
27027
27028// END-Class-Introspection - created by 'c_Class.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
27029
27031__parser__global__(MkRuntimeNext:hide);
27032__parser__global__(MkRuntimePrev:hide);
27033
27036__parser__(internal)
27038 // TODO replace loop by hash
27039 MkTypeLoop(MkTypeC,typ) {
27040 if ((*typ).objsig == typeSIG) return MkTypeInstances(typ);
27041 }
27042 return NULL;
27043}
27044
27045/*
27046mk_inline MK_SIG MkObjectRpcHdlGet(MK_OBJ obj) {
27047 return (*obj).rpcHdl;
27048}
27049*/
27050
27051// =============================================================================================================
27052
27058 return &MkERROR;
27059}
27060
27066 return &MkERROR;
27067}
27068
27074 return &MkERROR;
27075}
27076
27082 return &MkERROR;
27083}
27084
27090 return &MkERROR;
27091}
27092
27097 MK_OBJ obj,
27098 MK_PTR *self_out,
27099 MK_PTR const env
27100) {
27101 assert(self_out != NULL);
27102
27103 if (obj == NULL) {
27104 *self_out = NULL;
27105 return MK_OK;
27106 }
27107 MkRtSetup_ON_RT(obj);
27108
27109 enum MkErrorE ret = MK_OK;
27110 MK_PTR self = MkSelfGet(obj);
27111 if (self != NULL) {
27112 if (MkRefGet(obj) <= 0) {
27113 MkErrorSetV_2M(obj, "RefCount Error: object '%s' has 'self' but 'refCout <= 0", obj->type->type_name);
27114 goto error;
27115 } else {
27116 ret = MK_CONTINUE;
27117 if (MK_RT_REF.MkSelfIncrOnCacheB && MK_RT_REF.fSelfIncr) (*MK_RT_REF.fSelfIncr)(MK_RT_CALL self, env);
27118 goto end;
27119 }
27120 }
27121 self = MkSelfCreate(obj, env);
27122 if (self == NULL) {
27123 MkErrorSetV_2M(obj, "Error: '%s->SelfCreate' return a NULL pointer", obj->type->type_name);
27124 goto error;
27125 }
27126end:
27127 *self_out = self;
27128 return ret;
27129error:
27130 *self_out = NULL;
27131 return MK_ERROR;
27132}
27133
27136
27148 MK_OBJ const obj
27149) {
27150 MK_INSTANCE_RT_O(obj);
27151 return MkErrorFORMAT_1O(obj);
27152}
27153
27154#define MkObjectToError_1X(obj) MkObjectToError(MkOBJ(obj))
27155
27157// MkObjectC_Misc_C_API
27158
27161
27163mk_inline MkBinaryR MkBinaryDup_RT ( MK_PARSER_RT const MkBinaryR bin ) {
27165 return MkBinaryCreate(bin.size,(MK_BIN)MkSysMemDup(MK_ERROR_PANIC,bin.data,(size_t)bin.size));
27166}
27167
27169mk_inline void MkBinaryLog_RT ( MK_PARSER_RT const MkBinaryR bin ) {
27171 MkLogV(MK_ERROR_FORMAT,__func__,0,"MkBinaryR: size=%li, data=%p\n", bin.size, bin.data);
27172}
27173
27175
27178
27180mk_inline MkStringR MkStringDup_RT ( MK_PARSER_RT MkStringR const str ) {
27182 return MkStringCreate(str.len,(MK_STRN)MkSysMemDup(MK_ERROR_PANIC,str.ptr,(size_t)str.len));
27183}
27184
27187mk_inline void MkStringLog_RT ( MK_PARSER_RT MkStringR const str, MK_STRN func ) {
27189 MkLogV(MK_ERROR_FORMAT,func,0,"MkStringR: len=%i -> %.*s\n", str.len, str.len, str.ptr);
27190}
27191
27193
27196mk_inline void MkRuntimeIsSilentSet_RT ( MK_PARSER_RT bool silent ) {
27198 MkDCheck(1) {
27200 MkLogC(MK_ERROR_FORMAT, "Attention: set 'silient'\n", 1, __func__);
27203 }
27204 MkRuntimeRLS.isSilent = silent;
27205};
27206
27209mk_inline void MkRuntimeNoDecoSet_RT ( MK_PARSER_RT bool noDeco ) {
27211 MkRuntimeRLS.noDeco = noDeco;
27212};
27213
27214// end c++ save definition
27216// END: BEGIN_MK_C_DECLS
27217
27218#endif // KERNEL_MK_H
27219
27220// 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
#define MkRuntimeCallbackS_ident_size
#define MkBuffer1024S_ils_size
1024 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
struct MkBuffer1024S MkBuffer1024CR
instance-struct-reference same as struct MkBuffer1024S, useable in a class-macro as: class##R …
const struct MkBuffer1024S MkBuffer1024CNR
const instance-struct-reference same as const struct MkBuffer1024S, useable in a class-macro as: clas...
#define MkBuffer256S_ils_size
256 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
const struct MkBuffer256S MkBuffer256CNR
const instance-struct-reference same as const struct MkBuffer256S, useable in a class-macro as: class...
struct MkBuffer256S MkBuffer256CR
instance-struct-reference same as struct MkBuffer256S, useable in a class-macro as: class##R …
#define MkBuffer64S_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
const struct MkBuffer64S MkBuffer64CNR
const instance-struct-reference same as const struct MkBuffer64S, useable in a class-macro as: class#...
struct MkBuffer64S MkBuffer64CR
instance-struct-reference same as struct MkBuffer64S, useable in a class-macro as: class##R …
enum MkErrorE MkString2U16_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_U16 *val_out)
enum MkErrorE MkString2LONG_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_LONG *val_out)
enum MkErrorE MkString2I64_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_I64 *val_out)
enum MkErrorE MkString2HDL_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_HDL *val_out)
enum MkErrorE MkString2DBL_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_DBL *val_out)
#define MkBufferS_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
enum MkErrorE MkString2BOOL_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_BOOL *val_out)
enum MkErrorE MkString2ATO_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, enum MkTypeE type, MK_ATO *val_out)
enum MkErrorE MkString2BOL_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_BOL *val_out)
convert a string into a native
enum MkErrorE MkString2I16_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_I16 *val_out)
enum MkErrorE MkString2I8_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_I8 *val_out)
enum MkErrorE MkString2I32_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_I32 *val_out)
enum MkErrorE MkString2FLT_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_FLT *val_out)
enum MkErrorE MkString2U32_RT(MK_RT mkrt, MK_STRN const str, MK_NUM const length, MK_U32 *val_out)
struct MkBufferS * MK_BUF
class-shortcut for struct MkBufferS *, all shortcut using the XX_YYY syntax (only for public API) …
const struct MkBufferS * MK_BUFN
class-shortcut for const struct MkBufferS *, all const shortcut using the XX_YYYC syntax (only for pu...
static MK_BUF MkBufferGetNull(void)
Null-Slot - return a MkBufferC typed NULL instance …
struct MkBufferS MK_BUFR
reference-shortcut for struct MkBufferS, all shortcut using the XX_YYYR syntax (only for public API) ...
static MK_HDL MkBufferHandleGet_RT(MK_RT mkrt, MK_BUF const buf)
Handle-Get-Slot - returns a export-hdl to the MkBufferC useable for external storage
static MK_BUF MkBufferInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkBufferS type …
static MK_BUF MkBufferPrev(MK_BUF const buf)
get previous instance from linked-list of MkBufferS type
static MK_BUF MkBufferNext(MK_BUF const buf)
get next instance from linked-list of MkBufferS type
struct MkBufferS MkBufferCR
instance-struct-reference same as struct MkBufferS, useable in a class-macro as: class##R …
static MK_BUF MkBuf(MK_MNG mng)
cast a unknown-object into an MkBufferS pointer or NULL if not possible
#define MkBufferC_X2obj(x)
static bool MkBufCheckO(MK_OBJN obj)
check MkBufferS -> libmkkernel::MkObjectS::signature …
static bool MkBufCheck(MK_MNGN mng)
check MkBufferS -> libmkkernel::MkObjectS::signature …
const struct MkBufferS MkBufferCNR
const instance-struct-reference same as const struct MkBufferS, useable in a class-macro as: class##R...
#define MkBufferC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
void MkBufferLogS_RT(MK_RT mkrt, MK_BUFN const buf, MK_STRN const varname, MK_OBJN fmtobj, MK_STRN const callfunc)
log the short MkBufferC object data to the MkLogFileC (default: stderr) …
void MkBufferLogSS_RT(MK_RT mkrt, MK_BUFN const buf, MK_STRN const varname, MK_OBJN fmtobj, MK_STRN const callfunc)
log the whole MkBufferC object to the MkLogFileC (default: stderr) …
MK_I32 MkBufferCmp_RT(MK_RT mkrt, MK_BUFN const buf1, MK_BUFN const buf2)
compare TWO MkBufferC objects like strcmp do it for strings …
MK_STRN MkBufferToString_RT(MK_RT mkrt, MK_BUFN const inst)
String-Slot - returns the string representation of the inst …
enum MkErrorE MkBufferCastTo_RT(MK_RT mkrt, MK_BUF const buf, enum MkTypeE const typ)
change the type of an MkBufferC to type …
MK_BUF MkBufferSizeAdd_RT(MK_RT mkrt, MK_BUF const buf, MK_NUM const size)
add size storage to the buf …
void MkBufferResetFull_RT(MK_RT mkrt, MK_BUF const buf)
reset a MkBufferC to the length zero and free allocated storage…
MK_BUF MkBufferReset_RT(MK_RT mkrt, MK_BUF const buf)
reset a MkBufferC to the length zero …
MK_BUF MkBufferSizeNew_RT(MK_RT mkrt, MK_BUF const buf, MK_NUM const size)
alloc min size storage to the buf …
MK_BUF MkBufferCreateI8_RT(MK_RT mkrt, MK_I8 const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreateTLS_RT(MK_RT mkrt, MK_STRN const tlsName, bool const resetB)
same as BufferCreate but require no cleanup
MK_BUF MkBufferCreateBIN_RT(MK_RT mkrt, MkBinaryR const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreateDBL_RT(MK_RT mkrt, MK_DBL const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
#define MkBufferCreateLOCAL_T(cls, name, size)
create an new MkBufferC object as L)ocal S)torage…
MK_BUF MkBufferCreate_RT(MK_RT mkrt, MK_TYP type, MK_NUM const size)
Constructor - create a new MkBufferC with minimum size of internal storage …
MK_BUF MkBufferCreateFLT_RT(MK_RT mkrt, MK_FLT const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
#define MkBufferCreateTLS_inout_T(cls, name, inout)
Constructs a MkBufferC instance as T)hread L)ocal S)torage OR reuse inout if possible…
MK_BUF MkBufferCreateSTR_RT(MK_RT mkrt, MK_STRN const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreateI32_RT(MK_RT mkrt, MK_I32 const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreateI16_RT(MK_RT mkrt, MK_I16 const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
MK_BUF MkBufferCreateI64_RT(MK_RT mkrt, MK_I64 const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
#define MkBufferCreateTLS_T(cls, name, size)
create an new MkBufferC object as T)hread L)ocal S)torage…
MK_BUF MkBufferCreateBOL_RT(MK_RT mkrt, MK_BOL const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …
struct MkBufferListS MK_BFLR
reference-shortcut for struct MkBufferListS, all shortcut using the XX_YYYR syntax (only for public A...
const struct MkBufferListS * MK_BFLN
class-shortcut for const struct MkBufferListS *, all const shortcut using the XX_YYYC syntax (only fo...
struct MkBufferListS * MK_BFL
class-shortcut for struct MkBufferListS *, all shortcut using the XX_YYY syntax (only for public API)...
static MK_BFL MkBufferListPrev(MK_BFL const bfl)
get previous instance from linked-list of MkBufferListS type
static MK_BFL MkBufferListInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkBufferListS type …
struct MkBufferListS * MK_BAC
a list of 'buffer' as last argument in function …
static MK_BFL MkBufferListNext(MK_BFL const bfl)
get next instance from linked-list of MkBufferListS type
const struct MkBufferListS * MK_BACN
const - a list of 'buffer' as last argument in function …
#define MkBufferListC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MkBufferListC_X2obj(x)
#define MkBufferStream1024_ils_size
1024 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
const struct MkBufferStream1024S MkBufferStream1024CNR
const instance-struct-reference same as const struct MkBufferStream1024S, useable in a class-macro as...
struct MkBufferStream1024S MkBufferStream1024CR
instance-struct-reference same as struct MkBufferStream1024S, useable in a class-macro as: class##R …
struct MkBufferStream16384S MkBufferStream16384R
reference type of MkBufferStream16384S
#define MkBufferStream16384S_ils_size
16384 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
const struct MkBufferStream16384S MkBufferStream16384CNR
const instance-struct-reference same as const struct MkBufferStream16384S, useable in a class-macro a...
struct MkBufferStream16384S MkBufferStream16384CR
instance-struct-reference same as struct MkBufferStream16384S, useable in a class-macro as: class##R ...
#define MkBufferStream256S_ils_size
256 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
const struct MkBufferStream256S MkBufferStream256CNR
const instance-struct-reference same as const struct MkBufferStream256S, useable in a class-macro as:...
struct MkBufferStream256S MkBufferStream256CR
instance-struct-reference same as struct MkBufferStream256S, useable in a class-macro as: class##R …
#define MkBufferStream64_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
const struct MkBufferStream64S MkBufferStream64CNR
const instance-struct-reference same as const struct MkBufferStream64S, useable in a class-macro as: ...
struct MkBufferStream64S MkBufferStream64CR
instance-struct-reference same as struct MkBufferStream64S, useable in a class-macro as: class##R …
#define MkBufferStreamS_ils_size
64 bytes I)instance L)ocal S)torage - the memory that adds the final-class to the abstract-class.
static MK_HDL MkBufferStreamHandleGet_RT(MK_RT mkrt, MK_BUS const bus)
Handle-Get-Slot - returns a export-hdl to the MkBufferStreamC useable for external storage
const struct MkBufferStreamS * MK_BUSN
class-shortcut for const struct MkBufferStreamS *, all const shortcut using the XX_YYYC syntax (only ...
static MK_BUS MkBufferStreamInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkBufferStreamS type …
static MK_BUS MkBufferStreamPrev(MK_BUS const bus)
get previous instance from linked-list of MkBufferStreamS type
struct MkBufferStreamS * MK_BUS
class-shortcut for struct MkBufferStreamS *, all shortcut using the XX_YYY syntax (only for public AP...
static MK_BUS MkBufferStreamNext(MK_BUS const bus)
get next instance from linked-list of MkBufferStreamS type
struct MkBufferStreamS MK_BUSR
reference-shortcut for struct MkBufferStreamS, all shortcut using the XX_YYYR syntax (only for public...
static MK_BUS MkBufferStreamGetNull(void)
Null-Slot - return a MkBufferStreamC typed NULL instance …
static MK_BUS MkBus(MK_MNG mng)
cast a unknown-object into an MkBufferStreamS pointer or NULL if not possible
#define MkBufferStreamC_X2obj(x)
struct MkBufferStreamS MkBufferStreamCR
instance-struct-reference same as struct MkBufferStreamS, useable in a class-macro as: class##R …
static bool MkBusCheck(MK_MNGN mng)
check MkBufferStreamS -> libmkkernel::MkObjectS::signature …
const struct MkBufferStreamS MkBufferStreamCNR
const instance-struct-reference same as const struct MkBufferStreamS, useable in a class-macro as: cl...
#define MkBufferStreamC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
static bool MkBusCheckO(MK_OBJN obj)
check MkBufferStreamS -> libmkkernel::MkObjectS::signature …
MK_BFL MkBufferStreamToBFL_RT(MK_RT mkrt, MK_BUSN const bus)
convert the bus into a MkBufferListC …
void MkBufferStreamLog_RT(MK_RT mkrt, MK_BUS const bus, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the MkBufferStreamC …
void MkBufferStreamPosToStart_RT(MK_RT mkrt, MK_BUS const bus)
set the current-access-position to the start of MkBufferStreamC …
MK_STRN MkBufferStreamToString_RT(MK_RT mkrt, MK_BUSN const inst)
String-Slot - returns the string representation of the inst …
void MkBufferStreamFree_RT(MK_RT mkrt, MK_BUS const bus)
init and free a MkBufferStreamS reference
void MkBufferStreamInit_RT(MK_RT mkrt, MK_BUS const bus, MK_TYP type, MK_NUM const size)
init and free a MkBufferStreamS reference
MK_BUS MkBufferStreamCreate64_RT(MK_RT mkrt, MK_NUM const size)
call the BufferStreamCreate with default type MkBufferStream64S (64 byte) …
MK_BUS MkBufferStreamCreate_RT(MK_RT mkrt, MK_TYP type, MK_NUM const size)
create and initialize an MkBufferStreamC instance …
#define MkBufferStreamCreateSTATIC_T(cls, name)
Constructs a MkBufferStreamC instance as S)tatic S)torage …
#define MkBufferStreamCreateTLS_T(cls, name)
Constructs a MkBufferStreamC instance as T)hread L)ocal S)torage …
#define MkBufferStreamCreateLOCAL_T(cls, name, size)
Constructs a MkBufferStreamC instance as L)ocal S)torage …
enum MkErrorE MkBufferStreamWriteI8_RT(MK_RT mkrt, MK_BUS const bus, MK_I8 const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteSTR_RT(MK_RT mkrt, MK_BUS const bus, MK_STRN const val, MK_NUM const len)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteI32_RT(MK_RT mkrt, MK_BUS const bus, MK_I32 const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteBOL_RT(MK_RT mkrt, MK_BUS const bus, MK_BOL const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteFLT_RT(MK_RT mkrt, MK_BUS const bus, MK_FLT const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteI64_RT(MK_RT mkrt, MK_BUS const bus, MK_I64 const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
enum MkErrorE MkBufferStreamWriteDBL_RT(MK_RT mkrt, MK_BUS const bus, MK_DBL const val)
write a PRIMITIVE TYPE into the MkBufferStreamC …
bool(* MkErrorSetVLF)(MK_ERREXT_ARGS, MK_OBJN const fmtobj, MK_STRN const)
void(* MkErrorPanikF)(MK_ERREXT_ARGS_N, MK_OBJN const errobj, MK_STRN const prefix, MK_I32 const errnum, MK_STRN const fmt, va_list ap)
MK_OBJN const errobj because of MK_ERROR_FORMAT value.
void(* MkErrorResetF)(MK_ERREXT_ARGS, MK_OBJN const fmtobj)
bool(* MkErrorAppendFLT)(MK_ERREXT_ARGS, MK_OBJN const fmtobj)
void(* MkErrorSetRF)(MK_ERREXT_ARGS, MK_MNGN const errctx, MK_OBJN const fmtobj)
#define MK_ERREXT_ARGS
MK_OBJN(* MkErrorFormatOfF)(MK_ERREXT_ARGS_N, int const dummy)
void(* MkErrorSetEF)(MK_ERREXT_ARGS, MK_ERREXT const newerr, MK_OBJN const fmtobj)
void(* MkErrorLogF)(MK_ERREXT_ARGS_N, MK_OBJN const, MK_DBG const, MK_STRN const, MK_I32 const, MK_STRN const, MK_OBJ const)
void(* MkErrorInit)(MK_ERREXT_ARGS, MK_OBJN const fmtobj)
bool(* MkErrorResetOnExitF)(MK_ERREXT_ARGS, MK_OBJN const fmtobj)
#define MK_ERREXT_ARGS_N
struct MkErrExtS * MK_ERREXT
class-shortcut for struct MkErrExtS *, all shortcut using the XX_YYY syntax (only for public API) …
const struct MkErrExtS * MK_ERREXTN
class-shortcut for const struct MkErrExtS *, all const shortcut using the XX_YYYC syntax (only for pu...
struct MkErrExtS MK_ERREXTR
reference-shortcut for struct MkErrExtS, all shortcut using the XX_YYYR syntax (only for public API) ...
static bool MkErrExtCheckO(MK_OBJN obj)
check MkErrExtS -> libmkkernel::MkObjectS::signature …
static bool MkErrExtCheck(MK_MNGN mng)
check MkErrExtS -> libmkkernel::MkObjectS::signature …
struct MkErrExtS MkErrExtCR
instance-struct-reference same as struct MkErrExtS, useable in a class-macro as: class##R …
const struct MkErrExtS MkErrExtCNR
const instance-struct-reference same as const struct MkErrExtS, useable in a class-macro as: class##R...
static MK_HDL MkErrorHandleGet_RT(MK_RT mkrt, MK_ERR const err)
Handle-Get-Slot - returns a export-hdl to the MkErrorC useable for external storage
const struct MkErrorS * MK_ERRN
class-shortcut for const struct MkErrorS *, all const shortcut using the XX_YYYC syntax (only for pub...
static MK_ERR MkErrorNext(MK_ERR const err)
get next instance from linked-list of MkErrorS type
struct MkErrorS MK_ERRR
reference-shortcut for struct MkErrorS, all shortcut using the XX_YYYR syntax (only for public API) …
struct MkErrorS * MK_ERR
class-shortcut for struct MkErrorS *, all shortcut using the XX_YYY syntax (only for public API) …
static MK_ERR MkErrorGetNull(void)
Null-Slot - return a MkErrorC typed NULL instance …
static MK_ERR MkErrorPrev(MK_ERR const err)
get previous instance from linked-list of MkErrorS type
static MK_ERR MkErrorInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkErrorS type …
const struct MkErrorS MkErrorCNR
const instance-struct-reference same as const struct MkErrorS, useable in a class-macro as: class##R ...
#define MkErrorC_X2obj(x)
static bool MkErrCheckO(MK_OBJN obj)
check MkErrorS -> libmkkernel::MkObjectS::signature …
static MK_ERR MkErr(MK_MNG mng)
cast a unknown-object into an MkErrorS pointer or NULL if not possible
#define MkErrorC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
struct MkErrorS MkErrorCR
instance-struct-reference same as struct MkErrorS, useable in a class-macro as: class##R …
static bool MkErrCheck(MK_MNGN mng)
check MkErrorS -> libmkkernel::MkObjectS::signature …
enum MkErrorE MkErrorGetCode(MK_ERRN const err)
get the value of MkErrorS::code …
MK_SIZE MkErrorGetSize(MK_ERRN const err)
get the error-message-size from the exception-object …
#define MkErrorGetSizeI(e)
get the error-message-size from the exception-object …
#define MkErrorGetCodeI(e)
get the value of MkErrorS::code …
MK_STRN MkErrorGetText(MK_ERRN const err)
get the MkErrorS::text …
#define MkErrorGetTextI(e)
get the MkErrorS::text …
#define MkErrorGetNumI(e)
get the MkErrorS::num. The number can be used as exit-code …
MK_I32 MkErrorGetNum(MK_ERRN const err)
get the MkErrorS::num. The number can be used as exit-code …
enum MkErrorE MkErrorReset_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const callfunc, MK_I32 const callline, bool const force)
This function clears the err and resets to libmkkernel::MK_OK …
void MkErrorCleanup_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const callfunc, MK_I32 const callline)
cleanup and print unwanted active error …
void MkErrorStackFormat_RT(MK_RT mkrt, MK_ERR const err, MK_STRN callfunc, MK_STRN callfile, MK_I32 const callline)
append an ensemble of func, file and line to the error-message …
void MkErrorPrintln_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const msg, MK_STRN const callfunc, MK_I32 const callline)
print the default-error to the MkLogFileC (default: stderr) and clear the error afterwards …
MK_STRN MkErrorToString_RT(MK_RT mkrt, MK_ERRN const inst)
String-Slot - returns the string representation of the inst …
enum MkErrorE MkErrorRaise_RT(MK_RT mkrt, MK_ERRN const err)
convert an ccmkkernel error into an programming-language-error and raise afterwards....
enum MkErrorE MkErrorStack_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const callfunc, MK_STRN const callfile, MK_I32 const callline)
check on error and if yes append an ErrorStackFormat to the error-message …
MK_ERR MkErrorCatch_RT(MK_RT mkrt, MK_ERR const err, MK_EXP const exception, MK_STRN const callfunc)
convert a programming-language-error into an ccmkkernel error …
void MkErrorLog_RT(MK_RT mkrt, MK_ERRN const err, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the error to MkLogFileC (default: stderr) …
void MkPanicC_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MK_I32 const errnum, MK_STRN const message)
do a panic with string as argument …
void MkPanicVL_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MK_I32 const errnum, MK_FST const printfmt, va_list var_list)
do a panic with a vararg-list as argument …
enum MkErrorE MkErrorSetV_RT(MK_RT mkrt, MK_ERR err, MK_STRN const callfunc, MK_I32 const errnum, MK_FST const printfmt,...)
set the MkErrorS object using a format string argument list and raise an error …
void MkDisasterSignal(MK_I32 signal)
called if something get REALLY wrong …
enum MkErrorE MkErrorSetE_RT(MK_RT mkrt, MK_ERR const err, MK_ERR const newerr)
set the MkErrorC from a MkErrorC copy and raise an error …
enum MkErrorE MkErrorSetVL_RT(MK_RT mkrt, MK_ERR err, MK_STRN const callfunc, MK_I32 const errnum, MK_FST const printfmt, va_list var_list)
'set' and 'raise' the MkErrorC using a vararg-list message …
#define MkErrorSetV_2M(err, printfmt,...)
void MkPanicDEFAULT_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc) MK_NO_RETURN
make panic from libmkkernel::MkErrorDEFAULT_RT …
void MkPanicV_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MK_I32 const errnum, MK_FST const printfmt,...)
do a panic with a vararg as argument …
enum MkErrorE MkErrorSetC_RT(MK_RT mkrt, MK_ERR err, MK_STRN const message, MK_STRN const callfunc, MK_I32 const errnum)
'set' and 'raise' the MkErrorC using a string-message and a errnum-number …
bool MkErrorIsTIMEOUT(MK_ERRN const err)
check on TIMEOUT error …
bool MkErrorIsSOCKET(MK_ERRN const err)
check on SOCKET-DOWN error …
void MkErrorSetCONTINUE_RT(MK_RT mkrt, MK_ERR const err)
signal end of processing in an MqMqEventIF callback …
void MkErrorSetCode_RT(MK_RT mkrt, MK_ERR const err, enum MkErrorE code)
set the MkErrorS::code value …
enum MkErrorE MkErrorSetSOCKET_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const detail, MK_STRN const callfunc)
create SOCKET-DOWN error …
enum MkErrorE MkErrorSetEXIT_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const callfunc)
finish the current callback, return to toplevel and MqExit the application …
enum MkErrorE MkErrorSetABORT_RT(MK_RT mkrt, MK_ERR const err, MK_STRN const detail, MK_STRN const callfunc)
send the ABORT signal to the calling stack…
bool MkErrorIsABORT(MK_ERRN const err)
check on ABORT signal …
bool MkErrorIsEXIT(MK_ERR const err)
check on APPLICATION-EXIT error …
MK_ERR MkErrorFORMAT_EO(MK_OBJN fmtobj)
same as [static] MkErrorC* MkErrorC::DEFAULT() but do not set the MkERROR.format_of_error attribute o...
#define MkERROR
#define MK_ERROR_PRINT
static MK_ERR MkErrorPRINT_RT(MK_RT mkrt)
ignore-system-error - print the next error into MkLogFileC …
#define MK_ERROR_DEFAULT
MK_ERR MkErrorFORMAT(MK_OBJN fmtobj)
system-error-format - format and return the default-error …
#define MK_ERROR_EXIT
static MK_ERR MkErrorIGNORE_RT(MK_RT mkrt)
ignore-system-error - ignore the next error …
#define MkErrorFORMAT_1O(o)
#define MkERROR_RT
#define MK_ERROR_PANIC
static MK_ERR MkErrorPANIC_RT(MK_RT mkrt)
panic-system-error - panic on next error …
#define MK_ERROR_IGNORE
#define MK_ERROR_FORMAT
static MK_ERR MkErrorDEFAULT_RT(MK_RT mkrt)
default-system-error - default-error …
static MK_ERR MkErrorEXIT_RT(MK_RT mkrt)
panic-system-error - panic on next error …
void MkErrorCopy_RT(MK_RT mkrt, MK_ERR dest, MK_ERRN const srce)
Copy-Constructor - sync an existing MkErrorC instance with the values from an existing MkErrorC insta...
void MkErrorDelete_RT(MK_RT mkrt, MK_ERR err)
Destructor - delete a MkErrorS object …
MK_ERR MkErrorDup_RT(MK_RT mkrt, MK_ERRN const srce)
Dup-Constructor - create a new MkErrorC instance as copy from an existing MkErrorC instance …
const struct MkErrorDefaultS MkErrorDefaultCNR
const instance-struct-reference same as const struct MkErrorDefaultS, useable in a class-macro as: cl...
struct MkErrorDefaultS MkErrorDefaultCR
instance-struct-reference same as struct MkErrorDefaultS, useable in a class-macro as: class##R …
struct MkErrorExitS MkErrorExitCR
instance-struct-reference same as struct MkErrorExitS, useable in a class-macro as: class##R …
const struct MkErrorExitS MkErrorExitCNR
const instance-struct-reference same as const struct MkErrorExitS, useable in a class-macro as: class...
const struct MkErrorIgnoreS MkErrorIgnoreCNR
const instance-struct-reference same as const struct MkErrorIgnoreS, useable in a class-macro as: cla...
struct MkErrorIgnoreS MkErrorIgnoreCR
instance-struct-reference same as struct MkErrorIgnoreS, useable in a class-macro as: class##R …
const struct MkErrorPanicS MkErrorPanicCNR
const instance-struct-reference same as const struct MkErrorPanicS, useable in a class-macro as: clas...
struct MkErrorPanicS MkErrorPanicCR
instance-struct-reference same as struct MkErrorPanicS, useable in a class-macro as: class##R …
const struct MkErrorPrintS MkErrorPrintCNR
const instance-struct-reference same as const struct MkErrorPrintS, useable in a class-macro as: clas...
struct MkErrorPrintS MkErrorPrintCR
instance-struct-reference same as struct MkErrorPrintS, useable in a class-macro as: class##R …
bool MkExceptionCheck(MK_EXP exception)
Checks if Exception is of type MkExceptionC and returns true or false …
void MkExceptionRaise(MK_MNG const expobj, MK_STRN const callfunc, MK_I32 const callline)
convert an MkErrorC into a Target-Programming-Language (TPL) exception …
MK_ERR MkExceptionCatch(MK_MNG const expobj, MK_EXP const exception, MK_STRN const callfunc)
convert an Target-Programming-Language (TPL) exception into an MkErrorC …
MK_EXT MkExtensionAdd_RT(MK_RT mkrt, MK_EXT head, MK_EXT add)
this is an update to head, use: head = MkExtensionAdd(head, add)
MK_EXT MkExtensionDel_RT(MK_RT mkrt, MK_EXT head, MK_EXT del)
this is an update to head, use: head = MkExtensionDel(head, del)
struct libmkkernel::MkExtensionS MkExtensionS
Base class for the extension technologie …
#define MkExtension_size
maximum number of runtime-extensions useable in a theKernel software.
bool MkExtensionDeleteAll_RT(MK_RT mkrt, MK_EXT head)
struct MkExtensionS * MK_EXT
class-shortcut for struct MkExtensionS *, all shortcut using the XX_YYY syntax (only for public API) ...
const struct MkExtensionS * MK_EXTN
class-shortcut for const struct MkExtensionS *, all const shortcut using the XX_YYYC syntax (only for...
struct MkExtensionS MK_EXTR
reference-shortcut for struct MkExtensionS, all shortcut using the XX_YYYR syntax (only for public AP...
struct MkExtensionS MkExtensionCR
instance-struct-reference same as struct MkExtensionS, useable in a class-macro as: class##R …
const struct MkExtensionS MkExtensionCNR
const instance-struct-reference same as const struct MkExtensionS, useable in a class-macro as: class...
static bool MkExtCheck(MK_MNGN mng)
check MkExtensionS -> libmkkernel::MkObjectS::signature …
static bool MkExtCheckO(MK_OBJN obj)
check MkExtensionS -> libmkkernel::MkObjectS::signature …
static void MkBinaryLog_RT(MK_RT mkrt, const MkBinaryR bin)
get size from the binary ...
static MkBinaryR MkBinaryCreate(MK_SIZE size, MK_BINN data)
create a binary from data and size ...
static const MkBinaryR MkBinaryCreateSlice(const MkBinaryR bin, MK_SIZE start, MK_SIZE wide)
create a binary slice ...
static bool MkBinaryIsNull(const MkBinaryR bin)
check if binary is NULL ...
static MkBinaryR MkBinaryDup_RT(MK_RT mkrt, const MkBinaryR bin)
create a binary as duplicate from an already existsing MkBinaryR ...
static MK_SIZE MkBinaryGetSize(const MkBinaryR bin)
get size from the binary ...
static MK_BINN MkBinaryGetData(const MkBinaryR bin)
get data pointer from the binary ...
MK_PTR(* MkCacheCF)(MK_RT mkrt, MK_PTR const)
void(* MkCacheDF)(MK_RT mkrt, MK_PTR *const)
#define BEGIN_MK_C_DECLS
#define MK_NULL_STR
the string "MK_NULL" value as MK_NULL_STR …
#define MK_PARSER_fmtobj
use param_fmtobj for documentation
static bool MK_NULL_STR_OR_EMPTY_CHECK_1(char const *const __str)
same as libmkkernel::MK_NULL_STR_CHECK together with "" check but without len parameter
#define MK_NO_RETURN
dosable "MK_NO_RETURN" because C# require "return" from "MqExit" for thread-pool support
#define MK_DECL
#define mk_inline
static bool MK_NULL_STR_CHECK(char const *const __str, const long int __len)
check if __str is MK_NULL_STR return true or false …
#define MK_EXTERN_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_1(char const *const __str)
same as libmkkernel::MK_NULL_STR_CHECK but without len parameter
#define MK_NULL
The Programming-Language-Micro-Kernel (PLMK) NULL value as MK_NULL in C++ …
void * MK_MACRO_TYP
helper-type used to declare a prototype for a macro
#define MK_NULL_STR_LEN
the integer strlen("MK_NULL") value as MK_NULL_STR_LEN …
MK_STRN MkBoolE_ToString(enum MkBoolE value)
return the MkBoolE as string …
MK_STRN MkErrorE_ToString(enum MkErrorE value)
return the MkErrorE as string …
enum MkErrorE MkIdSE_FromInt(MK_I32 const value, enum MkIdSE *value_out)
return the MkIdSE from integer …
enum MkErrorE MkNativeIsE_FromInt(MK_I32 const value, enum MkNativeIsE *value_out)
return the MkNativeIsE from integer …
#define MK_TYPE_IS_1_I8E
the type is native and has a size of 1 byte …
MkTypeE
basic data-types supported by Programming-Language-Micro-Kernel (PLMK) …
static MK_I32 MkTypeE_ToInt(enum MkTypeE value)
return the MkTypeE as integer …
MkTimeoutE
Predefined Timeout values …
#define MK_TYPE_IS_2_I8E
the type is native and has a size of 2 bytes …
static MK_I32 MkTimeoutE_ToInt(enum MkTimeoutE value)
return the MkTimeoutE as integer …
MkNativeIsE
define if data is string or little or big endian …
#define MK_TYPE_SHIFT
FIXED: type is only 8bit -> 4 bit=15 for type and 4 bit for flag …
static MK_I32 MkBoolE_ToInt(enum MkBoolE value)
return the MkBoolE as integer …
MkBoolE
the internal boolean …
MK_STRN MkIdSE_ToString(enum MkIdSE value)
return the MkIdSE as string …
#define MK_TYPE_IS_8_I8E
the type is native and has a size of 8 bytes …
MkErrorE
collection for the different error-codes …
MK_STRN MkNativeIsE_ToString(enum MkNativeIsE value)
return the MkNativeIsE as string …
MK_STRN MkTypeE_ToString(enum MkTypeE value)
return the MkTypeE as string …
static MK_I32 MkNativeIsE_ToInt(enum MkNativeIsE value)
return the MkNativeIsE as integer …
static MK_I32 MkErrorE_ToInt(enum MkErrorE value)
return the MkErrorE as integer …
enum MkErrorE MkErrorE_FromInt(MK_I32 const value, enum MkErrorE *value_out)
return the MkErrorE from integer …
enum MkErrorE MkTypeE_FromInt(MK_I32 const value, enum MkTypeE *value_out)
return the MkTypeE from integer …
#define MK_TYPE_IS_4_I8E
the type is native and has a size of 4 bytes …
MK_STRN MkTimeoutE_ToString(enum MkTimeoutE value)
return the MkTimeoutE as string …
enum MkErrorE MkBoolE_FromInt(MK_I32 const value, enum MkBoolE *value_out)
return the MkBoolE from integer …
enum MkErrorE MkTimeoutE_FromInt(MK_I32 const value, enum MkTimeoutE *value_out)
return the MkTimeoutE from integer …
static MK_I32 MkIdSE_ToInt(enum MkIdSE value)
return the MkIdSE as integer …
@ MK_I8T
Y: 1 byte 'byte' type.
@ MK_I16T
S: 2 byte 'short' type.
@ MK_FLTT
F: 4 byte 'float' type.
@ MK_DBLT
D: 8 byte 'double' type.
@ MK_STRT
C: X byte 'string' type (e.g. with a \0 at the end)
@ MK_TIMEOUT_SHORT
short timeout in sec (20 sec) …
@ MK_TIMEOUT_INIT
maximum timeout in sec (900 sec) …
@ MK_TIMEOUT_VERYSHORT
very short timeout in sec (5 sec) …
@ MK_TIMEOUT_LONG
long timeout in sec (180 sec) …
@ MK_NATIVE_IS_LITTLE
L = using if the binary protocoll, data in little-edian.
@ MK_NATIVE_IS_BIG
B = using if the binary protocoll, data in big-endian.
@ MK_NATIVE_IS_INITIAL
0 = initial value
@ MK_NATIVE_IS_STRING
S = using of the string protocol.
@ MK_YES
boolean YES
@ MK_NO
boolean NO
@ MK_CONTINUE
(transient) raise an continue-event, the calling-function must handle this.
@ MK_OK
(persistent) everything is OK.
@ MK_ERROR
(persistent) raise an error-event, the calling-fucntion is interrupted.
MK_BFL MkKernelGetTypeList_RT(MK_RT mkrt)
return a list of all types defind in the Programming-Language-Micro-Kernel (PLMK) …
#define __parser__global__(...)
parser: apply an attribute to a dunction in global scope …
#define __parser__pop__
parser: stop apply a list of local attributes to a block of code …
#define __parser__push__(...)
parser: start apply a list of local attributes to a block of code …
#define __parser__(...)
parser: apply an attribute to an object in local scope …
static MkStringR MkStringCreate(MK_NUM len, MK_STRN str)
create a str from ptr and len ...
static bool MkStringIsNULL(MkStringR const strR)
check if strR is MK_NULL_STR return true or false …
static MK_NUM MkStringGetSize(MkStringR const str)
get len from the string ...
static MkStringR MkStringDup_RT(MK_RT mkrt, MkStringR const str)
create a string as duplicate from an already existsing MkBinaryR ...
static MkStringR MkStringCreate_1(MK_STRN str)
create a str from ptr use MK_NULL as end-of-string ...
static MK_STRN MkStringGetData(MkStringR const str)
get ptr pointer from the string ...
static void MkStringLog_RT(MK_RT mkrt, MkStringR const str, MK_STRN func)
log the string ...
static MkStringR MkStringSlice(MkStringR strR, MK_NUM start, MK_NUM len)
create a slice of strR start at start with max len bytes …
static void MkStringSplit(MkStringR strR, MK_NUM *len_out, MK_STRN *str_out)
split a str into ptr and len …
const MK_PTRB * MK_PTRN
const generic pointer data-type
unsigned long long MK_U64
double MK_DBL
8 byte double data-type
unsigned char MK_U8
MK_PTRB * MK_MNG
managed object pointer, datatype will be checked at runtime
unsigned char MK_LSTB
list type data-type
unsigned char MK_BINB
byte-array type data-type
unsigned char MK_BOL
1 byte boolean data-type
union MkBufferAtomU MK_ATO
8 byte atom data-type
signed char MK_I8
1 byte byte data-type
MK_PTRB * MK_CBP
generic pointer to call-back data
unsigned long MK_ULN
float MK_FLT
4 byte float data-type
signed long long MK_I64
8 byte wide integer data-type
MK_PTRB * MK_MXP
MkExceptionC object pointer.
MK_BINB const * MK_BINN
const byte-array pointer data-type
long MK_LONG
4/8 byte long data-type
MK_BINB * MK_BIN
byte-array pointer data-type with binary encoding (MK_BINN)
MK_LSTB * MK_LST
list pointer data-type
MK_STRB const * MK_FST
const format string pointer data-type
bool MK_BOOL
real bool data-type
int32_t MK_HDL
4 byte int handle data-type
MK_PTRB * MK_CCP
class constructor/destructor data type
int32_t MK_NUM
array size data-type ('num' items in array …
char MK_STRB
string type data-type
signed short int MK_I16
2 byte short data-type
int MK_DBG
debug-level data-type …
unsigned int MK_U32
signed int MK_I32
4 byte integer data-type
MK_STRB * MK_STR
string pointer data-type with UTF8 ecoding (MK_STR)
MK_UNUSED static const MK_STRN_A MK_STRN_A_NULL
unsigned int MK_SIG
signature datatype
MK_PTRB * MK_PTR
generic pointer data-type
unsigned short MK_U16
const MK_PTRB * MK_MNGN
const - a managed object pointer, datatype will be checked at runtime
MK_PTRB const * MK_EXP
exception object pointer
const MK_STRB * MK_STRN
constant string pointer data-type
void MK_PTRB
pointer type data-type
struct libmkkernel::MkLogDataS MkLogDataS
struct to hold the mkrt-logging-data …
static MK_HDL MkLogFileHandleGet_RT(MK_RT mkrt, MK_LFL const lfl)
Handle-Get-Slot - returns a export-hdl to the MkLogFileC useable for external storage
static MK_LFL MkLogFileInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkLogFileS type …
static MK_LFL MkLogFileGetNull(void)
Null-Slot - return a MkLogFileC typed NULL instance …
struct MkLogFileS * MK_LFL
class-shortcut for struct MkLogFileS *, all shortcut using the XX_YYY syntax (only for public API) …
static MK_LFL MkLogFilePrev(MK_LFL const lfl)
get previous instance from linked-list of MkLogFileS type
struct MkLogFileS MK_LFLR
reference-shortcut for struct MkLogFileS, all shortcut using the XX_YYYR syntax (only for public API)...
static MK_LFL MkLogFileNext(MK_LFL const lfl)
get next instance from linked-list of MkLogFileS type
const struct MkLogFileS * MK_LFLN
class-shortcut for const struct MkLogFileS *, all const shortcut using the XX_YYYC syntax (only for p...
static bool MkLflCheckO(MK_OBJN obj)
check MkLogFileS -> libmkkernel::MkObjectS::signature …
struct MkLogFileS MkLogFileCR
instance-struct-reference same as struct MkLogFileS, useable in a class-macro as: class##R …
#define MkLogFileC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MkLogFileC_X2obj(x)
static MK_LFL MkLfl(MK_MNG mng)
cast a unknown-object into an MkLogFileS pointer or NULL if not possible
static bool MkLflCheck(MK_MNGN mng)
check MkLogFileS -> libmkkernel::MkObjectS::signature …
const struct MkLogFileS MkLogFileCNR
const instance-struct-reference same as const struct MkLogFileS, useable in a class-macro as: class##...
enum MkErrorE MkLogFileOpen_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const file, MK_LFL *lfh_out)
open the log-file in append mode …
void MkLogFileClose_RT(MK_RT mkrt, MK_LFL lfh)
Destructor - delete a MkLogFileC instance …
enum MkErrorE MkLogFileWriteVL_RT(MK_RT mkrt, MK_LFLN lfl, MK_FST printfmt, va_list var_list)
write to log-file …
enum MkErrorE MkLogFileWriteV_RT(MK_RT mkrt, MK_LFLN lfl, MK_FST printfmt,...)
write to log-file …
void(* MkLogF)(MK_RT mkrt, MK_OBJN const obj, MK_OBJN fmt, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
MK_STRN(* MkToStringF)(MK_RT mkrt, MK_OBJN const obj)
MK_OBJ(* MkResetF)(MK_RT mkrt, MK_OBJ const obj)
void(* MkDestructorF)(MK_RT mkrt, MK_OBJ const obj)
MK_PTR(* MkAllocCreateFLT)(MK_RT mkrt, MK_TYP const type)
void(* MkSelfDeleteF)(MK_RT mkrt, MK_PTR self, MK_PTR const env)
#define __MkCheckX(cls, x)
MK_OBJ(* MkCopyF)(MK_RT mkrt, MK_OBJ const obj, MK_OBJN const src)
void(* MkSelfUnlinkF)(MK_RT mkrt, MK_PTR self, MK_PTR const env)
void(* MkTypeInitF)(MK_RT mkrt, MK_TYP const type)
MK_OBJ(* MkDup2F)(MK_RT mkrt, MK_OBJN const obj, MK_STRN const ident)
#define MkSanitizeCheck(_root, _m)
MK_PTR(* MkSelfCreateF)(MK_RT mkrt, MK_OBJ const obj, MK_PTR const env)
bool(* MkLogFormatF)(MK_RT mkrt, char *header, MK_SIZE const headerSize, MK_OBJN const obj, MK_STRN const caller, MK_I32 const debug, MK_STRN const fmt)
MK_OBJ(* MkMergeF)(MK_RT mkrt, MK_OBJ const obj)
#define MkDbgDeepWriter(...)
void(* MkAllocDeleteF)(MK_RT mkrt, MK_TYP const type, MK_PTR ptr)
MK_OBJ(* MkDupF)(MK_RT mkrt, MK_OBJN const obj)
MK_OBJ(* MkConstructorF)(MK_RT mkrt, MK_TYP type, MK_PTR nat, MK_PTR lnk)
#define MkSanitizeCheckO(_root, _o)
MK_OBJ MkObjectHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkObjectC from netHdl or MK_NULL if invalid…
static MK_OBJ MkObjectPrev(MK_OBJ const obj)
get previous instance from linked-list of MkObjectS type
bool MkObjectHandleExists(MK_OBJ const obj)
check if obj has already a handle defined…
#define MkObjectHandleResolve(...)
static MK_OBJ MkObjectInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkObjectS type …
#define MkObjectHandleGet(...)
const struct MkObjectS * MK_OBJN
class-shortcut for const struct MkObjectS *, all const shortcut using the XX_YYYC syntax (only for pu...
struct MkObjectS MK_OBJR
reference-shortcut for struct MkObjectS, all shortcut using the XX_YYYR syntax (only for public API) ...
static MK_HDL MkObjectHandleGetOfType(MK_OBJ const obj)
Export-Slot - returns typeHdl of the obj .
void MkObjectHandleDeleteByNetHdl_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Delete-Slot - delete a netHdl from handle-storage …
static MK_OBJ MkObjectGetNull(void)
Null-Slot - return a MkObjectC typed NULL instance …
MK_HDL MkObjectHandleGetOr0(MK_OBJ const obj)
return export-hdl or 0 in not created…
void MkObjectHandleDelete_RT(MK_RT mkrt, MK_OBJ const netObj)
Handle-Delete-Slot - delete a netObj from handle-storage …
static MK_OBJ MkObjectNext(MK_OBJ const obj)
get next instance from linked-list of MkObjectS type
MK_HDL MkObjectHandleGet_RT(MK_RT mkrt, MK_OBJ const obj)
Handle-Get-Slot - returns a export-hdl to the MkObjectC useable for external storage
struct MkObjectS * MK_OBJ
class-shortcut for struct MkObjectS *, all shortcut using the XX_YYY syntax (only for public API) …
#define MkObjectC_X2obj(x)
struct MkObjectS MkObjectCR
instance-struct-reference same as struct MkObjectS, useable in a class-macro as: class##R …
static bool MkObjCheck(MK_MNGN mng)
check MkObjectS -> libmkkernel::MkObjectS::signature …
#define MkOBJ(x)
cast a known-object into an MkObjectS pointer
static bool MkObjCheckO(MK_OBJN obj)
check MkObjectS -> libmkkernel::MkObjectS::signature …
#define MkObjectC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
const struct MkObjectS MkObjectCNR
const instance-struct-reference same as const struct MkObjectS, useable in a class-macro as: class##R...
void MkDbgO_RT(MK_RT mkrt, MK_OBJN const obj, MK_STRN const callfunc)
debug: write the object-details to MkLogFileC (default: stderr) …
void MkDbgLogC_RT(MK_RT mkrt, MK_OBJN const obj, MK_STRN const callfunc)
debug: write a short-obj-summary to MkLogFileC (default: stderr) …
void MkDbgM_RT(MK_RT mkrt, MK_STRN const message, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
debug: write a static-marker to the MkLogFileC (default: stderr) …
void MkDbgL_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const message, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
debug: write a instance-marker to the MkLogFileC (default: stderr) using the fmtobj as prefix …
enum MkErrorE MkDbgDump_RT(MK_RT mkrt, MK_OBJN const obj, MK_STRN const message, MK_STRN const callfunc)
debug: Dump a instance to stderr with LNG and MQ internal data…
#define MkDCheck(_debug)
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 MkObjectLog(...)
void MkLogHEX_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MkBinaryR const data)
log binaray data as HEX into the MkLogFileC (default: stderr) …
void MkLogVL_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MK_DBG debug, MK_FST const printfmt, va_list var_list)
write a vprintf style logging-message to MkLogFileC using the internal format …
void MkObjectLog_RT(MK_RT mkrt, MK_OBJN const obj, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
Log-Slot - log a summary of an object to the MkLogFileC (default: stderr) target …
void MkLogV_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, MK_DBG debug, MK_FST const printfmt,...)
write a printf style logging-message to MkLogFileC (default: stderr) using the internal format …
#define MkLogC(...)
#define MkLogV(...)
void MkDbgV_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_STRN const callfunc, FILE *FH, MK_FST const printfmt,...)
write a printf style debug-message to FH using the internal format …
MK_STRN const MkObjectToName_RT(MK_RT mkrt, MK_OBJN const obj)
Info-Slot - returns brief information about the obj as a string
static bool MkObjectIsNull(MK_OBJ const obj)
ckeck if the object is MK_NULL
MK_STRN MkObjectToNameOfClass_RT(MK_RT mkrt, MK_OBJ const obj)
Class-Slot - returns the C++-Class-Name of the obj as string
MK_STRN MkObjectToString_RT(MK_RT mkrt, MK_OBJN const inst)
String-Slot - returns the string representation of the inst …
static MK_ERR MkObjectToError_RT(MK_RT mkrt, MK_OBJ const obj)
Error-Slot - return an error-object pre initialized with obj data.
#define MkObjectToString(...)
MK_STRN MkObjectToNameOfType_RT(MK_RT mkrt, MK_OBJN const obj)
Type-Slot - returns the LibMkKernel-Type-Name of the obj as a string
MK_ERR MkObjectErrorCatch_RT(MK_RT mkrt, MK_OBJN const obj, MK_EXP const exception, MK_STRN const callfunc)
convert a programming-language-error into an ccmkkernel error …
static MK_PTR MkSelfGet(MK_OBJ const obj)
get the MkObjectS::self value
void(* MkSelfIncrF)(MK_RT mkrt, MK_PTR self, MK_PTR const env)
static void MkSelfSet(MK_OBJ const obj, MK_PTR const self, MK_PTR const env)
set the MkObjectS::self value
#define MkSelfCreate(...)
void(* MkSelfDecrF)(MK_RT mkrt, MK_PTR self, MK_PTR const env)
static void MkRefIncrSelf(MK_OBJ const obj, MK_PTR const self, MK_PTR const env)
ATOMIC operation -> link self with reference-count.
MK_NUM MkRefCidN_RT(MK_RT mkrt)
return the reference-count-recursion-level
static MK_I32 MkRefGet(MK_OBJ const obj)
get the reference-count
#define MkRefLOCK
unchangeable reference
MK_OBJ MkObjReset_RT(MK_RT mkrt, MK_OBJ const obj)
free the internal memory of an object and initialize the local variables to default values
MK_PTR MkSelfCreate_RT(MK_RT mkrt, MK_OBJ const obj, MK_PTR const env)
create the MkObjectS::self value
static bool MkRefIsLocked(MK_OBJ const obj)
check if object is locked
static bool MkSelfExists(MK_OBJN obj)
Check if the MkObjectS::self exists …
static MK_I32 MkRefLock(MK_OBJ const obj)
lock the object
MK_OBJ MkRefDecrWithUnlinkSelf_RT(MK_RT mkrt, MK_OBJ const obj)
ATOMIC operation -> unlink self from META und decr-ref-count in META.
MK_OBJ MkRefDecrWithoutSelf_RT(MK_RT mkrt, MK_OBJ const obj)
ATOMIC operation -> unlink self with reference-count.
MK_OBJ MkObjCopy_RT(MK_RT mkrt, MK_OBJ const tgtmng, MK_OBJN const srcmng)
call the copy from the object
static MK_ATTR_HOT enum MkErrorE MkSelfNew_RT(MK_RT mkrt, MK_OBJ obj, MK_PTR *self_out, MK_PTR const env)
return the self pointer for a given obj …
void MkSysFreeP(MK_PTR data)
free syscall with ccmkkernel error plugin
static enum MkErrorE MkSysSleep(MK_OBJN fmtobj, MK_I32 const sec)
sleep syscall with ccmkkernel error plugin
static int MkSysExit_RT(MK_RT mkrt, int isThread, int num)
exit syscall with ccmkkernel error plugin
MK_PTR(* MkSysCallocF)(size_t, size_t)
calloc syscall …
static enum MkErrorE MkSysWaitForThread(MK_OBJN fmtobj, MK_IDNT const id)
wait for thread to finish syscall with ccmkkernel error plugin
MK_PTR(* MkSysMallocF)(size_t)
malloc syscall …
#define MkSysPrintStackTrace_2(fmtobj, debug)
#define MkSysStringIsLenEQUAL(_str, _other, _len)
MK_STR(* MkSysStrNCpyF)(char *, const char *, size_t)
strdup strncpy …
MkIdSE
signal type of the MkIdS data val …
static MK_STRN MkSysStringGetNoNULL(MK_STRN str)
get string "" or VALUE …
MK_STR MkSysBasename_RT(MK_RT mkrt, MK_STRN const pathName, bool const includeExtension)
basename syscall with ccmkkernel error plugin
enum MkErrorE(* MkSysWaitF)(MK_OBJN const fmtobj, MK_IDNT const id)
wait for process to finish syscall with ccmkkernel error plugin
MK_STR MkSysDirname_RT(MK_RT mkrt, MK_STRN const pathName)
dirname syscall with ccmkkernel error plugin
uintptr_t MK_IDNT
process or thread identifier …
int(* MkSysExitF)(MK_RT mkrt, int isThread, int num)
static bool MkSysStringIsNULL(MK_STRN str)
test if string is NULL or EMPTY …
MK_STRN MkSysGetTrace_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl, MK_I32 skip, MK_I32 const num)
same as MkSysPrintStackTrace but return a string…
#define MkSysFree(pointer)
pid_t(* MkSysForkF)(void)
fork syscall …
#define MkSysStringSetNULL_R(_str)
MK_STR(* MkSysStrNDupF)(MK_STRN, size_t)
strndup syscall …
MK_STR(* MkSysStrDupF)(MK_STRN)
strdup syscall …
struct MkLalS MkLal
Language Abstraction Layer in duty.
#define MkSysStringIsNULL_R(_str)
#define MkSysStringSet_R(_str, _val)
#define MkSysStringIsEQUAL(_str, _other)
void MkSysPrintStackTrace_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl, MK_I32 skip, MK_I32 const num)
backtrace syscall with ccmkkernel error plugin
void MkSysPipeHandler(MkSysPipeHandlerE keepPipe)
internal support for pipe ignore
static bool MkSysStringIsNotNULL(MK_STRN str)
test if string is NOT NULL or EMPTY …
MK_STRN MkSysHashSTR(MK_STRN key, MK_NUM length)
compute the HASH from a string …
#define MkSysFreeNonNull(pointer)
void(* MkSysFreeF)(MK_PTR)
free syscall …
MK_STR MkSysPrintF_RT(MK_RT mkrt, MK_STRN const format,...)
sprintf syscall with ccmkkernel error plugin
static enum MkErrorE MkSysUSleep(MK_OBJN fmtobj, useconds_t const usec)
usleep syscall with ccmkkernel error plugin
MK_PTR(* MkSysReallocF)(MK_PTR, size_t)
realloc syscall …
MK_PTR MkSysMemDup(MK_OBJN fmtobj, MK_PTRN const blck, size_t const size)
memdup syscall with ccmkkernel error plugin
static MK_STRN MkSysStringGet(MK_STRN str)
get string NULL or VALUE …
@ MK_ID_UNUSED
empty struct
@ MK_ID_PROCESS
val has a process handle
@ MK_ID_THREAD
val has a thread handle
void MkObjectDeleteCallbackCleanup_RT(MK_RT mkrt, MK_STRN ident)
cleanup the DeleteCallback installed with MkObjectDeleteCallbackSetup …
MK_OBJ MkObjCreate_RT(MK_RT mkrt, MK_TYP type, MK_PTR nat, MK_PTR lnk)
call the Constructor from the object
MK_OBJ MkObjDup2_RT(MK_RT mkrt, MK_OBJ const srcmng, MK_STRN const ident)
call the Dup2-Constructor from the object
MK_OBJ MkObjDup_RT(MK_RT mkrt, MK_OBJ const srcobj)
call the Dup-Constructor from the object
void MkObjectDispose_RT(MK_RT mkrt, MK_OBJ obj)
Dispose-Slot - untie the connection between the Native-C++-Instance and the ccmkkernel-Instance.
#define MkObjectDeleteCallF_ARGS
the libmkkernel::MkObjectDeleteCallF arguments with default names
MK_OBJ MkObjMerge_RT(MK_RT mkrt, MK_OBJ const obj)
Constructor - create a new object as a merge from an existing object
enum MkErrorE MkObjectDeleteCallbackSetup_RT(MK_RT mkrt, MK_STRN ident, MkObjectDeleteCallF fCall, MK_CBP callback, MkObjectDeleteFreeF fFree, MK_STRN filter)
Create/Delete the instance-delete-callback …
void MkObjectDelete_RT(MK_RT mkrt, MK_OBJ obj)
Delete-Slot - delete an instance.
#define MkObjectDeleteFreeF_ARGS
the libmkkernel::MkObjectDeleteFreeF arguments with default names
struct MkRtExtS MK_RTEXTR
reference-shortcut for struct MkRtExtS, all shortcut using the XX_YYYR syntax (only for public API) …
const struct MkRtExtS * MK_RTEXTN
class-shortcut for const struct MkRtExtS *, all const shortcut using the XX_YYYC syntax (only for pub...
struct MkRtExtS * MK_RTEXT
class-shortcut for struct MkRtExtS *, all shortcut using the XX_YYY syntax (only for public API) …
const struct MkRtExtS MkRtExtCNR
const instance-struct-reference same as const struct MkRtExtS, useable in a class-macro as: class##R ...
static bool MkRtExtCheck(MK_MNGN mng)
check MkRtExtS -> libmkkernel::MkObjectS::signature …
static bool MkRtExtCheckO(MK_OBJN obj)
check MkRtExtS -> libmkkernel::MkObjectS::signature …
struct MkRtExtS MkRtExtCR
instance-struct-reference same as struct MkRtExtS, useable in a class-macro as: class##R …
struct libmkkernel::MkThreadDataS MkThreadDataS
bool MkRuntimeSysPipeHandlerUse
block SIGPIPE ignore handlern default=true, Java require this
#define MkRuntimeHandleResolve(...)
#define MkRuntimeHandleGet(...)
const struct MkRuntimeS * MK_RTN
class-shortcut for const struct MkRuntimeS *, all const shortcut using the XX_YYYC syntax (only for p...
static MK_RT MkRuntimeInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkRuntimeS type …
static MK_RT MkRuntimeNext(MK_RT const rt)
get next instance from linked-list of MkRuntimeS type
static MK_HDL MkRuntimeHandleGet_RT(MK_RT mkrt, MK_RT const rt)
Handle-Get-Slot - returns a export-hdl to the MkRuntimeC useable for external storage
#define MkRuntimeInstances()
static MK_RT MkRuntimeGetNull(void)
Null-Slot - return a MkRuntimeC typed NULL instance …
static MK_RT MkRuntimePrev(MK_RT const rt)
get previous instance from linked-list of MkRuntimeS type
struct MkRuntimeS * MK_RT
class-shortcut for struct MkRuntimeS *, all shortcut using the XX_YYY syntax (only for public API) …
struct MkRuntimeS MK_RTR
reference-shortcut for struct MkRuntimeS, all shortcut using the XX_YYYR syntax (only for public API)...
#define MkRuntimeC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
const struct MkRuntimeS MkRuntimeCNR
const instance-struct-reference same as const struct MkRuntimeS, useable in a class-macro as: class##...
static bool MkRtCheck(MK_MNGN mng)
check MkRuntimeS -> libmkkernel::MkObjectS::signature …
static MK_RT MkRt(MK_MNG mng)
cast a unknown-object into an MkRuntimeS pointer or NULL if not possible
#define MkRuntimeC_X2obj(x)
struct MkRuntimeS MkRuntimeCR
instance-struct-reference same as struct MkRuntimeS, useable in a class-macro as: class##R …
static bool MkRtCheckO(MK_OBJN obj)
check MkRuntimeS -> libmkkernel::MkObjectS::signature …
void MkRuntimeSetCID(MK_OBJ const cid)
CID == context-in-duty.
MkLogDataS MkRuntimeLogTargetPush_RT(MK_RT mkrt, MK_STRN logTgt)
enum MkErrorE MkRuntimeLogTargetSet_RT(MK_RT mkrt, MK_STRN logTgt)
set the MkRuntimeS::log value and cleanup old value …
void MkRuntimeLogTargetPop_RT(MK_RT mkrt, MkLogDataS logOld)
static void MkRuntimeIsSilentSet_RT(MK_RT mkrt, bool silent)
set the MkRuntimeS::isSilent value …
static void MkRuntimeDebugSet(MK_I32 dbg)
set the MkRuntimeS::debug value …
static bool MkRuntimeIsSilentGet(void)
get the MkRuntimeS::isSilent value …
#define MkRuntimeLogBufferPush()
static void MkRuntimeNoDecoSet_RT(MK_RT mkrt, bool noDeco)
set the MkRuntimeS::noDeco value …
static enum MkErrorE MkRuntimeErrorGetCode_RT(MK_RT mkrt)
return libmkkernel::MkErrorS::code from a given MkRuntimeC …
enum MkErrorE MkRuntimeLogTargetReset_RT(MK_RT mkrt)
set the MkRuntimeS::log value to the DEFAULT value …
#define MkRuntimeLogBufferPop()
static MK_STRN MkRuntimeLogTargetGet(void)
get the MkLogDataS::logNAME value …
static MK_I32 MkRuntimeDebugGet(void)
get the MkRuntimeS::debug value …
static MK_RT MkRuntimeGet(void)
return a initialized MkRuntimeRLS …
#define MkRT
#define MkRtSetup_ON_RT(o)
#define MK_ATTR_STATIC
#define MK_ATTR_RT_INSTANCE
static MK_RT MkRuntimeGetFromObj(MK_OBJ obj)
return the initialized MkRuntimeRLS from an obj …
#define MK_ATTR_INSTANCE
MK_RT MkRuntimeSetup(MK_RT const mkrt)
initialize MkRuntimeRLS …
#define MkThreadLocal
#define MK_RT_ATTR_FORMAT_4
size_t MkRuntimeCallbackAdd(MK_RT mkrt, MkRuntimeCallbackS *cbdata, MkRuntimeInitF rt_callback, MK_STRN ident)
add a callback to the runtime …
void MkRuntimeCleanup(MK_RT mkrt)
cleanup MkRuntimeRLS …
#define MK_INSTANCE_RT_O(o)
#define MK_PARSER_RT
#define MK_RT_ATTR_FORMAT_1
#define MK_RT_ATTR_FORMAT_2
void(* MkRuntimeInitF)(MK_RT mkrt)
additional runtime initialization function …
#define MK_PARSER_RT_ONLY
#define MK_ATTR_RT_STATIC
struct libmkkernel::MkRuntimeCallbackS MkRuntimeCallbackS
keep callback related data …
void MkRuntimeCallbackDel(MK_RT mkrt, MkRuntimeCallbackS *cbdata)
delete a callback from the runtime …
#define MK_RT_ARGS
#define MK_STATIC_RT
#define MK_RT_ARGS_ONLY
#define MK_INSTANCE_HDL(x)
#define MK_RT_REF
#define MkRT_O(o)
static MK_TYPN MkTypN(const MK_MNGN mng)
type-check and cast a unknown-managed-object into an MkTypeS pointer or MK_NULL if not possible
MK_PTR MkTypeSlotResolveP(MK_RT mkrt, MK_TYPN const type, size_t const offset, bool const force)
hidden function for MkTypeSlotResolve
const struct MkTypeS * MK_TYPN
class-shortcut for const struct MkTypeS *, all const shortcut using the XX_YYYC syntax (only for publ...
struct MkTypeS MK_TYPR
reference-shortcut for struct MkTypeS, all shortcut using the XX_YYYR syntax (only for public API) …
struct MkTypeS * MK_TYP
class-shortcut for struct MkTypeS *, all shortcut using the XX_YYY syntax (only for public API) …
const struct MkTypeS MkTypeCNR
const instance-struct-reference same as const struct MkTypeS, useable in a class-macro as: class##R …
struct MkTypeS MkTypeCR
instance-struct-reference same as struct MkTypeS, useable in a class-macro as: class##R …
#define MkTypeC_X2obj(x)
static bool MkTypCheckO(MK_OBJN obj)
check MkTypeS -> libmkkernel::MkObjectS::signature …
static bool MkTypCheck(MK_MNGN mng)
check MkTypeS -> libmkkernel::MkObjectS::signature …
#define MkTypeLoop(_cls, _var)
void MkTypeLog_RT(MK_RT mkrt, MK_TYPN const typ, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the MkTypeS …
MK_TYP MkTypeResolve_RT(MK_RT mkrt, MK_TYPN const typ)
resolve a new type
static MK_OBJ MkTypeInstances(MK_TYP const typ)
access the instance attribute of the type…
MK_TYP MkTypeDup2_RT(MK_RT mkrt, MK_TYPN const typ, MK_STRN const ident)
duplicate typ to create a lightweight-type …
MK_OBJ MkTypeAlloc_RT(MK_RT mkrt, MK_TYPN const typ)
alloc instance-memory for MkTypeS …
#define MkTypeCreate(clsV, basicV, identV)
void MkTypeDelete_RT(MK_RT mkrt, MK_TYP const typ)
delete a type object
static MK_TYPN MkTypeNextN(MK_TYPN const typ)
get next instance from linked-list of MkObjectS type
const struct MkTypeDefS MkTypeDefCNR
const instance-struct-reference same as const struct MkTypeDefS, useable in a class-macro as: class##...
struct MkTypeDefS MkTypeDefCR
instance-struct-reference same as struct MkTypeDefS, useable in a class-macro as: class##R …
static MK_OBJ MkObjectInstancesOfType_RT(MK_RT mkrt, MK_SIG typeSIG)
return the head-instance from a specific type defined by signature typeSIG …
MK_OBJN format_of_error
used to format the error-message and as input for source_of_error
MkSysWaitF MkSysWaitForThreadCB
wait for process to finish syscall with ccmkkernel error plugin
MkSysWaitF MkSysWaitForProcessCB
wait for process to finish syscall with ccmkkernel error plugin
enum MkErrorE(* SysSleep)(MK_OBJN const obj, unsigned int const sec)
sleep syscall with ccmkkernel error plugin
enum MkErrorE(* SysUSleep)(MK_OBJN const obj, unsigned int const usec)
usleep syscall with ccmkkernel error plugin
bool isSilent
write (false) or don't write (true) any message to MkLogFileC (default: stderr) (default: false) …
bool noDeco
do not use decoration to generate log messages (default: use decoration) …
MK_NUM len
len of the string data

◆ MkRuntimeSetCID()

void libmkkernel::MkRuntimeSetCID ( MK_OBJ const cid)

CID == context-in-duty.