pylcconfig 9.0
Loading...
Searching...
No Matches
LcConfigC_python.c
Go to the documentation of this file.
1
12/* VAR-START */
13
14#define NHI1_FILE_NAME "LcConfigC_python.c"
15
16#include "LibLcConfig_python.h"
17
18#define OT_retObj_CONSTR(mng) OT_retObj_SET(NS(LcConfigC_CTOR)((PyTypeObject*)class,mng))
19
20#define OT_SETUP_hdl OT_SETUP_hdl_tmpl(Lc,LcConfigC,0)
21#define OT_SETUP_hdl_constr MK_RT_UNUSED LcRtSetup_NULL; \
22 LC_CFG hdl = (LC_CFG) &MkERROR;
23#define OT_SETUP_hdl_destr OT_SETUP_hdl_tmpl(Lc,LcConfigC,1)
24#define OT_SETUP_hdl_static MK_RT_UNUSED LcRtSetup_NULL; \
25 __attribute__((unused)) MK_TYP hdl = LcConfigC##_TT;
26
27#define OT_SETUP_hdl_static_constr OT_SETUP_hdl_static
28
29__attribute__((unused)) static PyObject *
30NS(LcConfigC_CTOR) (PyTypeObject *type, LC_CFG hdl)
31{
32 return MK(MkObjectC_atomCreate)(type,LcConfigC_X2obj(hdl),true);
33}
34
35PyObject *
36NS(LcConfigC_ObjNew) (PyTypeObject *type, LC_CFG hdl)
37{
38 return MK(MkObjectC_atomObjNew)(type,LcConfigC_X2obj(hdl),true);
39}
40
41/* VAR-END */
42
43#define META_CONTEXT_S MK_ERROR_DEFAULT
44
50
51// BEGIN-DOC - created by 'py_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
52
53// doc-key: LcConfigC,LcConfig,sCc,func
54#define Create_doc "LcConfigC LcConfigC.Create()"
55#define new_doc "LcConfigC LcConfigC.new()"
56
57// doc-key: LcConfigC,LcConfig,sc_,func
58#define FromHandle_doc "LcConfigC LcConfigC.FromHandle(exporthdl:long)"
59#define Instances_doc "LcConfigC LcConfigC.Instances()"
60
61// doc-key: LcConfigC,LcConfig,oc_,func
62#define Lookup_doc "LcSettingC config.Lookup(path:string) (const)"
63#define Next_doc "LcConfigC cfg.Next()"
64#define Prev_doc "LcConfigC cfg.Prev()"
65#define RootSetting_doc "LcSettingC config.RootSetting() (const)"
66
67// doc-key: LcConfigC,LcConfig,om_,func
68#define Clear_doc "config.Clear()"
69#define ErrorType_doc "LcErrorTypeE config.ErrorType() (const)"
70#define GetDefaultFormat_doc "LcConfigFormatE config.GetDefaultFormat() (const)"
71#define GetFloatPrecision_doc "int16 config.GetFloatPrecision() (const)"
72#define GetIncludeDir_doc "string config.GetIncludeDir() (const)"
73#define GetOption_doc "bool config.GetOption(option:LcConfigOptionsEF) (const)"
74#define GetOptions_doc "LcConfigOptionsEF config.GetOptions() (const)"
75#define GetTabWidth_doc "int16 config.GetTabWidth() (const)"
76#define Log_doc "cfg.Log(?fmtobj:MkObjectC=None?, ?debug:int32=0?, ?callfunc:string=\"\"?, ?lvl:int32=0?) (const)"
77#define ReadFile_doc "config.ReadFile(filename:string)"
78#define ReadString_doc "config.ReadString(str:string)"
79#define SetDefaultFormat_doc "config.SetDefaultFormat(format:LcConfigFormatE)"
80#define SetFloatPrecision_doc "config.SetFloatPrecision(digits:int16)"
81#define SetIncludeDir_doc "config.SetIncludeDir(include_dir:string)"
82#define SetIncludeFunc_doc "cfg.SetIncludeFunc(fConfigIncludeData:LC_CBP)"
83#define SetOption_doc "config.SetOption(option:LcConfigOptionsEF, flag:bool)"
84#define SetOptions_doc "config.SetOptions(options:LcConfigOptionsEF)"
85#define SetSettingDeleteFunc_doc "cfg.SetSettingDeleteFunc(fSettingDeleteData:LC_CBP)"
86#define SetTabWidth_doc "config.SetTabWidth(width:int16)"
87#define WriteFile_doc "config.WriteFile(filename:string)"
88
89// doc-key: LcConfigC,LcConfig,omo,func
90#define LookupBool_doc "bool config.LookupBool(path:string) (const)"
91#define LookupFloat_doc "double config.LookupFloat(path:string) (const)"
92#define LookupInt_doc "int32 config.LookupInt(path:string) (const)"
93#define LookupInt64_doc "int64 config.LookupInt64(path:string) (const)"
94#define LookupString_doc "string config.LookupString(path:string) (const)"
95#define WriteString_doc "string cfg.WriteString() (const)"
96// END-DOC - created by 'py_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
97
98// ---------------------------------------------------------------------------------------
99
105
106// ---------------------------------------------------------------------------------------
107
108// BEGIN-LcConfigC - created by 'py_MqC.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
109
113
114// doc-key: LcConfigC,LcConfigC-Error,om_
115
117static OT_ProcRet NS(LcConfigC_ErrorType) (LcConfigC_ARGS) {
119 OT_SETUP_NOARG(ErrorType_doc)
120 OT_CHECK_NOARGS
121 OT_retObj_SET(OT_NEW_Lc_enum_OBJ(ErrorTypeE,LcConfigErrorType (hdl)))
122 goto end;
123 error:
124 OT_retObj_SET_Error
125 end:
126 OT_retObj_RETURN
127}
128
130
134
135// doc-key: LcConfigC,LcConfigC-Get,om_
136
138static OT_ProcRet NS(LcConfigC_GetDefaultFormat) (LcConfigC_ARGS) {
140 OT_SETUP_NOARG(GetDefaultFormat_doc)
141 OT_CHECK_NOARGS
142 OT_retObj_SET(OT_NEW_Lc_enum_OBJ(ConfigFormatE,LcConfigGetDefaultFormat (hdl)))
143 goto end;
144 error:
145 OT_retObj_SET_Error
146 end:
147 OT_retObj_RETURN
148}
149
151static OT_ProcRet NS(LcConfigC_GetFloatPrecision) (LcConfigC_ARGS) {
153 OT_SETUP_NOARG(GetFloatPrecision_doc)
154 OT_CHECK_NOARGS
155 OT_retObj_SET_SRT(LcConfigGetFloatPrecision (hdl))
156 goto end;
157 error:
158 OT_retObj_SET_Error
159 end:
160 OT_retObj_RETURN
161}
162
164static OT_ProcRet NS(LcConfigC_GetIncludeDir) (LcConfigC_ARGS) {
166 OT_SETUP_NOARG(GetIncludeDir_doc)
167 OT_CHECK_NOARGS
168 OT_retObj_SET_STR(LcConfigGetIncludeDir (hdl))
169 goto end;
170 error:
171 OT_retObj_SET_Error
172 end:
173 OT_retObj_RETURN
174}
175
177static OT_ProcRet NS(LcConfigC_GetOption) (LcConfigC_ARGS) {
179 OT_SETUP_ONEARG(GetOption_doc)
180 enum LcConfigOptionsEF option = 0;
181 OT_CHECK_REQUIRED(OT_CHECK_ENUM (LcConfigOptionsEF,option))
182 OT_CHECK_NOARGS
183 OT_retObj_SET_BOL(LcConfigGetOption (hdl, option))
184 goto end;
185 error:
186 OT_retObj_SET_Error
187 end:
188 OT_retObj_RETURN
189}
190
192static OT_ProcRet NS(LcConfigC_GetOptions) (LcConfigC_ARGS) {
194 OT_SETUP_NOARG(GetOptions_doc)
195 OT_CHECK_NOARGS
196 OT_retObj_SET(OT_NEW_Lc_enum_OBJ(ConfigOptionsEF,LcConfigGetOptions (hdl)))
197 goto end;
198 error:
199 OT_retObj_SET_Error
200 end:
201 OT_retObj_RETURN
202}
203
205static OT_ProcRet NS(LcConfigC_GetTabWidth) (LcConfigC_ARGS) {
207 OT_SETUP_NOARG(GetTabWidth_doc)
208 OT_CHECK_NOARGS
209 OT_retObj_SET_SRT(LcConfigGetTabWidth (hdl))
210 goto end;
211 error:
212 OT_retObj_SET_Error
213 end:
214 OT_retObj_RETURN
215}
216
218
222
223// doc-key: LcConfigC,LcConfigC-Introspection,oc_
224
226static OT_ProcRet NS(LcConfigC_Next) (LcConfigC_ARGS) {
228 OT_SETUP_NOARG(Next_doc)
229 OT_CHECK_NOARGS
230 LC_CFG retVal = LcConfigNext (hdl);
231 OT_retObj_SET_CFG(retVal)
232 goto end;
233 error:
234 OT_retObj_SET_Error
235 end:
236 OT_retObj_RETURN
237}
238
240static OT_ProcRet NS(LcConfigC_Prev) (LcConfigC_ARGS) {
242 OT_SETUP_NOARG(Prev_doc)
243 OT_CHECK_NOARGS
244 LC_CFG retVal = LcConfigPrev (hdl);
245 OT_retObj_SET_CFG(retVal)
246 goto end;
247 error:
248 OT_retObj_SET_Error
249 end:
250 OT_retObj_RETURN
251}
252
253
254// doc-key: LcConfigC,LcConfigC-Introspection,sc_
255
257static OT_ProcRet NS(LcConfigC_Instances) (OtClass_ARGS) {
259 OT_SETUP_NOARG(Instances_doc)
260 OT_CHECK_NOARGS
261 LC_CFG retVal = LcConfigInstances ();
262 if (retVal == NULL) {
263 OT_retObj_SET_None
264 goto end;
265 }
266 OT_retObj_SET_CFG(retVal)
267 goto end;
268 error:
269 OT_retObj_SET_Error
270 end:
271 OT_retObj_RETURN
272}
273
275
279
280// doc-key: LcConfigC,LcConfigC-Lookup,oc_
281
283static OT_ProcRet NS(LcConfigC_Lookup) (LcConfigC_ARGS) {
285 OT_SETUP_ONEARG(Lookup_doc)
286 MK_STRN path = 0;
287 OT_CHECK_REQUIRED(OT_CHECK_STRN (path))
288 OT_CHECK_NOARGS
289 LC_CFS retVal = LcConfigLookup (hdl, path);
290 if (retVal == NULL) {
291 OT_ERROR_CONSTRUCTOR(LcSettingC)
292 goto error;
293 }
294 OT_retObj_SET_CFS(retVal)
295 goto end;
296 error:
297 OT_retObj_SET_Error
298 end:
299 OT_retObj_RETURN
300}
301
302
303// doc-key: LcConfigC,LcConfigC-Lookup,omo
304
306static OT_ProcRet NS(LcConfigC_LookupBool) (LcConfigC_ARGS) {
308 OT_SETUP_ONEARG(LookupBool_doc)
309 MK_STRN path = 0;
310 OT_CHECK_REQUIRED(OT_CHECK_STRN (path))
311 OT_CHECK_NOARGS
312 MK_BOOL value_out;
313 MkErrorC_Check(hdl,LcConfigLookupBool (hdl, path, &value_out));
314 OT_retObj_SET_BOL(value_out)
315 goto end;
316 error:
317 OT_retObj_SET_Error
318 end:
319 OT_retObj_RETURN
320}
321
323static OT_ProcRet NS(LcConfigC_LookupFloat) (LcConfigC_ARGS) {
325 OT_SETUP_ONEARG(LookupFloat_doc)
326 MK_STRN path = 0;
327 OT_CHECK_REQUIRED(OT_CHECK_STRN (path))
328 OT_CHECK_NOARGS
329 MK_DBL value_out;
330 MkErrorC_Check(hdl,LcConfigLookupFloat (hdl, path, &value_out));
331 OT_retObj_SET_DBL(value_out)
332 goto end;
333 error:
334 OT_retObj_SET_Error
335 end:
336 OT_retObj_RETURN
337}
338
340static OT_ProcRet NS(LcConfigC_LookupInt) (LcConfigC_ARGS) {
342 OT_SETUP_ONEARG(LookupInt_doc)
343 MK_STRN path = 0;
344 OT_CHECK_REQUIRED(OT_CHECK_STRN (path))
345 OT_CHECK_NOARGS
346 MK_INT value_out;
347 MkErrorC_Check(hdl,LcConfigLookupInt (hdl, path, &value_out));
348 OT_retObj_SET_INT(value_out)
349 goto end;
350 error:
351 OT_retObj_SET_Error
352 end:
353 OT_retObj_RETURN
354}
355
357static OT_ProcRet NS(LcConfigC_LookupInt64) (LcConfigC_ARGS) {
359 OT_SETUP_ONEARG(LookupInt64_doc)
360 MK_STRN path = 0;
361 OT_CHECK_REQUIRED(OT_CHECK_STRN (path))
362 OT_CHECK_NOARGS
363 MK_WID value_out;
364 MkErrorC_Check(hdl,LcConfigLookupInt64 (hdl, path, &value_out));
365 OT_retObj_SET_WID(value_out)
366 goto end;
367 error:
368 OT_retObj_SET_Error
369 end:
370 OT_retObj_RETURN
371}
372
374static OT_ProcRet NS(LcConfigC_LookupString) (LcConfigC_ARGS) {
376 OT_SETUP_ONEARG(LookupString_doc)
377 MK_STRN path = 0;
378 OT_CHECK_REQUIRED(OT_CHECK_STRN (path))
379 OT_CHECK_NOARGS
380 MK_STRN value_out;
381 MkErrorC_Check(hdl,LcConfigLookupString (hdl, path, &value_out));
382 OT_retObj_SET_STR(value_out)
383 goto end;
384 error:
385 OT_retObj_SET_Error
386 end:
387 OT_retObj_RETURN
388}
389
391
395
396// doc-key: LcConfigC,LcConfigC-Misc,oc_
397
399static OT_ProcRet NS(LcConfigC_RootSetting) (LcConfigC_ARGS) {
401 OT_SETUP_NOARG(RootSetting_doc)
402 OT_CHECK_NOARGS
403 LC_CFS retVal = LcConfigRootSetting (hdl);
404 OT_retObj_SET_CFS(retVal)
405 goto end;
406 error:
407 OT_retObj_SET_Error
408 end:
409 OT_retObj_RETURN
410}
411
412
413// doc-key: LcConfigC,LcConfigC-Misc,om_
414
416static OT_ProcRet NS(LcConfigC_Clear) (LcConfigC_ARGS) {
418 OT_SETUP_NOARG(Clear_doc)
419 OT_CHECK_NOARGS
420 LcConfigClear (hdl);
421 OT_retObj_SET_None
422 goto end;
423 error:
424 OT_retObj_SET_Error
425 end:
426 OT_retObj_RETURN
427}
428
430static OT_ProcRet NS(LcConfigC_Log) (LcConfigC_ARGS) {
432 OT_SETUP_VARARGS(0,4,Log_doc)
433 MK_OBJN fmtobj = NULL;
434 OT_CHECK_OPTIONAL(OT_CHECK_OBJ (fmtobj))
435 MK_DBG debug = 0;
436 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (debug))
437 MK_STRN callfunc = "";
438 OT_CHECK_OPTIONAL(OT_CHECK_STRN (callfunc))
439 MK_INT lvl = 0;
440 OT_CHECK_OPTIONAL(OT_CHECK_NI4 (lvl))
441 OT_CHECK_NOARGS
442 if (debug > MkRuntimeGetDebug()) {
443 OT_retObj_SET_None;
444 goto end;
445 }
446 if (strcmp(callfunc,"")==0) {callfunc = OT_GET_CALL_PROC;}
447 LcConfigLog (hdl, fmtobj, debug, callfunc, lvl);
448 OT_retObj_SET_None
449 goto end;
450 error:
451 OT_retObj_SET_Error
452 end:
453 OT_retObj_RETURN
454}
455
457static OT_ProcRet NS(LcConfigC_ReadFile) (LcConfigC_ARGS) {
459 OT_SETUP_ONEARG(ReadFile_doc)
460 MK_STRN filename = 0;
461 OT_CHECK_REQUIRED(OT_CHECK_STRN (filename))
462 OT_CHECK_NOARGS
463 MkErrorC_Check(hdl,LcConfigReadFile (hdl, filename));
464 OT_retObj_SET_None
465 goto end;
466 error:
467 OT_retObj_SET_Error
468 end:
469 OT_retObj_RETURN
470}
471
473static OT_ProcRet NS(LcConfigC_ReadString) (LcConfigC_ARGS) {
475 OT_SETUP_ONEARG(ReadString_doc)
476 MK_STRN str = 0;
477 OT_CHECK_REQUIRED(OT_CHECK_STRN (str))
478 OT_CHECK_NOARGS
479 MkErrorC_Check(hdl,LcConfigReadString (hdl, str));
480 OT_retObj_SET_None
481 goto end;
482 error:
483 OT_retObj_SET_Error
484 end:
485 OT_retObj_RETURN
486}
487
489static OT_ProcRet NS(LcConfigC_WriteFile) (LcConfigC_ARGS) {
491 OT_SETUP_ONEARG(WriteFile_doc)
492 MK_STRN filename = 0;
493 OT_CHECK_REQUIRED(OT_CHECK_STRN (filename))
494 OT_CHECK_NOARGS
495 MkErrorC_Check(hdl,LcConfigWriteFile (hdl, filename));
496 OT_retObj_SET_None
497 goto end;
498 error:
499 OT_retObj_SET_Error
500 end:
501 OT_retObj_RETURN
502}
503
504
505// doc-key: LcConfigC,LcConfigC-Misc,omo
506
508static OT_ProcRet NS(LcConfigC_WriteString) (LcConfigC_ARGS) {
510 OT_SETUP_NOARG(WriteString_doc)
511 OT_CHECK_NOARGS
512 MK_STRN val_out;
513 MkErrorC_Check(hdl,LcConfigWriteString (hdl, &val_out));
514 OT_retObj_SET_STR(val_out)
515 goto end;
516 error:
517 OT_retObj_SET_Error
518 end:
519 OT_retObj_RETURN
520}
521
523
527
528// doc-key: LcConfigC,LcConfigC-Set,om_
529
531static OT_ProcRet NS(LcConfigC_SetDefaultFormat) (LcConfigC_ARGS) {
533 OT_SETUP_ONEARG(SetDefaultFormat_doc)
534 enum LcConfigFormatE format = 0;
535 OT_CHECK_REQUIRED(OT_CHECK_ENUM (LcConfigFormatE,format))
536 OT_CHECK_NOARGS
537 LcConfigSetDefaultFormat (hdl, format);
538 OT_retObj_SET_None
539 goto end;
540 error:
541 OT_retObj_SET_Error
542 end:
543 OT_retObj_RETURN
544}
545
547static OT_ProcRet NS(LcConfigC_SetFloatPrecision) (LcConfigC_ARGS) {
549 OT_SETUP_ONEARG(SetFloatPrecision_doc)
550 MK_SRT digits = 0;
551 OT_CHECK_REQUIRED(OT_CHECK_NI2 (digits))
552 OT_CHECK_NOARGS
553 LcConfigSetFloatPrecision (hdl, digits);
554 OT_retObj_SET_None
555 goto end;
556 error:
557 OT_retObj_SET_Error
558 end:
559 OT_retObj_RETURN
560}
561
563static OT_ProcRet NS(LcConfigC_SetIncludeDir) (LcConfigC_ARGS) {
565 OT_SETUP_ONEARG(SetIncludeDir_doc)
566 MK_STRN include_dir = 0;
567 OT_CHECK_REQUIRED(OT_CHECK_STRN (include_dir))
568 OT_CHECK_NOARGS
569 LcConfigSetIncludeDir (hdl, include_dir);
570 OT_retObj_SET_None
571 goto end;
572 error:
573 OT_retObj_SET_Error
574 end:
575 OT_retObj_RETURN
576}
577
579static OT_ProcRet NS(LcConfigC_SetIncludeFunc) (LcConfigC_ARGS) {
581 OT_SETUP_ONEARG(SetIncludeFunc_doc)
582 LC_CBP fConfigIncludeData = 0;
583 OT_CHECK_REQUIRED(OT_CHECK_CALLABLE(fConfigIncludeData))
584 OT_CHECK_NOARGS
585 MkErrorC_Check(hdl,LcConfigSetIncludeFunc (hdl, NS(LcConfigIncludeCall), fConfigIncludeData, NS(LcConfigIncludeFree)));
586 OT_retObj_SET_None
587 goto end;
588 error:
589 OT_retObj_SET_Error
590 end:
591 OT_retObj_RETURN
592}
593
595static OT_ProcRet NS(LcConfigC_SetOption) (LcConfigC_ARGS) {
597 OT_SETUP_VARARGS(2,2,SetOption_doc)
598 enum LcConfigOptionsEF option = 0;
599 OT_CHECK_REQUIRED(OT_CHECK_ENUM (LcConfigOptionsEF,option))
600 MK_BOOL flag = 0;
601 OT_CHECK_REQUIRED(OT_CHECK_bool (flag))
602 OT_CHECK_NOARGS
603 LcConfigSetOption (hdl, option, flag);
604 OT_retObj_SET_None
605 goto end;
606 error:
607 OT_retObj_SET_Error
608 end:
609 OT_retObj_RETURN
610}
611
613static OT_ProcRet NS(LcConfigC_SetOptions) (LcConfigC_ARGS) {
615 OT_SETUP_ONEARG(SetOptions_doc)
616 enum LcConfigOptionsEF options = 0;
617 OT_CHECK_REQUIRED(OT_CHECK_ENUM (LcConfigOptionsEF,options))
618 OT_CHECK_NOARGS
619 LcConfigSetOptions (hdl, options);
620 OT_retObj_SET_None
621 goto end;
622 error:
623 OT_retObj_SET_Error
624 end:
625 OT_retObj_RETURN
626}
627
629static OT_ProcRet NS(LcConfigC_SetSettingDeleteFunc) (LcConfigC_ARGS) {
631 OT_SETUP_ONEARG(SetSettingDeleteFunc_doc)
632 LC_CBP fSettingDeleteData = 0;
633 OT_CHECK_REQUIRED(OT_CHECK_CALLABLE(fSettingDeleteData))
634 OT_CHECK_NOARGS
635 MkErrorC_Check(hdl,LcConfigSetSettingDeleteFunc (hdl, NS(LcSettingDeleteCall), fSettingDeleteData, NS(LcSettingDeleteFree)));
636 OT_retObj_SET_None
637 goto end;
638 error:
639 OT_retObj_SET_Error
640 end:
641 OT_retObj_RETURN
642}
643
645static OT_ProcRet NS(LcConfigC_SetTabWidth) (LcConfigC_ARGS) {
647 OT_SETUP_ONEARG(SetTabWidth_doc)
648 MK_SRT width = 0;
649 OT_CHECK_REQUIRED(OT_CHECK_NI2 (width))
650 OT_CHECK_NOARGS
651 LcConfigSetTabWidth (hdl, width);
652 OT_retObj_SET_None
653 goto end;
654 error:
655 OT_retObj_SET_Error
656 end:
657 OT_retObj_RETURN
658}
659
661
665
666// doc-key: LcConfigC,LcConfigC-TOR,sCc
667
669static OT_ProcRet NS(LcConfigC_Create) (OtClass_ARGS) {
671 OT_SETUP_NOARG(Create_doc)
672 OT_CHECK_NOARGS
673 LC_CFG retVal = LcConfigCreate (NULL, NULL);
674 if (retVal == NULL) {
675 OT_ERROR_CONSTRUCTOR(LcConfigC)
676 goto error;
677 }
678 OT_CONSTRUCTOR_POST(retVal)
679 OT_retObj_SET_CFG(retVal)
680 goto end;
681 error:
682 OT_retObj_SET_Error
683 end:
684 OT_retObj_RETURN
685}
686
688static OT_ProcRet NS(LcConfigC_new) (CONSTR_ARGS) {
690 OT_SETUP_CONSTRUCTOR_ARGS(0,0,new_doc)
691 LC_CFG retVal = LcConfigCreate (NULL, NULL);
692 if (retVal == NULL) {
693 OT_ERROR_CONSTRUCTOR(LcConfigC)
694 goto error;
695 }
696 OT_CONSTRUCTOR_POST(retVal)
697 OT_retObj_CONSTR(retVal)
698 goto end;
699 error:
700 OT_retObj_SET_Error
701 end:
702 OT_retObj_RETURN
703}
704
705
706// doc-key: LcConfigC,LcConfigC-TOR,sc_
707
709static OT_ProcRet NS(LcConfigC_FromHandle) (OtClass_ARGS) {
711 OT_SETUP_ONEARG(FromHandle_doc)
712 MK_LONG exporthdl = 0;
713 OT_CHECK_REQUIRED(OT_CHECK_NIL (exporthdl))
714 OT_CHECK_NOARGS
715 LC_CFG retVal = LcConfigFromHandle (exporthdl);
716 if (retVal == NULL) {
717 OT_ERROR_CONSTRUCTOR(LcConfigC)
718 goto error;
719 }
720 OT_retObj_SET_CFG(retVal)
721 goto end;
722 error:
723 OT_retObj_SET_Error
724 end:
725 OT_retObj_RETURN
726}
727
729// END-LcConfigC - created by 'py_MqC.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
730
731// vim: Marker(t)
737
738static PyMethodDef LcConfigC_Methods[] = {
739
740 // BEGIN-CLASS - created by 'py_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
741
742 // doc-key: LcConfigC,LcConfig,sCc
743 { "Create" , (PyCFunction) NS(LcConfigC_Create) , METH_NOARGS|METH_CLASS , Create_doc },
744
745 // doc-key: LcConfigC,LcConfig,sc_
746 { "FromHandle" , (PyCFunction) NS(LcConfigC_FromHandle) , METH_O|METH_CLASS , FromHandle_doc },
747 { "Instances" , (PyCFunction) NS(LcConfigC_Instances) , METH_NOARGS|METH_CLASS , Instances_doc },
748 // END-CLASS - created by 'py_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
749
750 // BEGIN-OBJ - created by 'py_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
751
752 // doc-key: LcConfigC,LcConfig,oc_
753 { "Lookup" , (PyCFunction) NS(LcConfigC_Lookup) , METH_O , Lookup_doc },
754 { "Next" , (PyCFunction) NS(LcConfigC_Next) , METH_NOARGS , Next_doc },
755 { "Prev" , (PyCFunction) NS(LcConfigC_Prev) , METH_NOARGS , Prev_doc },
756 { "RootSetting" , (PyCFunction) NS(LcConfigC_RootSetting) , METH_NOARGS , RootSetting_doc },
757
758 // doc-key: LcConfigC,LcConfig,om_
759 { "Clear" , (PyCFunction) NS(LcConfigC_Clear) , METH_NOARGS , Clear_doc },
760 { "ErrorType" , (PyCFunction) NS(LcConfigC_ErrorType) , METH_NOARGS , ErrorType_doc },
761 { "GetDefaultFormat" , (PyCFunction) NS(LcConfigC_GetDefaultFormat) , METH_NOARGS , GetDefaultFormat_doc },
762 { "GetFloatPrecision" , (PyCFunction) NS(LcConfigC_GetFloatPrecision) , METH_NOARGS , GetFloatPrecision_doc },
763 { "GetIncludeDir" , (PyCFunction) NS(LcConfigC_GetIncludeDir) , METH_NOARGS , GetIncludeDir_doc },
764 { "GetOption" , (PyCFunction) NS(LcConfigC_GetOption) , METH_O , GetOption_doc },
765 { "GetOptions" , (PyCFunction) NS(LcConfigC_GetOptions) , METH_NOARGS , GetOptions_doc },
766 { "GetTabWidth" , (PyCFunction) NS(LcConfigC_GetTabWidth) , METH_NOARGS , GetTabWidth_doc },
767 { "Log" , (PyCFunction) NS(LcConfigC_Log) , METH_VARARGS , Log_doc },
768 { "ReadFile" , (PyCFunction) NS(LcConfigC_ReadFile) , METH_O , ReadFile_doc },
769 { "ReadString" , (PyCFunction) NS(LcConfigC_ReadString) , METH_O , ReadString_doc },
770 { "SetDefaultFormat" , (PyCFunction) NS(LcConfigC_SetDefaultFormat) , METH_O , SetDefaultFormat_doc },
771 { "SetFloatPrecision" , (PyCFunction) NS(LcConfigC_SetFloatPrecision) , METH_O , SetFloatPrecision_doc },
772 { "SetIncludeDir" , (PyCFunction) NS(LcConfigC_SetIncludeDir) , METH_O , SetIncludeDir_doc },
773 { "SetIncludeFunc" , (PyCFunction) NS(LcConfigC_SetIncludeFunc) , METH_O , SetIncludeFunc_doc },
774 { "SetOption" , (PyCFunction) NS(LcConfigC_SetOption) , METH_VARARGS , SetOption_doc },
775 { "SetOptions" , (PyCFunction) NS(LcConfigC_SetOptions) , METH_O , SetOptions_doc },
776 { "SetSettingDeleteFunc" , (PyCFunction) NS(LcConfigC_SetSettingDeleteFunc) , METH_O , SetSettingDeleteFunc_doc },
777 { "SetTabWidth" , (PyCFunction) NS(LcConfigC_SetTabWidth) , METH_O , SetTabWidth_doc },
778 { "WriteFile" , (PyCFunction) NS(LcConfigC_WriteFile) , METH_O , WriteFile_doc },
779
780 // doc-key: LcConfigC,LcConfig,omo
781 { "LookupBool" , (PyCFunction) NS(LcConfigC_LookupBool) , METH_O , LookupBool_doc },
782 { "LookupFloat" , (PyCFunction) NS(LcConfigC_LookupFloat) , METH_O , LookupFloat_doc },
783 { "LookupInt" , (PyCFunction) NS(LcConfigC_LookupInt) , METH_O , LookupInt_doc },
784 { "LookupInt64" , (PyCFunction) NS(LcConfigC_LookupInt64) , METH_O , LookupInt64_doc },
785 { "LookupString" , (PyCFunction) NS(LcConfigC_LookupString) , METH_O , LookupString_doc },
786 { "WriteString" , (PyCFunction) NS(LcConfigC_WriteString) , METH_NOARGS , WriteString_doc },
787 // END-OBJ - created by 'py_MqS.tcl -i NHI1_HOME/theConfig/liblcconfig/.liblcconfig.meta' - DO NOT change
788
789 {NULL, NULL, 0, NULL} /* Sentinel */
790};
791
792PyTypeObject NS(LcConfigC) = {
793 PyVarObject_HEAD_INIT(NULL, 0)
794 .tp_name = "pymsgque.LcConfigC",
795 .tp_doc = "PyMsgque LcConfigC Type",
796 .tp_basicsize = sizeof(LcConfigC_Obj),
797 .tp_itemsize = 0,
798 .tp_new = (newfunc) NS(LcConfigC_new),
799 .tp_flags = Py_TPFLAGS_DEFAULT,
800 .tp_methods = LcConfigC_Methods,
801 .tp_base = &MK(MkObjectC)
802};
803
804// vim: Marker(p)
810
811// vim: nowrap
enum MkErrorE LcConfigIncludeCall(LcConfigIncludeCallF_ARGS)
void LcConfigIncludeFree(LcConfigIncludeFreeF_ARGS)
#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 OT_retObj_CONSTR(mng)
#define LookupFloat_doc
#define ErrorType_doc
#define Log_doc
#define SetOptions_doc
#define SetTabWidth_doc
#define SetSettingDeleteFunc_doc
#define Next_doc
#define GetTabWidth_doc
#define Create_doc
#define LookupInt_doc
#define Prev_doc
#define SetFloatPrecision_doc
#define FromHandle_doc
#define LookupString_doc
#define OT_SETUP_hdl_static
#define OT_SETUP_hdl_constr
#define GetFloatPrecision_doc
static PyMethodDef LcConfigC_Methods[]
#define WriteFile_doc
#define SetDefaultFormat_doc
#define new_doc
#define RootSetting_doc
#define LookupInt64_doc
#define GetOptions_doc
#define Clear_doc
#define GetOption_doc
#define GetDefaultFormat_doc
#define GetIncludeDir_doc
MK_PTRB * LC_CBP
#define LcConfigC_X2obj(x)
enum LcErrorTypeE LcConfigErrorType(LC_CFGN config)
This function, which is implemented as a macro, returns the type of error that occurred during the la...
MK_SRT LcConfigGetTabWidth(LC_CFGN config)
These functions, which are implemented as macros, get and set the tab width for the configuration con...
MK_STRN LcConfigGetIncludeDir(LC_CFGN config)
ConfigSetIncludeDir specifies the include directory, include_dir, relative to which the files specifi...
enum LcConfigOptionsEF LcConfigGetOptions(LC_CFGN config)
These functions get and set the options for the configuration config …
MK_SRT LcConfigGetFloatPrecision(LC_CFGN config)
Since v1.6 These functions get and set the number of decimal digits to output after the radix charact...
MK_BOOL LcConfigGetOption(LC_CFGN config, enum LcConfigOptionsEF option)
Since v1.7 These functions get and set the given option of the configuration config …
enum LcConfigFormatE LcConfigGetDefaultFormat(LC_CFGN config)
These functions, which are implemented as macros, get and set the default external format for setting...
LC_CFG LcConfigPrev(LC_CFG const cfg)
get previous instance from linked-list of LcConfigS type
LC_CFG LcConfigNext(LC_CFG const cfg)
get next instance from linked-list of LcConfigS type
LC_CFG LcConfigInstances(void)
get head-instance from linked-list of LcConfigS type …
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...
enum MkErrorE LcConfigLookupInt64(LC_CFGN config, MK_STRN path, MK_WID *value_out)
These functions look up the value of the setting in the configuration config specified by the path pa...
enum MkErrorE LcConfigLookupInt(LC_CFGN config, MK_STRN path, MK_INT *value_out)
These functions look up the value of the setting in the configuration config specified by the path pa...
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...
LC_CFS LcConfigLookup(LC_CFGN config, MK_STRN path)
This function locates the setting in the configuration config specified by the path path …
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...
enum MkErrorE LcConfigWriteFile(LC_CFG config, MK_STRN filename)
This function writes the configuration config to the file named filename …
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...
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...
LC_CFS LcConfigRootSetting(LC_CFGN config)
This function, which is implemented as a macro, returns the root setting for the configuration config...
void LcConfigClear(LC_CFG config)
Since v1.7 This function clears the configuration config …
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 …
void LcConfigSetIncludeDir(LC_CFG config, MK_STRN include_dir)
ConfigSetIncludeDir specifies the include directory, include_dir, relative to which the files specifi...
void LcConfigSetOptions(LC_CFG config, enum LcConfigOptionsEF options)
These functions get and set the options for the configuration config …
void LcConfigSetTabWidth(LC_CFG config, MK_SRT width)
These functions, which are implemented as macros, get and set the tab width for the configuration con...
void LcConfigSetDefaultFormat(LC_CFG config, enum LcConfigFormatE format)
These functions, which are implemented as macros, get and set the default external format for setting...
void LcConfigSetFloatPrecision(LC_CFG config, MK_SRT digits)
Since v1.6 These functions get and set the number of decimal digits to output after the radix charact...
LC_CFG LcConfigFromHandle(MK_LONG const exporthdl)
return a LcConfigC from exporthdl…
LC_CFG LcConfigC_ObjNew(config_t *hdl)
return Programming-Language-Micro-Kernel instance from hdl …
LC_CFG LcConfigCreate(MK_TYP type, config_t *nat)
create a LcConfigC instance …
LcConfigFormatE
set the format of a LcSettingC …
LcConfigOptionsEF
configuration options for config-file-layout
const MK_STRB * MK_STRN
bool MK_BOOL
int64_t MK_WID
signed short MK_SRT
long MK_LONG
double MK_DBL
signed int MK_INT
int MK_DBG
MK_INT MkRuntimeGetDebug(void)
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 …