Lines Matching defs:self
151 static void brotli_Compressor_dealloc(brotli_Compressor* self) {
152 BrotliEncoderDestroyInstance(self->enc);
154 Py_TYPE(self)->tp_free((PyObject*)self);
156 self->ob_type->tp_free((PyObject*)self);
161 brotli_Compressor *self;
162 self = (brotli_Compressor *)type->tp_alloc(type, 0);
164 if (self != NULL) {
165 self->enc = BrotliEncoderCreateInstance(0, 0, 0);
168 return (PyObject *)self;
171 static int brotli_Compressor_init(brotli_Compressor *self, PyObject *args, PyObject *keywds) {
188 if (!self->enc)
192 BrotliEncoderSetParameter(self->enc, BROTLI_PARAM_MODE, (uint32_t)mode);
194 BrotliEncoderSetParameter(self->enc, BROTLI_PARAM_QUALITY, (uint32_t)quality);
196 BrotliEncoderSetParameter(self->enc, BROTLI_PARAM_LGWIN, (uint32_t)lgwin);
198 BrotliEncoderSetParameter(self->enc, BROTLI_PARAM_LGBLOCK, (uint32_t)lgblock);
223 static PyObject* brotli_Compressor_process(brotli_Compressor *self, PyObject *args) {
238 if (!self->enc) {
243 ok = compress_stream(self->enc, BROTLI_OPERATION_PROCESS,
271 static PyObject* brotli_Compressor_flush(brotli_Compressor *self) {
276 if (!self->enc) {
281 ok = compress_stream(self->enc, BROTLI_OPERATION_FLUSH,
311 static PyObject* brotli_Compressor_finish(brotli_Compressor *self) {
316 if (!self->enc) {
321 ok = compress_stream(self->enc, BROTLI_OPERATION_FINISH,
325 ok = BrotliEncoderIsFinished(self->enc);
437 static void brotli_Decompressor_dealloc(brotli_Decompressor* self) {
438 BrotliDecoderDestroyInstance(self->dec);
440 Py_TYPE(self)->tp_free((PyObject*)self);
442 self->ob_type->tp_free((PyObject*)self);
447 brotli_Decompressor *self;
448 self = (brotli_Decompressor *)type->tp_alloc(type, 0);
450 if (self != NULL) {
451 self->dec = BrotliDecoderCreateInstance(0, 0, 0);
454 return (PyObject *)self;
457 static int brotli_Decompressor_init(brotli_Decompressor *self, PyObject *args, PyObject *keywds) {
466 if (!self->dec)
492 static PyObject* brotli_Decompressor_process(brotli_Decompressor *self, PyObject *args) {
507 if (!self->dec) {
512 ok = decompress_stream(self->dec, &output, static_cast<uint8_t*>(input.buf), input.len);
539 static PyObject* brotli_Decompressor_is_finished(brotli_Decompressor *self) {
544 if (!self->dec) {
550 if (BrotliDecoderIsFinished(self->dec)) {
637 static PyObject* brotli_decompress(PyObject *self, PyObject *args, PyObject *keywds) {