@@ -6,7 +6,45 @@ preserve
66# include "pycore_gc.h" // PyGC_Head
77# include "pycore_runtime.h" // _Py_ID()
88#endif
9- #include "pycore_modsupport.h" // _PyArg_CheckPositional()
9+
10+ PyAPI_FUNC (int ) _PyArg_CheckPositional (const char * , Py_ssize_t ,
11+ Py_ssize_t , Py_ssize_t );
12+ #define _Py_ANY_VARARGS (n ) ((n) == PY_SSIZE_T_MAX)
13+ #define _PyArg_CheckPositional (funcname , nargs , min , max ) \
14+ ((!_Py_ANY_VARARGS(max) && (min) <= (nargs) && (nargs) <= (max)) \
15+ || _PyArg_CheckPositional((funcname), (nargs), (min), (max)))
16+
17+ // Export for '_heapq' shared extension
18+ PyAPI_FUNC (void ) _PyArg_BadArgument (
19+ const char * fname ,
20+ const char * displayname ,
21+ const char * expected ,
22+ PyObject * arg );
23+
24+ // Export for '_curses' shared extension
25+ PyAPI_FUNC (int ) _PyArg_ParseStack (
26+ PyObject * const * args ,
27+ Py_ssize_t nargs ,
28+ const char * format ,
29+ ...);
30+
31+ // Export for 'math' shared extension
32+ PyAPI_FUNC (PyObject * const * ) _PyArg_UnpackKeywords (
33+ PyObject * const * args ,
34+ Py_ssize_t nargs ,
35+ PyObject * kwargs ,
36+ PyObject * kwnames ,
37+ struct _PyArg_Parser * parser ,
38+ int minpos ,
39+ int maxpos ,
40+ int minkw ,
41+ PyObject * * buf );
42+ #define _PyArg_UnpackKeywords (args , nargs , kwargs , kwnames , parser , minpos , maxpos , minkw , buf ) \
43+ (((minkw) == 0 && (kwargs) == NULL && (kwnames) == NULL && \
44+ (minpos) <= (nargs) && (nargs) <= (maxpos) && (args) != NULL) ? (args) : \
45+ _PyArg_UnpackKeywords((args), (nargs), (kwargs), (kwnames), (parser), \
46+ (minpos), (maxpos), (minkw), (buf)))
47+
1048
1149PyDoc_STRVAR (_curses_window_addch__doc__ ,
1250"addch([y, x,] ch, [attr=_curses.A_NORMAL])\n"
0 commit comments