13#define OT_SETUP_hdl MkRtSetup_NULL; \
14 MK_OBJ hdl = MK_ERROR_PRINT;
15#define OT_SETUP_hdl_static __attribute__((unused)) MK_RT mkrt = MkRT; \
16 __attribute__((unused)) MK_ERR hdl = &MkERROR;
19#define LcCleanupTmpl()
80#define ConfigFormatE_FromInt_doc "LcConfigFormatE ConfigFormatE_FromInt(value:int32)"
81#define ConfigOptionsEF_FromInt_doc "LcConfigOptionsEF ConfigOptionsEF_FromInt(value:int32)"
82#define ConfigTypeE_FromInt_doc "LcConfigTypeE ConfigTypeE_FromInt(value:int32)"
83#define ErrorE_FromInt_doc "LcErrorE ErrorE_FromInt(value:int32)"
84#define ErrorTypeE_FromInt_doc "LcErrorTypeE ErrorTypeE_FromInt(value:int32)"
87#define ConfigFormatE_ToInt_doc "int32 ConfigFormatE_ToInt(value:LcConfigFormatE)"
88#define ConfigFormatE_ToString_doc "string ConfigFormatE_ToString(value:LcConfigFormatE)"
89#define ConfigOptionsEF_ToInt_doc "int32 ConfigOptionsEF_ToInt(value:LcConfigOptionsEF)"
90#define ConfigOptionsEF_ToString_doc "string ConfigOptionsEF_ToString(value:LcConfigOptionsEF)"
91#define ConfigTypeE_ToInt_doc "int32 ConfigTypeE_ToInt(value:LcConfigTypeE)"
92#define ConfigTypeE_ToString_doc "string ConfigTypeE_ToString(value:LcConfigTypeE)"
93#define ErrorE_ToInt_doc "int32 ErrorE_ToInt(value:LcErrorE)"
94#define ErrorE_ToString_doc "string ErrorE_ToString(value:LcErrorE)"
95#define ErrorTypeE_ToInt_doc "int32 ErrorTypeE_ToInt(value:LcErrorTypeE)"
96#define ErrorTypeE_ToString_doc "string ErrorTypeE_ToString(value:LcErrorTypeE)"
99#define Cleanup_doc "Cleanup()"
100#define Setup_doc "Setup()"
104#define Debug_doc "Debug(prefix:str, ?obj:object?"
414static PyMethodDef
NS(sLcConfigMethods)[] = {
432 {
"ErrorE_ToInt" , (PyCFunction)
NS(LcConfig_ErrorE_ToInt) , METH_O ,
ErrorE_ToInt_doc },
438 {
"Cleanup" , (PyCFunction)
NS(LcConfig_Cleanup) , METH_NOARGS ,
Cleanup_doc },
439 {
"Setup" , (PyCFunction)
NS(LcConfig_Setup) , METH_NOARGS ,
Setup_doc },
449 {NULL, NULL, 0, NULL}
466}
NS(sLcConfigStateS);
469NS(sLcConfigGetState)(PyObject *module)
471 void *state = PyModule_GetState(module);
472 assert(state != NULL);
473 return (
NS(sLcConfigStateS)*)state;
477NS(sLcConfigTraverse)(PyObject *module, visitproc visit,
void *arg)
498NS(sLcConfigClear)(PyObject *module)
519NS(sLcConfigFree)(
void *module)
521 NS(sLcConfigClear)((PyObject *)module);
525NS(sLcConfigExec)(PyObject *module)
531 NS(sLcConfigStateS) *state =
NS(sLcConfigGetState)(module);
534 PyObject *mainM = PyImport_AddModule(
"__main__");
536 PyObject *mkM = PyImport_ImportModule(
"pymkkernel");
538 ret = PyObject_SetAttrString(mainM,
"pymkkernel",mkM);
554 "from enum import IntEnum, IntFlag\n"
558 "class LcConfigFormatE(IntEnum):\n"
562 "class LcConfigOptionsEF(IntFlag):\n"
565 " SEMICOLON_SEPARATORS = 2\n"
566 " COLON_ASSIGNMENT_FOR_GROUPS = 4\n"
567 " COLON_ASSIGNMENT_FOR_NON_GROUPS = 8\n"
568 " OPEN_BRACE_ON_SEPARATE_LINE = 16\n"
569 " ALLOW_SCIENTIFIC_NOTATION = 32\n"
571 " ALLOW_OVERRIDES = 128\n"
573 "class LcConfigTypeE(IntEnum):\n"
584 "class LcErrorE(IntEnum):\n"
588 "class LcErrorTypeE(IntEnum):\n"
596 PyObject *myD, *mainD, *tmpO;
597 mainD = PyModule_GetDict(mainM);
598 myD = PyModule_GetDict(module);
599 tmpO = PyRun_String(enumCode, Py_file_input, mainD, myD);
607 LcConfigTypeE_lngO = (PyTypeObject*) Py_NewRef(PyDict_GetItemString(myD,
"LcConfigTypeE"));
608 LcErrorE_lngO = (PyTypeObject*) Py_NewRef(PyDict_GetItemString(myD,
"LcErrorE"));
609 LcErrorTypeE_lngO = (PyTypeObject*) Py_NewRef(PyDict_GetItemString(myD,
"LcErrorTypeE"));
619 {Py_mod_exec,
NS(sLcConfigExec)},
620 {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
624static PyModuleDef
NS(sLcConfigDef) = {
625 PyModuleDef_HEAD_INIT,
626 .m_name =
"pylcconfig",
627 .m_doc =
"python language binding for 'theConfig'",
628 .m_size =
sizeof(
NS(sLcConfigStateS)),
629 .m_methods =
NS(sLcConfigMethods),
630 .m_slots =
NS(sLcConfigDefSlots),
631 .m_traverse =
NS(sLcConfigTraverse),
632 .m_clear =
NS(sLcConfigClear),
633 .m_free =
NS(sLcConfigFree),
647 return PyModuleDef_Init(&
NS(sLcConfigDef));
#define ConfigOptionsEF_FromInt_doc
#define ConfigFormatE_ToInt_doc
#define ConfigFormatE_ToString_doc
PyMODINIT_FUNC LibLcConfig(void)
#define ConfigOptionsEF_ToString_doc
#define ErrorTypeE_FromInt_doc
#define ConfigOptionsEF_ToInt_doc
#define ErrorE_ToString_doc
#define ConfigFormatE_FromInt_doc
#define OT_SETUP_hdl_static
#define ErrorE_FromInt_doc
#define ConfigTypeE_FromInt_doc
#define ErrorTypeE_ToInt_doc
#define ConfigTypeE_ToInt_doc
#define ErrorTypeE_ToString_doc
#define ConfigTypeE_ToString_doc
#define LcConfigC_MK_NULL
#define LcConfigFormatE_lngO
#define LcConfigOptionsEF_lngO
#define LcSettingC_MK_NULL
#define LcConfigTypeE_lngO
#define LcErrorTypeE_lngO
#define OT_NEW_Lc_enum_OBJ(typ, val)
#define LngErrorCheckN(PROC)
#define OT_SETUP_NOARG(d)
#define OT_SETUP_ONEARG(d)
#define OtErrorCheckLng(PROC)
#define OT_CHECK_NI4(val)
#define OT_retObj_SET_Error
#define OT_CHECK_REQUIRED(val)
#define OT_retObj_SET_None
#define OT_retObj_SET_I32(nat)
#define OT_retObj_SET_STR(nat)
#define OT_retObj_SET(val)
#define MkErrorC_Check(mng, PROC)
static MK_I32 LcConfigTypeE_ToInt(enum LcConfigTypeE value)
return the LcConfigTypeE as integer …
MK_STRN LcErrorE_ToString(enum LcErrorE value)
return the LcErrorE as string …
static MK_I32 LcErrorE_ToInt(enum LcErrorE value)
return the LcErrorE as integer …
LcErrorE
Signals an error and is used as the return value of a function …
static MK_I32 LcErrorTypeE_ToInt(enum LcErrorTypeE value)
return the LcErrorTypeE as integer …
enum MkErrorE LcConfigFormatE_FromInt(MK_I32 const value, enum LcConfigFormatE *value_out)
return the LcConfigFormatE from integer …
static MK_I32 LcConfigOptionsEF_ToInt(enum LcConfigOptionsEF value)
return the LcConfigOptionsEF as integer …
LcConfigFormatE
set the format of a LcSettingC …
LcConfigOptionsEF
define the configuration-option of a LcConfigC …
static MK_I32 LcConfigFormatE_ToInt(enum LcConfigFormatE value)
return the LcConfigFormatE as integer …
MK_STRN LcConfigTypeE_ToString(enum LcConfigTypeE value)
return the LcConfigTypeE as string …
enum MkErrorE LcErrorTypeE_FromInt(MK_I32 const value, enum LcErrorTypeE *value_out)
return the LcErrorTypeE from integer …
MK_STRN LcErrorTypeE_ToString(enum LcErrorTypeE value)
return the LcErrorTypeE as string …
MK_STRN LcConfigOptionsEF_ToString(enum LcConfigOptionsEF value)
return the LcConfigOptionsEF as string …
LcConfigTypeE
define the data-type of a LcSettingC …
enum MkErrorE LcConfigOptionsEF_FromInt(MK_I32 const value, enum LcConfigOptionsEF *value_out)
return the LcConfigOptionsEF from integer …
enum MkErrorE LcErrorE_FromInt(MK_I32 const value, enum LcErrorE *value_out)
return the LcErrorE from integer …
enum MkErrorE LcConfigTypeE_FromInt(MK_I32 const value, enum LcConfigTypeE *value_out)
return the LcConfigTypeE from integer …
MK_STRN LcConfigFormatE_ToString(enum LcConfigFormatE value)
return the LcConfigFormatE as string …
void LcSetup(void)
setup pylcconfig internal memory …
#define OT_CHECK_ENUM(ename, val)