theKernel 10.0
Loading...
Searching...
No Matches
MkLogFileC_tcl.c
Go to the documentation of this file.
1
9/* LABEL-START */
10
11#define META_FILE_NAME "MkLogFileC_tcl.c"
12
14
15#define OT_CLASS NS(MkLogFileC)
16#define OT_CLASS_NAME "MkLogFileC"
17
18#define OBJECT2LFL(O) MkAssertCastM(MkLogFileC,(Tcl_ObjectGetMetadata(O, &MK(AtomMeta))))
19
20// TCL class
22
23// META class
25MkThreadLocal OT_OBJ_T MK(MkLogFileC_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(MkLogFileC_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(MkLogFileC_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(MkLogFileC_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 = MkLogFileC##_TT;
58
59#define OT_SETUP_hdl SetupHdlFromMetaData_2(LFL,MK_LFL);
60#define OT_SETUP_hdl__null_allow SetupHdlFromMetaData__null_allow_2(LFL,MK_LFL);
61#define OT_SETUP_hdl_destr SetupHdlFromMetaData__null_allow_2(LFL,MK_LFL);
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 MK_LFL hdl = (MK_LFL) &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 (MkLogFileCTT == NULL) MkLogFileCTT = MkLogFileSTT; \
80 \
81 /* protect against double call */ \
82 if (MkLogFileCTT->selfCreate == NS(MkLogFileC_selfCreate)) return MK_OK; \
83 \
84 /* add "selfCreate" and "selfDelete" feature to the MQ-Class */ \
85 MkLogFileCTT->selfCreate = NS(MkLogFileC_selfCreate); \
86 MkLogFileCTT->selfDelete = NS(MkLogFileC_selfDelete); \
87 MkLogFileCTT->selfUnlink = NS(MkLogFileC_selfUnlink); \
88 \
89 /* create the TCL-class */ \
90 OT_SELF_T classO = MK(ClassDef)(interp,ns,MkLogFileCTT); \
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 MK(MkLogFileC_MK_NULL) = Tcl_GetObjectName(interp, \
104 MK(AtomCreate) (MK_RT_CALL interp, NULL /*obj*/, OT_CLASS, "MK_NULL" /*name*/, "::tclmkkernel::MkLogFileC" /*ns*/) \
105 ); \
106 Tcl_IncrRefCount(MK(MkLogFileC_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/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
113
114// doc-key: MkLogFileC,MkLogFile,sCo,func
115#define CTOR_doc "MkLogFileC [MkLogFileC CTOR fmtobj:MkObjectC file:string]"
116#define Open_doc "MkLogFileC [MkLogFileC Open fmtobj:MkObjectC file:string]"
117
118// doc-key: MkLogFileC,MkLogFile,sc_,func
119#define GetNull_doc "MkLogFileC [MkLogFileC GetNull]"
120#define HandleResolve_doc "MkLogFileC [MkLogFileC HandleResolve netHdl:MK_HDL]"
121#define Instances_doc "MkLogFileC [MkLogFileC Instances]"
122
123// doc-key: MkLogFileC,MkLogFile,oc_,func
124#define Next_doc "MkLogFileC [$lfl Next]"
125#define Prev_doc "MkLogFileC [$lfl Prev]"
126
127// doc-key: MkLogFileC,MkLogFile,om_,func
128// skip class-overload: HandleGet → MkObjectHandleGet
129#define WriteC_doc "$lfl WriteC text:string (const)"
130
131// doc-key: MkLogFileC,MkLogFile,omo,func
132#define GetFile_doc "string [$lfl GetFile] (const)"
133
134// END-DOC - created by 'tcl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
135
136/*****************************************************************************/
137/* */
138/* O B J E C T */
139/* */
140/*****************************************************************************/
141
142// BEGIN-MkLogFileC - created by 'tcl_MqC.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
143
147
148// doc-key: MkLogFileC,MkLogFileC-Class-Export,sc_
149
151static OT_ProcRet NS(MkLogFileC_HandleResolve) (OtClass_ARGS) {
154 MK_HDL netHdl = 0;
157 MK_LFL retVal = MkLogFileHandleResolve (netHdl);
158 OT_retObj_SET_LFL(retVal);
159 goto end;
160 error:
162 end:
164}
165
166// doc-key: MkLogFileC,MkLogFileC-Class-Export,om_
167
168// skip on class-overload: MkLogFileHandleGet → MkObjectHandleGet
170static OT_ProcRet NS(MkLogFileC_HandleGet) (MkLogFileC_ARGS) {OT_ERROR_LNG_RETURN;}
171
173// MkLogFileC_Class_TCL_API
174
178
179// doc-key: MkLogFileC,MkLogFileC-Class-Introspection,oc_
180
182static OT_ProcRet NS(MkLogFileC_Next) (MkLogFileC_ARGS) {
186 MK_LFL retVal = MkLogFileNext (hdl);
187 OT_retObj_SET_LFL(retVal);
188 goto end;
189 error:
191 end:
193}
194
196static OT_ProcRet NS(MkLogFileC_Prev) (MkLogFileC_ARGS) {
200 MK_LFL retVal = MkLogFilePrev (hdl);
201 OT_retObj_SET_LFL(retVal);
202 goto end;
203 error:
205 end:
207}
208
209// doc-key: MkLogFileC,MkLogFileC-Class-Introspection,sc_
210
212static OT_ProcRet NS(MkLogFileC_Instances) (OtClass_ARGS) {
216 MK_LFL retVal = MkLogFileInstances ();
217 OT_retObj_SET_LFL(retVal);
218 goto end;
219 error:
221 end:
223}
224
226// MkLogFileC_Class_TCL_API
227
231
232// doc-key: MkLogFileC,MkLogFileC-Class-Misc,sc_
233
235static OT_ProcRet NS(MkLogFileC_GetNull) (OtClass_ARGS) {
239 MK_LFL retVal = MkLogFileGetNull ();
240 OT_retObj_SET_LFL(retVal);
241 goto end;
242 error:
244 end:
246}
247
249// MkLogFileC_Class_TCL_API
250
254
255// doc-key: MkLogFileC,MkLogFileC-TOR,sCo
256
258static OT_ProcRet NS(MkLogFileC_CTOR) (CONSTR_ARGS) {
261 MK_OBJN fmtobj = NULL;
263 MK_STRN file = 0;
265 MK_LFL lfh_out;
266 MkErrorC_Check(fmtobj,MkLogFileOpen (fmtobj, file, &lfh_out));
267 OT_CONSTRUCTOR_POST(lfh_out)
268 OT_retObj_CONSTR(lfh_out);
269 goto end;
270 error:
272 end:
274}
275
277static OT_ProcRet NS(MkLogFileC_Open) (OtClass_ARGS) {
280 MK_OBJN fmtobj = NULL;
282 MK_STRN file = 0;
285 MK_LFL lfh_out;
286 MkErrorC_Check(fmtobj,MkLogFileOpen (fmtobj, file, &lfh_out));
287 OT_CONSTRUCTOR_POST(lfh_out)
288 OT_retObj_SET_LFL(lfh_out);
289 goto end;
290 error:
292 end:
294}
295
297// MkLogFileC_TOR_TCL_API
298
302
303// doc-key: MkLogFileC,MkLogFileC-Write,om_
304
306static OT_ProcRet NS(MkLogFileC_WriteC) (MkLogFileC_ARGS) {
309 MK_STRN text = 0;
312 MkErrorC_Check(hdl,MkLogFileWriteC (hdl, text));
314 goto end;
315 error:
317 end:
319}
320
321// doc-key: MkLogFileC,MkLogFileC-Write,omo
322
324static OT_ProcRet NS(MkLogFileC_GetFile) (MkLogFileC_ARGS) {
328 MK_STRN file_out;
329 MkErrorC_Check(hdl,MkLogFileGetFile (hdl, &file_out));
330 OT_retObj_SET_STR(file_out);
331 goto end;
332 error:
334 end:
336}
337
339// MkLogFileC_Write_TCL_API
340
341// END-MkLogFileC - created by 'tcl_MqC.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
342
343// ---------------------------------------------------------------------------------------
344
345const static Tcl_MethodType NS(sOtClassDef)[] = {
346// BEGIN-CLASS - created by 'tcl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
347
348// doc-key: MkLogFileC,MkLogFile,sCo
349 {VER, "Open" , NS(MkLogFileC_Open) , NULL, NULL},
350
351// doc-key: MkLogFileC,MkLogFile,sc_
352 {VER, "GetNull" , NS(MkLogFileC_GetNull) , NULL, NULL},
353 {VER, "HandleResolve" , NS(MkLogFileC_HandleResolve) , NULL, NULL},
354 {VER, "Instances" , NS(MkLogFileC_Instances) , NULL, NULL},
355
356// END-CLASS - created by 'tcl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
357 {0, NULL, NULL, NULL}
358};
359
360// ---------------------------------------------------------------------------------------
361
362const static Tcl_MethodType NS(sInstanceDef)[] = {
363// BEGIN-OBJ - created by 'tcl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
364
365// doc-key: MkLogFileC,MkLogFile,oC_
366 {VER, "<constructor>" , NS(MkLogFileC_CTOR) , NULL, NULL},
367
368// doc-key: MkLogFileC,MkLogFile,oc_
369 {VER, "Next" , NS(MkLogFileC_Next) , NULL, NULL},
370 {VER, "Prev" , NS(MkLogFileC_Prev) , NULL, NULL},
371
372// doc-key: MkLogFileC,MkLogFile,om_
373 // skip class-overload: MkLogFileHandleGet → HandleGet, NS(MkLogFileC_HandleGet)
374 {VER, "WriteC" , NS(MkLogFileC_WriteC) , NULL, NULL},
375
376// doc-key: MkLogFileC,MkLogFile,omo
377 {VER, "GetFile" , NS(MkLogFileC_GetFile) , NULL, NULL},
378
379// END-OBJ - created by 'tcl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
380 {0, NULL, NULL, NULL, NULL}
381};
382
388
389int NS(pMkLogFileC_Init) ( MK_RT_ARGS OT_ENV_T interp, OT_NS_T ns)
390{
392
393 return TCL_OK;
394error:
395 return TCL_ERROR;
396}
tag: nhi1-release-250425
#define OtClass_ARGS
#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)
#define OT_retObj_SET_LFL(nat)
Tcl_Class OT_CLS_T
#define OT_ERROR_LNG_RETURN
Tcl_Namespace * OT_NS_T
#define OT_retObj_SET_Error
#define OT_CONSTRUCTOR_POST(x)
#define MkLogFileC_ARGS
#define OT_CHECK_REQUIRED(val)
#define OT_retObj_SET_None
#define NS(n)
#define OT_SETUP_CONSTRUCTOR_ARGS(...)
#define OT_retObj_RETURN
#define OT_retObj_SET_STR(nat)
Tcl_Object OT_SELF_T
#define OT_CHECK_OPTIONAL(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
#define OT_CHECK_STRN(val)
#define Instances_doc
#define OT_SETUP_hdl_static_constr
#define OT_SETUP_hdl
#define GetFile_doc
#define GetNull_doc
#define WriteC_doc
#define Next_doc
#define HandleResolve_doc
#define Prev_doc
#define VER
#define OT_CLASS
#define OT_SETUP_hdl_static
#define OT_SETUP_hdl_constr
static __thread MK_TYP MkLogFileCTT
#define OT_SETUP_hdl__null_allow
#define CTOR_doc
#define ClassInit
#define Open_doc
#define MK_NULL_YES
flag, allow NULL
#define MK_UNUSED
mark unnused variables and functions
#define MK_DEPRECATED
MK_PTRB * MK_PTR
generic pointer data-type
const MK_STRB * MK_STRN
constant string pointer data-type
int32_t MK_HDL
4 byte int handle data-type
#define MkLogFileHandleResolve(...)
static MK_LFL MkLogFilePrev(MK_LFL const lfl)
get previous instance from linked-list of MkLogFileS type
#define MkLogFileInstances()
static MK_LFL MkLogFileNext(MK_LFL const lfl)
get next instance from linked-list of MkLogFileS type
static MK_LFL MkLogFileGetNull(void)
Null-Slot - return a MkLogFileC typed NULL instance …
#define MkLogFileOpen(...)
#define MkLogFileGetFile(...)
#define MkLogFileWriteC(...)
#define MkThreadLocal
#define MK_RT_CALL
#define MK_RT_ARGS
#define OT_CHECK_OBJN(val, nullB)
define a MkLogFileC object …
object header …
MkTypeS - class known as typ or type is used as class-base for a Managed-Object-Technology (MOT) type...