Plugins#

Filters#

int(*) blosc2_filter_forward_cb (const uint8_t *, uint8_t *, int32_t, uint8_t, blosc2_cparams *, uint8_t)
int(*) blosc2_filter_backward_cb (const uint8_t *, uint8_t *, int32_t, uint8_t, blosc2_dparams *, uint8_t)
struct blosc2_filter#

The parameters for a user-defined filter.

Public Members

uint8_t id#

The filter identifier.

char *name#

The filter name.

uint8_t version#

The filter version.

blosc2_filter_forward_cb forward#

The filter function that is used during compression.

blosc2_filter_backward_cb backward#

The filter function that is used during decompression.

int blosc2_register_filter(blosc2_filter *filter)#

Register locally a user-defined filter in Blosc.

Parameters:
  • filter – The filter to register.

Returns:

0 if succeeds. Else a negative code is returned.

Codecs#

int(*) blosc2_codec_encoder_cb (const uint8_t *input, int32_t input_len, uint8_t *output, int32_t output_len, uint8_t meta, blosc2_cparams *cparams, const void *chunk)
int(*) blosc2_codec_decoder_cb (const uint8_t *input, int32_t input_len, uint8_t *output, int32_t output_len, uint8_t meta, blosc2_dparams *dparams, const void *chunk)
struct blosc2_codec#

Public Members

uint8_t compcode#

The codec identifier.

char *compname#

The codec name.

uint8_t complib#

The codec library format.

uint8_t version#

The codec version.

blosc2_codec_encoder_cb encoder#

The codec encoder that is used during compression.

blosc2_codec_decoder_cb decoder#

The codec decoder that is used during decompression.

int blosc2_register_codec(blosc2_codec *codec)#

Register locally a user-defined codec in Blosc.

Parameters:
  • codec – The codec to register.

Returns:

0 if succeeds. Else a negative code is returned.

Tuners#

struct blosc2_tuner#

Public Members

int(*) init (void *config, blosc2_context *cctx, blosc2_context *dctx)

Initialize tuner. Keep in mind dctx may be NULL. This should memcpy the cctx->tuner_params.

int(*) next_blocksize (blosc2_context *context)

Only compute the next blocksize. Only it is executed if tuner is not initialized.

int(*) next_cparams (blosc2_context *context)

Compute the next cparams. Only is executed if tuner is initialized.

int(*) update (blosc2_context *context, double ctime)

Update the tuner parameters.

int(*) free (blosc2_context *context)

Free the tuner.

int id#

The tuner id.

char *name#

The tuner name.

int blosc2_register_tuner(blosc2_tuner *tuner)#

Register locally a user-defined tuner in Blosc.

Parameters:
  • tuner – The tuner to register.

Returns:

0 if succeeds. Else a negative code is returned.

IO backends#

void *(*) blosc2_open_cb (const char *urlpath, const char *mode, void *params)
int(*) blosc2_close_cb (void *stream)
int64_t(*) blosc2_write_cb (const void *ptr, int64_t size, int64_t nitems, int64_t position, void *stream)
int64_t(*) blosc2_read_cb (void **ptr, int64_t size, int64_t nitems, int64_t position, void *stream)
int(*) blosc2_truncate_cb (void *stream, int64_t size)
struct blosc2_io_cb#

Public Members

uint8_t id#

The IO identifier.

char *name#

The IO name.

bool is_allocation_necessary#

If true, the caller needs to allocate data for the read function (ptr argument). If false, the read function stores in the ptr argument the address of memory that it owns (the caller must not free it), or NULL when it cannot read the requested bytes: check the returned count before using it.

blosc2_open_cb open#

The IO open callback.

blosc2_close_cb close#

The IO close callback.

blosc2_size_cb size#

The IO size callback.

blosc2_write_cb write#

The IO write callback.

blosc2_read_cb read#

The IO read callback.

blosc2_truncate_cb truncate#

The IO truncate callback.

blosc2_destroy_cb destroy#

The IO destroy callback (called in the end when finished with the schunk).

struct blosc2_io#

Public Members

const char *name#

The IO identifier.

void *params#

The IO parameters.

struct blosc2_stdio_params#

Parameters for the default filesystem I/O (BLOSC2_IO_FILESYSTEM).

Pass a pointer to this struct in the params member of the blosc2_io struct; a NULL params keeps all the defaults. The struct must outlive the super-chunks opened with it.

Public Members

bool locking#

Serialize accesses to a disk-based frame against other handles and other processes, via a sidecar lock file next to the frame (advisory locking: it only protects the frame if every handle on it enables this too). Readers share the lock; mutating operations take it exclusively. Not supported on network filesystems (NFS), nor by other I/O backends. The BLOSC_LOCKING environment variable turns this on globally (for every frame subsequently opened or created with the default filesystem I/O) without touching the sources; set it to “0” or the empty string to leave it off.

int blosc2_register_io_cb(const blosc2_io_cb *io)#

Register a user-defined input/output callbacks in Blosc.

Parameters:
  • io – The callbacks API to register.

Returns:

0 if succeeds. Else a negative code is returned.

blosc2_io_cb *blosc2_get_io_cb(uint8_t id)#

Get a user-defined input/output callback in Blosc.

Parameters:
  • id – The id of the callback to get.

Returns:

A pointer containing the desired callback if success. Else a NULL pointer is returned.