theLink 10.0
Loading...
Searching...
No Matches
MqCall_atl.c
Go to the documentation of this file.
1
9/* LABEL-NO */
10
12
13#define mqctx hdl
14
15/*****************************************************************************/
16/* */
17/* Proc-Call */
18/* */
19/*****************************************************************************/
20
21/*
22[ServiceCall signature]
23 1. The *service-ctx* is the *context* for which the service was defined.
24 2. If the *callback* is **not** an instance of the calling *context*, the *service-ctx* is added as an argument.
25
26 callback-args := service-ctx:MqContextC[in]
27 [static] proc callback { callback-args ?additional-args...? } ...
28 [own] myooX::ClassN ::XXX {
29 SuperI MqContextC
30 proc callback { ?additional-args...? } ...
31 [instance] myooX::ClassN ::YYY {
32 proc callback { myNs callback-args ?additional-args...? } ...
33 [class] myooX::ClassN ::ZZZ {
34 proc callback { callback-args ?additional-args...? } ...
35[ServiceCall signature]
36*/
37
38#if 0
39 #define dbgMsg(fmt,...) printV(fmt,__VA_ARGS__)
40 #define dbgObj(obj) printLngObj(obj)
41#else
42 #define dbgMsg(fmt,...)
43 #define dbgObj(obj)
44#endif
45
46enum MkErrorE NS(ServiceCall) ( MQ_SERVICE_CALL_ARGS )
47{
49
50 // 1. setup environment
51 MkCallS *call = __data__;
52 assert(call->signature == MkCallS_SIG);
53
54//MkCallLog(call);
55
56 // 2. prolog
57#if 0
59#else
60# define m mqctx
61 /* 1. setup runtime */
62 OT_MK_RT_T const amkrt = call->amkrt;
63 assert (amkrt->signature == OT_MK_RT_SIG);
64 OT_ENV_T const interp = amkrt->interp;
65 assert (!Tcl_InterpDeleted(interp));
66 Tcl_ResetResult(interp);
67
68 /* 2. setup arguments */
69 Tcl_Obj *objv[5+MkProcResolve_maxArgsLen];
70
71 rescan:
72 int objc = 1;
73
74 /* 1. setup methode */
75 objv[0] = call->mth;
76
77 /* 2. setup my */
78 switch (call->type) {
80 dbgMsg("%s","MkCallS_own_method");
81 break;
82 case MkCallS_static:
83 dbgMsg("%s","MkCallS_static");
84 break;
85 case MkCallS_proc:
86 dbgMsg("%s","MkCallS_proc");
87 break;
89 dbgMsg("%s","MkCallS_other_method");
90 objv[objc++] = call->my;
91 break;
92 case MkCallS_init: {
93 dbgMsg("%s","MkCallS_init");
94 check_META(MK(ProcResolve)(OT_MK_CALL (m), call)) goto error_mq;
95 goto rescan;
96 }
97 case MkCallS_null:
98 dbgMsg("%s","MkCallS_null");
99 return MK_OK;
100 case MkCallS_error:
101 dbgMsg("%s","MkCallS_error");
102 goto error;
103 }
104# undef m
105#endif
106
107 // 3. setup CTX arg
108 objv[objc++] = META2VAL_X(mqctx);
109
110 // 4. setup user arg(s)
111 if (call->args) MK(ProcResolveAppendArgs)(call,&objc,objv);
112
113 // 3. call the callback
114 int ret = Atl_EvalObjv (interp, objc, objv, 0); /* "MK(EvalObjv)" IS NOT required !! */
115 if (ret != TCL_OK) goto error;
116
117 return MkErrorGetCodeI(&MkERROR); /* MkErrorGetCode_0E() */
118
119error:
121
122error_mq:
123 return MkErrorStack_0E();
124}
125
126void NS(ServiceFree) ( MQ_SERVICE_FREE_ARGS )
127{
128 MK(CallFree) (dataP);
129}
130
131void NS(ServiceCopy) ( MQ_SERVICE_COPY_ARGS )
132{
133 MK(CallCopy)(MK_RT_CALL MkOBJ(mqctx), dataP);
134}
135
#define CallProlog(m)
#define MK(n)
MOX_ENV_T OT_ENV_T
#define MkCallS_SIG
#define check_META(code)
#define META2VAL_X(x)
#define OT_ERROR_LNG_2_META(m)
#define OT_MK_CALL
@ MkCallS_init
@ MkCallS_null
@ MkCallS_error
@ MkCallS_own_method
@ MkCallS_other_method
@ MkCallS_proc
@ MkCallS_static
#define MkProcResolve_maxArgsLen
#define OT_MK_RT_SIG
#define Atl_EvalObjv(...)
#define NS(n)
tag: nhi1-release-250425
#define m
#define mqctx
Definition MqCall_atl.c:13
#define dbgMsg(fmt,...)
Definition MqCall_atl.c:42
#define error
Definition high_lng.h:339
#define MkErrorGetCodeI(e)
#define MkErrorStack_0E()
#define MkERROR
MkErrorE
MK_OK
#define MkOBJ(x)
#define MK_RT_CALL
#define MQ_SERVICE_CALL_CHECK
#define MQ_SERVICE_FREE_ARGS
the MqDataFreeF arguments with default names
#define MQ_SERVICE_CALL_ARGS
the MqTokenF arguments with default names
#define MQ_SERVICE_COPY_ARGS
the MqDataFreeF arguments with default names
enum MqCallE call
OT_ENV_T interp