| 1 |
#ifndef Py_INTERNAL_MODSUPPORT_H |
| 2 |
#define Py_INTERNAL_MODSUPPORT_H |
| 3 |
|
| 4 |
#ifdef __cplusplus |
| 5 |
extern "C" { |
| 6 |
#endif |
| 7 |
|
| 8 |
#ifndef Py_BUILD_CORE |
| 9 |
# error "this header requires Py_BUILD_CORE define" |
| 10 |
#endif |
| 11 |
|
| 12 |
|
| 13 |
extern int _PyArg_NoKwnames(const char *funcname, PyObject *kwnames); |
| 14 |
#define _PyArg_NoKwnames(funcname, kwnames) \ |
| 15 |
((kwnames) == NULL || _PyArg_NoKwnames((funcname), (kwnames))) |
| 16 |
|
| 17 |
// Export for '_bz2' shared extension |
| 18 |
PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args); |
| 19 |
#define _PyArg_NoPositional(funcname, args) \ |
| 20 |
((args) == NULL || _PyArg_NoPositional((funcname), (args))) |
| 21 |
|
| 22 |
// Export for '_asyncio' shared extension |
| 23 |
PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kwargs); |
| 24 |
#define _PyArg_NoKeywords(funcname, kwargs) \ |
| 25 |
((kwargs) == NULL || _PyArg_NoKeywords((funcname), (kwargs))) |
| 26 |
|
| 27 |
// Export for 'zlib' shared extension |
| 28 |
PyAPI_FUNC(int) _PyArg_CheckPositional(const char *, Py_ssize_t, |
| 29 |
Py_ssize_t, Py_ssize_t); |
| 30 |
#define _Py_ANY_VARARGS(n) ((n) == PY_SSIZE_T_MAX) |
| 31 |
#define _PyArg_CheckPositional(funcname, nargs, min, max) \ |
| 32 |
((!_Py_ANY_VARARGS(max) && (min) <= (nargs) && (nargs) <= (max)) \ |
| 33 |
|| _PyArg_CheckPositional((funcname), (nargs), (min), (max))) |
| 34 |
|
| 35 |
extern PyObject ** _Py_VaBuildStack( |
| 36 |
PyObject **small_stack, |
| 37 |
Py_ssize_t small_stack_len, |
| 38 |
const char *format, |
| 39 |
va_list va, |
| 40 |
Py_ssize_t *p_nargs); |
| 41 |
|
| 42 |
extern PyObject* _PyModule_CreateInitialized(PyModuleDef*, int apiver); |
| 43 |
|
| 44 |
// Export for '_curses' shared extension |
| 45 |
PyAPI_FUNC(int) _PyArg_ParseStack( |
| 46 |
PyObject *const *args, |
| 47 |
Py_ssize_t nargs, |
| 48 |
const char *format, |
| 49 |
...); |
| 50 |
|
| 51 |
extern int _PyArg_UnpackStack( |
| 52 |
PyObject *const *args, |
| 53 |
Py_ssize_t nargs, |
| 54 |
const char *name, |
| 55 |
Py_ssize_t min, |
| 56 |
Py_ssize_t max, |
| 57 |
...); |
| 58 |
|
| 59 |
// Export for '_heapq' shared extension |
| 60 |
PyAPI_FUNC(void) _PyArg_BadArgument( |
| 61 |
const char *fname, |
| 62 |
const char *displayname, |
| 63 |
const char *expected, |
| 64 |
PyObject *arg); |
| 65 |
|
| 66 |
// --- _PyArg_Parser API --------------------------------------------------- |
| 67 |
|
| 68 |
// Export for '_dbm' shared extension |
| 69 |
PyAPI_FUNC(int) _PyArg_ParseStackAndKeywords( |
| 70 |
PyObject *const *args, |
| 71 |
Py_ssize_t nargs, |
| 72 |
PyObject *kwnames, |
| 73 |
struct _PyArg_Parser *, |
| 74 |
...); |
| 75 |
|
| 76 |
// Export for 'math' shared extension |
| 77 |
PyAPI_FUNC(PyObject * const *) _PyArg_UnpackKeywords( |
| 78 |
PyObject *const *args, |
| 79 |
Py_ssize_t nargs, |
| 80 |
PyObject *kwargs, |
| 81 |
PyObject *kwnames, |
| 82 |
struct _PyArg_Parser *parser, |
| 83 |
int minpos, |
| 84 |
int maxpos, |
| 85 |
int minkw, |
| 86 |
int varpos, |
| 87 |
PyObject **buf); |
| 88 |
#define _PyArg_UnpackKeywords(args, nargs, kwargs, kwnames, parser, minpos, maxpos, minkw, varpos, buf) \ |
| 89 |
(((minkw) == 0 && (kwargs) == NULL && (kwnames) == NULL && \ |
| 90 |
(minpos) <= (nargs) && ((varpos) || (nargs) <= (maxpos)) && (args) != NULL) ? \ |
| 91 |
(args) : \ |
| 92 |
_PyArg_UnpackKeywords((args), (nargs), (kwargs), (kwnames), (parser), \ |
| 93 |
(minpos), (maxpos), (minkw), (varpos), (buf))) |
| 94 |
|
| 95 |
#ifdef __cplusplus |
| 96 |
} |
| 97 |
#endif |
| 98 |
#endif // !Py_INTERNAL_MODSUPPORT_H |
| 99 |
|