liblcconfig 9.0
Loading...
Searching...
No Matches
LibLcConfig_lc.h
Go to the documentation of this file.
1
12#ifndef PARSE_C_HEADER_TO_META
13 #pragma once
14#endif
15
16#ifdef META_STATIC
17# include "kernel_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#endif
25
26#ifndef PARSE_C_HEADER_TO_META
27 #include "debug_mk.h"
28#endif
29
30__parser__(library=LcConfig@native@Lc);
31
32// MARK_D ################################################################
33// -----------------------------------------------------------------------
34// documentation order
77
78// =========================================================================================
79// Makefile: CPPFLAGS definitions
80
81// define: META_STATIC
82// reference: META_STATIC from kernel_mk.h
83
84#ifdef META_STATIC
85# undef LC_LIB_BUILD_DLL
86# define LC_LIB_BUILD_DLL
87#endif
88
89// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
90
91/* BEGIN_LC_C_DECLS should be used at the beginning of your declarations,
92 so that C++ compilers don't mangle their names. Use END_LC_C_DECLS at
93 the end of C declarations. */
94
95#undef BEGIN_LC_C_DECLS
96#undef END_LC_C_DECLS
97#if defined(META_COMPILE_AS_CC)
98# define BEGIN_LC_C_DECLS namespace liblcconfig { using namespace libmkkernel;
99# define END_LC_C_DECLS }
100#elif defined(__cplusplus)
101# define BEGIN_LC_C_DECLS extern "C" {
102# define END_LC_C_DECLS }
103#else
104# define BEGIN_LC_C_DECLS /* empty */
105# define END_LC_C_DECLS /* empty */
106#endif
107
108// MARK_O
109#include "config_overload_lc.h"
110
113
114// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
115
121
122# define LC_RT_ARGS_ONLY MK_RT_ARGS_ONLY
123# define LC_RT_ARGS MK_RT_ARGS
124# define LC_RT_CALL_ONLY MK_RT_CALL_ONLY
125# define LC_RT_CALL MK_RT_CALL
126# define LC_RT_CALL_NULL_ONLY MK_RT_CALL_NULL_ONLY
127# define LC_RT_CALL_NULL MK_RT_CALL_NULL
128# define LC_RT_REF MK_RT_REF
129# define LC_RT_PARSER_ONLY MK_RT_PARSER_ONLY
130# define LC_RT_PARSER MK_RT_PARSER
131# define LC_RT_PTR MK_RT_PTR
132
133# define LcRtSetup_O(o) MkRtSetup_O(o)
134# define LcRtSetup_X(x) MkRtSetup_X(x)
135# define LcRtSetup_XN(x) MkRtSetup_XN(x)
136# define LcRtSetup_ON(o) MkRtSetup_ON(o)
137# define LcRtSetup_NULL MkRtSetup_NULL
138
139# define LcERROR_R(r) MkERROR_R(r)
140# define LcERROR_RT MkERROR
141# define LcERROR_O(o) MkERROR_O(o)
142# define LcERROR_X(x) MkERROR_X(x)
143# define LcERROR_XN(x) MkERROR_XN(x)
144# define LcERROR MkERROR
145
147
148// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
149
150// ==================================================================================
154
155// BEGIN-HEADER - created by 'c_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
156
157// If the source of liblcconfig is direct used in an external library
158// (without dynamic linking) and this library should *not* export
159// the symbol's of liblcconfig then the flag META_IGNORE_EXTERN have
160// to be set
161#undef LC_EXTERN
162#if defined(META_IGNORE_EXTERN)
163# define LC_EXTERN
164#elif defined(PIC)
165 // does we build a DLL ?
166# if defined(DLL_EXPORT)
167 // does we build the libmqmsgque library ?
168# if defined(LC_LIB_BUILD_DLL)
169# define LC_EXTERN __declspec(dllexport)
170# else
171# define LC_EXTERN __declspec(dllimport)
172# endif
173# else
174 // no DLL - architecture specific extern specifier
175# define LC_EXTERN __attribute__ ((visibility("default")))
176# endif
177#else
179# define LC_EXTERN
180#endif
181
182// external data lookup
183#undef LC_EXTERN_DATA
184#if defined(META_PRIVATE)
185# define LC_EXTERN_DATA extern
186#elif defined(META_IGNORE_EXTERN)
187# define LC_EXTERN_DATA extern
188#elif defined(PIC)
189 // does we build a DLL ?
190# if defined(DLL_EXPORT)
191 // does we build the libmqmsgque library ?
192# if defined(LC_LIB_BUILD_DLL)
193# define LC_EXTERN_DATA __declspec(dllexport)
194# else
195# define LC_EXTERN_DATA __declspec(dllimport)
196# endif
197# else
198 // no DLL - architecture specific extern specifier
199# define LC_EXTERN_DATA __attribute__ ((visibility("default"))) extern
200# endif
201#else
202# define LC_EXTERN_DATA extern
203#endif
204
205// END-HEADER - created by 'c_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
206
208
209/* ####################################################################### */
210/* ### ### */
211/* ### START api definition ### */
212/* ### ### */
213/* ####################################################################### */
214
215// #######################################################################
216// -----------------------------------------------------------------------
225__parser__push__(no-rpc,template-overload,doc=Setup,prefix=Setup);
226
231LC_EXTERN void MK_DECL LcSetup (void) __attribute__ ((constructor(1000)));
232
238LC_EXTERN void MK_DECL LcCleanup (void) __attribute__ ((destructor(1000)));
239
241
243
244// ==================================================================================
248
249// ------------------------------------------------------------------
250// mq_object from nat
251
252#define LC_SET_T(_cls,_hook,_nat) ({ \
253 _cls##_type ret = (_nat ? (_cls##_type)_hook (_nat) : NULL); \
254 if (ret == NULL) { \
255 ret = (_cls##_type) MkObjCreate(_cls##_TT,_nat,NULL); \
256 } else { \
257 /* printV("reborn pointer class=%s value=%p\n",#_cls,ret); */ \
258 } \
259 ret; \
260})
261
262struct LcConfigS;
263struct LcSettingS;
264
266
267// BEGIN-ShortDef - created by 'cls_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
268
274 __parser__(type=ME_CCC_LcConfigC:"LcConfigC class handle":primary)
275 typedef struct LcConfigS * LC_CFG;
277 __parser__(type=ME_CCN_LcConfigC:"const - LcConfigC class handle":primary)
278 typedef const struct LcConfigS * LC_CFGN;
280 __parser__(ignore)
281 typedef struct LcConfigS LC_CFGR;
284
290 __parser__(type=ME_CCC_LcSettingC:"LcSettingC class handle":primary)
291 typedef struct LcSettingS * LC_CFS;
293 __parser__(type=ME_CCN_LcSettingC:"const - LcSettingC class handle":primary)
294 typedef const struct LcSettingS * LC_CFSN;
296 __parser__(ignore)
297 typedef struct LcSettingS LC_CFSR;
300// END-ShortDef - created by 'cls_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
301
302// -----------------------------------------------------------------------
305
306__parser__push__(doc=Enum,doc-index=_ignore_,class=LcConfig);
307
310
312// [LcConfigFormatE]
318// [LcConfigFormatE]
319
329
330// BEGIN-LcConfigFormatE - created by 'c_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
331
334__parser__(doc=Enum,doc-index=_ignore_,class=LcConfig,no-rpc,prefix=EnumFunc)
336
339__parser__(doc=Enum,doc-index=_ignore_,class=LcConfig,no-rpc,prefix=EnumFunc)
341 return (MK_INT) value;
342}
343
346__parser__(doc=Enum,doc-index=_ignore_,class=LcConfig,no-rpc,prefix=EnumFunc)
347LC_EXTERN enum MkErrorE LcConfigFormatE_FromInt ( MK_INT const value, enum LcConfigFormatE * value_out );
348
349// END-LcConfigFormatE - created by 'c_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
350
352
353// -----------------------------------------------------------------------
356
369
379
380// BEGIN-LcConfigTypeE - created by 'c_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
381
384__parser__(doc=Enum,doc-index=_ignore_,class=LcConfig,no-rpc,prefix=EnumFunc)
386
389__parser__(doc=Enum,doc-index=_ignore_,class=LcConfig,no-rpc,prefix=EnumFunc)
390mk_inline MK_INT LcConfigTypeE_ToInt ( enum LcConfigTypeE value ) {
391 return (MK_INT) value;
392}
393
396__parser__(doc=Enum,doc-index=_ignore_,class=LcConfig,no-rpc,prefix=EnumFunc)
397LC_EXTERN enum MkErrorE LcConfigTypeE_FromInt ( MK_INT const value, enum LcConfigTypeE * value_out );
398
399// END-LcConfigTypeE - created by 'c_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
400
402
403
404// -----------------------------------------------------------------------
407
410__parser__(enum-is-flag)
422
432
434
437__parser__(doc=Enum,doc-index=_ignore_,class=LcConfig,no-rpc,prefix=EnumFunc)
439
442__parser__(doc=Enum,doc-index=_ignore_,class=LcConfig,no-rpc,prefix=EnumFunc)
444 return (MK_INT) value;
445}
446
449__parser__(doc=Enum,doc-index=_ignore_,class=LcConfig,no-rpc,prefix=EnumFunc)
451
453
455
458
464
465// BEGIN-LcErrorE - created by 'c_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
466
469__parser__(doc=Enum,doc-index=_ignore_,class=LcConfig,no-rpc,prefix=EnumFunc)
471
474__parser__(doc=Enum,doc-index=_ignore_,class=LcConfig,no-rpc,prefix=EnumFunc)
475mk_inline MK_INT LcErrorE_ToInt ( enum LcErrorE value ) {
476 return (MK_INT) value;
477}
478
481__parser__(doc=Enum,doc-index=_ignore_,class=LcConfig,no-rpc,prefix=EnumFunc)
482LC_EXTERN enum MkErrorE LcErrorE_FromInt ( MK_INT const value, enum LcErrorE * value_out );
483
484// END-LcErrorE - created by 'c_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
485
486__parser__(global=LcErrorE_FromInt:ignore-error:yes);
487
489
490// -----------------------------------------------------------------------
493
499
500// BEGIN-LcErrorTypeE - created by 'c_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
501
504__parser__(doc=Enum,doc-index=_ignore_,class=LcConfig,no-rpc,prefix=EnumFunc)
506
509__parser__(doc=Enum,doc-index=_ignore_,class=LcConfig,no-rpc,prefix=EnumFunc)
510mk_inline MK_INT LcErrorTypeE_ToInt ( enum LcErrorTypeE value ) {
511 return (MK_INT) value;
512}
513
516__parser__(doc=Enum,doc-index=_ignore_,class=LcConfig,no-rpc,prefix=EnumFunc)
517LC_EXTERN enum MkErrorE LcErrorTypeE_FromInt ( MK_INT const value, enum LcErrorTypeE * value_out );
518
519// END-LcErrorTypeE - created by 'c_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
520
522
523__parser__pop__;
524
526
527// =======================================================================
544
549typedef enum LcErrorE LcErrorE;
550
559
565#define LcReturnCheckI(ret) ((ret) == CONFIG_FALSE)
566
573#define LcErrorE_Check(lc_hdl,PROC) \
574 if (unlikely(LcReturnCheckI(PROC))) { \
575 LcConfigErrorToMQ(MkOBJ(lc_hdl), __func__,__FILE__,__LINE__); \
576 goto error; \
577 }
578
579// fix non common name
580// example: (native code) config_error_t → (meta code) LcErrorE
581// add new meta-name with: typedef config_error_t LcErrorE;
582
583// ------------------------------------------------------------------
584// error
585
587__parser__(hide,overload-c-no,class=LcConfigC)
590 MK_OBJN const obj,
591 MK_STRN const func __parser__(default=F#FUNC) ,
592 MK_STRN const file __parser__(default=F#FILE) ,
593 MK_INT const line __parser__(default=F#LINE)
595
597
599
600#ifndef META_DOXYGEN_SHOULD_SKIP_THIS
601
602 #ifdef PARSE_C_HEADER_TO_META
603 #include "libconfig_modified.h"
604 #else
605 #include "libconfig.h"
606 #endif
607
608 #include "LcConfigC_lc.h"
609 #include "LcSettingC_lc.h"
610
611#endif
612
614
615/* ####################################################################### */
616/* ### ### */
617/* ### P A C K A G E - A P I ### */
618/* ### ### */
619/* ####################################################################### */
620
658// ===========================================================================
659__parser__(global=doc-force:LcConfig:Enum:local);
660
661// =========================================================================
662// BEGIN-LcConfig-inline - created by 'c_Native.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
663// -> no data
664// END-LcConfig-inline - created by 'c_Native.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
665
666__parser__(hide)
667typedef void ( MK_DECL *LcSetupThreadF ) ( MK_RT_ARGS_ONLY );
668
669__parser__(hide)
671
672/*****************************************************************************/
673/* */
674/* check */
675/* (macros used in typeS functions) */
676/*****************************************************************************/
677
678#define LcErrorCheckI(err) ((err) == CONFIG_FALSE)
679
680#define LcErrorC_Check(hdl,PROC) \
681 if (unlikely(LcErrorCheckI(PROC))) { \
682 OT_ERROR_LC_2_MQ(hdl); \
683 OT_ERROR_MQ_2_LNG(hdl); \
684 goto error; \
685 }
686
687#define OT_ERROR_LC_2_MQ(hdl) LcConfigErrorToMQ(MkOBJ(hdl), __func__,__FILE__,__LINE__);
688
690
LcConfigC_lc.h - 27 May 2023 - aotto1968.
LcSettingC_lc.h - 25 May 2023 - aotto1968.
#define BEGIN_LC_C_DECLS
#define END_LC_C_DECLS
void(* LcSetupThreadF)(MK_RT_ARGS_ONLY)
LC_EXTERN void LcSetupThreadCallback(LcSetupThreadF call)
config_overload_lc.h - 25 May 2023 - aotto1968
#define LC_EXTERN
static library
MK_INT LcErrorTypeE_ToInt(enum LcErrorTypeE value)
return the LcErrorTypeE as integer …
LC_EXTERN enum MkErrorE LcErrorE_FromInt(MK_INT const value, enum LcErrorE *value_out)
return the LcErrorE from integer …
LcErrorE
Signals an error and is used as the return value of a function …
LC_EXTERN enum MkErrorE LcConfigOptionsEF_FromInt(MK_INT const value, enum LcConfigOptionsEF *value_out)
return the LcConfigOptionsEF from integer …
LC_EXTERN MK_STRN LcConfigOptionsEF_ToString(enum LcConfigOptionsEF value)
BEGIN-LcConfigOptionsEF - created by 'c_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/....
LC_EXTERN MK_STRN LcErrorE_ToString(enum LcErrorE value)
return the LcErrorE as string …
LC_EXTERN MK_STRN LcConfigFormatE_ToString(enum LcConfigFormatE value)
return the LcConfigFormatE as string …
LcConfigFormatE
set the format of a LcSettingC …
LC_EXTERN enum MkErrorE LcErrorTypeE_FromInt(MK_INT const value, enum LcErrorTypeE *value_out)
return the LcErrorTypeE from integer …
LcConfigOptionsEF
configuration options for config-file-layout
LC_EXTERN enum MkErrorE LcConfigFormatE_FromInt(MK_INT const value, enum LcConfigFormatE *value_out)
return the LcConfigFormatE from integer …
LcErrorTypeE
MK_INT LcConfigOptionsEF_ToInt(enum LcConfigOptionsEF value)
return the LcConfigOptionsEF as integer …
MK_INT LcErrorE_ToInt(enum LcErrorE value)
return the LcErrorE as integer …
MK_INT LcConfigTypeE_ToInt(enum LcConfigTypeE value)
return the LcConfigTypeE as integer …
LC_EXTERN MK_STRN LcErrorTypeE_ToString(enum LcErrorTypeE value)
return the LcErrorTypeE as string …
LcConfigTypeE
MK_INT LcConfigFormatE_ToInt(enum LcConfigFormatE value)
return the LcConfigFormatE as integer …
LC_EXTERN enum MkErrorE LcConfigTypeE_FromInt(MK_INT const value, enum LcConfigTypeE *value_out)
return the LcConfigTypeE from integer …
LC_EXTERN MK_STRN LcConfigTypeE_ToString(enum LcConfigTypeE value)
return the LcConfigTypeE as string …
@ CONFIG_FALSE
@ CONFIG_TRUE
@ CONFIG_FORMAT_DEFAULT
@ CONFIG_FORMAT_HEX
@ CONFIG_OPTION_FSYNC
@ CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS
@ CONFIG_OPTION_AUTOCONVERT
@ CONFIG_OPTION_COLON_ASSIGNMENT_FOR_NON_GROUPS
@ CONFIG_OPTION_ALLOW_SCIENTIFIC_NOTATION
@ CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE
@ CONFIG_OPTION_SEMICOLON_SEPARATORS
@ CONFIG_OPTION_NONE
@ CONFIG_OPTION_ALLOW_OVERRIDES
@ CONFIG_ERRROR_FILE_IO
@ CONFIG_ERRROR_PARSE
@ CONFIG_ERRROR_NONE
@ CONFIG_TYPE_NONE
@ CONFIG_TYPE_GROUP
@ CONFIG_TYPE_LIST
@ CONFIG_TYPE_INT64
@ CONFIG_TYPE_INT
@ CONFIG_TYPE_FLOAT
@ CONFIG_TYPE_STRING
@ CONFIG_TYPE_ARRAY
@ CONFIG_TYPE_BOOL
LC_EXTERN enum MkErrorE LcConfigErrorToMQ(MK_OBJN const obj, MK_STRN const func, MK_STRN const file, MK_INT const line) MK_ATTR_HDL
if a libconfig funtion return LcErrorE use this function to create a libmsgque error
LC_EXTERN void LcCleanup(void)
cleanup liblcconfig internal memory …
LC_EXTERN void LcSetup(void)
setup liblcconfig internal memory …
#define MK_DECL
MkErrorE
const MK_STRB * MK_STRN
signed int MK_INT
#define __parser__pop__
#define __parser__push__(...)
#define MK_ATTR_HDL
#define __parser__(...)
Class to represent a the entire configuration of the of the libconfig library …
Class to represent a configuration-setting of the of the libconfig library …
struct MkObjectS obj