static const char init_twice_msg[] = "__init__ method is called twice.";
-extern int
-_PyZstd_load_c_dict(ZstdCompressor *self, PyObject *dict);
-
-extern int
-_PyZstd_load_d_dict(ZstdDecompressor *self, PyObject *dict);
-
-extern int
-_PyZstd_set_c_parameters(ZstdCompressor *self, PyObject *level_or_options,
- const char *arg_name, const char *arg_type);
-
-extern int
-_PyZstd_set_d_parameters(ZstdDecompressor *self, PyObject *options);
-
extern PyObject *
decompress_impl(ZstdDecompressor *self, ZSTD_inBuffer *in,
Py_ssize_t max_length,
#define ZstdCompressor_CAST(op) ((ZstdCompressor *)op)
-int
-_PyZstd_set_c_parameters(ZstdCompressor *self, PyObject *level_or_options,
- const char *arg_name, const char* arg_type)
+static int
+_zstd_set_c_parameters(ZstdCompressor *self, PyObject *level_or_options,
+ const char *arg_name, const char* arg_type)
{
size_t zstd_ret;
_zstd_state* const mod_state = PyType_GetModuleState(Py_TYPE(self));
return cdict;
}
-int
-_PyZstd_load_c_dict(ZstdCompressor *self, PyObject *dict) {
+static int
+_zstd_load_c_dict(ZstdCompressor *self, PyObject *dict) {
size_t zstd_ret;
_zstd_state* const mod_state = PyType_GetModuleState(Py_TYPE(self));
/* Set compressLevel/options to compression context */
if (level != Py_None) {
- if (_PyZstd_set_c_parameters(self, level, "level", "int") < 0) {
+ if (_zstd_set_c_parameters(self, level, "level", "int") < 0) {
return -1;
}
}
if (options != Py_None) {
- if (_PyZstd_set_c_parameters(self, options, "options", "dict") < 0) {
+ if (_zstd_set_c_parameters(self, options, "options", "dict") < 0) {
return -1;
}
}
/* Load dictionary to compression context */
if (zstd_dict != Py_None) {
- if (_PyZstd_load_c_dict(self, zstd_dict) < 0) {
+ if (_zstd_load_c_dict(self, zstd_dict) < 0) {
return -1;
}
}
/* Set decompression parameters to decompression context */
-int
-_PyZstd_set_d_parameters(ZstdDecompressor *self, PyObject *options)
+static int
+_zstd_set_d_parameters(ZstdDecompressor *self, PyObject *options)
{
size_t zstd_ret;
PyObject *key, *value;
}
/* Load dictionary or prefix to decompression context */
-int
-_PyZstd_load_d_dict(ZstdDecompressor *self, PyObject *dict)
+static int
+_zstd_load_d_dict(ZstdDecompressor *self, PyObject *dict)
{
size_t zstd_ret;
_zstd_state* const mod_state = PyType_GetModuleState(Py_TYPE(self));
/* Load dictionary to decompression context */
if (zstd_dict != Py_None) {
- if (_PyZstd_load_d_dict(self, zstd_dict) < 0) {
+ if (_zstd_load_d_dict(self, zstd_dict) < 0) {
return -1;
}
/* Set option to decompression context */
if (options != Py_None) {
- if (_PyZstd_set_d_parameters(self, options) < 0) {
+ if (_zstd_set_d_parameters(self, options) < 0) {
return -1;
}
}