theConfig 10.0
Loading...
Searching...
No Matches
LcConfigC_def_lc.h
Go to the documentation of this file.
1
9/* LABEL-START */
10#pragma once
11
12#include "LibLcConfig_lc.h"
13/* LABEL-END */
14
16
17// BEGIN-Class-Doc-Order - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
18
19// external
25
26// END-Class-Doc-Order - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
27
30
31__parser__(type=ME_PAX_LC_CBP:"generic pointer to libconfig call-back data")
32typedef MK_PTRB * LC_CBP;
33
34// [LcConfigIncludeCall]
35#define LcConfigIncludeCallF_ARGS \
36 MK_RT_ARGS struct LcConfigS* const cfg, MK_STRN incDir, MK_STRN path, MK_BFL ret_inout
38
39#define LcConfigIncludeFreeF_ARGS MK_RT_ARGS struct LcConfigS* const cfg
41// [LcConfigIncludeCall]
42
43#define LcConfigIncludeCallF_CHECK do { \
44 assert (cfg->fConfigIncludeData != NULL); \
45 if (LcCfgCheck(cfg) == false || MkOBJ_R(cfg).self == NULL) return MK_OK; \
46} while (0)
47
48// [LcSettingDeleteCall]
49#define LcSettingDeleteCallF_ARGS \
50 MK_RT_ARGS struct LcConfigS* const cfg, struct LcSettingS* const cfs
52
53#define LcSettingDeleteFreeF_ARGS MK_RT_ARGS struct LcConfigS* const cfg
55// [LcSettingDeleteCall]
56
57#define LcSettingDeleteCallF_CHECK do { \
58 assert (cfg->fSettingDeleteData != NULL); \
59 if (LcCfgCheck(cfg) == false || MkOBJ_R(cfg).self == NULL) return MK_OK; \
60} while (0)
61
63// LcConfigC_C_API
64
65// MARK_C ==================================================================
66
70
72struct LcConfigS {
73 // BEGIN-LcConfigS-super - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
74
75 union {
76 struct MkObjectS obj; // instance-base MkObjectS
78
79 // END-LcConfigS-super - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
80
81 // BEGIN-LcConfigS-native - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
82
84
85 // END-LcConfigS-native - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
86
88 //config_t *nat ; ///< \b internal - link between \e LcConfigS and \libconfig
89
90 // include function
94 //MK_PTR fConfigIncludeHook ; ///< \b internal - link between \e LcConfigS and \e target-programming-language ("my" in TCL)
95
96 // setting delete hook function
100 // MK_PTR fSettingDeleteHook ; ///< \b internal - link between \e LcConfigS and \e target-programming-language ("my" in TCL)
101};
102
103// MARK_D ==================================================================
104// BEGIN-LcConfigS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
105
109 __parser__push__(prefix=Class, doc-group=Define, doc-index=Class);
110
111// Signature --------------------------------------------------------------
114
115 #define LcConfigC_SIGNATURE (MkObjectC_SIGNATURE ^ (16u<<10))
116 #define LcConfigC_MASK (((1u<<22)-1)<<10)
117
119
120// CompileTimeCast --------------------------------------------------------------
123
124 #define LcConfigC_X2cfg(x) (x)
125 #define LcConfigC_X2obj(x) MkOBJ(x)
126
128
129// TypeDef --------------------------------------------------------------
132
134 __parser__(ignore) typedef struct LcConfigS LcConfigCR;
136 __parser__(ignore) typedef const struct LcConfigS LcConfigCNR;
140 #define LcConfigC_T ( (struct MkTypeDefS *) (LcConfigC_TT) )
142 #define LcConfigST LcConfigC_T
144 #define LcConfigSTT (MkTYP(LcConfigST))
146 #define LcConfigC_type LC_CFG
148 #define LcConfigCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
150 #define LcConfigCTT_X(instance) (MkOBJ_R(instance).type)
152 #define LcConfigCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
154 #define LcConfigC_NS LC
156 #define LcConfigCTT LcConfigCTT
158 #define LcConfigCT ( (struct MkTypeDefS *) LcConfigCTT )
159
161
162// TypeCheck --------------------------------------------------------------
165
166 #pragma GCC diagnostic push
167 #pragma GCC diagnostic ignored "-Wattributes"
168
171 __parser__(class=LcConfigC,static,hide)
174 return MkSanitizeCheck(LcConfigC,mng);
175 }
176
179 __parser__(class=LcConfigC,static,hide)
182 return MkSanitizeCheckO(LcConfigC,obj);
183 }
184
185 #pragma GCC diagnostic pop
186 #define LcConfigC_Check(mng) LcCfgCheck(mng)
187
189
190// RunTimeCast --------------------------------------------------------------
193
195 __parser__(class=LcConfigC,hide,static)
196 META_ATTRIBUTE_SANITIZE
199 return (LcCfgCheck(mng) ? (LC_CFG)mng : NULL);
200 }
201
203 __parser__(class=LcConfigC,hide,static)
204 META_ATTRIBUTE_SANITIZE
207 return (LcCfgCheck(mng) ? (LC_CFGN)mng : NULL);
208 }
209
211 #define LcCfgRaise(_cfg) if (!_MkCheckX(LcConfigC,_cfg)) { \
212 MkErrorSetC_1E("'LcConfigC' hdl is NULL"); \
213 goto error ; \
214 }
215
217 #define LcCFG_R(x) (*(x)).super.cfg
219 #define LcCFG(x) (&LcCFG_R(x))
220
222
225// LcConfigC_Class_Define_C_API
226
227// END-LcConfigS-Definition - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
228
230
231// MARK_C ==================================================================
232
235#define LcGetCfgFromNat(_nat) LC_SET_T(LcConfigC,config_get_hook,_nat)
236
237// =========================================================================
238// BEGIN-LcConfigS-Export - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
239
242
245
246__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,class=LcConfigC);
247
250__parser__(internal)
253 return LcGetCfgFromNat(hdl);
254}
255
257__parser__(internal)
260 return LcGetCfgFromNat(hdl);
261}
262
278__parser__(class-overload=MkObjectHandleGet)
282 LC_CFG const cfg __parser__(null-allowed)
283) {
284 return MkObjectHandleGet(cfg?MkOBJ(cfg):NULL);
285}
286
295__parser__(flags=new)
299 MK_HDL const netHdl
300) {
301 return LcCfg(MkObjectHandleResolve(netHdl));
302}
303
313#define LcConfigHandleResolve_e(netHdl) ({ \
314 MK_HDL tmpHdl=netHdl; \
315 LC_CFG tmp; \
316 if (tmpHdl==0) { \
317 tmp=NULL; \
318 } else { \
319 tmp=LcConfigHandleResolve(tmpHdl); \
320 if (tmp==NULL) { \
321 MkErrorSetC_1_NULL("ERROR: 'LcConfigC' handle is 'NULL'"); \
322 goto error; \
323 }; \
324 }; \
325 tmp; \
326})
327
329
331// Class export & import
332
336 __parser__(flags=new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,class=LcConfigC,null-return-allow)
339 return (LC_CFG)MK_NULL;
340 }
342// LcConfigC - Misc - function
343
345// LcConfigC_Class_C_API
346
347// END-LcConfigS-Export - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
348
349// =========================================================================
350// BEGIN-Class-Introspection - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
351
356
357__parser__push__(doc-name=Introspection,doc-index=Class,class=LcConfigC,no-rpc,null-return-allow,flags=new);
358
366
370 MK_INSTANCE_HDL(cfg);
371 return (LC_CFG)LcConfigC_X2obj(cfg)->obj_protect.next;
372}
373
377 MK_INSTANCE_HDL(cfg);
378 return (LC_CFG)LcConfigC_X2obj(cfg)->obj_protect.prev;
379}
380
382
385// LcConfigC_Class_C_API
386
387// END-Class-Introspection - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
388
tag: nhi1-release-250425
#define BEGIN_LC_C_DECLS
#define END_LC_C_DECLS
MK_PTRB * LC_CBP
void(* LcConfigIncludeFreeF)(LcConfigIncludeFreeF_ARGS)
enum MkErrorE(* LcSettingDeleteCallF)(LcSettingDeleteCallF_ARGS)
#define LcSettingDeleteFreeF_ARGS
enum MkErrorE(* LcConfigIncludeCallF)(LcConfigIncludeCallF_ARGS)
void(* LcSettingDeleteFreeF)(LcSettingDeleteFreeF_ARGS)
#define LcConfigIncludeFreeF_ARGS
#define LcConfigIncludeCallF_ARGS
#define LcSettingDeleteCallF_ARGS
static MK_HDL LcConfigHandleGet_RT(MK_RT mkrt, LC_CFG const cfg)
Handle-Get-Slot - returns a export-hdl to the LcConfigC useable for external storage
static LC_CFG LcConfigHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a LcConfigC from netHdl or "MK_NULL" if invalid…
static MK_ARTIFICIAL LC_CFG LcConfigC_ObjNew(config_t *hdl)
return Programming-Language-Micro-Kernel (PLMK) instance from native hdl …
#define LcGetCfgFromNat(_nat)
helper for LcConfigC_ObjNew …
static LC_CFG LcConfigInstances_RT(MK_RT mkrt)
get head-instance from linked-list of LcConfigS type …
static LC_CFG LcConfigPrev(LC_CFG const cfg)
get previous instance from linked-list of LcConfigS type
static LC_CFG LcConfigC_ObjCreate(config_t *hdl)
return Programming-Language-Micro-Kernel (PLMK) instance from native hdl …
static LC_CFG LcConfigNext(LC_CFG const cfg)
get next instance from linked-list of LcConfigS type
static LC_CFG LcConfigGetNull(void)
Null-Slot - return a LcConfigC typed NULL instance …
static bool LcCfgCheckO(MK_OBJN obj)
check LcConfigS -> MkObjectS::signature …
#define LcConfigC_X2obj(x)
static bool LcCfgCheck(MK_MNGN mng)
check LcConfigS -> MkObjectS::signature …
static LC_CFG LcCfg(MK_MNG mng)
cast a unknown-object into an LcConfigS pointer or NULL if not possible
__thread MK_TYP LcConfigC_TT
class as MkTypeDefS-class-type …
static LC_CFGN LcCfgN(MK_MNGN mng)
(const) cast a unknown-object into an LcConfigS pointer or NULL if not possible
#define LC_EXTERN_DATA
#define LC_STATIC_RT
#define MK_DECL
#define mk_inline
#define MK_ARTIFICIAL
#define MK_NULL
MkErrorE
#define __parser__pop__
#define __parser__push__(...)
#define __parser__(...)
const MK_PTRB * MK_MNGN
MK_PTRB * MK_MNG
void MK_PTRB
int32_t MK_HDL
#define MkSanitizeCheck(_root, _m)
#define MkSanitizeCheckO(_root, _o)
#define MkObjectHandleResolve(...)
#define MkObjectHandleGet(...)
#define MkOBJ(x)
#define MK_ATTR_STATIC
#define MK_ATTR_RT_INSTANCE
#define MK_ATTR_INSTANCE
#define MkThreadLocal
#define MK_PARSER_RT
#define MK_PARSER_RT_ONLY
#define MK_ATTR_RT_STATIC
#define MkRtSetup_NULL
#define MK_INSTANCE_HDL(x)
static MK_OBJ MkTypeInstances(MK_TYP const typ)
Struct to represent the data from the LcConfigC …
LcConfigIncludeCallF fConfigIncludeCall
internal - callback call function
LC_CBP fConfigIncludeData
callback data - internal used for config_include_fn_t callback
LcSettingDeleteFreeF fSettingDeleteFree
internal - callback data-free function
LC_CBP fSettingDeleteData
callback data - internal used for config_include_fn_t callback
LcConfigIncludeFreeF fConfigIncludeFree
internal - callback data-free function
config_t * nat
internal - link between LcConfigS and native library
config_t natdata
internal - predefined storage used for 'nat' pointer
union LcConfigS::@1 super
LcSettingDeleteCallF fSettingDeleteCall
internal - callback call function
struct MkObjectS obj