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
100 changes: 50 additions & 50 deletions Modules/_cursesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1936,10 +1936,10 @@ Window_NoArgTrueFalseFunction(is_scrollok)
Window_NoArgTrueFalseFunction(is_subwin)
Window_NoArgTrueFalseFunction(is_syncok)
#endif
#if defined(HAVE_CURSES_IS_KEYPAD) || defined(PDCURSES)
#if defined(_Py__Py_HAVE_CURSES_IS_KEYPAD) || defined(PDCURSES)
Window_NoArgTrueFalseFunction(is_keypad)
#endif
#if defined(HAVE_CURSES_IS_LEAVEOK) || defined(PDCURSES)
#if defined(_Py_HAVE_CURSES_IS_LEAVEOK) || defined(PDCURSES)
Window_NoArgTrueFalseFunction(is_leaveok)
#endif
#if defined(HAVE_CURSES_IS_PAD) || defined(PDCURSES)
Expand Down Expand Up @@ -2199,7 +2199,7 @@ static int
curses_wattr_save(PyCursesWindowObject *self, attr_t *attrs, int *pair,
const char *funcname)
{
#if defined(HAVE_CURSES_WATTR_GET) && defined(HAVE_CURSES_WATTR_SET)
#if defined(_Py_HAVE_CURSES_WATTR_GET) && defined(_Py_HAVE_CURSES_WATTR_SET)
int rtn;
#if _NCURSES_EXTENDED_COLOR_FUNCS
short legacy_pair;
Expand All @@ -2222,7 +2222,7 @@ curses_wattr_save(PyCursesWindowObject *self, attr_t *attrs, int *pair,

/* Put the rendition back. The name of the curses function used is
_CURSES_WATTR_RESTORE_FUNC, for the caller to name it in an error. */
#if defined(HAVE_CURSES_WATTR_GET) && defined(HAVE_CURSES_WATTR_SET)
#if defined(_Py_HAVE_CURSES_WATTR_GET) && defined(_Py_HAVE_CURSES_WATTR_SET)
#define _CURSES_WATTR_RESTORE_FUNC "wattr_set"
#else
#define _CURSES_WATTR_RESTORE_FUNC "wattrset"
Expand All @@ -2231,7 +2231,7 @@ curses_wattr_save(PyCursesWindowObject *self, attr_t *attrs, int *pair,
static int
curses_wattr_restore(PyCursesWindowObject *self, attr_t attrs, int pair)
{
#if defined(HAVE_CURSES_WATTR_GET) && defined(HAVE_CURSES_WATTR_SET)
#if defined(_Py_HAVE_CURSES_WATTR_GET) && defined(_Py_HAVE_CURSES_WATTR_SET)
#if _NCURSES_EXTENDED_COLOR_FUNCS
return wattr_set(self->win, attrs, 0, &pair);
#else
Expand Down Expand Up @@ -2558,7 +2558,7 @@ _curses_window_attrset_impl(PyCursesWindowObject *self, attr_t attr)
return curses_window_check_err(self, rtn, "wattrset", "attrset");
}

#ifdef HAVE_CURSES_WATTR_GET
#ifdef _Py_HAVE_CURSES_WATTR_GET
/*[clinic input]
_curses.window.attr_get
Expand All @@ -2584,9 +2584,9 @@ _curses_window_attr_get_impl(PyCursesWindowObject *self)
}
return Py_BuildValue("(ki)", (unsigned long)attrs, (int)pair);
}
#endif /* HAVE_CURSES_WATTR_GET */
#endif /* _Py_HAVE_CURSES_WATTR_GET */

#ifdef HAVE_CURSES_WATTR_SET
#ifdef _Py_HAVE_CURSES_WATTR_SET
/*[clinic input]
_curses.window.attr_set
Expand All @@ -2610,9 +2610,9 @@ _curses_window_attr_set_impl(PyCursesWindowObject *self, attr_t attr,
#endif
return curses_window_check_err(self, rtn, "wattr_set", "attr_set");
}
#endif /* HAVE_CURSES_WATTR_SET */
#endif /* _Py_HAVE_CURSES_WATTR_SET */

#ifdef HAVE_CURSES_WATTR_ON
#ifdef _Py_HAVE_CURSES_WATTR_ON
/*[clinic input]
_curses.window.attr_on
Expand All @@ -2629,9 +2629,9 @@ _curses_window_attr_on_impl(PyCursesWindowObject *self, attr_t attr)
int rtn = wattr_on(self->win, attr, NULL);
return curses_window_check_err(self, rtn, "wattr_on", "attr_on");
}
#endif /* HAVE_CURSES_WATTR_ON */
#endif /* _Py_HAVE_CURSES_WATTR_ON */

#ifdef HAVE_CURSES_WATTR_OFF
#ifdef _Py_HAVE_CURSES_WATTR_OFF
/*[clinic input]
_curses.window.attr_off
Expand All @@ -2648,9 +2648,9 @@ _curses_window_attr_off_impl(PyCursesWindowObject *self, attr_t attr)
int rtn = wattr_off(self->win, attr, NULL);
return curses_window_check_err(self, rtn, "wattr_off", "attr_off");
}
#endif /* HAVE_CURSES_WATTR_OFF */
#endif /* _Py_HAVE_CURSES_WATTR_OFF */

#ifdef HAVE_CURSES_WCOLOR_SET
#ifdef _Py_HAVE_CURSES_WCOLOR_SET
/*[clinic input]
_curses.window.color_set
Expand All @@ -2672,7 +2672,7 @@ _curses_window_color_set_impl(PyCursesWindowObject *self, int pair)
#endif
return curses_window_check_err(self, rtn, "wcolor_set", "color_set");
}
#endif /* HAVE_CURSES_WCOLOR_SET */
#endif /* _Py_HAVE_CURSES_WCOLOR_SET */

/*[clinic input]
_curses.window.getattrs
Expand Down Expand Up @@ -5035,7 +5035,7 @@ static PyType_Spec PyCursesComplexStr_Type_spec = {
};
#undef clinic_state

#if defined(HAVE_CURSES_USE_SCREEN) || defined(HAVE_CURSES_USE_WINDOW)
#if defined(_Py_HAVE_CURSES_USE_SCREEN) || defined(_Py_HAVE_CURSES_USE_WINDOW)
/* Shared trampoline for window.use()/screen.use(): call
func(obj, *extra, **kwargs) and store the result (NULL on exception) in
data->result. */
Expand Down Expand Up @@ -5085,7 +5085,7 @@ curses_use_parse(PyObject *args, PyObject **func, PyObject **extra)
}
#endif

#ifdef HAVE_CURSES_USE_WINDOW
#ifdef _Py_HAVE_CURSES_USE_WINDOW
static int
curses_use_window_cb(WINDOW *Py_UNUSED(win), void *data)
{
Expand All @@ -5111,7 +5111,7 @@ PyCursesWindow_use(PyObject *self, PyObject *args, PyObject *kwargs)
Py_DECREF(extra);
return data.result;
}
#endif /* HAVE_CURSES_USE_WINDOW */
#endif /* _Py_HAVE_CURSES_USE_WINDOW */

static PyMethodDef PyCursesWindow_methods[] = {
_CURSES_WINDOW_ADDCH_METHODDEF
Expand Down Expand Up @@ -5250,12 +5250,12 @@ static PyMethodDef PyCursesWindow_methods[] = {
"is_syncok($self, /)\n--\n\n"
"Return the current value set by syncok()."},
#endif
#if defined(HAVE_CURSES_IS_KEYPAD) || defined(PDCURSES)
#if defined(_Py__Py_HAVE_CURSES_IS_KEYPAD) || defined(PDCURSES)
{"is_keypad", PyCursesWindow_is_keypad, METH_NOARGS,
"is_keypad($self, /)\n--\n\n"
"Return the current value set by keypad()."},
#endif
#if defined(HAVE_CURSES_IS_LEAVEOK) || defined(PDCURSES)
#if defined(_Py_HAVE_CURSES_IS_LEAVEOK) || defined(PDCURSES)
{"is_leaveok", PyCursesWindow_is_leaveok, METH_NOARGS,
"is_leaveok($self, /)\n--\n\n"
"Return the current value set by leaveok()."},
Expand Down Expand Up @@ -5336,7 +5336,7 @@ static PyMethodDef PyCursesWindow_methods[] = {
"untouchwin($self, /)\n--\n\n"
"Mark all lines in the window as unchanged since last refresh()."},
_CURSES_WINDOW_VLINE_METHODDEF
#ifdef HAVE_CURSES_USE_WINDOW
#ifdef _Py_HAVE_CURSES_USE_WINDOW
{"use", _PyCFunction_CAST(PyCursesWindow_use),
METH_VARARGS | METH_KEYWORDS, PyCursesWindow_use__doc__},
#endif
Expand Down Expand Up @@ -5478,7 +5478,7 @@ static PyGetSetDef PyCursesScreen_getsets[] = {
{NULL, NULL, NULL, NULL, NULL} /* sentinel */
};

#ifdef HAVE_CURSES_USE_SCREEN
#ifdef _Py_HAVE_CURSES_USE_SCREEN
static int
curses_use_screen_cb(SCREEN *Py_UNUSED(sp), void *data)
{
Expand Down Expand Up @@ -5533,7 +5533,7 @@ PyCursesScreen_use(PyObject *self, PyObject *args, PyObject *kwargs)
}
return data.result;
}
#endif /* HAVE_CURSES_USE_SCREEN */
#endif /* _Py_HAVE_CURSES_USE_SCREEN */

PyDoc_STRVAR(PyCursesScreen_close__doc__,
"close($self, /)\n--\n\n"
Expand All @@ -5552,7 +5552,7 @@ PyCursesScreen_close(PyObject *self, PyObject *Py_UNUSED(ignored))
static PyMethodDef PyCursesScreen_methods[] = {
{"close", PyCursesScreen_close, METH_NOARGS,
PyCursesScreen_close__doc__},
#ifdef HAVE_CURSES_USE_SCREEN
#ifdef _Py_HAVE_CURSES_USE_SCREEN
{"use", _PyCFunction_CAST(PyCursesScreen_use),
METH_VARARGS | METH_KEYWORDS, PyCursesScreen_use__doc__},
#endif
Expand Down Expand Up @@ -5704,7 +5704,7 @@ _curses_filter_impl(PyObject *module)
}
#endif

#ifdef HAVE_CURSES_NOFILTER
#ifdef _Py_HAVE_CURSES_NOFILTER
/*[clinic input]
_curses.nofilter
Expand Down Expand Up @@ -6269,7 +6269,7 @@ _curses_getwin(PyObject *module, PyObject *file)
return res;
}

#ifdef HAVE_CURSES_SCR_DUMP
#ifdef _Py_HAVE_CURSES_SCR_DUMP
/*[clinic input]
_curses.scr_dump
Expand Down Expand Up @@ -6324,7 +6324,7 @@ _curses_scr_init(PyObject *module, PyObject *filename)
/*[clinic end generated code: output=2e861d381d710419 input=81c45e4702124ef6]*/
ScreenDumpFunctionBody(scr_init)

#ifdef HAVE_CURSES_SCR_SET
#ifdef _Py_HAVE_CURSES_SCR_SET
/*[clinic input]
_curses.scr_set
Expand All @@ -6341,8 +6341,8 @@ static PyObject *
_curses_scr_set(PyObject *module, PyObject *filename)
/*[clinic end generated code: output=6056fdec12c5935f input=d248c20543cc289b]*/
ScreenDumpFunctionBody(scr_set)
#endif /* HAVE_CURSES_SCR_SET */
#endif /* HAVE_CURSES_SCR_DUMP */
#endif /* _Py_HAVE_CURSES_SCR_SET */
#endif /* _Py_HAVE_CURSES_SCR_DUMP */

/*[clinic input]
_curses.halfdelay
Expand Down Expand Up @@ -6421,7 +6421,7 @@ _curses_has_key_impl(PyObject *module, int key)
}
#endif

#ifdef HAVE_CURSES_DEFINE_KEY
#ifdef _Py_HAVE_CURSES_DEFINE_KEY
/*[clinic input]
_curses.define_key
Expand All @@ -6447,9 +6447,9 @@ _curses_define_key_impl(PyObject *module, const char *definition,
return curses_check_err(module, define_key(definition, keycode),
"define_key", NULL);
}
#endif /* HAVE_CURSES_DEFINE_KEY */
#endif /* _Py_HAVE_CURSES_DEFINE_KEY */

#ifdef HAVE_CURSES_KEY_DEFINED
#ifdef _Py_HAVE_CURSES_KEY_DEFINED
/*[clinic input]
_curses.key_defined
Expand All @@ -6471,9 +6471,9 @@ _curses_key_defined_impl(PyObject *module, const char *definition)

return PyLong_FromLong(key_defined(definition));
}
#endif /* HAVE_CURSES_KEY_DEFINED */
#endif /* _Py_HAVE_CURSES_KEY_DEFINED */

#ifdef HAVE_CURSES_KEYOK
#ifdef _Py_HAVE_CURSES_KEYOK
/*[clinic input]
_curses.keyok
Expand All @@ -6494,7 +6494,7 @@ _curses_keyok_impl(PyObject *module, int keycode, int enable)

return curses_check_err(module, keyok(keycode, enable), "keyok", NULL);
}
#endif /* HAVE_CURSES_KEYOK */
#endif /* _Py_HAVE_CURSES_KEYOK */

/*[clinic input]
_curses.init_color
Expand Down Expand Up @@ -7283,7 +7283,7 @@ _curses_set_term(PyObject *module, PyObject *screen)
return prev != NULL ? prev : Py_NewRef(Py_None);
}

#ifdef HAVE_CURSES_NEW_PRESCR
#ifdef _Py_HAVE_CURSES_NEW_PRESCR
/*[clinic input]
_curses.new_prescr
Expand Down Expand Up @@ -7317,7 +7317,7 @@ _curses_new_prescr_impl(PyObject *module)
state->prescreen = Py_NewRef(screenobj);
return screenobj;
}
#endif /* HAVE_CURSES_NEW_PRESCR */
#endif /* _Py_HAVE_CURSES_NEW_PRESCR */

#ifdef HAVE_CURSES_ESCDELAY
/*[clinic input]
Expand Down Expand Up @@ -7573,7 +7573,7 @@ _curses_meta_impl(PyObject *module, int yes)
}

#if defined(HAVE_CURSES_GETMOUSE) || defined(PDCURSES)
#if defined(HAVE_CURSES_HAS_MOUSE) || defined(PDCURSES)
#if defined(_Py_HAVE_CURSES_HAS_MOUSE) || defined(PDCURSES)
/*[clinic input]
_curses.has_mouse
Expand All @@ -7588,7 +7588,7 @@ _curses_has_mouse_impl(PyObject *module)

return PyBool_FromLong(has_mouse());
}
#endif /* HAVE_CURSES_HAS_MOUSE || PDCURSES */
#endif /* _Py_HAVE_CURSES_HAS_MOUSE || PDCURSES */

/*[clinic input]
_curses.mouseinterval
Expand Down Expand Up @@ -8272,7 +8272,7 @@ _curses_termattrs_impl(PyObject *module)
return PyLong_FromUnsignedLong((unsigned long)(chtype)termattrs());
}

#ifdef HAVE_CURSES_TERM_ATTRS
#ifdef _Py_HAVE_CURSES_TERM_ATTRS
/*[clinic input]
_curses.term_attrs
Expand All @@ -8290,7 +8290,7 @@ _curses_term_attrs_impl(PyObject *module)

return PyLong_FromUnsignedLongLong(term_attrs());
}
#endif /* HAVE_CURSES_TERM_ATTRS */
#endif /* _Py_HAVE_CURSES_TERM_ATTRS */

/*[clinic input]
@permit_long_summary
Expand Down Expand Up @@ -8877,7 +8877,7 @@ _curses_slk_attr_impl(PyObject *module)
}
#endif

#ifdef HAVE_CURSES_SLK_ATTR_ON
#ifdef _Py_HAVE_CURSES_SLK_ATTR_ON
/*[clinic input]
_curses.slk_attr_on
Expand All @@ -8895,9 +8895,9 @@ _curses_slk_attr_on_impl(PyObject *module, attr_t attr)
return curses_check_err(module, slk_attr_on(attr, NULL),
"slk_attr_on", NULL);
}
#endif /* HAVE_CURSES_SLK_ATTR_ON */
#endif /* _Py_HAVE_CURSES_SLK_ATTR_ON */

#ifdef HAVE_CURSES_SLK_ATTR_OFF
#ifdef _Py_HAVE_CURSES_SLK_ATTR_OFF
/*[clinic input]
_curses.slk_attr_off
Expand All @@ -8915,9 +8915,9 @@ _curses_slk_attr_off_impl(PyObject *module, attr_t attr)
return curses_check_err(module, slk_attr_off(attr, NULL),
"slk_attr_off", NULL);
}
#endif /* HAVE_CURSES_SLK_ATTR_OFF */
#endif /* _Py_HAVE_CURSES_SLK_ATTR_OFF */

#ifdef HAVE_CURSES_SLK_ATTR_SET
#ifdef _Py_HAVE_CURSES_SLK_ATTR_SET
/*[clinic input]
_curses.slk_attr_set
Expand All @@ -8941,9 +8941,9 @@ _curses_slk_attr_set_impl(PyObject *module, attr_t attr, int pair)
#endif
return curses_check_err(module, rtn, "slk_attr_set", NULL);
}
#endif /* HAVE_CURSES_SLK_ATTR_SET */
#endif /* _Py_HAVE_CURSES_SLK_ATTR_SET */

#ifdef HAVE_CURSES_SLK_COLOR
#ifdef _Py_HAVE_CURSES_SLK_COLOR
/*[clinic input]
_curses.slk_color
Expand All @@ -8966,7 +8966,7 @@ _curses_slk_color_impl(PyObject *module, int pair)
#endif
return curses_check_err(module, rtn, "slk_color", NULL);
}
#endif /* HAVE_CURSES_SLK_COLOR */
#endif /* _Py_HAVE_CURSES_SLK_COLOR */

#ifdef HAVE_CURSES_USE_ENV
/*[clinic input]
Expand Down Expand Up @@ -9178,7 +9178,7 @@ static PyMethodDef cursesmodule_methods[] = {
_CURSES_NEWPAD_METHODDEF
_CURSES_NEWTERM_METHODDEF
_CURSES_NEWWIN_METHODDEF
#ifdef HAVE_CURSES_NEW_PRESCR
#ifdef _Py_HAVE_CURSES_NEW_PRESCR
_CURSES_NEW_PRESCR_METHODDEF
#endif
_CURSES_NL_METHODDEF
Expand Down
Loading
Loading