theConfig 10.0
Loading...
Searching...
No Matches
LcConfigC_tcl.c
Go to the documentation of this file.
1
9/* LABEL-START */
10
11#define META_FILE_NAME "LcConfigC_tcl.c"
12
14
15#define OT_CLASS NS(LcConfigC)
16#define OT_CLASS_NAME "LcConfigC"
17
18#define OBJECT2CFG(O) MkAssertCastM(LcConfigC,(Tcl_ObjectGetMetadata(O, &MK(AtomMeta))))
19
20// TCL class
22
23// META class
25MkThreadLocal OT_OBJ_T LC(LcConfigC_MK_NULL) = NULL;
26
27// META: ObjNew feature: selfCreate will be called from "ObjNew->MkSelfNew" if MkObj need a SELF pointer
28static MK_PTR NS(LcConfigC_selfCreate) (MK_RT_ARGS MK_OBJ const obj, MK_PTR const env) {
29 OT_ENV_T interp = env;
30 return MK(AtomCreate) (MK_RT_CALL interp,obj,OT_CLASS,NULL,NULL);
31}
32// META: is called when the META object is destroyed and SELF does NOT belongs to the META.
33static void NS(LcConfigC_selfDelete) (MK_RT_ARGS MK_PTR selfP, MK_PTR const env) {
34 OT_SELF_T selfO = selfP;
35 OT_ENV_T interp = env;
36 MK(AtomDeleteHard) (MK_RT_CALL interp, selfO);
37}
38// META: is called when the META object is destroyed and SELF does NOT belong to the META.
39static void NS(LcConfigC_selfUnlink) (MK_RT_ARGS MK_PTR selfP, MK_PTR const env) {
40 OT_SELF_T selfO = selfP;
41 OT_ENV_T interp = env;
42 MK(AtomUnlink) (MK_RT_CALL interp, selfO);
43}
44
45// ATTENTION: TCL has no "Unlink" because the "Tcl_ObjectSetMetadata(selfO,&MK(AtomMeta),NULL);" call
46// also the destructor
47
48#define OT_SETUP_hdl_static_constr_pre
49#define OT_SETUP_hdl_static_constr \
50 OT_SETUP_hdl_static_constr_pre; \
51 OT_SETUP_hdl_static
52
53#define OT_SETUP_hdl_static \
54 int __skip=Tcl_ObjectContextSkippedArgs(objCtx); \
55 AllRtSetup_NULL; \
56 __attribute__((unused)) OT_SELF_T selfO = Tcl_ObjectContextObject(objCtx); \
57 __attribute__((unused)) MK_TYP hdl = LcConfigC##_TT;
58
59#define OT_SETUP_hdl SetupHdlFromMetaData_2(CFG,LC_CFG);
60#define OT_SETUP_hdl__null_allow SetupHdlFromMetaData__null_allow_2(CFG,LC_CFG);
61#define OT_SETUP_hdl_destr SetupHdlFromMetaData__null_allow_2(CFG,LC_CFG);
62
63#define OT_SETUP_hdl_constr_pre
64#define OT_SETUP_hdl_constr \
65 OT_SETUP_hdl_constr_pre; \
66 int __skip=Tcl_ObjectContextSkippedArgs(objCtx); \
67 AllRtSetup_NULL; \
68 MK_RT_UNUSED OT_SELF_T selfO = Tcl_ObjectContextObject(objCtx); \
69 LC_CFG hdl = (LC_CFG) &MkERROR;
70
71#if !defined(SetupRtFromHdl_XN)
72 #define SetupRtFromHdl_XN(hdl) AllRtSetup_XN(hdl)
73 #define SetupRtFromHdl_X(hdl) AllRtSetup_X(hdl)
74#endif
75
76// initialize the TCL and MO class specific object
77#define ClassInit \
78 /* if not already done, initialize NEW MQ type */ \
79 if (LcConfigCTT == NULL) LcConfigCTT = LcConfigSTT; \
80 \
81 /* protect against double call */ \
82 if (LcConfigCTT->selfCreate == NS(LcConfigC_selfCreate)) return MK_OK; \
83 \
84 /* add "selfCreate" and "selfDelete" feature to the MQ-Class */ \
85 LcConfigCTT->selfCreate = NS(LcConfigC_selfCreate); \
86 LcConfigCTT->selfDelete = NS(LcConfigC_selfDelete); \
87 LcConfigCTT->selfUnlink = NS(LcConfigC_selfUnlink); \
88 \
89 /* create the TCL-class */ \
90 OT_SELF_T classO = MK(ClassDef)(interp,ns,LcConfigCTT); \
91 check_NULL(classO) goto error; \
92 OT_CLASS = Tcl_GetObjectAsClass(classO); \
93 \
94 /* create the TCL static Methods */ \
95 static MkThreadLocal OtUnknownS NS(sClassUnknown) = {OT_UNKNOWN_CLASS}; \
96 check_LNG(MK(UnknownSetup) (interp,classO,NS(sOtClassDef),&NS(sClassUnknown))) goto error; \
97 \
98 /* create the TCL instance Methods */ \
99 static MkThreadLocal OtUnknownS NS(sInstanceUnknown) = {OT_UNKNOWN_INSTANCE}; \
100 check_LNG(MK(UnknownSetup) (interp,classO,NS(sInstanceDef),&NS(sInstanceUnknown))) goto error; \
101 \
102 /* define the "NULL" object */ \
103 LC(LcConfigC_MK_NULL) = Tcl_GetObjectName(interp, \
104 MK(AtomCreate) (MK_RT_CALL interp, NULL /*obj*/, OT_CLASS, "MK_NULL" /*name*/, "::tcllcconfig::LcConfigC" /*ns*/) \
105 ); \
106 Tcl_IncrRefCount(LC(LcConfigC_MK_NULL));
107
108#define VER TCL_OO_METHOD_VERSION_CURRENT
109
110/* LABEL-END */
111
112// BEGIN-DOC - created by 'tcl_MqS.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
113
114// doc-key: LcConfigC,LcConfig,sCc,func
115#define CTOR_doc "LcConfigC [LcConfigC CTOR]"
116#define Create_doc "LcConfigC [LcConfigC Create]"
117
118// doc-key: LcConfigC,LcConfig,sc_,func
119#define GetNull_doc "LcConfigC [LcConfigC GetNull]"
120#define HandleResolve_doc "LcConfigC [LcConfigC HandleResolve netHdl:MK_HDL]"
121#define Instances_doc "LcConfigC [LcConfigC Instances]"
122
123// doc-key: LcConfigC,LcConfig,oc_,func
124#define Lookup_doc "LcSettingC [$config Lookup path:string] (const)"
125#define Next_doc "LcConfigC [$cfg Next]"
126#define Prev_doc "LcConfigC [$cfg Prev]"
127#define RootSetting_doc "LcSettingC [$config RootSetting] (const)"
128
129// doc-key: LcConfigC,LcConfig,om_,func
130#define Clear_doc "$config Clear"
131#define ErrorType_doc "LcErrorTypeE [$config ErrorType] (const)"
132#define GetDefaultFormat_doc "LcConfigFormatE [$config GetDefaultFormat] (const)"
133#define GetFloatPrecision_doc "int16 [$config GetFloatPrecision] (const)"
134#define GetIncludeDir_doc "string [$config GetIncludeDir] (const)"
135#define GetOption_doc "bool [$config GetOption option:LcConfigOptionsEF] (const)"
136#define GetOptions_doc "LcConfigOptionsEF [$config GetOptions] (const)"
137#define GetTabWidth_doc "int16 [$config GetTabWidth] (const)"
138// skip class-overload: HandleGet → MkObjectHandleGet
139#define Log_doc "$cfg Log ?fmtobj:MkObjectC=\"MK_NULL\"? ?debug:int32=0? ?callfunc:string=\"MK_NULL\"? ?lvl:int32=0? (const)"
140#define ReadFile_doc "$config ReadFile filename:string"
141#define ReadString_doc "$config ReadString str:string"
142#define SetDefaultFormat_doc "$config SetDefaultFormat format:LcConfigFormatE"
143#define SetFloatPrecision_doc "$config SetFloatPrecision digits:int16"
144#define SetIncludeDir_doc "$config SetIncludeDir include_dir:string"
145#define SetIncludeFunc_doc "$cfg SetIncludeFunc ?fConfigIncludeData:LC_CBP=\"MK_NULL\"?"
146#define SetOption_doc "$config SetOption option:LcConfigOptionsEF flag:bool"
147#define SetOptions_doc "$config SetOptions options:LcConfigOptionsEF"
148#define SetSettingDeleteFunc_doc "$cfg SetSettingDeleteFunc ?fSettingDeleteData:LC_CBP=\"MK_NULL\"?"
149#define SetTabWidth_doc "$config SetTabWidth width:int16"
150#define WriteFile_doc "$config WriteFile filename:string"
151
152// doc-key: LcConfigC,LcConfig,omo,func
153#define LookupBool_doc "bool [$config LookupBool path:string] (const)"
154#define LookupFloat_doc "double [$config LookupFloat path:string] (const)"
155#define LookupInt_doc "int32 [$config LookupInt path:string] (const)"
156#define LookupInt64_doc "int64 [$config LookupInt64 path:string] (const)"
157#define LookupString_doc "string [$config LookupString path:string] (const)"
158#define WriteString_doc "string [$cfg WriteString] (const)"
159
160// END-DOC - created by 'tcl_MqS.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
161
162/*****************************************************************************/
163/* */
164/* C O N / D E - S T R U C T O R */
165/* */
166/*****************************************************************************/
167
171
172/*****************************************************************************/
173/* */
174/* O B J E C T */
175/* */
176/*****************************************************************************/
177
178// BEGIN-LcConfigC - created by 'tcl_MqC.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
179
183
184// doc-key: LcConfigC,LcConfigC-Class-Export,sc_
185
187static OT_ProcRet NS(LcConfigC_HandleResolve) (OtClass_ARGS) {
190 MK_HDL netHdl = 0;
193 LC_CFG retVal = LcConfigHandleResolve (netHdl);
194 OT_retObj_SET_CFG(retVal);
195 goto end;
196 error:
198 end:
200}
201
202// doc-key: LcConfigC,LcConfigC-Class-Export,om_
203
204// skip on class-overload: LcConfigHandleGet → MkObjectHandleGet
206static OT_ProcRet NS(LcConfigC_HandleGet) (LcConfigC_ARGS) {OT_ERROR_LNG_RETURN;}
207
209// LcConfigC_Class_TCL_API
210
214
215// doc-key: LcConfigC,LcConfigC-Class-Introspection,oc_
216
218static OT_ProcRet NS(LcConfigC_Next) (LcConfigC_ARGS) {
222 LC_CFG retVal = LcConfigNext (hdl);
223 OT_retObj_SET_CFG(retVal);
224 goto end;
225 error:
227 end:
229}
230
232static OT_ProcRet NS(LcConfigC_Prev) (LcConfigC_ARGS) {
236 LC_CFG retVal = LcConfigPrev (hdl);
237 OT_retObj_SET_CFG(retVal);
238 goto end;
239 error:
241 end:
243}
244
245// doc-key: LcConfigC,LcConfigC-Class-Introspection,sc_
246
248static OT_ProcRet NS(LcConfigC_Instances) (OtClass_ARGS) {
252 LC_CFG retVal = LcConfigInstances ();
253 OT_retObj_SET_CFG(retVal);
254 goto end;
255 error:
257 end:
259}
260
262// LcConfigC_Class_TCL_API
263
267
268// doc-key: LcConfigC,LcConfigC-Class-Misc,sc_
269
271static OT_ProcRet NS(LcConfigC_GetNull) (OtClass_ARGS) {
275 LC_CFG retVal = LcConfigGetNull ();
276 OT_retObj_SET_CFG(retVal);
277 goto end;
278 error:
280 end:
282}
283
285// LcConfigC_Class_TCL_API
286
290
291// doc-key: LcConfigC,LcConfigC-Error,om_
292
294static OT_ProcRet NS(LcConfigC_ErrorType) (LcConfigC_ARGS) {
299 goto end;
300 error:
302 end:
304}
305
307// LcConfigC_Error_TCL_API
308
312
313// doc-key: LcConfigC,LcConfigC-Get,om_
314
316static OT_ProcRet NS(LcConfigC_GetDefaultFormat) (LcConfigC_ARGS) {
321 goto end;
322 error:
324 end:
326}
327
329static OT_ProcRet NS(LcConfigC_GetFloatPrecision) (LcConfigC_ARGS) {
334 goto end;
335 error:
337 end:
339}
340
342static OT_ProcRet NS(LcConfigC_GetIncludeDir) (LcConfigC_ARGS) {
347 goto end;
348 error:
350 end:
352}
353
355static OT_ProcRet NS(LcConfigC_GetOption) (LcConfigC_ARGS) {
358 enum LcConfigOptionsEF option = 0;
362 goto end;
363 error:
365 end:
367}
368
370static OT_ProcRet NS(LcConfigC_GetOptions) (LcConfigC_ARGS) {
375 goto end;
376 error:
378 end:
380}
381
383static OT_ProcRet NS(LcConfigC_GetTabWidth) (LcConfigC_ARGS) {
388 goto end;
389 error:
391 end:
393}
394
396// LcConfigC_Get_TCL_API
397
401
402// doc-key: LcConfigC,LcConfigC-Lookup,oc_
403
405static OT_ProcRet NS(LcConfigC_Lookup) (LcConfigC_ARGS) {
408 MK_STRN path = 0;
411 LC_CFS retVal = LcConfigLookup (hdl, path);
412 OT_retObj_SET_CFS(retVal);
413 goto end;
414 error:
416 end:
418}
419
420// doc-key: LcConfigC,LcConfigC-Lookup,omo
421
423static OT_ProcRet NS(LcConfigC_LookupBool) (LcConfigC_ARGS) {
426 MK_STRN path = 0;
429 MK_BOOL value_out;
430 MkErrorC_Check(hdl,LcConfigLookupBool (hdl, path, &value_out));
431 OT_retObj_SET_BOL(value_out);
432 goto end;
433 error:
435 end:
437}
438
440static OT_ProcRet NS(LcConfigC_LookupFloat) (LcConfigC_ARGS) {
443 MK_STRN path = 0;
446 MK_DBL value_out;
447 MkErrorC_Check(hdl,LcConfigLookupFloat (hdl, path, &value_out));
448 OT_retObj_SET_DBL(value_out);
449 goto end;
450 error:
452 end:
454}
455
457static OT_ProcRet NS(LcConfigC_LookupInt) (LcConfigC_ARGS) {
460 MK_STRN path = 0;
463 MK_I32 value_out;
464 MkErrorC_Check(hdl,LcConfigLookupInt (hdl, path, &value_out));
465 OT_retObj_SET_I32(value_out);
466 goto end;
467 error:
469 end:
471}
472
474static OT_ProcRet NS(LcConfigC_LookupInt64) (LcConfigC_ARGS) {
477 MK_STRN path = 0;
480 MK_I64 value_out;
481 MkErrorC_Check(hdl,LcConfigLookupInt64 (hdl, path, &value_out));
482 OT_retObj_SET_I64(value_out);
483 goto end;
484 error:
486 end:
488}
489
491static OT_ProcRet NS(LcConfigC_LookupString) (LcConfigC_ARGS) {
494 MK_STRN path = 0;
497 MK_STRN value_out;
498 MkErrorC_Check(hdl,LcConfigLookupString (hdl, path, &value_out));
499 OT_retObj_SET_STR(value_out);
500 goto end;
501 error:
503 end:
505}
506
508// LcConfigC_Lookup_TCL_API
509
513
514// doc-key: LcConfigC,LcConfigC-Misc,oc_
515
517static OT_ProcRet NS(LcConfigC_RootSetting) (LcConfigC_ARGS) {
521 LC_CFS retVal = LcConfigRootSetting (hdl);
522 OT_retObj_SET_CFS(retVal);
523 goto end;
524 error:
526 end:
528}
529
530// doc-key: LcConfigC,LcConfigC-Misc,om_
531
533static OT_ProcRet NS(LcConfigC_Clear) (LcConfigC_ARGS) {
537 LcConfigClear (hdl);
539 goto end;
540 error:
542 end:
544}
545
547static OT_ProcRet NS(LcConfigC_Log) (LcConfigC_ARGS) {
550 MK_OBJN fmtobj = NULL;
552 MK_DBG debug = 0;
554 MK_STRN callfunc = NULL;
556 MK_I32 lvl = 0;
559 if (debug > MkRuntimeDebugGet()) {
561 goto end;
562 }
563 if (MkSysStringIsNULL(callfunc)) {callfunc = OT_GET_CALL_PROC;}
564 LcConfigLog (hdl, fmtobj, debug, callfunc, lvl);
566 goto end;
567 error:
569 end:
572}
573
575static OT_ProcRet NS(LcConfigC_ReadFile) (LcConfigC_ARGS) {
578 MK_STRN filename = 0;
581 MkErrorC_Check(hdl,LcConfigReadFile (hdl, filename));
583 goto end;
584 error:
586 end:
588}
589
591static OT_ProcRet NS(LcConfigC_ReadString) (LcConfigC_ARGS) {
594 MK_STRN str = 0;
599 goto end;
600 error:
602 end:
604}
605
607static OT_ProcRet NS(LcConfigC_WriteFile) (LcConfigC_ARGS) {
610 MK_STRN filename = 0;
613 MkErrorC_Check(hdl,LcConfigWriteFile (hdl, filename));
615 goto end;
616 error:
618 end:
620}
621
622// doc-key: LcConfigC,LcConfigC-Misc,omo
623
625static OT_ProcRet NS(LcConfigC_WriteString) (LcConfigC_ARGS) {
629 MK_STRN val_out;
630 MkErrorC_Check(hdl,LcConfigWriteString (hdl, &val_out));
631 OT_retObj_SET_STR(val_out);
632 goto end;
633 error:
635 end:
637}
638
640// LcConfigC_Misc_TCL_API
641
645
646// doc-key: LcConfigC,LcConfigC-Set,om_
647
649static OT_ProcRet NS(LcConfigC_SetDefaultFormat) (LcConfigC_ARGS) {
652 enum LcConfigFormatE format = 0;
655 LcConfigSetDefaultFormat (hdl, format);
657 goto end;
658 error:
660 end:
662}
663
665static OT_ProcRet NS(LcConfigC_SetFloatPrecision) (LcConfigC_ARGS) {
668 MK_I16 digits = 0;
671 LcConfigSetFloatPrecision (hdl, digits);
673 goto end;
674 error:
676 end:
678}
679
681static OT_ProcRet NS(LcConfigC_SetIncludeDir) (LcConfigC_ARGS) {
684 MK_STRN include_dir = 0;
685 OT_CHECK_REQUIRED(OT_CHECK_STRN (include_dir))
687 LcConfigSetIncludeDir (hdl, include_dir);
689 goto end;
690 error:
692 end:
694}
695
697static OT_ProcRet NS(LcConfigC_SetIncludeFunc) (LcConfigC_ARGS) {
700 OT_SETUP_CALLABLE(fConfigIncludeData)
701 OT_CHECK_OPTIONAL(OT_CHECK_CALLABLE(fConfigIncludeData))
703 LcConfigIncludeCallF fConfigIncludeCall = (fConfigIncludeData == NULL ? NULL : NS(ConfigIncludeCall));
704 MkErrorC_Check(hdl,LcConfigSetIncludeFunc (hdl, fConfigIncludeCall, fConfigIncludeData, NS(ConfigIncludeFree)));
706 goto end;
707 error:
709 end:
710 OT_CLEANUP_CALLABLE(fConfigIncludeData)
712}
713
715static OT_ProcRet NS(LcConfigC_SetOption) (LcConfigC_ARGS) {
718 enum LcConfigOptionsEF option = 0;
720 MK_BOOL flag = 0;
723 LcConfigSetOption (hdl, option, flag);
725 goto end;
726 error:
728 end:
730}
731
733static OT_ProcRet NS(LcConfigC_SetOptions) (LcConfigC_ARGS) {
736 enum LcConfigOptionsEF options = 0;
739 LcConfigSetOptions (hdl, options);
741 goto end;
742 error:
744 end:
746}
747
749static OT_ProcRet NS(LcConfigC_SetSettingDeleteFunc) (LcConfigC_ARGS) {
752 OT_SETUP_CALLABLE(fSettingDeleteData)
753 OT_CHECK_OPTIONAL(OT_CHECK_CALLABLE(fSettingDeleteData))
755 LcSettingDeleteCallF fSettingDeleteCall = (fSettingDeleteData == NULL ? NULL : NS(SettingDeleteCall));
756 MkErrorC_Check(hdl,LcConfigSetSettingDeleteFunc (hdl, fSettingDeleteCall, fSettingDeleteData, NS(SettingDeleteFree)));
758 goto end;
759 error:
761 end:
762 OT_CLEANUP_CALLABLE(fSettingDeleteData)
764}
765
767static OT_ProcRet NS(LcConfigC_SetTabWidth) (LcConfigC_ARGS) {
770 MK_I16 width = 0;
773 LcConfigSetTabWidth (hdl, width);
775 goto end;
776 error:
778 end:
780}
781
783// LcConfigC_Set_TCL_API
784
788
789// doc-key: LcConfigC,LcConfigC-TOR,sCc
790
792static OT_ProcRet NS(LcConfigC_CTOR) (CONSTR_ARGS) {
795 LC_CFG retVal = LcConfigCreate (NULL, NULL);
796 if (retVal == NULL) {
797 OT_ERROR_CONSTRUCTOR(LcConfigC);
798 goto error;
799 }
800 OT_CONSTRUCTOR_POST(retVal)
801 OT_retObj_CONSTR(retVal);
802 goto end;
803 error:
805 end:
807}
808
810static OT_ProcRet NS(LcConfigC_Create) (OtClass_ARGS) {
814 LC_CFG retVal = LcConfigCreate (NULL, NULL);
815 if (retVal == NULL) {
816 OT_ERROR_CONSTRUCTOR(LcConfigC);
817 goto error;
818 }
819 OT_CONSTRUCTOR_POST(retVal)
820 OT_retObj_SET_CFG(retVal);
821 goto end;
822 error:
824 end:
826}
827
829// LcConfigC_TOR_TCL_API
830
831// END-LcConfigC - created by 'tcl_MqC.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
832
834
835#if 0
836// Assumes little endian
837char* printBits(size_t const size, void const * const ptr)
838{
839 static char buf[100];
840 char * bufP = &buf[0];
841 unsigned char *b = (unsigned char*) ptr;
842 unsigned char byte;
843 int i, j;
844 int num;
845
846 for (i = (int)size-1; i >= 0; i--) {
847 for (j = 7; j >= 0; j--) {
848 byte = (b[i] >> j) & 1;
849 num = sprintf(bufP,"%u", byte);
850 bufP+=num;
851 }
852 }
853 *bufP = '\0';
854 return buf;
855}
856
857#define myprint(num) ({ \
858 unsigned int tmp=num; \
859 printf("%-40s → %s\n", #num, printBits(4,&tmp)); \
860})
861
863static OT_ProcRet NS(LcConfigC_test) (LcConfigC_ARGS) {
864 MK_UNUSED int __skip; Tcl_Object selfO; LC_CFG hdl; \
865 if (objCtx) { \
866 /* call method via TCL */ \
867 __skip = Tcl_ObjectContextSkippedArgs(objCtx); \
868 selfO = Tcl_ObjectContextObject(objCtx); \
869 hdl = OBJECT2CFG(selfO); \
870 if (hdl == NULL) { \
871 Tcl_SetResult(interp, "PointerError: 'LcConfigC' hdl is NULL", TCL_STATIC); \
872 return TCL_ERROR; \
873 } \
874
875printP(hdl)
876myprint(MkOBJ_R(hdl).signature);
877myprint(MkOBJ_R(hdl).type->objmask);
878myprint(LcConfigS_SIGNATURE);
879myprint(LcConfigS_MASK);
880myprint(MkObjectS_SIGNATURE);
881myprint(MkObjectS_MASK);
882
883 //if (!__MkCheckX(LcConfig,hdl)) { MkPanicV_1E("broken hdl=%p\n",hdl); }
884 } else { \
885 /* call method DIRECT */ \
886 __skip = 0; \
887 selfO = NULL; \
888 hdl = (LC_CFG) clientData; \
889 } \
890 SetupRtFromHdl(hdl);
891
892 return TCL_OK;
893/*
894 OT_SETUP_hdl
895 OT_SETUP_ONEARG(Lookup_doc)
896 MK_STRN path = 0;
897 OT_CHECK_REQUIRED(OT_CHECK_STRN (path))
898 OT_CHECK_NOARGS
899 if (hdl->nat == NULL) OT_ERROR_LNG_RETURN_HDL_NAT_NULL(hdl);
900 config_setting_t* nat = config_lookup (hdl->nat, path);
901 LC_CFS retVal = OT_get_CFS_from_NAT(nat);
902 OT_retObj_SET_CFS(retVal)
903 goto end;
904 error:
905 OT_retObj_SET_Error
906 end:
907 OT_retObj_RETURN
908*/
909}
910#endif
911
912// ---------------------------------------------------------------------------------------
913
914static Tcl_MethodType NS(sOtClassDef)[] = {
915// BEGIN-CLASS - created by 'tcl_MqS.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
916
917// doc-key: LcConfigC,LcConfig,sCc
918 {VER, "Create" , NS(LcConfigC_Create) , NULL, NULL},
919
920// doc-key: LcConfigC,LcConfig,sc_
921 {VER, "GetNull" , NS(LcConfigC_GetNull) , NULL, NULL},
922 {VER, "HandleResolve" , NS(LcConfigC_HandleResolve) , NULL, NULL},
923 {VER, "Instances" , NS(LcConfigC_Instances) , NULL, NULL},
924
925// END-CLASS - created by 'tcl_MqS.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
926 {0, NULL, NULL, NULL}
927};
928
929// ---------------------------------------------------------------------------------------
930
931static Tcl_MethodType NS(sInstanceDef)[] = {
932// {VER, "test" , NS(LcConfigC_test) , NULL, NULL},
933// BEGIN-OBJ - created by 'tcl_MqS.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
934
935// doc-key: LcConfigC,LcConfig,oC_
936 {VER, "<constructor>" , NS(LcConfigC_CTOR) , NULL, NULL},
937
938// doc-key: LcConfigC,LcConfig,oc_
939 {VER, "Lookup" , NS(LcConfigC_Lookup) , NULL, NULL},
940 {VER, "Next" , NS(LcConfigC_Next) , NULL, NULL},
941 {VER, "Prev" , NS(LcConfigC_Prev) , NULL, NULL},
942 {VER, "RootSetting" , NS(LcConfigC_RootSetting) , NULL, NULL},
943
944// doc-key: LcConfigC,LcConfig,om_
945 {VER, "Clear" , NS(LcConfigC_Clear) , NULL, NULL},
946 {VER, "ErrorType" , NS(LcConfigC_ErrorType) , NULL, NULL},
947 {VER, "GetDefaultFormat" , NS(LcConfigC_GetDefaultFormat) , NULL, NULL},
948 {VER, "GetFloatPrecision" , NS(LcConfigC_GetFloatPrecision) , NULL, NULL},
949 {VER, "GetIncludeDir" , NS(LcConfigC_GetIncludeDir) , NULL, NULL},
950 {VER, "GetOption" , NS(LcConfigC_GetOption) , NULL, NULL},
951 {VER, "GetOptions" , NS(LcConfigC_GetOptions) , NULL, NULL},
952 {VER, "GetTabWidth" , NS(LcConfigC_GetTabWidth) , NULL, NULL},
953 // skip class-overload: LcConfigHandleGet → HandleGet, NS(LcConfigC_HandleGet)
954 {VER, "Log" , NS(LcConfigC_Log) , NULL, NULL},
955 {VER, "ReadFile" , NS(LcConfigC_ReadFile) , NULL, NULL},
956 {VER, "ReadString" , NS(LcConfigC_ReadString) , NULL, NULL},
957 {VER, "SetDefaultFormat" , NS(LcConfigC_SetDefaultFormat) , NULL, NULL},
958 {VER, "SetFloatPrecision" , NS(LcConfigC_SetFloatPrecision) , NULL, NULL},
959 {VER, "SetIncludeDir" , NS(LcConfigC_SetIncludeDir) , NULL, NULL},
960 {VER, "SetIncludeFunc" , NS(LcConfigC_SetIncludeFunc) , NULL, NULL},
961 {VER, "SetOption" , NS(LcConfigC_SetOption) , NULL, NULL},
962 {VER, "SetOptions" , NS(LcConfigC_SetOptions) , NULL, NULL},
963 {VER, "SetSettingDeleteFunc", NS(LcConfigC_SetSettingDeleteFunc) , NULL, NULL},
964 {VER, "SetTabWidth" , NS(LcConfigC_SetTabWidth) , NULL, NULL},
965 {VER, "WriteFile" , NS(LcConfigC_WriteFile) , NULL, NULL},
966
967// doc-key: LcConfigC,LcConfig,omo
968 {VER, "LookupBool" , NS(LcConfigC_LookupBool) , NULL, NULL},
969 {VER, "LookupFloat" , NS(LcConfigC_LookupFloat) , NULL, NULL},
970 {VER, "LookupInt" , NS(LcConfigC_LookupInt) , NULL, NULL},
971 {VER, "LookupInt64" , NS(LcConfigC_LookupInt64) , NULL, NULL},
972 {VER, "LookupString" , NS(LcConfigC_LookupString) , NULL, NULL},
973 {VER, "WriteString" , NS(LcConfigC_WriteString) , NULL, NULL},
974
975// END-OBJ - created by 'tcl_MqS.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
976 {0, NULL, NULL, NULL, NULL}
977};
978
984
985int NS(pLcConfigC_Init) ( MK_RT_ARGS Tcl_Interp *interp, Tcl_Namespace *ns)
986{
988
989 return TCL_OK;
990error:
991 return TCL_ERROR;
992}
#define Instances_doc
#define SetIncludeFunc_doc
#define WriteString_doc
#define ReadString_doc
#define ReadFile_doc
#define SetIncludeDir_doc
#define OT_SETUP_hdl_static_constr
#define Lookup_doc
#define SetOption_doc
#define OT_SETUP_hdl
#define LookupBool_doc
#define LookupFloat_doc
#define ErrorType_doc
#define Log_doc
#define SetOptions_doc
static __thread MK_TYP LcConfigCTT
#define SetTabWidth_doc
#define GetNull_doc
#define SetSettingDeleteFunc_doc
#define Next_doc
#define GetTabWidth_doc
#define Create_doc
#define HandleResolve_doc
#define LookupInt_doc
#define Prev_doc
#define SetFloatPrecision_doc
#define VER
#define OT_CLASS
#define LookupString_doc
#define OT_SETUP_hdl_static
#define OT_SETUP_hdl_constr
#define GetFloatPrecision_doc
#define WriteFile_doc
#define SetDefaultFormat_doc
#define RootSetting_doc
#define LookupInt64_doc
#define GetOptions_doc
#define Clear_doc
#define OBJECT2CFG(O)
#define CTOR_doc
#define GetOption_doc
#define ClassInit
#define GetDefaultFormat_doc
#define GetIncludeDir_doc
tag: nhi1-release-250425
#define OtClass_ARGS
#define LcConfigC_ARGS
#define OT_retObj_SET_CFG(nat)
#define OT_retObj_SET_CFS(nat)
#define NS(n)
#define LC(n)
#define OT_NEW_Lc_enum_OBJ(typ, val)
#define OT_CHECK_bool(val)
#define MK(n)
#define OT_SETUP_VARARGS(min, max, d)
#define OT_CHECK_NIH(val)
#define OT_retObj_SET_BOL(nat)
#define OT_SETUP_NOARG(d)
#define OT_SETUP_ONEARG(d)
Tcl_Class OT_CLS_T
#define OT_ERROR_LNG_RETURN
#define OT_CHECK_NI4(val)
#define OT_retObj_SET_I16(nat)
#define OT_retObj_SET_Error
#define OT_CONSTRUCTOR_POST(x)
#define OT_FRAME_CLEANUP
#define OT_ERROR_CONSTRUCTOR(class)
#define OT_retObj_SET_DBL(nat)
#define OT_retObj_SET_I64(nat)
#define OT_CHECK_REQUIRED(val)
#define OT_retObj_SET_None
#define OT_retObj_SET_I32(nat)
#define OT_SETUP_CONSTRUCTOR_ARGS(...)
#define OT_CHECK_ENUM(ename, val)
#define OT_retObj_RETURN
#define OT_GET_CALL_PROC
#define OT_CHECK_NI2(val)
#define OT_retObj_SET_STR(nat)
Tcl_Object OT_SELF_T
#define OT_CHECK_OPTIONAL(val)
#define OT_retObj_SET(val)
#define str(s)
#define OT_retObj_CONSTR(x)
#define OT_CHECK_NOARGS
#define MkErrorC_Check(mng, PROC)
#define OT_ProcRet
Tcl_Interp * OT_ENV_T
#define CONSTR_ARGS
Tcl_Obj * OT_OBJ_T
#define OT_CHECK_STRN(val)
enum MkErrorE(* LcSettingDeleteCallF)(LcSettingDeleteCallF_ARGS)
enum MkErrorE(* LcConfigIncludeCallF)(LcConfigIncludeCallF_ARGS)
struct LcConfigS * LC_CFG
class-shortcut for struct LcConfigS *, all shortcut using the XX_YYY syntax (only for public API) …
#define LcConfigInstances()
static LC_CFG LcConfigPrev(LC_CFG const cfg)
get previous instance from linked-list of LcConfigS type
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 …
#define LcConfigHandleResolve(...)
static enum LcErrorTypeE LcConfigErrorType(LC_CFGN config)
This function, which is implemented as a macro, returns the type of error that occurred during the la...
static enum LcConfigFormatE LcConfigGetDefaultFormat(LC_CFGN config)
These functions, which are implemented as macros, get and set the default external format for setting...
static MK_I16 LcConfigGetTabWidth(LC_CFGN config)
These functions, which are implemented as macros, get and set the tab width for the configuration con...
static MK_BOOL LcConfigGetOption(LC_CFGN config, enum LcConfigOptionsEF option)
Since v1.7 These functions get and set the given option of the configuration config …
static MK_I16 LcConfigGetFloatPrecision(LC_CFGN config)
Since v1.6 These functions get and set the number of decimal digits to output after the radix charact...
static enum LcConfigOptionsEF LcConfigGetOptions(LC_CFGN config)
These functions get and set the options for the configuration config …
static MK_STRN LcConfigGetIncludeDir(LC_CFGN config)
ConfigSetIncludeDir specifies the include directory, include_dir, relative to which the files specifi...
static enum MkErrorE LcConfigLookupFloat(LC_CFGN config, MK_STRN path, MK_DBL *value_out)
These functions look up the value of the setting in the configuration config specified by the path pa...
static enum MkErrorE LcConfigLookupBool(LC_CFGN config, MK_STRN path, MK_BOOL *value_out)
These functions look up the value of the setting in the configuration config specified by the path pa...
static enum MkErrorE LcConfigLookupString(LC_CFGN config, MK_STRN path, MK_STRN *value_out)
These functions look up the value of the setting in the configuration config specified by the path pa...
static enum MkErrorE LcConfigLookupInt(LC_CFGN config, MK_STRN path, MK_I32 *value_out)
These functions look up the value of the setting in the configuration config specified by the path pa...
static enum MkErrorE LcConfigLookupInt64(LC_CFGN config, MK_STRN path, MK_I64 *value_out)
These functions look up the value of the setting in the configuration config specified by the path pa...
static LC_CFS LcConfigLookup(LC_CFGN config, MK_STRN path)
This function locates the setting in the configuration config specified by the path path …
static enum MkErrorE LcConfigWriteFile(LC_CFG config, MK_STRN filename)
This function writes the configuration config to the file named filename …
#define LcConfigWriteString(...)
static LC_CFS LcConfigRootSetting(LC_CFGN config)
This function, which is implemented as a macro, returns the root setting for the configuration config...
#define LcConfigLog(...)
static void LcConfigClear(LC_CFG config)
Since v1.7 This function clears the configuration config …
static enum MkErrorE LcConfigReadFile(LC_CFG config, MK_STRN filename)
This function reads and parses a configuration from the file named filename into the configuration ob...
static enum MkErrorE LcConfigReadString(LC_CFG config, MK_STRN str)
This function reads and parses a configuration from the string str into the configuration object conf...
static void LcConfigSetTabWidth(LC_CFG config, MK_I16 width)
These functions, which are implemented as macros, get and set the tab width for the configuration con...
static void LcConfigSetFloatPrecision(LC_CFG config, MK_I16 digits)
Since v1.6 These functions get and set the number of decimal digits to output after the radix charact...
#define LcConfigSetSettingDeleteFunc(...)
static void LcConfigSetOptions(LC_CFG config, enum LcConfigOptionsEF options)
These functions get and set the options for the configuration config …
static void LcConfigSetOption(LC_CFG config, enum LcConfigOptionsEF option, MK_BOOL flag)
Since v1.7 These functions get and set the given option of the configuration config …
static void LcConfigSetIncludeDir(LC_CFG config, MK_STRN include_dir)
ConfigSetIncludeDir specifies the include directory, include_dir, relative to which the files specifi...
#define LcConfigSetIncludeFunc(...)
static void LcConfigSetDefaultFormat(LC_CFG config, enum LcConfigFormatE format)
These functions, which are implemented as macros, get and set the default external format for setting...
static LC_CFG LcConfigCreate(MK_TYP type, config_t *nat)
create a LcConfigC instance …
LcConfigFormatE
set the format of a LcSettingC …
Definition LcEnum_lc.h:30
LcConfigOptionsEF
define the configuration-option of a LcConfigC …
Definition LcEnum_lc.h:134
#define MK_NULL_YES
#define MK_UNUSED
#define MK_DEPRECATED
MK_PTRB * MK_PTR
const MK_STRB * MK_STRN
signed long long MK_I64
bool MK_BOOL
signed short int MK_I16
double MK_DBL
int32_t MK_HDL
signed int MK_I32
int MK_DBG
#define MkOBJ_R(x)
static bool MkSysStringIsNULL(MK_STRN str)
static MK_I32 MkRuntimeDebugGet(void)
#define MkThreadLocal
#define MK_RT_CALL
#define MK_RT_ARGS
#define OT_CHECK_CALLABLE(val)
#define OT_CLEANUP_CALLABLE(val)
#define OT_SETUP_CALLABLE(val)
#define OT_CHECK_OBJN(val, nullB)
Struct to represent the data from the LcConfigC …
Struct to represent the data from the LcSettingC …