theKernel 10.0
Loading...
Searching...
No Matches
MkLogFileC.cs
Go to the documentation of this file.
1
9/* LABEL-START */
10
11using System;
12using System.Reflection;
13using System.Runtime.InteropServices;
14using System.Runtime.CompilerServices;
15using System.Collections.Generic;
16using System.Threading;
17
18namespace csmkkernel {
19
23#if META_IS_OBJECT
24 public partial class MkLogFileC
25#else
26 public partial class MkLogFileC : MkObjectC
27#endif
28 {
29 private readonly static ConstructorInfo ctor = getCtor(typeof(MkLogFileC));
30 private readonly static ThreadLocal<MkLogFileC> MK_NULL = new ThreadLocal<MkLogFileC>(() => {
31 return (MkLogFileC) atomSelfNull(ctor);
32 });
33
34 public static MkLogFileC MkLogFileC_ObjNew (IntPtr hdl) {
35 return hdl != IntPtr.Zero ? (MkLogFileC) atomObjNew(typeof(MkLogFileC), ctor, hdl) : MK_NULL.Value;
36 }
37
38 private static MkLogFileC MkLogFileC_ObjCreate (IntPtr hdl) {
39 return hdl != IntPtr.Zero ? (MkLogFileC) atomObjCreate(typeof(MkLogFileC), ctor, hdl) : MK_NULL.Value;
40 }
41
42 private static IntPtr MkLogFileC_SelfCreate (IntPtr mkrt, IntPtr obj, IntPtr env) {
43 return atomSelfCreate(ctor, obj, env);
44 }
45
46 private static void MkLogFileC_SelfUnlink (IntPtr mkrt, IntPtr self, IntPtr env) {
47 atomSelfUnlink(self, env);
48 }
49
50 internal static void SetupThreadLFL (IntPtr mkrt) {
51 Mk.MkCsTypeUpdate(mkrt, MkCsTypeLookupE.LFL, MkLogFileC_SelfCreate, MkLogFileC_SelfUnlink);
52 }
53
54 #if !META_STATIC_OVERWRITE
55
56 static MkLogFileC() {
57 // M0("MkLogFileC");
58 MkKernel.Setup();
59 SetupThreadLFL(IntPtr.Zero);
60 }
61
62 #endif
63/* LABEL-END */
64
65 internal MkLogFileC (IntPtr hdlP) : base(hdlP) {
66 }
67
68 } // END - class "MkLogFileC"
69
70 // BEGIN-MkLogFileC - created by 'cs_MqC.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
71
72 public partial class MkLogFileC {
73
77
78 // doc-key: MkLogFileC,MkLogFileC-Class-Export,sc_
79
81 new public static MkLogFileC HandleResolve (Int32 netHdl) {
82 IntPtr __retVal__L = Mk.MkLogFileHandleResolve(IntPtr.Zero, netHdl);
83 return MkLogFileC.MkLogFileC_ObjNew(__retVal__L);
84 }
85
86 // doc-key: MkLogFileC,MkLogFileC-Class-Export,om_
87
88 // skip class-overload: HandleGet = MkLogFileHandleGet → MkObjectHandleGet
89
91 // MkLogFileC_Class_CS_API
92 }
93
94 public partial class MkLogFileC {
95
99
100 // doc-key: MkLogFileC,MkLogFileC-Class-Introspection,oc_
101
103 new public MkLogFileC Next () {
104 IntPtr __retVal__L = Mk.MkLogFileNext(hdl);
105 return MkLogFileC.MkLogFileC_ObjNew(__retVal__L);
106 }
107
109 new public MkLogFileC Prev () {
110 IntPtr __retVal__L = Mk.MkLogFilePrev(hdl);
111 return MkLogFileC.MkLogFileC_ObjNew(__retVal__L);
112 }
113
114 // doc-key: MkLogFileC,MkLogFileC-Class-Introspection,sc_
115
117 new public static MkLogFileC Instances () {
118 IntPtr __retVal__L = Mk.MkLogFileInstances(IntPtr.Zero);
119 return MkLogFileC.MkLogFileC_ObjNew(__retVal__L);
120 }
121
123 // MkLogFileC_Class_CS_API
124 }
125
126 public partial class MkLogFileC {
127
131
132 // doc-key: MkLogFileC,MkLogFileC-Class-Misc,sc_
133
135 new public static MkLogFileC GetNull () {
136 IntPtr __retVal__L = Mk.MkLogFileGetNull();
137 return MkLogFileC.MkLogFileC_ObjNew(__retVal__L);
138 }
139
141 // MkLogFileC_Class_CS_API
142 }
143
144 public partial class MkLogFileC {
145
149
150 // doc-key: MkLogFileC,MkLogFileC-TOR,sCo
151
153 protected static IntPtr CTOR (MkObjectC fmtobj, string file) {
154 IntPtr lfh_out;
155 IntPtr fmtobj_hdl = MkObjectC.getOBJ_null_allow(fmtobj);
156 IntPtr file_cstr = Marshal.StringToHGlobalAnsi(file);
157 MkErrorE errVal = Mk.MkLogFileOpen(IntPtr.Zero, fmtobj_hdl, file_cstr, out lfh_out);
158 Marshal.FreeHGlobal(file_cstr);
159 if (errVal > MkErrorE.CONTINUE) MkErrorC.Check(errVal);
160 return (IntPtr)lfh_out;
161 }
162
164 public MkLogFileC(MkObjectC fmtobj, string file) : this(CTOR(fmtobj, file)) {}
165
167 public static MkLogFileC Open (MkObjectC fmtobj, string file) {
168 IntPtr lfh_out;
169 IntPtr fmtobj_hdl = MkObjectC.getOBJ_null_allow(fmtobj);
170 IntPtr file_cstr = Marshal.StringToHGlobalAnsi(file);
171 MkErrorE errVal = Mk.MkLogFileOpen(IntPtr.Zero, fmtobj_hdl, file_cstr, out lfh_out);
172 Marshal.FreeHGlobal(file_cstr);
173 if (errVal > MkErrorE.CONTINUE) MkErrorC.Check(errVal);
174 return MkLogFileC.MkLogFileC_ObjCreate(lfh_out);
175 }
176
178 // MkLogFileC_TOR_CS_API
179 }
180
181 public partial class MkLogFileC {
182
186
187 // doc-key: MkLogFileC,MkLogFileC-Write,om_
188
190 public void WriteC (string text) {
191 IntPtr text_cstr = Marshal.StringToHGlobalAnsi(text);
192 MkErrorE errVal = Mk.MkLogFileWriteC(mkrt, hdl_null_allow, text_cstr);
193 Marshal.FreeHGlobal(text_cstr);
195 }
196
197 // doc-key: MkLogFileC,MkLogFileC-Write,omo
198
200 public string GetFile () {
201 IntPtr file_out;
202 MkErrorE errVal = Mk.MkLogFileGetFile(mkrt, hdl, out file_out);
203 MkErrorC.Check(hdl, errVal);
204 return Marshal.PtrToStringAnsi(file_out);
205 }
206
208 // MkLogFileC_Write_CS_API
209 }
210
211 // END-MkLogFileC - created by 'cs_MqC.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
212
213} // END - namespace "csmkkernel"
csmkkernel.MkKernel Mk
MkErrorC - the class known as err or error is used to create and manage an error message …
Definition MkErrorC.cs:498
static void Check(IntPtr ctx, MkErrorE err)
Definition MkErrorC.cs:74
MkLogFileC - the class known as lfl or log-file is used to control the target of the logging-output …
static MkLogFileC MkLogFileC_ObjNew(IntPtr hdl)
Definition MkLogFileC.cs:34
MkObjectC - class known as obj or object is used as base-class type for a Programming-Language-Micro-...
static object atomObjNew(Type type, ConstructorInfo ctor, IntPtr obj)
Definition MkObjectC.cs:189
static IntPtr getOBJ_null_allow(MkObjectC obj)
Definition MkObjectC.cs:116
static object atomObjCreate(Type type, ConstructorInfo ctor, IntPtr obj)
Definition MkObjectC.cs:202
static void atomSelfUnlink(IntPtr self, IntPtr env)
Definition MkObjectC.cs:222
static object atomSelfNull(ConstructorInfo ctor)
Definition MkObjectC.cs:217
static ConstructorInfo getCtor(Type type)
Definition MkObjectC.cs:244
static IntPtr atomSelfCreate(ConstructorInfo ctor, IntPtr obj, IntPtr env)
Definition MkObjectC.cs:207
#define MK_NULL
The Programming-Language-Micro-Kernel (PLMK) NULL value as null in C# …
new static MkLogFileC Instances()
C#: [static] MkLogFileC MkLogFileC.Instances() → C-API get head-instance from linked-list of MkL...
new static MkLogFileC GetNull()
C#: [static] MkLogFileC MkLogFileC.GetNull() → C-API Null-Slot - return a MkLogFileC typed NULL ...
new static MkLogFileC HandleResolve(Int32 netHdl)
C#: [static] MkLogFileC MkLogFileC.HandleResolve(Int32 netHdl) → C-API Handle-Resolve-Slot - ret...
Definition MkLogFileC.cs:81
new MkLogFileC Prev()
C#: MkLogFileC lfl.Prev() → C-API get previous instance from linked-list of MkLogFileS type
new MkLogFileC Next()
C#: MkLogFileC lfl.Next() → C-API get next instance from linked-list of MkLogFileS type
static MkLogFileC Open(MkObjectC fmtobj, string file)
C#: [constructor,static] MkLogFileC MkLogFileC.Open(MkObjectC fmtobj, string file) → C-API open ...
static IntPtr CTOR(MkObjectC fmtobj, string file)
C#: [constructor,static] MkLogFileC MkLogFileC.Open(MkObjectC fmtobj, string file) → C-API open ...
MkLogFileC(MkObjectC fmtobj, string file)
CONSTRUCTOR.
void WriteC(string text)
C#: lfl.WriteC(string text) → C-API write to log-file …
string GetFile()
C#: string lfl.GetFile() → C-API get the log-file …
MkErrorE
→ C-API: MkErrorE → C-API: MkErrorE