Source

python-clinic / Modules / zlibmodule_clinic.c

Full commit

PyDoc_STRVAR(zlib_decompress__doc__,
"zlib.decompress(data[, max_length=0])\n"
"\n"
"  data\n"
"      The binary data to decompress.\n"
"  max_length\n"
"      The maximum allowable length of the decompressed data.\n"
"      Unconsumed input data will be stored in\n"
"      the unconsumed_tail attribute.\n"
"\n"
"Return a string containing the decompressed version of the data.\n"
"\n"
"After calling this function, some of the input data may still be stored in\n"
"internal buffers for later processing.\n"
"Call the flush() method to clear these buffers.\n");

#define ZLIB_DECOMPRESS_METHODDEF    \
    {"decompress", (PyCFunction)zlib_decompress, METH_VARARGS | METH_KEYWORDS, zlib_decompress__doc__}

static PyObject *
zlib_decompress_impl(PyObject *self, Py_buffer data, int max_length);

static PyObject *
zlib_decompress(PyObject *self, PyObject *args, PyObject *kwargs)
{
    PyObject *_return_value;
    Py_buffer data;
    int max_length = 0;
    static char *_keywords[] = {"data", "max_length", NULL};

    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
        "y*|i:decompress", _keywords,
        &data, &max_length))
        return NULL;

    _return_value = zlib_decompress_impl(self, data, max_length);
    return _return_value;
}