Skip to content

Commit

Permalink
gh-123961: Add a global state to _curses (#124729)
Browse files Browse the repository at this point in the history
  • Loading branch information
picnixz authored Sep 29, 2024
1 parent 12417a9 commit 4d8e7c4
Show file tree
Hide file tree
Showing 3 changed files with 274 additions and 177 deletions.
4 changes: 2 additions & 2 deletions Include/py_curses.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand All @@ -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);

Expand Down
Loading

0 comments on commit 4d8e7c4

Please sign in to comment.