theSq3Lite 10.0
Loading...
Searching...
No Matches
LibMkKernel_py.h
Go to the documentation of this file.
1
9#pragma once
10
11#include <Python.h>
12
13#include "nhi1_config.h"
14#include "debug_mk.h"
15
16#include "LibMkKernel_mk.h"
17
18#include "tmpl/mk_type_S_lng.h"
19
20#if !defined(META_FILE_NAME)
21 #define META_FILE_NAME (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__)
22#endif
23
24/*****************************************************************************/
25/* */
26/* Macro_API */
27/* */
28/*****************************************************************************/
29
30// BEGIN-HEADER - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
31
32#undef HEADER
33#define HEADER
34
35// If the source of libmkkernel is direct used in an external library
36// (without dynamic linking) and this library should *not* export
37// the symbol's of libmkkernel then the flag META_IGNORE_EXTERN have
38// to be set
39#undef MK_PY_EXTERN
40#if defined(META_IGNORE_EXTERN)
41# define MK_PY_EXTERN
42#elif defined(PIC)
43 // does we build a DLL ?
44# if defined(DLL_EXPORT)
45 // does we build the libmkkernel library ?
46# if defined(MK_PY_BUILD_DLL)
47# define MK_PY_EXTERN __declspec(dllexport)
48# else
49# define MK_PY_EXTERN __declspec(dllimport)
50# endif
51# else
52 // no DLL - architecture specific extern specifier
53# define MK_PY_EXTERN __attribute__ ((visibility("default")))
54# endif
55#else
57# define MK_PY_EXTERN
58#endif
59
60// external data lookup
61#undef MK_PY_EXTERN_DATA
62#if defined(META_PRIVATE)
63# define MK_PY_EXTERN_DATA extern
64#elif defined(META_IGNORE_EXTERN)
65# define MK_PY_EXTERN_DATA extern
66#elif defined(PIC)
67 // does we build a DLL ?
68# if defined(DLL_EXPORT)
69 // does we build the libmkkernel library ?
70# if defined(MK_PY_BUILD_DLL)
71# define MK_PY_EXTERN_DATA __declspec(dllexport)
72# else
73# define MK_PY_EXTERN_DATA __declspec(dllimport)
74# endif
75# else
76 // no DLL - architecture specific extern specifier
77# define MK_PY_EXTERN_DATA __attribute__ ((visibility("default"))) extern
78# endif
79#else
80# define MK_PY_EXTERN_DATA extern
81#endif
82
83#undef MK
84#define MK(n) pymkkernel_ ## n
85#undef NS
86#define NS(n) pymkkernel_ ## n
87
88// END-HEADER - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
89
90#define OT_ProcRet PyObject*
91
92#define CONSTR_ARGS PyTypeObject *class, PyObject *objv, PyObject *kwd
93#define CONSTR_ARGS_CALL class, objv
94
95#define OtClass_ARGS PyObject *class, PyObject *objv
96#define OtClass_ARGS_CALL class, objv
97
98// LNG ******************************************************************************
99
100typedef PyObject* OT_OBJ_T;
101typedef PyTypeObject* OT_ENUM_T;
102typedef PyTypeObject OT_CLS_TR;
103typedef PyTypeObject* OT_CLS_T;
104
105/*
106#define OT_OBJ_T PyObject*
107#define OT_ENUM_T PyTypeObject*
108#define OT_CLS_TR PyTypeObject
109#define OT_CLS_T PyTypeObject*
110#define OT_LNG_OBJ_T MkObjectC_Obj*
111*/
112
113#define OT_LNG_NULL Py_None
114#define OT_LNG_UNDEF Py_None
115#define OT_LNG_IS_NULL(val) Py_IsNone(val)
116#define OT_LNG_RETURN(ret,cmd) ret=cmd
117
118#define OT_LNG_NAME_FROM_CLASS(cls) (cls)->tp_name
119
120#define OT_LNG_OBJ_CLASSNAME(obj) Py_TYPE(obj)->tp_name
121
122#define OT_LNG_OBJV(skip) OT_TUPLE_GET_ITEM(objv,skip)
123
124#define OT_LNG_OBJ_CLASS_IS(val,cls) PyObject_TypeCheck(val,cls)
125#define OT_OBJ_TO_CLASS(ptr) ptr
126#define OT_OBJ_TO_ENUM(str) str ## _lngO
127
128#define OT_LNG_OBJECT_IS(objV) PyObject_TypeCheck(objV,MkObjectC_lngO)
129
130/*****************************************************************************/
131/* */
132/* Module API */
133/* */
134/*****************************************************************************/
135
136// BEGIN-CLASS-DEC - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
137
138int NS(pMkObjectC_Init) (MK_RT_ARGS OT_OBJ_T) ;
139int NS(pMkBufferC_Init) (MK_RT_ARGS OT_OBJ_T) ;
140int NS(pMkBufferStreamC_Init) (MK_RT_ARGS OT_OBJ_T) ;
141int NS(pMkBufferListC_Init) (MK_RT_ARGS OT_OBJ_T) ;
142int NS(pMkLogFileC_Init) (MK_RT_ARGS OT_OBJ_T) ;
143int NS(pMkErrorC_Init) (MK_RT_ARGS OT_OBJ_T) ;
144int NS(pMkRuntimeC_Init) (MK_RT_ARGS OT_OBJ_T) ;
145
146// END-CLASS-DEC - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
147
148typedef struct {
149 // BEGIN-EnumThreadState - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
150
151 PyTypeObject* MkErrorE;
152 PyTypeObject* MkIdSE;
153 PyTypeObject* MkTimeoutE;
154 PyTypeObject* MkTypeE;
155
156 // END-EnumThreadState - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
157 // BEGIN-ClassThreadState - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
158
166
167 // END-ClassThreadState - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
168 // BEGIN-ClassThreadStateNull - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
169
177
178 // END-ClassThreadStateNull - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
179
180 PyObject* InitError;
181 PyObject* InitSoftError;
182 PyObject* MkExceptionC;
183 PyObject* emptyTuple;
184 PyObject* inspect_stack;
185
187
189
190/*****************************************************************************/
191/* */
192/* Class_API */
193/* */
194/*****************************************************************************/
195
196//#define OT_CLASS_TYPE_REF MkThreadLocal OT_CLS_TR
197#define OT_CLASS_TYPE_REF OT_CLS_TR
198
199// atom ******************************************************************************
200
201mk_inline PyObject* MK(AtomObjNew) (MK_RT_ARGS OT_CLS_T, MK_OBJ );
202mk_inline PyObject* MK(AtomCreate) (MK_RT_ARGS OT_CLS_T, MK_OBJ );
203mk_inline void MK(AtomDispose) (MK_RT_ARGS MK_MNG);
204mk_inline void MK(AtomDelete) (MK_RT_ARGS MK_MNG);
205mk_inline void MK(AtomDeleteHard) (MK_RT_ARGS OT_OBJ_T);
206
207#define OT_REF_INCR(_obj) Py_INCREF(_obj)
208#define OT_REF_INCR_AND_RETURN(_obj) ({ OT_REF_INCR(_obj); _obj;})
209#define OT_REF_DECR_AND_NULL(_obj) Py_CLEAR(_obj)
210
211// BEGIN-CLASS - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
212
213// ----------------------------------------------------------------------
214// class: MkBufferListC
215
216 // class struct
217 typedef struct MkBufferListC_Obj {
218 PyObject_HEAD
221
223 #define MkBufferListC_lngO (&MK(MkBufferListCR))
224 #define MkBufferListC_base (&MK(MkObjectCR))
225
226 // MK_NULL singelton
227 #define MkBufferListC_MK_NULL MK(MkKernelThreadState).MkBufferListC_MK_NULL
228
229 // arguments
230 #define MkBufferListC_ARGS MkBufferListC_Obj *self, PyObject *objv
231 #define MkBufferListC_ARGS_CALL self, objv
232
233 // return object
234 #define OT_retObj_SET_BFL(nat) retObj = MK(MkBufferListC_ObjNew) (MK_RT_CALL &MK(MkBufferListCR),nat)
235
236 // new objec
237 #define OT_TMP_BFL_OBJ(val) MK(MkBufferListC_ObjNew)(MK_RT_CALL &MK(MkBufferListCR),val)
239 mk_inline OT_OBJ_T MK(MkBufferListC_ObjNew) ( MK_RT_ARGS OT_CLS_T type, MK_BFL hdl ) {
240 return hdl ? MK(AtomObjNew)(MK_RT_CALL type,MkBufferListC_X2obj(hdl)) : Py_NewRef(MkBufferListC_MK_NULL);
241 }
242
243 // cast from LNG to MQ
244 #define VAL2BFL(val) ((MkBufferListC_Obj*) (val))->hdl
245
246// ----------------------------------------------------------------------
247// class: MkBufferC
248
249 // class struct
250 typedef struct MkBufferC_Obj {
251 PyObject_HEAD
254
256 #define MkBufferC_lngO (&MK(MkBufferCR))
257 #define MkBufferC_base (&MK(MkObjectCR))
258
259 // MK_NULL singelton
260 #define MkBufferC_MK_NULL MK(MkKernelThreadState).MkBufferC_MK_NULL
261
262 // arguments
263 #define MkBufferC_ARGS MkBufferC_Obj *self, PyObject *objv
264 #define MkBufferC_ARGS_CALL self, objv
265
266 // return object
267 #define OT_retObj_SET_BUF(nat) retObj = MK(MkBufferC_ObjNew) (MK_RT_CALL &MK(MkBufferCR),nat)
268
269 // new objec
270 #define OT_TMP_BUF_OBJ(val) MK(MkBufferC_ObjNew)(MK_RT_CALL &MK(MkBufferCR),val)
272 mk_inline OT_OBJ_T MK(MkBufferC_ObjNew) ( MK_RT_ARGS OT_CLS_T type, MK_BUF hdl ) {
273 return hdl ? MK(AtomObjNew)(MK_RT_CALL type,MkBufferC_X2obj(hdl)) : Py_NewRef(MkBufferC_MK_NULL);
274 }
275
276 // cast from LNG to MQ
277 #define VAL2BUF(val) ((MkBufferC_Obj*) (val))->hdl
278
279// ----------------------------------------------------------------------
280// class: MkBufferStreamC
281
282 // class struct
283 typedef struct MkBufferStreamC_Obj {
284 PyObject_HEAD
287
289 #define MkBufferStreamC_lngO (&MK(MkBufferStreamCR))
290 #define MkBufferStreamC_base (&MK(MkObjectCR))
291
292 // MK_NULL singelton
293 #define MkBufferStreamC_MK_NULL MK(MkKernelThreadState).MkBufferStreamC_MK_NULL
294
295 // arguments
296 #define MkBufferStreamC_ARGS MkBufferStreamC_Obj *self, PyObject *objv
297 #define MkBufferStreamC_ARGS_CALL self, objv
298
299 // return object
300 #define OT_retObj_SET_BUS(nat) retObj = MK(MkBufferStreamC_ObjNew) (MK_RT_CALL &MK(MkBufferStreamCR),nat)
301
302 // new objec
303 #define OT_TMP_BUS_OBJ(val) MK(MkBufferStreamC_ObjNew)(MK_RT_CALL &MK(MkBufferStreamCR),val)
305 mk_inline OT_OBJ_T MK(MkBufferStreamC_ObjNew) ( MK_RT_ARGS OT_CLS_T type, MK_BUS hdl ) {
306 return hdl ? MK(AtomObjNew)(MK_RT_CALL type,MkBufferStreamC_X2obj(hdl)) : Py_NewRef(MkBufferStreamC_MK_NULL);
307 }
308
309 // cast from LNG to MQ
310 #define VAL2BUS(val) ((MkBufferStreamC_Obj*) (val))->hdl
311
312// ----------------------------------------------------------------------
313// class: MkErrorC
314
315 // class struct
316 typedef struct MkErrorC_Obj {
317 PyObject_HEAD
320
322 #define MkErrorC_lngO (&MK(MkErrorCR))
323 #define MkErrorC_base (&MK(MkObjectCR))
324
325 // MK_NULL singelton
326 #define MkErrorC_MK_NULL MK(MkKernelThreadState).MkErrorC_MK_NULL
327
328 // arguments
329 #define MkErrorC_ARGS MkErrorC_Obj *self, PyObject *objv
330 #define MkErrorC_ARGS_CALL self, objv
331
332 // return object
333 #define OT_retObj_SET_ERR(nat) retObj = MK(MkErrorC_ObjNew) (MK_RT_CALL &MK(MkErrorCR),nat)
334
335 // new objec
336 #define OT_TMP_ERR_OBJ(val) MK(MkErrorC_ObjNew)(MK_RT_CALL &MK(MkErrorCR),val)
338 mk_inline OT_OBJ_T MK(MkErrorC_ObjNew) ( MK_RT_ARGS OT_CLS_T type, MK_ERR hdl ) {
339 return hdl ? MK(AtomObjNew)(MK_RT_CALL type,MkErrorC_X2obj(hdl)) : Py_NewRef(MkErrorC_MK_NULL);
340 }
341
342 // cast from LNG to MQ
343 #define VAL2ERR(val) ((MkErrorC_Obj*) (val))->hdl
344
345// ----------------------------------------------------------------------
346// class: MkLogFileC
347
348 // class struct
349 typedef struct MkLogFileC_Obj {
350 PyObject_HEAD
353
355 #define MkLogFileC_lngO (&MK(MkLogFileCR))
356 #define MkLogFileC_base (&MK(MkObjectCR))
357
358 // MK_NULL singelton
359 #define MkLogFileC_MK_NULL MK(MkKernelThreadState).MkLogFileC_MK_NULL
360
361 // arguments
362 #define MkLogFileC_ARGS MkLogFileC_Obj *self, PyObject *objv
363 #define MkLogFileC_ARGS_CALL self, objv
364
365 // return object
366 #define OT_retObj_SET_LFL(nat) retObj = MK(MkLogFileC_ObjNew) (MK_RT_CALL &MK(MkLogFileCR),nat)
367
368 // new objec
369 #define OT_TMP_LFL_OBJ(val) MK(MkLogFileC_ObjNew)(MK_RT_CALL &MK(MkLogFileCR),val)
371 mk_inline OT_OBJ_T MK(MkLogFileC_ObjNew) ( MK_RT_ARGS OT_CLS_T type, MK_LFL hdl ) {
372 return hdl ? MK(AtomObjNew)(MK_RT_CALL type,MkLogFileC_X2obj(hdl)) : Py_NewRef(MkLogFileC_MK_NULL);
373 }
374
375 // cast from LNG to MQ
376 #define VAL2LFL(val) ((MkLogFileC_Obj*) (val))->hdl
377
378// ----------------------------------------------------------------------
379// class: MkObjectC
380
381 // class struct
382 typedef struct MkObjectC_Obj {
383 PyObject_HEAD
386
388 #define MkObjectC_lngO (&MK(MkObjectCR))
389 #define MkObjectC_base NULL
390
391 // MK_NULL singelton
392 #define MkObjectC_MK_NULL MK(MkKernelThreadState).MkObjectC_MK_NULL
393
394 // arguments
395 #define MkObjectC_ARGS MkObjectC_Obj *self, PyObject *objv
396 #define MkObjectC_ARGS_CALL self, objv
397
398 // return object
399 #define OT_retObj_SET_OBJ(nat) retObj = MK(MkObjectC_ObjNew) (MK_RT_CALL &MK(MkObjectCR),nat)
400
401 // new objec
402 #define OT_TMP_OBJ_OBJ(val) MK(MkObjectC_ObjNew)(MK_RT_CALL &MK(MkObjectCR),val)
404 mk_inline OT_OBJ_T MK(MkObjectC_ObjNew) ( MK_RT_ARGS OT_CLS_T type, MK_OBJ hdl ) {
405 return hdl ? MK(AtomObjNew)(MK_RT_CALL type,MkObjectC_X2obj(hdl)) : Py_NewRef(MkObjectC_MK_NULL);
406 }
407
408 // cast from LNG to MQ
409 #define VAL2OBJ(val) ((MkObjectC_Obj*) (val))->hdl
410
411// ----------------------------------------------------------------------
412// class: MkRuntimeC
413
414 // class struct
415 typedef struct MkRuntimeC_Obj {
416 PyObject_HEAD
419
421 #define MkRuntimeC_lngO (&MK(MkRuntimeCR))
422 #define MkRuntimeC_base (&MK(MkObjectCR))
423
424 // MK_NULL singelton
425 #define MkRuntimeC_MK_NULL MK(MkKernelThreadState).MkRuntimeC_MK_NULL
426
427 // arguments
428 #define MkRuntimeC_ARGS MkRuntimeC_Obj *self, PyObject *objv
429 #define MkRuntimeC_ARGS_CALL self, objv
430
431 // return object
432 #define OT_retObj_SET_RT(nat) retObj = MK(MkRuntimeC_ObjNew) (MK_RT_CALL &MK(MkRuntimeCR),nat)
433
434 // new objec
435 #define OT_TMP_RT_OBJ(val) MK(MkRuntimeC_ObjNew)(MK_RT_CALL &MK(MkRuntimeCR),val)
437 mk_inline OT_OBJ_T MK(MkRuntimeC_ObjNew) ( MK_RT_ARGS OT_CLS_T type, MK_RT hdl ) {
438 return hdl ? MK(AtomObjNew)(MK_RT_CALL type,MkRuntimeC_X2obj(hdl)) : Py_NewRef(MkRuntimeC_MK_NULL);
439 }
440
441 // cast from LNG to MQ
442 #define VAL2RT(val) ((MkRuntimeC_Obj*) (val))->hdl
443
444// END-CLASS - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
445
447
448// setup ***********************************************************************************
449
450#define OT_SETUP_ARGS_ALL(d) \
451 PyObject *retObj=NULL; \
452 Py_ssize_t __skip=0; \
453 MK_UNUSED static const MK_STRN __doc=d; \
454 MK_UNUSED PyObject* frame=NULL; \
455
456#define OT_FRAME_CLEANUP if (frame != NULL) Py_CLEAR(frame)
457
458#define OT_SETUP_VARARGS(min,max,d) \
459 OT_SETUP_ARGS_ALL(d) \
460 Py_ssize_t objc=PyTuple_GET_SIZE(objv); \
461 OT_CHECK_NUM_ARGS(min,max); \
462
463#define OT_SETUP_CONSTRUCTOR_ARGS(...) OT_SETUP_VARARGS(__VA_ARGS__)
464
465#define OT_SETUP_ONEARG(d) \
466 OT_SETUP_ARGS_ALL(d) \
467 Py_ssize_t objc=1; \
468 OT_CHECK_NUM_ARGS(1,1); \
469
470#define OT_SETUP_NOARG(d) \
471 OT_SETUP_ARGS_ALL(d) \
472 Py_ssize_t objc=0; \
473 OT_CHECK_NUM_ARGS(0,0); \
474
475#define OT_SETUP_OBJ(o,v) PyObject* o=(PyObject*)v;
476
477#define OT_SELF ((PyObject*)self)
478#define OT_SELF_X(x) ((PyObject*)(MkOBJ_R(x).self))
479#define OT_SELF_O(o) ((PyObject*)((*o).self))
480
482 return (MkObjCheck(mng) ? (PyObject*) (((MK_OBJ)mng)->self) : Py_None);
483}
484
485#define OT_SETUP_hdl_tmpl(cls) \
486 typeof(self->hdl) hdl = self->hdl; \
487 if (hdl == NULL) { \
488 OT_ERROR_VAR_DEFAULT("'%s' hdl is NULL",OT_LNG_OBJ_CLASSNAME(self)); \
489 goto error; \
490 } \
491 SetupRtFromObj_XN(hdl); \
492
493#define OT_SETUP_hdl_tmpl__null_allow(cls) \
494 typeof(self->hdl) hdl = self->hdl; \
495 SetupRtFromObj_X(hdl); \
496
497#define OT_RET_SELF (Py_NewRef(OT_SELF))
498
499#define OT_retObj_SET(val) retObj = (val);
500#define OT_retObj_SET_None retObj = Py_NewRef(Py_None);
501//#define OT_retObj_SET_Error retObj = MK(ErrorAppend)(__doc);
502#define OT_retObj_SET_Error retObj = NULL;
503#define OT_retObj_SET_List retObj = PyList_New(0);
504#define OT_retObj_APPEND(var) PyList_Append(retObj,var);
505#define OT_retObj_RETURN return ((PyObject*)retObj);
506
507#define OT_retObj_SET_BOL(nat) retObj = BOL2VAL(nat);
508#define OT_retObj_SET_I8(nat) retObj = I82VAL(nat);
509#define OT_retObj_SET_I16(nat) retObj = I162VAL(nat);
510#define OT_retObj_SET_I32(nat) retObj = INT2VAL(nat);
511#define OT_retObj_SET_I64(nat) retObj = I642VAL(nat);
512#define OT_retObj_SET_FLT(nat) retObj = FLT2VAL(nat);
513#define OT_retObj_SET_DBL(nat) retObj = DBL2VAL(nat);
514#define OT_retObj_SET_BIN(nat,len) retObj = BIN2VAL(nat,len);
515#define OT_retObj_SET_STR(nat) retObj = STRN2VAL(nat);
516#define OT_retObj_SET_STRN(nat) retObj = STRN2VAL(nat);
517#define OT_retObj_SET_LONG(nat) retObj = LONG2VAL(nat);
518#define OT_retObj_SET_HDL(nat) retObj = HDL2VAL(nat);
519
520#define OT_CONSTRUCTOR_POST(x)
521
522// METHOD CALL **********************************************************************
523
524#define OT_MK_CALL_0(obj,cls,meth,ret) ret=MK(cls##_##meth)((cls##_Obj*)cls##_constr(obj),MK(MkKernelThreadState).emptyTuple);
525//#define OT_MK_CALL_0(obj,cls,meth,ret) ret=PyObject_CallMethod((PyObject*)cls##_constr(obj),#meth,NULL)
526
527// error ******************************************************************************
528
529#define OT_ERROR_LNG_RETURN return NULL
530
531#define OT_ERROR_BASE(err,str) { \
532 if (MkErrorCheckE_0E()) { \
533 PyErr_Format(err,"%s\nMqError: %s",str,MkErrorGetText_0E()); \
534 MkErrorReset_0M(); \
535 } else { \
536 PyErr_SetString(err,str); \
537 } \
538}
539
540#define OT_ERROR_SOFT_CONSTRUCTOR(class) { \
541 OT_ERROR_BASE(MK(MkKernelThreadState).InitSoftError, "'" #class "' soft constructor return 'NULL' pointer"); \
542}
543
544#define OT_ERROR_CONSTRUCTOR(class) \
545 OT_ERROR_BASE(MK(MkKernelThreadState).InitError, "'" #class "' constructor return 'NULL' pointer")
546
547#define OT_ERROR_TYPE(str) \
548 PyErr_SetString(PyExc_TypeError, str);
549
550#define MkErrorC_Check(mng,PROC) \
551 if (unlikely(MkErrorCheckI(PROC))) { \
552 OT_ERROR_META_2_LNG(mng); goto error; \
553 }
554
555#define MkErrorC_Check_1(PROC) \
556 if (unlikely(MkErrorCheckI(PROC))) { \
557 OT_ERROR_META_2_LNG(MK_ERROR_FORMAT); goto error; \
558 }
559
560#define MkErrorC_CheckD(PROC) \
561 if (unlikely(MkErrorCheckI(PROC))) { \
562 OT_ERROR_META_2_LNG(hdl); goto error; \
563 }
564
565#define OT_ERROR_META_2_LNG(m) MK(MkExceptionC_Raise) (OT_Prefix_CALL m,__doc,__FILE__,__LINE__)
566#define OT_ERROR_LNG_2_META(m) MK(MkExceptionC_Catch) (OT_Prefix_CALL m, NULL, __func__)
567
568#define check_LNG(PROC) if ((PROC) < 0)
569#define OtErrorCheckLng(PROC) if ((PROC) < 0) goto error;
570#define LngErrorCheckT(TAG,PROC) if ((PROC) < 0) goto TAG;
571#define LngErrorCheckN(PROC) if ((PROC) == NULL) goto error;
572#define LngErrorCheckNT(TAG,PROC) if ((PROC) == NULL) goto TAG;
573
574// !! attention → always jumps to error
575#define OT_ERROR_NUMARGS(...) MkErrorC_CheckD(WrongNumArgs(__VA_ARGS__))
576
577#if 1
578# define OT_ERROR_VAR_DEFAULT(...) PyErr_Format(PyExc_SystemError,__VA_ARGS__)
579#else
580# define OT_ERROR_VAR_DEFAULT(...) do { \
581 char buf[512]; \
582 PyOS_snprintf(buf,512,__VA_ARGS__); \
583 PyErr_SetString(PyExc_SystemError,buf); \
584 } while (0)
585#endif
586
587// new object ******************************************************************************
588
589#define OT_TMP_BOL_OBJ(val) BOL2VAL(val)
590#define OT_TMP_I8_OBJ(val) I82VAL(val)
591#define OT_TMP_I16_OBJ(val) I162VAL(val)
592#define OT_TMP_I32_OBJ(val) INT2VAL(val)
593#define OT_TMP_I64_OBJ(val) I642VAL(val)
594#define OT_TMP_FLT_OBJ(val) FLT2VAL(val)
595#define OT_TMP_DBL_OBJ(val) DBL2VAL(val)
596#define OT_TMP_BIN_OBJ(val,len) BIN2VAL(val,len)
597#define OT_TMP_STR_OBJ(val) STRN2VAL(val)
598
599// check *********************************************************************************
600
601#define OT_Prefix_ARGS MK_RT_ARGS
602#define OT_Prefix_CALL MK_RT_CALL
603
604#define SETUP_ARGS MK_RT_ARGS Py_ssize_t objc, PyObject *objv
605#define SETUP_ARGS_CALL MK_RT_CALL objc, objv
606
607#define OT_Check_ARGS SETUP_ARGS, MK_MNG hdl, MK_STRN const arg, Py_ssize_t *skipP
608#define OT_Check_CALL(arg) SETUP_ARGS_CALL, hdl, arg, &__skip
609
610#define OT_LNG_NULL_IS(obj) (obj == Py_None)
611#define OT_LNG_ARRAY_IS(obj) PyObject_TypeCheck(obj,&PyList_Type)
612#define OT_LNG_LONG_IS(obj) (CHECK_LONG(obj) || CHECK_STRING(obj)) // from "high"
613#define OT_LNG_I32_IS(obj) (CHECK_LONG(obj) || CHECK_STRING(obj)) // from "high"
614
615#define OT_LNG_SKIP_TYPE Py_ssize_t
616
617#define OT_LNG_OBJ_ENUM_IS(obj,enm) PyObject_TypeCheck((obj),(enm))
618#define OT_LNG_ENUM_NAME(enm) OT_LNG_NAME_FROM_CLASS(enm)
619#define OT_ENUM_TO_I32(o,e)
620#define OT_ENUM_TO_I32_2(o,str)
621
622#define OT_LNG_STRN_PRE(str,obj) PyObject *__##str=PyObject_Str(obj); \
623 LngErrorCheckN(__##str); \
624 MK_STRN str=PyUnicode_AsUTF8(__##str)
625
626#define OT_LNG_STRN_PRE_AND_LEN(str,_len,obj) \
627 PyObject *__##str=PyObject_Str(obj); \
628 LngErrorCheckN(__##str); \
629 MK_STRN str=PyUnicode_AsUTF8AndSize(__##str,&_len)
630
631#define OT_LNG_STRN_POST(str,obj) Py_CLEAR(__##str)
632
634
635#define OT_TUPLE_GET_ITEM(_obj,_skip) ({typeof(_skip) _idx=(_skip);(PyTuple_Check(_obj)?PyTuple_GET_ITEM((_obj),(_idx)):(_obj));})
636
637#define OT_CHECK_OPTIONAL(val) if (__skip < objc) {val}
638#define OT_CHECK_REQUIRED(val) val
639
640#define OT_CHECK_NUM_ARGS(min,max) \
641 if (objc < min || objc > max) {\
642 OT_ERROR_NUMARGS(hdl,__skip, objc, min, max, "");\
643 }
644
645#define OT_CHECK_NOARGS \
646 if (__skip != objc) {\
647 OT_ERROR_NUMARGS(hdl,__skip, objc, -999, +999, "");\
648 }
649
650#define OT_CHECK_BNP(val,len) \
651 if (__skip >= objc) { \
652 OT_ERROR_NUMARGS(hdl,__skip, objc, -999, +999, #val); \
653 } else {\
654 PyObject *t1 = OT_TUPLE_GET_ITEM(objv,__skip++);\
655 if (PyByteArray_Check(t1)) { \
656 val = (MK_BIN)PyByteArray_AS_STRING(t1); \
657 len = (MK_SIZE)PyByteArray_GET_SIZE(t1); \
658 } else { \
659 PyErr_SetString(PyExc_TypeError, "parameter '" #val "' must be a 'byte-array'.");\
660 goto error;\
661 } \
662 };
663
664#define OT_CHECK_BCP(val) \
665 if (__skip >= objc) { \
666 OT_ERROR_NUMARGS(hdl,__skip, objc, -999, +999, #val); \
667 } else {\
668 PyObject *t1 = OT_TUPLE_GET_ITEM(objv,__skip++);\
669 if (PyByteArray_Check(t1)) { \
670 val = (MK_BINN)PyByteArray_AS_STRING(t1); \
671 } else { \
672 PyErr_SetString(PyExc_TypeError, "parameter '" #val "' must be a 'byte-array'.");\
673 goto error;\
674 } \
675 };
676
677#define OT_GET_CONSTR_NAME(ctor) ((PyTypeObject*)ctor)->tp_name
678
679#define check_NULL(E) if (unlikely((E) == NULL))
680
681// enum ******************************************************************************
682
683// #define MK_ENUM(enm) py_mkkernel_MkKernelThreadState.enm
684
685// BEGIN-EnumExtern - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
686
687#define MkErrorE_lngO (MK(MkKernelThreadState).MkErrorE)
688#define MkIdSE_lngO (MK(MkKernelThreadState).MkIdSE)
689#define MkTimeoutE_lngO (MK(MkKernelThreadState).MkTimeoutE)
690#define MkTypeE_lngO (MK(MkKernelThreadState).MkTypeE)
691
692// END-EnumExtern - created by 'py_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
693
694#define OT_NEW_Mk_enum_OBJ(typ,val) PyObject_CallFunction((PyObject*)(Mk ## typ ##_lngO),"i",val)
695
696// class ******************************************************************************
697
698// object 2 native *************************************************************************
699
700#define OT_CHECK_STRN(val) \
701 if (__skip >= objc) { \
702 OT_ERROR_NUMARGS(hdl,__skip, objc, -999, +999, #val); \
703 } else { \
704 Py_ssize_t len; \
705 PyObject *obj=OT_TUPLE_GET_ITEM(objv,__skip++); \
706 if (obj == Py_None) { \
707 val=""; \
708 } else { \
709 if (PyUnicode_Check(obj)) { \
710 val=PyUnicode_AsUTF8AndSize(obj,&len); \
711 } else { \
712 OT_LNG_STRN_PRE_AND_LEN(strC,len,obj); \
713 /* NO function because of strdupa */ \
714 val=strdupa(strC); \
715 OT_LNG_STRN_POST(strC,obj); \
716 } \
717 if (MK_NULL_STR_CHECK(val,len)) { \
718 val = NULL; \
719 } \
720 } \
721 };
722
723#define OT_CHECK_C_COPY(val,size) \
724 if (__skip >= objc) { \
725 OT_ERROR_NUMARGS(hdl,__skip, objc, -999, +999, #val); \
726 } else { \
727 PyObject *obj=OT_TUPLE_GET_ITEM(objv,__skip++); \
728 if (obj == Py_None) { \
729 val[0]='\0'; \
730 } else { \
731 if (PyUnicode_Check(obj)) { \
732 strncpy(val,PyUnicode_AsUTF8(obj),size); \
733 } else { \
734 OT_LNG_STRN_PRE(strC,obj); \
735 strncpy(val,strC,size); \
736 OT_LNG_STRN_POST(strC,obj); \
737 } \
738 } \
739 };
740
741// object 2 native *************************************************************************
742
744
745#define OT_CHECK_LNGTMPL(val,func) MkErrorC_CheckD(func(OT_Check_CALL(#val),&val));
746
747#define OT_CHECK_bool(val) OT_CHECK_LNGTMPL(val,MK(Obj_AsBOOL))
748#define OT_CHECK_NB1(val) OT_CHECK_LNGTMPL(val,MK(Obj_AsBOL))
749#define OT_CHECK_NI1(val) OT_CHECK_LNGTMPL(val,MK(Obj_AsI8))
750#define OT_CHECK_NI2(val) OT_CHECK_LNGTMPL(val,MK(Obj_AsI16))
751#define OT_CHECK_NI4(val) OT_CHECK_LNGTMPL(val,MK(Obj_AsI32))
752#define OT_CHECK_NI8(val) OT_CHECK_LNGTMPL(val,MK(Obj_AsI64))
753#define OT_CHECK_NF4(val) OT_CHECK_LNGTMPL(val,MK(Obj_AsFLT))
754#define OT_CHECK_NF8(val) OT_CHECK_LNGTMPL(val,MK(Obj_AsDBL))
755#define OT_CHECK_NIL(val) OT_CHECK_LNGTMPL(val,MK(Obj_AsLONG))
756
757// isc nspection *************************************************************************
758
759#define OT_GET_CALL_PROC MK(Get_Call_Proc)(0,&frame)
760#define OT_GET_CALL_FILE MK(Get_Call_Script)(0,&frame)
761#define OT_GET_CALL_LINE MK(Get_Call_Line)(0,&frame)
762
763MK_PY_EXTERN MK_STRN MK(Get_Call_Proc) (Py_ssize_t,PyObject**);
764MK_PY_EXTERN MK_STRN MK(Get_Call_Code) (Py_ssize_t,PyObject**);
765MK_PY_EXTERN MK_STRN MK(Get_Call_Script) (Py_ssize_t,PyObject**);
766MK_PY_EXTERN MK_I32 MK(Get_Call_Line) (Py_ssize_t,PyObject**);
767 bool MK(Get_Call_Stack) (MK_RT_ARGS MK_ERR const,Py_ssize_t,PyObject**);
768
769// call ******************************************************************************
770
771typedef struct MkCallS {
775 bool isAlloc; // instance was alloced
777
778// cleanup MkCallS from above
779mk_inline void NS(CallFreeOnce) (MK_CBP* callP)
780{
781 if ( callP == NULL || *callP == NULL || _Py_IsFinalizing()) return;
782
783 struct MkCallS *call = *callP;
784
786
787 if (call->isAlloc) MkSysFree(*callP);
788 else *callP = NULL;
789}
790
791mk_inline void NS(CallFree) (MK_CBP* callP)
792{
793 if ( callP == NULL || *callP == NULL || _Py_IsFinalizing()) return;
794
795 OT_OBJ_T callable = *callP;
796
798
799 *callP = NULL;
800}
801
802/*****************************************************************************/
803/* */
804/* Object_API */
805/* */
806/*****************************************************************************/
807
808#define OT_OBJECT_DISPOSE(self) MK(AtomDispose)(MK_RT_CALL hdl);
809#define OT_OBJECT_DELETE(self) MK(AtomDelete)(MK_RT_CALL hdl);
810#define OT_OBJECT_DELETE_HARD(self) MK(AtomDeleteHard)(MK_RT_CALL self);
811#define OT_MODULE_STATE(Ns) ((NS(ModuleStateS)*)MK_RT_REF.mkThreadData)
812
813/*****************************************************************************/
814/* */
815/* MISC functions */
816/* */
817/*****************************************************************************/
818
819// from misc_py.c
820
821//MK_PY_EXTERN PyObject* MK(ErrorAppend)(MK_STRN);
822
823// MkExceptionC_py.c
824MK_PY_EXTERN MK_ERR MK(MkExceptionC_Catch) (OT_Prefix_ARGS MK_MNG const, MK_EXP const, MK_STRN const);
825MK_PY_EXTERN void MK(MkExceptionC_Raise) (OT_Prefix_ARGS MK_MNGN const,MK_STRN const,MK_STRN const,MK_I32);
826
827// from MkBufferC_py.c
829MK_PY_EXTERN OT_ProcRet MK(MkBufferC_GetBFL) (MkBufferC_ARGS);
830
831// from MkBufferListC_py.c
833
834// misc
835mk_inline PyObject* PyC2O(MK_STRN v) {
836 return (v?PyUnicode_FromString(v):Py_NewRef(Py_None));
837}
838
839/*****************************************************************************/
840/* */
841/* definition's */
842/* */
843/*****************************************************************************/
844
845//#define PTR2VAL(nat) _PTR2VAL(nat)
846#define OBJ2VAL(nat) ((OT_OBJ_T)((MK_OBJ)nat)->self)
847#define I82VAL(nat) PyLong_FromLong(nat)
848#define BOL2VAL(nat) PyBool_FromLong(nat)
849#define I162VAL(nat) PyLong_FromLong(nat)
850#define INT2VAL(nat) PyLong_FromLong(nat)
851#define I642VAL(nat) PyLong_FromLongLong(nat)
852#define FLT2VAL(nat) PyFloat_FromDouble(nat)
853#define DBL2VAL(nat) PyFloat_FromDouble(nat)
854#define STRN2VAL(nat) MK(STRN2VAL)(nat)
855#define STR2VAL(ptr,len) MK(STR2VAL)(ptr,len)
856#define BIN2VAL(ptr,len) PyByteArray_FromStringAndSize((const char*)ptr,(Py_ssize_t)len)
857#define LONG2VAL(nat) PyLong_FromLong(nat)
858#define HDL2VAL(nat) PyLong_FromLong(nat)
859
860#define VAL2MNG(val) (MK_MNG)((MkObjectC_Obj*) val)->hdl
861
862// *********************************************************************************************
863
864mk_inline PyObject* MK(STRN2VAL)(MK_STRN str) {
865 PyObject *uc=NULL;
866 if (str == MK_NULL) {
867 return PyUnicode_FromString(MK_NULL_STR);
868 } else if ((uc = PyUnicode_FromString(str)) == NULL) {
869 PyErr_Print();
870 return PyUnicode_FromString("ERROR in STRN2VAL");
871 } else {
872 return uc;
873 }
874}
875
876mk_inline PyObject* MK(STR2VAL)(MK_STRN str, MK_NUM len) {
877 PyObject *uc=NULL;
878 if (str == MK_NULL) {
879 return PyUnicode_FromString(MK_NULL_STR);
880 } else if ((uc = PyUnicode_FromStringAndSize(str,len)) == NULL) {
881 PyErr_Print();
882 return PyUnicode_FromString("ERROR in STR2VAL");
883 } else {
884 return uc;
885 }
886}
887
888/*****************************************************************************/
889/* */
890/* reference */
891/* */
892/*****************************************************************************/
893
894#define ME_REF_MkBinaryR MkBinaryR
895#define OT_GET__ME_REF_MkBinaryR(b) BIN2VAL(b.data,b.size)
896#define VAL2MkBinaryR(_obj) ({ \
897 PyObject *obj=_obj; \
898 MK_BIN bin=NULL; \
899 MK_SIZE len=0; \
900 if (obj != Py_None) { \
901 if (PyByteArray_Check(obj)) { \
902 bin = (MK_BIN)PyByteArray_AS_STRING(obj); \
903 len = (MK_SIZE)PyByteArray_GET_SIZE(obj); \
904 } else { \
905 PyErr_SetString(PyExc_TypeError, "parameter '" #_obj "' must be a 'byte-array'."); \
906 goto error; \
907 } \
908 } \
909 MkBinaryCreate(len,bin); \
910})
911#define OT_CHECK__ME_REF_MkBinaryR(val) \
912 if (__skip >= objc) { \
913 OT_ERROR_NUMARGS(hdl,__skip, objc, -999, +999, #val); \
914 } else { \
915 val=VAL2MkBinaryR(OT_TUPLE_GET_ITEM(objv,__skip++)); \
916 }
917
918#define ME_REF_MkStringR MkStringR
919#define OT_GET__ME_REF_MkStringR(b) STR2VAL(b.ptr,b.len)
920#define VAL2MkStringR(_obj) ({ \
921 PyObject *obj=_obj; \
922 const char *str=NULL; \
923 Py_ssize_t len=0; \
924 if (obj != Py_None) { \
925 if (PyUnicode_Check(obj)) { \
926 str=PyUnicode_AsUTF8AndSize(obj,&len); \
927 } else { \
928 OT_LNG_STRN_PRE_AND_LEN(strC,len,obj); \
929 /* NO function because of strdupa */ \
930 str=strdupa(strC); \
931 OT_LNG_STRN_POST(strC,obj); \
932 } \
933 } \
934 MkStringCreate((MK_NUM)len,str); \
935})
936#define OT_CHECK__ME_REF_MkStringR(val) \
937 if (__skip >= objc) { \
938 OT_ERROR_NUMARGS(hdl,__skip, objc, -999, +999, #val); \
939 } else { \
940 val=VAL2MkStringR(OT_TUPLE_GET_ITEM(objv,__skip++)); \
941 };
942
943/*****************************************************************************/
944/* */
945/* debugging */
946/* */
947/*****************************************************************************/
948
949mk_inline void MK(printObjRaw)(PyObject* obj, MK_STRN str, MK_STRN caller) {
950 if (obj == NULL) obj = Py_None;
951 fprintf(stderr,"%-30s:%-25s[refCnt=%-3zi, type=%-10s, self=%-20p] -> ",
952 caller,str,Py_REFCNT(obj),Py_TYPE(obj)->tp_name,obj);
953 PyObject_Print(obj,stderr,Py_PRINT_RAW);
954 fprintf(stderr,"\n");
955 fflush(stderr);
956}
957
958 #define formatObj_fmt "%-10s [ptr=%-16p, refCnt=%-3zi, type=%-16s, self=%-16p, mq=%p] -> %s"
959 #define formatObj_args(s,o) s, o, Py_REFCNT(o),Py_TYPE(o)->tp_name, o, MK(LngObjToMqPtr)(o), MK(LngObjToString)(o)
960
961 #define formatObj(s,o) formatObj_fmt,formatObj_args(s,o)
962
963 #define printXSObj(ctx,s,o) printXV(ctx, formatObj_fmt, formatObj_args(s,o));
964 #define printXLngObj(x,o) printXSObj(x,#o,(o!=NULL?(PyObject*)o:(PyObject*)Py_None))
965 #define printLngObj(o) printXLngObj(NULL,(o))
966
967 #define formatObj2_fmt "%-10s [ptr=%-16p, refCnt=%-3zi, type=%-16s, self=%-16p, mq=%p]"
968 #define formatObj2_args(s,o) s, o, Py_REFCNT(o),Py_TYPE(o)->tp_name, o, MK(LngObjToMqPtr)(o)
969
970 #define printXSObj2(ctx,s,o) printXV(ctx, formatObj2_fmt, formatObj2_args(s,o));
971 #define printXLngObj2(x,o) printXSObj2(x,#o,(o!=NULL?(PyObject*)o:(PyObject*)Py_None))
972 #define printLngObj2(o) printXLngObj2(NULL,o)
973
974 #define printObj1(x,o) printXLngObj(x,o)
975 #define printRef(s,o) printV(s ": " #o "<%p>, refCount<%li>\n", o, Py_REFCNT(o));
976 #define printXRef(x,s,o) {\
977 if (o == NULL) {\
978 printXLV(x,s ": " #o "<%p>, refCount<%li>\n", NULL, 0L);\
979 } else {\
980 printXLV(x,s ": " #o "<%p>, refCount<%li>\n", o, Py_REFCNT(o));\
981 } \
982 } while (0);
983
984#if META_DEBUG
985 #define printError(ctx,str) if (PyErr_Occurred()) {\
986 MLTxt2(ctx,str,MK(LngErrorToString)())\
987 } else {\
988 MLTxt2(ctx,str,"None")\
989 }
990#endif
991
992char* MK(LngErrorToString)(void);
993
994// required in "tmpl/misc_ObjAs_lng.h" error-message
995MK_PY_EXTERN const char* MK(LngObjToString)(PyObject*);
996MK_PY_EXTERN MK_OBJ MK(LngObjToMqPtr)(PyObject*);
997 void MK(LngUnicodeObjToBuffer)(PyObject*,MK_STR,MK_SIZE,MK_STRN);
998
999// ***********************************************************************************
1000
1001// CALLED from: "Dispose"
1002mk_inline void NS(AtomDispose) (MK_RT_ARGS MK_MNG mng)
1003{
1004 // check if hdl is valid
1005 MK_OBJ obj = MkObj(mng);
1006 // delete link between PYTHON and MQ
1007 check_NULL(obj) return;
1008
1009 // delete link between MQ and PYTHON
1010 obj = MkRefDecrWithUnlinkSelf(obj);
1011}
1012
1013// CALLED from: "Delete"
1014mk_inline void NS(AtomDelete) (MK_RT_ARGS MK_MNG mng)
1015{
1016 // check if hdl is valid
1017 MK_OBJ obj = MkObj(mng);
1018 // delete link between PYTHON and MQ
1019 check_NULL(obj) return;
1020 // delete link between META and PYTHON
1022}
1023
1024// CALLED to delete an EXISTING self
1025mk_inline void NS(AtomDeleteHard) (MK_RT_ARGS OT_OBJ_T selfO)
1026{
1027 if (selfO==NULL || _Py_IsFinalizing()) return;
1028 MkObjectC_Obj *self = (MkObjectC_Obj*) selfO;
1029
1030#ifdef LOG_REF
1031 printLngObj(self)
1032#endif
1033
1034 // check if hdl is valid
1035 MK_OBJ obj = MkObj(self->hdl);
1036 check_NULL(obj) return;
1037
1038 // delete link between SELF and META
1039 self->hdl = NULL;
1040
1041 // delete link between META and SELF
1043
1044 // cleanup python object
1045 Py_CLEAR(selfO);
1046}
1047
1048mk_inline PyObject* NS(AtomCreate) (
1050 PyTypeObject *type,
1051 MK_OBJ obj
1052) {
1053 MkObjectC_Obj *retObj = (MkObjectC_Obj*) (type)->tp_alloc(type, 0);
1054
1055 if (obj) {
1056 retObj->hdl = obj;
1057 MkRefIncr(obj);
1058 MkSelfSet (obj, (void*) retObj, NULL);
1059 }
1060
1061#if LOG_REF
1062 printLngObj(retObj);
1063#endif
1064
1065// mk_dbg_color_ln(MK_COLOR_PURPLE,"obj<%p>, retObj<%p>, retObj->hdl<%p>", obj, retObj, retObj->hdl);
1066
1067 return (PyObject*)retObj;
1068}
1069
1070mk_inline PyObject* NS(AtomObjNew) (
1072 PyTypeObject *type,
1073 MK_OBJ obj
1074) {
1075 if (obj == NULL) {
1076 if (PyErr_Occurred()) {
1077 return NULL;
1078 } else {
1079 Py_RETURN_NONE;
1080 //PyErr_Format(PyExc_ValueError, "'%s' constructor return a NULL pointer", type->tp_name);
1081 }
1082 }
1083
1084 #define __doc "AtomObjNew"
1085 MK_PTR selfO = NULL;
1086 MkErrorC_Check(obj, MkSelfNew(obj,&selfO,NULL))
1087 return Py_NewRef((OT_OBJ_T) selfO);
1088 #undef __doc
1089error:
1090 return NULL;
1091}
1092
1093#undef HEADER
#define MK(n)
struct MkErrorC_Obj MkErrorC_Obj
#define MkObjectC_MK_NULL
PyTypeObject * OT_ENUM_T
#define MK_PY_EXTERN_DATA
struct MkBufferListC_Obj MkBufferListC_Obj
struct MkLogFileC_Obj MkLogFileC_Obj
struct MkBufferStreamC_Obj MkBufferStreamC_Obj
#define MkLogFileC_MK_NULL
MkObjectC_Obj * OT_LNG_OBJ_T
PyTypeObject * OT_CLS_T
#define STR2VAL(ptr, len)
struct MkRuntimeC_Obj MkRuntimeC_Obj
#define MkBufferListC_MK_NULL
#define MkBufferC_ARGS
#define NS(n)
#define MkRuntimeC_MK_NULL
PyTypeObject OT_CLS_TR
#define MkErrorC_MK_NULL
static PyObject * PyC2O(MK_STRN v)
PyObject * OT_OBJ_T
#define MK_PY_EXTERN
static library
struct MkCallS MkCallS
struct MkBufferC_Obj MkBufferC_Obj
#define OT_CLASS_TYPE_REF
#define MkBufferC_MK_NULL
#define check_NULL(E)
#define MkBufferStreamC_MK_NULL
static PyObject * OT_PyObjectOrNone(MK_MNG mng)
#define OT_REF_DECR_AND_NULL(_obj)
#define MkBufferListC_ARGS
#define MkErrorC_Check(mng, PROC)
#define OT_ProcRet
#define OT_Prefix_ARGS
struct MkObjectC_Obj MkObjectC_Obj
#define printLngObj(o)
#define STRN2VAL(nat)
OT_ProcRet NS MkBufferC_ToObject(MkBufferC_ARGS)
OT_ProcRet MK MkBufferListC_ToList(MkBufferListC_ARGS)
#define MkBufferC_X2obj(x)
#define MkBufferListC_X2obj(x)
#define MkBufferStreamC_X2obj(x)
#define MkErrorC_X2obj(x)
#define MK_NULL_STR
#define mk_inline
#define MK_ARTIFICIAL
#define MK_NULL
const MK_PTRB * MK_MNGN
int32_t MK_NUM
MK_PTRB * MK_PTR
const MK_STRB * MK_STRN
MK_PTRB * MK_MNG
MK_PTRB const * MK_EXP
MK_PTRB * MK_CBP
MK_STRB * MK_STR
long MK_SIZE
signed int MK_I32
#define MkLogFileC_X2obj(x)
struct MkObjectS * MK_OBJ
#define MkObjectC_X2obj(x)
static bool MkObjCheck(MK_MNGN mng)
static MK_OBJ MkObj(MK_MNG mng)
#define MkSelfNew(...)
#define MkRefDecrWithUnlinkSelf(...)
#define MkRefDecrWithoutSelf(...)
static void MkSelfSet(MK_OBJ const obj, MK_PTR const self, MK_PTR const env)
static void MkRefIncr(MK_OBJ obj)
#define MkSysFree(pointer)
#define MkRuntimeC_X2obj(x)
#define MkThreadLocal
#define MK_RT_CALL
#define MK_RT_ARGS
tag: nhi1-release-250425
tag: nhi1-release-250425
tag: nhi1-release-250425
PyObject_HEAD MK_BUF hdl
PyObject_HEAD MK_BFL hdl
PyObject_HEAD MK_BUS hdl
OT_OBJ_T callable
PyObject_HEAD MK_ERR hdl
PyObject * MkBufferStreamC_MK_NULL
PyTypeObject * MkErrorE
PyObject * MkLogFileC_MK_NULL
PyTypeObject * MkTimeoutE
PyObject * MkBufferListC_MK_NULL
PyTypeObject * MkIdSE
PyTypeObject * MkTypeE
PyObject * MkRuntimeC_MK_NULL
PyObject_HEAD MK_LFL hdl
PyObject_HEAD MK_OBJ hdl
PyObject_HEAD MK_RT hdl