theKernel 10.0
Loading...
Searching...
No Matches
MkLogFileC_atl.c
Go to the documentation of this file.
1
9/* LABEL-START */
10
11#define META_FILE_NAME "MkLogFileC_atl.c"
12
14
15#define OT_CLASS amkrt->AtlMkLogFileC
16#define OT_NULL amkrt->AtlMkLogFileC_MK_NULL
17#define OT_CLASS_NAME "MkLogFileC"
18
19#define SELF2HDL(O) MkLfl(VAL2MNG(O))
20
21// LNG: class
22// -> moved to LibMkKernel_atl.h → OT_MK_RT_S → AtlMkKernelCTT;
23
24// META: ObjNew feature: called to return a new or an already existing ATL-SELF-Object
25// -> moved to LibMkKernel_atl.h → MkKernelC_ObjNew
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 SETUP_amkrt(env);
30 return AtomMake(obj,OT_CLASS,NULL,NULL,env);
31}
32
33// META: called if MkObj must be destroyed and if the SELF is still alive → goal: destroy the SELF
34static void NS(MkLogFileC_selfDelete) (MK_RT_ARGS MK_PTR selfP, MK_PTR const env) {
35 OT_SELF_T selfO = selfP;
36 SETUP_amkrt(env);
37 MK(AtomDeleteHard) (OT_MK_CALL selfO);
38}
39
40// META: called to destroy link from SELF to META
41static void NS(MkLogFileC_selfUnlink) (MK_RT_ARGS MK_PTR selfP, MK_PTR const env) {
42 OT_SELF_T selfO = selfP;
43 SETUP_amkrt(env);
44 return MK(AtomUnlink) (OT_MK_CALL selfO);
45}
46
47#define OT_SETUP_hdl SetupHdlFromMetaData_2(MK_LFL)
48#define OT_SETUP_hdl__null_allow SetupHdlFromMetaData__null_allow_2(MK_LFL)
49#define OT_SETUP_hdl_destr SetupHdlFromMetaData__null_allow_2(MK_LFL)
50#define OT_SETUP_hdl_constr SetupHdlConstr(MkLogFileC)
51#define OT_SETUP_hdl_static_constr OT_SETUP_hdl_static
52#define OT_SETUP_hdl_static SetupHdlStatic(MkLogFileC)
53
54#define OT_retObj_CONSTR(x) OT_retObj_SET(AtomInit(OT_SELF,MkLogFileC_X2obj(x),amkrt))
55
56// initialize the ATL and META class specific object
57#define ClassInit \
58 /* if not already done, initialize NEW META type */ \
59 if (MkLogFileCTT == NULL) MkLogFileCTT = MkLogFileSTT; \
60 \
61 /* protect against double call */ \
62 if (MkLogFileCTT->selfCreate == NS(MkLogFileC_selfCreate)) return MK_OK; \
63 \
64 /* add "selfCreate" and "selfDelete" feature to the META-Class */ \
65 MkLogFileCTT->selfCreate = NS(MkLogFileC_selfCreate); \
66 MkLogFileCTT->selfDelete = NS(MkLogFileC_selfDelete); \
67 MkLogFileCTT->selfUnlink = NS(MkLogFileC_selfUnlink); \
68 \
69 /* create the ATL-class */ \
70 OT_CLASS = AltClassDef(MkLogFileCTT,&amkrt->AtlMkLogFileC_NS); \
71 if (OT_CLASS == NULL) goto error; \
72 OT_REF_INCR(OT_CLASS); \
73 \
74 /* create the ATL static Methods */ \
75 check_LNG(AtlUnknownSetup (NS(sOtClassDef),amkrt)) goto error; \
76 \
77 /* create the ATL instance Methods */ \
78 check_LNG(AtlUnknownSetup (NS(sInstanceDef),amkrt)) goto error; \
79 \
80 /* after class was modified, recompile the class */ \
81 RL_init(2, recompile, RL_T(0,RecompileN)); RL_O(1,OT_CLASS) ; \
82 int retI = RL_EvalEx(0); \
83 if (retI != TCL_OK) return retI; \
84 \
85 /* define the "NULL" object */ \
86 OT_NULL = AtomCreateNULL(OT_CLASS, "::MkLogFileC::MK_NULL", (MK_PTR)amkrt); \
87 if (OT_NULL == NULL) goto error; \
88 OT_REF_INCR(OT_NULL);
89/* LABEL-END */
90
91// BEGIN-DOC - created by 'atl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
92
93// doc-key: MkLogFileC,MkLogFile,sCo,func
94#define CTOR_doc "MkLogFileC [MkLogFileC::CTOR fmtobj:MkObjectC file:string]"
95#define Open_doc "MkLogFileC [MkLogFileC::Open fmtobj:MkObjectC file:string]"
96
97// doc-key: MkLogFileC,MkLogFile,sc_,func
98#define GetNull_doc "MkLogFileC [MkLogFileC::GetNull]"
99#define HandleResolve_doc "MkLogFileC [MkLogFileC::HandleResolve netHdl:MK_HDL]"
100#define Instances_doc "MkLogFileC [MkLogFileC::Instances]"
101
102// doc-key: MkLogFileC,MkLogFile,oc_,func
103#define Next_doc "MkLogFileC [MkLogFileC::Next $lfl]"
104#define Prev_doc "MkLogFileC [MkLogFileC::Prev $lfl]"
105
106// doc-key: MkLogFileC,MkLogFile,om_,func
107// skip class-overload: HandleGet → MkObjectHandleGet
108#define WriteC_doc "MkLogFileC::WriteC $lfl text:string (const)"
109
110// doc-key: MkLogFileC,MkLogFile,omo,func
111#define GetFile_doc "string [MkLogFileC::GetFile $lfl] (const)"
112
113// END-DOC - created by 'atl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
114
115/*****************************************************************************/
116/* */
117/* O B J E C T */
118/* */
119/*****************************************************************************/
120
121// BEGIN-MkLogFileC - created by 'atl_MqC.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
122
126
127// doc-key: MkLogFileC,MkLogFileC-Class-Export,sc_
128
130static OT_ProcRet NS(MkLogFileC_HandleResolve) (OtClass_ARGS) {
133 MK_HDL netHdl = 0;
136 MK_LFL retVal = MkLogFileHandleResolve (netHdl);
137 OT_retObj_SET_LFL(retVal);
138 goto end;
139 error:
141 end:
143}
144
145// doc-key: MkLogFileC,MkLogFileC-Class-Export,om_
146
147// skip on class-overload: MkLogFileHandleGet → MkObjectHandleGet
149static OT_ProcRet NS(MkLogFileC_HandleGet) (MkLogFileC_ARGS) {OT_ERROR_LNG_RETURN;}
150
152// MkLogFileC_Class_ATL_API
153
157
158// doc-key: MkLogFileC,MkLogFileC-Class-Introspection,oc_
159
161static OT_ProcRet NS(MkLogFileC_Next) (MkLogFileC_ARGS) {
165 MK_LFL retVal = MkLogFileNext (hdl);
166 OT_retObj_SET_LFL(retVal);
167 goto end;
168 error:
170 end:
172}
173
175static OT_ProcRet NS(MkLogFileC_Prev) (MkLogFileC_ARGS) {
179 MK_LFL retVal = MkLogFilePrev (hdl);
180 OT_retObj_SET_LFL(retVal);
181 goto end;
182 error:
184 end:
186}
187
188// doc-key: MkLogFileC,MkLogFileC-Class-Introspection,sc_
189
191static OT_ProcRet NS(MkLogFileC_Instances) (OtClass_ARGS) {
195 MK_LFL retVal = MkLogFileInstances ();
196 OT_retObj_SET_LFL(retVal);
197 goto end;
198 error:
200 end:
202}
203
205// MkLogFileC_Class_ATL_API
206
210
211// doc-key: MkLogFileC,MkLogFileC-Class-Misc,sc_
212
214static OT_ProcRet NS(MkLogFileC_GetNull) (OtClass_ARGS) {
218 MK_LFL retVal = MkLogFileGetNull ();
219 OT_retObj_SET_LFL(retVal);
220 goto end;
221 error:
223 end:
225}
226
228// MkLogFileC_Class_ATL_API
229
233
234// doc-key: MkLogFileC,MkLogFileC-TOR,sCo
235
237static OT_ProcRet NS(MkLogFileC_CTOR) (CONSTR_ARGS) {
240 MK_OBJN fmtobj = NULL;
242 MK_STRN file = 0;
244 MK_LFL lfh_out;
245 MkErrorC_Check(fmtobj,MkLogFileOpen (fmtobj, file, &lfh_out));
246 OT_CONSTRUCTOR_POST(lfh_out)
247 OT_retObj_CONSTR(lfh_out);
248 goto end;
249 error:
251 end:
253}
254
256static OT_ProcRet NS(MkLogFileC_Open) (OtClass_ARGS) {
259 MK_OBJN fmtobj = NULL;
261 MK_STRN file = 0;
264 MK_LFL lfh_out;
265 MkErrorC_Check(fmtobj,MkLogFileOpen (fmtobj, file, &lfh_out));
266 OT_CONSTRUCTOR_POST(lfh_out)
267 OT_retObj_SET_LFL(lfh_out);
268 goto end;
269 error:
271 end:
273}
274
276// MkLogFileC_TOR_ATL_API
277
281
282// doc-key: MkLogFileC,MkLogFileC-Write,om_
283
285static OT_ProcRet NS(MkLogFileC_WriteC) (MkLogFileC_ARGS) {
288 MK_STRN text = 0;
291 MkErrorC_Check(hdl,MkLogFileWriteC (hdl, text));
293 goto end;
294 error:
296 end:
298}
299
300// doc-key: MkLogFileC,MkLogFileC-Write,omo
301
303static OT_ProcRet NS(MkLogFileC_GetFile) (MkLogFileC_ARGS) {
307 MK_STRN file_out;
308 MkErrorC_Check(hdl,MkLogFileGetFile (hdl, &file_out));
309 OT_retObj_SET_STR(file_out);
310 goto end;
311 error:
313 end:
315}
316
318// MkLogFileC_Write_ATL_API
319
320// END-MkLogFileC - created by 'atl_MqC.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
321
322// ---------------------------------------------------------------------------------------
323
324static const OtObjProcDefS NS(sOtClassDef)[] = {
325 // BEGIN-CLASS - created by 'atl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
326
327 // doc-key: MkLogFileC,MkLogFile,sCo
328 { "::MkLogFileC::Open" , NS(MkLogFileC_Open) },
329
330 // doc-key: MkLogFileC,MkLogFile,sc_
331 { "::MkLogFileC::GetNull" , NS(MkLogFileC_GetNull) },
332 { "::MkLogFileC::HandleResolve" , NS(MkLogFileC_HandleResolve) },
333 { "::MkLogFileC::Instances" , NS(MkLogFileC_Instances) },
334
335 // END-CLASS - created by 'atl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
336 { NULL }
337};
338
339// ---------------------------------------------------------------------------------------
340
341static const OtObjProcDefS NS(sInstanceDef)[] = {
342 // BEGIN-OBJ - created by 'atl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
343
344 // doc-key: MkLogFileC,MkLogFile,oC_
345 { "::MkLogFileC::MkLogFileC" , NS(MkLogFileC_CTOR) },
346
347 // doc-key: MkLogFileC,MkLogFile,oc_
348 { "::MkLogFileC::Next" , NS(MkLogFileC_Next) },
349 { "::MkLogFileC::Prev" , NS(MkLogFileC_Prev) },
350
351 // doc-key: MkLogFileC,MkLogFile,om_
352 // skip class-overload: HandleGet → MkObjectHandleGet
353 { "::MkLogFileC::WriteC" , NS(MkLogFileC_WriteC) },
354
355 // doc-key: MkLogFileC,MkLogFile,omo
356 { "::MkLogFileC::GetFile" , NS(MkLogFileC_GetFile) },
357
358 // END-OBJ - created by 'atl_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
359 { NULL }
360};
361
367
368int NS(pMkLogFileC_Init) ( OT_MK_ARGS OT_NS_T ns)
369{
371
372 return TCL_OK;
373error:
374 return TCL_ERROR;
375}
#define OtClass_ARGS
#define MK(n)
#define AtomMake(...)
#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)
#define OT_ERROR_LNG_RETURN
MOX_NS_T 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
MOX_OBJ_T OT_SELF_T
#define NS(n)
#define OT_SETUP_CONSTRUCTOR_ARGS(...)
#define OT_retObj_RETURN
#define OT_MK_CALL
#define OT_MK_ARGS
#define OT_retObj_SET_STR(nat)
#define SETUP_amkrt(r)
#define OT_CHECK_OPTIONAL(val)
#define OT_CHECK_NOARGS
#define MkErrorC_Check(mng, PROC)
#define OT_ProcRet
#define CONSTR_ARGS
#define OT_CHECK_STRN(val)
tag: nhi1-release-250425
#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 OT_CLASS
#define OT_SETUP_hdl_static
#define OT_SETUP_hdl_constr
#define OT_SETUP_hdl__null_allow
#define OT_retObj_CONSTR(x)
#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 MK_RT_ARGS
#define OT_CHECK_OBJN(val, nullB)
define a MkLogFileC object …
object header …