Context

struct caterva_ctx_t

Context for caterva arrays that specifies the functions used to manage memory and the compression/decompression parameters used in Blosc.

Configuration parameters

struct caterva_config_t

Configuration parameters used to create a caterva context.

Public Members

void *(*alloc)(size_t)

The memory allocation function used internally.

void (*free)(void*)

The memory release function used internally.

uint8_t compcodec

Defines the codec used in compression.

uint8_t compmeta

The metadata for the compressor codec.

uint8_t complevel

Determines the compression level used in Blosc.

int32_t splitmode

Whether the blocks should be split or not.

int usedict

Indicates whether a dictionary is used to compress data or not.

int16_t nthreads

Determines the maximum number of threads that can be used.

uint8_t filters[BLOSC2_MAX_FILTERS]

Defines the filters used in compression.

uint8_t filtersmeta[BLOSC2_MAX_FILTERS]

Indicates the meta filters used in Blosc.

blosc2_prefilter_fn prefilter

Defines the function that is applied to the data before compressing it.

blosc2_prefilter_params *pparams

Indicates the parameters of the prefilter function.

blosc2_btune *udbtune

Indicates user-defined parameters for btune.

static const caterva_config_t CATERVA_CONFIG_DEFAULTS

The default configuration parameters used in caterva.

Creation

int caterva_ctx_new(caterva_config_t *cfg, caterva_ctx_t **ctx)

Create a context for caterva.

Parameters
  • cfg – The configuration parameters needed for the context creation.

  • ctx – The memory pointer where the context will be created.

Returns

An error code.

Destruction

int caterva_ctx_free(caterva_ctx_t **ctx)

Free a context.

Parameters

ctx – The The context to be freed.

Returns

An error code.