theConfig 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - 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 "kernel_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// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
102
103/* BEGIN_LC_C_DECLS should be used at the beginning of your declarations,
104 so that C++ compilers don't mangle their names. Use END_LC_C_DECLS at
105 the end of C declarations. */
106
107#undef BEGIN_LC_C_DECLS
108#undef END_LC_C_DECLS
109#if defined(META_COMPILE_AS_CC)
110# define BEGIN_LC_C_DECLS namespace liblcconfig { using namespace libmkkernel;
111# define END_LC_C_DECLS }
112#elif defined(__cplusplus)
113# define BEGIN_LC_C_DECLS extern "C" {
114# define END_LC_C_DECLS }
115#else
116# define BEGIN_LC_C_DECLS /* empty */
117# define END_LC_C_DECLS /* empty */
118#endif
119
120// MARK_O
121#ifndef PARSE_C_HEADER_TO_META
122# include "gen/config_overload_lc.h"
123#endif
124
126
127// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
128
136
137# define LC_RT_ARGS_ONLY MK_RT_ARGS_ONLY
138# define LC_RT_ARGS MK_RT_ARGS
139# define LC_RT_CALL_ONLY MK_RT_CALL_ONLY
140# define LC_RT_CALL MK_RT_CALL
141# define LC_RT_CALL_NULL_ONLY MK_RT_CALL_NULL_ONLY
142# define LC_RT_CALL_NULL MK_RT_CALL_NULL
143# define LC_RT_REF MK_RT_REF
144// DESIGN STANDARD: ONLY "MK_PARSER*" at top-level
145// # define LC_PARSER_RT_ONLY MK_PARSER_RT_ONLY
146// # define LC_PARSER_RT MK_PARSER_RT
147# define LC_RT_PTR MK_RT_PTR
148
149# define LcRtSetup_O(o) MkRtSetup_O(o)
150# define LcRtSetup_X(x) MkRtSetup_X(x)
151# define LcRtSetup_XN(x) MkRtSetup_XN(x)
152# define LcRtSetup_ON(o) MkRtSetup_ON(o)
153# define LcRtSetup_NULL MkRtSetup_NULL
154# define LcRtSetup_NULL_RT MkRtSetup_NULL_RT
155
156# define LcERROR_R(r) MkERROR_R(r)
157# define LcERROR_RT MkERROR
158# define LcERROR_O(o) MkERROR_O(o)
159# define LcERROR_X(x) MkERROR_X(x)
160# define LcERROR_XN(x) MkERROR_XN(x)
161# define LcERROR MkERROR
162
163# define __LC_ATTR_DEFINED __parser__(ATTR-DEFINED=LC)
164
165// ".h" file
166# define LC_ATTR_INSTANCE MK_ATTR_INSTANCE __LC_ATTR_DEFINED
167# define LC_ATTR_RT_INSTANCE MK_ATTR_RT_INSTANCE __LC_ATTR_DEFINED
168# define LC_ATTR_CLASS MK_ATTR_CLASS __LC_ATTR_DEFINED
169# define LC_ATTR_RT_CLASS MK_ATTR_RT_CLASS __LC_ATTR_DEFINED
170
171// ".c" file
172# define LC_INSTANCE_HDL(x) MK_INSTANCE_HDL(x)
173
174# define LC_INSTANCE_RT_X(x) MK_INSTANCE_RT_X(x)
175# define LC_INSTANCE_RT_XN(x) MK_INSTANCE_RT_XN(x)
176# define LC_INSTANCE_RT_O(o) MK_INSTANCE_RT_O(o)
177# define LC_INSTANCE_RT_ON(o) MK_INSTANCE_RT_ON(o)
178# define LC_DESTRUCTOR_RT_X(c,x) MK_DESTRUCTOR_RT_X(c,x)
179# define LC_STATIC_RT MK_CLASS_RT
180
182// LcRuntimeC_C_API
183
184// ==================================================================================
188
189// BEGIN-HEADER - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
190
191// If the source of liblcconfig is direct used in an external library
192// (without dynamic linking) and this library should *not* export
193// the symbol's of liblcconfig then the flag META_IGNORE_EXTERN have
194// to be set
195#undef LC_EXTERN
196#if defined(META_IGNORE_EXTERN)
197# define LC_EXTERN
198#elif defined(PIC)
199 // does we build a DLL ?
200# if defined(DLL_EXPORT)
201 // does we build the libmqmsgque library ?
202# if defined(LC_C_BUILD_DLL)
203# define LC_EXTERN __declspec(dllexport)
204# else
205# define LC_EXTERN __declspec(dllimport)
206# endif
207# else
208 // no DLL - architecture specific extern specifier
209# define LC_EXTERN __attribute__ ((visibility("default")))
210# endif
211#else
213# define LC_EXTERN
214#endif
215
216// external data lookup
217#undef LC_EXTERN_DATA
218#if defined(META_PRIVATE)
219# define LC_EXTERN_DATA extern
220#elif defined(META_IGNORE_EXTERN)
221# define LC_EXTERN_DATA extern
222#elif defined(PIC)
223 // does we build a DLL ?
224# if defined(DLL_EXPORT)
225 // does we build the libmqmsgque library ?
226# if defined(LC_C_BUILD_DLL)
227# define LC_EXTERN_DATA __declspec(dllexport)
228# else
229# define LC_EXTERN_DATA __declspec(dllimport)
230# endif
231# else
232 // no DLL - architecture specific extern specifier
233# define LC_EXTERN_DATA __attribute__ ((visibility("default"))) extern
234# endif
235#else
236# define LC_EXTERN_DATA extern
237#endif
238
239// END-HEADER - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
240
242// LC_Compiler_C_API
243
244/* ####################################################################### */
245/* ### ### */
246/* ### START api definition ### */
247/* ### ### */
248/* ####################################################################### */
249
250// #######################################################################
251// -----------------------------------------------------------------------
260__parser__push__(no-rpc,template-overload,doc-group=Setup,prefix=Setup);
261
268__parser__(no-inline)
269LC_EXTERN void MK_DECL LcSetup (void) __attribute__ ((constructor(1000))) LC_ATTR_CLASS ;
270
275
278__parser__(no-inline)
279LC_EXTERN void MK_DECL LcCleanup (void) __attribute__ ((destructor(1000))) LC_ATTR_CLASS ;
280
282
284// LcConfig_Setup_C_API
285
286// ==================================================================================
290
291// ------------------------------------------------------------------
292// mq_object from nat
293
294#define LC_SET_T(_cls,_hook,_nat) ({ \
295 _cls##_type ret; \
296 if ((_nat) == NULL) { \
297 ret = NULL; \
298 } else { \
299 ret = (_cls##_type)_hook (_nat); \
300 if (ret == NULL) { \
301 ret = (_cls##_type) MkObjCreate(_cls##_TT,_nat,NULL); \
302 } else { \
303 /* printV("reborn pointer class=%s value=%p\n",#_cls,ret); */ \
304 } \
305 } \
306 ret; \
307})
308
309struct LcConfigS;
310struct LcSettingS;
311
313// LcConfig_Type_C_API
314
315// BEGIN-ShortDef - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
316
320 __parser__(type=ME_CCC_LcConfigC:"LcConfigC class handle":primary)
321 typedef struct LcConfigS * LC_CFG;
323 __parser__(type=ME_CCN_LcConfigC:"const - LcConfigC class handle":primary)
324 typedef const struct LcConfigS * LC_CFGN;
326 __parser__(ignore)
327 typedef struct LcConfigS LC_CFGR;
329// LcConfigC_Class_C_API
330
334 __parser__(type=ME_CCC_LcSettingC:"LcSettingC class handle":primary)
335 typedef struct LcSettingS * LC_CFS;
337 __parser__(type=ME_CCN_LcSettingC:"const - LcSettingC class handle":primary)
338 typedef const struct LcSettingS * LC_CFSN;
340 __parser__(ignore)
341 typedef struct LcSettingS LC_CFSR;
343// LcSettingC_Class_C_API
344
345// END-ShortDef - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
346
347// =======================================================================
348
350#include "LcEnum_lc.h"
352
353// =======================================================================
370
374typedef enum LcErrorE LcErrorE;
375
382
388#define LcErrorCheckI(ret) ((ret) == CONFIG_FALSE)
389
396#define LcErrorE_Check(lc_hdl,PROC) \
397 if (unlikely(LcErrorCheckI(PROC))) { \
398 LcConfigErrorToMQ(MkOBJ(lc_hdl), __func__,__FILE__,__LINE__); \
399 goto error; \
400 }
401
402// fix non common name
403// example: (native code) config_error_t → (meta code) LcErrorE
404// add new meta-name with: typedef config_error_t LcErrorE;
405
406// ------------------------------------------------------------------
407// error
408
411__parser__(hide,overload-c-no,class=LcConfig,doc-group=Error,prefix=Error)
414 MK_OBJN const obj,
415 MK_STRN const func __parser__(default=F#FUNC) ,
416 MK_STRN const file __parser__(default=F#FILE) ,
417 MK_I32 const line __parser__(default=F#LINE)
419
421
422/* ####################################################################### */
423/* ### ### */
424/* ### I N C L U D E ### */
425/* ### ### */
426/* ####################################################################### */
427
429
430#ifndef META_DOXYGEN_SHOULD_SKIP_THIS
431
432 #ifdef PARSE_C_HEADER_TO_META
433 #include "libconfig_modified.h"
434 #else
435 #include "libconfig.h"
436 #endif
437
438 // BEGIN-Class-Include - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
439
440 #include "LcConfigC_lc.h"
441 #include "LcSettingC_lc.h"
442
443 // END-Class-Include - created by 'c_Class.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
444
445#endif
446
448
449/* ####################################################################### */
450/* ### ### */
451/* ### P A C K A G E - A P I ### */
452/* ### ### */
453/* ####################################################################### */
454
492// ===========================================================================
493__parser__global__(doc-force=LcConfig@Enum@local);
494
495// =========================================================================
496// BEGIN-LcConfig-fupu - created by 'c_Native.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
497
498// -> no data
499
500// END-LcConfig-fupu - created by 'c_Native.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
501
502// =========================================================================
503// BEGIN-LcConfig-inline - created by 'c_Native.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
504
505// -> no data
506
507// END-LcConfig-inline - created by 'c_Native.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
508
511
512__parser__push__(hide,no-rpc,doc-group=Setup,prefix=Setup);
513
516
521
523
525
526/*****************************************************************************/
527/* */
528/* check */
529/* (macros used in typeS functions) */
530/*****************************************************************************/
531
532#define LcErrorC_Check(hdl,PROC) \
533 if (unlikely(LcErrorCheckI(PROC))) { \
534 OT_ERROR_LC_2_MQ(hdl); \
535 OT_ERROR_MQ_2_LNG(hdl); \
536 goto error; \
537 }
538
539#define OT_ERROR_LC_2_MQ(hdl) LcConfigErrorToMQ(MkOBJ(hdl), __func__,__FILE__,__LINE__);
540
LcConfigC_lc.h - 29 Oct 2024 - aotto1968.
LcSettingC_lc.h - 04 Oct 2024 - aotto1968.
#define BEGIN_LC_C_DECLS
#define END_LC_C_DECLS
config_overload_lc.h - 02 Oct 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:205
LcErrorTypeE
error types
Definition LcEnum_lc.h:245
LC_EXTERN 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 …
LC_EXTERN void LcCleanup(void)
cleanup liblcconfig internal memory …
LC_EXTERN void LcSetup(void)
setup liblcconfig internal memory …
void(* LcSetupThreadF)(MK_RT_ARGS_ONLY)
prototype of the runtime-callback …
LC_EXTERN void LcSetupThreadCallback(LcSetupThreadF call)
callback used to register a new runtime …
#define LC_ATTR_CLASS
#define LC_ATTR_INSTANCE
#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_RT_ARGS_ONLY
Struct to represent the data from the LcConfigC …
Struct to represent the data from the LcSettingC …
struct MkObjectS obj