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_tcl.c File Reference

Sq3Call_tcl.c - 13 Feb 2025 - aotto1968. More...

#include "LibSq3Lite_tcl.h"
+ Include dependency graph for Sq3Call_tcl.c:

Go to the source code of this file.

Functions

Sq3Fupu_Sq3LiteExec_callback_call_ret tclsq3lite_LiteExecCall (Sq3Fupu_Sq3LiteExec_callback_call_args)
 
Sq3LiteExecV2CB_ret tclsq3lite_LiteExecV2Call (Sq3LiteExecV2CB_args)
 

Detailed Description

Sq3Call_tcl.c - 13 Feb 2025 - aotto1968.

Version
02754e95eceb31b4783d830cea2717d06a482264
Date
Thu Feb 13 14:03:29 2025 +0100
Author
aotto1968 aotto.nosp@m.1968.nosp@m.@t-on.nosp@m.line.nosp@m..de

Definition in file Sq3Call_tcl.c.

Function Documentation

◆ tclsq3lite_LiteExecCall()

Definition at line 31 of file Sq3Call_tcl.c.

32{
34
35 // 1. setup environment
36 struct MkCallS * call = callV1 ;
37 SQ3_LITE lite = Sq3Lite(call->hdl);
38 OT_OBJ_T valsO=NULL;
39 OT_OBJ_T colsO=NULL;
40 OT_ENV_T interp = call->interp;
41 if (call->interp==NULL || Tcl_InterpDeleted(interp) || lite == NULL || OT_SELF_X(lite)==NULL) return 1;
42 MkRtSetup_RT(call->mkrt);
43
44 // 2. setup arguments
45 Tcl_Obj *objv[5+MkProcResolve_maxArgsLen] = {0};
46 int objc = 0;
47#if 0
48 MkBufferListCreateTLS_T(valsL,num);
49 MkBufferListAppendVC(valsL,num,(MK_STRN*)vals);
50 Tcl_Obj* valsO = MK(MkBufferListC_ObjNew)(MK_RT_CALL interp, valsL);
51 MkBufferListCreateTLS_T(colsL,num);
52 MkBufferListAppendVC(colsL,num,(MK_STRN*)cols);
53 Tcl_Obj* colsO = MK(MkBufferListC_ObjNew)(MK_RT_CALL interp, colsL);
54
55#else
56 valsO = Tcl_NewObj();
57 for (int i=0; i<num; i++) {
58 check_LNG(Tcl_ListObjAppendElement(interp,valsO,Tcl_NewStringObj(vals[i],-1))) goto error_lng;
59 }
60 colsO = Tcl_NewObj();
61 for (int i=0; i<num; i++) {
62 check_LNG(Tcl_ListObjAppendElement(interp,colsO,Tcl_NewStringObj(cols[i],-1))) goto error_lng;
63 }
64#endif
65
66 // 3. setup my
67rescan:
68 switch (call->type) {
69 case MkCallS_own_method: {
70 // this is a instance->method
71 objv[objc++] = OT_SELF_NAME_O(MkOBJ(lite));
72 break;
73 }
75 case MkCallS_static:
76 objv[objc++] = call->my;
77 break;
78 case MkCallS_proc:
79 break;
80 case MkCallS_init: {
81 check_META(MK(ProcResolve)(MK_RT_CALL call->interp, MkOBJ(lite), call)) goto error_mq;
82 goto rescan;
83 }
84 case MkCallS_error:
85 goto error_lng;
86 case MkCallS_null:
87 goto end;
88 }
89
90 // 4. setup methode
91 if (call->mth) objv[objc++] = call->mth;
92
93 if (call->args) MK(ProcResolveAppendArgs)(call,&objc,objv);
94
95 objv[objc++] = valsO;
96 objv[objc++] = colsO;
97
98//M1; printAryDetail(objc,objv);
99 // 3. call the callback
100 check_LNG (MK(EvalObjv) (interp, objc, objv, TCL_EVAL_GLOBAL)) goto error_lng;
101 //check_LNG (Tcl_EvalObjv (interp, objc, objv, TCL_EVAL_GLOBAL)) goto error_lng;
102//M2; printAryDetail(objc,objv);
103
104end:
105 Tcl_ResetResult(interp);
106 return 0;
107error_lng:
109error_mq:
111 return 1;
112}
#define MK(n)
#define OT_SELF_X(x)
#define check_META(code)
#define check_LNG(code)
#define OT_ERROR_LNG_2_META(m)
#define OT_SELF_NAME_O(o)
#define MkProcResolve_maxArgsLen
Tcl_Interp * OT_ENV_T
Tcl_Obj * OT_OBJ_T
#define MkBufferListAppendVC(...)
#define MkBufferListCreateTLS_T(name, num)
#define MkErrorStack_0E()
const MK_STRB * MK_STRN
#define MkOBJ(x)
#define MK_RT_CALL
#define MkRtSetup_RT(r)
static SQ3_LITE Sq3Lite(MK_MNG mng)
cast a unknown-object into an Sq3LiteS pointer or NULL if not possible
#define Sq3Fupu_Sq3LiteExec_callback_call_check
OT_OBJ_T mth
OT_ENV_T interp
OT_OBJ_T args
enum MkCallS::@3 type
OT_OBJ_T my
Struct to represent the data of the Sq3LiteC …

◆ tclsq3lite_LiteExecV2Call()

Sq3LiteExecV2CB_ret tclsq3lite_LiteExecV2Call ( Sq3LiteExecV2CB_args )

Definition at line 129 of file Sq3Call_tcl.c.

130{
132
133 // 1. setup environment
134 struct MkCallS *call = callV2 ;
135 SQ3_LITE lite = Sq3Lite(call->hdl);
136 OT_OBJ_T valsO = NULL;
137 OT_OBJ_T colsO = NULL;
138 OT_ENV_T interp = call->interp;
139 if (call->interp==NULL || Tcl_InterpDeleted(interp) || lite == NULL || OT_SELF_X(lite)==NULL) return MK_ERROR;
140
141 // 2. setup arguments
142 Tcl_Obj *objv[5+MkProcResolve_maxArgsLen] = {0};
143 int objc = 0;
144 valsO = OT_TMP_BFL_OBJ(vals);
145 colsO = OT_TMP_BFL_OBJ(cols);
146
147 // 3. setup my
148rescan:
149 switch (call->type) {
150 case MkCallS_own_method: {
151 // this is a instance->method
152 objv[objc++] = OT_SELF_NAME_O(MkOBJ(lite));
153 break;
154 }
156 case MkCallS_static:
157 objv[objc++] = call->my;
158 break;
159 case MkCallS_proc:
160 break;
161 case MkCallS_init: {
162 check_META(MK(ProcResolve)(MK_RT_CALL call->interp, MkOBJ(lite), call)) goto error_mq;
163 goto rescan;
164 }
165 case MkCallS_error:
166 goto error_lng;
167 case MkCallS_null:
168 goto end;
169 }
170
171 // 4. setup methode
172 if (call->mth) objv[objc++] = call->mth;
173
174 MK(ProcResolveAppendArgs)(call,&objc,objv);
175
176 objv[objc++] = valsO;
177 objv[objc++] = colsO;
178
179 // 3. call the callback
180 check_LNG (MK(EvalObjv) (interp, objc, objv, TCL_EVAL_GLOBAL)) goto error_lng;
181 //check_LNG (Tcl_EvalObjv (interp, objc, objv, TCL_EVAL_GLOBAL)) goto error_lng;
182
183 Tcl_ResetResult(interp);
184end:
185 return MkErrorGetCode_0E();
186error_lng:
188error_mq:
190 return MK_ERROR;
191}
#define OT_TMP_BFL_OBJ(val)
#define MkErrorGetCode_0E()
MK_ERROR
#define Sq3Fupu_Sq3LiteExecV2CB_callback_call_check