Metalayers

Fixed-length metalayers

int caterva_meta_exists(caterva_ctx_t *ctx, caterva_array_t *array, const char *name, bool *exists)

Check if a metalayer exists or not.

Parameters
  • ctx – The context to be used.

  • array – The array where the check will be done.

  • name – The name of the metalayer to check.

  • exists – Pointer where the result will be stored.

Returns

An error code

int caterva_meta_get(caterva_ctx_t *ctx, caterva_array_t *array, const char *name, caterva_metalayer_t *meta)

Get a metalayer from a Caterva array.

Warning

The contents of meta are allocated inside the function. Therefore, they must be released with a free.

Parameters
  • ctx – The context to be used.

  • array – The array where the metalayer will be added.

  • name – The vl-metalayer name.

  • meta – Pointer to the metalayer where the data will be stored.

Returns

An error code

int caterva_meta_update(caterva_ctx_t *ctx, caterva_array_t *array, caterva_metalayer_t *meta)

Update a metalayer content in a Caterva array.

Parameters
  • ctx – The context to be used.

  • array – The array where the metalayer will be updated.

  • meta – The metalayer to update.

Returns

An error code

Variable-length metalayers

int caterva_vlmeta_add(caterva_ctx_t *ctx, caterva_array_t *array, caterva_metalayer_t *vlmeta)

Add a vl-metalayer to the Caterva array.

Parameters
  • ctx – The context to be used.

  • array – The array where the metalayer will be added.

  • name – The vl-metalayer to add.

Returns

An error code

int caterva_vlmeta_exists(caterva_ctx_t *ctx, caterva_array_t *array, const char *name, bool *exists)

Check if a vl-metalayer exists or not.

Parameters
  • ctx – The context to be used.

  • array – The array where the check will be done.

  • name – The name of the vl-metalayer to check.

  • exists – Pointer where the result will be stored.

Returns

An error code

int caterva_vlmeta_get(caterva_ctx_t *ctx, caterva_array_t *array, const char *name, caterva_metalayer_t *vlmeta)

Get a vl-metalayer from a Caterva array.

Warning

The contents of vlmeta are allocated inside the function. Therefore, they must be released with a free.

Parameters
  • ctx – The context to be used.

  • array – The array where the vl-metalayer will be added.

  • name – The vl-metalayer name.

  • vlmeta – Pointer to the metalayer where the data will be stored.

Returns

An error code

int caterva_vlmeta_update(caterva_ctx_t *ctx, caterva_array_t *array, caterva_metalayer_t *vlmeta)

Update a vl-metalayer content in a Caterva array.

Parameters
  • ctx – The context to be used.

  • array – The array where the vl-metalayer will be updated.

  • vlmeta – The vl-metalayer to update.

Returns

An error code