Skip to content

Commit

Permalink
Rename zarrsCreateArrayRWWithMetadata to zarrsCreateArrayRW and `…
Browse files Browse the repository at this point in the history
…zarrsCreateArrayRW` to `zarrsOpenArrayRW`
  • Loading branch information
LDeakin committed Jun 23, 2024
1 parent f9384e2 commit 625cbb8
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- Make `cbindgen` dependency optional
- **Breaking**: Rename `zarrsCreateArrayRWWithMetadata` to `zarrsCreateArrayRW` and `zarrsCreateArrayRW` to `zarrsOpenArrayRW`

## [0.6.2] - 2024-04-20

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "zarrs_ffi"
description = "FFI bindings for the zarrs crate"
version = "0.6.2"
version = "0.7.0"
authors = ["Lachlan Deakin <ljdgit@gmail.com>"]
edition = "2021"
rust-version = "1.71"
Expand Down
2 changes: 1 addition & 1 deletion examples/array_write_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int main() {
assert(storage);

ZarrsArray array = nullptr;
zarrs_assert(zarrsCreateArrayRWWithMetadata(storage, "/array", metadata, &array));
zarrs_assert(zarrsCreateArrayRW(storage, "/array", metadata, &array));
assert(array);

size_t dimensionality;
Expand Down
4 changes: 2 additions & 2 deletions src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub type ZarrsArray = *mut ZarrsArray_T;
/// # Safety
/// `pArray` must be a valid pointer to a `ZarrsArray` handle.
#[no_mangle]
pub unsafe extern "C" fn zarrsCreateArrayRW(
pub unsafe extern "C" fn zarrsOpenArrayRW(
storage: ZarrsStorage,
path: FfiStr,
pArray: *mut ZarrsArray,
Expand Down Expand Up @@ -107,7 +107,7 @@ pub unsafe extern "C" fn zarrsCreateArrayRW(
/// # Safety
/// `pArray` must be a valid pointer to a `ZarrsArray` handle.
#[no_mangle]
pub unsafe extern "C" fn zarrsCreateArrayRWWithMetadata(
pub unsafe extern "C" fn zarrsCreateArrayRW(
storage: ZarrsStorage,
path: FfiStr,
metadata: FfiStr,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub use array::{
zarrsArrayGetChunkGridShape, zarrsArrayGetChunkOrigin, zarrsArrayGetChunkShape,
zarrsArrayGetChunkSize, zarrsArrayGetChunksInSubset, zarrsArrayGetDataType,
zarrsArrayGetDimensionality, zarrsArrayGetShape, zarrsArrayGetSubsetSize, zarrsCreateArrayRW,
zarrsCreateArrayRWWithMetadata, zarrsDestroyArray, ZarrsArray,
zarrsDestroyArray, zarrsOpenArrayRW, ZarrsArray,
};
pub use storage::{zarrsCreateStorageFilesystem, zarrsDestroyStorage, ZarrsStorage};
pub use version::{zarrsVersion, zarrsVersionMajor, zarrsVersionMinor, zarrsVersionPatch};
Expand Down
2 changes: 1 addition & 1 deletion tests/array_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int main() {
assert(storage);

ZarrsArray array = nullptr;
zarrs_assert(zarrsCreateArrayRW(storage, "/array", &array));
zarrs_assert(zarrsOpenArrayRW(storage, "/array", &array));
assert(array);

// Update a subset
Expand Down
28 changes: 14 additions & 14 deletions zarrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,16 +302,6 @@ ZarrsResult zarrsArrayStoreSubset(ZarrsArray array,
size_t subsetBytesCount,
const uint8_t *pSubsetBytes);

/**
* Create a handle to an existing array (read/write capability).
*
* `pArray` is a pointer to a handle in which the created `ZarrsArray` is returned.
*
* # Safety
* `pArray` must be a valid pointer to a `ZarrsArray` handle.
*/
ZarrsResult zarrsCreateArrayRW(ZarrsStorage storage, const char* path, ZarrsArray *pArray);

/**
* Create a handle to a new array (read/write capability).
*
Expand All @@ -321,10 +311,10 @@ ZarrsResult zarrsCreateArrayRW(ZarrsStorage storage, const char* path, ZarrsArra
* # Safety
* `pArray` must be a valid pointer to a `ZarrsArray` handle.
*/
ZarrsResult zarrsCreateArrayRWWithMetadata(ZarrsStorage storage,
const char* path,
const char* metadata,
ZarrsArray *pArray);
ZarrsResult zarrsCreateArrayRW(ZarrsStorage storage,
const char* path,
const char* metadata,
ZarrsArray *pArray);

/**
* Create a storage handle to a filesystem store.
Expand Down Expand Up @@ -363,6 +353,16 @@ ZarrsResult zarrsDestroyStorage(ZarrsStorage storage);
*/
const char *zarrsLastError(void);

/**
* Create a handle to an existing array (read/write capability).
*
* `pArray` is a pointer to a handle in which the created `ZarrsArray` is returned.
*
* # Safety
* `pArray` must be a valid pointer to a `ZarrsArray` handle.
*/
ZarrsResult zarrsOpenArrayRW(ZarrsStorage storage, const char* path, ZarrsArray *pArray);

/**
* Get the zarrs version.
*
Expand Down

0 comments on commit 625cbb8

Please sign in to comment.