diff options
Diffstat (limited to 'Modules/clinic/zlibmodule.c.h')
-rw-r--r-- | Modules/clinic/zlibmodule.c.h | 58 |
1 files changed, 23 insertions, 35 deletions
diff --git a/Modules/clinic/zlibmodule.c.h b/Modules/clinic/zlibmodule.c.h index f54a805..35661a5 100644 --- a/Modules/clinic/zlibmodule.c.h +++ b/Modules/clinic/zlibmodule.c.h @@ -26,8 +26,7 @@ zlib_compress(PyModuleDef *module, PyObject *args) Py_buffer bytes = {NULL, NULL}; int level = Z_DEFAULT_COMPRESSION; - if (!PyArg_ParseTuple(args, - "y*|i:compress", + if (!PyArg_ParseTuple(args, "y*|i:compress", &bytes, &level)) goto exit; return_value = zlib_compress_impl(module, &bytes, level); @@ -57,7 +56,8 @@ PyDoc_STRVAR(zlib_decompress__doc__, {"decompress", (PyCFunction)zlib_decompress, METH_VARARGS, zlib_decompress__doc__}, static PyObject * -zlib_decompress_impl(PyModuleDef *module, Py_buffer *data, int wbits, unsigned int bufsize); +zlib_decompress_impl(PyModuleDef *module, Py_buffer *data, int wbits, + unsigned int bufsize); static PyObject * zlib_decompress(PyModuleDef *module, PyObject *args) @@ -67,8 +67,7 @@ zlib_decompress(PyModuleDef *module, PyObject *args) int wbits = MAX_WBITS; unsigned int bufsize = DEF_BUF_SIZE; - if (!PyArg_ParseTuple(args, - "y*|iO&:decompress", + if (!PyArg_ParseTuple(args, "y*|iO&:decompress", &data, &wbits, uint_converter, &bufsize)) goto exit; return_value = zlib_decompress_impl(module, &data, wbits, bufsize); @@ -111,7 +110,8 @@ PyDoc_STRVAR(zlib_compressobj__doc__, {"compressobj", (PyCFunction)zlib_compressobj, METH_VARARGS|METH_KEYWORDS, zlib_compressobj__doc__}, static PyObject * -zlib_compressobj_impl(PyModuleDef *module, int level, int method, int wbits, int memLevel, int strategy, Py_buffer *zdict); +zlib_compressobj_impl(PyModuleDef *module, int level, int method, int wbits, + int memLevel, int strategy, Py_buffer *zdict); static PyObject * zlib_compressobj(PyModuleDef *module, PyObject *args, PyObject *kwargs) @@ -125,8 +125,7 @@ zlib_compressobj(PyModuleDef *module, PyObject *args, PyObject *kwargs) int strategy = Z_DEFAULT_STRATEGY; Py_buffer zdict = {NULL, NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "|iiiiiy*:compressobj", _keywords, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|iiiiiy*:compressobj", _keywords, &level, &method, &wbits, &memLevel, &strategy, &zdict)) goto exit; return_value = zlib_compressobj_impl(module, level, method, wbits, memLevel, strategy, &zdict); @@ -165,8 +164,7 @@ zlib_decompressobj(PyModuleDef *module, PyObject *args, PyObject *kwargs) int wbits = MAX_WBITS; PyObject *zdict = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "|iO:decompressobj", _keywords, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|iO:decompressobj", _keywords, &wbits, &zdict)) goto exit; return_value = zlib_decompressobj_impl(module, wbits, zdict); @@ -189,20 +187,18 @@ PyDoc_STRVAR(zlib_Compress_compress__doc__, "Call the flush() method to clear these buffers."); #define ZLIB_COMPRESS_COMPRESS_METHODDEF \ - {"compress", (PyCFunction)zlib_Compress_compress, METH_VARARGS, zlib_Compress_compress__doc__}, + {"compress", (PyCFunction)zlib_Compress_compress, METH_O, zlib_Compress_compress__doc__}, static PyObject * zlib_Compress_compress_impl(compobject *self, Py_buffer *data); static PyObject * -zlib_Compress_compress(compobject *self, PyObject *args) +zlib_Compress_compress(compobject *self, PyObject *arg) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; - if (!PyArg_ParseTuple(args, - "y*:compress", - &data)) + if (!PyArg_Parse(arg, "y*:compress", &data)) goto exit; return_value = zlib_Compress_compress_impl(self, &data); @@ -235,7 +231,8 @@ PyDoc_STRVAR(zlib_Decompress_decompress__doc__, {"decompress", (PyCFunction)zlib_Decompress_decompress, METH_VARARGS, zlib_Decompress_decompress__doc__}, static PyObject * -zlib_Decompress_decompress_impl(compobject *self, Py_buffer *data, unsigned int max_length); +zlib_Decompress_decompress_impl(compobject *self, Py_buffer *data, + unsigned int max_length); static PyObject * zlib_Decompress_decompress(compobject *self, PyObject *args) @@ -244,8 +241,7 @@ zlib_Decompress_decompress(compobject *self, PyObject *args) Py_buffer data = {NULL, NULL}; unsigned int max_length = 0; - if (!PyArg_ParseTuple(args, - "y*|O&:decompress", + if (!PyArg_ParseTuple(args, "y*|O&:decompress", &data, uint_converter, &max_length)) goto exit; return_value = zlib_Decompress_decompress_impl(self, &data, max_length); @@ -282,8 +278,7 @@ zlib_Compress_flush(compobject *self, PyObject *args) PyObject *return_value = NULL; int mode = Z_FINISH; - if (!PyArg_ParseTuple(args, - "|i:flush", + if (!PyArg_ParseTuple(args, "|i:flush", &mode)) goto exit; return_value = zlib_Compress_flush_impl(self, mode); @@ -314,10 +309,6 @@ zlib_Compress_copy(compobject *self, PyObject *Py_UNUSED(ignored)) #endif /* defined(HAVE_ZLIB_COPY) */ -#ifndef ZLIB_COMPRESS_COPY_METHODDEF - #define ZLIB_COMPRESS_COPY_METHODDEF -#endif /* !defined(ZLIB_COMPRESS_COPY_METHODDEF) */ - #if defined(HAVE_ZLIB_COPY) PyDoc_STRVAR(zlib_Decompress_copy__doc__, @@ -340,10 +331,6 @@ zlib_Decompress_copy(compobject *self, PyObject *Py_UNUSED(ignored)) #endif /* defined(HAVE_ZLIB_COPY) */ -#ifndef ZLIB_DECOMPRESS_COPY_METHODDEF - #define ZLIB_DECOMPRESS_COPY_METHODDEF -#endif /* !defined(ZLIB_DECOMPRESS_COPY_METHODDEF) */ - PyDoc_STRVAR(zlib_Decompress_flush__doc__, "flush($self, length=zlib.DEF_BUF_SIZE, /)\n" "--\n" @@ -365,8 +352,7 @@ zlib_Decompress_flush(compobject *self, PyObject *args) PyObject *return_value = NULL; unsigned int length = DEF_BUF_SIZE; - if (!PyArg_ParseTuple(args, - "|O&:flush", + if (!PyArg_ParseTuple(args, "|O&:flush", uint_converter, &length)) goto exit; return_value = zlib_Decompress_flush_impl(self, length); @@ -399,8 +385,7 @@ zlib_adler32(PyModuleDef *module, PyObject *args) Py_buffer data = {NULL, NULL}; unsigned int value = 1; - if (!PyArg_ParseTuple(args, - "y*|I:adler32", + if (!PyArg_ParseTuple(args, "y*|I:adler32", &data, &value)) goto exit; return_value = zlib_adler32_impl(module, &data, value); @@ -437,8 +422,7 @@ zlib_crc32(PyModuleDef *module, PyObject *args) Py_buffer data = {NULL, NULL}; unsigned int value = 0; - if (!PyArg_ParseTuple(args, - "y*|I:crc32", + if (!PyArg_ParseTuple(args, "y*|I:crc32", &data, &value)) goto exit; return_value = zlib_crc32_impl(module, &data, value); @@ -450,4 +434,8 @@ exit: return return_value; } -/*[clinic end generated code: output=bc9473721ca7c962 input=a9049054013a1b77]*/ + +#ifndef ZLIB_COMPRESS_COPY_METHODDEF + #define ZLIB_COMPRESS_COPY_METHODDEF +#endif /* !defined(ZLIB_COMPRESS_COPY_METHODDEF) */ +/*[clinic end generated code: output=56ed1147bbbb4788 input=a9049054013a1b77]*/ |