theLink 10.0
Loading...
Searching...
No Matches
MqDumpC_tcl.c
Go to the documentation of this file.
1
9/* LABEL-START */
10
11#define META_FILE_NAME "MqDumpC_tcl.c"
12
14
15#define OT_CLASS NS(MqDumpC)
16#define OT_CLASS_NAME "MqDumpC"
17
18#define OBJECT2DMP(O) MkAssertCastM(MqDumpC,(Tcl_ObjectGetMetadata(O, &MK(AtomMeta))))
19
20// TCL class
22
23// META class
25MkThreadLocal OT_OBJ_T MQ(MqDumpC_MK_NULL) = NULL;
26
27// META: ObjNew feature: selfCreate will be called from "ObjNew->MkSelfNew" if MkObj need a SELF pointer
28static MK_PTR NS(MqDumpC_selfCreate) (MK_RT_ARGS MK_OBJ const obj, MK_PTR const env) {
29 OT_ENV_T interp = env;
30 return MK(AtomCreate) (MK_RT_CALL interp,obj,OT_CLASS,NULL,NULL);
31}
32// META: is called when the META object is destroyed and SELF does NOT belongs to the META.
33static void NS(MqDumpC_selfDelete) (MK_RT_ARGS MK_PTR selfP, MK_PTR const env) {
34 OT_SELF_T selfO = selfP;
35 OT_ENV_T interp = env;
36 MK(AtomDeleteHard) (MK_RT_CALL interp, selfO);
37}
38// META: is called when the META object is destroyed and SELF does NOT belong to the META.
39static void NS(MqDumpC_selfUnlink) (MK_RT_ARGS MK_PTR selfP, MK_PTR const env) {
40 OT_SELF_T selfO = selfP;
41 OT_ENV_T interp = env;
42 MK(AtomUnlink) (MK_RT_CALL interp, selfO);
43}
44
45// ATTENTION: TCL has no "Unlink" because the "Tcl_ObjectSetMetadata(selfO,&MK(AtomMeta),NULL);" call
46// also the destructor
47
48#define OT_SETUP_hdl_static_constr_pre
49#define OT_SETUP_hdl_static_constr \
50 OT_SETUP_hdl_static_constr_pre; \
51 OT_SETUP_hdl_static
52
53#define OT_SETUP_hdl_static \
54 int __skip=Tcl_ObjectContextSkippedArgs(objCtx); \
55 AllRtSetup_NULL; \
56 __attribute__((unused)) OT_SELF_T selfO = Tcl_ObjectContextObject(objCtx); \
57 __attribute__((unused)) MK_TYP hdl = MqDumpC##_TT;
58
59#define OT_SETUP_hdl SetupHdlFromMetaData_2(DMP,MQ_DMP);
60#define OT_SETUP_hdl__null_allow SetupHdlFromMetaData__null_allow_2(DMP,MQ_DMP);
61#define OT_SETUP_hdl_destr SetupHdlFromMetaData__null_allow_2(DMP,MQ_DMP);
62
63#define OT_SETUP_hdl_constr_pre
64#define OT_SETUP_hdl_constr \
65 OT_SETUP_hdl_constr_pre; \
66 int __skip=Tcl_ObjectContextSkippedArgs(objCtx); \
67 AllRtSetup_NULL; \
68 MK_RT_UNUSED OT_SELF_T selfO = Tcl_ObjectContextObject(objCtx); \
69 MQ_DMP hdl = (MQ_DMP) &MkERROR;
70
71#if !defined(SetupRtFromHdl_XN)
72 #define SetupRtFromHdl_XN(hdl) AllRtSetup_XN(hdl)
73 #define SetupRtFromHdl_X(hdl) AllRtSetup_X(hdl)
74#endif
75
76// initialize the TCL and MO class specific object
77#define ClassInit \
78 /* if not already done, initialize NEW MQ type */ \
79 if (MqDumpCTT == NULL) MqDumpCTT = MqDumpSTT; \
80 \
81 /* protect against double call */ \
82 if (MqDumpCTT->selfCreate == NS(MqDumpC_selfCreate)) return MK_OK; \
83 \
84 /* add "selfCreate" and "selfDelete" feature to the MQ-Class */ \
85 MqDumpCTT->selfCreate = NS(MqDumpC_selfCreate); \
86 MqDumpCTT->selfDelete = NS(MqDumpC_selfDelete); \
87 MqDumpCTT->selfUnlink = NS(MqDumpC_selfUnlink); \
88 \
89 /* create the TCL-class */ \
90 OT_SELF_T classO = MK(ClassDef)(interp,ns,MqDumpCTT); \
91 check_NULL(classO) goto error; \
92 OT_CLASS = Tcl_GetObjectAsClass(classO); \
93 \
94 /* create the TCL static Methods */ \
95 static MkThreadLocal OtUnknownS NS(sClassUnknown) = {OT_UNKNOWN_CLASS}; \
96 check_LNG(MK(UnknownSetup) (interp,classO,NS(sOtClassDef),&NS(sClassUnknown))) goto error; \
97 \
98 /* create the TCL instance Methods */ \
99 static MkThreadLocal OtUnknownS NS(sInstanceUnknown) = {OT_UNKNOWN_INSTANCE}; \
100 check_LNG(MK(UnknownSetup) (interp,classO,NS(sInstanceDef),&NS(sInstanceUnknown))) goto error; \
101 \
102 /* define the "NULL" object */ \
103 MQ(MqDumpC_MK_NULL) = Tcl_GetObjectName(interp, \
104 MK(AtomCreate) (MK_RT_CALL interp, NULL /*obj*/, OT_CLASS, "MK_NULL" /*name*/, "::tclmqmsgque::MqDumpC" /*ns*/) \
105 ); \
106 Tcl_IncrRefCount(MQ(MqDumpC_MK_NULL));
107
108#define VER TCL_OO_METHOD_VERSION_CURRENT
109
110/* LABEL-END */
111
112// BEGIN-DOC - created by 'tcl_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
113
114// doc-key: MqDumpC,MqDump,sCi,func
115#define CTOR_doc "MqDumpC [MqDumpC CTOR ctx:MqContextC ?dumpP_inout:MqDumpC=\"MK_NULL\"?]"
116#define Error_doc "MqDumpC [MqDumpC Error error:MqContextC ?dumpP_inout:MqDumpC=\"MK_NULL\"?]"
117#define Export_doc "MqDumpC [MqDumpC Export ctx:MqContextC ?dumpP_inout:MqDumpC=\"MK_NULL\"?]"
118
119// doc-key: MqDumpC,MqDump,sCo,func
120#define BinSet_doc "MqDumpC [MqDumpC BinSet data:binary]"
121
122// doc-key: MqDumpC,MqDump,sc_,func
123#define GetNull_doc "MqDumpC [MqDumpC GetNull]"
124#define HandleResolve_doc "MqDumpC [MqDumpC HandleResolve netHdl:MK_HDL]"
125#define Instances_doc "MqDumpC [MqDumpC Instances]"
126
127// doc-key: MqDumpC,MqDump,oc_,func
128#define Next_doc "MqDumpC [$dmp Next]"
129#define Prev_doc "MqDumpC [$dmp Prev]"
130
131// doc-key: MqDumpC,MqDump,om_,func
132#define BinGet_doc "binary [$dump BinGet] (const)"
133// skip class-overload: HandleGet → MkObjectHandleGet
134#define Import_doc "$dump Import ctx:MqContextC"
135// skip class-overload: Log → MkObjectLog
136#define SizeGet_doc "long [$dump SizeGet] (const)"
137#define TokenGet_doc "string [$dump TokenGet] (const)"
138
139// END-DOC - created by 'tcl_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
140
141/*****************************************************************************/
142/* */
143/* O B J E C T */
144/* */
145/*****************************************************************************/
146
147// BEGIN-MqDumpC - created by 'tcl_MqC.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
148
152
153// doc-key: MqDumpC,MqDumpC-Class-Export,sc_
154
156static OT_ProcRet NS(MqDumpC_HandleResolve) (OtClass_ARGS) {
159 MK_HDL netHdl = 0;
162 MQ_DMP retVal = MqDumpHandleResolve (netHdl);
163 OT_retObj_SET_DMP(retVal);
164 goto end;
165 error:
167 end:
169}
170
171// doc-key: MqDumpC,MqDumpC-Class-Export,om_
172
173// skip on class-overload: MqDumpHandleGet → MkObjectHandleGet
175static OT_ProcRet NS(MqDumpC_HandleGet) (MqDumpC_ARGS) {OT_ERROR_LNG_RETURN;}
176
178// MqDumpC_Class_TCL_API
179
183
184// doc-key: MqDumpC,MqDumpC-Class-Introspection,oc_
185
187static OT_ProcRet NS(MqDumpC_Next) (MqDumpC_ARGS) {
191 MQ_DMP retVal = MqDumpNext (hdl);
192 OT_retObj_SET_DMP(retVal);
193 goto end;
194 error:
196 end:
198}
199
201static OT_ProcRet NS(MqDumpC_Prev) (MqDumpC_ARGS) {
205 MQ_DMP retVal = MqDumpPrev (hdl);
206 OT_retObj_SET_DMP(retVal);
207 goto end;
208 error:
210 end:
212}
213
214// doc-key: MqDumpC,MqDumpC-Class-Introspection,sc_
215
217static OT_ProcRet NS(MqDumpC_Instances) (OtClass_ARGS) {
221 MQ_DMP retVal = MqDumpInstances ();
222 OT_retObj_SET_DMP(retVal);
223 goto end;
224 error:
226 end:
228}
229
231// MqDumpC_Class_TCL_API
232
236
237// doc-key: MqDumpC,MqDumpC-Class-Misc,sc_
238
240static OT_ProcRet NS(MqDumpC_GetNull) (OtClass_ARGS) {
244 MQ_DMP retVal = MqDumpGetNull ();
245 OT_retObj_SET_DMP(retVal);
246 goto end;
247 error:
249 end:
251}
252
254// MqDumpC_Class_TCL_API
255
259
260// doc-key: MqDumpC,MqDumpC-Misc,om_
261
262// skip on class-overload: MqDumpLog → MkObjectLog
265
267static OT_ProcRet NS(MqDumpC_SizeGet) (MqDumpC_ARGS) {
272 goto end;
273 error:
275 end:
277}
278
280static OT_ProcRet NS(MqDumpC_TokenGet) (MqDumpC_ARGS) {
285 goto end;
286 error:
288 end:
290}
291
293// MqDumpC_Misc_TCL_API
294
298
299// doc-key: MqDumpC,MqDumpC-TOR,sCi
300
302static OT_ProcRet NS(MqDumpC_CTOR) (CONSTR_ARGS) {
305 MQ_CTX ctx = 0;
307 MQ_DMP dumpP_inout = NULL;
309 MkErrorC_Check(ctx,MqDumpExport (ctx, &dumpP_inout));
310 OT_CONSTRUCTOR_POST(dumpP_inout)
311 OT_retObj_CONSTR(dumpP_inout);
312 goto end;
313 error:
315 end:
317}
318
320static OT_ProcRet NS(MqDumpC_Error) (OtClass_ARGS) {
323 MQ_CTX error = 0;
325 MQ_DMP dumpP_inout = NULL;
328 MkErrorC_Check(error,MqDumpError (error, &dumpP_inout));
329 OT_retObj_SET_DMP(dumpP_inout);
330 goto end;
331 error:
333 end:
335}
336
338static OT_ProcRet NS(MqDumpC_Export) (OtClass_ARGS) {
341 MQ_CTX ctx = 0;
343 MQ_DMP dumpP_inout = NULL;
346 MkErrorC_Check(ctx,MqDumpExport (ctx, &dumpP_inout));
347 OT_CONSTRUCTOR_POST(dumpP_inout)
348 OT_retObj_SET_DMP(dumpP_inout);
349 goto end;
350 error:
352 end:
354}
355
356// doc-key: MqDumpC,MqDumpC-TOR,sCo
357
359static OT_ProcRet NS(MqDumpC_BinSet) (OtClass_ARGS) {
362 MkBinaryR data = {0};
365 MQ_DMP dmp_out;
367 OT_retObj_SET_DMP(dmp_out);
368 goto end;
369 error:
371 end:
373}
374
375// doc-key: MqDumpC,MqDumpC-TOR,om_
376
378static OT_ProcRet NS(MqDumpC_BinGet) (MqDumpC_ARGS) {
382 MkBinaryR retVal = MqDumpBinGet (hdl);
384 goto end;
385 error:
387 end:
389}
390
392static OT_ProcRet NS(MqDumpC_Import) (MqDumpC_ARGS) {
395 MQ_CTX ctx = 0;
398 MkErrorC_Check(hdl,MqDumpImport (hdl, ctx));
400 goto end;
401 error:
403 end:
405}
406
408// MqDumpC_TOR_TCL_API
409
410// END-MqDumpC - created by 'tcl_MqC.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
411
412// ---------------------------------------------------------------------------------------
413
414static Tcl_MethodType NS(sOtClassDef)[] = {
415// BEGIN-CLASS - created by 'tcl_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
416
417// doc-key: MqDumpC,MqDump,sCi
418 {VER, "Error" , NS(MqDumpC_Error) , NULL, NULL},
419 {VER, "Export" , NS(MqDumpC_Export) , NULL, NULL},
420
421// doc-key: MqDumpC,MqDump,sCo
422 {VER, "BinSet" , NS(MqDumpC_BinSet) , NULL, NULL},
423
424// doc-key: MqDumpC,MqDump,sc_
425 {VER, "GetNull" , NS(MqDumpC_GetNull) , NULL, NULL},
426 {VER, "HandleResolve" , NS(MqDumpC_HandleResolve) , NULL, NULL},
427 {VER, "Instances" , NS(MqDumpC_Instances) , NULL, NULL},
428
429// END-CLASS - created by 'tcl_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
430 {0, NULL, NULL, NULL}
431};
432
433// ---------------------------------------------------------------------------------------
434
435static Tcl_MethodType NS(sInstanceDef)[] = {
436// BEGIN-OBJ - created by 'tcl_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
437
438// doc-key: MqDumpC,MqDump,oC_
439 {VER, "<constructor>" , NS(MqDumpC_CTOR) , NULL, NULL},
440
441// doc-key: MqDumpC,MqDump,oc_
442 {VER, "Next" , NS(MqDumpC_Next) , NULL, NULL},
443 {VER, "Prev" , NS(MqDumpC_Prev) , NULL, NULL},
444
445// doc-key: MqDumpC,MqDump,om_
446 {VER, "BinGet" , NS(MqDumpC_BinGet) , NULL, NULL},
447 // skip class-overload: MqDumpHandleGet → HandleGet, NS(MqDumpC_HandleGet)
448 {VER, "Import" , NS(MqDumpC_Import) , NULL, NULL},
449 // skip class-overload: MqDumpLog → Log, NS(MqDumpC_Log)
450 {VER, "SizeGet" , NS(MqDumpC_SizeGet) , NULL, NULL},
451 {VER, "TokenGet" , NS(MqDumpC_TokenGet) , NULL, NULL},
452
453// END-OBJ - created by 'tcl_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
454 {0, NULL, NULL, NULL, NULL}
455};
456
462
463int NS(pMqDumpC_Init) ( MK_RT_ARGS OT_ENV_T interp, OT_NS_T ns)
464{
467
468 return TCL_OK;
469error:
470 return TCL_ERROR;
471}
#define MK(n)
#define OT_SETUP_VARARGS(min, max, d)
#define OT_CHECK_NIH(val)
#define OT_SETUP_NOARG(d)
#define OT_SETUP_ONEARG(d)
Tcl_Class OT_CLS_T
#define OT_ERROR_LNG_RETURN
Tcl_Namespace * OT_NS_T
#define OT_retObj_SET_Error
#define OT_retObj_SET_LONG(nat)
#define OT_CHECK_REQUIRED(val)
#define OT_retObj_SET_None
#define OT_GET__ME_REF_MkBinaryR(b)
#define OT_SETUP_CONSTRUCTOR_ARGS(...)
#define OT_retObj_RETURN
#define OT_CHECK__ME_REF_MkBinaryR(val)
#define OT_retObj_SET_STR(nat)
Tcl_Object OT_SELF_T
#define OT_CHECK_OPTIONAL(val)
#define OT_retObj_SET(val)
#define OT_retObj_CONSTR(x)
#define OT_CHECK_NOARGS
#define MkErrorC_Check(mng, PROC)
#define OT_ProcRet
Tcl_Interp * OT_ENV_T
#define CONSTR_ARGS
Tcl_Obj * OT_OBJ_T
tag: nhi1-release-250425
#define OtClass_ARGS
#define MQ(n)
#define NS(n)
#define MqDumpC_ARGS
#define OT_retObj_SET_DMP(nat)
#define OT_CONSTRUCTOR_POST(x)
#define Instances_doc
#define Import_doc
#define OT_SETUP_hdl_static_constr
Definition MqDumpC_tcl.c:49
#define OT_SETUP_hdl
Definition MqDumpC_tcl.c:59
#define GetNull_doc
#define Next_doc
static __thread MK_TYP MqDumpCTT
Definition MqDumpC_tcl.c:24
#define Error_doc
#define HandleResolve_doc
#define Prev_doc
#define VER
#define OT_CLASS
Definition MqDumpC_tcl.c:15
#define OT_SETUP_hdl_static
Definition MqDumpC_tcl.c:53
#define OT_SETUP_hdl_constr
Definition MqDumpC_tcl.c:64
#define Export_doc
#define SizeGet_doc
#define TokenGet_doc
#define CTOR_doc
#define BinSet_doc
#define ClassInit
Definition MqDumpC_tcl.c:77
#define BinGet_doc
#define error
Definition high_lng.h:339
#define MK_ERROR_FORMAT
#define MK_NULL_NO
#define MK_NULL_YES
#define MK_UNUSED
#define MK_DEPRECATED
MK_PTRB * MK_PTR
int32_t MK_HDL
#define MkThreadLocal
#define MK_RT_CALL
#define MK_RT_ARGS
#define MqDumpHandleResolve(...)
static MQ_DMP MqDumpGetNull(void)
Null-Slot - return a MqDumpC typed NULL instance …
#define MqDumpInstances()
static MQ_DMP MqDumpNext(MQ_DMP const dmp)
get next instance from linked-list of MqDumpS type
static MQ_DMP MqDumpPrev(MQ_DMP const dmp)
get previous instance from linked-list of MqDumpS type
MK_STRN MqDumpTokenGet(MQ_DMPN const dump)
return the MqContextC_ServiceApi_Identifer …
MK_SIZE MqDumpSizeGet(MQ_DMPN const dump)
report the binary data size from an MqDumpS object
#define MqDumpError(...)
#define MqDumpExport(...)
#define MqDumpBinSet(...)
#define MqDumpImport(...)
MkBinaryR MqDumpBinGet(MQ_DMPN const dump)
export the binary data from an MqDumpS object
#define MQ_STATIC_RT
MK_OBJ const obj
Definition high_lng.h:136
#define OT_CHECK_CTX(val, nullB)
#define OT_CHECK_DMP(val, nullB)
PUBLIC data structure for the tclmqmsgque-specific-data
MqDumpC - the class known as dmp or dump is used to export a tclmqmsgque data package as binary …