diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-01-17 00:29:49 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-01-17 00:29:49 (GMT) |
commit | 6518a93cb1dd9ff971a7455eb1622a4c89da4bb4 (patch) | |
tree | 21e6d8b15110178e4c35e53299e1bf615cbde662 /Include | |
parent | 3e1fad6913689f1cbb08657ee5f65439a4639303 (diff) | |
download | cpython-6518a93cb1dd9ff971a7455eb1622a4c89da4bb4.zip cpython-6518a93cb1dd9ff971a7455eb1622a4c89da4bb4.tar.gz cpython-6518a93cb1dd9ff971a7455eb1622a4c89da4bb4.tar.bz2 |
Add _PyArg_ParseStack() helper function
Issue #29286. Function similar to PyArg_ParseTuple(), but uses a C array of
PyObject* to pass arguments. Don't support the compatibility mode.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/modsupport.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Include/modsupport.h b/Include/modsupport.h index 188f0b1..5c21f98 100644 --- a/Include/modsupport.h +++ b/Include/modsupport.h @@ -79,17 +79,27 @@ typedef struct _PyArg_Parser { } _PyArg_Parser; #ifdef PY_SSIZE_T_CLEAN #define _PyArg_ParseTupleAndKeywordsFast _PyArg_ParseTupleAndKeywordsFast_SizeT +#define _PyArg_ParseStack _PyArg_ParseStack_SizeT #define _PyArg_ParseStackAndKeywords _PyArg_ParseStackAndKeywords_SizeT #define _PyArg_VaParseTupleAndKeywordsFast _PyArg_VaParseTupleAndKeywordsFast_SizeT #endif PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *, struct _PyArg_Parser *, ...); -PyAPI_FUNC(int) _PyArg_ParseStackAndKeywords(PyObject **args, Py_ssize_t nargs, PyObject *kwnames, - struct _PyArg_Parser *, ...); +PyAPI_FUNC(int) _PyArg_ParseStack( + PyObject **args, + Py_ssize_t nargs, + const char *format, + ...); +PyAPI_FUNC(int) _PyArg_ParseStackAndKeywords( + PyObject **args, + Py_ssize_t nargs, + PyObject *kwnames, + struct _PyArg_Parser *, + ...); PyAPI_FUNC(int) _PyArg_VaParseTupleAndKeywordsFast(PyObject *, PyObject *, struct _PyArg_Parser *, va_list); void _PyArg_Fini(void); -#endif +#endif /* Py_LIMITED_API */ PyAPI_FUNC(int) PyModule_AddObject(PyObject *, const char *, PyObject *); PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, const char *, long); |