theKernel 10.0
Loading...
Searching...
No Matches
MkLogFileC_rb.c
Go to the documentation of this file.
1
9/* LABEL-START */
10#define META_FILE_NAME "MkLogFileC_rb.c"
11
13
14#define OT_CLASS NS(MkLogFileC)
15#define OT_CLASS_NAME "MkLogFileC"
16
17#define OT_LNG2META(O) MkLfl(VAL2MNG(O))
18
20
21// new Class type object
22static MK_TYP MkLogFileCTT = NULL;
24
25// GS marker in "Data_Wrap_Struct"
26static void NS(sMark) (MK_PTR);
27
28// ruby datatype of the wrapped struct
29static rb_data_type_t NS(MkLogFileC_T) = {
30 "MkLogFileC",
31 {
32 NS(sMark),
33 MK(AtomDeleteSoft),
34 0, /* dsize */
35 0, /* reserved[1] */
36 },
37 NULL, /* parent */
38 NULL, /* data */
39 RUBY_TYPED_FREE_IMMEDIATELY
40};
41
42// >>THIS<< is a Phase-1-CONSTRUCTOR: a constructor which create the SELF object
43// A Phase-2-CONSTRUCTOR is a constructor which configure an already existing object
44// DO: create a new SELF and link this SELF with the MQ-Object "mng"
45// clazz is the toplevel "subclass" or "MkLogFileC"
46mk_inline OT_OBJ_T NS(LNG_CONSTR) (OT_CLS_T clazz, MK_MNG mng, int objc, VALUE* objv) {
47 return MK(AtomObjCrt)(clazz,&NS(MkLogFileC_T),mng,objc,objv);
48}
49// MQ: ObjNew feature: called to return a new or an already existing RUBY-SELF-Object
50// -> moved to: msgque_rb.h
51// OT_OBJ_T NS(MkLogFileC_ObjNew) (MK_LFL hdl) {
52// return MK(AtomObjNew) (MkLogFileC_X2obj(hdl));
53// }
54// MQ: ObjNew feature: selfCreate will be called from "ObjNew->MkSelfNew" if MkObj need a SELF pointer
55static MK_PTR NS(MkLogFileC_selfCreate) (MK_RT_ARGS MK_OBJ obj, MK_PTR envP) {
56 OT_OBJ_T self = NS(LNG_CONSTR) (OT_CLASS, obj, 0, NULL);
57 return VAL2PTR(self);
58}
59// MQ: called on instance-destruction for a "selfCreate" instance → goal: destroy the SELF
60static void NS(MkLogFileC_selfDelete) (MK_RT_ARGS MK_PTR ptr, MK_PTR envP) {
62}
63// MQ: called to destroy link from SELF to META
64static void NS(MkLogFileC_selfUnlink) (MK_RT_ARGS MK_PTR ptr, MK_PTR envP) {
65 OT_OBJ_T self = PTR2VAL(ptr);
66 RDATA(self)->data = NULL;
67}
68// initialize the RUBY and MO class specific object
69#define S_INIT NS(sInit)(MK_RT_CALL_ONLY)
70static void NS(sInit)(MK_RT_ARGS_ONLY) {
71
72 // add "selfCreate" and "selfDelete" feature to the MQ-MkLogFileC-Type
73 MkLogFileCTT->selfCreate = NS(MkLogFileC_selfCreate);
74 MkLogFileCTT->selfDelete = NS(MkLogFileC_selfDelete);
75 MkLogFileCTT->selfUnlink = NS(MkLogFileC_selfUnlink);
76
77 // create the RUBY class
78 OT_CLASS = rb_define_class_under(OT_PKG, "MkLogFileC", MK_BASE_CLASS);
79 rb_undef_alloc_func(OT_CLASS);
80
81 /* define the "NULL" object */
82 VALUE nullO = TypedData_Wrap_Struct (OT_CLASS, &NS(MkLogFileC_T), MK_NULL);
83 NS(MkLogFileC_MK_NULL) = nullO;
85}
86
87#define OT_SETUP_hdl OT_SETUP_hdl_tmpl(MkLogFileC);
88#define OT_SETUP_hdl__null_allow OT_SETUP_hdl_tmpl__null_allow(MkLogFileC);
89#define OT_SETUP_hdl_constr AllRtSetup_NULL; \
90 OT_OBJ_T clazz = self; \
91 MkLogFileC_type hdl = (MkLogFileC_type) &MkERROR;
92#define OT_SETUP_hdl_destr OT_SETUP_hdl_tmpl__null_allow(MkLogFileC);
93#define OT_SETUP_hdl_static AllRtSetup_NULL; \
94 __attribute__((unused)) MK_TYP hdl = MkLogFileC##_TT;
95#define OT_SETUP_hdl_static_constr OT_SETUP_hdl_static
96
97#if !defined(SetupRtFromObj_X)
98 #define SetupRtFromObj_X(hdl) AllRtSetup_X(hdl)
99 #define SetupRtFromObj_XN(hdl) AllRtSetup_XN(hdl)
100#endif
101
102/* LABEL-END */
103
104// BEGIN-DOC - created by 'rb_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
105
106// doc-key: MkLogFileC,MkLogFile,sCo,func
107#define Open_doc "MkLogFileC MkLogFileC.Open(fmtobj:MkObjectC, file:string)"
108#define new_doc "MkLogFileC MkLogFileC.new(fmtobj:MkObjectC, file:string)"
109
110// doc-key: MkLogFileC,MkLogFile,sc_,func
111#define GetNull_doc "MkLogFileC MkLogFileC.GetNull()"
112#define HandleResolve_doc "MkLogFileC MkLogFileC.HandleResolve(netHdl:MK_HDL)"
113#define Instances_doc "MkLogFileC MkLogFileC.Instances()"
114
115// doc-key: MkLogFileC,MkLogFile,oc_,func
116#define Next_doc "MkLogFileC lfl.Next()"
117#define Prev_doc "MkLogFileC lfl.Prev()"
118
119// doc-key: MkLogFileC,MkLogFile,om_,func
120// skip class-overload: HandleGet → MkObjectHandleGet
121#define WriteC_doc "lfl.WriteC(text:string) (const)"
122
123// doc-key: MkLogFileC,MkLogFile,omo,func
124#define GetFile_doc "string lfl.GetFile() (const)"
125
126// END-DOC - created by 'rb_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
127
128// ---------------------------------------------------------------------------------------
129
135
136// BEGIN-MkLogFileC - created by 'rb_MqC.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
137
141
142// doc-key: MkLogFileC,MkLogFileC-Class-Export,sc_
143
145static OT_ProcRet NS(MkLogFileC_HandleResolve) (OtClass_ARGS) {
148 MK_HDL netHdl = 0;
151 MK_LFL retVal = MkLogFileHandleResolve (netHdl);
152 OT_retObj_SET_LFL(retVal);
153 end: MK_UNUSED /* LONG JUMP on error */
155}
156
157// doc-key: MkLogFileC,MkLogFileC-Class-Export,om_
158
159// skip on class-overload: MkLogFileHandleGet → MkObjectHandleGet
161static OT_ProcRet NS(MkLogFileC_HandleGet) (MkLogFileC_ARGS) {OT_ERROR_LNG_RETURN;}
162
164// MkLogFileC_Class_RB_API
165
169
170// doc-key: MkLogFileC,MkLogFileC-Class-Introspection,oc_
171
173static OT_ProcRet NS(MkLogFileC_Next) (MkLogFileC_ARGS) {
177 MK_LFL retVal = MkLogFileNext (hdl);
178 OT_retObj_SET_LFL(retVal);
179 end: MK_UNUSED /* LONG JUMP on error */
181}
182
184static OT_ProcRet NS(MkLogFileC_Prev) (MkLogFileC_ARGS) {
188 MK_LFL retVal = MkLogFilePrev (hdl);
189 OT_retObj_SET_LFL(retVal);
190 end: MK_UNUSED /* LONG JUMP on error */
192}
193
194// doc-key: MkLogFileC,MkLogFileC-Class-Introspection,sc_
195
197static OT_ProcRet NS(MkLogFileC_Instances) (OtClass_ARGS) {
201 MK_LFL retVal = MkLogFileInstances ();
202 OT_retObj_SET_LFL(retVal);
203 end: MK_UNUSED /* LONG JUMP on error */
205}
206
208// MkLogFileC_Class_RB_API
209
213
214// doc-key: MkLogFileC,MkLogFileC-Class-Misc,sc_
215
217static OT_ProcRet NS(MkLogFileC_GetNull) (OtClass_ARGS) {
221 MK_LFL retVal = MkLogFileGetNull ();
222 OT_retObj_SET_LFL(retVal);
223 end: MK_UNUSED /* LONG JUMP on error */
225}
226
228// MkLogFileC_Class_RB_API
229
233
234// doc-key: MkLogFileC,MkLogFileC-TOR,sCo
235
237static OT_ProcRet NS(MkLogFileC_Open) (OtClass_ARGS) {
240 MK_OBJN fmtobj = NULL;
242 MK_STRN file = 0;
245 MK_LFL lfh_out;
246 MkErrorC_Check(fmtobj,MkLogFileOpen (fmtobj, file, &lfh_out));
247 OT_CONSTRUCTOR_POST(lfh_out)
248 OT_retObj_SET_LFL(lfh_out);
249 end: MK_UNUSED /* LONG JUMP on error */
251}
252
254static OT_ProcRet NS(MkLogFileC_new) (CONSTR_ARGS) {
257 MK_OBJN fmtobj = NULL;
259 MK_STRN file = 0;
261 MK_LFL lfh_out;
262 MkErrorC_Check(fmtobj,MkLogFileOpen (fmtobj, file, &lfh_out));
263 OT_CONSTRUCTOR_POST(lfh_out)
264 OT_retObj_CONSTR(lfh_out);
265 end: MK_UNUSED /* LONG JUMP on error */
267}
268
270// MkLogFileC_TOR_RB_API
271
275
276// doc-key: MkLogFileC,MkLogFileC-Write,om_
277
279static OT_ProcRet NS(MkLogFileC_WriteC) (MkLogFileC_ARGS) {
282 MK_STRN text = 0;
285 MkErrorC_Check(hdl,MkLogFileWriteC (hdl, text));
287 end: MK_UNUSED /* LONG JUMP on error */
289}
290
291// doc-key: MkLogFileC,MkLogFileC-Write,omo
292
294static OT_ProcRet NS(MkLogFileC_GetFile) (MkLogFileC_ARGS) {
298 MK_STRN file_out;
299 MkErrorC_Check(hdl,MkLogFileGetFile (hdl, &file_out));
300 OT_retObj_SET_STR(file_out);
301 end: MK_UNUSED /* LONG JUMP on error */
303}
304
306// MkLogFileC_Write_RB_API
307
308// END-MkLogFileC - created by 'rb_MqC.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
309
310/*****************************************************************************/
311/* */
312/* public */
313/* */
314/*****************************************************************************/
315
316static void NS(sMark) (MK_PTR mng )
317{
318
319}
320
321void MK(MkLogFileC_Init) (MK_RT_ARGS_ONLY) {
322
323 // init type
325 S_INIT;
326
327// BEGIN-CLASS - created by 'rb_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
328
329// doc-key: MkLogFileC,MkLogFile,sCo
330OT_METH_S ( MkLogFileC, Open, MkLogFileC_Open )
331OT_METH_C ( MkLogFileC, new, MkLogFileC_new )
332
333// doc-key: MkLogFileC,MkLogFile,sc_
334OT_METH_O ( MkLogFileC, GetNull, MkLogFileC_GetNull )
335OT_METH_S ( MkLogFileC, GetNull, MkLogFileC_GetNull )
336OT_METH_O ( MkLogFileC, HandleResolve, MkLogFileC_HandleResolve )
337OT_METH_S ( MkLogFileC, HandleResolve, MkLogFileC_HandleResolve )
338OT_METH_O ( MkLogFileC, Instances, MkLogFileC_Instances )
339OT_METH_S ( MkLogFileC, Instances, MkLogFileC_Instances )
340
341// END-CLASS - created by 'rb_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
342
343// BEGIN-OBJ - created by 'rb_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
344
345// doc-key: MkLogFileC,MkLogFile,oc_
346OT_METH_O ( MkLogFileC, Next, MkLogFileC_Next )
347OT_METH_O ( MkLogFileC, Prev, MkLogFileC_Prev )
348
349// doc-key: MkLogFileC,MkLogFile,om_
350// skip class-overload: MkLogFileHandleGet → HandleGet, MkLogFileC_HandleGet
351OT_METH_O ( MkLogFileC, WriteC, MkLogFileC_WriteC )
352
353// doc-key: MkLogFileC,MkLogFile,omo
354OT_METH_O ( MkLogFileC, GetFile, MkLogFileC_GetFile )
355
356// END-OBJ - created by 'rb_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
357
358}
tag: nhi1-release-250425
#define MK(n)
#define OT_SETUP_VARARGS(min, max, d)
#define OT_SETUP_NOARG(d)
#define OT_SETUP_ONEARG(d)
#define OT_retObj_SET_LFL(nat)
#define OT_ERROR_LNG_RETURN
#define PTR2VAL(nat)
#define OT_PKG
#define OT_CONSTRUCTOR_POST(x)
#define OT_METH_S(c, s, f)
#define MkLogFileC_MK_NULL
#define MK_BASE_CLASS
#define OT_CLS_T
#define MkLogFileC_ARGS
#define OT_retObj_CONSTR(mng)
#define OT_CHECK_REQUIRED(val)
#define OT_retObj_SET_None
#define OT_METH_O(c, s, f)
#define OT_SETUP_CONSTRUCTOR_ARGS(min, max, d)
#define INCR_REF(valP)
#define OT_OBJ_T
#define NS(n)
#define OT_retObj_RETURN
#define OT_OBJECT_DELETE_HARD(obj)
#define OT_retObj_SET_STR(nat)
#define OT_CHECK_OPTIONAL(val)
#define VAL2PTR(val)
#define OT_CHECK_NOARGS
#define MkErrorC_Check(mng, PROC)
#define OT_ProcRet
#define OT_METH_C(c, s, f)
#define CONSTR_ARGS
#define OtClass_ARGS
#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 OT_CLASS
#define OT_SETUP_hdl_static
static MK_TYP MkLogFileCTT
#define OT_SETUP_hdl_constr
#define OT_SETUP_hdl__null_allow
#define new_doc
#define S_INIT
#define Open_doc
#define mk_inline
#define MK_NULL_YES
flag, allow NULL
#define MK_UNUSED
mark unnused variables and functions
#define MK_NULL
The Programming-Language-Micro-Kernel (PLMK) NULL value as nil in Ruby …
#define MK_DEPRECATED
MK_PTRB * MK_PTR
generic pointer data-type
const MK_STRB * MK_STRN
constant string pointer data-type
MK_PTRB * MK_MNG
managed object pointer, datatype will be checked at runtime
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 MkLogFileC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MkLogFileC_T
class as MkTypeDefS-class-type, useable in a class-macro as: class##_T …
#define MkLogFileOpen(...)
#define MkLogFileGetFile(...)
#define MkLogFileWriteC(...)
#define MK_RT_ARGS
#define MK_RT_ARGS_ONLY
#define OT_CHECK_NIH(val)
#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...
MkSelfUnlinkF selfUnlink
"unlink" the "self" pointer from META-Kernel
MkSelfDeleteF selfDelete
"delete" the "self" pointer
MkSelfCreateF selfCreate
"create" the "self" pointer