theSq3Lite 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard - theLib - theATL
c - tcl - atl - cs - py - rb - jv - cc
Loading...
Searching...
No Matches
Sq3Call_py.c
Go to the documentation of this file.
1
12/* LABEL-NO */
13
15#include "misc_check_py.h"
16
17// #define Sq3Fupu_Sq3LiteExec_callback_call_args MK_CBP callback, MK_I32 num, MK_STR *vals, MK_STR *cols
18
19/*
20[LiteExecCall signature]
21 callback-args := vals:List[in] , cols:List[in]
22 [static] def callback ( callback-args )
23 [instance] class YYY:
24 def callback ( self, callback-args )
25 [class] class ZZZ:
26 @staticmethod
27 def callback ( callback-args )
28[LiteExecCall signature]
29*/
30
32{
34
35 // 1. setup environment
36 if (_Py_IsFinalizing()) return 1;
38
39 MkCallS *cbS = callV1;
40 MkRtSetup_RT(cbS->mkrt);
41
42 OT_OBJ_T resultO = NULL;
43 OT_OBJ_T valsO = PyList_New(num);
44 OT_OBJ_T colsO = PyList_New(num);
45 for (int i=0; i<num; i++) {
46 check_LNG(PyList_SetItem(valsO,i,STRN2VAL(vals[i]))) goto error_lng;
47 }
48 for (int i=0; i<num; i++) {
49 check_LNG(PyList_SetItem(colsO,i,STRN2VAL(cols[i]))) goto error_lng;
50 }
51
52 PyErr_Clear();
53
54 // call the function
55 resultO = PyObject_CallFunctionObjArgs(cbS->callable, valsO, colsO, NULL);
56
57 if (resultO == NULL) {
58 goto error_lng;
59 }
60
61end:
62 Py_CLEAR(valsO);
63 Py_CLEAR(colsO);
64 Py_CLEAR(resultO);
65 return ret;
66error_lng:
68error_mq: MK_UNUSED
70error_end: MK_UNUSED
71 ret=1;
72 goto end;
73}
74
75// *********************************************************************************
76
77/*
78[LiteExecV2Call signature]
79 callback-args := vals:MkBufferList[in] , cols:MkBufferList[in]
80 [static] def callback ( callback-args )
81 [instance] class YYY:
82 def callback ( self, callback-args )
83 [class] class ZZZ:
84 @staticmethod
85 def callback ( callback-args )
86[LiteExecV2Call signature]
87*/
88
89// #define Sq3LiteExecV2CB_ret enum MkErrorE
90// #define Sq3LiteExecV2CB_args MK_RT_ARGS MK_CBP callback, MK_BFL vals, MK_BFL cols
92{
94
95 // 1. setup environment
96 if (_Py_IsFinalizing()) return MK_ERROR;
97 MkCallS *cbS = callV2;
98
99 OT_OBJ_T resultO = NULL;
100 OT_OBJ_T valsO = OT_TMP_BFL_OBJ(vals);
101 OT_OBJ_T colsO = OT_TMP_BFL_OBJ(cols);
102
103 PyErr_Clear();
104
105 // call the function
106 resultO = PyObject_CallFunctionObjArgs(cbS->callable, valsO, colsO, NULL);
107
108 if (resultO == NULL) {
110 }
111
112 Py_CLEAR(valsO);
113 Py_CLEAR(colsO);
114 Py_CLEAR(resultO);
115 return MkErrorStack_0E_Check();
116}
117
#define OT_ERROR_LNG_2_META(m)
PyObject * OT_OBJ_T
#define OT_TMP_BFL_OBJ(val)
#define check_LNG(PROC)
#define STRN2VAL(nat)
LibSq3Lite_private_py.h - 17 Apr 2025 - aotto1968.
#define NS(n)
#define MkErrorStack_0E_Check()
#define MkErrorStack_0E()
#define MK_UNUSED
MK_ERROR
#define MkRtSetup_RT(r)
#define Sq3Fupu_Sq3LiteExecV2CB_callback_call_check
#define Sq3LiteExecV2CB_ret
#define Sq3Fupu_Sq3LiteExec_callback_call_check
#define Sq3Fupu_Sq3LiteExec_callback_call_args
#define Sq3Fupu_Sq3LiteExec_callback_call_ret
#define Sq3LiteExecV2CB_args
OT_OBJ_T callable