mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-123961: Add a global state to _curses (#124729)
This commit is contained in:
parent
12417a984c
commit
4d8e7c40a0
3 changed files with 274 additions and 177 deletions
|
@ -81,8 +81,6 @@ typedef struct {
|
|||
char *encoding;
|
||||
} PyCursesWindowObject;
|
||||
|
||||
#define PyCursesWindow_Check(v) Py_IS_TYPE((v), &PyCursesWindow_Type)
|
||||
|
||||
#define PyCurses_CAPSULE_NAME "_curses._C_API"
|
||||
|
||||
|
||||
|
@ -99,6 +97,8 @@ static void **PyCurses_API;
|
|||
#define PyCursesInitialised {if (! ((int (*)(void))PyCurses_API[2]) () ) return NULL;}
|
||||
#define PyCursesInitialisedColor {if (! ((int (*)(void))PyCurses_API[3]) () ) return NULL;}
|
||||
|
||||
#define PyCursesWindow_Check(v) Py_IS_TYPE((v), &PyCursesWindow_Type)
|
||||
|
||||
#define import_curses() \
|
||||
PyCurses_API = (void **)PyCapsule_Import(PyCurses_CAPSULE_NAME, 1);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue