Low-level C API
Zarrs.LibZarrs is a thin wrapper around the C API of the zarrs_jl Rust library. It is internal and may change between releases; use the high-level API instead.
The module is generated by gen/generator.jl from deps/zarrs_jl/zarrs_jl.h, which is itself generated from the Rust sources with cbindgen. After changing an extern "C" function in deps/zarrs_jl/src/, regenerate both files with Julia 1.13 (the version CI uses; gen/Manifest.toml pins the generator's dependencies):
cargo install cbindgen --version "$(cat gen/cbindgen-version)" --locked
julia --project=gen -e 'using Pkg; Pkg.instantiate()'
julia --project=gen gen/generator.jlCI fails if the committed files do not match the regenerated output.
Zarrs.LibZarrs.zarrs_array_get_attributes — Method
zarrs_array_get_attributes(array, pretty)Prototype
ZarrsResult zarrsArrayGetAttributes(ArrayHandle *array, int32_t pretty, char **pAttributes);Zarrs.LibZarrs.zarrs_array_get_chunk_grid_shape — Method
zarrs_array_get_chunk_grid_shape(array, dimensionality, pChunkGridShape)Prototype
ZarrsResult zarrsArrayGetChunkGridShape(ArrayHandle *array, uintptr_t dimensionality, uint64_t *pChunkGridShape);Zarrs.LibZarrs.zarrs_array_get_chunk_origin — Method
zarrs_array_get_chunk_origin(array, dimensionality, pChunkIndices, pChunkOrigin)Prototype
ZarrsResult zarrsArrayGetChunkOrigin(ArrayHandle *array, uintptr_t dimensionality, const uint64_t *pChunkIndices, uint64_t *pChunkOrigin);Zarrs.LibZarrs.zarrs_array_get_chunk_shape — Method
zarrs_array_get_chunk_shape(array, dimensionality, pChunkIndices, pChunkShape)Prototype
ZarrsResult zarrsArrayGetChunkShape(ArrayHandle *array, uintptr_t dimensionality, const uint64_t *pChunkIndices, uint64_t *pChunkShape);Zarrs.LibZarrs.zarrs_array_get_chunk_size — Method
zarrs_array_get_chunk_size(array, dimensionality, pChunkIndices)Prototype
ZarrsResult zarrsArrayGetChunkSize(ArrayHandle *array, uintptr_t dimensionality, const uint64_t *pChunkIndices, uintptr_t *pChunkSize);Zarrs.LibZarrs.zarrs_array_get_data_type — Method
zarrs_array_get_data_type(array)Prototype
ZarrsResult zarrsArrayGetDataType(ArrayHandle *array, int32_t *pDataType);Zarrs.LibZarrs.zarrs_array_get_dimensionality — Method
zarrs_array_get_dimensionality(array)Prototype
ZarrsResult zarrsArrayGetDimensionality(ArrayHandle *array, uintptr_t *pDimensionality);Zarrs.LibZarrs.zarrs_array_get_metadata_string — Method
zarrs_array_get_metadata_string(array, pretty)Prototype
ZarrsResult zarrsArrayGetMetadataString(ArrayHandle *array, int32_t pretty, char **pMetadata);Zarrs.LibZarrs.zarrs_array_get_shape — Method
zarrs_array_get_shape(array, dimensionality, pShape)Prototype
ZarrsResult zarrsArrayGetShape(ArrayHandle *array, uintptr_t dimensionality, uint64_t *pShape);Zarrs.LibZarrs.zarrs_array_get_sub_chunk_shape — Method
zarrs_array_get_sub_chunk_shape(array, dimensionality, pIsSharded, pSubChunkShape)Prototype
ZarrsResult zarrsArrayGetSubChunkShape(ArrayHandle *array, uintptr_t dimensionality, int32_t *pIsSharded, uint64_t *pSubChunkShape);Zarrs.LibZarrs.zarrs_array_get_subset_size — Method
zarrs_array_get_subset_size(array, dimensionality, pSubsetShape)Prototype
ZarrsResult zarrsArrayGetSubsetSize(ArrayHandle *array, uintptr_t dimensionality, const uint64_t *pSubsetShape, uintptr_t *pSubsetSize);Zarrs.LibZarrs.zarrs_array_retrieve_chunk — Method
zarrs_array_retrieve_chunk(array, dimensionality, pChunkIndices, chunkBytesCount, pChunkBytes)Prototype
ZarrsResult zarrsArrayRetrieveChunk(ArrayHandle *array, uintptr_t dimensionality, const uint64_t *pChunkIndices, uintptr_t chunkBytesCount, uint8_t *pChunkBytes);Zarrs.LibZarrs.zarrs_array_retrieve_subset — Method
zarrs_array_retrieve_subset(array, dimensionality, pSubsetStart, pSubsetShape, subsetBytesCount, pSubsetBytes)Prototype
ZarrsResult zarrsArrayRetrieveSubset(ArrayHandle *array, uintptr_t dimensionality, const uint64_t *pSubsetStart, const uint64_t *pSubsetShape, uintptr_t subsetBytesCount, uint8_t *pSubsetBytes);Zarrs.LibZarrs.zarrs_array_set_attributes — Method
zarrs_array_set_attributes(array, attributes)Prototype
ZarrsResult zarrsArraySetAttributes(ArrayHandle *array, const char *attributes);Zarrs.LibZarrs.zarrs_array_store_chunk — Method
zarrs_array_store_chunk(array, dimensionality, pChunkIndices, chunkBytesCount, pChunkBytes)Prototype
ZarrsResult zarrsArrayStoreChunk(ArrayHandle *array, uintptr_t dimensionality, const uint64_t *pChunkIndices, uintptr_t chunkBytesCount, const uint8_t *pChunkBytes);Zarrs.LibZarrs.zarrs_array_store_metadata — Method
zarrs_array_store_metadata(array)Prototype
ZarrsResult zarrsArrayStoreMetadata(ArrayHandle *array);Zarrs.LibZarrs.zarrs_array_store_subset — Method
zarrs_array_store_subset(array, dimensionality, pSubsetStart, pSubsetShape, subsetBytesCount, pSubsetBytes)Prototype
ZarrsResult zarrsArrayStoreSubset(ArrayHandle *array, uintptr_t dimensionality, const uint64_t *pSubsetStart, const uint64_t *pSubsetShape, uintptr_t subsetBytesCount, const uint8_t *pSubsetBytes);Zarrs.LibZarrs.zarrs_create_array_rw — Method
zarrs_create_array_rw(storage, path, metadata_json)Prototype
ZarrsResult zarrsCreateArrayRW(StorageHandle *storage, const char *path, const char *metadata_json, ArrayHandle **pArray);Zarrs.LibZarrs.zarrs_create_group_rw — Method
zarrs_create_group_rw(storage, path, metadata_json)Prototype
ZarrsResult zarrsCreateGroupRW(StorageHandle *storage, const char *path, const char *metadata_json, GroupHandle **pGroup);Zarrs.LibZarrs.zarrs_create_storage_filesystem — Method
zarrs_create_storage_filesystem(path)Prototype
ZarrsResult zarrsCreateStorageFilesystem(const char *path, StorageHandle **pStorage);Zarrs.LibZarrs.zarrs_create_storage_gcs — Method
zarrs_create_storage_gcs(bucket, prefix, anonymous)Prototype
ZarrsResult zarrsCreateStorageGCS(const char *bucket, const char *prefix, int32_t anonymous, StorageHandle **pStorage);Zarrs.LibZarrs.zarrs_create_storage_http — Method
zarrs_create_storage_http(url)Prototype
ZarrsResult zarrsCreateStorageHTTP(const char *url, StorageHandle **pStorage);Zarrs.LibZarrs.zarrs_create_storage_s3 — Method
zarrs_create_storage_s3(bucket, prefix, region, endpoint_url, anonymous)Prototype
ZarrsResult zarrsCreateStorageS3(const char *bucket, const char *prefix, const char *region, const char *endpoint_url, int32_t anonymous, StorageHandle **pStorage);Zarrs.LibZarrs.zarrs_destroy_array — Method
zarrs_destroy_array(array)Prototype
ZarrsResult zarrsDestroyArray(ArrayHandle *array);Zarrs.LibZarrs.zarrs_destroy_group — Method
zarrs_destroy_group(group)Prototype
ZarrsResult zarrsDestroyGroup(GroupHandle *group);Zarrs.LibZarrs.zarrs_destroy_storage — Method
zarrs_destroy_storage(storage)Prototype
ZarrsResult zarrsDestroyStorage(StorageHandle *storage);Zarrs.LibZarrs.zarrs_free_string — Method
zarrs_free_string(s::Union{Cstring, Ptr{UInt8}})Prototype
void zarrsFreeString(char *s);Zarrs.LibZarrs.zarrs_group_get_attributes — Method
zarrs_group_get_attributes(group, pretty)Prototype
ZarrsResult zarrsGroupGetAttributes(GroupHandle *group, int32_t pretty, char **pAttributes);Zarrs.LibZarrs.zarrs_group_set_attributes — Method
zarrs_group_set_attributes(group, attributes)Prototype
ZarrsResult zarrsGroupSetAttributes(GroupHandle *group, const char *attributes);Zarrs.LibZarrs.zarrs_group_store_metadata — Method
zarrs_group_store_metadata(group)Prototype
ZarrsResult zarrsGroupStoreMetadata(GroupHandle *group);Zarrs.LibZarrs.zarrs_icechunk_azure_storage — Method
zarrs_icechunk_azure_storage(account, container, prefix, credential_type, credential_value)Prototype
ZarrsResult zarrsIcechunkAzureStorage(const char *account, const char *container, const char *prefix, int32_t credential_type, const char *credential_value, IcStorageHandle **pHandle);Zarrs.LibZarrs.zarrs_icechunk_destroy_repo — Method
zarrs_icechunk_destroy_repo(repo)Prototype
ZarrsResult zarrsIcechunkDestroyRepo(IcRepoHandle *repo);Zarrs.LibZarrs.zarrs_icechunk_destroy_session — Method
zarrs_icechunk_destroy_session(session)Prototype
ZarrsResult zarrsIcechunkDestroySession(IcSessionHandle *session);Zarrs.LibZarrs.zarrs_icechunk_destroy_storage — Method
zarrs_icechunk_destroy_storage(handle)Prototype
ZarrsResult zarrsIcechunkDestroyStorage(IcStorageHandle *handle);Zarrs.LibZarrs.zarrs_icechunk_gcs_storage — Method
zarrs_icechunk_gcs_storage(bucket, prefix, credential_type, credential_value)Prototype
ZarrsResult zarrsIcechunkGcsStorage(const char *bucket, const char *prefix, int32_t credential_type, const char *credential_value, IcStorageHandle **pHandle);Zarrs.LibZarrs.zarrs_icechunk_local_storage — Method
zarrs_icechunk_local_storage(path)Prototype
ZarrsResult zarrsIcechunkLocalStorage(const char *path, IcStorageHandle **pHandle);Zarrs.LibZarrs.zarrs_icechunk_memory_storage — Method
zarrs_icechunk_memory_storage()Prototype
ZarrsResult zarrsIcechunkMemoryStorage(IcStorageHandle **pHandle);Zarrs.LibZarrs.zarrs_icechunk_readonly_session — Method
zarrs_icechunk_readonly_session(repo, version_type, version_value)Create a readonly session. version_type: 0 = branch, 1 = tag, 2 = snapshot_id version_value: the branch name, tag name, or snapshot ID string
Prototype
ZarrsResult zarrsIcechunkReadonlySession(IcRepoHandle *repo, int32_t version_type, const char *version_value, IcSessionHandle **pSession);Zarrs.LibZarrs.zarrs_icechunk_repo_create — Method
zarrs_icechunk_repo_create(ic_storage)Prototype
ZarrsResult zarrsIcechunkRepoCreate(IcStorageHandle *ic_storage, IcRepoHandle **pRepo);Zarrs.LibZarrs.zarrs_icechunk_repo_create_branch — Method
zarrs_icechunk_repo_create_branch(repo, name, snapshot_id_str)Prototype
ZarrsResult zarrsIcechunkRepoCreateBranch(IcRepoHandle *repo, const char *name, const char *snapshot_id_str, char **pResult);Zarrs.LibZarrs.zarrs_icechunk_repo_create_tag — Method
zarrs_icechunk_repo_create_tag(repo, name, snapshot_id_str)Prototype
ZarrsResult zarrsIcechunkRepoCreateTag(IcRepoHandle *repo, const char *name, const char *snapshot_id_str, char **pResult);Zarrs.LibZarrs.zarrs_icechunk_repo_delete_branch — Method
zarrs_icechunk_repo_delete_branch(repo, name)Prototype
ZarrsResult zarrsIcechunkRepoDeleteBranch(IcRepoHandle *repo, const char *name);Zarrs.LibZarrs.zarrs_icechunk_repo_delete_tag — Method
zarrs_icechunk_repo_delete_tag(repo, name)Prototype
ZarrsResult zarrsIcechunkRepoDeleteTag(IcRepoHandle *repo, const char *name);Zarrs.LibZarrs.zarrs_icechunk_repo_list_branches — Method
zarrs_icechunk_repo_list_branches(repo)Prototype
ZarrsResult zarrsIcechunkRepoListBranches(IcRepoHandle *repo, char **pJson);Zarrs.LibZarrs.zarrs_icechunk_repo_list_tags — Method
zarrs_icechunk_repo_list_tags(repo)Prototype
ZarrsResult zarrsIcechunkRepoListTags(IcRepoHandle *repo, char **pJson);Zarrs.LibZarrs.zarrs_icechunk_repo_lookup_branch — Method
zarrs_icechunk_repo_lookup_branch(repo, name)Prototype
ZarrsResult zarrsIcechunkRepoLookupBranch(IcRepoHandle *repo, const char *name, char **pSnapshotId);Zarrs.LibZarrs.zarrs_icechunk_repo_lookup_tag — Method
zarrs_icechunk_repo_lookup_tag(repo, name)Prototype
ZarrsResult zarrsIcechunkRepoLookupTag(IcRepoHandle *repo, const char *name, char **pSnapshotId);Zarrs.LibZarrs.zarrs_icechunk_repo_open — Method
zarrs_icechunk_repo_open(ic_storage)Prototype
ZarrsResult zarrsIcechunkRepoOpen(IcStorageHandle *ic_storage, IcRepoHandle **pRepo);Zarrs.LibZarrs.zarrs_icechunk_repo_open_or_create — Method
zarrs_icechunk_repo_open_or_create(ic_storage)Prototype
ZarrsResult zarrsIcechunkRepoOpenOrCreate(IcStorageHandle *ic_storage, IcRepoHandle **pRepo);Zarrs.LibZarrs.zarrs_icechunk_s3_storage — Method
zarrs_icechunk_s3_storage(bucket, prefix, region, anonymous, endpoint_url, allow_http, access_key_id, secret_access_key, session_token)Prototype
ZarrsResult zarrsIcechunkS3Storage(const char *bucket, const char *prefix, const char *region, int32_t anonymous, const char *endpoint_url, int32_t allow_http, const char *access_key_id, const char *secret_access_key, const char *session_token, IcStorageHandle **pHandle);Zarrs.LibZarrs.zarrs_icechunk_session_commit — Method
zarrs_icechunk_session_commit(session, message)Commit a writable session with a message, returning a snapshot ID string.
Prototype
ZarrsResult zarrsIcechunkSessionCommit(IcSessionHandle *session, const char *message, char **pSnapshotId);Zarrs.LibZarrs.zarrs_icechunk_session_get_storage — Method
zarrs_icechunk_session_get_storage(session)Create a zarrs-compatible StorageHandle from an Icechunk session. This bridges the Icechunk Store to the zarrs sync storage interface.
Prototype
ZarrsResult zarrsIcechunkSessionGetStorage(IcSessionHandle *session, StorageHandle **pStorage);Zarrs.LibZarrs.zarrs_icechunk_session_has_changes — Method
zarrs_icechunk_session_has_changes(session)Check if a session has uncommitted changes.
Prototype
ZarrsResult zarrsIcechunkSessionHasChanges(IcSessionHandle *session, int32_t *pHasChanges);Zarrs.LibZarrs.zarrs_icechunk_session_read_only — Method
zarrs_icechunk_session_read_only(session)Check if a session is read-only.
Prototype
ZarrsResult zarrsIcechunkSessionReadOnly(IcSessionHandle *session, int32_t *pReadOnly);Zarrs.LibZarrs.zarrs_icechunk_writable_session — Method
zarrs_icechunk_writable_session(repo, branch)Create a writable session on a branch.
Prototype
ZarrsResult zarrsIcechunkWritableSession(IcRepoHandle *repo, const char *branch, IcSessionHandle **pSession);Zarrs.LibZarrs.zarrs_jl_array_erase_chunk — Method
zarrs_jl_array_erase_chunk(storage, path, ndim, indices)Erase a specific chunk from an array.
Prototype
ZarrsResult zarrsJlArrayEraseChunk(StorageHandle *storage, const char *path, uintptr_t ndim, const uint64_t *indices);Zarrs.LibZarrs.zarrs_jl_array_resize — Method
zarrs_jl_array_resize(storage, path, ndim, new_shape)Resize an array.
Prototype
ZarrsResult zarrsJlArrayResize(StorageHandle *storage, const char *path, uintptr_t ndim, const uint64_t *new_shape);Zarrs.LibZarrs.zarrs_jl_storage_get — Method
zarrs_jl_storage_get(storage, key)Read a single key from storage, returning its bytes as a C string. Returns ZARRS_SUCCESS with null output if the key is not found.
Prototype
ZarrsResult zarrsJlStorageGet(StorageHandle *storage, const char *key, char **data_out);Zarrs.LibZarrs.zarrs_jl_storage_list_dir — Method
zarrs_jl_storage_list_dir(storage, path)List directory children, returning a JSON array of strings.
Prototype
ZarrsResult zarrsJlStorageListDir(StorageHandle *storage, const char *path, char **json_out);Zarrs.LibZarrs.zarrs_last_error — Method
zarrs_last_error()Prototype
char *zarrsLastError(void);Zarrs.LibZarrs.zarrs_open_array_rw — Method
zarrs_open_array_rw(storage, path)Prototype
ZarrsResult zarrsOpenArrayRW(StorageHandle *storage, const char *path, ArrayHandle **pArray);Zarrs.LibZarrs.zarrs_open_group_rw — Method
zarrs_open_group_rw(storage, path)Prototype
ZarrsResult zarrsOpenGroupRW(StorageHandle *storage, const char *path, GroupHandle **pGroup);Zarrs.LibZarrs.zarrs_version — Method
zarrs_version()Prototype
char *zarrsVersion(void);