theConfig 10.0
Loading...
Searching...
No Matches
LibLcConfig_lc.h
Go to the documentation of this file.
1
9/* LABEL-NO */
10
11#pragma once
12
13#ifdef META_STATIC
14# include "private_mk.h"
15#else
16# include "LibMkKernel_mk.h"
17#endif
18
19#ifndef PARSE_C_HEADER_TO_META
20 #include <string.h>
21 #include "debug_mk.h"
22#endif
23
24__parser__(library=LcConfig@native@Lc@Config);
25
26// MARK_D ################################################################
27// -----------------------------------------------------------------------
28// documentation order
86
87// =========================================================================================
88// Makefile: CPPFLAGS definitions
89
90// define: META_STATIC
91// reference: META_STATIC from kernel_mk.h
92
93#ifdef META_STATIC
94# undef LC_C_BUILD_DLL
95# define LC_C_BUILD_DLL
96#endif
97
98#if META_HAS_THREAD
99# define LC_RT_ARGS_ONLY MK_RT mkrt
100# define LC_RT_ARGS LC_RT_ARGS_ONLY,
101# define LC_RT_CALL_ONLY mkrt
102# define LC_RT_CALL LC_RT_CALL_ONLY,
103#else
104# define LC_RT_ARGS_ONLY void
105# define LC_RT_ARGS
106# define LC_RT_CALL_ONLY
107# define LC_RT_CALL
108#endif
109
110// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
111
112/* BEGIN_LC_C_DECLS should be used at the beginning of your declarations,
113 so that C++ compilers don't mangle their names. Use END_LC_C_DECLS at
114 the end of C declarations. */
115
116#undef BEGIN_LC_C_DECLS
117#undef END_LC_C_DECLS
118#if defined(META_COMPILE_AS_CC)
119# define BEGIN_LC_C_DECLS namespace liblcconfig { using namespace libmkkernel;
120# define END_LC_C_DECLS }
121#elif defined(__cplusplus)
122# define BEGIN_LC_C_DECLS extern "C" {
123# define END_LC_C_DECLS }
124#else
125# define BEGIN_LC_C_DECLS /* empty */
126# define END_LC_C_DECLS /* empty */
127#endif
128
129// MARK_O
130#ifndef PARSE_C_HEADER_TO_META
131# include "gen/config_overload_lc.h"
132#endif
133
135
136// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
137
145
146// ".c" file
147# define LC_INSTANCE_HDL(x) MK_INSTANCE_HDL(x)
148
149# define LC_INSTANCE_RT_X(x) MK_INSTANCE_RT_X(x)
150# define LC_INSTANCE_RT_X_NULL(x) MK_INSTANCE_RT_X_NULL(x)
151# define LC_INSTANCE_RT_O(o) MK_INSTANCE_RT_O(o)
152# define LC_INSTANCE_RT_O_NULL(o) MK_INSTANCE_RT_O_NULL(o)
153# define LC_DESTRUCTOR_RT_X(c,x) MK_DESTRUCTOR_RT_X(c,x)
154# define LC_STATIC_RT MK_STATIC_RT
155
157// LcRuntimeC_C_API
158
159// ==================================================================================
163
164// BEGIN-HEADER - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
165
166// If the source of liblcconfig is direct used in an external library
167// (without dynamic linking) and this library should *not* export
168// the symbol's of liblcconfig then the flag META_IGNORE_EXTERN have
169// to be set
170#undef LC_EXTERN
171#if defined(META_IGNORE_EXTERN)
172# define LC_EXTERN
173#elif defined(PIC)
174 // does we build a DLL ?
175# if defined(DLL_EXPORT)
176 // does we build the liblcconfig library ?
177# if defined(LC_C_BUILD_DLL)
178# define LC_EXTERN __declspec(dllexport)
179# else
180# define LC_EXTERN __declspec(dllimport)
181# endif
182# else
183 // no DLL - architecture specific extern specifier
184# define LC_EXTERN __attribute__ ((visibility("default")))
185# endif
186#else
188# define LC_EXTERN
189#endif
190
191// external data lookup
192#undef LC_EXTERN_DATA
193#if defined(META_PRIVATE)
194# define LC_EXTERN_DATA extern
195#elif defined(META_IGNORE_EXTERN)
196# define LC_EXTERN_DATA extern
197#elif defined(PIC)
198 // does we build a DLL ?
199# if defined(DLL_EXPORT)
200 // does we build the liblcconfig library ?
201# if defined(LC_C_BUILD_DLL)
202# define LC_EXTERN_DATA __declspec(dllexport)
203# else
204# define LC_EXTERN_DATA __declspec(dllimport)
205# endif
206# else
207 // no DLL - architecture specific extern specifier
208# define LC_EXTERN_DATA __attribute__ ((visibility("default"))) extern
209# endif
210#else
211# define LC_EXTERN_DATA extern
212#endif
213
214// END-HEADER - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
215
217// LC_Compiler_C_API
218
219/* ####################################################################### */
220/* ### ### */
221/* ### START api definition ### */
222/* ### ### */
223/* ####################################################################### */
224
225// #######################################################################
226// -----------------------------------------------------------------------
235__parser__push__(no-rpc,template-overload,doc-group=Setup,prefix=Setup);
236
240#ifndef META_COMPILE_AS_CC
241__attribute__ ((constructor(200)))
242#endif
243__parser__(no-inline)
245
249#ifndef META_COMPILE_AS_CC
250__attribute__ ((destructor(200)))
251#endif
252__parser__(no-inline)
254
256
258// LcConfig_Setup_C_API
259
260// ==================================================================================
264
265// ------------------------------------------------------------------
266// mq_object from nat
267
268#define LC_SET_T(_cls,_hook,_nat) ({ \
269 _cls##_type ret; \
270 if ((_nat) == NULL) { \
271 ret = NULL; \
272 } else { \
273 ret = (_cls##_type)_hook (_nat); \
274 if (ret == NULL) { \
275 ret = (_cls##_type) MkObjCreate(_cls##_TT,_nat,NULL); \
276 } else { \
277 /* printV("reborn pointer class=%s value=%p\n",#_cls,ret); */ \
278 } \
279 } \
280 ret; \
281})
282
283struct LcConfigS;
284struct LcSettingS;
285
287// LcConfig_Type_C_API
288
289// BEGIN-ShortDef - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
290
294 __parser__(type=ME_CCC_LcConfigC:"LcConfigC class handle":primary)
295 typedef struct LcConfigS * LC_CFG;
297 __parser__(type=ME_CCN_LcConfigC:"const - LcConfigC class handle":primary)
298 typedef const struct LcConfigS * LC_CFGN;
300 __parser__(ignore)
301 typedef struct LcConfigS LC_CFGR;
303// LcConfigC_Class_C_API
304
308 __parser__(type=ME_CCC_LcSettingC:"LcSettingC class handle":primary)
309 typedef struct LcSettingS * LC_CFS;
311 __parser__(type=ME_CCN_LcSettingC:"const - LcSettingC class handle":primary)
312 typedef const struct LcSettingS * LC_CFSN;
314 __parser__(ignore)
315 typedef struct LcSettingS LC_CFSR;
317// LcSettingC_Class_C_API
318
319// END-ShortDef - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
320
321// =======================================================================
322
324#include "LcEnum_lc.h"
326
327// =======================================================================
344
348typedef enum LcErrorE LcErrorE;
349
356
362#define LcErrorCheckI(ret) ((ret) == CONFIG_FALSE)
363
370#define LcErrorE_Check(lc_hdl,PROC) \
371 if (unlikely(LcErrorCheckI(PROC))) { \
372 LcConfigErrorToMQ(MkOBJ(lc_hdl), __func__,__FILE__,__LINE__); \
373 goto error; \
374 }
375
376// fix non common name
377// example: (native code) config_error_t → (meta code) LcErrorE
378// add new meta-name with: typedef config_error_t LcErrorE;
379
380// ------------------------------------------------------------------
381// error
382
385__parser__(hide,overload-c-no,class=LcConfig,doc-group=Error,prefix=Error)
388 MK_OBJN const obj,
389 MK_STRN const func __parser__(default=F#FUNC) ,
390 MK_STRN const file __parser__(default=F#FILE) ,
391 MK_I32 const line __parser__(default=F#LINE)
393
395
396/* ####################################################################### */
397/* ### ### */
398/* ### I N C L U D E ### */
399/* ### ### */
400/* ####################################################################### */
401
403
404#ifndef META_DOXYGEN_SHOULD_SKIP_THIS
405
406 #ifdef PARSE_C_HEADER_TO_META
407 #include "libconfig_modified.h"
408 #else
409 #include "libconfig.h"
410 #endif
411
412 // BEGIN-Class-Include - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
413
414 #include "LcConfigC_lc.h"
415 #include "LcSettingC_lc.h"
416
417 // END-Class-Include - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
418
419#endif
420
422
423/* ####################################################################### */
424/* ### ### */
425/* ### P A C K A G E - A P I ### */
426/* ### ### */
427/* ####################################################################### */
428
466// ===========================================================================
467__parser__global__(doc-force=LcConfig@Enum@local);
468
469// =========================================================================
470// BEGIN-LcConfig-fupu - created by 'c_Native.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
471
472// -> no data
473
474// END-LcConfig-fupu - created by 'c_Native.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
475
476// =========================================================================
477// BEGIN-LcConfig-inline - created by 'c_Native.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
478
479// -> no data
480
481// END-LcConfig-inline - created by 'c_Native.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
482
485
486__parser__push__(hide,no-rpc,doc-group=Setup,prefix=Setup);
487
490
495
497
499
500/*****************************************************************************/
501/* */
502/* check */
503/* (macros used in typeS functions) */
504/*****************************************************************************/
505
506#define LcErrorC_Check(hdl,PROC) \
507 if (unlikely(LcErrorCheckI(PROC))) { \
508 OT_ERROR_LC_2_MQ(hdl); \
509 OT_ERROR_META_2_LNG(hdl); \
510 goto error; \
511 }
512
513#define OT_ERROR_LC_2_MQ(hdl) LcConfigErrorToMQ(MkOBJ(hdl), __func__,__FILE__,__LINE__);
514
tag: nhi1-release-250425
tag: nhi1-release-250425
#define BEGIN_LC_C_DECLS
#define END_LC_C_DECLS
tag: nhi1-release-250425
#define LC_EXTERN
static library
LcErrorE
Signals an error and is used as the return value of a function …
Definition LcEnum_lc.h:188
LcErrorTypeE
error types
Definition LcEnum_lc.h:228
enum MkErrorE LcConfigErrorToMQ(MK_OBJN const obj, MK_STRN const func, MK_STRN const file, MK_I32 const line)
if a libconfig funtion return a LcErrorE use this function to convert the libconfig-error into the li...
enum LcErrorTypeE LcErrorTypeE
define the error-source of a LcConfigC …
enum LcErrorE LcErrorE
define the return-code of a method-call …
void LcSetupThreadCallback(LcSetupThreadF call)
callback used to register a new runtime …
void LcSetup(void)
setup liblcconfig internal memory …
void(* LcSetupThreadF)(MK_RT mkrt)
prototype of the runtime-callback …
void LcCleanup(void)
cleanup liblcconfig internal memory …
#define MK_DECL
MkErrorE
#define __parser__global__(...)
#define __parser__pop__
#define __parser__push__(...)
#define __parser__(...)
const MK_STRB * MK_STRN
signed int MK_I32
#define MK_ATTR_STATIC
#define MK_ATTR_INSTANCE
#define MK_RT_ARGS_ONLY
Struct to represent the data from the LcConfigC …
Struct to represent the data from the LcSettingC …
struct MkObjectS obj