theLink
10.0
NHI1
-
theKernel
-
theLink
-
theConfig
-
theSq3Lite
-
theCompiler
-
theBrain
-
theGuard
-
theLib
-
theATL
c
-
tcl
-
atl
-
cs
-
py
-
rb
-
jv
-
cc
Loading...
Searching...
No Matches
MqCall_atl.c
Go to the documentation of this file.
1
9
/* LABEL-NO */
10
11
#include "
LibMqMsgque_private_atl.h
"
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
46
enum
MkErrorE
NS
(ServiceCall) (
MQ_SERVICE_CALL_ARGS
)
47
{
48
MQ_SERVICE_CALL_CHECK
;
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
58
CallProlog
(
mqctx
);
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) {
79
case
MkCallS_own_method
:
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
;
88
case
MkCallS_other_method
:
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
119
error
:
120
OT_ERROR_LNG_2_META
(
mqctx
);
121
122
error_mq:
123
return
MkErrorStack_0E
();
124
}
125
126
void
NS
(ServiceFree) (
MQ_SERVICE_FREE_ARGS
)
127
{
128
MK
(CallFree) (dataP);
129
}
130
131
void
NS
(ServiceCopy) (
MQ_SERVICE_COPY_ARGS
)
132
{
133
MK
(CallCopy)(
MK_RT_CALL
MkOBJ
(
mqctx
), dataP);
134
}
135
CallProlog
#define CallProlog(m)
Definition
LibMkKernel_atl.h:628
MK
#define MK(n)
Definition
LibMkKernel_atl.h:89
OT_ENV_T
MOX_ENV_T OT_ENV_T
Definition
LibMkKernel_atl.h:237
MkCallS_SIG
#define MkCallS_SIG
Definition
LibMkKernel_atl.h:513
check_META
#define check_META(code)
Definition
LibMkKernel_atl.h:474
META2VAL_X
#define META2VAL_X(x)
Definition
LibMkKernel_atl.h:980
OT_ERROR_LNG_2_META
#define OT_ERROR_LNG_2_META(m)
Definition
LibMkKernel_atl.h:470
OT_MK_CALL
#define OT_MK_CALL
Definition
LibMkKernel_atl.h:322
MkCallS_init
@ MkCallS_init
Definition
LibMkKernel_atl.h:515
MkCallS_null
@ MkCallS_null
Definition
LibMkKernel_atl.h:516
MkCallS_error
@ MkCallS_error
Definition
LibMkKernel_atl.h:521
MkCallS_own_method
@ MkCallS_own_method
Definition
LibMkKernel_atl.h:519
MkCallS_other_method
@ MkCallS_other_method
Definition
LibMkKernel_atl.h:520
MkCallS_proc
@ MkCallS_proc
Definition
LibMkKernel_atl.h:517
MkCallS_static
@ MkCallS_static
Definition
LibMkKernel_atl.h:518
MkProcResolve_maxArgsLen
#define MkProcResolve_maxArgsLen
Definition
LibMkKernel_atl.h:541
OT_MK_RT_SIG
#define OT_MK_RT_SIG
Definition
LibMkKernel_atl.h:251
Atl_EvalObjv
#define Atl_EvalObjv(...)
Definition
LibMkKernel_atl.h:1522
NS
#define NS(n)
Definition
LibMqMsgque_atl.h:77
LibMqMsgque_private_atl.h
tag: nhi1-release-250425
m
#define m
mqctx
#define mqctx
Definition
MqCall_atl.c:13
dbgMsg
#define dbgMsg(fmt,...)
Definition
MqCall_atl.c:42
error
#define error
Definition
high_lng.h:339
MkErrorGetCodeI
#define MkErrorGetCodeI(e)
MkErrorStack_0E
#define MkErrorStack_0E()
MkERROR
#define MkERROR
MkErrorE
MkErrorE
MK_OK
MK_OK
MkOBJ
#define MkOBJ(x)
MK_RT_CALL
#define MK_RT_CALL
MQ_SERVICE_CALL_CHECK
#define MQ_SERVICE_CALL_CHECK
Definition
LibMqMsgque_mq.h:929
MQ_SERVICE_FREE_ARGS
#define MQ_SERVICE_FREE_ARGS
the MqDataFreeF arguments with default names
Definition
LibMqMsgque_mq.h:959
MQ_SERVICE_CALL_ARGS
#define MQ_SERVICE_CALL_ARGS
the MqTokenF arguments with default names
Definition
LibMqMsgque_mq.h:936
MQ_SERVICE_COPY_ARGS
#define MQ_SERVICE_COPY_ARGS
the MqDataFreeF arguments with default names
Definition
LibMqMsgque_mq.h:968
call
enum MqCallE call
MkCallS
Definition
LibMkKernel_atl.h:524
OT_MK_RT_S
Definition
LibMkKernel_atl.h:255
OT_MK_RT_S::signature
MK_SIG signature
Definition
LibMkKernel_atl.h:256
OT_MK_RT_S::interp
OT_ENV_T interp
Definition
LibMkKernel_atl.h:259
Generated on Thu May 29 2025 13:13:59 for theLink by
1.12.0