-WIMLIBAPI int
-wimlib_set_default_decompressor_params(enum wimlib_compression_type ctype,
- const struct wimlib_decompressor_params_header *params)
-{
- struct wimlib_decompressor_params_header *dup;
-
- if (!decompressor_ctype_valid(ctype))
- return WIMLIB_ERR_INVALID_COMPRESSION_TYPE;
-
- dup = NULL;
- if (params) {
- dup = memdup(params, params->size);
- if (dup == NULL)
- return WIMLIB_ERR_NOMEM;
- }
-
- FREE(decompressor_default_params[ctype]);
- decompressor_default_params[ctype] = dup;
- return 0;
-}
-
-void
-cleanup_decompressor_params(void)
-{
- for (size_t i = 0; i < ARRAY_LEN(decompressor_default_params); i++) {
- FREE(decompressor_default_params[i]);
- decompressor_default_params[i] = NULL;
- }
-}
-