theLink 10.0
Loading...
Searching...
No Matches
MqHigh_tcl.c
Go to the documentation of this file.
1
9/* LABEL-NO */
10
11#define META_FILE_NAME "MqHigh_tcl.c"
12
14
15#define OT_SETUP_hdl SetupHdlFromMetaData_2(CTX,MQ_CTX);
16
17#define OBJECT2CTX(O) MqCtx(Tcl_ObjectGetMetadata(O, &MK(AtomMeta)))
18
19#if !defined(SetupRtFromHdl_XN)
20 #define SetupRtFromHdl_XN(hdl) AllRtSetup_XN(hdl)
21 #define SetupRtFromHdl_X(hdl) AllRtSetup_X(hdl)
22#endif
23
24/* LABEL-END */
25
26#define META_CONTEXT_S hdl
27
30int NS(MqContextC_Send) (MqContextC_ARGS) {
31 //static const MK_STRN doc="[list…] [$ctx Send…]";
32
33#define highSELF "$ctx Send"
34
35#define highSKIP __skip
36#define highSKIP_SHIFT 1
37#define highSIZE objc
38
39#define highSIZE_AVAILABLE 1
40#define highREAD_RETURN_LIST 1
41#define highREAD_HAS_REFERENCE 1
42
43#define highINITcstr OT_CHECK_STR(cstr)
44#define highCMD "%s '%s' ... '%s' ..."
45#define highFARGS(f) NS(ServiceCall),f,NS(ServiceFree)
46
47#define highTRAN(str) OT_CHECK_C_COPY(str,MQ_SEND_TRANSACTION_TOKEN_SIZE)
48#define highTOKEN(str) OT_CHECK_C_COPY(str,MQ_SEND_TOKEN_SIGNATURE_SIZE)
49#define highTIME(t) OT_CHECK_TIME_T(timeout)
50#define highCALL(f) OT_CHECK_CALLABLE(f)
51
52// Tcl has no "easy way" to check for an TCL error set with Tcl_SetObjErrorCode - dito -
53// if it is not a MQ error -> it is an TCL error
54#define highERRORnative \
55 if (!MkErrorCheckE_0E()) OT_ERROR_LNG_2_META(mqctx);
56
57#define highRETerror OT_ERROR_META_2_LNG(hdl); \
58 retObj = NULL;
59
60#define highRETURN highRETURN_type_S
61#define highRETok goto end;
62
63#define highSend(T) { \
64 high_T_##T val; \
65 OT_CHECK_REQUIRED(OT_CHECK_##T(val)); \
66 MkErrorCheck(MqSend##T(mqctx,val)); \
67 break; \
68}
69
70#define highSendObj(T) { \
71 high_T_##T val; \
72 OT_CHECK_REQUIRED(OT_CHECK_##T(val,false)); \
73 MkErrorCheck(MqSend##T(mqctx,val)); \
74 break; \
75}
76
77/*
78#define highSendBUF(T) { \
79 high_T_##T val; \
80printObjv; \
81 OT_CHECK_REQUIRED(OT_CHECK_##T(val)); \
82printU(val); \
83 MkErrorCheck(MqSend##T(mqctx,val)); \
84 break; \
85}
86*/
87
88#define highSend_BOL highSend(BOL)
89#define highSend_I8 highSend(I8)
90#define highSend_I16 highSend(I16)
91#define highSend_I32 highSend(I32)
92#define highSend_I64 highSend(I64)
93#define highSend_HDL highSend(HDL)
94#define highSend_FLT highSend(FLT)
95#define highSend_DBL highSend(DBL)
96#define highSend_STR highSend(STR)
97#define highSend_BUF highSendObj(BUF)
98#define highSend_BFL { \
99 MkBufferListCreateTLS_T(bfl,5); \
100 OT_CHECK_REQUIRED(OT_CHECK_BFL(bfl,false)) \
101 MqSendBFL_E(mqctx, bfl); \
102 break; \
103}
104#define highSend_BIN { \
105 MkBinaryR cbi={0}; \
106 OT_CHECK_REQUIRED(OT_CHECK__ME_REF_MkBinaryR(cbi)) \
107 MqSendBIN_E(mqctx, cbi); \
108 break; \
109}
110
111#define highReadRef(T) { \
112 high_T_##T val = 0; \
113 OT_CHECK_REQUIRED(OT_CHECK_LNG_T(readVal)); \
114 MkErrorCheck(MqRead##T(mqctx,&val)); \
115 if (readVal != NULL) { \
116 OT_LNG_SET_VAR(readVal, high_C_##T (val)); \
117 } \
118 break; \
119}
120
121#define highREADprepare
122#define highREADinit readVal=NULL
123
124#define highReadRef_I8 highReadRef(I8);
125#define highReadRef_BOL highReadRef(BOL);
126#define highReadRef_I16 highReadRef(I16);
127#define highReadRef_I32 highReadRef(I32);
128#define highReadRef_I64 highReadRef(I64);
129#define highReadRef_HDL highReadRef(HDL);
130#define highReadRef_FLT highReadRef(FLT);
131#define highReadRef_DBL highReadRef(DBL);
132#define highReadRef_STR highReadRef(STR);
133#define highReadRef_BUF highReadRef(BUF);
134#define highReadRef_BFL highReadRef(BFL);
135#define highReadRef_ARGS highReadRef(A);
136#define highReadRef_BIN { \
137 MkBinaryR cbi; \
138 OT_CHECK_REQUIRED(OT_CHECK_LNG_T(readVal)); \
139 MqReadBIN_E(mqctx, &cbi); \
140 if (readVal) { \
141 OT_LNG_SET_VAR(readVal, OT_TMP_BIN_OBJ(cbi.data,(int)cbi.size)); \
142 } \
143 break; \
144}
145
147 #define error error1
148 OT_SETUP_VARARGS(1,99,highSELF "...");
149 #undef error
150#define mqctx hdl
151 //Tcl_ResetResult(interp);
152 OT_OBJ_T readVal;
153
154 MK_CBP fCall = NULL;
155 MK_STRN cstr = NULL;
156
157// **************************************************************************************************
158#define error high_error
159 #include "tmpl/high_lng.h"
160#undef error
161// ********************************************************************************************
162
163end:
165error1:
166 return TCL_ERROR;
167}
168
170
171// vim: nowrap
#define OT_SETUP_VARARGS(min, max, d)
#define OT_retObj_RETURN
Tcl_Obj * OT_OBJ_T
tag: nhi1-release-250425
#define NS(n)
#define MqContextC_ARGS
#define OT_SETUP_hdl
Definition MqHigh_tcl.c:15
#define highSELF
const MK_STRB * MK_STRN
MK_PTRB * MK_CBP
tag: nhi1-release-250425