mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-03 19:22:27 +00:00
Backporting METH_FASTCALL from Python 3.7 (#317)
* dict copy speedup refer to bpo-31179 or python/cpython@boa7a037b8fde * __build_class__() uses METH_FASTCALL refer python/cpython@69de71b255 refer python/cpython@773dc6dd06 a single test related to __prepare__ fails. * type_prepare uses METH_FASTCALL refer python/cpython@d526cfe546 refer python/cpython@80ab22fa2c the prepare-related test still fails. It's just related to the error message format though. * separate into ParseStack and ParseStackAndKeywords refer python/cpython@6518a93cb1 refer python/cpython@3e1fad6913 refer python/cpython@c0083fc47d * Add _PyArg_NoStackKeywords refer python/cpython@29d39cc8f5 * _PyStack_UnpackDict now returns int refer python/cpython@998c20962c * METH_FASTCALL changes to .inc files done via python's Argument Clinic tool, refer python/cpython@259f0e4437 * Added _PyArg_UnpackStack refer python/cpython@fe54dda08 * Argument Clinic FASTCALL again refer python/cpython@0c4a828ca * Argument Clinic for ordered dictionary object refer python/cpython@b05cbac052 * speed up getargs refer python/cpython@1741441649 * FASTCALL for sorted, next, and getattr refer python/cpython@5a60ecaa7a refer python/cpython@fda6d0acf0 refer python/cpython@84b388bb80 * Optimize methoddescr_call refer python/cpython@2a1b676d1f refer python/cpython@c52572319c refer python/cpython@35ecebe165 refer python/cpython@8128d5a491 * cleanup _PyMethodDef_RawFastCallDict refer python/cpython@0a2e46835d refer python/cpython@98ccba8344 refer python/cpython@c89ef828cf refer python/cpython@250e4b0063 * print now uses METH_FASTCALL refer python/cpython@c3858bd7c6 refer python/cpython@bd584f169f refer python/cpython@06d34393c2 * _struct module now uses Argument Clinic refer python/cpython@3f2d10132d * make deque methods faster refer python/cpython@dd407d5006 * recursive calls in PyObject_Call refer python/cpython@7399a05965 only partially ported, because RawFastCallKeywords hasn't been ported * add macros refer python/cpython@68a001dd59 * all tests pass in MODE=dbg * convert some internal functions to FASTCALL __import__ might need to be changed later, if it is possible to backport the METH_FASTCALL | METH_KEYWORDS flag distinction later. * speed up unpickling refer python/cpython@bee09aecc2 * added _PyMethodDef_RawFastCallKeywords refer python/cpython@7399a05965 * PyCFunction_Call performance refer python/cpython@12c5838dae * avoid PyMethodObject in slots main change in python/cpython@516b98161a test_exceptions changed in python/cpython@331bbe6aaa type_settattro changed in python/cpython@193f7e094f _PyObject_CallFunctionVa changed in python/cpython@fe4ff83049 * fix refcount error found in MODE=dbg all tests now pass in MODE=dbg
This commit is contained in:
parent
6f658f058b
commit
7fe9e70117
71 changed files with 4154 additions and 2450 deletions
|
@ -281,7 +281,7 @@ _asyncio_Task_current_task(PyTypeObject *type, PyObject **args, Py_ssize_t nargs
|
|||
static _PyArg_Parser _parser = {"|O:current_task", _keywords, 0};
|
||||
PyObject *loop = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&loop)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ _asyncio_Task_all_tasks(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, P
|
|||
static _PyArg_Parser _parser = {"|O:all_tasks", _keywords, 0};
|
||||
PyObject *loop = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&loop)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -413,7 +413,7 @@ _asyncio_Task_get_stack(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObje
|
|||
static _PyArg_Parser _parser = {"|$O:get_stack", _keywords, 0};
|
||||
PyObject *limit = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&limit)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -451,7 +451,7 @@ _asyncio_Task_print_stack(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyOb
|
|||
PyObject *limit = Py_None;
|
||||
PyObject *file = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&limit, &file)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -480,7 +480,7 @@ _asyncio_Task__step(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObject *
|
|||
static _PyArg_Parser _parser = {"|O:_step", _keywords, 0};
|
||||
PyObject *exc = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&exc)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -509,7 +509,7 @@ _asyncio_Task__wakeup(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObject
|
|||
static _PyArg_Parser _parser = {"O:_wakeup", _keywords, 0};
|
||||
PyObject *fut;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&fut)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -518,4 +518,4 @@ _asyncio_Task__wakeup(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObject
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=7441872b13652085 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=1f2f5bbc35bc3c4e input=a9049054013a1b77]*/
|
||||
|
|
|
@ -131,7 +131,7 @@ _bz2_BZ2Decompressor_decompress(BZ2Decompressor *self, PyObject **args, Py_ssize
|
|||
Py_buffer data = {NULL, NULL};
|
||||
Py_ssize_t max_length = -1;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&data, &max_length)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -175,4 +175,4 @@ _bz2_BZ2Decompressor___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=7e57af0b368d3e55 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=0e97a1d716b35a14 input=a9049054013a1b77]*/
|
||||
|
|
406
third_party/python/Modules/clinic/_codecsmodule.inc
vendored
406
third_party/python/Modules/clinic/_codecsmodule.inc
vendored
File diff suppressed because it is too large
Load diff
|
@ -15,25 +15,29 @@ PyDoc_STRVAR(crypt_crypt__doc__,
|
|||
"results for a given *word*.");
|
||||
|
||||
#define CRYPT_CRYPT_METHODDEF \
|
||||
{"crypt", (PyCFunction)crypt_crypt, METH_VARARGS, crypt_crypt__doc__},
|
||||
{"crypt", (PyCFunction)crypt_crypt, METH_FASTCALL, crypt_crypt__doc__},
|
||||
|
||||
static PyObject *
|
||||
crypt_crypt_impl(PyObject *module, const char *word, const char *salt);
|
||||
|
||||
static PyObject *
|
||||
crypt_crypt(PyObject *module, PyObject *args)
|
||||
crypt_crypt(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *word;
|
||||
const char *salt;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "ss:crypt",
|
||||
if (!_PyArg_ParseStack(args, nargs, "ss:crypt",
|
||||
&word, &salt)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("crypt", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = crypt_crypt_impl(module, word, salt);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=8dfc88264e662df4 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=3fd5d3625a6f32fe input=a9049054013a1b77]*/
|
||||
|
|
|
@ -28,7 +28,7 @@ datetime_datetime_now(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, PyO
|
|||
static _PyArg_Parser _parser = {"|O:now", _keywords, 0};
|
||||
PyObject *tz = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&tz)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -37,4 +37,4 @@ datetime_datetime_now(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, PyO
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=8aaac0705add61ca input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=ff78f2f51687e9a9 input=a9049054013a1b77]*/
|
||||
|
|
32
third_party/python/Modules/clinic/_dbmmodule.inc
vendored
32
third_party/python/Modules/clinic/_dbmmodule.inc
vendored
|
@ -46,24 +46,28 @@ PyDoc_STRVAR(_dbm_dbm_get__doc__,
|
|||
"Return the value for key if present, otherwise default.");
|
||||
|
||||
#define _DBM_DBM_GET_METHODDEF \
|
||||
{"get", (PyCFunction)_dbm_dbm_get, METH_VARARGS, _dbm_dbm_get__doc__},
|
||||
{"get", (PyCFunction)_dbm_dbm_get, METH_FASTCALL, _dbm_dbm_get__doc__},
|
||||
|
||||
static PyObject *
|
||||
_dbm_dbm_get_impl(dbmobject *self, const char *key,
|
||||
Py_ssize_clean_t key_length, PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
_dbm_dbm_get(dbmobject *self, PyObject *args)
|
||||
_dbm_dbm_get(dbmobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *key;
|
||||
Py_ssize_clean_t key_length;
|
||||
PyObject *default_value = Py_None;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "s#|O:get",
|
||||
if (!_PyArg_ParseStack(args, nargs, "s#|O:get",
|
||||
&key, &key_length, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("get", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _dbm_dbm_get_impl(self, key, key_length, default_value);
|
||||
|
||||
exit:
|
||||
|
@ -79,7 +83,7 @@ PyDoc_STRVAR(_dbm_dbm_setdefault__doc__,
|
|||
"If key is not in the database, it is inserted with default as the value.");
|
||||
|
||||
#define _DBM_DBM_SETDEFAULT_METHODDEF \
|
||||
{"setdefault", (PyCFunction)_dbm_dbm_setdefault, METH_VARARGS, _dbm_dbm_setdefault__doc__},
|
||||
{"setdefault", (PyCFunction)_dbm_dbm_setdefault, METH_FASTCALL, _dbm_dbm_setdefault__doc__},
|
||||
|
||||
static PyObject *
|
||||
_dbm_dbm_setdefault_impl(dbmobject *self, const char *key,
|
||||
|
@ -87,17 +91,21 @@ _dbm_dbm_setdefault_impl(dbmobject *self, const char *key,
|
|||
PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
_dbm_dbm_setdefault(dbmobject *self, PyObject *args)
|
||||
_dbm_dbm_setdefault(dbmobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *key;
|
||||
Py_ssize_clean_t key_length;
|
||||
PyObject *default_value = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "s#|O:setdefault",
|
||||
if (!_PyArg_ParseStack(args, nargs, "s#|O:setdefault",
|
||||
&key, &key_length, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("setdefault", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _dbm_dbm_setdefault_impl(self, key, key_length, default_value);
|
||||
|
||||
exit:
|
||||
|
@ -119,27 +127,31 @@ PyDoc_STRVAR(dbmopen__doc__,
|
|||
" (e.g. os.O_RDWR).");
|
||||
|
||||
#define DBMOPEN_METHODDEF \
|
||||
{"open", (PyCFunction)dbmopen, METH_VARARGS, dbmopen__doc__},
|
||||
{"open", (PyCFunction)dbmopen, METH_FASTCALL, dbmopen__doc__},
|
||||
|
||||
static PyObject *
|
||||
dbmopen_impl(PyObject *module, PyObject *filename, const char *flags,
|
||||
int mode);
|
||||
|
||||
static PyObject *
|
||||
dbmopen(PyObject *module, PyObject *args)
|
||||
dbmopen(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *filename;
|
||||
const char *flags = "r";
|
||||
int mode = 438;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "U|si:open",
|
||||
if (!_PyArg_ParseStack(args, nargs, "U|si:open",
|
||||
&filename, &flags, &mode)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("open", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = dbmopen_impl(module, filename, flags, mode);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=919cc4337be4a5d3 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=60482e924110a70a input=a9049054013a1b77]*/
|
||||
|
|
|
@ -152,7 +152,7 @@ _elementtree_Element_find(ElementObject *self, PyObject **args, Py_ssize_t nargs
|
|||
PyObject *path;
|
||||
PyObject *namespaces = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&path, &namespaces)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ _elementtree_Element_findtext(ElementObject *self, PyObject **args, Py_ssize_t n
|
|||
PyObject *default_value = Py_None;
|
||||
PyObject *namespaces = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&path, &default_value, &namespaces)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ _elementtree_Element_findall(ElementObject *self, PyObject **args, Py_ssize_t na
|
|||
PyObject *path;
|
||||
PyObject *namespaces = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&path, &namespaces)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ _elementtree_Element_iterfind(ElementObject *self, PyObject **args, Py_ssize_t n
|
|||
PyObject *path;
|
||||
PyObject *namespaces = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&path, &namespaces)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ _elementtree_Element_get(ElementObject *self, PyObject **args, Py_ssize_t nargs,
|
|||
PyObject *key;
|
||||
PyObject *default_value = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&key, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -324,7 +324,7 @@ _elementtree_Element_iter(ElementObject *self, PyObject **args, Py_ssize_t nargs
|
|||
static _PyArg_Parser _parser = {"|O:iter", _keywords, 0};
|
||||
PyObject *tag = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&tag)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -357,23 +357,27 @@ PyDoc_STRVAR(_elementtree_Element_insert__doc__,
|
|||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_INSERT_METHODDEF \
|
||||
{"insert", (PyCFunction)_elementtree_Element_insert, METH_VARARGS, _elementtree_Element_insert__doc__},
|
||||
{"insert", (PyCFunction)_elementtree_Element_insert, METH_FASTCALL, _elementtree_Element_insert__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_insert_impl(ElementObject *self, Py_ssize_t index,
|
||||
PyObject *subelement);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_insert(ElementObject *self, PyObject *args)
|
||||
_elementtree_Element_insert(ElementObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t index;
|
||||
PyObject *subelement;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "nO!:insert",
|
||||
if (!_PyArg_ParseStack(args, nargs, "nO!:insert",
|
||||
&index, &Element_Type, &subelement)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("insert", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_Element_insert_impl(self, index, subelement);
|
||||
|
||||
exit:
|
||||
|
@ -420,24 +424,28 @@ PyDoc_STRVAR(_elementtree_Element_makeelement__doc__,
|
|||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_MAKEELEMENT_METHODDEF \
|
||||
{"makeelement", (PyCFunction)_elementtree_Element_makeelement, METH_VARARGS, _elementtree_Element_makeelement__doc__},
|
||||
{"makeelement", (PyCFunction)_elementtree_Element_makeelement, METH_FASTCALL, _elementtree_Element_makeelement__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_makeelement_impl(ElementObject *self, PyObject *tag,
|
||||
PyObject *attrib);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_makeelement(ElementObject *self, PyObject *args)
|
||||
_elementtree_Element_makeelement(ElementObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *tag;
|
||||
PyObject *attrib;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "makeelement",
|
||||
if (!_PyArg_UnpackStack(args, nargs, "makeelement",
|
||||
2, 2,
|
||||
&tag, &attrib)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("makeelement", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_Element_makeelement_impl(self, tag, attrib);
|
||||
|
||||
exit:
|
||||
|
@ -476,24 +484,28 @@ PyDoc_STRVAR(_elementtree_Element_set__doc__,
|
|||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_ELEMENT_SET_METHODDEF \
|
||||
{"set", (PyCFunction)_elementtree_Element_set, METH_VARARGS, _elementtree_Element_set__doc__},
|
||||
{"set", (PyCFunction)_elementtree_Element_set, METH_FASTCALL, _elementtree_Element_set__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_set_impl(ElementObject *self, PyObject *key,
|
||||
PyObject *value);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_Element_set(ElementObject *self, PyObject *args)
|
||||
_elementtree_Element_set(ElementObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *key;
|
||||
PyObject *value;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "set",
|
||||
if (!_PyArg_UnpackStack(args, nargs, "set",
|
||||
2, 2,
|
||||
&key, &value)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("set", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_Element_set_impl(self, key, value);
|
||||
|
||||
exit:
|
||||
|
@ -561,24 +573,28 @@ PyDoc_STRVAR(_elementtree_TreeBuilder_start__doc__,
|
|||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_TREEBUILDER_START_METHODDEF \
|
||||
{"start", (PyCFunction)_elementtree_TreeBuilder_start, METH_VARARGS, _elementtree_TreeBuilder_start__doc__},
|
||||
{"start", (PyCFunction)_elementtree_TreeBuilder_start, METH_FASTCALL, _elementtree_TreeBuilder_start__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_TreeBuilder_start_impl(TreeBuilderObject *self, PyObject *tag,
|
||||
PyObject *attrs);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_TreeBuilder_start(TreeBuilderObject *self, PyObject *args)
|
||||
_elementtree_TreeBuilder_start(TreeBuilderObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *tag;
|
||||
PyObject *attrs = Py_None;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "start",
|
||||
if (!_PyArg_UnpackStack(args, nargs, "start",
|
||||
1, 2,
|
||||
&tag, &attrs)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("start", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_TreeBuilder_start_impl(self, tag, attrs);
|
||||
|
||||
exit:
|
||||
|
@ -648,25 +664,29 @@ PyDoc_STRVAR(_elementtree_XMLParser_doctype__doc__,
|
|||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_XMLPARSER_DOCTYPE_METHODDEF \
|
||||
{"doctype", (PyCFunction)_elementtree_XMLParser_doctype, METH_VARARGS, _elementtree_XMLParser_doctype__doc__},
|
||||
{"doctype", (PyCFunction)_elementtree_XMLParser_doctype, METH_FASTCALL, _elementtree_XMLParser_doctype__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_XMLParser_doctype_impl(XMLParserObject *self, PyObject *name,
|
||||
PyObject *pubid, PyObject *system);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_XMLParser_doctype(XMLParserObject *self, PyObject *args)
|
||||
_elementtree_XMLParser_doctype(XMLParserObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
PyObject *pubid;
|
||||
PyObject *system;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "doctype",
|
||||
if (!_PyArg_UnpackStack(args, nargs, "doctype",
|
||||
3, 3,
|
||||
&name, &pubid, &system)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("doctype", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_XMLParser_doctype_impl(self, name, pubid, system);
|
||||
|
||||
exit:
|
||||
|
@ -679,7 +699,7 @@ PyDoc_STRVAR(_elementtree_XMLParser__setevents__doc__,
|
|||
"\n");
|
||||
|
||||
#define _ELEMENTTREE_XMLPARSER__SETEVENTS_METHODDEF \
|
||||
{"_setevents", (PyCFunction)_elementtree_XMLParser__setevents, METH_VARARGS, _elementtree_XMLParser__setevents__doc__},
|
||||
{"_setevents", (PyCFunction)_elementtree_XMLParser__setevents, METH_FASTCALL, _elementtree_XMLParser__setevents__doc__},
|
||||
|
||||
static PyObject *
|
||||
_elementtree_XMLParser__setevents_impl(XMLParserObject *self,
|
||||
|
@ -687,20 +707,24 @@ _elementtree_XMLParser__setevents_impl(XMLParserObject *self,
|
|||
PyObject *events_to_report);
|
||||
|
||||
static PyObject *
|
||||
_elementtree_XMLParser__setevents(XMLParserObject *self, PyObject *args)
|
||||
_elementtree_XMLParser__setevents(XMLParserObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *events_queue;
|
||||
PyObject *events_to_report = Py_None;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "_setevents",
|
||||
if (!_PyArg_UnpackStack(args, nargs, "_setevents",
|
||||
1, 2,
|
||||
&events_queue, &events_to_report)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("_setevents", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _elementtree_XMLParser__setevents_impl(self, events_queue, events_to_report);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=b4a571a98ced3163 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=b69fa98c40917f58 input=a9049054013a1b77]*/
|
||||
|
|
|
@ -10,23 +10,27 @@ PyDoc_STRVAR(_gdbm_gdbm_get__doc__,
|
|||
"Get the value for key, or default if not present.");
|
||||
|
||||
#define _GDBM_GDBM_GET_METHODDEF \
|
||||
{"get", (PyCFunction)_gdbm_gdbm_get, METH_VARARGS, _gdbm_gdbm_get__doc__},
|
||||
{"get", (PyCFunction)_gdbm_gdbm_get, METH_FASTCALL, _gdbm_gdbm_get__doc__},
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_get_impl(dbmobject *self, PyObject *key, PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_get(dbmobject *self, PyObject *args)
|
||||
_gdbm_gdbm_get(dbmobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *key;
|
||||
PyObject *default_value = Py_None;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "get",
|
||||
if (!_PyArg_UnpackStack(args, nargs, "get",
|
||||
1, 2,
|
||||
&key, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("get", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _gdbm_gdbm_get_impl(self, key, default_value);
|
||||
|
||||
exit:
|
||||
|
@ -40,24 +44,28 @@ PyDoc_STRVAR(_gdbm_gdbm_setdefault__doc__,
|
|||
"Get value for key, or set it to default and return default if not present.");
|
||||
|
||||
#define _GDBM_GDBM_SETDEFAULT_METHODDEF \
|
||||
{"setdefault", (PyCFunction)_gdbm_gdbm_setdefault, METH_VARARGS, _gdbm_gdbm_setdefault__doc__},
|
||||
{"setdefault", (PyCFunction)_gdbm_gdbm_setdefault, METH_FASTCALL, _gdbm_gdbm_setdefault__doc__},
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_setdefault_impl(dbmobject *self, PyObject *key,
|
||||
PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
_gdbm_gdbm_setdefault(dbmobject *self, PyObject *args)
|
||||
_gdbm_gdbm_setdefault(dbmobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *key;
|
||||
PyObject *default_value = Py_None;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "setdefault",
|
||||
if (!_PyArg_UnpackStack(args, nargs, "setdefault",
|
||||
1, 2,
|
||||
&key, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("setdefault", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _gdbm_gdbm_setdefault_impl(self, key, default_value);
|
||||
|
||||
exit:
|
||||
|
@ -232,27 +240,31 @@ PyDoc_STRVAR(dbmopen__doc__,
|
|||
"when the database has to be created. It defaults to octal 0o666.");
|
||||
|
||||
#define DBMOPEN_METHODDEF \
|
||||
{"open", (PyCFunction)dbmopen, METH_VARARGS, dbmopen__doc__},
|
||||
{"open", (PyCFunction)dbmopen, METH_FASTCALL, dbmopen__doc__},
|
||||
|
||||
static PyObject *
|
||||
dbmopen_impl(PyObject *module, PyObject *filename, const char *flags,
|
||||
int mode);
|
||||
|
||||
static PyObject *
|
||||
dbmopen(PyObject *module, PyObject *args)
|
||||
dbmopen(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *filename;
|
||||
const char *flags = "r";
|
||||
int mode = 438;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "U|si:open",
|
||||
if (!_PyArg_ParseStack(args, nargs, "U|si:open",
|
||||
&filename, &flags, &mode)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("open", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = dbmopen_impl(module, filename, flags, mode);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=afb99364ac420d10 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=d12de247acddccc3 input=a9049054013a1b77]*/
|
||||
|
|
|
@ -97,7 +97,7 @@ _lzma_LZMADecompressor_decompress(Decompressor *self, PyObject **args, Py_ssize_
|
|||
Py_buffer data = {NULL, NULL};
|
||||
Py_ssize_t max_length = -1;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&data, &max_length)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -230,23 +230,27 @@ PyDoc_STRVAR(_lzma__decode_filter_properties__doc__,
|
|||
"The result does not include the filter ID itself, only the options.");
|
||||
|
||||
#define _LZMA__DECODE_FILTER_PROPERTIES_METHODDEF \
|
||||
{"_decode_filter_properties", (PyCFunction)_lzma__decode_filter_properties, METH_VARARGS, _lzma__decode_filter_properties__doc__},
|
||||
{"_decode_filter_properties", (PyCFunction)_lzma__decode_filter_properties, METH_FASTCALL, _lzma__decode_filter_properties__doc__},
|
||||
|
||||
static PyObject *
|
||||
_lzma__decode_filter_properties_impl(PyObject *module, lzma_vli filter_id,
|
||||
Py_buffer *encoded_props);
|
||||
|
||||
static PyObject *
|
||||
_lzma__decode_filter_properties(PyObject *module, PyObject *args)
|
||||
_lzma__decode_filter_properties(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
lzma_vli filter_id;
|
||||
Py_buffer encoded_props = {NULL, NULL};
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O&y*:_decode_filter_properties",
|
||||
if (!_PyArg_ParseStack(args, nargs, "O&y*:_decode_filter_properties",
|
||||
lzma_vli_converter, &filter_id, &encoded_props)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("_decode_filter_properties", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _lzma__decode_filter_properties_impl(module, filter_id, &encoded_props);
|
||||
|
||||
exit:
|
||||
|
@ -257,4 +261,4 @@ exit:
|
|||
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=f27abae460122706 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=5f7a915fb7e41453 input=a9049054013a1b77]*/
|
||||
|
|
12
third_party/python/Modules/clinic/_opcode.inc
vendored
12
third_party/python/Modules/clinic/_opcode.inc
vendored
|
@ -10,23 +10,27 @@ PyDoc_STRVAR(_opcode_stack_effect__doc__,
|
|||
"Compute the stack effect of the opcode.");
|
||||
|
||||
#define _OPCODE_STACK_EFFECT_METHODDEF \
|
||||
{"stack_effect", (PyCFunction)_opcode_stack_effect, METH_VARARGS, _opcode_stack_effect__doc__},
|
||||
{"stack_effect", (PyCFunction)_opcode_stack_effect, METH_FASTCALL, _opcode_stack_effect__doc__},
|
||||
|
||||
static int
|
||||
_opcode_stack_effect_impl(PyObject *module, int opcode, PyObject *oparg);
|
||||
|
||||
static PyObject *
|
||||
_opcode_stack_effect(PyObject *module, PyObject *args)
|
||||
_opcode_stack_effect(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int opcode;
|
||||
PyObject *oparg = Py_None;
|
||||
int _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i|O:stack_effect",
|
||||
if (!_PyArg_ParseStack(args, nargs, "i|O:stack_effect",
|
||||
&opcode, &oparg)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("stack_effect", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _opcode_stack_effect_impl(module, opcode, oparg);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
|
@ -36,4 +40,4 @@ _opcode_stack_effect(PyObject *module, PyObject *args)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=4d91c6a765097853 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=62858005ac85baa9 input=a9049054013a1b77]*/
|
||||
|
|
20
third_party/python/Modules/clinic/_pickle.inc
vendored
20
third_party/python/Modules/clinic/_pickle.inc
vendored
|
@ -200,7 +200,7 @@ PyDoc_STRVAR(_pickle_Unpickler_find_class__doc__,
|
|||
"needed. Both arguments passed are str objects.");
|
||||
|
||||
#define _PICKLE_UNPICKLER_FIND_CLASS_METHODDEF \
|
||||
{"find_class", (PyCFunction)_pickle_Unpickler_find_class, METH_VARARGS, _pickle_Unpickler_find_class__doc__},
|
||||
{"find_class", (PyCFunction)_pickle_Unpickler_find_class, METH_FASTCALL, _pickle_Unpickler_find_class__doc__},
|
||||
|
||||
static PyObject *
|
||||
_pickle_Unpickler_find_class_impl(UnpicklerObject *self,
|
||||
|
@ -208,17 +208,21 @@ _pickle_Unpickler_find_class_impl(UnpicklerObject *self,
|
|||
PyObject *global_name);
|
||||
|
||||
static PyObject *
|
||||
_pickle_Unpickler_find_class(UnpicklerObject *self, PyObject *args)
|
||||
_pickle_Unpickler_find_class(UnpicklerObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *module_name;
|
||||
PyObject *global_name;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "find_class",
|
||||
if (!_PyArg_UnpackStack(args, nargs, "find_class",
|
||||
2, 2,
|
||||
&module_name, &global_name)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("find_class", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _pickle_Unpickler_find_class_impl(self, module_name, global_name);
|
||||
|
||||
exit:
|
||||
|
@ -402,7 +406,7 @@ _pickle_dump(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
|
|||
PyObject *protocol = NULL;
|
||||
int fix_imports = 1;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&obj, &file, &protocol, &fix_imports)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -447,7 +451,7 @@ _pickle_dumps(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
|
|||
PyObject *protocol = NULL;
|
||||
int fix_imports = 1;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&obj, &protocol, &fix_imports)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -504,7 +508,7 @@ _pickle_load(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
|
|||
const char *encoding = "ASCII";
|
||||
const char *errors = "strict";
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&file, &fix_imports, &encoding, &errors)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -552,7 +556,7 @@ _pickle_loads(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
|
|||
const char *encoding = "ASCII";
|
||||
const char *errors = "strict";
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&data, &fix_imports, &encoding, &errors)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -561,4 +565,4 @@ _pickle_loads(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=82be137b3c09cb9f input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=b921d325b2f7a096 input=a9049054013a1b77]*/
|
||||
|
|
72
third_party/python/Modules/clinic/_sre.inc
vendored
72
third_party/python/Modules/clinic/_sre.inc
vendored
|
@ -36,23 +36,27 @@ PyDoc_STRVAR(_sre_getlower__doc__,
|
|||
"\n");
|
||||
|
||||
#define _SRE_GETLOWER_METHODDEF \
|
||||
{"getlower", (PyCFunction)_sre_getlower, METH_VARARGS, _sre_getlower__doc__},
|
||||
{"getlower", (PyCFunction)_sre_getlower, METH_FASTCALL, _sre_getlower__doc__},
|
||||
|
||||
static int
|
||||
_sre_getlower_impl(PyObject *module, int character, int flags);
|
||||
|
||||
static PyObject *
|
||||
_sre_getlower(PyObject *module, PyObject *args)
|
||||
_sre_getlower(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int character;
|
||||
int flags;
|
||||
int _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "ii:getlower",
|
||||
if (!_PyArg_ParseStack(args, nargs, "ii:getlower",
|
||||
&character, &flags)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("getlower", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _sre_getlower_impl(module, character, flags);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
|
@ -88,7 +92,7 @@ _sre_SRE_Pattern_match(PatternObject *self, PyObject **args, Py_ssize_t nargs, P
|
|||
Py_ssize_t endpos = PY_SSIZE_T_MAX;
|
||||
PyObject *pattern = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&string, &pos, &endpos, &pattern)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -124,7 +128,7 @@ _sre_SRE_Pattern_fullmatch(PatternObject *self, PyObject **args, Py_ssize_t narg
|
|||
Py_ssize_t endpos = PY_SSIZE_T_MAX;
|
||||
PyObject *pattern = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&string, &pos, &endpos, &pattern)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -162,7 +166,7 @@ _sre_SRE_Pattern_search(PatternObject *self, PyObject **args, Py_ssize_t nargs,
|
|||
Py_ssize_t endpos = PY_SSIZE_T_MAX;
|
||||
PyObject *pattern = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&string, &pos, &endpos, &pattern)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -198,7 +202,7 @@ _sre_SRE_Pattern_findall(PatternObject *self, PyObject **args, Py_ssize_t nargs,
|
|||
Py_ssize_t endpos = PY_SSIZE_T_MAX;
|
||||
PyObject *source = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&string, &pos, &endpos, &source)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -233,7 +237,7 @@ _sre_SRE_Pattern_finditer(PatternObject *self, PyObject **args, Py_ssize_t nargs
|
|||
Py_ssize_t pos = 0;
|
||||
Py_ssize_t endpos = PY_SSIZE_T_MAX;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&string, &pos, &endpos)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -265,7 +269,7 @@ _sre_SRE_Pattern_scanner(PatternObject *self, PyObject **args, Py_ssize_t nargs,
|
|||
Py_ssize_t pos = 0;
|
||||
Py_ssize_t endpos = PY_SSIZE_T_MAX;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&string, &pos, &endpos)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -298,7 +302,7 @@ _sre_SRE_Pattern_split(PatternObject *self, PyObject **args, Py_ssize_t nargs, P
|
|||
Py_ssize_t maxsplit = 0;
|
||||
PyObject *source = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&string, &maxsplit, &source)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -331,7 +335,7 @@ _sre_SRE_Pattern_sub(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyO
|
|||
PyObject *string;
|
||||
Py_ssize_t count = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&repl, &string, &count)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -364,7 +368,7 @@ _sre_SRE_Pattern_subn(PatternObject *self, PyObject **args, Py_ssize_t nargs, Py
|
|||
PyObject *string;
|
||||
Py_ssize_t count = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&repl, &string, &count)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -410,7 +414,7 @@ _sre_SRE_Pattern___deepcopy__(PatternObject *self, PyObject **args, Py_ssize_t n
|
|||
static _PyArg_Parser _parser = {"O:__deepcopy__", _keywords, 0};
|
||||
PyObject *memo;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&memo)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -447,7 +451,7 @@ _sre_compile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
|
|||
PyObject *groupindex;
|
||||
PyObject *indexgroup;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&pattern, &flags, &PyList_Type, &code, &groups, &groupindex, &indexgroup)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -477,7 +481,7 @@ _sre_SRE_Match_expand(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyOb
|
|||
static _PyArg_Parser _parser = {"O:expand", _keywords, 0};
|
||||
PyObject *template;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&template)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -510,7 +514,7 @@ _sre_SRE_Match_groups(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyOb
|
|||
static _PyArg_Parser _parser = {"|O:groups", _keywords, 0};
|
||||
PyObject *default_value = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -543,7 +547,7 @@ _sre_SRE_Match_groupdict(MatchObject *self, PyObject **args, Py_ssize_t nargs, P
|
|||
static _PyArg_Parser _parser = {"|O:groupdict", _keywords, 0};
|
||||
PyObject *default_value = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -560,23 +564,27 @@ PyDoc_STRVAR(_sre_SRE_Match_start__doc__,
|
|||
"Return index of the start of the substring matched by group.");
|
||||
|
||||
#define _SRE_SRE_MATCH_START_METHODDEF \
|
||||
{"start", (PyCFunction)_sre_SRE_Match_start, METH_VARARGS, _sre_SRE_Match_start__doc__},
|
||||
{"start", (PyCFunction)_sre_SRE_Match_start, METH_FASTCALL, _sre_SRE_Match_start__doc__},
|
||||
|
||||
static Py_ssize_t
|
||||
_sre_SRE_Match_start_impl(MatchObject *self, PyObject *group);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match_start(MatchObject *self, PyObject *args)
|
||||
_sre_SRE_Match_start(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *group = NULL;
|
||||
Py_ssize_t _return_value;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "start",
|
||||
if (!_PyArg_UnpackStack(args, nargs, "start",
|
||||
0, 1,
|
||||
&group)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("start", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _sre_SRE_Match_start_impl(self, group);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
|
@ -594,23 +602,27 @@ PyDoc_STRVAR(_sre_SRE_Match_end__doc__,
|
|||
"Return index of the end of the substring matched by group.");
|
||||
|
||||
#define _SRE_SRE_MATCH_END_METHODDEF \
|
||||
{"end", (PyCFunction)_sre_SRE_Match_end, METH_VARARGS, _sre_SRE_Match_end__doc__},
|
||||
{"end", (PyCFunction)_sre_SRE_Match_end, METH_FASTCALL, _sre_SRE_Match_end__doc__},
|
||||
|
||||
static Py_ssize_t
|
||||
_sre_SRE_Match_end_impl(MatchObject *self, PyObject *group);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match_end(MatchObject *self, PyObject *args)
|
||||
_sre_SRE_Match_end(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *group = NULL;
|
||||
Py_ssize_t _return_value;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "end",
|
||||
if (!_PyArg_UnpackStack(args, nargs, "end",
|
||||
0, 1,
|
||||
&group)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("end", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _sre_SRE_Match_end_impl(self, group);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
|
@ -628,22 +640,26 @@ PyDoc_STRVAR(_sre_SRE_Match_span__doc__,
|
|||
"For MatchObject m, return the 2-tuple (m.start(group), m.end(group)).");
|
||||
|
||||
#define _SRE_SRE_MATCH_SPAN_METHODDEF \
|
||||
{"span", (PyCFunction)_sre_SRE_Match_span, METH_VARARGS, _sre_SRE_Match_span__doc__},
|
||||
{"span", (PyCFunction)_sre_SRE_Match_span, METH_FASTCALL, _sre_SRE_Match_span__doc__},
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match_span_impl(MatchObject *self, PyObject *group);
|
||||
|
||||
static PyObject *
|
||||
_sre_SRE_Match_span(MatchObject *self, PyObject *args)
|
||||
_sre_SRE_Match_span(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *group = NULL;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "span",
|
||||
if (!_PyArg_UnpackStack(args, nargs, "span",
|
||||
0, 1,
|
||||
&group)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("span", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _sre_SRE_Match_span_impl(self, group);
|
||||
|
||||
exit:
|
||||
|
@ -686,7 +702,7 @@ _sre_SRE_Match___deepcopy__(MatchObject *self, PyObject **args, Py_ssize_t nargs
|
|||
static _PyArg_Parser _parser = {"O:__deepcopy__", _keywords, 0};
|
||||
PyObject *memo;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&memo)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -729,4 +745,4 @@ _sre_SRE_Scanner_search(ScannerObject *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return _sre_SRE_Scanner_search_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=a4a246bca1963bc9 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=ddfd6158e7ca39a3 input=a9049054013a1b77]*/
|
||||
|
|
16
third_party/python/Modules/clinic/_ssl.inc
vendored
16
third_party/python/Modules/clinic/_ssl.inc
vendored
|
@ -504,7 +504,7 @@ _ssl__SSLContext_load_cert_chain(PySSLContext *self, PyObject **args, Py_ssize_t
|
|||
PyObject *keyfile = NULL;
|
||||
PyObject *password = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&certfile, &keyfile, &password)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -538,7 +538,7 @@ _ssl__SSLContext_load_verify_locations(PySSLContext *self, PyObject **args, Py_s
|
|||
PyObject *capath = NULL;
|
||||
PyObject *cadata = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&cafile, &capath, &cadata)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -578,7 +578,7 @@ _ssl__SSLContext__wrap_socket(PySSLContext *self, PyObject **args, Py_ssize_t na
|
|||
int server_side;
|
||||
PyObject *hostname_obj = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
PySocketModule.Sock_Type, &sock, &server_side, &hostname_obj)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -613,7 +613,7 @@ _ssl__SSLContext__wrap_bio(PySSLContext *self, PyObject **args, Py_ssize_t nargs
|
|||
int server_side;
|
||||
PyObject *hostname_obj = Py_None;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&PySSLMemoryBIO_Type, &incoming, &PySSLMemoryBIO_Type, &outgoing, &server_side, &hostname_obj)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -732,7 +732,7 @@ _ssl__SSLContext_get_ca_certs(PySSLContext *self, PyObject **args, Py_ssize_t na
|
|||
static _PyArg_Parser _parser = {"|p:get_ca_certs", _keywords, 0};
|
||||
int binary_form = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&binary_form)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1044,7 +1044,7 @@ _ssl_txt2obj(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
|
|||
const char *txt;
|
||||
int name = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&txt, &name)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1109,7 +1109,7 @@ _ssl_enum_certificates(PyObject *module, PyObject **args, Py_ssize_t nargs, PyOb
|
|||
static _PyArg_Parser _parser = {"s:enum_certificates", _keywords, 0};
|
||||
const char *store_name;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&store_name)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1148,7 +1148,7 @@ _ssl_enum_crls(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
|
|||
static _PyArg_Parser _parser = {"s:enum_crls", _keywords, 0};
|
||||
const char *store_name;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&store_name)) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
277
third_party/python/Modules/clinic/_struct.inc
vendored
Normal file
277
third_party/python/Modules/clinic/_struct.inc
vendored
Normal file
|
@ -0,0 +1,277 @@
|
|||
/* clang-format off */
|
||||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(Struct___init____doc__,
|
||||
"Struct(format)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Create a compiled struct object.\n"
|
||||
"\n"
|
||||
"Return a new Struct object which writes and reads binary data according to\n"
|
||||
"the format string.\n"
|
||||
"\n"
|
||||
"See help(struct) for more on format strings.");
|
||||
|
||||
static int
|
||||
Struct___init___impl(PyStructObject *self, PyObject *format);
|
||||
|
||||
static int
|
||||
Struct___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
int return_value = -1;
|
||||
static const char * const _keywords[] = {"format", NULL};
|
||||
static _PyArg_Parser _parser = {"O:Struct", _keywords, 0};
|
||||
PyObject *format;
|
||||
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
|
||||
&format)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = Struct___init___impl((PyStructObject *)self, format);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(Struct_unpack__doc__,
|
||||
"unpack($self, buffer, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a tuple containing unpacked values.\n"
|
||||
"\n"
|
||||
"Unpack according to the format string Struct.format. The buffer\'s size\n"
|
||||
"in bytes must be Struct.size.\n"
|
||||
"\n"
|
||||
"See help(struct) for more on format strings.");
|
||||
|
||||
#define STRUCT_UNPACK_METHODDEF \
|
||||
{"unpack", (PyCFunction)Struct_unpack, METH_O, Struct_unpack__doc__},
|
||||
|
||||
static PyObject *
|
||||
Struct_unpack_impl(PyStructObject *self, Py_buffer *buffer);
|
||||
|
||||
static PyObject *
|
||||
Struct_unpack(PyStructObject *self, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer buffer = {NULL, NULL};
|
||||
|
||||
if (!PyArg_Parse(arg, "y*:unpack", &buffer)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = Struct_unpack_impl(self, &buffer);
|
||||
|
||||
exit:
|
||||
/* Cleanup for buffer */
|
||||
if (buffer.obj) {
|
||||
PyBuffer_Release(&buffer);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(Struct_unpack_from__doc__,
|
||||
"unpack_from($self, /, buffer, offset=0)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a tuple containing unpacked values.\n"
|
||||
"\n"
|
||||
"Values are unpacked according to the format string Struct.format.\n"
|
||||
"\n"
|
||||
"The buffer\'s size in bytes, minus offset, must be at least Struct.size.\n"
|
||||
"\n"
|
||||
"See help(struct) for more on format strings.");
|
||||
|
||||
#define STRUCT_UNPACK_FROM_METHODDEF \
|
||||
{"unpack_from", (PyCFunction)Struct_unpack_from, METH_FASTCALL, Struct_unpack_from__doc__},
|
||||
|
||||
static PyObject *
|
||||
Struct_unpack_from_impl(PyStructObject *self, Py_buffer *buffer,
|
||||
Py_ssize_t offset);
|
||||
|
||||
static PyObject *
|
||||
Struct_unpack_from(PyStructObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"buffer", "offset", NULL};
|
||||
static _PyArg_Parser _parser = {"y*|n:unpack_from", _keywords, 0};
|
||||
Py_buffer buffer = {NULL, NULL};
|
||||
Py_ssize_t offset = 0;
|
||||
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&buffer, &offset)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = Struct_unpack_from_impl(self, &buffer, offset);
|
||||
|
||||
exit:
|
||||
/* Cleanup for buffer */
|
||||
if (buffer.obj) {
|
||||
PyBuffer_Release(&buffer);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(Struct_iter_unpack__doc__,
|
||||
"iter_unpack($self, buffer, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return an iterator yielding tuples.\n"
|
||||
"\n"
|
||||
"Tuples are unpacked from the given bytes source, like a repeated\n"
|
||||
"invocation of unpack_from().\n"
|
||||
"\n"
|
||||
"Requires that the bytes length be a multiple of the struct size.");
|
||||
|
||||
#define STRUCT_ITER_UNPACK_METHODDEF \
|
||||
{"iter_unpack", (PyCFunction)Struct_iter_unpack, METH_O, Struct_iter_unpack__doc__},
|
||||
|
||||
PyDoc_STRVAR(_clearcache__doc__,
|
||||
"_clearcache($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Clear the internal cache.");
|
||||
|
||||
#define _CLEARCACHE_METHODDEF \
|
||||
{"_clearcache", (PyCFunction)_clearcache, METH_NOARGS, _clearcache__doc__},
|
||||
|
||||
static PyObject *
|
||||
_clearcache_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
_clearcache(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _clearcache_impl(module);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(calcsize__doc__,
|
||||
"calcsize($module, format, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return size in bytes of the struct described by the format string.");
|
||||
|
||||
#define CALCSIZE_METHODDEF \
|
||||
{"calcsize", (PyCFunction)calcsize, METH_O, calcsize__doc__},
|
||||
|
||||
PyDoc_STRVAR(unpack__doc__,
|
||||
"unpack($module, format, inputstr, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a tuple containing values unpacked according to the format string.\n"
|
||||
"\n"
|
||||
"The buffer\'s size in bytes must be calcsize(format).\n"
|
||||
"\n"
|
||||
"See help(struct) for more on format strings.");
|
||||
|
||||
#define UNPACK_METHODDEF \
|
||||
{"unpack", (PyCFunction)unpack, METH_FASTCALL, unpack__doc__},
|
||||
|
||||
static PyObject *
|
||||
unpack_impl(PyObject *module, PyObject *format, PyObject *inputstr);
|
||||
|
||||
static PyObject *
|
||||
unpack(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *format;
|
||||
PyObject *inputstr;
|
||||
|
||||
if (!_PyArg_UnpackStack(args, nargs, "unpack",
|
||||
2, 2,
|
||||
&format, &inputstr)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("unpack", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unpack_impl(module, format, inputstr);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(unpack_from__doc__,
|
||||
"unpack_from($module, format, /, buffer, offset=0)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return a tuple containing values unpacked according to the format string.\n"
|
||||
"\n"
|
||||
"The buffer\'s size, minus offset, must be at least calcsize(format).\n"
|
||||
"\n"
|
||||
"See help(struct) for more on format strings.");
|
||||
|
||||
#define UNPACK_FROM_METHODDEF \
|
||||
{"unpack_from", (PyCFunction)unpack_from, METH_FASTCALL, unpack_from__doc__},
|
||||
|
||||
static PyObject *
|
||||
unpack_from_impl(PyObject *module, PyObject *format, Py_buffer *buffer,
|
||||
Py_ssize_t offset);
|
||||
|
||||
static PyObject *
|
||||
unpack_from(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"", "buffer", "offset", NULL};
|
||||
static _PyArg_Parser _parser = {"Oy*|n:unpack_from", _keywords, 0};
|
||||
PyObject *format;
|
||||
Py_buffer buffer = {NULL, NULL};
|
||||
Py_ssize_t offset = 0;
|
||||
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&format, &buffer, &offset)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unpack_from_impl(module, format, &buffer, offset);
|
||||
|
||||
exit:
|
||||
/* Cleanup for buffer */
|
||||
if (buffer.obj) {
|
||||
PyBuffer_Release(&buffer);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(iter_unpack__doc__,
|
||||
"iter_unpack($module, format, buffer, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return an iterator yielding tuples unpacked from the given bytes.\n"
|
||||
"\n"
|
||||
"The bytes are unpacked according to the format string, like\n"
|
||||
"a repeated invocation of unpack_from().\n"
|
||||
"\n"
|
||||
"Requires that the bytes length be a multiple of the format struct size.");
|
||||
|
||||
#define ITER_UNPACK_METHODDEF \
|
||||
{"iter_unpack", (PyCFunction)iter_unpack, METH_FASTCALL, iter_unpack__doc__},
|
||||
|
||||
static PyObject *
|
||||
iter_unpack_impl(PyObject *module, PyObject *format, PyObject *buffer);
|
||||
|
||||
static PyObject *
|
||||
iter_unpack(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *format;
|
||||
PyObject *buffer;
|
||||
|
||||
if (!_PyArg_UnpackStack(args, nargs, "iter_unpack",
|
||||
2, 2,
|
||||
&format, &buffer)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("iter_unpack", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = iter_unpack_impl(module, format, buffer);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=db8152ad222fa3d0 input=a9049054013a1b77]*/
|
12
third_party/python/Modules/clinic/_weakref.inc
vendored
12
third_party/python/Modules/clinic/_weakref.inc
vendored
|
@ -38,26 +38,30 @@ PyDoc_STRVAR(_weakref__remove_dead_weakref__doc__,
|
|||
"Atomically remove key from dict if it points to a dead weakref.");
|
||||
|
||||
#define _WEAKREF__REMOVE_DEAD_WEAKREF_METHODDEF \
|
||||
{"_remove_dead_weakref", (PyCFunction)_weakref__remove_dead_weakref, METH_VARARGS, _weakref__remove_dead_weakref__doc__},
|
||||
{"_remove_dead_weakref", (PyCFunction)_weakref__remove_dead_weakref, METH_FASTCALL, _weakref__remove_dead_weakref__doc__},
|
||||
|
||||
static PyObject *
|
||||
_weakref__remove_dead_weakref_impl(PyObject *module, PyObject *dct,
|
||||
PyObject *key);
|
||||
|
||||
static PyObject *
|
||||
_weakref__remove_dead_weakref(PyObject *module, PyObject *args)
|
||||
_weakref__remove_dead_weakref(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *dct;
|
||||
PyObject *key;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O!O:_remove_dead_weakref",
|
||||
if (!_PyArg_ParseStack(args, nargs, "O!O:_remove_dead_weakref",
|
||||
&PyDict_Type, &dct, &key)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("_remove_dead_weakref", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _weakref__remove_dead_weakref_impl(module, dct, key);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=e860dd818a44bc9b input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=b686303486bdfefd input=a9049054013a1b77]*/
|
||||
|
|
|
@ -111,7 +111,7 @@ _winapi_ConnectNamedPipe(PyObject *module, PyObject **args, Py_ssize_t nargs, Py
|
|||
int64_t handle;
|
||||
int use_overlapped = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&handle, &use_overlapped)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -685,7 +685,7 @@ _winapi_ReadFile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *
|
|||
uint32_t size;
|
||||
int use_overlapped = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&handle, &size, &use_overlapped)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -879,7 +879,7 @@ _winapi_WriteFile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject
|
|||
PyObject *buffer;
|
||||
int use_overlapped = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&handle, &buffer, &use_overlapped)) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
|
@ -66,21 +66,25 @@ PyDoc_STRVAR(array_array_pop__doc__,
|
|||
"i defaults to -1.");
|
||||
|
||||
#define ARRAY_ARRAY_POP_METHODDEF \
|
||||
{"pop", (PyCFunction)array_array_pop, METH_VARARGS, array_array_pop__doc__},
|
||||
{"pop", (PyCFunction)array_array_pop, METH_FASTCALL, array_array_pop__doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array_pop_impl(arrayobject *self, Py_ssize_t i);
|
||||
|
||||
static PyObject *
|
||||
array_array_pop(arrayobject *self, PyObject *args)
|
||||
array_array_pop(arrayobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t i = -1;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|n:pop",
|
||||
if (!_PyArg_ParseStack(args, nargs, "|n:pop",
|
||||
&i)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("pop", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = array_array_pop_impl(self, i);
|
||||
|
||||
exit:
|
||||
|
@ -103,22 +107,26 @@ PyDoc_STRVAR(array_array_insert__doc__,
|
|||
"Insert a new item v into the array before position i.");
|
||||
|
||||
#define ARRAY_ARRAY_INSERT_METHODDEF \
|
||||
{"insert", (PyCFunction)array_array_insert, METH_VARARGS, array_array_insert__doc__},
|
||||
{"insert", (PyCFunction)array_array_insert, METH_FASTCALL, array_array_insert__doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array_insert_impl(arrayobject *self, Py_ssize_t i, PyObject *v);
|
||||
|
||||
static PyObject *
|
||||
array_array_insert(arrayobject *self, PyObject *args)
|
||||
array_array_insert(arrayobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t i;
|
||||
PyObject *v;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "nO:insert",
|
||||
if (!_PyArg_ParseStack(args, nargs, "nO:insert",
|
||||
&i, &v)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("insert", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = array_array_insert_impl(self, i, v);
|
||||
|
||||
exit:
|
||||
|
@ -201,22 +209,26 @@ PyDoc_STRVAR(array_array_fromfile__doc__,
|
|||
"Read n objects from the file object f and append them to the end of the array.");
|
||||
|
||||
#define ARRAY_ARRAY_FROMFILE_METHODDEF \
|
||||
{"fromfile", (PyCFunction)array_array_fromfile, METH_VARARGS, array_array_fromfile__doc__},
|
||||
{"fromfile", (PyCFunction)array_array_fromfile, METH_FASTCALL, array_array_fromfile__doc__},
|
||||
|
||||
static PyObject *
|
||||
array_array_fromfile_impl(arrayobject *self, PyObject *f, Py_ssize_t n);
|
||||
|
||||
static PyObject *
|
||||
array_array_fromfile(arrayobject *self, PyObject *args)
|
||||
array_array_fromfile(arrayobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *f;
|
||||
Py_ssize_t n;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "On:fromfile",
|
||||
if (!_PyArg_ParseStack(args, nargs, "On:fromfile",
|
||||
&f, &n)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("fromfile", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = array_array_fromfile_impl(self, f, n);
|
||||
|
||||
exit:
|
||||
|
@ -444,7 +456,7 @@ PyDoc_STRVAR(array__array_reconstructor__doc__,
|
|||
"Internal. Used for pickling support.");
|
||||
|
||||
#define ARRAY__ARRAY_RECONSTRUCTOR_METHODDEF \
|
||||
{"_array_reconstructor", (PyCFunction)array__array_reconstructor, METH_VARARGS, array__array_reconstructor__doc__},
|
||||
{"_array_reconstructor", (PyCFunction)array__array_reconstructor, METH_FASTCALL, array__array_reconstructor__doc__},
|
||||
|
||||
static PyObject *
|
||||
array__array_reconstructor_impl(PyObject *module, PyTypeObject *arraytype,
|
||||
|
@ -453,7 +465,7 @@ array__array_reconstructor_impl(PyObject *module, PyTypeObject *arraytype,
|
|||
PyObject *items);
|
||||
|
||||
static PyObject *
|
||||
array__array_reconstructor(PyObject *module, PyObject *args)
|
||||
array__array_reconstructor(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyTypeObject *arraytype;
|
||||
|
@ -461,10 +473,14 @@ array__array_reconstructor(PyObject *module, PyObject *args)
|
|||
enum machine_format_code mformat_code;
|
||||
PyObject *items;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "OCiO:_array_reconstructor",
|
||||
if (!_PyArg_ParseStack(args, nargs, "OCiO:_array_reconstructor",
|
||||
&arraytype, &typecode, &mformat_code, &items)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("_array_reconstructor", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = array__array_reconstructor_impl(module, arraytype, typecode, mformat_code, items);
|
||||
|
||||
exit:
|
||||
|
@ -506,4 +522,4 @@ PyDoc_STRVAR(array_arrayiterator___setstate____doc__,
|
|||
|
||||
#define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \
|
||||
{"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__},
|
||||
/*[clinic end generated code: output=b2054fb764c8cc64 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=d186a7553c1f1a41 input=a9049054013a1b77]*/
|
||||
|
|
267
third_party/python/Modules/clinic/audioop.inc
vendored
267
third_party/python/Modules/clinic/audioop.inc
vendored
|
@ -2,7 +2,6 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
|
||||
PyDoc_STRVAR(audioop_getsample__doc__,
|
||||
"getsample($module, fragment, width, index, /)\n"
|
||||
|
@ -11,24 +10,28 @@ PyDoc_STRVAR(audioop_getsample__doc__,
|
|||
"Return the value of sample index from the fragment.");
|
||||
|
||||
#define AUDIOOP_GETSAMPLE_METHODDEF \
|
||||
{"getsample", (PyCFunction)audioop_getsample, METH_VARARGS, audioop_getsample__doc__},
|
||||
{"getsample", (PyCFunction)audioop_getsample, METH_FASTCALL, audioop_getsample__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_getsample_impl(PyObject *module, Py_buffer *fragment, int width,
|
||||
Py_ssize_t index);
|
||||
|
||||
static PyObject *
|
||||
audioop_getsample(PyObject *module, PyObject *args)
|
||||
audioop_getsample(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
Py_ssize_t index;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*in:getsample",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*in:getsample",
|
||||
&fragment, &width, &index)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("getsample", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_getsample_impl(module, &fragment, width, index);
|
||||
|
||||
exit:
|
||||
|
@ -47,22 +50,26 @@ PyDoc_STRVAR(audioop_max__doc__,
|
|||
"Return the maximum of the absolute value of all samples in a fragment.");
|
||||
|
||||
#define AUDIOOP_MAX_METHODDEF \
|
||||
{"max", (PyCFunction)audioop_max, METH_VARARGS, audioop_max__doc__},
|
||||
{"max", (PyCFunction)audioop_max, METH_FASTCALL, audioop_max__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_max_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_max(PyObject *module, PyObject *args)
|
||||
audioop_max(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:max",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*i:max",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("max", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_max_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
|
@ -81,22 +88,26 @@ PyDoc_STRVAR(audioop_minmax__doc__,
|
|||
"Return the minimum and maximum values of all samples in the sound fragment.");
|
||||
|
||||
#define AUDIOOP_MINMAX_METHODDEF \
|
||||
{"minmax", (PyCFunction)audioop_minmax, METH_VARARGS, audioop_minmax__doc__},
|
||||
{"minmax", (PyCFunction)audioop_minmax, METH_FASTCALL, audioop_minmax__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_minmax_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_minmax(PyObject *module, PyObject *args)
|
||||
audioop_minmax(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:minmax",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*i:minmax",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("minmax", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_minmax_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
|
@ -115,22 +126,26 @@ PyDoc_STRVAR(audioop_avg__doc__,
|
|||
"Return the average over all samples in the fragment.");
|
||||
|
||||
#define AUDIOOP_AVG_METHODDEF \
|
||||
{"avg", (PyCFunction)audioop_avg, METH_VARARGS, audioop_avg__doc__},
|
||||
{"avg", (PyCFunction)audioop_avg, METH_FASTCALL, audioop_avg__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_avg_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_avg(PyObject *module, PyObject *args)
|
||||
audioop_avg(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:avg",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*i:avg",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("avg", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_avg_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
|
@ -149,22 +164,26 @@ PyDoc_STRVAR(audioop_rms__doc__,
|
|||
"Return the root-mean-square of the fragment, i.e. sqrt(sum(S_i^2)/n).");
|
||||
|
||||
#define AUDIOOP_RMS_METHODDEF \
|
||||
{"rms", (PyCFunction)audioop_rms, METH_VARARGS, audioop_rms__doc__},
|
||||
{"rms", (PyCFunction)audioop_rms, METH_FASTCALL, audioop_rms__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_rms_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_rms(PyObject *module, PyObject *args)
|
||||
audioop_rms(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:rms",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*i:rms",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("rms", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_rms_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
|
@ -183,23 +202,27 @@ PyDoc_STRVAR(audioop_findfit__doc__,
|
|||
"Try to match reference as well as possible to a portion of fragment.");
|
||||
|
||||
#define AUDIOOP_FINDFIT_METHODDEF \
|
||||
{"findfit", (PyCFunction)audioop_findfit, METH_VARARGS, audioop_findfit__doc__},
|
||||
{"findfit", (PyCFunction)audioop_findfit, METH_FASTCALL, audioop_findfit__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_findfit_impl(PyObject *module, Py_buffer *fragment,
|
||||
Py_buffer *reference);
|
||||
|
||||
static PyObject *
|
||||
audioop_findfit(PyObject *module, PyObject *args)
|
||||
audioop_findfit(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
Py_buffer reference = {NULL, NULL};
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*y*:findfit",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*y*:findfit",
|
||||
&fragment, &reference)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("findfit", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_findfit_impl(module, &fragment, &reference);
|
||||
|
||||
exit:
|
||||
|
@ -222,23 +245,27 @@ PyDoc_STRVAR(audioop_findfactor__doc__,
|
|||
"Return a factor F such that rms(add(fragment, mul(reference, -F))) is minimal.");
|
||||
|
||||
#define AUDIOOP_FINDFACTOR_METHODDEF \
|
||||
{"findfactor", (PyCFunction)audioop_findfactor, METH_VARARGS, audioop_findfactor__doc__},
|
||||
{"findfactor", (PyCFunction)audioop_findfactor, METH_FASTCALL, audioop_findfactor__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_findfactor_impl(PyObject *module, Py_buffer *fragment,
|
||||
Py_buffer *reference);
|
||||
|
||||
static PyObject *
|
||||
audioop_findfactor(PyObject *module, PyObject *args)
|
||||
audioop_findfactor(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
Py_buffer reference = {NULL, NULL};
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*y*:findfactor",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*y*:findfactor",
|
||||
&fragment, &reference)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("findfactor", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_findfactor_impl(module, &fragment, &reference);
|
||||
|
||||
exit:
|
||||
|
@ -261,23 +288,27 @@ PyDoc_STRVAR(audioop_findmax__doc__,
|
|||
"Search fragment for a slice of specified number of samples with maximum energy.");
|
||||
|
||||
#define AUDIOOP_FINDMAX_METHODDEF \
|
||||
{"findmax", (PyCFunction)audioop_findmax, METH_VARARGS, audioop_findmax__doc__},
|
||||
{"findmax", (PyCFunction)audioop_findmax, METH_FASTCALL, audioop_findmax__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_findmax_impl(PyObject *module, Py_buffer *fragment,
|
||||
Py_ssize_t length);
|
||||
|
||||
static PyObject *
|
||||
audioop_findmax(PyObject *module, PyObject *args)
|
||||
audioop_findmax(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
Py_ssize_t length;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*n:findmax",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*n:findmax",
|
||||
&fragment, &length)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("findmax", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_findmax_impl(module, &fragment, length);
|
||||
|
||||
exit:
|
||||
|
@ -296,22 +327,26 @@ PyDoc_STRVAR(audioop_avgpp__doc__,
|
|||
"Return the average peak-peak value over all samples in the fragment.");
|
||||
|
||||
#define AUDIOOP_AVGPP_METHODDEF \
|
||||
{"avgpp", (PyCFunction)audioop_avgpp, METH_VARARGS, audioop_avgpp__doc__},
|
||||
{"avgpp", (PyCFunction)audioop_avgpp, METH_FASTCALL, audioop_avgpp__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_avgpp_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_avgpp(PyObject *module, PyObject *args)
|
||||
audioop_avgpp(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:avgpp",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*i:avgpp",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("avgpp", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_avgpp_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
|
@ -330,22 +365,26 @@ PyDoc_STRVAR(audioop_maxpp__doc__,
|
|||
"Return the maximum peak-peak value in the sound fragment.");
|
||||
|
||||
#define AUDIOOP_MAXPP_METHODDEF \
|
||||
{"maxpp", (PyCFunction)audioop_maxpp, METH_VARARGS, audioop_maxpp__doc__},
|
||||
{"maxpp", (PyCFunction)audioop_maxpp, METH_FASTCALL, audioop_maxpp__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_maxpp_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_maxpp(PyObject *module, PyObject *args)
|
||||
audioop_maxpp(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:maxpp",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*i:maxpp",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("maxpp", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_maxpp_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
|
@ -364,22 +403,26 @@ PyDoc_STRVAR(audioop_cross__doc__,
|
|||
"Return the number of zero crossings in the fragment passed as an argument.");
|
||||
|
||||
#define AUDIOOP_CROSS_METHODDEF \
|
||||
{"cross", (PyCFunction)audioop_cross, METH_VARARGS, audioop_cross__doc__},
|
||||
{"cross", (PyCFunction)audioop_cross, METH_FASTCALL, audioop_cross__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_cross_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_cross(PyObject *module, PyObject *args)
|
||||
audioop_cross(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:cross",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*i:cross",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("cross", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_cross_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
|
@ -398,24 +441,28 @@ PyDoc_STRVAR(audioop_mul__doc__,
|
|||
"Return a fragment that has all samples in the original fragment multiplied by the floating-point value factor.");
|
||||
|
||||
#define AUDIOOP_MUL_METHODDEF \
|
||||
{"mul", (PyCFunction)audioop_mul, METH_VARARGS, audioop_mul__doc__},
|
||||
{"mul", (PyCFunction)audioop_mul, METH_FASTCALL, audioop_mul__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_mul_impl(PyObject *module, Py_buffer *fragment, int width,
|
||||
double factor);
|
||||
|
||||
static PyObject *
|
||||
audioop_mul(PyObject *module, PyObject *args)
|
||||
audioop_mul(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
double factor;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*id:mul",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*id:mul",
|
||||
&fragment, &width, &factor)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("mul", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_mul_impl(module, &fragment, width, factor);
|
||||
|
||||
exit:
|
||||
|
@ -434,14 +481,14 @@ PyDoc_STRVAR(audioop_tomono__doc__,
|
|||
"Convert a stereo fragment to a mono fragment.");
|
||||
|
||||
#define AUDIOOP_TOMONO_METHODDEF \
|
||||
{"tomono", (PyCFunction)audioop_tomono, METH_VARARGS, audioop_tomono__doc__},
|
||||
{"tomono", (PyCFunction)audioop_tomono, METH_FASTCALL, audioop_tomono__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_tomono_impl(PyObject *module, Py_buffer *fragment, int width,
|
||||
double lfactor, double rfactor);
|
||||
|
||||
static PyObject *
|
||||
audioop_tomono(PyObject *module, PyObject *args)
|
||||
audioop_tomono(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
|
@ -449,10 +496,14 @@ audioop_tomono(PyObject *module, PyObject *args)
|
|||
double lfactor;
|
||||
double rfactor;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*idd:tomono",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*idd:tomono",
|
||||
&fragment, &width, &lfactor, &rfactor)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("tomono", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_tomono_impl(module, &fragment, width, lfactor, rfactor);
|
||||
|
||||
exit:
|
||||
|
@ -471,14 +522,14 @@ PyDoc_STRVAR(audioop_tostereo__doc__,
|
|||
"Generate a stereo fragment from a mono fragment.");
|
||||
|
||||
#define AUDIOOP_TOSTEREO_METHODDEF \
|
||||
{"tostereo", (PyCFunction)audioop_tostereo, METH_VARARGS, audioop_tostereo__doc__},
|
||||
{"tostereo", (PyCFunction)audioop_tostereo, METH_FASTCALL, audioop_tostereo__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_tostereo_impl(PyObject *module, Py_buffer *fragment, int width,
|
||||
double lfactor, double rfactor);
|
||||
|
||||
static PyObject *
|
||||
audioop_tostereo(PyObject *module, PyObject *args)
|
||||
audioop_tostereo(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
|
@ -486,10 +537,14 @@ audioop_tostereo(PyObject *module, PyObject *args)
|
|||
double lfactor;
|
||||
double rfactor;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*idd:tostereo",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*idd:tostereo",
|
||||
&fragment, &width, &lfactor, &rfactor)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("tostereo", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_tostereo_impl(module, &fragment, width, lfactor, rfactor);
|
||||
|
||||
exit:
|
||||
|
@ -508,24 +563,28 @@ PyDoc_STRVAR(audioop_add__doc__,
|
|||
"Return a fragment which is the addition of the two samples passed as parameters.");
|
||||
|
||||
#define AUDIOOP_ADD_METHODDEF \
|
||||
{"add", (PyCFunction)audioop_add, METH_VARARGS, audioop_add__doc__},
|
||||
{"add", (PyCFunction)audioop_add, METH_FASTCALL, audioop_add__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_add_impl(PyObject *module, Py_buffer *fragment1,
|
||||
Py_buffer *fragment2, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_add(PyObject *module, PyObject *args)
|
||||
audioop_add(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment1 = {NULL, NULL};
|
||||
Py_buffer fragment2 = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*y*i:add",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*y*i:add",
|
||||
&fragment1, &fragment2, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("add", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_add_impl(module, &fragment1, &fragment2, width);
|
||||
|
||||
exit:
|
||||
|
@ -548,23 +607,27 @@ PyDoc_STRVAR(audioop_bias__doc__,
|
|||
"Return a fragment that is the original fragment with a bias added to each sample.");
|
||||
|
||||
#define AUDIOOP_BIAS_METHODDEF \
|
||||
{"bias", (PyCFunction)audioop_bias, METH_VARARGS, audioop_bias__doc__},
|
||||
{"bias", (PyCFunction)audioop_bias, METH_FASTCALL, audioop_bias__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_bias_impl(PyObject *module, Py_buffer *fragment, int width, int bias);
|
||||
|
||||
static PyObject *
|
||||
audioop_bias(PyObject *module, PyObject *args)
|
||||
audioop_bias(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
int bias;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*ii:bias",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*ii:bias",
|
||||
&fragment, &width, &bias)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("bias", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_bias_impl(module, &fragment, width, bias);
|
||||
|
||||
exit:
|
||||
|
@ -583,22 +646,26 @@ PyDoc_STRVAR(audioop_reverse__doc__,
|
|||
"Reverse the samples in a fragment and returns the modified fragment.");
|
||||
|
||||
#define AUDIOOP_REVERSE_METHODDEF \
|
||||
{"reverse", (PyCFunction)audioop_reverse, METH_VARARGS, audioop_reverse__doc__},
|
||||
{"reverse", (PyCFunction)audioop_reverse, METH_FASTCALL, audioop_reverse__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_reverse_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_reverse(PyObject *module, PyObject *args)
|
||||
audioop_reverse(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:reverse",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*i:reverse",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("reverse", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_reverse_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
|
@ -617,22 +684,26 @@ PyDoc_STRVAR(audioop_byteswap__doc__,
|
|||
"Convert big-endian samples to little-endian and vice versa.");
|
||||
|
||||
#define AUDIOOP_BYTESWAP_METHODDEF \
|
||||
{"byteswap", (PyCFunction)audioop_byteswap, METH_VARARGS, audioop_byteswap__doc__},
|
||||
{"byteswap", (PyCFunction)audioop_byteswap, METH_FASTCALL, audioop_byteswap__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_byteswap_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_byteswap(PyObject *module, PyObject *args)
|
||||
audioop_byteswap(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:byteswap",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*i:byteswap",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("byteswap", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_byteswap_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
|
@ -651,24 +722,28 @@ PyDoc_STRVAR(audioop_lin2lin__doc__,
|
|||
"Convert samples between 1-, 2-, 3- and 4-byte formats.");
|
||||
|
||||
#define AUDIOOP_LIN2LIN_METHODDEF \
|
||||
{"lin2lin", (PyCFunction)audioop_lin2lin, METH_VARARGS, audioop_lin2lin__doc__},
|
||||
{"lin2lin", (PyCFunction)audioop_lin2lin, METH_FASTCALL, audioop_lin2lin__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_lin2lin_impl(PyObject *module, Py_buffer *fragment, int width,
|
||||
int newwidth);
|
||||
|
||||
static PyObject *
|
||||
audioop_lin2lin(PyObject *module, PyObject *args)
|
||||
audioop_lin2lin(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
int newwidth;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*ii:lin2lin",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*ii:lin2lin",
|
||||
&fragment, &width, &newwidth)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("lin2lin", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_lin2lin_impl(module, &fragment, width, newwidth);
|
||||
|
||||
exit:
|
||||
|
@ -688,7 +763,7 @@ PyDoc_STRVAR(audioop_ratecv__doc__,
|
|||
"Convert the frame rate of the input fragment.");
|
||||
|
||||
#define AUDIOOP_RATECV_METHODDEF \
|
||||
{"ratecv", (PyCFunction)audioop_ratecv, METH_VARARGS, audioop_ratecv__doc__},
|
||||
{"ratecv", (PyCFunction)audioop_ratecv, METH_FASTCALL, audioop_ratecv__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_ratecv_impl(PyObject *module, Py_buffer *fragment, int width,
|
||||
|
@ -696,7 +771,7 @@ audioop_ratecv_impl(PyObject *module, Py_buffer *fragment, int width,
|
|||
int weightA, int weightB);
|
||||
|
||||
static PyObject *
|
||||
audioop_ratecv(PyObject *module, PyObject *args)
|
||||
audioop_ratecv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
|
@ -708,10 +783,14 @@ audioop_ratecv(PyObject *module, PyObject *args)
|
|||
int weightA = 1;
|
||||
int weightB = 0;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*iiiiO|ii:ratecv",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*iiiiO|ii:ratecv",
|
||||
&fragment, &width, &nchannels, &inrate, &outrate, &state, &weightA, &weightB)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("ratecv", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_ratecv_impl(module, &fragment, width, nchannels, inrate, outrate, state, weightA, weightB);
|
||||
|
||||
exit:
|
||||
|
@ -730,22 +809,26 @@ PyDoc_STRVAR(audioop_lin2ulaw__doc__,
|
|||
"Convert samples in the audio fragment to u-LAW encoding.");
|
||||
|
||||
#define AUDIOOP_LIN2ULAW_METHODDEF \
|
||||
{"lin2ulaw", (PyCFunction)audioop_lin2ulaw, METH_VARARGS, audioop_lin2ulaw__doc__},
|
||||
{"lin2ulaw", (PyCFunction)audioop_lin2ulaw, METH_FASTCALL, audioop_lin2ulaw__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_lin2ulaw_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_lin2ulaw(PyObject *module, PyObject *args)
|
||||
audioop_lin2ulaw(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:lin2ulaw",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*i:lin2ulaw",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("lin2ulaw", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_lin2ulaw_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
|
@ -764,22 +847,26 @@ PyDoc_STRVAR(audioop_ulaw2lin__doc__,
|
|||
"Convert sound fragments in u-LAW encoding to linearly encoded sound fragments.");
|
||||
|
||||
#define AUDIOOP_ULAW2LIN_METHODDEF \
|
||||
{"ulaw2lin", (PyCFunction)audioop_ulaw2lin, METH_VARARGS, audioop_ulaw2lin__doc__},
|
||||
{"ulaw2lin", (PyCFunction)audioop_ulaw2lin, METH_FASTCALL, audioop_ulaw2lin__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_ulaw2lin_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_ulaw2lin(PyObject *module, PyObject *args)
|
||||
audioop_ulaw2lin(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:ulaw2lin",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*i:ulaw2lin",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("ulaw2lin", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_ulaw2lin_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
|
@ -798,22 +885,26 @@ PyDoc_STRVAR(audioop_lin2alaw__doc__,
|
|||
"Convert samples in the audio fragment to a-LAW encoding.");
|
||||
|
||||
#define AUDIOOP_LIN2ALAW_METHODDEF \
|
||||
{"lin2alaw", (PyCFunction)audioop_lin2alaw, METH_VARARGS, audioop_lin2alaw__doc__},
|
||||
{"lin2alaw", (PyCFunction)audioop_lin2alaw, METH_FASTCALL, audioop_lin2alaw__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_lin2alaw_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_lin2alaw(PyObject *module, PyObject *args)
|
||||
audioop_lin2alaw(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*i:lin2alaw",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*i:lin2alaw",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("lin2alaw", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_lin2alaw_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
|
@ -832,26 +923,34 @@ PyDoc_STRVAR(audioop_alaw2lin__doc__,
|
|||
"Convert sound fragments in a-LAW encoding to linearly encoded sound fragments.");
|
||||
|
||||
#define AUDIOOP_ALAW2LIN_METHODDEF \
|
||||
{"alaw2lin", (PyCFunction)audioop_alaw2lin, METH_VARARGS, audioop_alaw2lin__doc__},
|
||||
{"alaw2lin", (PyCFunction)audioop_alaw2lin, METH_FASTCALL, audioop_alaw2lin__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_alaw2lin_impl(PyObject *module, Py_buffer *fragment, int width);
|
||||
|
||||
static PyObject *
|
||||
audioop_alaw2lin(PyObject *module, PyObject *args)
|
||||
audioop_alaw2lin(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
if (!PyArg_ParseTuple(args, "y*i:alaw2lin", &fragment, &width)) {
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*i:alaw2lin",
|
||||
&fragment, &width)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("alaw2lin", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_alaw2lin_impl(module, &fragment, width);
|
||||
|
||||
exit:
|
||||
/* Cleanup for fragment */
|
||||
if (fragment.obj) {
|
||||
PyBuffer_Release(&fragment);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
|
@ -862,24 +961,28 @@ PyDoc_STRVAR(audioop_lin2adpcm__doc__,
|
|||
"Convert samples to 4 bit Intel/DVI ADPCM encoding.");
|
||||
|
||||
#define AUDIOOP_LIN2ADPCM_METHODDEF \
|
||||
{"lin2adpcm", (PyCFunction)audioop_lin2adpcm, METH_VARARGS, audioop_lin2adpcm__doc__},
|
||||
{"lin2adpcm", (PyCFunction)audioop_lin2adpcm, METH_FASTCALL, audioop_lin2adpcm__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_lin2adpcm_impl(PyObject *module, Py_buffer *fragment, int width,
|
||||
PyObject *state);
|
||||
|
||||
static PyObject *
|
||||
audioop_lin2adpcm(PyObject *module, PyObject *args)
|
||||
audioop_lin2adpcm(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
PyObject *state;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*iO:lin2adpcm",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*iO:lin2adpcm",
|
||||
&fragment, &width, &state)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("lin2adpcm", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_lin2adpcm_impl(module, &fragment, width, state);
|
||||
|
||||
exit:
|
||||
|
@ -898,24 +1001,28 @@ PyDoc_STRVAR(audioop_adpcm2lin__doc__,
|
|||
"Decode an Intel/DVI ADPCM coded fragment to a linear fragment.");
|
||||
|
||||
#define AUDIOOP_ADPCM2LIN_METHODDEF \
|
||||
{"adpcm2lin", (PyCFunction)audioop_adpcm2lin, METH_VARARGS, audioop_adpcm2lin__doc__},
|
||||
{"adpcm2lin", (PyCFunction)audioop_adpcm2lin, METH_FASTCALL, audioop_adpcm2lin__doc__},
|
||||
|
||||
static PyObject *
|
||||
audioop_adpcm2lin_impl(PyObject *module, Py_buffer *fragment, int width,
|
||||
PyObject *state);
|
||||
|
||||
static PyObject *
|
||||
audioop_adpcm2lin(PyObject *module, PyObject *args)
|
||||
audioop_adpcm2lin(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer fragment = {NULL, NULL};
|
||||
int width;
|
||||
PyObject *state;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*iO:adpcm2lin",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*iO:adpcm2lin",
|
||||
&fragment, &width, &state)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("adpcm2lin", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = audioop_adpcm2lin_impl(module, &fragment, width, state);
|
||||
|
||||
exit:
|
||||
|
@ -926,4 +1033,4 @@ exit:
|
|||
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=e0ab74c3fa57c39c input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=ee7c63ec28a11b78 input=a9049054013a1b77]*/
|
||||
|
|
28
third_party/python/Modules/clinic/binascii.inc
vendored
28
third_party/python/Modules/clinic/binascii.inc
vendored
|
@ -118,7 +118,7 @@ binascii_b2a_base64(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObjec
|
|||
Py_buffer data = {NULL, NULL};
|
||||
int newline = 1;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&data, &newline)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -267,23 +267,27 @@ PyDoc_STRVAR(binascii_crc_hqx__doc__,
|
|||
"Compute CRC-CCITT incrementally.");
|
||||
|
||||
#define BINASCII_CRC_HQX_METHODDEF \
|
||||
{"crc_hqx", (PyCFunction)binascii_crc_hqx, METH_VARARGS, binascii_crc_hqx__doc__},
|
||||
{"crc_hqx", (PyCFunction)binascii_crc_hqx, METH_FASTCALL, binascii_crc_hqx__doc__},
|
||||
|
||||
static unsigned int
|
||||
binascii_crc_hqx_impl(PyObject *module, Py_buffer *data, unsigned int crc);
|
||||
|
||||
static PyObject *
|
||||
binascii_crc_hqx(PyObject *module, PyObject *args)
|
||||
binascii_crc_hqx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
unsigned int crc;
|
||||
unsigned int _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*I:crc_hqx",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*I:crc_hqx",
|
||||
&data, &crc)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("crc_hqx", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = binascii_crc_hqx_impl(module, &data, crc);
|
||||
if ((_return_value == (unsigned int)-1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
|
@ -306,23 +310,27 @@ PyDoc_STRVAR(binascii_crc32__doc__,
|
|||
"Compute CRC-32 incrementally.");
|
||||
|
||||
#define BINASCII_CRC32_METHODDEF \
|
||||
{"crc32", (PyCFunction)binascii_crc32, METH_VARARGS, binascii_crc32__doc__},
|
||||
{"crc32", (PyCFunction)binascii_crc32, METH_FASTCALL, binascii_crc32__doc__},
|
||||
|
||||
static unsigned int
|
||||
binascii_crc32_impl(PyObject *module, Py_buffer *data, unsigned int crc);
|
||||
|
||||
static PyObject *
|
||||
binascii_crc32(PyObject *module, PyObject *args)
|
||||
binascii_crc32(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
unsigned int crc = 0;
|
||||
unsigned int _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*|I:crc32",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*|I:crc32",
|
||||
&data, &crc)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("crc32", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = binascii_crc32_impl(module, &data, crc);
|
||||
if ((_return_value == (unsigned int)-1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
|
@ -495,7 +503,7 @@ binascii_a2b_qp(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *k
|
|||
Py_buffer data = {NULL, NULL};
|
||||
int header = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
ascii_buffer_converter, &data, &header)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -537,7 +545,7 @@ binascii_b2a_qp(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *k
|
|||
int istext = 1;
|
||||
int header = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&data, "etabs, &istext, &header)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -551,4 +559,4 @@ exit:
|
|||
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=458eb09731cb7877 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=4a418f883ccc79fe input=a9049054013a1b77]*/
|
||||
|
|
|
@ -642,22 +642,26 @@ PyDoc_STRVAR(cmath_log__doc__,
|
|||
"If the base not specified, returns the natural logarithm (base e) of z.");
|
||||
|
||||
#define CMATH_LOG_METHODDEF \
|
||||
{"log", (PyCFunction)cmath_log, METH_VARARGS, cmath_log__doc__},
|
||||
{"log", (PyCFunction)cmath_log, METH_FASTCALL, cmath_log__doc__},
|
||||
|
||||
static PyObject *
|
||||
cmath_log_impl(PyObject *module, Py_complex x, PyObject *y_obj);
|
||||
|
||||
static PyObject *
|
||||
cmath_log(PyObject *module, PyObject *args)
|
||||
cmath_log(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_complex x;
|
||||
PyObject *y_obj = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "D|O:log",
|
||||
if (!_PyArg_ParseStack(args, nargs, "D|O:log",
|
||||
&x, &y_obj)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("log", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = cmath_log_impl(module, x, y_obj);
|
||||
|
||||
exit:
|
||||
|
@ -727,22 +731,26 @@ PyDoc_STRVAR(cmath_rect__doc__,
|
|||
"Convert from polar coordinates to rectangular coordinates.");
|
||||
|
||||
#define CMATH_RECT_METHODDEF \
|
||||
{"rect", (PyCFunction)cmath_rect, METH_VARARGS, cmath_rect__doc__},
|
||||
{"rect", (PyCFunction)cmath_rect, METH_FASTCALL, cmath_rect__doc__},
|
||||
|
||||
static PyObject *
|
||||
cmath_rect_impl(PyObject *module, double r, double phi);
|
||||
|
||||
static PyObject *
|
||||
cmath_rect(PyObject *module, PyObject *args)
|
||||
cmath_rect(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
double r;
|
||||
double phi;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "dd:rect",
|
||||
if (!_PyArg_ParseStack(args, nargs, "dd:rect",
|
||||
&r, &phi)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("rect", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = cmath_rect_impl(module, r, phi);
|
||||
|
||||
exit:
|
||||
|
@ -870,7 +878,7 @@ cmath_isclose(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
|
|||
double abs_tol = 0.0;
|
||||
int _return_value;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&a, &b, &rel_tol, &abs_tol)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -883,4 +891,4 @@ cmath_isclose(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=978f59702b41655f input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=93eff5d4c242ee57 input=a9049054013a1b77]*/
|
||||
|
|
|
@ -20,23 +20,27 @@ PyDoc_STRVAR(fcntl_fcntl__doc__,
|
|||
"corresponding to the return value of the fcntl call in the C code.");
|
||||
|
||||
#define FCNTL_FCNTL_METHODDEF \
|
||||
{"fcntl", (PyCFunction)fcntl_fcntl, METH_VARARGS, fcntl_fcntl__doc__},
|
||||
{"fcntl", (PyCFunction)fcntl_fcntl, METH_FASTCALL, fcntl_fcntl__doc__},
|
||||
|
||||
static PyObject *
|
||||
fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg);
|
||||
|
||||
static PyObject *
|
||||
fcntl_fcntl(PyObject *module, PyObject *args)
|
||||
fcntl_fcntl(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int fd;
|
||||
int code;
|
||||
PyObject *arg = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O&i|O:fcntl",
|
||||
if (!_PyArg_ParseStack(args, nargs, "O&i|O:fcntl",
|
||||
conv_descriptor, &fd, &code, &arg)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("fcntl", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = fcntl_fcntl_impl(module, fd, code, arg);
|
||||
|
||||
exit:
|
||||
|
@ -77,14 +81,14 @@ PyDoc_STRVAR(fcntl_ioctl__doc__,
|
|||
"code.");
|
||||
|
||||
#define FCNTL_IOCTL_METHODDEF \
|
||||
{"ioctl", (PyCFunction)fcntl_ioctl, METH_VARARGS, fcntl_ioctl__doc__},
|
||||
{"ioctl", (PyCFunction)fcntl_ioctl, METH_FASTCALL, fcntl_ioctl__doc__},
|
||||
|
||||
static PyObject *
|
||||
fcntl_ioctl_impl(PyObject *module, int fd, unsigned int code,
|
||||
PyObject *ob_arg, int mutate_arg);
|
||||
|
||||
static PyObject *
|
||||
fcntl_ioctl(PyObject *module, PyObject *args)
|
||||
fcntl_ioctl(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int fd;
|
||||
|
@ -92,10 +96,14 @@ fcntl_ioctl(PyObject *module, PyObject *args)
|
|||
PyObject *ob_arg = NULL;
|
||||
int mutate_arg = 1;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O&I|Op:ioctl",
|
||||
if (!_PyArg_ParseStack(args, nargs, "O&I|Op:ioctl",
|
||||
conv_descriptor, &fd, &code, &ob_arg, &mutate_arg)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("ioctl", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = fcntl_ioctl_impl(module, fd, code, ob_arg, mutate_arg);
|
||||
|
||||
exit:
|
||||
|
@ -112,22 +120,26 @@ PyDoc_STRVAR(fcntl_flock__doc__,
|
|||
"function is emulated using fcntl()).");
|
||||
|
||||
#define FCNTL_FLOCK_METHODDEF \
|
||||
{"flock", (PyCFunction)fcntl_flock, METH_VARARGS, fcntl_flock__doc__},
|
||||
{"flock", (PyCFunction)fcntl_flock, METH_FASTCALL, fcntl_flock__doc__},
|
||||
|
||||
static PyObject *
|
||||
fcntl_flock_impl(PyObject *module, int fd, int code);
|
||||
|
||||
static PyObject *
|
||||
fcntl_flock(PyObject *module, PyObject *args)
|
||||
fcntl_flock(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int fd;
|
||||
int code;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O&i:flock",
|
||||
if (!_PyArg_ParseStack(args, nargs, "O&i:flock",
|
||||
conv_descriptor, &fd, &code)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("flock", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = fcntl_flock_impl(module, fd, code);
|
||||
|
||||
exit:
|
||||
|
@ -162,14 +174,14 @@ PyDoc_STRVAR(fcntl_lockf__doc__,
|
|||
" 2 - relative to the end of the file (SEEK_END)");
|
||||
|
||||
#define FCNTL_LOCKF_METHODDEF \
|
||||
{"lockf", (PyCFunction)fcntl_lockf, METH_VARARGS, fcntl_lockf__doc__},
|
||||
{"lockf", (PyCFunction)fcntl_lockf, METH_FASTCALL, fcntl_lockf__doc__},
|
||||
|
||||
static PyObject *
|
||||
fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj,
|
||||
PyObject *startobj, int whence);
|
||||
|
||||
static PyObject *
|
||||
fcntl_lockf(PyObject *module, PyObject *args)
|
||||
fcntl_lockf(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int fd;
|
||||
|
@ -178,13 +190,17 @@ fcntl_lockf(PyObject *module, PyObject *args)
|
|||
PyObject *startobj = NULL;
|
||||
int whence = 0;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O&i|OOi:lockf",
|
||||
if (!_PyArg_ParseStack(args, nargs, "O&i|OOi:lockf",
|
||||
conv_descriptor, &fd, &code, &lenobj, &startobj, &whence)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("lockf", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = fcntl_lockf_impl(module, fd, code, lenobj, startobj, whence);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=36cff76a8fb2c9a6 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=b67e9579722e6d4f input=a9049054013a1b77]*/
|
||||
|
|
|
@ -25,7 +25,7 @@ grp_getgrgid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
|
|||
static _PyArg_Parser _parser = {"O:getgrgid", _keywords, 0};
|
||||
PyObject *id;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&id)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ grp_getgrnam(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
|
|||
static _PyArg_Parser _parser = {"U:getgrnam", _keywords, 0};
|
||||
PyObject *name;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&name)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -87,4 +87,4 @@ grp_getgrall(PyObject *module, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return grp_getgrall_impl(module);
|
||||
}
|
||||
/*[clinic end generated code: output=d6417ae0a7298e0e input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=fb690db5e676d378 input=a9049054013a1b77]*/
|
||||
|
|
575
third_party/python/Modules/clinic/posixmodule.inc
vendored
575
third_party/python/Modules/clinic/posixmodule.inc
vendored
File diff suppressed because it is too large
Load diff
34
third_party/python/Modules/clinic/pyexpat.inc
vendored
34
third_party/python/Modules/clinic/pyexpat.inc
vendored
|
@ -12,23 +12,27 @@ PyDoc_STRVAR(pyexpat_xmlparser_Parse__doc__,
|
|||
"`isfinal\' should be true at end of input.");
|
||||
|
||||
#define PYEXPAT_XMLPARSER_PARSE_METHODDEF \
|
||||
{"Parse", (PyCFunction)pyexpat_xmlparser_Parse, METH_VARARGS, pyexpat_xmlparser_Parse__doc__},
|
||||
{"Parse", (PyCFunction)pyexpat_xmlparser_Parse, METH_FASTCALL, pyexpat_xmlparser_Parse__doc__},
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_Parse_impl(xmlparseobject *self, PyObject *data,
|
||||
int isfinal);
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_Parse(xmlparseobject *self, PyObject *args)
|
||||
pyexpat_xmlparser_Parse(xmlparseobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *data;
|
||||
int isfinal = 0;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O|i:Parse",
|
||||
if (!_PyArg_ParseStack(args, nargs, "O|i:Parse",
|
||||
&data, &isfinal)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("Parse", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = pyexpat_xmlparser_Parse_impl(self, data, isfinal);
|
||||
|
||||
exit:
|
||||
|
@ -117,7 +121,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_ExternalEntityParserCreate__doc__,
|
|||
"Create a parser for parsing an external entity based on the information passed to the ExternalEntityRefHandler.");
|
||||
|
||||
#define PYEXPAT_XMLPARSER_EXTERNALENTITYPARSERCREATE_METHODDEF \
|
||||
{"ExternalEntityParserCreate", (PyCFunction)pyexpat_xmlparser_ExternalEntityParserCreate, METH_VARARGS, pyexpat_xmlparser_ExternalEntityParserCreate__doc__},
|
||||
{"ExternalEntityParserCreate", (PyCFunction)pyexpat_xmlparser_ExternalEntityParserCreate, METH_FASTCALL, pyexpat_xmlparser_ExternalEntityParserCreate__doc__},
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_ExternalEntityParserCreate_impl(xmlparseobject *self,
|
||||
|
@ -125,16 +129,20 @@ pyexpat_xmlparser_ExternalEntityParserCreate_impl(xmlparseobject *self,
|
|||
const char *encoding);
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
|
||||
pyexpat_xmlparser_ExternalEntityParserCreate(xmlparseobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *context;
|
||||
const char *encoding = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "z|s:ExternalEntityParserCreate",
|
||||
if (!_PyArg_ParseStack(args, nargs, "z|s:ExternalEntityParserCreate",
|
||||
&context, &encoding)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("ExternalEntityParserCreate", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = pyexpat_xmlparser_ExternalEntityParserCreate_impl(self, context, encoding);
|
||||
|
||||
exit:
|
||||
|
@ -186,21 +194,25 @@ PyDoc_STRVAR(pyexpat_xmlparser_UseForeignDTD__doc__,
|
|||
"information to the parser. \'flag\' defaults to True if not provided.");
|
||||
|
||||
#define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF \
|
||||
{"UseForeignDTD", (PyCFunction)pyexpat_xmlparser_UseForeignDTD, METH_VARARGS, pyexpat_xmlparser_UseForeignDTD__doc__},
|
||||
{"UseForeignDTD", (PyCFunction)pyexpat_xmlparser_UseForeignDTD, METH_FASTCALL, pyexpat_xmlparser_UseForeignDTD__doc__},
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_UseForeignDTD_impl(xmlparseobject *self, int flag);
|
||||
|
||||
static PyObject *
|
||||
pyexpat_xmlparser_UseForeignDTD(xmlparseobject *self, PyObject *args)
|
||||
pyexpat_xmlparser_UseForeignDTD(xmlparseobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int flag = 1;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|p:UseForeignDTD",
|
||||
if (!_PyArg_ParseStack(args, nargs, "|p:UseForeignDTD",
|
||||
&flag)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("UseForeignDTD", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = pyexpat_xmlparser_UseForeignDTD_impl(self, flag);
|
||||
|
||||
exit:
|
||||
|
@ -250,7 +262,7 @@ pyexpat_ParserCreate(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObje
|
|||
const char *namespace_separator = NULL;
|
||||
PyObject *intern = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&encoding, &namespace_separator, &intern)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -290,4 +302,4 @@ exit:
|
|||
#ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
|
||||
#define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
|
||||
#endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */
|
||||
/*[clinic end generated code: output=e889f7c6af6cc42f input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=0548a6b12157e29b input=a9049054013a1b77]*/
|
||||
|
|
|
@ -75,22 +75,26 @@ PyDoc_STRVAR(signal_signal__doc__,
|
|||
"the first is the signal number, the second is the interrupted stack frame.");
|
||||
|
||||
#define SIGNAL_SIGNAL_METHODDEF \
|
||||
{"signal", (PyCFunction)signal_signal, METH_VARARGS, signal_signal__doc__},
|
||||
{"signal", (PyCFunction)signal_signal, METH_FASTCALL, signal_signal__doc__},
|
||||
|
||||
static PyObject *
|
||||
signal_signal_impl(PyObject *module, int signalnum, PyObject *handler);
|
||||
|
||||
static PyObject *
|
||||
signal_signal(PyObject *module, PyObject *args)
|
||||
signal_signal(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int signalnum;
|
||||
PyObject *handler;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "iO:signal",
|
||||
if (!_PyArg_ParseStack(args, nargs, "iO:signal",
|
||||
&signalnum, &handler)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("signal", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = signal_signal_impl(module, signalnum, handler);
|
||||
|
||||
exit:
|
||||
|
@ -142,22 +146,26 @@ PyDoc_STRVAR(signal_siginterrupt__doc__,
|
|||
"signal sig, else system calls will be interrupted.");
|
||||
|
||||
#define SIGNAL_SIGINTERRUPT_METHODDEF \
|
||||
{"siginterrupt", (PyCFunction)signal_siginterrupt, METH_VARARGS, signal_siginterrupt__doc__},
|
||||
{"siginterrupt", (PyCFunction)signal_siginterrupt, METH_FASTCALL, signal_siginterrupt__doc__},
|
||||
|
||||
static PyObject *
|
||||
signal_siginterrupt_impl(PyObject *module, int signalnum, int flag);
|
||||
|
||||
static PyObject *
|
||||
signal_siginterrupt(PyObject *module, PyObject *args)
|
||||
signal_siginterrupt(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int signalnum;
|
||||
int flag;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "ii:siginterrupt",
|
||||
if (!_PyArg_ParseStack(args, nargs, "ii:siginterrupt",
|
||||
&signalnum, &flag)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("siginterrupt", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = signal_siginterrupt_impl(module, signalnum, flag);
|
||||
|
||||
exit:
|
||||
|
@ -180,24 +188,28 @@ PyDoc_STRVAR(signal_setitimer__doc__,
|
|||
"Returns old values as a tuple: (delay, interval).");
|
||||
|
||||
#define SIGNAL_SETITIMER_METHODDEF \
|
||||
{"setitimer", (PyCFunction)signal_setitimer, METH_VARARGS, signal_setitimer__doc__},
|
||||
{"setitimer", (PyCFunction)signal_setitimer, METH_FASTCALL, signal_setitimer__doc__},
|
||||
|
||||
static PyObject *
|
||||
signal_setitimer_impl(PyObject *module, int which, double seconds,
|
||||
double interval);
|
||||
|
||||
static PyObject *
|
||||
signal_setitimer(PyObject *module, PyObject *args)
|
||||
signal_setitimer(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int which;
|
||||
double seconds;
|
||||
double interval = 0.0;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "id|d:setitimer",
|
||||
if (!_PyArg_ParseStack(args, nargs, "id|d:setitimer",
|
||||
&which, &seconds, &interval)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("setitimer", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = signal_setitimer_impl(module, which, seconds, interval);
|
||||
|
||||
exit:
|
||||
|
@ -246,22 +258,26 @@ PyDoc_STRVAR(signal_pthread_sigmask__doc__,
|
|||
"Fetch and/or change the signal mask of the calling thread.");
|
||||
|
||||
#define SIGNAL_PTHREAD_SIGMASK_METHODDEF \
|
||||
{"pthread_sigmask", (PyCFunction)signal_pthread_sigmask, METH_VARARGS, signal_pthread_sigmask__doc__},
|
||||
{"pthread_sigmask", (PyCFunction)signal_pthread_sigmask, METH_FASTCALL, signal_pthread_sigmask__doc__},
|
||||
|
||||
static PyObject *
|
||||
signal_pthread_sigmask_impl(PyObject *module, int how, PyObject *mask);
|
||||
|
||||
static PyObject *
|
||||
signal_pthread_sigmask(PyObject *module, PyObject *args)
|
||||
signal_pthread_sigmask(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int how;
|
||||
PyObject *mask;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "iO:pthread_sigmask",
|
||||
if (!_PyArg_ParseStack(args, nargs, "iO:pthread_sigmask",
|
||||
&how, &mask)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("pthread_sigmask", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = signal_pthread_sigmask_impl(module, how, mask);
|
||||
|
||||
exit:
|
||||
|
@ -338,24 +354,28 @@ PyDoc_STRVAR(signal_sigtimedwait__doc__,
|
|||
"The timeout is specified in seconds, with floating point numbers allowed.");
|
||||
|
||||
#define SIGNAL_SIGTIMEDWAIT_METHODDEF \
|
||||
{"sigtimedwait", (PyCFunction)signal_sigtimedwait, METH_VARARGS, signal_sigtimedwait__doc__},
|
||||
{"sigtimedwait", (PyCFunction)signal_sigtimedwait, METH_FASTCALL, signal_sigtimedwait__doc__},
|
||||
|
||||
static PyObject *
|
||||
signal_sigtimedwait_impl(PyObject *module, PyObject *sigset,
|
||||
PyObject *timeout_obj);
|
||||
|
||||
static PyObject *
|
||||
signal_sigtimedwait(PyObject *module, PyObject *args)
|
||||
signal_sigtimedwait(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *sigset;
|
||||
PyObject *timeout_obj;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "sigtimedwait",
|
||||
if (!_PyArg_UnpackStack(args, nargs, "sigtimedwait",
|
||||
2, 2,
|
||||
&sigset, &timeout_obj)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("sigtimedwait", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = signal_sigtimedwait_impl(module, sigset, timeout_obj);
|
||||
|
||||
exit:
|
||||
|
@ -373,22 +393,26 @@ PyDoc_STRVAR(signal_pthread_kill__doc__,
|
|||
"Send a signal to a thread.");
|
||||
|
||||
#define SIGNAL_PTHREAD_KILL_METHODDEF \
|
||||
{"pthread_kill", (PyCFunction)signal_pthread_kill, METH_VARARGS, signal_pthread_kill__doc__},
|
||||
{"pthread_kill", (PyCFunction)signal_pthread_kill, METH_FASTCALL, signal_pthread_kill__doc__},
|
||||
|
||||
static PyObject *
|
||||
signal_pthread_kill_impl(PyObject *module, long thread_id, int signalnum);
|
||||
|
||||
static PyObject *
|
||||
signal_pthread_kill(PyObject *module, PyObject *args)
|
||||
signal_pthread_kill(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
long thread_id;
|
||||
int signalnum;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "li:pthread_kill",
|
||||
if (!_PyArg_ParseStack(args, nargs, "li:pthread_kill",
|
||||
&thread_id, &signalnum)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("pthread_kill", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = signal_pthread_kill_impl(module, thread_id, signalnum);
|
||||
|
||||
exit:
|
||||
|
@ -440,4 +464,4 @@ exit:
|
|||
#ifndef SIGNAL_PTHREAD_KILL_METHODDEF
|
||||
#define SIGNAL_PTHREAD_KILL_METHODDEF
|
||||
#endif /* !defined(SIGNAL_PTHREAD_KILL_METHODDEF) */
|
||||
/*[clinic end generated code: output=c6990ef0d0ba72b6 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=fab3dba32c058588 input=a9049054013a1b77]*/
|
||||
|
|
|
@ -14,23 +14,27 @@ PyDoc_STRVAR(unicodedata_UCD_decimal__doc__,
|
|||
"ValueError is raised.");
|
||||
|
||||
#define UNICODEDATA_UCD_DECIMAL_METHODDEF \
|
||||
{"decimal", (PyCFunction)unicodedata_UCD_decimal, METH_VARARGS, unicodedata_UCD_decimal__doc__},
|
||||
{"decimal", (PyCFunction)unicodedata_UCD_decimal, METH_FASTCALL, unicodedata_UCD_decimal__doc__},
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_decimal_impl(PyObject *self, int chr,
|
||||
PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_decimal(PyObject *self, PyObject *args)
|
||||
unicodedata_UCD_decimal(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int chr;
|
||||
PyObject *default_value = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "C|O:decimal",
|
||||
if (!_PyArg_ParseStack(args, nargs, "C|O:decimal",
|
||||
&chr, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("decimal", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unicodedata_UCD_decimal_impl(self, chr, default_value);
|
||||
|
||||
exit:
|
||||
|
@ -48,22 +52,26 @@ PyDoc_STRVAR(unicodedata_UCD_digit__doc__,
|
|||
"ValueError is raised.");
|
||||
|
||||
#define UNICODEDATA_UCD_DIGIT_METHODDEF \
|
||||
{"digit", (PyCFunction)unicodedata_UCD_digit, METH_VARARGS, unicodedata_UCD_digit__doc__},
|
||||
{"digit", (PyCFunction)unicodedata_UCD_digit, METH_FASTCALL, unicodedata_UCD_digit__doc__},
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_digit_impl(PyObject *self, int chr, PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_digit(PyObject *self, PyObject *args)
|
||||
unicodedata_UCD_digit(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int chr;
|
||||
PyObject *default_value = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "C|O:digit",
|
||||
if (!_PyArg_ParseStack(args, nargs, "C|O:digit",
|
||||
&chr, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("digit", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unicodedata_UCD_digit_impl(self, chr, default_value);
|
||||
|
||||
exit:
|
||||
|
@ -81,23 +89,27 @@ PyDoc_STRVAR(unicodedata_UCD_numeric__doc__,
|
|||
"ValueError is raised.");
|
||||
|
||||
#define UNICODEDATA_UCD_NUMERIC_METHODDEF \
|
||||
{"numeric", (PyCFunction)unicodedata_UCD_numeric, METH_VARARGS, unicodedata_UCD_numeric__doc__},
|
||||
{"numeric", (PyCFunction)unicodedata_UCD_numeric, METH_FASTCALL, unicodedata_UCD_numeric__doc__},
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_numeric_impl(PyObject *self, int chr,
|
||||
PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_numeric(PyObject *self, PyObject *args)
|
||||
unicodedata_UCD_numeric(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int chr;
|
||||
PyObject *default_value = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "C|O:numeric",
|
||||
if (!_PyArg_ParseStack(args, nargs, "C|O:numeric",
|
||||
&chr, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("numeric", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unicodedata_UCD_numeric_impl(self, chr, default_value);
|
||||
|
||||
exit:
|
||||
|
@ -294,23 +306,27 @@ PyDoc_STRVAR(unicodedata_UCD_normalize__doc__,
|
|||
"Valid values for form are \'NFC\', \'NFKC\', \'NFD\', and \'NFKD\'.");
|
||||
|
||||
#define UNICODEDATA_UCD_NORMALIZE_METHODDEF \
|
||||
{"normalize", (PyCFunction)unicodedata_UCD_normalize, METH_VARARGS, unicodedata_UCD_normalize__doc__},
|
||||
{"normalize", (PyCFunction)unicodedata_UCD_normalize, METH_FASTCALL, unicodedata_UCD_normalize__doc__},
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_normalize_impl(PyObject *self, const char *form,
|
||||
PyObject *input);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_normalize(PyObject *self, PyObject *args)
|
||||
unicodedata_UCD_normalize(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
const char *form;
|
||||
PyObject *input;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "sO!:normalize",
|
||||
if (!_PyArg_ParseStack(args, nargs, "sO!:normalize",
|
||||
&form, &PyUnicode_Type, &input)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("normalize", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unicodedata_UCD_normalize_impl(self, form, input);
|
||||
|
||||
exit:
|
||||
|
@ -327,22 +343,26 @@ PyDoc_STRVAR(unicodedata_UCD_name__doc__,
|
|||
"ValueError is raised.");
|
||||
|
||||
#define UNICODEDATA_UCD_NAME_METHODDEF \
|
||||
{"name", (PyCFunction)unicodedata_UCD_name, METH_VARARGS, unicodedata_UCD_name__doc__},
|
||||
{"name", (PyCFunction)unicodedata_UCD_name, METH_FASTCALL, unicodedata_UCD_name__doc__},
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_name_impl(PyObject *self, int chr, PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_UCD_name(PyObject *self, PyObject *args)
|
||||
unicodedata_UCD_name(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int chr;
|
||||
PyObject *default_value = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "C|O:name",
|
||||
if (!_PyArg_ParseStack(args, nargs, "C|O:name",
|
||||
&chr, &default_value)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("name", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = unicodedata_UCD_name_impl(self, chr, default_value);
|
||||
|
||||
exit:
|
||||
|
@ -380,4 +400,4 @@ unicodedata_UCD_lookup(PyObject *self, PyObject *arg)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=5313ce129da87b2f input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=badeb811d1caec40 input=a9049054013a1b77]*/
|
||||
|
|
61
third_party/python/Modules/clinic/zlibmodule.inc
vendored
61
third_party/python/Modules/clinic/zlibmodule.inc
vendored
|
@ -17,6 +17,9 @@ PyDoc_STRVAR(zlib_compress__doc__,
|
|||
#define ZLIB_COMPRESS_METHODDEF \
|
||||
{"compress", (PyCFunction)zlib_compress, METH_FASTCALL, zlib_compress__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_compress_impl(PyObject *module, Py_buffer *data, int level);
|
||||
|
||||
static PyObject *
|
||||
zlib_compress(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
|
@ -26,7 +29,7 @@ zlib_compress(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
|
|||
Py_buffer data = {NULL, NULL};
|
||||
int level = Z_DEFAULT_COMPRESSION;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&data, &level)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -71,7 +74,7 @@ zlib_decompress(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *k
|
|||
int wbits = MAX_WBITS;
|
||||
Py_ssize_t bufsize = DEF_BUF_SIZE;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&data, &wbits, ssize_t_converter, &bufsize)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -110,7 +113,7 @@ PyDoc_STRVAR(zlib_compressobj__doc__,
|
|||
" Valid values range from 1 to 9. Higher values result in higher memory\n"
|
||||
" usage, faster compression, and smaller output.\n"
|
||||
" strategy\n"
|
||||
" Used to tune the compression algorithm. Possible values are\n"
|
||||
" Used to tune the compression algorithm. Possible values are\n"
|
||||
" Z_DEFAULT_STRATEGY, Z_RLE, Z_HUFFMAN_ONLY, Z_FILTERED, and\n"
|
||||
" Z_FIXED.\n"
|
||||
" zdict\n"
|
||||
|
@ -137,7 +140,7 @@ zlib_compressobj(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *
|
|||
int strategy = Z_DEFAULT_STRATEGY;
|
||||
Py_buffer zdict = {NULL, NULL};
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&level, &method, &wbits, &memLevel, &strategy, &zdict)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -179,7 +182,7 @@ zlib_decompressobj(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject
|
|||
int wbits = MAX_WBITS;
|
||||
PyObject *zdict = NULL;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&wbits, &zdict)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -261,7 +264,7 @@ zlib_Decompress_decompress(compobject *self, PyObject **args, Py_ssize_t nargs,
|
|||
Py_buffer data = {NULL, NULL};
|
||||
Py_ssize_t max_length = 0;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
|
||||
&data, ssize_t_converter, &max_length)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -289,21 +292,25 @@ PyDoc_STRVAR(zlib_Compress_flush__doc__,
|
|||
" can still be compressed.");
|
||||
|
||||
#define ZLIB_COMPRESS_FLUSH_METHODDEF \
|
||||
{"flush", (PyCFunction)zlib_Compress_flush, METH_VARARGS, zlib_Compress_flush__doc__},
|
||||
{"flush", (PyCFunction)zlib_Compress_flush, METH_FASTCALL, zlib_Compress_flush__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_Compress_flush_impl(compobject *self, int mode);
|
||||
|
||||
static PyObject *
|
||||
zlib_Compress_flush(compobject *self, PyObject *args)
|
||||
zlib_Compress_flush(compobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int mode = Z_FINISH;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|i:flush",
|
||||
if (!_PyArg_ParseStack(args, nargs, "|i:flush",
|
||||
&mode)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("flush", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = zlib_Compress_flush_impl(self, mode);
|
||||
|
||||
exit:
|
||||
|
@ -364,21 +371,25 @@ PyDoc_STRVAR(zlib_Decompress_flush__doc__,
|
|||
" the initial size of the output buffer.");
|
||||
|
||||
#define ZLIB_DECOMPRESS_FLUSH_METHODDEF \
|
||||
{"flush", (PyCFunction)zlib_Decompress_flush, METH_VARARGS, zlib_Decompress_flush__doc__},
|
||||
{"flush", (PyCFunction)zlib_Decompress_flush, METH_FASTCALL, zlib_Decompress_flush__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_Decompress_flush_impl(compobject *self, Py_ssize_t length);
|
||||
|
||||
static PyObject *
|
||||
zlib_Decompress_flush(compobject *self, PyObject *args)
|
||||
zlib_Decompress_flush(compobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t length = DEF_BUF_SIZE;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|O&:flush",
|
||||
if (!_PyArg_ParseStack(args, nargs, "|O&:flush",
|
||||
ssize_t_converter, &length)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("flush", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = zlib_Decompress_flush_impl(self, length);
|
||||
|
||||
exit:
|
||||
|
@ -397,22 +408,26 @@ PyDoc_STRVAR(zlib_adler32__doc__,
|
|||
"The returned checksum is an integer.");
|
||||
|
||||
#define ZLIB_ADLER32_METHODDEF \
|
||||
{"adler32", (PyCFunction)zlib_adler32, METH_VARARGS, zlib_adler32__doc__},
|
||||
{"adler32", (PyCFunction)zlib_adler32, METH_FASTCALL, zlib_adler32__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_adler32_impl(PyObject *module, Py_buffer *data, unsigned int value);
|
||||
|
||||
static PyObject *
|
||||
zlib_adler32(PyObject *module, PyObject *args)
|
||||
zlib_adler32(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
unsigned int value = 1;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*|I:adler32",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*|I:adler32",
|
||||
&data, &value)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("adler32", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = zlib_adler32_impl(module, &data, value);
|
||||
|
||||
exit:
|
||||
|
@ -436,22 +451,26 @@ PyDoc_STRVAR(zlib_crc32__doc__,
|
|||
"The returned checksum is an integer.");
|
||||
|
||||
#define ZLIB_CRC32_METHODDEF \
|
||||
{"crc32", (PyCFunction)zlib_crc32, METH_VARARGS, zlib_crc32__doc__},
|
||||
{"crc32", (PyCFunction)zlib_crc32, METH_FASTCALL, zlib_crc32__doc__},
|
||||
|
||||
static PyObject *
|
||||
zlib_crc32_impl(PyObject *module, Py_buffer *data, unsigned int value);
|
||||
|
||||
static PyObject *
|
||||
zlib_crc32(PyObject *module, PyObject *args)
|
||||
zlib_crc32(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer data = {NULL, NULL};
|
||||
unsigned int value = 0;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y*|I:crc32",
|
||||
if (!_PyArg_ParseStack(args, nargs, "y*|I:crc32",
|
||||
&data, &value)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("crc32", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = zlib_crc32_impl(module, &data, value);
|
||||
|
||||
exit:
|
||||
|
@ -466,8 +485,4 @@ exit:
|
|||
#ifndef ZLIB_COMPRESS_COPY_METHODDEF
|
||||
#define ZLIB_COMPRESS_COPY_METHODDEF
|
||||
#endif /* !defined(ZLIB_COMPRESS_COPY_METHODDEF) */
|
||||
|
||||
#ifndef ZLIB_DECOMPRESS_COPY_METHODDEF
|
||||
#define ZLIB_DECOMPRESS_COPY_METHODDEF
|
||||
#endif /* !defined(ZLIB_DECOMPRESS_COPY_METHODDEF) */
|
||||
/*[clinic end generated code: output=497dad1132c962e2 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=c6cb10ed66f226b2 input=a9049054013a1b77]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue