theKernel 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - py - rb - jv - cc
Loading...
Searching...
No Matches
MkObjectC_py.c
Go to the documentation of this file.
1
12/* LABEL-INIT */
13
14#define SetupRtFromObj_X(hdl) MkRtSetup_O(hdl)
15#define SetupRtFromObj_XN(hdl) MkRtSetup_ON(hdl)
16
17/* LABEL-START */
18
19#define META_FILE_NAME "MkObjectC_py.c"
20
21#include "LibMkKernel_private_py.h"
22
23// PY class
24#define OT_CLASS (&NS(MkObjectCR))
25#define OT_CLASS_NAME "MkObjectC"
26
27#define OT_LNG2META(O) MkObj(VAL2MNG(O))
28
29#define OT_retObj_CONSTR(mng) OT_retObj_SET(NS(MkObjectC_CTOR)(MK_RT_CALL (PyTypeObject*)class,mng))
30
31#define OT_SETUP_hdl OT_SETUP_hdl_tmpl(MkObjectC)
32#define OT_SETUP_hdl__null_allow OT_SETUP_hdl_tmpl__null_allow(MkObjectC)
33#define OT_SETUP_hdl_constr MK_RT_UNUSED AllRtSetup_NULL; \
34 MK_OBJ hdl = (MK_OBJ) &MkERROR;
35#define OT_SETUP_hdl_destr OT_SETUP_hdl_tmpl__null_allow(MkObjectC)
36#define OT_SETUP_hdl_static MK_RT_UNUSED AllRtSetup_NULL; \
37 __attribute__((unused)) MK_TYP hdl = MkObjectC##_TT;
38
39#define OT_SETUP_hdl_static_constr OT_SETUP_hdl_static
40
41#if !defined(SetupRtFromObj_X)
42 #define SetupRtFromObj_X(hdl) AllRtSetup_X(hdl)
43 #define SetupRtFromObj_XN(hdl) AllRtSetup_XN(hdl)
44#endif
45
46// MO class
47#undef MkObjectCTT
48#define MkObjectCTT MK(MkKernelThreadState).MkObjectCTT
49/* MkObjectC_MK_NULL defined in LibMkKernel_py.h */
50
51__attribute__((unused)) mk_inline
52OT_LNG_T NS(MkObjectC_CTOR) (MK_RT_ARGS OT_LNG_CLASS_T type, MK_OBJ hdl) {
53 return MK(AtomCreate)(MK_RT_CALL type,MkObjectC_X2obj(hdl),true);
54}
55
56// helper: mk_debug_color(MK_COLOR_YELLOW,"hdl<%p>, self<%p>", obj, self);
57
58// MQ: ObjNew feature: selfCreate will be called from "ObjNew->MkSelfNew" if MkObj need a SELF pointer
59static MK_PTR NS(MkObjectC_selfCreate) (MK_RT_ARGS MK_OBJ const obj, MK_PTR const env) {
60 return MK(AtomCreate) (MK_RT_CALL OT_CLASS,obj,true);
61}
62// MQ: called if MkObj must be destroyed and if the SELF is still alive → goal: destroy the SELF
63static void NS(MkObjectC_selfDelete) (MK_RT_ARGS MK_PTR self, MK_PTR const env) {
64 OT_OBJECT_DELETE_HARD(OT_SELF);
65}
66// MQ: called to destroy link from SELF to META
67static void NS(MkObjectC_selfUnlink) (MK_RT_ARGS MK_PTR self, MK_PTR const env) {
68 MkObjectC_Obj *selfO = (MkObjectC_Obj*) self;
69 selfO->hdl = NULL;
70}
71
72// initialize the PY and MO class specific object
73#define ClassInit \
74 /* if not already done, initialize NEW MQ type */ \
75 if (MkObjectCTT == NULL) MkObjectCTT = MkObjectSTT; \
76 \
77 /* protect against double call */ \
78 if (MkObjectCTT->selfCreate == NS(MkObjectC_selfCreate)) return MK_OK; \
79 \
80 /* add "selfCreate" and "selfDelete" feature to the MQ-Class */ \
81 MkObjectCTT->selfCreate = NS(MkObjectC_selfCreate); \
82 MkObjectCTT->selfDelete = NS(MkObjectC_selfDelete); \
83 MkObjectCTT->selfUnlink = NS(MkObjectC_selfUnlink); \
84 \
85 if (!PyType_HasFeature(OT_CLASS,Py_TPFLAGS_READY)) { \
86 NS(MkObjectCR).tp_base = OT_MkObjectC_base; \
87 LngErrorCheck (PyType_Ready(OT_CLASS)); \
88 } \
89 LngErrorCheck(PyModule_AddObjectRef(m, "MkObjectC", (PyObject *)OT_CLASS)); \
90 \
91 /* define the "NULL" object */ \
92 MkObjectC_MK_NULL = Py_NewRef(MK(AtomCreate) (MK_RT_CALL OT_CLASS, NULL /*obj*/, false));
93
94/* LABEL-END */
95
96#define MqDbgO_O(hdl,frm) printXSObj(hdl,frm,OBJ2VAL(hdl))
97#define MkObjectErrorCatchTmpl(...) MK(MkExceptionC_Set)(OT_Prefix_CALL __VA_ARGS__)
98#define MkObjectToNameOfClassTmpl(hdl) OT_LNG_OBJ_CLASSNAME(OBJ2VAL(hdl))
99#define MkDbgDumpTmpl(...) MK(DbgDumpTmpl)( MK_RT_CALL __VA_ARGS__ )
100
101static enum MkErrorE MK(DbgDumpTmpl)( MK_RT_ARGS MK_OBJ const obj, MK_STRN const message, MK_STRN const callfunc)
102{
103 MkBufferCreateLOCAL_T(MkBuffer256C,buf,512);
104 MkBufferAppendV(buf, "message = %s\n", message);
105 MkBufferAppendV(buf, formatObj("intern =", OT_SELF_O(obj)));
106 return MkDbgDump(obj, bufR.super.buf.storage.first.C, callfunc);
107}
108
114
115// BEGIN-DOC - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
116
117// doc-key: MkObjectC,MkDbg,sm_,func
118#define DbgM_doc "MkObjectC.DbgM(message:string, ?debug:int32=0?, ?callfunc:string=\"MK_NULL\"?, ?lvl:int32=0?)"
119
120// doc-key: MkObjectC,MkDbg,om_,func
121#define DbgDump_doc "obj.DbgDump(?message:string=\"var\"?, ?callfunc:string=\"MK_NULL\"?) (const)"
122#define DbgL_doc "fmtobj.DbgL(message:string, ?debug:int32=0?, ?callfunc:string=\"MK_NULL\"?, ?lvl:int32=0?) (const)"
123#define DbgLogC_doc "obj.DbgLogC(?callfunc:string=\"MK_NULL\"?) (const)"
124#define DbgO_doc "obj.DbgO(?callfunc:string=\"MK_NULL\"?) (const)"
125#define DbgSTACK_doc "fmtobj.DbgSTACK(?skip:int32=0?, ?num:int32=-1?, ?callfunc:string=\"MK_NULL\"?) (const)"
126
127// doc-key: MkObjectC,MkLog,om_,func
128#define LogC_doc "fmtobj.LogC(message:string, ?debug:int32=0?, ?callfunc:string=\"MK_NULL\"?) (const)"
129#define LogHEX_doc "fmtobj.LogHEX(callfunc:string, data:binary) (const)"
130
131// doc-key: MkObjectC,MkObj,om_,func
132#define RefGet_doc "int32 obj.RefGet()"
133
134// doc-key: MkObjectC,MkObject,sc_,func
135#define GetNull_doc "MkObjectC MkObjectC.GetNull()"
136#define HandleResolve_doc "MkObjectC MkObjectC.HandleResolve(netHdl:MK_HDL)"
137#define Instances_doc "MkObjectC MkObjectC.Instances()"
138
139// doc-key: MkObjectC,MkObject,sm_,func
140#define DeleteCallbackCleanup_doc "MkObjectC.DeleteCallbackCleanup(ident:string)"
141#define DeleteCallbackSetup_doc "MkObjectC.DeleteCallbackSetup(ident:string, ?callback:callable=None?, ?filter:string=\"None\"?)"
142#define HandleDeleteByNetHdl_doc "MkObjectC.HandleDeleteByNetHdl(netHdl:MK_HDL)"
143
144// doc-key: MkObjectC,MkObject,oD_,func
145#define Delete_doc "obj.Delete()"
146
147// doc-key: MkObjectC,MkObject,od_,func
148#define Dispose_doc "obj.Dispose()"
149
150// doc-key: MkObjectC,MkObject,oc_,func
151#define ErrorCatch_doc "MkErrorC obj.ErrorCatch(?exception:errorCode=None?, ?callfunc:string=\"MK_NULL\"?) (const)"
152#define Next_doc "MkObjectC obj.Next()"
153#define Prev_doc "MkObjectC obj.Prev()"
154#define ToError_doc "MkErrorC obj.ToError()"
155
156// doc-key: MkObjectC,MkObject,om_,func
157#define HandleDelete_doc "netObj.HandleDelete()"
158#define HandleGet_doc "MK_HDL obj.HandleGet()"
159#define HandleGetOfType_doc "int32 obj.HandleGetOfType()"
160#define IsNull_doc "bool obj.IsNull()"
161#define Log_doc "obj.Log(?fmtobj:MkObjectC=None?, ?debug:int32=0?, ?callfunc:string=\"MK_NULL\"?, ?lvl:int32=0?) (const)"
162#define LogDetail_doc "obj.LogDetail(?fmtobj:MkObjectC=None?, ?debug:int32=0?, ?callfunc:string=\"MK_NULL\"?, ?lvl:int32=0?) (const)"
163#define LogSimple_doc "obj.LogSimple(?fmtobj:MkObjectC=None?, ?debug:int32=0?, ?callfunc:string=\"MK_NULL\"?, ?lvl:int32=0?) (const)"
164#define ToName_doc "string obj.ToName() (const)"
165#define ToNameOfClass_doc "string obj.ToNameOfClass()"
166#define ToNameOfType_doc "string obj.ToNameOfType() (const)"
167#define ToString_doc "string inst.ToString() (const)"
168
169// doc-key: MkObjectC,MkSys,sm_,func
170#define SysHashI32_doc "int32 MkObjectC.SysHashI32(key:string, ?length:int32=-1?)"
171#define SysHashSTR_doc "string MkObjectC.SysHashSTR(key:string, ?length:int32=-1?)"
172
173// doc-key: MkObjectC,MkSys,om_,func
174#define SysKill_doc "fmtobj.SysKill(pid:int32, signal:int32) (const)"
175
176// doc-key: MkObjectC,MkSys,omo,func
177#define SysGetPid_doc "int32 fmtobj.SysGetPid() (const)"
178
179// END-DOC - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
180
186
187// -----------------------------------------------------------------------------
188
189// vim: Marker(s)
190// BEGIN-MkObjectC - created by 'py_MqC.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
191
195
196// doc-key: MkObjectC,MkObjectC-Class-Export,sc_
197
199static OT_ProcRet NS(MkObjectC_HandleResolve) (OtClass_ARGS) {
201 OT_SETUP_ONEARG(HandleResolve_doc)
202 MK_HDL netHdl = 0;
203 OT_CHECK_REQUIRED(OT_CHECK_NIH (netHdl))
204 OT_CHECK_NOARGS
205 MK_OBJ retVal = MkObjectHandleResolve (netHdl);
206 OT_retObj_SET_OBJ(retVal)
207 goto end;
208 error:
209 OT_retObj_SET_Error
210 end:
211 OT_retObj_RETURN
212}
213
214// doc-key: MkObjectC,MkObjectC-Class-Export,om_
215
217static OT_ProcRet NS(MkObjectC_HandleDelete) (MkObjectC_ARGS) {
219 OT_SETUP_NOARG(HandleDelete_doc)
220 OT_CHECK_NOARGS
222 OT_retObj_SET_None
223 goto end;
224 error:
225 OT_retObj_SET_Error
226 end:
227 OT_retObj_RETURN
228}
229
231static OT_ProcRet NS(MkObjectC_HandleGet) (MkObjectC_ARGS) ; // skip template-required
232
233// doc-key: MkObjectC,MkObjectC-Class-Export,sm_
234
236static OT_ProcRet NS(MkObjectC_HandleDeleteByNetHdl) (OtClass_ARGS) {
238 OT_SETUP_ONEARG(HandleDeleteByNetHdl_doc)
239 MK_HDL netHdl = 0;
240 OT_CHECK_REQUIRED(OT_CHECK_NIH (netHdl))
241 OT_CHECK_NOARGS
243 OT_retObj_SET_None
244 goto end;
245 error:
246 OT_retObj_SET_Error
247 end:
248 OT_retObj_RETURN
249}
250
252// MkObjectC_Class_PY_API
253
257
258// doc-key: MkObjectC,MkObjectC-Class-Introspection,oc_
259
261static OT_ProcRet NS(MkObjectC_Next) (MkObjectC_ARGS) {
263 OT_SETUP_NOARG(Next_doc)
264 OT_CHECK_NOARGS
265 MK_OBJ retVal = MkObjectNext (hdl);
266 OT_retObj_SET_OBJ(retVal)
267 goto end;
268 error:
269 OT_retObj_SET_Error
270 end:
271 OT_retObj_RETURN
272}
273
275static OT_ProcRet NS(MkObjectC_Prev) (MkObjectC_ARGS) {
277 OT_SETUP_NOARG(Prev_doc)
278 OT_CHECK_NOARGS
279 MK_OBJ retVal = MkObjectPrev (hdl);
280 OT_retObj_SET_OBJ(retVal)
281 goto end;
282 error:
283 OT_retObj_SET_Error
284 end:
285 OT_retObj_RETURN
286}
287
288// doc-key: MkObjectC,MkObjectC-Class-Introspection,sc_
289
291static OT_ProcRet NS(MkObjectC_Instances) (OtClass_ARGS) {
293 OT_SETUP_NOARG(Instances_doc)
294 OT_CHECK_NOARGS
295 MK_OBJ retVal = MkObjectInstances ();
296 OT_retObj_SET_OBJ(retVal)
297 goto end;
298 error:
299 OT_retObj_SET_Error
300 end:
301 OT_retObj_RETURN
302}
303
305// MkObjectC_Class_PY_API
306
310
311// doc-key: MkObjectC,MkObjectC-Class-Misc,sc_
312
314static OT_ProcRet NS(MkObjectC_GetNull) (OtClass_ARGS) {
316 OT_SETUP_NOARG(GetNull_doc)
317 OT_CHECK_NOARGS
318 MK_OBJ retVal = MkObjectGetNull ();
319 OT_retObj_SET_OBJ(retVal)
320 goto end;
321 error:
322 OT_retObj_SET_Error
323 end:
324 OT_retObj_RETURN
325}
326
328// MkObjectC_Class_PY_API
329
333
334// doc-key: MkObjectC,MkObjectC-Dbg,om_
335
337static OT_ProcRet NS(MkObjectC_DbgDump) (MkObjectC_ARGS) {
339 OT_SETUP_VARARGS(0,2,DbgDump_doc)
340 MK_STRN message = "var";
341 OT_CHECK_OPTIONAL(OT_CHECK_STRN (message))
342 MK_STRN callfunc = NULL;
343 OT_CHECK_OPTIONAL(OT_CHECK_STRN (callfunc))
344 OT_CHECK_NOARGS
345 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
346 OT_FRAME_CLEANUP;
347 MkErrorC_Check(hdl,MkDbgDumpTmpl (hdl, message, callfunc));
348 OT_retObj_SET_None
349 goto end;
350 error:
351 OT_retObj_SET_Error
352 end:
353 OT_retObj_RETURN
354}
355
357static OT_ProcRet NS(MkObjectC_DbgL) (MkObjectC_ARGS) {
359 OT_SETUP_VARARGS(1,4,DbgL_doc)
360 MK_STRN message = 0;
361 OT_CHECK_REQUIRED(OT_CHECK_STRN (message))
362 MK_DBG debug = 0;
363 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (debug))
364 MK_STRN callfunc = NULL;
365 OT_CHECK_OPTIONAL(OT_CHECK_STRN (callfunc))
366 MK_I32 lvl = 0;
367 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (lvl))
368 OT_CHECK_NOARGS
369 if (debug > MkRuntimeGetDebug()) {
370 OT_retObj_SET_None;
371 goto end;
372 }
373 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
374 OT_FRAME_CLEANUP;
375 MkDbgL (hdl, message, debug, callfunc, lvl);
376 OT_retObj_SET_None
377 goto end;
378 error:
379 OT_retObj_SET_Error
380 end:
381 OT_retObj_RETURN
382}
383
385static OT_ProcRet NS(MkObjectC_DbgLogC) (MkObjectC_ARGS) {
387 OT_SETUP_VARARGS(0,1,DbgLogC_doc)
388 MK_STRN callfunc = NULL;
389 OT_CHECK_OPTIONAL(OT_CHECK_STRN (callfunc))
390 OT_CHECK_NOARGS
391 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
392 OT_FRAME_CLEANUP;
393 MkDbgLogC (hdl, callfunc);
394 OT_retObj_SET_None
395 goto end;
396 error:
397 OT_retObj_SET_Error
398 end:
399 OT_retObj_RETURN
400}
401
403static OT_ProcRet NS(MkObjectC_DbgO) (MkObjectC_ARGS) {
405 OT_SETUP_VARARGS(0,1,DbgO_doc)
406 MK_STRN callfunc = NULL;
407 OT_CHECK_OPTIONAL(OT_CHECK_STRN (callfunc))
408 OT_CHECK_NOARGS
409 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
410 OT_FRAME_CLEANUP;
411 MkDbgO (hdl, callfunc);
412 OT_retObj_SET_None
413 goto end;
414 error:
415 OT_retObj_SET_Error
416 end:
417 OT_retObj_RETURN
418}
419
421static OT_ProcRet NS(MkObjectC_DbgSTACK) (MkObjectC_ARGS) {
423 OT_SETUP_VARARGS(0,3,DbgSTACK_doc)
424 MK_I32 skip = 0;
425 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (skip))
426 MK_I32 num = -1;
427 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (num))
428 MK_STRN callfunc = NULL;
429 OT_CHECK_OPTIONAL(OT_CHECK_STRN (callfunc))
430 OT_CHECK_NOARGS
431 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
432 OT_FRAME_CLEANUP;
433 MkDbgSTACK (hdl, skip, num, callfunc);
434 OT_retObj_SET_None
435 goto end;
436 error:
437 OT_retObj_SET_Error
438 end:
439 OT_retObj_RETURN
440}
441
442// doc-key: MkObjectC,MkObjectC-Dbg,sm_
443
445static OT_ProcRet NS(MkObjectC_DbgM) (OtClass_ARGS) {
447 OT_SETUP_VARARGS(1,4,DbgM_doc)
448 MK_STRN message = 0;
449 OT_CHECK_REQUIRED(OT_CHECK_STRN (message))
450 MK_DBG debug = 0;
451 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (debug))
452 MK_STRN callfunc = NULL;
453 OT_CHECK_OPTIONAL(OT_CHECK_STRN (callfunc))
454 MK_I32 lvl = 0;
455 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (lvl))
456 OT_CHECK_NOARGS
457 if (debug > MkRuntimeGetDebug()) {
458 OT_retObj_SET_None;
459 goto end;
460 }
461 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
462 OT_FRAME_CLEANUP;
463 MkDbgM (message, debug, callfunc, lvl);
464 OT_retObj_SET_None
465 goto end;
466 error:
467 OT_retObj_SET_Error
468 end:
469 OT_retObj_RETURN
470}
471
473// MkObjectC_Dbg_PY_API
474
478
479// doc-key: MkObjectC,MkObjectC-Log,om_
480
482static OT_ProcRet NS(MkObjectC_LogC) (MkObjectC_ARGS) {
484 OT_SETUP_VARARGS(1,3,LogC_doc)
485 MK_STRN message = 0;
486 OT_CHECK_REQUIRED(OT_CHECK_STRN (message))
487 MK_DBG debug = 0;
488 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (debug))
489 MK_STRN callfunc = NULL;
490 OT_CHECK_OPTIONAL(OT_CHECK_STRN (callfunc))
491 OT_CHECK_NOARGS
492 if (debug > MkRuntimeGetDebug()) {
493 OT_retObj_SET_None;
494 goto end;
495 }
496 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
497 OT_FRAME_CLEANUP;
498 MkLogC (hdl, message, debug, callfunc);
499 OT_retObj_SET_None
500 goto end;
501 error:
502 OT_retObj_SET_Error
503 end:
504 OT_retObj_RETURN
505}
506
508static OT_ProcRet NS(MkObjectC_LogHEX) (MkObjectC_ARGS) {
510 OT_SETUP_VARARGS(1,2,LogHEX_doc)
511 MK_STRN callfunc = NULL;
512 OT_CHECK_OPTIONAL(OT_CHECK_STRN (callfunc))
513 MkBinaryR data = {0};
514 OT_CHECK_REQUIRED(OT_CHECK__ME_REF_MkBinaryR(data))
515 OT_CHECK_NOARGS
516 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
517 OT_FRAME_CLEANUP;
518 MkLogHEX (hdl, callfunc, data);
519 OT_retObj_SET_None
520 goto end;
521 error:
522 OT_retObj_SET_Error
523 end:
524 OT_retObj_RETURN
525}
526
528static OT_ProcRet NS(MkObjectC_Log) (MkObjectC_ARGS) {
530 OT_SETUP_VARARGS(0,4,Log_doc)
531 MK_OBJN fmtobj = NULL;
532 OT_CHECK_OPTIONAL(OT_CHECK_OBJN (fmtobj,MK_NULL_YES))
533 MK_DBG debug = 0;
534 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (debug))
535 MK_STRN callfunc = NULL;
536 OT_CHECK_OPTIONAL(OT_CHECK_STRN (callfunc))
537 MK_I32 lvl = 0;
538 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (lvl))
539 OT_CHECK_NOARGS
540 if (debug > MkRuntimeGetDebug()) {
541 OT_retObj_SET_None;
542 goto end;
543 }
544 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
545 OT_FRAME_CLEANUP;
546 MkObjectLog (hdl, fmtobj, debug, callfunc, lvl);
547 OT_retObj_SET_None
548 goto end;
549 error:
550 OT_retObj_SET_Error
551 end:
552 OT_retObj_RETURN
553}
554
556static OT_ProcRet NS(MkObjectC_LogDetail) (MkObjectC_ARGS) {
558 OT_SETUP_VARARGS(0,4,LogDetail_doc)
559 MK_OBJN fmtobj = NULL;
560 OT_CHECK_OPTIONAL(OT_CHECK_OBJN (fmtobj,MK_NULL_YES))
561 MK_DBG debug = 0;
562 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (debug))
563 MK_STRN callfunc = NULL;
564 OT_CHECK_OPTIONAL(OT_CHECK_STRN (callfunc))
565 MK_I32 lvl = 0;
566 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (lvl))
567 OT_CHECK_NOARGS
568 if (debug > MkRuntimeGetDebug()) {
569 OT_retObj_SET_None;
570 goto end;
571 }
572 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
573 OT_FRAME_CLEANUP;
574 MkObjectLogDetail (hdl, fmtobj, debug, callfunc, lvl);
575 OT_retObj_SET_None
576 goto end;
577 error:
578 OT_retObj_SET_Error
579 end:
580 OT_retObj_RETURN
581}
582
584static OT_ProcRet NS(MkObjectC_LogSimple) (MkObjectC_ARGS) {
586 OT_SETUP_VARARGS(0,4,LogSimple_doc)
587 MK_OBJN fmtobj = NULL;
588 OT_CHECK_OPTIONAL(OT_CHECK_OBJN (fmtobj,MK_NULL_YES))
589 MK_DBG debug = 0;
590 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (debug))
591 MK_STRN callfunc = NULL;
592 OT_CHECK_OPTIONAL(OT_CHECK_STRN (callfunc))
593 MK_I32 lvl = 0;
594 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (lvl))
595 OT_CHECK_NOARGS
596 if (debug > MkRuntimeGetDebug()) {
597 OT_retObj_SET_None;
598 goto end;
599 }
600 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
601 OT_FRAME_CLEANUP;
602 MkObjectLogSimple (hdl, fmtobj, debug, callfunc, lvl);
603 OT_retObj_SET_None
604 goto end;
605 error:
606 OT_retObj_SET_Error
607 end:
608 OT_retObj_RETURN
609}
610
612// MkObjectC_Log_PY_API
613
617
618// doc-key: MkObjectC,MkObjectC-Misc,oc_
619
621static OT_ProcRet NS(MkObjectC_ErrorCatch) (MkObjectC_ARGS) {
623 OT_SETUP_VARARGS(0,2,ErrorCatch_doc)
624 MK_EXP exception = NULL;
625 OT_CHECK_OPTIONAL(OT_CHECK_EXP (exception))
626 MK_STRN callfunc = NULL;
627 OT_CHECK_OPTIONAL(OT_CHECK_STRN (callfunc))
628 OT_CHECK_NOARGS
629 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
630 MK_ERR retVal = MkObjectErrorCatchTmpl (hdl, exception, callfunc);
631 OT_FRAME_CLEANUP;
632 OT_retObj_SET_ERR(retVal)
633 goto end;
634 error:
635 OT_retObj_SET_Error
636 end:
637 OT_retObj_RETURN
638}
639
641static OT_ProcRet NS(MkObjectC_ToError) (MkObjectC_ARGS) {
643 OT_SETUP_NOARG(ToError_doc)
644 OT_CHECK_NOARGS
645 MK_ERR retVal = MkObjectToError (hdl);
646 OT_retObj_SET_ERR(retVal)
647 goto end;
648 error:
649 OT_retObj_SET_Error
650 end:
651 OT_retObj_RETURN
652}
653
654// doc-key: MkObjectC,MkObjectC-Misc,om_
655
657static OT_ProcRet NS(MkObjectC_HandleGetOfType) (MkObjectC_ARGS) {
659 OT_SETUP_NOARG(HandleGetOfType_doc)
660 OT_CHECK_NOARGS
661 OT_retObj_SET_I32(MkObjectHandleGetOfType (hdl))
662 goto end;
663 error:
664 OT_retObj_SET_Error
665 end:
666 OT_retObj_RETURN
667}
668
670static OT_ProcRet NS(MkObjectC_IsNull) (MkObjectC_ARGS) ; // skip template-required
671
673static OT_ProcRet NS(MkObjectC_ToName) (MkObjectC_ARGS) {
675 OT_SETUP_NOARG(ToName_doc)
676 OT_CHECK_NOARGS
677 OT_retObj_SET_STR(MkObjectToName (hdl))
678 goto end;
679 error:
680 OT_retObj_SET_Error
681 end:
682 OT_retObj_RETURN
683}
684
686static OT_ProcRet NS(MkObjectC_ToNameOfClass) (MkObjectC_ARGS) {
688 OT_SETUP_NOARG(ToNameOfClass_doc)
689 OT_CHECK_NOARGS
690 OT_retObj_SET_STR(MkObjectToNameOfClassTmpl (hdl))
691 goto end;
692 error:
693 OT_retObj_SET_Error
694 end:
695 OT_retObj_RETURN
696}
697
699static OT_ProcRet NS(MkObjectC_ToNameOfType) (MkObjectC_ARGS) {
701 OT_SETUP_NOARG(ToNameOfType_doc)
702 OT_CHECK_NOARGS
703 OT_retObj_SET_STR(MkObjectToNameOfType (hdl))
704 goto end;
705 error:
706 OT_retObj_SET_Error
707 end:
708 OT_retObj_RETURN
709}
710
712static OT_ProcRet NS(MkObjectC_ToString) (MkObjectC_ARGS) {
714 OT_SETUP_NOARG(ToString_doc)
715 OT_CHECK_NOARGS
716 OT_retObj_SET_STR(MkObjectToString (hdl))
717 goto end;
718 error:
719 OT_retObj_SET_Error
720 end:
721 OT_retObj_RETURN
722}
723
725// MkObjectC_Misc_PY_API
726
730
731// doc-key: MkObjectC,MkObjectC-Obj,om_
732
734static OT_ProcRet NS(MkObjectC_RefGet) (MkObjectC_ARGS) {
736 OT_SETUP_NOARG(RefGet_doc)
737 OT_CHECK_NOARGS
738 OT_retObj_SET_I32(MkRefGet (hdl))
739 goto end;
740 error:
741 OT_retObj_SET_Error
742 end:
743 OT_retObj_RETURN
744}
745
747// MkObjectC_Obj_PY_API
748
752
753// doc-key: MkObjectC,MkObjectC-Sys,om_
754
756static OT_ProcRet NS(MkObjectC_SysKill) (MkObjectC_ARGS) {
758 OT_SETUP_VARARGS(2,2,SysKill_doc)
759 MK_I32 pid = 0;
760 OT_CHECK_REQUIRED(OT_CHECK_NI4 (pid))
761 MK_I32 signal = 0;
762 OT_CHECK_REQUIRED(OT_CHECK_NI4 (signal))
763 OT_CHECK_NOARGS
764 MkErrorC_Check(hdl,MkSysKill (hdl, pid, signal));
765 OT_retObj_SET_None
766 goto end;
767 error:
768 OT_retObj_SET_Error
769 end:
770 OT_retObj_RETURN
771}
772
773// doc-key: MkObjectC,MkObjectC-Sys,omo
774
776static OT_ProcRet NS(MkObjectC_SysGetPid) (MkObjectC_ARGS) {
778 OT_SETUP_NOARG(SysGetPid_doc)
779 OT_CHECK_NOARGS
780 MK_I32 pid_out;
781 MkErrorC_Check(hdl,MkSysGetPid (hdl, &pid_out));
782 OT_retObj_SET_I32(pid_out)
783 goto end;
784 error:
785 OT_retObj_SET_Error
786 end:
787 OT_retObj_RETURN
788}
789
790// doc-key: MkObjectC,MkObjectC-Sys,sm_
791
793static OT_ProcRet NS(MkObjectC_SysHashI32) (OtClass_ARGS) {
795 OT_SETUP_VARARGS(1,2,SysHashI32_doc)
796 MK_STRN key = 0;
797 OT_CHECK_REQUIRED(OT_CHECK_STRN (key))
798 MK_NUM length = -1;
799 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (length))
800 OT_CHECK_NOARGS
801 OT_retObj_SET_I32(MkSysHashI32 (key, length))
802 goto end;
803 error:
804 OT_retObj_SET_Error
805 end:
806 OT_retObj_RETURN
807}
808
810static OT_ProcRet NS(MkObjectC_SysHashSTR) (OtClass_ARGS) {
812 OT_SETUP_VARARGS(1,2,SysHashSTR_doc)
813 MK_STRN key = 0;
814 OT_CHECK_REQUIRED(OT_CHECK_STRN (key))
815 MK_NUM length = -1;
816 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (length))
817 OT_CHECK_NOARGS
818 OT_retObj_SET_STR(MkSysHashSTR (key, length))
819 goto end;
820 error:
821 OT_retObj_SET_Error
822 end:
823 OT_retObj_RETURN
824}
825
827// MkObjectC_Sys_PY_API
828
832
833// doc-key: MkObjectC,MkObjectC-TOR,od_
834
836static OT_ProcRet NS(MkObjectC_Dispose) (MkObjectC_ARGS) {
838 OT_SETUP_NOARG(Dispose_doc)
839 OT_CHECK_NOARGS
840 OT_OBJECT_DISPOSE(OT_SELF);
841 OT_retObj_SET_None
842 goto end;
843 error:
844 OT_retObj_SET_Error
845 end:
846 OT_retObj_RETURN
847}
848
849// doc-key: MkObjectC,MkObjectC-TOR,oD_
850
852static OT_ProcRet NS(MkObjectC_Delete) (MkObjectC_ARGS) {
854 OT_SETUP_NOARG(Delete_doc)
855 OT_CHECK_NOARGS
856 OT_OBJECT_DELETE(OT_SELF);
857 OT_retObj_SET_None
858 goto end;
859 error:
860 OT_retObj_SET_Error
861 end:
862 OT_retObj_RETURN
863}
864
865// doc-key: MkObjectC,MkObjectC-TOR,sm_
866
868static OT_ProcRet NS(MkObjectC_DeleteCallbackCleanup) (OtClass_ARGS) {
870 OT_SETUP_ONEARG(DeleteCallbackCleanup_doc)
871 MK_STRN ident = 0;
872 OT_CHECK_REQUIRED(OT_CHECK_STRN (ident))
873 OT_CHECK_NOARGS
875 OT_retObj_SET_None
876 goto end;
877 error:
878 OT_retObj_SET_Error
879 end:
880 OT_retObj_RETURN
881}
882
884static OT_ProcRet NS(MkObjectC_DeleteCallbackSetup) (OtClass_ARGS) {
886 OT_SETUP_VARARGS(1,3,DeleteCallbackSetup_doc)
887 MK_STRN ident = 0;
888 OT_CHECK_REQUIRED(OT_CHECK_STRN (ident))
889 OT_SETUP_CALLABLE(callback)
890 OT_CHECK_OPTIONAL(OT_CHECK_CALLABLE(callback))
891 MK_STRN filter = NULL;
892 OT_CHECK_OPTIONAL(OT_CHECK_STRN (filter))
893 OT_CHECK_NOARGS
894 MkObjectDeleteCallF fCall = (callback == NULL ? NULL : NS(ObjectDeleteCall));
895 MkErrorC_Check(MK_ERROR_FORMAT,MkObjectDeleteCallbackSetup (ident, fCall, callback, NS(ObjectDeleteFree), filter));
896 OT_retObj_SET_None
897 goto end;
898 error:
899 OT_retObj_SET_Error
900 end:
901 OT_CLEANUP_CALLABLE(callback)
902 OT_retObj_RETURN
903}
904
906// MkObjectC_TOR_PY_API
907
908// END-MkObjectC - created by 'py_MqC.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
909
910// vim: Marker(o)
916
917static PyMethodDef NS(MkObjectC_Methods)[] = {
918
919 // BEGIN-CLASS - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
920
921 // doc-key: MkObjectC,MkDbg,sm_
922 { "DbgM" , (PyCFunction) NS(MkObjectC_DbgM) , METH_VARARGS|METH_CLASS , DbgM_doc },
923
924 // doc-key: MkObjectC,MkObject,sc_
925 { "GetNull" , (PyCFunction) NS(MkObjectC_GetNull) , METH_NOARGS|METH_CLASS , GetNull_doc },
926 { "HandleResolve" , (PyCFunction) NS(MkObjectC_HandleResolve) , METH_O|METH_CLASS , HandleResolve_doc },
927 { "Instances" , (PyCFunction) NS(MkObjectC_Instances) , METH_NOARGS|METH_CLASS , Instances_doc },
928
929 // doc-key: MkObjectC,MkObject,sm_
930 { "DeleteCallbackCleanup" , (PyCFunction) NS(MkObjectC_DeleteCallbackCleanup) , METH_O|METH_CLASS , DeleteCallbackCleanup_doc },
931 { "DeleteCallbackSetup" , (PyCFunction) NS(MkObjectC_DeleteCallbackSetup) , METH_VARARGS|METH_CLASS , DeleteCallbackSetup_doc },
932 { "HandleDeleteByNetHdl" , (PyCFunction) NS(MkObjectC_HandleDeleteByNetHdl) , METH_O|METH_CLASS , HandleDeleteByNetHdl_doc },
933
934 // doc-key: MkObjectC,MkSys,sm_
935 { "SysHashI32" , (PyCFunction) NS(MkObjectC_SysHashI32) , METH_VARARGS|METH_CLASS , SysHashI32_doc },
936 { "SysHashSTR" , (PyCFunction) NS(MkObjectC_SysHashSTR) , METH_VARARGS|METH_CLASS , SysHashSTR_doc },
937
938 // END-CLASS - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
939 // BEGIN-OBJ - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
940
941 // doc-key: MkObjectC,MkDbg,om_
942 { "DbgDump" , (PyCFunction) NS(MkObjectC_DbgDump) , METH_VARARGS , DbgDump_doc },
943 { "DbgL" , (PyCFunction) NS(MkObjectC_DbgL) , METH_VARARGS , DbgL_doc },
944 { "DbgLogC" , (PyCFunction) NS(MkObjectC_DbgLogC) , METH_VARARGS , DbgLogC_doc },
945 { "DbgO" , (PyCFunction) NS(MkObjectC_DbgO) , METH_VARARGS , DbgO_doc },
946 { "DbgSTACK" , (PyCFunction) NS(MkObjectC_DbgSTACK) , METH_VARARGS , DbgSTACK_doc },
947
948 // doc-key: MkObjectC,MkLog,om_
949 { "LogC" , (PyCFunction) NS(MkObjectC_LogC) , METH_VARARGS , LogC_doc },
950 { "LogHEX" , (PyCFunction) NS(MkObjectC_LogHEX) , METH_VARARGS , LogHEX_doc },
951
952 // doc-key: MkObjectC,MkObj,om_
953 { "RefGet" , (PyCFunction) NS(MkObjectC_RefGet) , METH_NOARGS , RefGet_doc },
954
955 // doc-key: MkObjectC,MkObject,oD_
956 { "Delete" , (PyCFunction) NS(MkObjectC_Delete) , METH_NOARGS , Delete_doc },
957
958 // doc-key: MkObjectC,MkObject,od_
959 { "Dispose" , (PyCFunction) NS(MkObjectC_Dispose) , METH_NOARGS , Dispose_doc },
960
961 // doc-key: MkObjectC,MkObject,oc_
962 { "ErrorCatch" , (PyCFunction) NS(MkObjectC_ErrorCatch) , METH_VARARGS , ErrorCatch_doc },
963 { "Next" , (PyCFunction) NS(MkObjectC_Next) , METH_NOARGS , Next_doc },
964 { "Prev" , (PyCFunction) NS(MkObjectC_Prev) , METH_NOARGS , Prev_doc },
965 { "ToError" , (PyCFunction) NS(MkObjectC_ToError) , METH_NOARGS , ToError_doc },
966
967 // doc-key: MkObjectC,MkObject,om_
968 { "HandleDelete" , (PyCFunction) NS(MkObjectC_HandleDelete) , METH_NOARGS , HandleDelete_doc },
969 { "HandleGet" , (PyCFunction) NS(MkObjectC_HandleGet) , METH_NOARGS , HandleGet_doc },
970 { "HandleGetOfType" , (PyCFunction) NS(MkObjectC_HandleGetOfType) , METH_NOARGS , HandleGetOfType_doc },
971 { "IsNull" , (PyCFunction) NS(MkObjectC_IsNull) , METH_NOARGS , IsNull_doc },
972 { "Log" , (PyCFunction) NS(MkObjectC_Log) , METH_VARARGS , Log_doc },
973 { "LogDetail" , (PyCFunction) NS(MkObjectC_LogDetail) , METH_VARARGS , LogDetail_doc },
974 { "LogSimple" , (PyCFunction) NS(MkObjectC_LogSimple) , METH_VARARGS , LogSimple_doc },
975 { "ToName" , (PyCFunction) NS(MkObjectC_ToName) , METH_NOARGS , ToName_doc },
976 { "ToNameOfClass" , (PyCFunction) NS(MkObjectC_ToNameOfClass) , METH_NOARGS , ToNameOfClass_doc },
977 { "ToNameOfType" , (PyCFunction) NS(MkObjectC_ToNameOfType) , METH_NOARGS , ToNameOfType_doc },
978 { "ToString" , (PyCFunction) NS(MkObjectC_ToString) , METH_NOARGS , ToString_doc },
979
980 // doc-key: MkObjectC,MkSys,om_
981 { "SysKill" , (PyCFunction) NS(MkObjectC_SysKill) , METH_VARARGS , SysKill_doc },
982
983 // doc-key: MkObjectC,MkSys,omo
984 { "SysGetPid" , (PyCFunction) NS(MkObjectC_SysGetPid) , METH_NOARGS , SysGetPid_doc },
985
986 // END-OBJ - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
987
988 {NULL, NULL, 0, NULL} /* Sentinel */
989};
990
991
992/*
993 if (MkRefIsLocked(obj)) {
994 obj = MkObjMerge (obj);
995 if (obj == NULL) {
996 PyErr_Format(PyExc_RuntimeError, "MergeError: '%s.Merge()' return a NULL pointer",type->tp_name);
997 return NULL;
998 }
999 } else if (MkRefGet(obj) > 0 && obj->self != NULL) {
1000 return Py_NewRef(obj->self);
1001 } else if (obj->self != NULL) {
1002//printSTACK0();
1003 PyErr_Format(PyExc_RuntimeError,
1004 "InternalError: '%s' 'obj->self != NULL' with 'obj->ref == 0'", type->tp_name
1005 );
1006 return NULL;
1007 }
1008 return NS(AtomCreate)(MK_RT_CALL type,obj,useSelf);
1009}
1010*/
1011
1012// ***********************************************************************************
1013
1014static void
1015MkObjectC_Dealloc(OT_LNG_T self)
1016{
1017 MK_MNG mng = VAL2MNG(self);
1018 if (mng) {
1019 MK_OBJ obj = MkObj(mng);
1020 check_NULL(obj) goto end;
1021 MkRtSetup_ON(obj);
1022
1023 #ifdef LOG_REF
1024 if (self) printLngObj(self)
1025 #endif
1026
1027 // delete link between MQ and PYTHON
1028 obj = MkRefDecrWithoutSelf(obj);
1029 }
1030end:
1031 Py_TYPE(self)->tp_free(self);
1032}
1033
1034PyObject *
1035MkObjectC_Str(OT_LNG_OBJ_T self)
1036{
1038 MK_STRN str = MkObjectToString(hdl);
1039 return STRN2VAL(str);
1040}
1041
1042int NS(sMkObjectC_init)(CONSTR_ARGS)
1043{
1044 return 0;
1045}
1046
1047// ########################################################################################
1048// OVERLOAD
1049
1051static OT_ProcRet NS(MkObjectC_IsNull) (MkObjectC_ARGS) {
1052 OT_SETUP_hdl_static // set hdl to class to avoid using object->hdl
1053 OT_SETUP_NOARG(IsNull_doc)
1054 OT_CHECK_NOARGS
1055 OT_retObj_SET_BOL(MkObjectIsNull(OT_LNG2META(OT_SELF)))
1056 goto end;
1057 error:
1058 OT_retObj_SET_Error
1059 end:
1060 OT_retObj_RETURN
1061}
1062
1064static OT_ProcRet NS(MkObjectC_HandleGet) (MkObjectC_ARGS) {
1065 OT_SETUP_hdl_static // set hdl to class to avoid using object->hdl
1066 OT_SETUP_NOARG(HandleGet_doc)
1067 OT_CHECK_NOARGS
1068 MK_OBJ nullhdl = OT_LNG2META(OT_SELF);
1069 if (nullhdl == NULL) {
1070 OT_retObj_SET_LONG(0);
1071 } else {
1072 OT_retObj_SET_LONG(MkObjectHandleGet(nullhdl))
1073 }
1074 goto end;
1075 error:
1076 OT_retObj_SET_Error
1077 end:
1078 OT_retObj_RETURN
1079}
1080
1086
1088{
1089 Py_INCREF(self);
1090}
1091
1093{
1094 Py_CLEAR(self);
1095}
1096
1097OT_CLASS_TYPE_REF NS(MkObjectCR) = {
1098 PyVarObject_HEAD_INIT(NULL, 0)
1099 .tp_name = "pymkkernel.MkObjectC",
1100 .tp_doc = "PyMkKernel MkObjectC Type",
1101 .tp_basicsize = sizeof(MkObjectC_Obj),
1102 .tp_dealloc = MkObjectC_Dealloc,
1103 .tp_methods = NS(MkObjectC_Methods),
1104 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1105 .tp_str = (reprfunc) MkObjectC_Str,
1106 .tp_init = (initproc) NS(sMkObjectC_init)
1107 };
1108
1109int NS(pMkObjectC_Init) ( MK_RT_ARGS PyObject* m)
1110{
1111/*
1112 NS(MkObjectCR) = (PyTypeObject) {
1113 PyVarObject_HEAD_INIT(NULL, 0)
1114 .tp_name = "pymkkernel.MkObjectC",
1115 .tp_doc = "PyMkKernel MkObjectC Type",
1116 .tp_basicsize = sizeof(MkObjectC_Obj),
1117 .tp_dealloc = MkObjectC_Dealloc,
1118 .tp_methods = NS(MkObjectC_Methods),
1119 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1120 .tp_str = (reprfunc) MkObjectC_Str,
1121 .tp_init = (initproc) NS(sMkObjectC_init)
1122 };
1123*/
1124
1125 // attention this is NOT thread-safe because pymkkernel is NOT thread-safe.
1126 // a threaded application require this PER THREAD and not once
1127 MK_RT_REF.fSelfIncr = MkObjectC_SelfIncr;
1128 MK_RT_REF.fSelfDecr = MkObjectC_SelfDecr;
1129 MK_RT_REF.MkSelfIncrOnCacheB = true;
1130
1131 ClassInit
1132
1133 return 0;
1134error:
1135 return -1;
1136}
1137
1138// vim: nowrap
#define Instances_doc
#define SysKill_doc
#define DbgLogC_doc
#define SysGetPid_doc
void MkObjectC_SelfDecr(MK_RT mkrt, MK_PTR self, MK_PTR const env)
static void MkObjectC_Dealloc(OT_LNG_T self)
#define SysHashSTR_doc
#define LogDetail_doc
#define HandleDeleteByNetHdl_doc
#define SysHashI32_doc
#define OT_SETUP_hdl
#define ToString_doc
void MkObjectC_SelfIncr(MK_RT mkrt, MK_PTR self, MK_PTR const env)
#define ToName_doc
#define LogC_doc
#define Log_doc
#define OT_SETUP_hdl_destr
#define IsNull_doc
#define LogHEX_doc
#define GetNull_doc
#define Next_doc
#define LogSimple_doc
#define HandleResolve_doc
#define DbgM_doc
#define Prev_doc
#define MkDbgDumpTmpl(...)
#define ToError_doc
#define OT_CLASS
#define OT_SETUP_hdl_static
#define DeleteCallbackCleanup_doc
#define OT_LNG2META(O)
#define DbgO_doc
#define HandleGet_doc
#define ToNameOfType_doc
#define HandleDelete_doc
#define OT_SETUP_hdl__null_allow
#define MkObjectToNameOfClassTmpl(hdl)
#define DbgDump_doc
PyObject * MkObjectC_Str(OT_LNG_OBJ_T self)
#define MkObjectErrorCatchTmpl(...)
#define Delete_doc
#define DeleteCallbackSetup_doc
#define DbgL_doc
#define Dispose_doc
#define ErrorCatch_doc
#define ClassInit
#define DbgSTACK_doc
#define HandleGetOfType_doc
#define RefGet_doc
#define ToNameOfClass_doc
#define MkBufferAppendV(...)
#define MkBufferCreateLOCAL_T(cls, name, size)
create an new MkBufferC object as L)ocal S)torage…
#define MK_ERROR_FORMAT
#define mk_inline
#define MK_NULL_YES
flag, allow NULL
MkErrorE
collection for the different error-codes …
int32_t MK_NUM
array size data-type ('num' items in array …
MK_PTRB * MK_PTR
generic pointer data-type
const MK_STRB * MK_STRN
constant string pointer data-type
MK_PTRB * MK_MNG
managed object pointer, datatype will be checked at runtime
MK_PTRB const * MK_EXP
exception object pointer
int32_t MK_HDL
4 byte int handle data-type
signed int MK_I32
4 byte integer data-type
int MK_DBG
debug-level data-type …
MK_I32 MkObjectHandleGetOfType(MK_OBJ const obj)
Export-Slot - returns typeHdl of the obj .
MK_OBJ MkObjectGetNull(void)
Null-Slot - return a MkObjectC typed NULL instance …
#define MkObjectHandleResolve(...)
MK_OBJ MkObjectPrev(MK_OBJ const obj)
get previous instance from linked-list of MkObjectS type
#define MkObjectHandleGet(...)
#define MkObjectHandleDelete(...)
#define MkObjectInstances()
MK_OBJ MkObjectNext(MK_OBJ const obj)
get next instance from linked-list of MkObjectS type
#define MkObjectHandleDeleteByNetHdl(...)
MK_OBJ MkObj(MK_MNG mng)
cast a unknown-object into an MkObjectS pointer or NULL if not possible
#define MkObjectC_X2obj(x)
#define MkDbgDump(...)
#define MkDbgM(...)
#define MkDbgLogC(...)
#define MkDbgL(...)
#define MkDbgO(...)
#define MkDbgSTACK(...)
#define MkObjectLog(...)
#define MkObjectLogDetail(...)
#define MkLogC(...)
#define MkLogHEX(...)
#define MkObjectLogSimple(...)
bool MkObjectIsNull(MK_OBJ const obj)
ckeck if the object is None
#define MkObjectToName(...)
#define MkObjectToString(...)
#define MkObjectToError(...)
#define MkObjectToNameOfType(...)
#define MkRefDecrWithoutSelf(...)
MK_I32 MkRefGet(MK_OBJ const obj)
get the reference-count
MK_EXTERN enum MkErrorE MkSysKill(MK_OBJN fmtobj, MK_I32 pid, MK_I32 signal)
kill syscall with pymkkernel error plugin
MK_EXTERN MK_STRN MkSysHashSTR(MK_STRN key, MK_NUM length)
compute the HASH from a string …
bool MkSysStringIsNULL(MK_STRN str)
test if string is NULL or EMPTY …
MK_EXTERN enum MkErrorE MkSysGetPid(MK_OBJN fmtobj, MK_I32 *pid_out)
getpid syscall with pymkkernel error plugin
MK_EXTERN MK_I32 MkSysHashI32(MK_STRN key, MK_NUM length)
same as MkSysHashSTR but return MK_I32 …
enum MkErrorE(* MkObjectDeleteCallF)(MkObjectDeleteCallF_ARGS)
static callback
#define MkObjectDeleteCallbackCleanup(...)
#define MkObjectDeleteCallbackSetup(...)
MK_I32 MkRuntimeGetDebug(void)
get the MkRuntimeS::debug value …
#define MkRtSetup_ON(o)
#define MK_RT_CALL
#define MK_RT_ARGS
#define MK_RT_REF
binary data default format …
The data-type to store and handle the error-condition …
object header …