theLink 10.0
Loading...
Searching...
No Matches
MqCall_tcl.c File Reference

tag: nhi1-release-250425 More...

+ Include dependency graph for MqCall_tcl.c:

Go to the source code of this file.

Macros

#define mqctx   hdl
 
#define SETUP_my
 

Functions

static enum MkErrorE tclmqmsgque_SetupMy (OT_Prefix_ARGS struct TclContextS *tclctx, MQ_CTX mqctx, OT_SELF_T object)
 
enum MkErrorE tclmqmsgque_ServiceCall (MQ_SERVICE_CALL_ARGS)
 
void tclmqmsgque_ServiceFree (MQ_SERVICE_FREE_ARGS)
 
void tclmqmsgque_ServiceCopy (MQ_SERVICE_COPY_ARGS)
 

Detailed Description

tag: nhi1-release-250425

Definition in file MqCall_tcl.c.

Macro Definition Documentation

◆ mqctx

#define mqctx   hdl

Definition at line 13 of file MqCall_tcl.c.

◆ SETUP_my

#define SETUP_my
Value:
if (tclctx->my == NULL) { \
check_META(NS(SetupMy)(OT_Prefix_CALL tclctx,mqctx,selfO)) goto error; \
}
#define SETUP_tclctx
#define OT_Prefix_CALL
#define NS(n)
#define mqctx
Definition MqCall_tcl.c:13
#define error
Definition high_lng.h:339

Definition at line 44 of file MqCall_tcl.c.

44#define SETUP_my \
45 SETUP_tclctx; \
46 if (tclctx->my == NULL) { \
47 check_META(NS(SetupMy)(OT_Prefix_CALL tclctx,mqctx,selfO)) goto error; \
48 }

Function Documentation

◆ tclmqmsgque_ServiceCall()

enum MkErrorE tclmqmsgque_ServiceCall ( MQ_SERVICE_CALL_ARGS )

Definition at line 72 of file MqCall_tcl.c.

73{
75
76 // 1. setup environment
78 if (interp==NULL || Tcl_InterpDeleted(interp) ) return MK_OK;
79
80 // 2. setup arguments
81 struct MkCallS *call = __data__;
83 int objc = 0;
84
85//colorBLUE("call<%p>, type<%d>, nsO<%p>",call,call->type,call->nsO);
86
87 // 3. setup my
88rescan:
89 switch (call->type) {
90 case MkCallS_own_method: {
91//printLTxt("MkCallS_own_method");
92 // this is a instance->method
95 objv[objc++] = tclctx->my;
96 break;
97 }
99 case MkCallS_static:
100//printLTxt("MkCallS_other_method OR MkCallS_static");
101 objv[objc++] = call->my;
102 break;
103 case MkCallS_proc:
104//printLTxt("MkCallS_proc");
105 break;
106 case MkCallS_init: {
107 check_META(MK(ProcResolve)(MK_RT_CALL interp, MkOBJ(mqctx), call)) goto error_mq;
108 goto rescan;
109 }
110 case MkCallS_error:
111//printLTxt("MkCallS_error");
112 goto error;
113 case MkCallS_null:
114//printLTxt("MkCallS_null");
115 return MK_OK;
116 }
117
118 // 4. setup methode
119 if (call->mth) objv[objc++] = call->mth;
120
121 // 5. setup CTX arg
122 switch (call->type) {
124 break;
126 case MkCallS_static:
127 case MkCallS_proc:
128 objv[objc++] = META2VAL_X(mqctx);
129 break;
130 case MkCallS_init:
131 break;
132 case MkCallS_error:
133 goto error;
134 case MkCallS_null:
135 return MK_OK;
136 }
137
138 if (call->args) MK(ProcResolveAppendArgs)(call,&objc,objv);
139
140//printAryL("__data__", objc, objv);
141
142 // 3. call the callback
143 //int ret = Tcl_EvalObjv (interp, objc, objv, TCL_EVAL_GLOBAL);
144 int ret = MK(EvalObjv) (interp, objc, objv, TCL_EVAL_GLOBAL);
145
146//printV("ret=%i, code=%s\n", ret, MkLogErrorE(MkErrorGetCode_0E()))
147
148 if (ret == TCL_OK) {
149 Tcl_ResetResult(interp);
150 return MkErrorGetCode_0E();
151 }
152
153error:
154//ME
156//MkErrorLog_0E();
157
158error_mq:
159 return MkErrorStack_0E();
160}
#define MK(n)
#define SETUP_selfO
#define check_META(code)
#define META2VAL_X(x)
#define OT_ERROR_LNG_2_META(m)
#define MkProcResolve_maxArgsLen
Tcl_Obj * OT_OBJ_T
#define SETUP_interp
#define SETUP_my
Definition MqCall_tcl.c:44
#define MkErrorGetCode_0E()
#define MkErrorStack_0E()
MK_OK
#define MkOBJ(x)
#define MK_RT_CALL
#define MQ_SERVICE_CALL_CHECK
enum MqCallE call
OT_OBJ_T mth
OT_ENV_T interp

◆ tclmqmsgque_ServiceCopy()

void tclmqmsgque_ServiceCopy ( MQ_SERVICE_COPY_ARGS )

Definition at line 170 of file MqCall_tcl.c.

171{
172 MK(CallCopy)(MK_RT_CALL MkOBJ(mqctx), dataP);
173}

◆ tclmqmsgque_ServiceFree()

void tclmqmsgque_ServiceFree ( MQ_SERVICE_FREE_ARGS )

Definition at line 162 of file MqCall_tcl.c.

163{
165 if ( interp == NULL || Tcl_InterpDeleted(interp)) return;
166
167 MK(CallFree) (dataP);
168}

◆ tclmqmsgque_SetupMy()

static enum MkErrorE tclmqmsgque_SetupMy ( OT_Prefix_ARGS struct TclContextS * tclctx,
MQ_CTX mqctx,
OT_SELF_T object )
static

Definition at line 26 of file MqCall_tcl.c.

26 {
27 if (tclctx->my != NULL) return MK_OK;
28 if (object == NULL) {
29 NS(MqContextC_ObjNew)(MK_RT_CALL interp,mqctx);
30 object = (OT_SELF_T) (MkOBJ_R(mqctx).self);
31 }
32 check_NULL(object) goto error;
33 tclctx->my = MK(GetMyFromObject)(interp, object);
34 check_NULL(tclctx->my) goto error;
35 Tcl_IncrRefCount(tclctx->my);
36
37 return MK_OK;
38error:
40 return MK_ERROR;
41}
#define check_NULL(code)
Tcl_Object OT_SELF_T
MK_ERROR
#define MkOBJ_R(x)