30 Py_INCREF(version); |
30 Py_INCREF(version); |
31 PyModule_AddObject(mod, "__version__", version); |
31 PyModule_AddObject(mod, "__version__", version); |
32 |
32 |
33 ZstdError = PyErr_NewException("zstd.ZstdError", NULL, NULL); |
33 ZstdError = PyErr_NewException("zstd.ZstdError", NULL, NULL); |
34 PyModule_AddObject(mod, "ZstdError", ZstdError); |
34 PyModule_AddObject(mod, "ZstdError", ZstdError); |
|
35 |
|
36 PyModule_AddIntConstant(mod, "COMPRESSOBJ_FLUSH_FINISH", compressorobj_flush_finish); |
|
37 PyModule_AddIntConstant(mod, "COMPRESSOBJ_FLUSH_BLOCK", compressorobj_flush_block); |
35 |
38 |
36 /* For now, the version is a simple tuple instead of a dedicated type. */ |
39 /* For now, the version is a simple tuple instead of a dedicated type. */ |
37 zstdVersion = PyTuple_New(3); |
40 zstdVersion = PyTuple_New(3); |
38 PyTuple_SetItem(zstdVersion, 0, PyLong_FromLong(ZSTD_VERSION_MAJOR)); |
41 PyTuple_SetItem(zstdVersion, 0, PyLong_FromLong(ZSTD_VERSION_MAJOR)); |
39 PyTuple_SetItem(zstdVersion, 1, PyLong_FromLong(ZSTD_VERSION_MINOR)); |
42 PyTuple_SetItem(zstdVersion, 1, PyLong_FromLong(ZSTD_VERSION_MINOR)); |