2 * Copyright (c) Meta Platforms, Inc. and affiliates.
5 * This source code is licensed under both the BSD-style license (found in the
6 * LICENSE file in the root directory of this source tree) and the GPLv2 (found
7 * in the COPYING file in the root directory of this source tree).
8 * You may select, at your option, one of the above-listed licenses.
16 #define ZSTD_STATIC_LINKING_ONLY
22 ZSTD_cParameter param;
28 param_value_t const* data;
32 * The config tells the compression method what options to use.
35 const char* name; /**< Identifies the config in the results table */
37 * Optional arguments to pass to the CLI. If not set, CLI-based methods
38 * will skip this config.
42 * Parameters to pass to the advanced API. If the advanced API isn't used,
43 * the parameters will be derived from these.
45 param_values_t param_values;
47 * Boolean parameter that says if we should use a dictionary. If the data
48 * doesn't have a dictionary, this config is skipped. Defaults to no.
52 * Boolean parameter that says if we should pass the pledged source size
53 * when the method allows it. Defaults to yes.
55 int no_pledged_src_size;
57 * Boolean parameter that says that this config should only be used
58 * for methods that use the advanced compression API
60 int advanced_api_only;
64 * Returns true if the config should skip this data.
65 * For instance, if the config requires a dictionary but the data doesn't have
68 int config_skip_data(config_t const* config, data_t const* data);
70 #define CONFIG_NO_LEVEL (-ZSTD_TARGETLENGTH_MAX - 1)
72 * Returns the compression level specified by the config, or CONFIG_NO_LEVEL if
73 * no level is specified. Note that 0 is a valid compression level, meaning
76 int config_get_level(config_t const* config);
79 * Returns the compression parameters specified by the config.
81 ZSTD_parameters config_get_zstd_params(
82 config_t const* config,
87 * The NULL-terminated list of configs.
89 extern config_t const* const* configs;