theConfig 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard - theLib
c - tcl - atl - cs - py - rb - jv - cc
Loading...
Searching...
No Matches
LibLcConfig_lc.h
Go to the documentation of this file.
1
12/* LABEL-NO */
13
14#pragma once
15
16#ifdef META_STATIC
17# include "private_mk.h"
18#else
19# include "LibMkKernel_mk.h"
20#endif
21
22#ifndef PARSE_C_HEADER_TO_META
23 #include <string.h>
24 #include "debug_mk.h"
25#endif
26
27__parser__(library=LcConfig@native@Lc@Config);
28
29// MARK_D ################################################################
30// -----------------------------------------------------------------------
31// documentation order
89
90// =========================================================================================
91// Makefile: CPPFLAGS definitions
92
93// define: META_STATIC
94// reference: META_STATIC from kernel_mk.h
95
96#ifdef META_STATIC
97# undef LC_C_BUILD_DLL
98# define LC_C_BUILD_DLL
99#endif
100
101#if META_HAS_THREAD
102# define LC_RT_ARGS_ONLY MK_RT mkrt
103# define LC_RT_ARGS LC_RT_ARGS_ONLY,
104# define LC_RT_CALL_ONLY mkrt
105# define LC_RT_CALL LC_RT_CALL_ONLY,
106#else
107# define LC_RT_ARGS_ONLY void
108# define LC_RT_ARGS
109# define LC_RT_CALL_ONLY
110# define LC_RT_CALL
111#endif
112
113// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
114
115/* BEGIN_LC_C_DECLS should be used at the beginning of your declarations,
116 so that C++ compilers don't mangle their names. Use END_LC_C_DECLS at
117 the end of C declarations. */
118
119#undef BEGIN_LC_C_DECLS
120#undef END_LC_C_DECLS
121#if defined(META_COMPILE_AS_CC)
122# define BEGIN_LC_C_DECLS namespace liblcconfig { using namespace libmkkernel;
123# define END_LC_C_DECLS }
124#elif defined(__cplusplus)
125# define BEGIN_LC_C_DECLS extern "C" {
126# define END_LC_C_DECLS }
127#else
128# define BEGIN_LC_C_DECLS /* empty */
129# define END_LC_C_DECLS /* empty */
130#endif
131
132// MARK_O
133#ifndef PARSE_C_HEADER_TO_META
134# include "gen/config_overload_lc.h"
135#endif
136
138
139// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
140
148
149// ".c" file
150# define LC_INSTANCE_HDL(x) MK_INSTANCE_HDL(x)
151
152# define LC_INSTANCE_RT_X(x) MK_INSTANCE_RT_X(x)
153# define LC_INSTANCE_RT_X_NULL(x) MK_INSTANCE_RT_X_NULL(x)
154# define LC_INSTANCE_RT_O(o) MK_INSTANCE_RT_O(o)
155# define LC_INSTANCE_RT_O_NULL(o) MK_INSTANCE_RT_O_NULL(o)
156# define LC_DESTRUCTOR_RT_X(c,x) MK_DESTRUCTOR_RT_X(c,x)
157# define LC_STATIC_RT MK_STATIC_RT
158
160// LcRuntimeC_C_API
161
162// ==================================================================================
166
167// BEGIN-HEADER - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
168
169// If the source of liblcconfig is direct used in an external library
170// (without dynamic linking) and this library should *not* export
171// the symbol's of liblcconfig then the flag META_IGNORE_EXTERN have
172// to be set
173#undef LC_EXTERN
174#if defined(META_IGNORE_EXTERN)
175# define LC_EXTERN
176#elif defined(PIC)
177 // does we build a DLL ?
178# if defined(DLL_EXPORT)
179 // does we build the liblcconfig library ?
180# if defined(LC_C_BUILD_DLL)
181# define LC_EXTERN __declspec(dllexport)
182# else
183# define LC_EXTERN __declspec(dllimport)
184# endif
185# else
186 // no DLL - architecture specific extern specifier
187# define LC_EXTERN __attribute__ ((visibility("default")))
188# endif
189#else
191# define LC_EXTERN
192#endif
193
194// external data lookup
195#undef LC_EXTERN_DATA
196#if defined(META_PRIVATE)
197# define LC_EXTERN_DATA extern
198#elif defined(META_IGNORE_EXTERN)
199# define LC_EXTERN_DATA extern
200#elif defined(PIC)
201 // does we build a DLL ?
202# if defined(DLL_EXPORT)
203 // does we build the liblcconfig library ?
204# if defined(LC_C_BUILD_DLL)
205# define LC_EXTERN_DATA __declspec(dllexport)
206# else
207# define LC_EXTERN_DATA __declspec(dllimport)
208# endif
209# else
210 // no DLL - architecture specific extern specifier
211# define LC_EXTERN_DATA __attribute__ ((visibility("default"))) extern
212# endif
213#else
214# define LC_EXTERN_DATA extern
215#endif
216
217// END-HEADER - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
218
220// LC_Compiler_C_API
221
222/* ####################################################################### */
223/* ### ### */
224/* ### START api definition ### */
225/* ### ### */
226/* ####################################################################### */
227
228// #######################################################################
229// -----------------------------------------------------------------------
238__parser__push__(no-rpc,template-overload,doc-group=Setup,prefix=Setup);
239
243#ifndef META_COMPILE_AS_CC
244__attribute__ ((constructor(200)))
245#endif
246__parser__(no-inline)
248
252#ifndef META_COMPILE_AS_CC
253__attribute__ ((destructor(200)))
254#endif
255__parser__(no-inline)
257
259
261// LcConfig_Setup_C_API
262
263// ==================================================================================
267
268// ------------------------------------------------------------------
269// mq_object from nat
270
271#define LC_SET_T(_cls,_hook,_nat) ({ \
272 _cls##_type ret; \
273 if ((_nat) == NULL) { \
274 ret = NULL; \
275 } else { \
276 ret = (_cls##_type)_hook (_nat); \
277 if (ret == NULL) { \
278 ret = (_cls##_type) MkObjCreate(_cls##_TT,_nat,NULL); \
279 } else { \
280 /* printV("reborn pointer class=%s value=%p\n",#_cls,ret); */ \
281 } \
282 } \
283 ret; \
284})
285
286struct LcConfigS;
287struct LcSettingS;
288
290// LcConfig_Type_C_API
291
292// BEGIN-ShortDef - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
293
297 __parser__(type=ME_CCC_LcConfigC:"LcConfigC class handle":primary)
298 typedef struct LcConfigS * LC_CFG;
300 __parser__(type=ME_CCN_LcConfigC:"const - LcConfigC class handle":primary)
301 typedef const struct LcConfigS * LC_CFGN;
303 __parser__(ignore)
304 typedef struct LcConfigS LC_CFGR;
306// LcConfigC_Class_C_API
307
311 __parser__(type=ME_CCC_LcSettingC:"LcSettingC class handle":primary)
312 typedef struct LcSettingS * LC_CFS;
314 __parser__(type=ME_CCN_LcSettingC:"const - LcSettingC class handle":primary)
315 typedef const struct LcSettingS * LC_CFSN;
317 __parser__(ignore)
318 typedef struct LcSettingS LC_CFSR;
320// LcSettingC_Class_C_API
321
322// END-ShortDef - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
323
324// =======================================================================
325
327#include "LcEnum_lc.h"
329
330// =======================================================================
347
351typedef enum LcErrorE LcErrorE;
352
359
365#define LcErrorCheckI(ret) ((ret) == CONFIG_FALSE)
366
373#define LcErrorE_Check(lc_hdl,PROC) \
374 if (unlikely(LcErrorCheckI(PROC))) { \
375 LcConfigErrorToMQ(MkOBJ(lc_hdl), __func__,__FILE__,__LINE__); \
376 goto error; \
377 }
378
379// fix non common name
380// example: (native code) config_error_t → (meta code) LcErrorE
381// add new meta-name with: typedef config_error_t LcErrorE;
382
383// ------------------------------------------------------------------
384// error
385
388__parser__(hide,overload-c-no,class=LcConfig,doc-group=Error,prefix=Error)
391 MK_OBJN const obj,
392 MK_STRN const func __parser__(default=F#FUNC) ,
393 MK_STRN const file __parser__(default=F#FILE) ,
394 MK_I32 const line __parser__(default=F#LINE)
396
398
399/* ####################################################################### */
400/* ### ### */
401/* ### I N C L U D E ### */
402/* ### ### */
403/* ####################################################################### */
404
406
407#ifndef META_DOXYGEN_SHOULD_SKIP_THIS
408
409 #ifdef PARSE_C_HEADER_TO_META
410 #include "libconfig_modified.h"
411 #else
412 #include "libconfig.h"
413 #endif
414
415 // BEGIN-Class-Include - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
416
417 #include "LcConfigC_lc.h"
418 #include "LcSettingC_lc.h"
419
420 // END-Class-Include - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
421
422#endif
423
425
426/* ####################################################################### */
427/* ### ### */
428/* ### P A C K A G E - A P I ### */
429/* ### ### */
430/* ####################################################################### */
431
469// ===========================================================================
470__parser__global__(doc-force=LcConfig@Enum@local);
471
472// =========================================================================
473// BEGIN-LcConfig-fupu - created by 'c_Native.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
474
475// -> no data
476
477// END-LcConfig-fupu - created by 'c_Native.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
478
479// =========================================================================
480// BEGIN-LcConfig-inline - created by 'c_Native.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
481
482// -> no data
483
484// END-LcConfig-inline - created by 'c_Native.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
485
488
489__parser__push__(hide,no-rpc,doc-group=Setup,prefix=Setup);
490
493
498
500
502
503/*****************************************************************************/
504/* */
505/* check */
506/* (macros used in typeS functions) */
507/*****************************************************************************/
508
509#define LcErrorC_Check(hdl,PROC) \
510 if (unlikely(LcErrorCheckI(PROC))) { \
511 OT_ERROR_LC_2_MQ(hdl); \
512 OT_ERROR_META_2_LNG(hdl); \
513 goto error; \
514 }
515
516#define OT_ERROR_LC_2_MQ(hdl) LcConfigErrorToMQ(MkOBJ(hdl), __func__,__FILE__,__LINE__);
517
LcConfigC_lc.h - 12 Dec 2024 - aotto1968.
LcSettingC_lc.h - 12 Dec 2024 - aotto1968.
#define BEGIN_LC_C_DECLS
#define END_LC_C_DECLS
config_overload_lc.h - 06 Dec 2024 - aotto1968
#define LC_EXTERN
static library
LcErrorE
Signals an error and is used as the return value of a function …
Definition LcEnum_lc.h:191
LcErrorTypeE
error types
Definition LcEnum_lc.h:231
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