Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The :mod:`curses` module now detects ``set_escdelay()``, ``set_tabsize()`` and
the ``ESCDELAY`` and ``TABSIZE`` variables with :program:`configure` capability
probes instead of the ncurses-specific ``NCURSES_EXT_FUNCS`` macro, so they are
exposed when building against other curses implementations such as NetBSD curses
that provide them.
16 changes: 10 additions & 6 deletions Modules/_cursesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3479,9 +3479,7 @@ _curses_setupterm_impl(PyObject *module, const char *term, int fd)
Py_RETURN_NONE;
}

#if defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102
// https://invisible-island.net/ncurses/NEWS.html#index-t20080119

#ifdef HAVE_CURSES_ESCDELAY
/*[clinic input]
_curses.get_escdelay

Expand All @@ -3498,6 +3496,9 @@ _curses_get_escdelay_impl(PyObject *module)
{
return PyLong_FromLong(ESCDELAY);
}
#endif /* HAVE_CURSES_ESCDELAY */

#ifdef HAVE_CURSES_SET_ESCDELAY
/*[clinic input]
_curses.set_escdelay
ms: int
Expand All @@ -3522,7 +3523,9 @@ _curses_set_escdelay_impl(PyObject *module, int ms)

return PyCursesCheckERR(set_escdelay(ms), "set_escdelay");
}
#endif /* HAVE_CURSES_SET_ESCDELAY */

#ifdef HAVE_CURSES_TABSIZE
/*[clinic input]
_curses.get_tabsize

Expand All @@ -3538,6 +3541,9 @@ _curses_get_tabsize_impl(PyObject *module)
{
return PyLong_FromLong(TABSIZE);
}
#endif /* HAVE_CURSES_TABSIZE */

#ifdef HAVE_CURSES_SET_TABSIZE
/*[clinic input]
_curses.set_tabsize
size: int
Expand All @@ -3561,7 +3567,7 @@ _curses_set_tabsize_impl(PyObject *module, int size)

return PyCursesCheckERR(set_tabsize(size), "set_tabsize");
}
#endif
#endif /* HAVE_CURSES_SET_TABSIZE */

/*[clinic input]
_curses.intrflush
Expand Down Expand Up @@ -4766,10 +4772,8 @@ static PyMethodDef PyCurses_methods[] = {
_CURSES_RESIZETERM_METHODDEF
_CURSES_RESIZE_TERM_METHODDEF
_CURSES_SAVETTY_METHODDEF
#if defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102
_CURSES_GET_ESCDELAY_METHODDEF
_CURSES_SET_ESCDELAY_METHODDEF
#endif
_CURSES_GET_TABSIZE_METHODDEF
_CURSES_SET_TABSIZE_METHODDEF
_CURSES_SETSYX_METHODDEF
Expand Down
18 changes: 9 additions & 9 deletions Modules/clinic/_cursesmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

230 changes: 230 additions & 0 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading