theSq3Lite 10.0
Loading...
Searching...
No Matches
Sq3Call_py.c
Go to the documentation of this file.
1
9/* LABEL-NO */
10
12#include "misc_check_py.h"
13
14// #define Sq3Fupu_Sq3LiteExec_callback_call_args MK_CBP callback, MK_I32 num, MK_STR *vals, MK_STR *cols
15
16/*
17[LiteExecCall signature]
18 callback-args := vals:List[in] , cols:List[in]
19 [static] def callback ( callback-args )
20 [instance] class YYY:
21 def callback ( self, callback-args )
22 [class] class ZZZ:
23 @staticmethod
24 def callback ( callback-args )
25[LiteExecCall signature]
26*/
27
29{
31
32 // 1. setup environment
33 if (_Py_IsFinalizing()) return 1;
35
36 MkCallS *cbS = callV1;
37 MkRtSetup_RT(cbS->mkrt);
38
39 OT_OBJ_T resultO = NULL;
40 OT_OBJ_T valsO = PyList_New(num);
41 OT_OBJ_T colsO = PyList_New(num);
42 for (int i=0; i<num; i++) {
43 check_LNG(PyList_SetItem(valsO,i,STRN2VAL(vals[i]))) goto error_lng;
44 }
45 for (int i=0; i<num; i++) {
46 check_LNG(PyList_SetItem(colsO,i,STRN2VAL(cols[i]))) goto error_lng;
47 }
48
49 PyErr_Clear();
50
51 // call the function
52 resultO = PyObject_CallFunctionObjArgs(cbS->callable, valsO, colsO, NULL);
53
54 if (resultO == NULL) {
55 goto error_lng;
56 }
57
58end:
59 Py_CLEAR(valsO);
60 Py_CLEAR(colsO);
61 Py_CLEAR(resultO);
62 return ret;
63error_lng:
65error_mq: MK_UNUSED
67error_end: MK_UNUSED
68 ret=1;
69 goto end;
70}
71
72// *********************************************************************************
73
74/*
75[LiteExecV2Call signature]
76 callback-args := vals:MkBufferList[in] , cols:MkBufferList[in]
77 [static] def callback ( callback-args )
78 [instance] class YYY:
79 def callback ( self, callback-args )
80 [class] class ZZZ:
81 @staticmethod
82 def callback ( callback-args )
83[LiteExecV2Call signature]
84*/
85
86// #define Sq3LiteExecV2CB_ret enum MkErrorE
87// #define Sq3LiteExecV2CB_args MK_RT_ARGS MK_CBP callback, MK_BFL vals, MK_BFL cols
89{
91
92 // 1. setup environment
93 if (_Py_IsFinalizing()) return MK_ERROR;
94 MkCallS *cbS = callV2;
95
96 OT_OBJ_T resultO = NULL;
97 OT_OBJ_T valsO = OT_TMP_BFL_OBJ(vals);
98 OT_OBJ_T colsO = OT_TMP_BFL_OBJ(cols);
99
100 PyErr_Clear();
101
102 // call the function
103 resultO = PyObject_CallFunctionObjArgs(cbS->callable, valsO, colsO, NULL);
104
105 if (resultO == NULL) {
107 }
108
109 Py_CLEAR(valsO);
110 Py_CLEAR(colsO);
111 Py_CLEAR(resultO);
112 return MkErrorStack_0E_Check();
113}
114
#define OT_ERROR_LNG_2_META(m)
PyObject * OT_OBJ_T
#define OT_TMP_BFL_OBJ(val)
#define check_LNG(PROC)
#define STRN2VAL(nat)
tag: nhi1-release-250425
#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