756 0, /* tp_alloc */ |
756 0, /* tp_alloc */ |
757 PyType_GenericNew, /* tp_new */ |
757 PyType_GenericNew, /* tp_new */ |
758 }; |
758 }; |
759 |
759 |
760 void bufferutil_module_init(PyObject* mod) { |
760 void bufferutil_module_init(PyObject* mod) { |
761 Py_TYPE(&ZstdBufferWithSegmentsType) = &PyType_Type; |
761 Py_SET_TYPE(&ZstdBufferWithSegmentsType, &PyType_Type); |
762 if (PyType_Ready(&ZstdBufferWithSegmentsType) < 0) { |
762 if (PyType_Ready(&ZstdBufferWithSegmentsType) < 0) { |
763 return; |
763 return; |
764 } |
764 } |
765 |
765 |
766 Py_INCREF(&ZstdBufferWithSegmentsType); |
766 Py_INCREF(&ZstdBufferWithSegmentsType); |
767 PyModule_AddObject(mod, "BufferWithSegments", (PyObject*)&ZstdBufferWithSegmentsType); |
767 PyModule_AddObject(mod, "BufferWithSegments", (PyObject*)&ZstdBufferWithSegmentsType); |
768 |
768 |
769 Py_TYPE(&ZstdBufferSegmentsType) = &PyType_Type; |
769 Py_SET_TYPE(&ZstdBufferSegmentsType, &PyType_Type); |
770 if (PyType_Ready(&ZstdBufferSegmentsType) < 0) { |
770 if (PyType_Ready(&ZstdBufferSegmentsType) < 0) { |
771 return; |
771 return; |
772 } |
772 } |
773 |
773 |
774 Py_INCREF(&ZstdBufferSegmentsType); |
774 Py_INCREF(&ZstdBufferSegmentsType); |
775 PyModule_AddObject(mod, "BufferSegments", (PyObject*)&ZstdBufferSegmentsType); |
775 PyModule_AddObject(mod, "BufferSegments", (PyObject*)&ZstdBufferSegmentsType); |
776 |
776 |
777 Py_TYPE(&ZstdBufferSegmentType) = &PyType_Type; |
777 Py_SET_TYPE(&ZstdBufferSegmentType, &PyType_Type); |
778 if (PyType_Ready(&ZstdBufferSegmentType) < 0) { |
778 if (PyType_Ready(&ZstdBufferSegmentType) < 0) { |
779 return; |
779 return; |
780 } |
780 } |
781 |
781 |
782 Py_INCREF(&ZstdBufferSegmentType); |
782 Py_INCREF(&ZstdBufferSegmentType); |
783 PyModule_AddObject(mod, "BufferSegment", (PyObject*)&ZstdBufferSegmentType); |
783 PyModule_AddObject(mod, "BufferSegment", (PyObject*)&ZstdBufferSegmentType); |
784 |
784 |
785 Py_TYPE(&ZstdBufferWithSegmentsCollectionType) = &PyType_Type; |
785 Py_SET_TYPE(&ZstdBufferWithSegmentsCollectionType, &PyType_Type); |
786 if (PyType_Ready(&ZstdBufferWithSegmentsCollectionType) < 0) { |
786 if (PyType_Ready(&ZstdBufferWithSegmentsCollectionType) < 0) { |
787 return; |
787 return; |
788 } |
788 } |
789 |
789 |
790 Py_INCREF(&ZstdBufferWithSegmentsCollectionType); |
790 Py_INCREF(&ZstdBufferWithSegmentsCollectionType); |