diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-27-19-40-29.bpo-1635741.X7bcDY.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-27-19-40-29.bpo-1635741.X7bcDY.rst new file mode 100644 index 00000000000000..00039d7a9c1fef --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-08-27-19-40-29.bpo-1635741.X7bcDY.rst @@ -0,0 +1,5 @@ +Port :mod:`_curses_panel` to multi-phase init Port :mod:`_opcode` to +multi-phase init Port :mod:`_testbuffer` to multi-phase init Port +:mod:`overlapped` to multi-phase init and convert to heap types Port +:mod:`signalmodule` to multi-phase init Port :mod:`termios` to multi-phase +init diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c index f124803493d88b..1065eba5a02012 100644 --- a/Modules/_curses_panel.c +++ b/Modules/_curses_panel.c @@ -610,7 +610,6 @@ _curses_panel_update_panels_impl(PyObject *module) Py_RETURN_NONE; } - /* List of functions defined in the module */ static PyMethodDef PyCurses_methods[] = { @@ -622,33 +621,12 @@ static PyMethodDef PyCurses_methods[] = { }; /* Initialization function for the module */ - - -static struct PyModuleDef _curses_panelmodule = { - PyModuleDef_HEAD_INIT, - "_curses_panel", - NULL, - sizeof(_curses_panelstate), - PyCurses_methods, - NULL, - _curses_panel_traverse, - _curses_panel_clear, - _curses_panel_free -}; - -PyMODINIT_FUNC -PyInit__curses_panel(void) +static int _curses_exec(PyObject *m) { - PyObject *m, *d, *v; - - /* Create the module and add the functions */ - m = PyModule_Create(&_curses_panelmodule); - if (m == NULL) - goto fail; - d = PyModule_GetDict(m); + PyObject *d = PyModule_GetDict(m); /* Initialize object type */ - v = PyType_FromSpec(&PyCursesPanel_Type_spec); + PyObject *v = PyType_FromSpec(&PyCursesPanel_Type_spec); if (v == NULL) goto fail; ((PyTypeObject *)v)->tp_new = NULL; @@ -671,8 +649,30 @@ PyInit__curses_panel(void) Py_INCREF(get_curses_panelstate(m)->PyCursesPanel_Type); PyModule_AddObject(m, "panel", (PyObject *)get_curses_panelstate(m)->PyCursesPanel_Type); - return m; + return 0; + fail: - Py_XDECREF(m); - return NULL; + return -1; } + +static PyModuleDef_Slot _curses_slots[] = { + {Py_mod_exec, _curses_exec}, + {0, NULL} +}; + +static struct PyModuleDef _curses_panelmodule = { + PyModuleDef_HEAD_INIT, + .m_name = "_curses_panel", + .m_size = sizeof(_curses_panelstate), + .m_methods = PyCurses_methods, + .m_slots = _curses_slots, + .m_traverse = _curses_panel_traverse, + .m_clear = _curses_panel_clear, + .m_free = _curses_panel_free +}; + +PyMODINIT_FUNC +PyInit__opcode(void) +{ + return PyModuleDef_Init(&_curses_panelmodule); +} \ No newline at end of file diff --git a/Modules/_opcode.c b/Modules/_opcode.c index 42a8732694afef..e431a5fbac4e02 100644 --- a/Modules/_opcode.c +++ b/Modules/_opcode.c @@ -67,30 +67,32 @@ _opcode_stack_effect_impl(PyObject *module, int opcode, PyObject *oparg, return effect; } - - - static PyMethodDef opcode_functions[] = { _OPCODE_STACK_EFFECT_METHODDEF {NULL, NULL, 0, NULL} }; +static int opcode_exec(PyObject *m) { + return 0; +} + +static PyModuleDef_Slot opcode_slots[] = { + {Py_mod_exec, opcode_exec}, + {0, NULL} +}; static struct PyModuleDef opcodemodule = { PyModuleDef_HEAD_INIT, - "_opcode", - "Opcode support module.", - -1, - opcode_functions, - NULL, - NULL, - NULL, - NULL + .m_name = "_opcode", + .m_doc = "Opcode support module.", + .m_size = 0, + .m_methods = opcode_functions, + .m_slots = opcode_slots }; PyMODINIT_FUNC PyInit__opcode(void) { - return PyModule_Create(&opcodemodule); + return PyModuleDef_Init(&opcodemodule); } diff --git a/Modules/_testbuffer.c b/Modules/_testbuffer.c index d8321768bc9729..81984813d04ee6 100644 --- a/Modules/_testbuffer.c +++ b/Modules/_testbuffer.c @@ -2813,28 +2813,8 @@ static struct PyMethodDef _testbuffer_functions[] = { {NULL, NULL} }; -static struct PyModuleDef _testbuffermodule = { - PyModuleDef_HEAD_INIT, - "_testbuffer", - NULL, - -1, - _testbuffer_functions, - NULL, - NULL, - NULL, - NULL -}; - - -PyMODINIT_FUNC -PyInit__testbuffer(void) +static int testbuffer_exec(PyObject *m) { - PyObject *m; - - m = PyModule_Create(&_testbuffermodule); - if (m == NULL) - return NULL; - Py_SET_TYPE(&NDArray_Type, &PyType_Type); Py_INCREF(&NDArray_Type); PyModule_AddObject(m, "ndarray", (PyObject *)&NDArray_Type); @@ -2845,16 +2825,16 @@ PyInit__testbuffer(void) structmodule = PyImport_ImportModule("struct"); if (structmodule == NULL) - return NULL; + return -1; Struct = PyObject_GetAttrString(structmodule, "Struct"); calcsize = PyObject_GetAttrString(structmodule, "calcsize"); if (Struct == NULL || calcsize == NULL) - return NULL; + return -1; simple_format = PyUnicode_FromString(simple_fmt); if (simple_format == NULL) - return NULL; + return -1; PyModule_AddIntMacro(m, ND_MAX_NDIM); PyModule_AddIntMacro(m, ND_VAREXPORT); @@ -2887,8 +2867,22 @@ PyInit__testbuffer(void) PyModule_AddIntMacro(m, PyBUF_READ); PyModule_AddIntMacro(m, PyBUF_WRITE); - return m; + return 0; } +static PyModuleDef_Slot _testbuffer_slots[] = { + {Py_mod_exec, testbuffer_exec}, + {0, NULL} +}; +static struct PyModuleDef _testbuffermodule = { + PyModuleDef_HEAD_INIT, + .m_name = "_testbuffer", + .m_size = 0, + .m_methods = _testbuffer_functions, + .m_slots = _testbuffer_slots +}; +PyMODINIT_FUNC PyInit__testbuffer(void) { + return PyModuleDef_Init(&_testbuffermodule); +} \ No newline at end of file diff --git a/Modules/overlapped.c b/Modules/overlapped.c index 5e7a1bbba76787..edf12d37d402ab 100644 --- a/Modules/overlapped.c +++ b/Modules/overlapped.c @@ -100,6 +100,19 @@ typedef struct { }; } OverlappedObject; +typedef struct { + PyTypeObject *overlapped_type; +} OverlappedState; + +static inline OverlappedState* +overlapped_get_state(PyObject *module) +{ + void *state = PyModule_GetState(module); + assert(state != NULL); + return (OverlappedState *)state; +} + + /* * Map Windows error codes to subclasses of OSError */ @@ -706,6 +719,7 @@ Overlapped_dealloc(OverlappedObject *self) } Overlapped_clear(self); + Py_DECREF(Py_TYPE(self)); PyObject_Del(self); SetLastError(olderr); } @@ -1846,45 +1860,22 @@ static PyGetSetDef Overlapped_getsets[] = { {NULL}, }; -PyTypeObject OverlappedType = { - PyVarObject_HEAD_INIT(NULL, 0) - /* tp_name */ "_overlapped.Overlapped", - /* tp_basicsize */ sizeof(OverlappedObject), - /* tp_itemsize */ 0, - /* tp_dealloc */ (destructor) Overlapped_dealloc, - /* tp_vectorcall_offset */ 0, - /* tp_getattr */ 0, - /* tp_setattr */ 0, - /* tp_as_async */ 0, - /* tp_repr */ 0, - /* tp_as_number */ 0, - /* tp_as_sequence */ 0, - /* tp_as_mapping */ 0, - /* tp_hash */ 0, - /* tp_call */ 0, - /* tp_str */ 0, - /* tp_getattro */ 0, - /* tp_setattro */ 0, - /* tp_as_buffer */ 0, - /* tp_flags */ Py_TPFLAGS_DEFAULT, - /* tp_doc */ _overlapped_Overlapped__doc__, - /* tp_traverse */ (traverseproc)Overlapped_traverse, - /* tp_clear */ 0, - /* tp_richcompare */ 0, - /* tp_weaklistoffset */ 0, - /* tp_iter */ 0, - /* tp_iternext */ 0, - /* tp_methods */ Overlapped_methods, - /* tp_members */ Overlapped_members, - /* tp_getset */ Overlapped_getsets, - /* tp_base */ 0, - /* tp_dict */ 0, - /* tp_descr_get */ 0, - /* tp_descr_set */ 0, - /* tp_dictoffset */ 0, - /* tp_init */ 0, - /* tp_alloc */ 0, - /* tp_new */ _overlapped_Overlapped, +static PyType_Slot overlapped_type_slots[] = { + {Py_tp_dealloc, Overlapped_dealloc}, + {Py_tp_doc, (char *)_overlapped_Overlapped__doc__}, + {Py_tp_traverse, Overlapped_traverse}, + {Py_tp_methods, Overlapped_methods}, + {Py_tp_members, Overlapped_members}, + {Py_tp_getset, Overlapped_getsets}, + {Py_tp_new, _overlapped_Overlapped}, + {0,0} +}; + +static PyType_Spec overlapped_type_spec = { + .name = "_overlapped.Overlapped", + .basicsize = sizeof(OverlappedObject), + .flags = Py_TPFLAGS_DEFAULT, + .slots = overlapped_type_slots }; static PyMethodDef overlapped_functions[] = { @@ -1904,41 +1895,65 @@ static PyMethodDef overlapped_functions[] = { {NULL} }; -static struct PyModuleDef overlapped_module = { - PyModuleDef_HEAD_INIT, - "_overlapped", - NULL, - -1, - overlapped_functions, - NULL, - NULL, - NULL, - NULL -}; +static int +overlapped_traverse(PyObject *module, visitproc visit, void *arg) +{ + OverlappedState *state = overlapped_get_state(module); + Py_VISIT(state->overlapped_type); + return 0; +} -#define WINAPI_CONSTANT(fmt, con) \ - PyDict_SetItemString(d, #con, Py_BuildValue(fmt, con)) +static int +overlapped_clear(PyObject *module) +{ + OverlappedState *state = overlapped_get_state(module); + Py_CLEAR(state->overlapped_type); + return 0; +} -PyMODINIT_FUNC -PyInit__overlapped(void) +static void +overlapped_free(void *module) { - PyObject *m, *d; + overlapped_clear((PyObject *)module); +} +#define WINAPI_CONSTANT(fmt, con) \ + do { \ + PyObject *value = Py_BuildValue(fmt, con); \ + if (value == NULL) { \ + return -1; \ + } \ + if (PyDict_SetItemString(d, #con, value) < 0) { \ + Py_DECREF(value); \ + return -1; \ + } \ + Py_DECREF(value); \ + } while (0) + +static int overlapped_exec(PyObject *module) +{ /* Ensure WSAStartup() called before initializing function pointers */ - m = PyImport_ImportModule("_socket"); + PyObject *m = PyImport_ImportModule("_socket"); if (!m) - return NULL; + return -1; Py_DECREF(m); if (initialize_function_pointers() < 0) - return NULL; + return -1; - m = PyModule_Create(&overlapped_module); - if (PyModule_AddType(m, &OverlappedType) < 0) { - return NULL; + OverlappedState *st = overlapped_get_state(module); + st->overlapped_type = (PyTypeObject *)PyType_FromModuleAndSpec( + m, &overlapped_type_spec, NULL); + + if (st->overlapped_type == NULL) { + return -1; + } + + if (PyModule_AddType(module, st->overlapped_type) < 0) { + return -1; } - d = PyModule_GetDict(m); + PyObject *d = PyModule_GetDict(module); WINAPI_CONSTANT(F_DWORD, ERROR_IO_PENDING); WINAPI_CONSTANT(F_DWORD, ERROR_NETNAME_DELETED); @@ -1952,5 +1967,26 @@ PyInit__overlapped(void) WINAPI_CONSTANT(F_DWORD, SO_UPDATE_CONNECT_CONTEXT); WINAPI_CONSTANT(F_DWORD, TF_REUSE_SOCKET); - return m; + return 0; +} + +static PyModuleDef_Slot overlapped_slots[] = { + {Py_mod_exec, overlapped_exec}, + {0, NULL} +}; + +static struct PyModuleDef overlapped_module = { + PyModuleDef_HEAD_INIT, + .m_name = "_overlapped", + .m_size = sizeof(OverlappedState), + .m_methods = overlapped_functions, + .m_slots = overlapped_slots, + .m_traverse = overlapped_traverse, + .m_clear = overlapped_clear, + .m_free = overlapped_free +}; + +PyMODINIT_FUNC PyInit__overlapped(void) +{ + return PyModuleDef_Init(&overlapped_module); } diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index 7bc1b535e6e2ca..e11a8116255b47 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -1365,33 +1365,15 @@ ITIMER_PROF -- decrements both when the process is executing and\n\ A signal handler function is called with two arguments:\n\ the first is the signal number, the second is the interrupted stack frame."); -static struct PyModuleDef signalmodule = { - PyModuleDef_HEAD_INIT, - "_signal", - module_doc, - -1, - signal_methods, - NULL, - NULL, - NULL, - NULL -}; -PyMODINIT_FUNC -PyInit__signal(void) -{ - PyObject *m, *d; - int i; - - /* Create the module and add the functions */ - m = PyModule_Create(&signalmodule); - if (m == NULL) - return NULL; +static int signal_exec(PyObject *m) +{ + /* add the functions */ #if defined(HAVE_SIGWAITINFO) || defined(HAVE_SIGTIMEDWAIT) if (!initialized) { if (PyStructSequence_InitType2(&SiginfoType, &struct_siginfo_desc) < 0) - return NULL; + return -1; } Py_INCREF((PyObject*) &SiginfoType); PyModule_AddObject(m, "struct_siginfo", (PyObject*) &SiginfoType); @@ -1399,43 +1381,43 @@ PyInit__signal(void) #endif /* Add some symbolic constants to the module */ - d = PyModule_GetDict(m); + PyObject *d = PyModule_GetDict(m); DefaultHandler = PyLong_FromVoidPtr((void *)SIG_DFL); if (!DefaultHandler || PyDict_SetItemString(d, "SIG_DFL", DefaultHandler) < 0) { - goto finally; + return -1; } IgnoreHandler = PyLong_FromVoidPtr((void *)SIG_IGN); if (!IgnoreHandler || PyDict_SetItemString(d, "SIG_IGN", IgnoreHandler) < 0) { - goto finally; + return -1; } if (PyModule_AddIntMacro(m, NSIG)) - goto finally; + return -1; #ifdef SIG_BLOCK if (PyModule_AddIntMacro(m, SIG_BLOCK)) - goto finally; + return -1; #endif #ifdef SIG_UNBLOCK if (PyModule_AddIntMacro(m, SIG_UNBLOCK)) - goto finally; + return -1; #endif #ifdef SIG_SETMASK if (PyModule_AddIntMacro(m, SIG_SETMASK)) - goto finally; + return -1; #endif IntHandler = PyDict_GetItemString(d, "default_int_handler"); if (!IntHandler) - goto finally; + return -1; Py_INCREF(IntHandler); _Py_atomic_store_relaxed(&Handlers[0].tripped, 0); - for (i = 1; i < NSIG; i++) { + for (int i = 1; i < NSIG; i++) { void (*t)(int); t = PyOS_getsig(i); _Py_atomic_store_relaxed(&Handlers[i].tripped, 0); @@ -1456,168 +1438,168 @@ PyInit__signal(void) #ifdef SIGHUP if (PyModule_AddIntMacro(m, SIGHUP)) - goto finally; + return -1; #endif #ifdef SIGINT if (PyModule_AddIntMacro(m, SIGINT)) - goto finally; + return -1; #endif #ifdef SIGBREAK if (PyModule_AddIntMacro(m, SIGBREAK)) - goto finally; + return -1; #endif #ifdef SIGQUIT if (PyModule_AddIntMacro(m, SIGQUIT)) - goto finally; + return -1; #endif #ifdef SIGILL if (PyModule_AddIntMacro(m, SIGILL)) - goto finally; + return -1; #endif #ifdef SIGTRAP if (PyModule_AddIntMacro(m, SIGTRAP)) - goto finally; + return -1; #endif #ifdef SIGIOT if (PyModule_AddIntMacro(m, SIGIOT)) - goto finally; + return -1; #endif #ifdef SIGABRT if (PyModule_AddIntMacro(m, SIGABRT)) - goto finally; + return -1; #endif #ifdef SIGEMT if (PyModule_AddIntMacro(m, SIGEMT)) - goto finally; + return -1; #endif #ifdef SIGFPE if (PyModule_AddIntMacro(m, SIGFPE)) - goto finally; + return -1; #endif #ifdef SIGKILL if (PyModule_AddIntMacro(m, SIGKILL)) - goto finally; + return -1; #endif #ifdef SIGBUS if (PyModule_AddIntMacro(m, SIGBUS)) - goto finally; + return -1; #endif #ifdef SIGSEGV if (PyModule_AddIntMacro(m, SIGSEGV)) - goto finally; + return -1; #endif #ifdef SIGSYS if (PyModule_AddIntMacro(m, SIGSYS)) - goto finally; + return -1; #endif #ifdef SIGPIPE if (PyModule_AddIntMacro(m, SIGPIPE)) - goto finally; + return -1; #endif #ifdef SIGALRM if (PyModule_AddIntMacro(m, SIGALRM)) - goto finally; + return -1; #endif #ifdef SIGTERM if (PyModule_AddIntMacro(m, SIGTERM)) - goto finally; + return -1; #endif #ifdef SIGUSR1 if (PyModule_AddIntMacro(m, SIGUSR1)) - goto finally; + return -1; #endif #ifdef SIGUSR2 if (PyModule_AddIntMacro(m, SIGUSR2)) - goto finally; + return -1; #endif #ifdef SIGCLD if (PyModule_AddIntMacro(m, SIGCLD)) - goto finally; + return -1; #endif #ifdef SIGCHLD if (PyModule_AddIntMacro(m, SIGCHLD)) - goto finally; + return -1; #endif #ifdef SIGPWR if (PyModule_AddIntMacro(m, SIGPWR)) - goto finally; + return -1; #endif #ifdef SIGIO if (PyModule_AddIntMacro(m, SIGIO)) - goto finally; + return -1; #endif #ifdef SIGURG if (PyModule_AddIntMacro(m, SIGURG)) - goto finally; + return -1; #endif #ifdef SIGWINCH if (PyModule_AddIntMacro(m, SIGWINCH)) - goto finally; + return -1; #endif #ifdef SIGPOLL if (PyModule_AddIntMacro(m, SIGPOLL)) - goto finally; + return -1; #endif #ifdef SIGSTOP if (PyModule_AddIntMacro(m, SIGSTOP)) - goto finally; + return -1; #endif #ifdef SIGTSTP if (PyModule_AddIntMacro(m, SIGTSTP)) - goto finally; + return -1; #endif #ifdef SIGCONT if (PyModule_AddIntMacro(m, SIGCONT)) - goto finally; + return -1; #endif #ifdef SIGTTIN if (PyModule_AddIntMacro(m, SIGTTIN)) - goto finally; + return -1; #endif #ifdef SIGTTOU if (PyModule_AddIntMacro(m, SIGTTOU)) - goto finally; + return -1; #endif #ifdef SIGVTALRM if (PyModule_AddIntMacro(m, SIGVTALRM)) - goto finally; + return -1; #endif #ifdef SIGPROF if (PyModule_AddIntMacro(m, SIGPROF)) - goto finally; + return -1; #endif #ifdef SIGXCPU if (PyModule_AddIntMacro(m, SIGXCPU)) - goto finally; + return -1; #endif #ifdef SIGXFSZ if (PyModule_AddIntMacro(m, SIGXFSZ)) - goto finally; + return -1; #endif #ifdef SIGRTMIN if (PyModule_AddIntMacro(m, SIGRTMIN)) - goto finally; + return -1; #endif #ifdef SIGRTMAX if (PyModule_AddIntMacro(m, SIGRTMAX)) - goto finally; + return -1; #endif #ifdef SIGINFO if (PyModule_AddIntMacro(m, SIGINFO)) - goto finally; + return -1; #endif #ifdef ITIMER_REAL if (PyModule_AddIntMacro(m, ITIMER_REAL)) - goto finally; + return -1; #endif #ifdef ITIMER_VIRTUAL if (PyModule_AddIntMacro(m, ITIMER_VIRTUAL)) - goto finally; + return -1; #endif #ifdef ITIMER_PROF if (PyModule_AddIntMacro(m, ITIMER_PROF)) - goto finally; + return -1; #endif #if defined (HAVE_SETITIMER) || defined (HAVE_GETITIMER) @@ -1625,18 +1607,18 @@ PyInit__signal(void) PyExc_OSError, NULL); if (!ItimerError || PyDict_SetItemString(d, "ItimerError", ItimerError) < 0) { - goto finally; + return -1; } #endif #ifdef CTRL_C_EVENT if (PyModule_AddIntMacro(m, CTRL_C_EVENT)) - goto finally; + return -1; #endif #ifdef CTRL_BREAK_EVENT if (PyModule_AddIntMacro(m, CTRL_BREAK_EVENT)) - goto finally; + return -1; #endif #ifdef MS_WINDOWS @@ -1645,12 +1627,29 @@ PyInit__signal(void) #endif if (PyErr_Occurred()) { - Py_DECREF(m); - m = NULL; + return -1; } - finally: - return m; + return 0; +} + +static PyModuleDef_Slot signal_slots[] = { + {Py_mod_exec, signal_exec}, + {0, NULL} +}; + +static struct PyModuleDef signalmodule = { + PyModuleDef_HEAD_INIT, + "_signal", + .m_doc = module_doc, + .m_size = 0, + .m_methods = signal_methods, + .m_slots = signal_slots +}; + +PyMODINIT_FUNC PyInit__signal(void) +{ + return PyModuleDef_Init(&signalmodule); } static void diff --git a/Modules/termios.c b/Modules/termios.c index 75e5e523206f41..d890d91b3af4a7 100644 --- a/Modules/termios.c +++ b/Modules/termios.c @@ -997,37 +997,14 @@ static void termiosmodule_free(void *m) { termiosmodule_clear((PyObject *)m); } -static struct PyModuleDef termiosmodule = { - PyModuleDef_HEAD_INIT, - "termios", - termios__doc__, - sizeof(termiosmodulestate), - termios_methods, - NULL, - termiosmodule_traverse, - termiosmodule_clear, - termiosmodule_free, -}; - -PyMODINIT_FUNC -PyInit_termios(void) +static int +termios_exec(PyObject *m) { - PyObject *m; struct constant *constant = termios_constants; - - if ((m = PyState_FindModule(&termiosmodule)) != NULL) { - Py_INCREF(m); - return m; - } - - if ((m = PyModule_Create(&termiosmodule)) == NULL) { - return NULL; - } - termiosmodulestate *state = get_termios_state(m); state->TermiosError = PyErr_NewException("termios.error", NULL, NULL); if (state->TermiosError == NULL) { - return NULL; + return -1; } Py_INCREF(state->TermiosError); PyModule_AddObject(m, "error", state->TermiosError); @@ -1036,5 +1013,27 @@ PyInit_termios(void) PyModule_AddIntConstant(m, constant->name, constant->value); ++constant; } - return m; + return 0; +} + +static PyModuleDef_Slot termios_slots[] = { + {Py_mod_exec, termios_exec}, + {0, NULL} +}; + +static struct PyModuleDef termiosmodule = { + PyModuleDef_HEAD_INIT, + .m_name = "termios", + .m_doc = termios__doc__, + .m_size = sizeof(termiosmodulestate), + .m_methods = termios_methods, + .m_slots = termios_slots, + .m_traverse = termiosmodule_traverse, + .m_clear = termiosmodule_clear, + .m_free = termiosmodule_free, +}; + +PyMODINIT_FUNC PyInit_termios(void) +{ + return PyModuleDef_Init(&termiosmodule); }