theKernel 10.0
Loading...
Searching...
No Matches
MkRuntimeC_atl.c
Go to the documentation of this file.
1
9/* LABEL-START */
10
11#define META_FILE_NAME "MkRuntimeC_atl.c"
12
14
15#define OT_CLASS amkrt->AtlMkRuntimeC
16#define OT_NULL amkrt->AtlMkRuntimeC_MK_NULL
17#define OT_CLASS_NAME "MkRuntimeC"
18
19#define SELF2HDL(O) MkRt(VAL2MNG(O))
20
21// LNG: class
22// -> moved to LibMkKernel_atl.h → OT_MK_RT_S → AtlMkKernelCTT;
23
24// META: ObjNew feature: called to return a new or an already existing ATL-SELF-Object
25// -> moved to LibMkKernel_atl.h → MkKernelC_ObjNew
26
27// META: ObjNew feature: selfCreate will be called from "ObjNew->MkSelfNew" if MkObj need a SELF pointer
28static MK_PTR NS(MkRuntimeC_selfCreate) (MK_RT_ARGS MK_OBJ const obj, MK_PTR const env) {
29 SETUP_amkrt(env);
30 return AtomMake(obj,OT_CLASS,NULL,NULL,env);
31}
32
33// META: called if MkObj must be destroyed and if the SELF is still alive → goal: destroy the SELF
34static void NS(MkRuntimeC_selfDelete) (MK_RT_ARGS MK_PTR selfP, MK_PTR const env) {
35 OT_SELF_T selfO = selfP;
36 SETUP_amkrt(env);
37 MK(AtomDeleteHard) (OT_MK_CALL selfO);
38}
39
40// META: called to destroy link from SELF to META
41static void NS(MkRuntimeC_selfUnlink) (MK_RT_ARGS MK_PTR selfP, MK_PTR const env) {
42 OT_SELF_T selfO = selfP;
43 SETUP_amkrt(env);
44 return MK(AtomUnlink) (OT_MK_CALL selfO);
45}
46
47#define OT_SETUP_hdl SetupHdlFromMetaData_2(MK_RT)
48#define OT_SETUP_hdl__null_allow SetupHdlFromMetaData__null_allow_2(MK_RT)
49#define OT_SETUP_hdl_destr SetupHdlFromMetaData__null_allow_2(MK_RT)
50#define OT_SETUP_hdl_constr SetupHdlConstr(MkRuntimeC)
51#define OT_SETUP_hdl_static_constr OT_SETUP_hdl_static
52#define OT_SETUP_hdl_static SetupHdlStatic(MkRuntimeC)
53
54#define OT_retObj_CONSTR(x) OT_retObj_SET(AtomInit(OT_SELF,MkRuntimeC_X2obj(x),amkrt))
55
56// initialize the ATL and META class specific object
57#define ClassInit \
58 /* if not already done, initialize NEW META type */ \
59 if (MkRuntimeCTT == NULL) MkRuntimeCTT = MkRuntimeSTT; \
60 \
61 /* protect against double call */ \
62 if (MkRuntimeCTT->selfCreate == NS(MkRuntimeC_selfCreate)) return MK_OK; \
63 \
64 /* add "selfCreate" and "selfDelete" feature to the META-Class */ \
65 MkRuntimeCTT->selfCreate = NS(MkRuntimeC_selfCreate); \
66 MkRuntimeCTT->selfDelete = NS(MkRuntimeC_selfDelete); \
67 MkRuntimeCTT->selfUnlink = NS(MkRuntimeC_selfUnlink); \
68 \
69 /* create the ATL-class */ \
70 OT_CLASS = AltClassDef(MkRuntimeCTT,&amkrt->AtlMkRuntimeC_NS); \
71 if (OT_CLASS == NULL) goto error; \
72 OT_REF_INCR(OT_CLASS); \
73 \
74 /* create the ATL static Methods */ \
75 check_LNG(AtlUnknownSetup (NS(sOtClassDef),amkrt)) goto error; \
76 \
77 /* create the ATL instance Methods */ \
78 check_LNG(AtlUnknownSetup (NS(sInstanceDef),amkrt)) goto error; \
79 \
80 /* after class was modified, recompile the class */ \
81 RL_init(2, recompile, RL_T(0,RecompileN)); RL_O(1,OT_CLASS) ; \
82 int retI = RL_EvalEx(0); \
83 if (retI != TCL_OK) return retI; \
84 \
85 /* define the "NULL" object */ \
86 OT_NULL = AtomCreateNULL(OT_CLASS, "::MkRuntimeC::MK_NULL", (MK_PTR)amkrt); \
87 if (OT_NULL == NULL) goto error; \
88 OT_REF_INCR(OT_NULL);
89/* LABEL-END */
90
91// BEGIN-DOC - created by 'atl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
92
93// doc-key: MkRuntimeC,MkRuntime,sm_,func
94#define DebugGet_doc "int32 [MkRuntimeC::DebugGet]"
95#define DebugSet_doc "MkRuntimeC::DebugSet dbg:int32"
96#define ErrorGetCode_doc "MkErrorE [MkRuntimeC::ErrorGetCode]"
97#define IsSilentGet_doc "bool [MkRuntimeC::IsSilentGet]"
98#define IsSilentSet_doc "MkRuntimeC::IsSilentSet silent:bool"
99#define Log0_doc "MkRuntimeC::Log0 ?fmtobj:MkObjectC=NULL? ?debug:int32=0? ?callfunc:string=\"MK_NULL\"? ?lvl:int32=0? (const)"
100#define LogTargetGet_doc "string [MkRuntimeC::LogTargetGet]"
101#define LogTargetReset_doc "MkRuntimeC::LogTargetReset"
102#define LogTargetSet_doc "MkRuntimeC::LogTargetSet logTgt:string"
103#define NoDecoSet_doc "MkRuntimeC::NoDecoSet noDeco:bool"
104
105// END-DOC - created by 'atl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
106
107/*****************************************************************************/
108/* */
109/* O B J E C T */
110/* */
111/*****************************************************************************/
112
113// BEGIN-MkRuntimeC - created by 'atl_MqC.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
114
118
119// doc-key: MkRuntimeC,MkRuntimeC-Config,sm_
120
122static OT_ProcRet NS(MkRuntimeC_DebugGet) (OtClass_ARGS) {
127 goto end;
128 error:
130 end:
132}
133
135static OT_ProcRet NS(MkRuntimeC_DebugSet) (OtClass_ARGS) {
138 MK_I32 dbg = 0;
141 MkRuntimeDebugSet (dbg);
143 goto end;
144 error:
146 end:
148}
149
151static OT_ProcRet NS(MkRuntimeC_ErrorGetCode) (OtClass_ARGS) {
156 goto end;
157 error:
159 end:
161}
162
164static OT_ProcRet NS(MkRuntimeC_IsSilentGet) (OtClass_ARGS) {
169 goto end;
170 error:
172 end:
174}
175
177static OT_ProcRet NS(MkRuntimeC_IsSilentSet) (OtClass_ARGS) {
180 MK_BOOL silent = 0;
183 MkRuntimeIsSilentSet (silent);
185 goto end;
186 error:
188 end:
190}
191
193static OT_ProcRet NS(MkRuntimeC_LogTargetGet) (OtClass_ARGS) {
198 goto end;
199 error:
201 end:
203}
204
218
220static OT_ProcRet NS(MkRuntimeC_LogTargetSet) (OtClass_ARGS) {
223 MK_STRN logTgt = 0;
228 goto end;
229 error:
231 end:
233}
234
236static OT_ProcRet NS(MkRuntimeC_NoDecoSet) (OtClass_ARGS) {
239 MK_BOOL noDeco = 0;
242 MkRuntimeNoDecoSet (noDeco);
244 goto end;
245 error:
247 end:
249}
250
252// MkRuntimeC_Config_ATL_API
253
257
258// doc-key: MkRuntimeC,MkRuntimeC-Info,sm_
259
261static OT_ProcRet NS(MkRuntimeC_Log0) (OtClass_ARGS) {
264 MK_OBJN fmtobj = NULL;
266 MK_DBG debug = 0;
268 MK_STRN callfunc = NULL;
270 MK_I32 lvl = 0;
273 if (debug > MkRuntimeDebugGet()) {
275 goto end;
276 }
277 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
278 MkRuntimeLog0 (fmtobj, debug, callfunc, lvl);
280 goto end;
281 error:
283 end:
286}
287
289// MkRuntimeC_Info_ATL_API
290
291// END-MkRuntimeC - created by 'atl_MqC.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
292
298
299static const OtObjProcDefS NS(sOtClassDef)[] = {
300 // BEGIN-CLASS - created by 'atl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
301
302 // doc-key: MkRuntimeC,MkRuntime,sm_
303 { "::MkRuntimeC::DebugGet" , NS(MkRuntimeC_DebugGet) },
304 { "::MkRuntimeC::DebugSet" , NS(MkRuntimeC_DebugSet) },
305 { "::MkRuntimeC::ErrorGetCode" , NS(MkRuntimeC_ErrorGetCode) },
306 { "::MkRuntimeC::IsSilentGet" , NS(MkRuntimeC_IsSilentGet) },
307 { "::MkRuntimeC::IsSilentSet" , NS(MkRuntimeC_IsSilentSet) },
308 { "::MkRuntimeC::Log0" , NS(MkRuntimeC_Log0) },
309 { "::MkRuntimeC::LogTargetGet" , NS(MkRuntimeC_LogTargetGet) },
310 { "::MkRuntimeC::LogTargetReset" , NS(MkRuntimeC_LogTargetReset) },
311 { "::MkRuntimeC::LogTargetSet" , NS(MkRuntimeC_LogTargetSet) },
312 { "::MkRuntimeC::NoDecoSet" , NS(MkRuntimeC_NoDecoSet) },
313
314 // END-CLASS - created by 'atl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
315 { NULL }
316};
317
318// ---------------------------------------------------------------------------------------
319
320static const OtObjProcDefS NS(sInstanceDef)[] = {
321 // BEGIN-OBJ - created by 'atl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
322
323 // → no data
324
325 // END-OBJ - created by 'atl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
326 { NULL }
327};
328
334
340
341int NS(pMkRuntimeC_Init) ( OT_MK_ARGS OT_NS_T ns )
342{
344
345 return TCL_OK;
346error:
347 return TCL_ERROR;
348}
#define OtClass_ARGS
#define OT_CHECK_bool(val)
#define MK(n)
#define AtomMake(...)
#define OT_SETUP_VARARGS(min, max, d)
#define OT_retObj_SET_BOL(nat)
#define OT_SETUP_NOARG(d)
#define OT_SETUP_ONEARG(d)
#define OT_CHECK_NI4(val)
MOX_NS_T OT_NS_T
#define OT_retObj_SET_Error
#define OT_FRAME_CLEANUP
#define OT_CHECK_REQUIRED(val)
#define OT_retObj_SET_None
#define OT_retObj_SET_I32(nat)
MOX_OBJ_T OT_SELF_T
#define NS(n)
#define OT_retObj_RETURN
#define OT_GET_CALL_PROC
#define OT_MK_CALL
#define OT_MK_ARGS
#define OT_retObj_SET_STR(nat)
#define SETUP_amkrt(r)
#define OT_NEW_Mk_enum_OBJ(typ, val)
#define OT_CHECK_OPTIONAL(val)
#define OT_retObj_SET(val)
#define OT_CHECK_NOARGS
#define MkErrorC_Check(mng, PROC)
#define OT_ProcRet
#define OT_CHECK_STRN(val)
tag: nhi1-release-250425
#define ErrorGetCode_doc
#define Log0_doc
#define IsSilentGet_doc
#define IsSilentSet_doc
#define NoDecoSet_doc
#define LogTargetReset_doc
#define OT_CLASS
#define OT_SETUP_hdl_static
#define DebugGet_doc
#define DebugSet_doc
#define LogTargetGet_doc
#define ClassInit
#define LogTargetSet_doc
#define MK_ERROR_FORMAT
#define MK_NULL_YES
flag, allow NULL
MK_PTRB * MK_PTR
generic pointer data-type
const MK_STRB * MK_STRN
constant string pointer data-type
bool MK_BOOL
real bool data-type
signed int MK_I32
4 byte integer data-type
int MK_DBG
debug-level data-type …
static bool MkSysStringIsNULL(MK_STRN str)
test if string is NULL or EMPTY …
#define MkRuntimeLogTargetReset()
#define MkRuntimeErrorGetCode()
static void MkRuntimeDebugSet(MK_I32 dbg)
set the MkRuntimeS::debug value …
static bool MkRuntimeIsSilentGet(void)
get the MkRuntimeS::isSilent value …
#define MkRuntimeLogTargetSet(...)
#define MkRuntimeNoDecoSet(...)
static MK_I32 MkRuntimeDebugGet(void)
get the MkRuntimeS::debug value …
#define MkRuntimeIsSilentSet(...)
static MK_STRN MkRuntimeLogTargetGet(void)
get the MkLogDataS::logNAME value …
#define MkRuntimeLog0(...)
#define MK_RT_ARGS
#define OT_CHECK_OBJN(val, nullB)
object header …