theConfig 10.0
Loading...
Searching...
No Matches
LcSettingC_py.c
Go to the documentation of this file.
1
9/* LABEL-START */
10
11#define META_FILE_NAME "LcSettingC_py.c"
12
14
15// PY class
16#define OT_CLASS (&NS(LcSettingCR))
17#define OT_CLASS_NAME "LcSettingC"
18
19#define OT_LNG2META(O) LcCfs(VAL2MNG(O))
20
21#define OT_retObj_CONSTR(mng) OT_retObj_SET(NS(LcSettingC_CTOR)(MK_RT_CALL (PyTypeObject*)class,mng))
22
23#define OT_SETUP_hdl OT_SETUP_hdl_tmpl(LcSettingC)
24#define OT_SETUP_hdl__null_allow OT_SETUP_hdl_tmpl__null_allow(LcSettingC)
25#define OT_SETUP_hdl_constr MK_RT_UNUSED AllRtSetup_NULL; \
26 LC_CFS hdl = (LC_CFS) OT_CLASS;
27#define OT_SETUP_hdl_destr OT_SETUP_hdl_tmpl__null_allow(LcSettingC)
28#define OT_SETUP_hdl_static MK_RT_UNUSED AllRtSetup_NULL; \
29 __attribute__((unused)) MK_TYP hdl = LcSettingC##_TT;
30
31#define OT_SETUP_hdl_static_constr OT_SETUP_hdl_static
32
33#if !defined(SetupRtFromObj_X)
34 #define SetupRtFromObj_X(hdl) AllRtSetup_X(hdl)
35 #define SetupRtFromObj_XN(hdl) AllRtSetup_XN(hdl)
36#endif
37
38// MO class
39#undef LcSettingCTT
40#define LcSettingCTT LC(LcConfigThreadState).LcSettingCTT
41/* LcSettingC_MK_NULL defined in LibLcConfig_py.h */
42
43__attribute__((unused)) mk_inline
44OT_OBJ_T NS(LcSettingC_CTOR) (MK_RT_ARGS OT_CLS_T type, LC_CFS hdl) {
45 return MK(AtomCreate)(MK_RT_CALL type,LcSettingC_X2obj(hdl));
46}
47
48// helper: mk_dbg_color_ln(MK_COLOR_YELLOW,"hdl<%p>, self<%p>", obj, self);
49
50// META: ObjNew feature: selfCreate will be called from "ObjNew->MkSelfNew" if MkObj need a SELF pointer
51static MK_PTR NS(LcSettingC_selfCreate) (MK_RT_ARGS MK_OBJ const obj, MK_PTR const env) {
52 return MK(AtomCreate) (MK_RT_CALL OT_CLASS,obj);
53}
54// META: called if MkObj must be destroyed and if the SELF is still alive → goal: destroy the SELF
55static void NS(LcSettingC_selfDelete) (MK_RT_ARGS MK_PTR self, MK_PTR const env) {
56 MK(AtomDeleteHard) (MK_RT_CALL OT_SELF);
57}
58// META: called to destroy link from SELF to META
59static void NS(LcSettingC_selfUnlink) (MK_RT_ARGS MK_PTR self, MK_PTR const env) {
60 MkObjectC_Obj *selfO = (MkObjectC_Obj*) self;
61 selfO->hdl = NULL;
62}
63
64// initialize the PY and MO class specific object
65#define ClassInit \
66 /* if not already done, initialize NEW META type */ \
67 if (LcSettingCTT == NULL) LcSettingCTT = LcSettingSTT; \
68 \
69 /* protect against double call */ \
70 if (LcSettingCTT->selfCreate == NS(LcSettingC_selfCreate)) return MK_OK; \
71 \
72 /* add "selfCreate" and "selfDelete" feature to the META-Class */ \
73 LcSettingCTT->selfCreate = NS(LcSettingC_selfCreate); \
74 LcSettingCTT->selfDelete = NS(LcSettingC_selfDelete); \
75 LcSettingCTT->selfUnlink = NS(LcSettingC_selfUnlink); \
76 \
77 if (!PyType_HasFeature(OT_CLASS,Py_TPFLAGS_READY)) { \
78 NS(LcSettingCR).tp_base = LcSettingC_base; \
79 OtErrorCheckLng (PyType_Ready(OT_CLASS)); \
80 } \
81 OtErrorCheckLng(PyModule_AddObjectRef(m, "LcSettingC", (PyObject *)OT_CLASS)); \
82 \
83 /* define the "NULL" object */ \
84 LcSettingC_MK_NULL = Py_NewRef(MK(AtomCreate) (MK_RT_CALL OT_CLASS, NULL /*obj*/));
85
86/* LABEL-END */
87
88#define META_CONTEXT_S MK_ERROR_DEFAULT
89
95
96// BEGIN-DOC - created by 'py_MqS.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
97
98// doc-key: LcSettingC,LcSetting,sc_,func
99#define GetNull_doc "LcSettingC LcSettingC.GetNull()"
100#define HandleResolve_doc "LcSettingC LcSettingC.HandleResolve(netHdl:MK_HDL)"
101#define Instances_doc "LcSettingC LcSettingC.Instances()"
102
103// doc-key: LcSettingC,LcSetting,oC_,func
104#define Add_doc "LcSettingC parent.Add(name:string, __type:LcConfigTypeE)"
105
106// doc-key: LcSettingC,LcSetting,oc_,func
107#define AddIfNotExists_doc "LcSettingC setting.AddIfNotExists(name:string, cfgtype:LcConfigTypeE)"
108#define GetConfig_doc "LcConfigC setting.GetConfig() (const)"
109#define GetElem_doc "LcSettingC setting.GetElem(idx:int32) (const)"
110#define GetMember_doc "LcSettingC setting.GetMember(name:string) (const)"
111#define Lookup_doc "LcSettingC setting.Lookup(path:string)"
112#define LookupAll_doc "MkBufferListC setting.LookupAll() (const)"
113#define Next_doc "LcSettingC cfs.Next()"
114#define Parent_doc "LcSettingC setting.Parent() (const)"
115#define Prev_doc "LcSettingC cfs.Prev()"
116#define SetBoolElem_doc "LcSettingC setting.SetBoolElem(idx:int32, value:int32)"
117#define SetFloatElem_doc "LcSettingC setting.SetFloatElem(idx:int32, value:double)"
118#define SetInt64Elem_doc "LcSettingC setting.SetInt64Elem(idx:int32, value:int64)"
119#define SetIntElem_doc "LcSettingC setting.SetIntElem(idx:int32, value:int32)"
120#define SetStringElem_doc "LcSettingC setting.SetStringElem(idx:int32, value:string)"
121
122// doc-key: LcSettingC,LcSetting,om_,func
123#define Exists_doc "bool setting.Exists(name:string)"
124#define GetBool_doc "bool setting.GetBool() (const)"
125#define GetBoolElem_doc "bool setting.GetBoolElem(idx:int32) (const)"
126#define GetFloat_doc "double setting.GetFloat() (const)"
127#define GetFloatElem_doc "double setting.GetFloatElem(idx:int32) (const)"
128#define GetFormat_doc "LcConfigFormatE setting.GetFormat() (const)"
129#define GetInt_doc "int32 setting.GetInt() (const)"
130#define GetInt64_doc "int64 setting.GetInt64() (const)"
131#define GetInt64Elem_doc "int64 setting.GetInt64Elem(idx:int32) (const)"
132#define GetIntElem_doc "int32 setting.GetIntElem(idx:int32) (const)"
133#define GetString_doc "string setting.GetString() (const)"
134#define GetStringElem_doc "string setting.GetStringElem(idx:int32) (const)"
135// skip class-overload: HandleGet → MkObjectHandleGet
136#define Index_doc "int32 setting.Index() (const)"
137#define IsAggregate_doc "bool setting.IsAggregate() (const)"
138#define IsArray_doc "bool setting.IsArray() (const)"
139#define IsGroup_doc "bool setting.IsGroup() (const)"
140#define IsList_doc "bool setting.IsList() (const)"
141#define IsNumber_doc "bool setting.IsNumber() (const)"
142#define IsRoot_doc "bool setting.IsRoot() (const)"
143#define IsScalar_doc "bool setting.IsScalar() (const)"
144#define Length_doc "int32 setting.Length() (const)"
145// skip class-overload: Log → MkObjectLog
146#define Name_doc "string setting.Name() (const)"
147#define Remove_doc "parent.Remove(name:string)"
148#define RemoveElem_doc "parent.RemoveElem(idx:int32)"
149#define SetBool_doc "setting.SetBool(value:bool)"
150#define SetFloat_doc "setting.SetFloat(value:double)"
151#define SetFormat_doc "setting.SetFormat(format:LcConfigFormatE)"
152#define SetInt_doc "setting.SetInt(value:int32)"
153#define SetInt64_doc "setting.SetInt64(value:int64)"
154#define SetString_doc "setting.SetString(value:string)"
155#define SourceFile_doc "string setting.SourceFile() (const)"
156#define SourceLine_doc "int32 setting.SourceLine() (const)"
157#define Type_doc "LcConfigTypeE setting.Type() (const)"
158
159// doc-key: LcSettingC,LcSetting,omo,func
160#define LookupBool_doc "bool setting.LookupBool(name:string) (const)"
161#define LookupFloat_doc "double setting.LookupFloat(name:string) (const)"
162#define LookupInt_doc "int32 setting.LookupInt(name:string) (const)"
163#define LookupInt64_doc "int64 setting.LookupInt64(name:string) (const)"
164#define LookupString_doc "string setting.LookupString(name:string) (const)"
165
166// END-DOC - created by 'py_MqS.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
167
168// ---------------------------------------------------------------------------------------
169
175
176// BEGIN-LcSettingC - created by 'py_MqC.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
177
181
182// doc-key: LcSettingC,LcSettingC-Class-Export,sc_
183
185static OT_ProcRet NS(LcSettingC_HandleResolve) (OtClass_ARGS) {
188 MK_HDL netHdl = 0;
191 LC_CFS retVal = LcSettingHandleResolve (netHdl);
192 OT_retObj_SET_CFS(retVal);
193 goto end;
194 error:
196 end:
198}
199
200// doc-key: LcSettingC,LcSettingC-Class-Export,om_
201
202// skip on class-overload: LcSettingHandleGet → MkObjectHandleGet
204static OT_ProcRet NS(LcSettingC_HandleGet) (LcSettingC_ARGS) {OT_ERROR_LNG_RETURN;}
205
207// LcSettingC_Class_PY_API
208
212
213// doc-key: LcSettingC,LcSettingC-Class-Introspection,oc_
214
216static OT_ProcRet NS(LcSettingC_Next) (LcSettingC_ARGS) {
220 LC_CFS retVal = LcSettingNext (hdl);
221 OT_retObj_SET_CFS(retVal);
222 goto end;
223 error:
225 end:
227}
228
230static OT_ProcRet NS(LcSettingC_Prev) (LcSettingC_ARGS) {
234 LC_CFS retVal = LcSettingPrev (hdl);
235 OT_retObj_SET_CFS(retVal);
236 goto end;
237 error:
239 end:
241}
242
243// doc-key: LcSettingC,LcSettingC-Class-Introspection,sc_
244
246static OT_ProcRet NS(LcSettingC_Instances) (OtClass_ARGS) {
250 LC_CFS retVal = LcSettingInstances ();
251 OT_retObj_SET_CFS(retVal);
252 goto end;
253 error:
255 end:
257}
258
260// LcSettingC_Class_PY_API
261
265
266// doc-key: LcSettingC,LcSettingC-Class-Misc,sc_
267
269static OT_ProcRet NS(LcSettingC_GetNull) (OtClass_ARGS) {
273 LC_CFS retVal = LcSettingGetNull ();
274 OT_retObj_SET_CFS(retVal);
275 goto end;
276 error:
278 end:
280}
281
283// LcSettingC_Class_PY_API
284
288
289// doc-key: LcSettingC,LcSettingC-Get,oc_
290
292static OT_ProcRet NS(LcSettingC_GetElem) (LcSettingC_ARGS) {
295 MK_I32 idx = 0;
298 LC_CFS retVal = LcSettingGetElem (hdl, idx);
299 if (retVal == NULL) {
300 OT_ERROR_SOFT_CONSTRUCTOR(LcSettingC);
301 goto error;
302 }
303 OT_retObj_SET_CFS(retVal);
304 goto end;
305 error:
307 end:
309}
310
312static OT_ProcRet NS(LcSettingC_GetMember) (LcSettingC_ARGS) {
315 MK_STRN name = 0;
318 LC_CFS retVal = LcSettingGetMember (hdl, name);
319 if (retVal == NULL) {
320 OT_ERROR_SOFT_CONSTRUCTOR(LcSettingC);
321 goto error;
322 }
323 OT_retObj_SET_CFS(retVal);
324 goto end;
325 error:
327 end:
329}
330
331// doc-key: LcSettingC,LcSettingC-Get,om_
332
334static OT_ProcRet NS(LcSettingC_GetBool) (LcSettingC_ARGS) {
339 goto end;
340 error:
342 end:
344}
345
347static OT_ProcRet NS(LcSettingC_GetBoolElem) (LcSettingC_ARGS) {
350 MK_I32 idx = 0;
354 goto end;
355 error:
357 end:
359}
360
362static OT_ProcRet NS(LcSettingC_GetFloat) (LcSettingC_ARGS) {
367 goto end;
368 error:
370 end:
372}
373
375static OT_ProcRet NS(LcSettingC_GetFloatElem) (LcSettingC_ARGS) {
378 MK_I32 idx = 0;
382 goto end;
383 error:
385 end:
387}
388
390static OT_ProcRet NS(LcSettingC_GetFormat) (LcSettingC_ARGS) {
395 goto end;
396 error:
398 end:
400}
401
403static OT_ProcRet NS(LcSettingC_GetInt) (LcSettingC_ARGS) {
408 goto end;
409 error:
411 end:
413}
414
416static OT_ProcRet NS(LcSettingC_GetInt64) (LcSettingC_ARGS) {
421 goto end;
422 error:
424 end:
426}
427
429static OT_ProcRet NS(LcSettingC_GetInt64Elem) (LcSettingC_ARGS) {
432 MK_I32 idx = 0;
436 goto end;
437 error:
439 end:
441}
442
444static OT_ProcRet NS(LcSettingC_GetIntElem) (LcSettingC_ARGS) {
447 MK_I32 idx = 0;
451 goto end;
452 error:
454 end:
456}
457
459static OT_ProcRet NS(LcSettingC_GetString) (LcSettingC_ARGS) {
464 goto end;
465 error:
467 end:
469}
470
472static OT_ProcRet NS(LcSettingC_GetStringElem) (LcSettingC_ARGS) {
475 MK_I32 idx = 0;
479 goto end;
480 error:
482 end:
484}
485
487// LcSettingC_Get_PY_API
488
492
493// doc-key: LcSettingC,LcSettingC-Is,om_
494
496static OT_ProcRet NS(LcSettingC_IsAggregate) (LcSettingC_ARGS) {
501 goto end;
502 error:
504 end:
506}
507
509static OT_ProcRet NS(LcSettingC_IsArray) (LcSettingC_ARGS) {
514 goto end;
515 error:
517 end:
519}
520
522static OT_ProcRet NS(LcSettingC_IsGroup) (LcSettingC_ARGS) {
527 goto end;
528 error:
530 end:
532}
533
535static OT_ProcRet NS(LcSettingC_IsList) (LcSettingC_ARGS) {
540 goto end;
541 error:
543 end:
545}
546
548static OT_ProcRet NS(LcSettingC_IsNumber) (LcSettingC_ARGS) {
553 goto end;
554 error:
556 end:
558}
559
561static OT_ProcRet NS(LcSettingC_IsRoot) (LcSettingC_ARGS) {
566 goto end;
567 error:
569 end:
571}
572
574static OT_ProcRet NS(LcSettingC_IsScalar) (LcSettingC_ARGS) {
579 goto end;
580 error:
582 end:
584}
585
587// LcSettingC_Is_PY_API
588
592
593// doc-key: LcSettingC,LcSettingC-Lookup,oc_
594
596static OT_ProcRet NS(LcSettingC_Lookup) (LcSettingC_ARGS) {
599 MK_STRN path = 0;
602 LC_CFS retVal = LcSettingLookup (hdl, path);
603 if (retVal == NULL) {
604 OT_ERROR_SOFT_CONSTRUCTOR(LcSettingC);
605 goto error;
606 }
607 OT_retObj_SET_CFS(retVal);
608 goto end;
609 error:
611 end:
613}
614
616static OT_ProcRet NS(LcSettingC_LookupAll) (LcSettingC_ARGS) {
620 MK_BFL retVal = LcSettingLookupAll (hdl);
621 OT_retObj_SET_BFL(retVal);
622 goto end;
623 error:
625 end:
627}
628
629// doc-key: LcSettingC,LcSettingC-Lookup,omo
630
632static OT_ProcRet NS(LcSettingC_LookupBool) (LcSettingC_ARGS) {
635 MK_STRN name = 0;
638 MK_BOOL value_out;
639 MkErrorC_Check(hdl,LcSettingLookupBool (hdl, name, &value_out));
640 OT_retObj_SET_BOL(value_out);
641 goto end;
642 error:
644 end:
646}
647
649static OT_ProcRet NS(LcSettingC_LookupFloat) (LcSettingC_ARGS) {
652 MK_STRN name = 0;
655 MK_DBL value_out;
656 MkErrorC_Check(hdl,LcSettingLookupFloat (hdl, name, &value_out));
657 OT_retObj_SET_DBL(value_out);
658 goto end;
659 error:
661 end:
663}
664
666static OT_ProcRet NS(LcSettingC_LookupInt) (LcSettingC_ARGS) {
669 MK_STRN name = 0;
672 MK_I32 value_out;
673 MkErrorC_Check(hdl,LcSettingLookupInt (hdl, name, &value_out));
674 OT_retObj_SET_I32(value_out);
675 goto end;
676 error:
678 end:
680}
681
683static OT_ProcRet NS(LcSettingC_LookupInt64) (LcSettingC_ARGS) {
686 MK_STRN name = 0;
689 MK_I64 value_out;
690 MkErrorC_Check(hdl,LcSettingLookupInt64 (hdl, name, &value_out));
691 OT_retObj_SET_I64(value_out);
692 goto end;
693 error:
695 end:
697}
698
700static OT_ProcRet NS(LcSettingC_LookupString) (LcSettingC_ARGS) {
703 MK_STRN name = 0;
706 MK_STRN value_out;
707 MkErrorC_Check(hdl,LcSettingLookupString (hdl, name, &value_out));
708 OT_retObj_SET_STR(value_out);
709 goto end;
710 error:
712 end:
714}
715
717// LcSettingC_Lookup_PY_API
718
722
723// doc-key: LcSettingC,LcSettingC-Misc,oc_
724
726static OT_ProcRet NS(LcSettingC_AddIfNotExists) (LcSettingC_ARGS) {
729 MK_STRN name = 0;
731 enum LcConfigTypeE cfgtype = 0;
734 LC_CFS retVal = LcSettingAddIfNotExists (hdl, name, cfgtype);
735 OT_retObj_SET_CFS(retVal);
736 goto end;
737 error:
739 end:
741}
742
744static OT_ProcRet NS(LcSettingC_Parent) (LcSettingC_ARGS) {
748 LC_CFS retVal = LcSettingParent (hdl);
749 if (retVal == NULL) {
750 OT_ERROR_SOFT_CONSTRUCTOR(LcSettingC);
751 goto error;
752 }
753 OT_retObj_SET_CFS(retVal);
754 goto end;
755 error:
757 end:
759}
760
761// doc-key: LcSettingC,LcSettingC-Misc,om_
762
764static OT_ProcRet NS(LcSettingC_Exists) (LcSettingC_ARGS) {
767 MK_STRN name = 0;
771 goto end;
772 error:
774 end:
776}
777
779static OT_ProcRet NS(LcSettingC_Index) (LcSettingC_ARGS) {
784 goto end;
785 error:
787 end:
789}
790
792static OT_ProcRet NS(LcSettingC_Length) (LcSettingC_ARGS) {
797 goto end;
798 error:
800 end:
802}
803
804// skip on class-overload: LcSettingLog → MkObjectLog
807
809static OT_ProcRet NS(LcSettingC_Name) (LcSettingC_ARGS) {
814 goto end;
815 error:
817 end:
819}
820
822static OT_ProcRet NS(LcSettingC_Remove) (LcSettingC_ARGS) {
825 MK_STRN name = 0;
828 MkErrorC_Check(hdl,LcSettingRemove (hdl, name));
830 goto end;
831 error:
833 end:
835}
836
838static OT_ProcRet NS(LcSettingC_RemoveElem) (LcSettingC_ARGS) {
841 MK_I32 idx = 0;
844 MkErrorC_Check(hdl,LcSettingRemoveElem (hdl, idx));
846 goto end;
847 error:
849 end:
851}
852
854static OT_ProcRet NS(LcSettingC_SourceFile) (LcSettingC_ARGS) {
859 goto end;
860 error:
862 end:
864}
865
867static OT_ProcRet NS(LcSettingC_SourceLine) (LcSettingC_ARGS) {
872 goto end;
873 error:
875 end:
877}
878
880static OT_ProcRet NS(LcSettingC_Type) (LcSettingC_ARGS) {
885 goto end;
886 error:
888 end:
890}
891
893// LcSettingC_Misc_PY_API
894
898
899// doc-key: LcSettingC,LcSettingC-Set,oc_
900
902static OT_ProcRet NS(LcSettingC_SetBoolElem) (LcSettingC_ARGS) {
905 MK_I32 idx = 0;
907 MK_I32 value = 0;
910 LC_CFS retVal = LcSettingSetBoolElem (hdl, idx, value);
911 if (retVal == NULL) {
912 OT_ERROR_SOFT_CONSTRUCTOR(LcSettingC);
913 goto error;
914 }
915 OT_retObj_SET_CFS(retVal);
916 goto end;
917 error:
919 end:
921}
922
924static OT_ProcRet NS(LcSettingC_SetFloatElem) (LcSettingC_ARGS) {
927 MK_I32 idx = 0;
929 MK_DBL value = 0;
932 LC_CFS retVal = LcSettingSetFloatElem (hdl, idx, value);
933 if (retVal == NULL) {
934 OT_ERROR_SOFT_CONSTRUCTOR(LcSettingC);
935 goto error;
936 }
937 OT_retObj_SET_CFS(retVal);
938 goto end;
939 error:
941 end:
943}
944
946static OT_ProcRet NS(LcSettingC_SetInt64Elem) (LcSettingC_ARGS) {
949 MK_I32 idx = 0;
951 MK_I64 value = 0;
954 LC_CFS retVal = LcSettingSetInt64Elem (hdl, idx, value);
955 if (retVal == NULL) {
956 OT_ERROR_SOFT_CONSTRUCTOR(LcSettingC);
957 goto error;
958 }
959 OT_retObj_SET_CFS(retVal);
960 goto end;
961 error:
963 end:
965}
966
968static OT_ProcRet NS(LcSettingC_SetIntElem) (LcSettingC_ARGS) {
971 MK_I32 idx = 0;
973 MK_I32 value = 0;
976 LC_CFS retVal = LcSettingSetIntElem (hdl, idx, value);
977 if (retVal == NULL) {
978 OT_ERROR_SOFT_CONSTRUCTOR(LcSettingC);
979 goto error;
980 }
981 OT_retObj_SET_CFS(retVal);
982 goto end;
983 error:
985 end:
987}
988
990static OT_ProcRet NS(LcSettingC_SetStringElem) (LcSettingC_ARGS) {
993 MK_I32 idx = 0;
995 MK_STRN value = 0;
998 LC_CFS retVal = LcSettingSetStringElem (hdl, idx, value);
999 if (retVal == NULL) {
1000 OT_ERROR_SOFT_CONSTRUCTOR(LcSettingC);
1001 goto error;
1002 }
1003 OT_retObj_SET_CFS(retVal);
1004 goto end;
1005 error:
1007 end:
1009}
1010
1011// doc-key: LcSettingC,LcSettingC-Set,om_
1012
1014static OT_ProcRet NS(LcSettingC_SetBool) (LcSettingC_ARGS) {
1017 MK_BOOL value = 0;
1020 MkErrorC_Check(hdl,LcSettingSetBool (hdl, value));
1022 goto end;
1023 error:
1025 end:
1027}
1028
1030static OT_ProcRet NS(LcSettingC_SetFloat) (LcSettingC_ARGS) {
1033 MK_DBL value = 0;
1036 MkErrorC_Check(hdl,LcSettingSetFloat (hdl, value));
1038 goto end;
1039 error:
1041 end:
1043}
1044
1046static OT_ProcRet NS(LcSettingC_SetFormat) (LcSettingC_ARGS) {
1049 enum LcConfigFormatE format = 0;
1052 MkErrorC_Check(hdl,LcSettingSetFormat (hdl, format));
1054 goto end;
1055 error:
1057 end:
1059}
1060
1062static OT_ProcRet NS(LcSettingC_SetInt) (LcSettingC_ARGS) {
1065 MK_I32 value = 0;
1068 MkErrorC_Check(hdl,LcSettingSetInt (hdl, value));
1070 goto end;
1071 error:
1073 end:
1075}
1076
1078static OT_ProcRet NS(LcSettingC_SetInt64) (LcSettingC_ARGS) {
1081 MK_I64 value = 0;
1084 MkErrorC_Check(hdl,LcSettingSetInt64 (hdl, value));
1086 goto end;
1087 error:
1089 end:
1091}
1092
1094static OT_ProcRet NS(LcSettingC_SetString) (LcSettingC_ARGS) {
1097 MK_STRN value = 0;
1100 MkErrorC_Check(hdl,LcSettingSetString (hdl, value));
1102 goto end;
1103 error:
1105 end:
1107}
1108
1110// LcSettingC_Set_PY_API
1111
1115
1116// doc-key: LcSettingC,LcSettingC-TOR,oC_
1117
1119static OT_ProcRet NS(LcSettingC_Add) (LcSettingC_ARGS) {
1122 MK_STRN name = 0;
1124 enum LcConfigTypeE __type = 0;
1127 LC_CFS retVal = LcSettingAdd (hdl, name, __type);
1128 if (retVal == NULL) {
1129 OT_ERROR_CONSTRUCTOR(LcSettingC);
1130 goto error;
1131 }
1132 OT_retObj_SET_CFS(retVal);
1133 goto end;
1134 error:
1136 end:
1138}
1139
1140// doc-key: LcSettingC,LcSettingC-TOR,oc_
1141
1143static OT_ProcRet NS(LcSettingC_GetConfig) (LcSettingC_ARGS) {
1147 LC_CFG retVal = LcSettingGetConfig (hdl);
1148 OT_retObj_SET_CFG(retVal);
1149 goto end;
1150 error:
1152 end:
1154}
1155
1157// LcSettingC_TOR_PY_API
1158
1159// END-LcSettingC - created by 'py_MqC.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
1160
1161
1162// vim: Marker(t)
1168
1169static PyMethodDef LcSettingC_Methods[] = {
1170
1171 // BEGIN-CLASS - created by 'py_MqS.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
1172
1173 // doc-key: LcSettingC,LcSetting,sc_
1174 { "GetNull" , (PyCFunction) NS(LcSettingC_GetNull) , METH_NOARGS|METH_CLASS , GetNull_doc },
1175 { "HandleResolve" , (PyCFunction) NS(LcSettingC_HandleResolve) , METH_O|METH_CLASS , HandleResolve_doc },
1176 { "Instances" , (PyCFunction) NS(LcSettingC_Instances) , METH_NOARGS|METH_CLASS , Instances_doc },
1177
1178 // END-CLASS - created by 'py_MqS.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
1179
1180 // BEGIN-OBJ - created by 'py_MqS.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
1181
1182 // doc-key: LcSettingC,LcSetting,oC_
1183 { "Add" , (PyCFunction) NS(LcSettingC_Add) , METH_VARARGS , Add_doc },
1184
1185 // doc-key: LcSettingC,LcSetting,oc_
1186 { "AddIfNotExists" , (PyCFunction) NS(LcSettingC_AddIfNotExists) , METH_VARARGS , AddIfNotExists_doc },
1187 { "GetConfig" , (PyCFunction) NS(LcSettingC_GetConfig) , METH_NOARGS , GetConfig_doc },
1188 { "GetElem" , (PyCFunction) NS(LcSettingC_GetElem) , METH_O , GetElem_doc },
1189 { "GetMember" , (PyCFunction) NS(LcSettingC_GetMember) , METH_O , GetMember_doc },
1190 { "Lookup" , (PyCFunction) NS(LcSettingC_Lookup) , METH_O , Lookup_doc },
1191 { "LookupAll" , (PyCFunction) NS(LcSettingC_LookupAll) , METH_NOARGS , LookupAll_doc },
1192 { "Next" , (PyCFunction) NS(LcSettingC_Next) , METH_NOARGS , Next_doc },
1193 { "Parent" , (PyCFunction) NS(LcSettingC_Parent) , METH_NOARGS , Parent_doc },
1194 { "Prev" , (PyCFunction) NS(LcSettingC_Prev) , METH_NOARGS , Prev_doc },
1195 { "SetBoolElem" , (PyCFunction) NS(LcSettingC_SetBoolElem) , METH_VARARGS , SetBoolElem_doc },
1196 { "SetFloatElem" , (PyCFunction) NS(LcSettingC_SetFloatElem) , METH_VARARGS , SetFloatElem_doc },
1197 { "SetInt64Elem" , (PyCFunction) NS(LcSettingC_SetInt64Elem) , METH_VARARGS , SetInt64Elem_doc },
1198 { "SetIntElem" , (PyCFunction) NS(LcSettingC_SetIntElem) , METH_VARARGS , SetIntElem_doc },
1199 { "SetStringElem" , (PyCFunction) NS(LcSettingC_SetStringElem) , METH_VARARGS , SetStringElem_doc },
1200
1201 // doc-key: LcSettingC,LcSetting,om_
1202 { "Exists" , (PyCFunction) NS(LcSettingC_Exists) , METH_O , Exists_doc },
1203 { "GetBool" , (PyCFunction) NS(LcSettingC_GetBool) , METH_NOARGS , GetBool_doc },
1204 { "GetBoolElem" , (PyCFunction) NS(LcSettingC_GetBoolElem) , METH_O , GetBoolElem_doc },
1205 { "GetFloat" , (PyCFunction) NS(LcSettingC_GetFloat) , METH_NOARGS , GetFloat_doc },
1206 { "GetFloatElem" , (PyCFunction) NS(LcSettingC_GetFloatElem) , METH_O , GetFloatElem_doc },
1207 { "GetFormat" , (PyCFunction) NS(LcSettingC_GetFormat) , METH_NOARGS , GetFormat_doc },
1208 { "GetInt" , (PyCFunction) NS(LcSettingC_GetInt) , METH_NOARGS , GetInt_doc },
1209 { "GetInt64" , (PyCFunction) NS(LcSettingC_GetInt64) , METH_NOARGS , GetInt64_doc },
1210 { "GetInt64Elem" , (PyCFunction) NS(LcSettingC_GetInt64Elem) , METH_O , GetInt64Elem_doc },
1211 { "GetIntElem" , (PyCFunction) NS(LcSettingC_GetIntElem) , METH_O , GetIntElem_doc },
1212 { "GetString" , (PyCFunction) NS(LcSettingC_GetString) , METH_NOARGS , GetString_doc },
1213 { "GetStringElem" , (PyCFunction) NS(LcSettingC_GetStringElem) , METH_O , GetStringElem_doc },
1214 // skip class-overload: LcSettingHandleGet → HandleGet, NS(LcSettingC_HandleGet)
1215 { "Index" , (PyCFunction) NS(LcSettingC_Index) , METH_NOARGS , Index_doc },
1216 { "IsAggregate" , (PyCFunction) NS(LcSettingC_IsAggregate) , METH_NOARGS , IsAggregate_doc },
1217 { "IsArray" , (PyCFunction) NS(LcSettingC_IsArray) , METH_NOARGS , IsArray_doc },
1218 { "IsGroup" , (PyCFunction) NS(LcSettingC_IsGroup) , METH_NOARGS , IsGroup_doc },
1219 { "IsList" , (PyCFunction) NS(LcSettingC_IsList) , METH_NOARGS , IsList_doc },
1220 { "IsNumber" , (PyCFunction) NS(LcSettingC_IsNumber) , METH_NOARGS , IsNumber_doc },
1221 { "IsRoot" , (PyCFunction) NS(LcSettingC_IsRoot) , METH_NOARGS , IsRoot_doc },
1222 { "IsScalar" , (PyCFunction) NS(LcSettingC_IsScalar) , METH_NOARGS , IsScalar_doc },
1223 { "Length" , (PyCFunction) NS(LcSettingC_Length) , METH_NOARGS , Length_doc },
1224 // skip class-overload: LcSettingLog → Log, NS(LcSettingC_Log)
1225 { "Name" , (PyCFunction) NS(LcSettingC_Name) , METH_NOARGS , Name_doc },
1226 { "Remove" , (PyCFunction) NS(LcSettingC_Remove) , METH_O , Remove_doc },
1227 { "RemoveElem" , (PyCFunction) NS(LcSettingC_RemoveElem) , METH_O , RemoveElem_doc },
1228 { "SetBool" , (PyCFunction) NS(LcSettingC_SetBool) , METH_O , SetBool_doc },
1229 { "SetFloat" , (PyCFunction) NS(LcSettingC_SetFloat) , METH_O , SetFloat_doc },
1230 { "SetFormat" , (PyCFunction) NS(LcSettingC_SetFormat) , METH_O , SetFormat_doc },
1231 { "SetInt" , (PyCFunction) NS(LcSettingC_SetInt) , METH_O , SetInt_doc },
1232 { "SetInt64" , (PyCFunction) NS(LcSettingC_SetInt64) , METH_O , SetInt64_doc },
1233 { "SetString" , (PyCFunction) NS(LcSettingC_SetString) , METH_O , SetString_doc },
1234 { "SourceFile" , (PyCFunction) NS(LcSettingC_SourceFile) , METH_NOARGS , SourceFile_doc },
1235 { "SourceLine" , (PyCFunction) NS(LcSettingC_SourceLine) , METH_NOARGS , SourceLine_doc },
1236 { "Type" , (PyCFunction) NS(LcSettingC_Type) , METH_NOARGS , Type_doc },
1237
1238 // doc-key: LcSettingC,LcSetting,omo
1239 { "LookupBool" , (PyCFunction) NS(LcSettingC_LookupBool) , METH_O , LookupBool_doc },
1240 { "LookupFloat" , (PyCFunction) NS(LcSettingC_LookupFloat) , METH_O , LookupFloat_doc },
1241 { "LookupInt" , (PyCFunction) NS(LcSettingC_LookupInt) , METH_O , LookupInt_doc },
1242 { "LookupInt64" , (PyCFunction) NS(LcSettingC_LookupInt64) , METH_O , LookupInt64_doc },
1243 { "LookupString" , (PyCFunction) NS(LcSettingC_LookupString) , METH_O , LookupString_doc },
1244
1245 // END-OBJ - created by 'py_MqS.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
1246
1247 {NULL, NULL, 0, NULL} /* Sentinel */
1248};
1249
1250#if 0
1251#define LcSettingC_Dealloc
1252static void
1253LcSettingC_Dealloc(OT_OBJ_T self)
1254{
1255 MK_MNG mng = VAL2MNG(self);
1256 if (mng) {
1257 MK_OBJ obj = MkObj(mng);
1258 check_NULL(obj) goto end;
1259 MkRtSetup_ON(obj);
1260
1261mk_dbg_color_ln(MK_COLOR_RED,"hdl<%p>, self<%p>", obj, self);
1262
1263 #ifdef LOG_REF
1264 if (self) printLngObj(self)
1265 #endif
1266
1267 // delete link between MQ and PYTHON
1268 obj = MkRefDecrWithoutSelf(obj);
1269 }
1270end:
1271 Py_TYPE(self)->tp_free(self);
1272}
1273#endif
1274
1280
1282 PyVarObject_HEAD_INIT(NULL, 0)
1283 .tp_name = "pymsgque.LcSettingC",
1284 .tp_doc = "PyMsgque LcSettingC Type",
1285 .tp_basicsize = sizeof(LcSettingC_Obj),
1286 .tp_itemsize = 0,
1287
1288#ifdef LcSettingC_Dealloc
1289 .tp_dealloc = LcSettingC_Dealloc,
1290#endif
1291
1292 .tp_flags = Py_TPFLAGS_DEFAULT,
1293 .tp_methods = LcSettingC_Methods,
1294 .tp_base = NULL
1295};
1296
1297int NS(pLcSettingC_Init) ( MK_RT_ARGS PyObject* m)
1298{
1299 ClassInit
1300
1301 return 0;
1302error:
1303 return -1;
1304}
1305
1306// vim: nowrap
#define Instances_doc
#define GetInt64_doc
#define Lookup_doc
#define GetInt64Elem_doc
#define GetConfig_doc
#define IsRoot_doc
#define OT_SETUP_hdl
#define LookupBool_doc
#define IsGroup_doc
#define GetBool_doc
#define GetStringElem_doc
#define SetString_doc
#define LookupFloat_doc
#define SetInt64Elem_doc
#define GetMember_doc
#define IsAggregate_doc
#define GetIntElem_doc
#define SetIntElem_doc
static PyMethodDef LcSettingC_Methods[]
#define SetFormat_doc
#define GetNull_doc
#define SetBoolElem_doc
#define Remove_doc
#define Next_doc
#define SetBool_doc
#define SetStringElem_doc
#define SetFloatElem_doc
#define HandleResolve_doc
#define SetFloat_doc
#define LookupInt_doc
#define GetFloatElem_doc
#define IsList_doc
#define Prev_doc
#define GetFormat_doc
#define Index_doc
#define Parent_doc
#define GetInt_doc
#define IsArray_doc
#define OT_CLASS
#define LookupString_doc
#define OT_SETUP_hdl_static
#define Type_doc
#define Exists_doc
#define GetFloat_doc
#define AddIfNotExists_doc
#define GetBoolElem_doc
#define IsNumber_doc
#define SourceLine_doc
#define LookupInt64_doc
#define LookupAll_doc
#define SourceFile_doc
#define GetString_doc
#define IsScalar_doc
#define Length_doc
#define GetElem_doc
#define RemoveElem_doc
#define Add_doc
#define SetInt64_doc
#define ClassInit
#define Name_doc
#define SetInt_doc
tag: nhi1-release-250425
#define OT_retObj_SET_CFG(nat)
#define OT_retObj_SET_CFS(nat)
#define NS(n)
struct LcSettingC_Obj LcSettingC_Obj
#define OT_NEW_Lc_enum_OBJ(typ, val)
#define LcSettingC_ARGS
#define OT_CHECK_bool(val)
#define OT_SELF
#define MK(n)
#define OT_SETUP_VARARGS(min, max, d)
#define OT_retObj_SET_BOL(nat)
#define OT_SETUP_NOARG(d)
#define OT_SETUP_ONEARG(d)
#define OT_ERROR_LNG_RETURN
#define OT_CHECK_NI4(val)
#define OT_CHECK_NI8(val)
#define OT_retObj_SET_Error
#define OT_CHECK_NF8(val)
#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)
PyTypeObject * OT_CLS_T
#define OT_retObj_SET_BFL(nat)
#define VAL2MNG(val)
#define OT_retObj_RETURN
PyObject * OT_OBJ_T
#define OT_retObj_SET_STR(nat)
#define OT_CLASS_TYPE_REF
#define check_NULL(E)
#define OT_retObj_SET(val)
#define OT_CHECK_NOARGS
#define MkErrorC_Check(mng, PROC)
#define OT_ProcRet
#define OtClass_ARGS
#define OT_ERROR_SOFT_CONSTRUCTOR(class)
#define printLngObj(o)
#define OT_CHECK_STRN(val)
LcConfigFormatE
set the format of a LcSettingC …
Definition LcEnum_lc.h:30
LcConfigTypeE
define the data-type of a LcSettingC …
Definition LcEnum_lc.h:78
#define LcSettingHandleResolve(...)
static LC_CFS LcSettingPrev(LC_CFS const cfs)
get previous instance from linked-list of LcSettingS type
static LC_CFS LcSettingNext(LC_CFS const cfs)
get next instance from linked-list of LcSettingS type
#define LcSettingInstances()
static LC_CFS LcSettingGetNull(void)
Null-Slot - return a LcSettingC typed NULL instance …
#define LcSettingC_X2obj(x)
static MK_STRN LcSettingGetString(LC_CFSN setting)
These functions return the value of the given setting …
static LC_CFG LcSettingGetConfig(LC_CFSN setting)
addon - return the LcConfigC from the LcSettingC …
static LC_CFS LcSettingGetElem(LC_CFSN setting, MK_I32 idx)
This function fetches the element at the given index index in the setting setting,...
static MK_BOOL LcSettingGetBool(LC_CFSN setting)
These functions return the value of the given setting …
static MK_DBL LcSettingGetFloat(LC_CFSN setting)
These functions return the value of the given setting …
static MK_BOOL LcSettingGetBoolElem(LC_CFSN setting, MK_I32 idx)
These functions return the value at the specified index index in the setting setting …
static MK_I64 LcSettingGetInt64Elem(LC_CFSN setting, MK_I32 idx)
These functions return the value at the specified index index in the setting setting …
static LC_CFS LcSettingGetMember(LC_CFSN setting, MK_STRN name)
This function fetches the child setting named name from the group setting …
static enum LcConfigFormatE LcSettingGetFormat(LC_CFSN setting)
These functions get and set the external format for the setting setting …
static MK_I32 LcSettingGetInt(LC_CFSN setting)
These functions return the value of the given setting …
static MK_I32 LcSettingGetIntElem(LC_CFSN setting, MK_I32 idx)
These functions return the value at the specified index index in the setting setting …
static MK_I64 LcSettingGetInt64(LC_CFSN setting)
These functions return the value of the given setting …
static MK_STRN LcSettingGetStringElem(LC_CFSN setting, MK_I32 idx)
These functions return the value at the specified index index in the setting setting …
static MK_DBL LcSettingGetFloatElem(LC_CFSN setting, MK_I32 idx)
These functions return the value at the specified index index in the setting setting …
static MK_BOOL LcSettingIsArray(LC_CFSN setting)
These convenience functions, which are implemented as macros, test if the setting setting is of a giv...
static MK_BOOL LcSettingIsNumber(LC_CFSN setting)
These convenience functions, some of which are implemented as macros, test if the setting setting is ...
static MK_BOOL LcSettingIsRoot(LC_CFSN setting)
This function returns CONFIG_TRUE if the given setting is the root setting, and CONFIG_FALSE otherwis...
static MK_BOOL LcSettingIsList(LC_CFSN setting)
These convenience functions, which are implemented as macros, test if the setting setting is of a giv...
static MK_BOOL LcSettingIsAggregate(LC_CFSN setting)
These convenience functions, some of which are implemented as macros, test if the setting setting is ...
static MK_BOOL LcSettingIsGroup(LC_CFSN setting)
These convenience functions, which are implemented as macros, test if the setting setting is of a giv...
static MK_BOOL LcSettingIsScalar(LC_CFSN setting)
These convenience functions, some of which are implemented as macros, test if the setting setting is ...
static enum MkErrorE LcSettingLookupString(LC_CFSN setting, MK_STRN name, MK_STRN *value_out)
These functions look up the value of the child setting named name of the setting setting …
static LC_CFS LcSettingLookup(LC_CFS setting, MK_STRN path)
This function locates a setting by a path path relative to the setting setting …
static enum MkErrorE LcSettingLookupBool(LC_CFSN setting, MK_STRN name, MK_BOOL *value_out)
These functions look up the value of the child setting named name of the setting setting …
static enum MkErrorE LcSettingLookupInt(LC_CFSN setting, MK_STRN name, MK_I32 *value_out)
These functions look up the value of the child setting named name of the setting setting …
static enum MkErrorE LcSettingLookupInt64(LC_CFSN setting, MK_STRN name, MK_I64 *value_out)
These functions look up the value of the child setting named name of the setting setting …
static enum MkErrorE LcSettingLookupFloat(LC_CFSN setting, MK_STRN name, MK_DBL *value_out)
These functions look up the value of the child setting named name of the setting setting …
MK_BFL LcSettingLookupAll(LC_CFSN setting)
addon - read an entire configuration below setting into MkBufferListC …
static LC_CFS LcSettingParent(LC_CFSN setting)
This function returns the parent setting of the given setting, or NULL if setting is the root setting...
static MK_I32 LcSettingIndex(LC_CFSN setting)
This function returns the index of the given setting within its parent setting …
static enum MkErrorE LcSettingRemoveElem(LC_CFS parent, MK_I32 idx)
This function removes the child setting at the given index index from the setting parent,...
static MK_STRN LcSettingName(LC_CFSN setting)
This function returns the name of the given setting, or NULL if the setting has no name …
static bool LcSettingExists(const LC_CFS setting, MK_STRN name)
addon - return true if name exists in the setting otherwise false …
static MK_I32 LcSettingSourceLine(LC_CFSN setting)
This function returns the line number of the configuration file or stream at which the setting settin...
static MK_STRN LcSettingSourceFile(LC_CFSN setting)
This function returns the name of the file from which the setting setting was read,...
static enum MkErrorE LcSettingRemove(LC_CFS parent, MK_STRN name)
This function removes and destroys the setting named name from the parent setting parent,...
static enum LcConfigTypeE LcSettingType(LC_CFSN setting)
This function returns the type of the given setting …
static MK_I32 LcSettingLength(LC_CFSN setting)
This function returns the number of settings in a group, or the number of elements in a list or array...
static LC_CFS LcSettingAddIfNotExists(LC_CFS setting, MK_STRN name, enum LcConfigTypeE cfgtype)
addon - add name with type only if not exists in the setting …
static LC_CFS LcSettingSetFloatElem(LC_CFS setting, MK_I32 idx, MK_DBL value)
These functions set the value at the specified index index in the setting setting to value …
static enum MkErrorE LcSettingSetInt64(LC_CFS setting, MK_I64 value)
These functions set the value of the given setting to value …
static enum MkErrorE LcSettingSetBool(LC_CFS setting, MK_BOOL value)
These functions set the value of the given setting to value …
static LC_CFS LcSettingSetIntElem(LC_CFS setting, MK_I32 idx, MK_I32 value)
These functions set the value at the specified index index in the setting setting to value …
static enum MkErrorE LcSettingSetString(LC_CFS setting, MK_STRN value)
These functions set the value of the given setting to value …
static enum MkErrorE LcSettingSetFormat(LC_CFS setting, enum LcConfigFormatE format)
These functions get and set the external format for the setting setting …
static LC_CFS LcSettingSetBoolElem(LC_CFS setting, MK_I32 idx, MK_I32 value)
These functions set the value at the specified index index in the setting setting to value …
static enum MkErrorE LcSettingSetFloat(LC_CFS setting, MK_DBL value)
These functions set the value of the given setting to value …
static LC_CFS LcSettingSetStringElem(LC_CFS setting, MK_I32 idx, MK_STRN value)
These functions set the value at the specified index index in the setting setting to value …
static LC_CFS LcSettingSetInt64Elem(LC_CFS setting, MK_I32 idx, MK_I64 value)
These functions set the value at the specified index index in the setting setting to value …
static enum MkErrorE LcSettingSetInt(LC_CFS setting, MK_I32 value)
These functions set the value of the given setting to value …
static LC_CFS LcSettingAdd(LC_CFS parent, MK_STRN name, enum LcConfigTypeE __type)
This function adds a new child setting or element to the setting parent, which must be a group,...
#define mk_inline
#define MK_UNUSED
#define MK_DEPRECATED
MK_PTRB * MK_PTR
const MK_STRB * MK_STRN
MK_PTRB * MK_MNG
signed long long MK_I64
bool MK_BOOL
double MK_DBL
int32_t MK_HDL
signed int MK_I32
static MK_OBJ MkObj(MK_MNG mng)
#define MkRefDecrWithoutSelf(...)
#define MkRtSetup_ON(o)
#define MK_RT_CALL
#define MK_RT_ARGS
#define OT_CHECK_NIH(val)
#define OT_CHECK_ENUM(ename, val)
Struct to represent the data from the LcConfigC …
Struct to represent the data from the LcSettingC …
PyObject_HEAD MK_OBJ hdl