zarrs_ffi
C/C++ bindings for the zarrs rust crate
zarrs.h
Go to the documentation of this file.
1 #pragma once
2 
3 /* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
4 
5 #include <stdarg.h>
6 #include <stdbool.h>
7 #include <stddef.h>
8 #include <stdint.h>
9 #include <stdlib.h>
10 
11 #undef NDEBUG
12 #ifdef __cplusplus
13 #include <cassert>
14 #else // __cplusplus
15 #include <assert.h>
16 #endif // __cplusplus
17 
18 #define zarrs_assert(expr) assert(ZARRS_SUCCESS == expr)
19 
20 
25 #ifdef __cplusplus
26  : int32_t
27 #endif // __cplusplus
28  {
46 };
47 #ifndef __cplusplus
48 typedef int32_t ZarrsDataType;
49 #endif // __cplusplus
50 
52 #ifdef __cplusplus
53  : int32_t
54 #endif // __cplusplus
55  {
69 };
70 #ifndef __cplusplus
71 typedef int32_t ZarrsResult;
72 #endif // __cplusplus
73 
74 typedef struct ZarrsArray_T ZarrsArray_T;
75 
77 
78 typedef struct ZarrsStorage_T ZarrsStorage_T;
79 
83 typedef struct ZarrsArray_T *ZarrsArray;
84 
89 
93 typedef struct ZarrsStorage_T *ZarrsStorage;
94 
95 #ifdef __cplusplus
96 extern "C" {
97 #endif // __cplusplus
98 
107 ZarrsResult zarrsArrayGetAttributesString(ZarrsArray array, bool pretty, char **pAttributesString);
108 
121  size_t dimensionality,
122  uint64_t *pChunkGridShape);
123 
134  size_t dimensionality,
135  const uint64_t *pChunkIndices,
136  uint64_t *pChunkOrigin);
137 
148  size_t dimensionality,
149  const uint64_t *pChunkIndices,
150  uint64_t *pChunkShape);
151 
162  size_t dimensionality,
163  const uint64_t *pChunkIndices,
164  size_t *chunkSize);
165 
178  size_t dimensionality,
179  const uint64_t *pSubsetStart,
180  const uint64_t *pSubsetShape,
181  uint64_t *pChunksStart,
182  uint64_t *pChunksShape);
183 
194 
204 ZarrsResult zarrsArrayGetDimensionality(ZarrsArray array, size_t *dimensionality);
205 
216  size_t dimensionality,
217  uint64_t *pInnerChunkGridShape);
218 
230  size_t dimensionality,
231  bool *pIsSharded,
232  uint64_t *pInnerChunkShape);
233 
242 ZarrsResult zarrsArrayGetMetadataString(ZarrsArray array, bool pretty, char **pMetadataString);
243 
255  size_t dimensionality,
256  uint64_t *pShape);
257 
268  size_t dimensionality,
269  const uint64_t *pSubsetShape,
270  size_t *subsetSize);
271 
286  size_t dimensionality,
287  const uint64_t *pChunkIndices,
288  size_t chunkBytesCount,
289  uint8_t *pChunkBytes);
290 
305  ZarrsShardIndexCache cache,
306  size_t dimensionality,
307  const uint64_t *pChunkIndices,
308  size_t chunkBytesCount,
309  uint8_t *pChunkBytes);
310 
325  size_t dimensionality,
326  const uint64_t *pSubsetStart,
327  const uint64_t *pSubsetShape,
328  size_t subsetBytesCount,
329  uint8_t *pSubsetBytes);
330 
345  ZarrsShardIndexCache cache,
346  size_t dimensionality,
347  const uint64_t *pSubsetStart,
348  const uint64_t *pSubsetShape,
349  size_t subsetBytesCount,
350  uint8_t *pSubsetBytes);
351 
362  const char* attributes);
363 
378  size_t dimensionality,
379  const uint64_t *pChunkIndices,
380  size_t chunkBytesCount,
381  const uint8_t *pChunkBytes);
382 
393 
408  size_t dimensionality,
409  const uint64_t *pSubsetStart,
410  const uint64_t *pSubsetShape,
411  size_t subsetBytesCount,
412  const uint8_t *pSubsetBytes);
413 
424  const char* path,
425  const char* metadata,
426  ZarrsArray *pArray);
427 
438 
448 
459 
470 
481 
489 
495 char *zarrsLastError(void);
496 
505 ZarrsResult zarrsOpenArrayRW(ZarrsStorage storage, const char* path, ZarrsArray *pArray);
506 
512 uint32_t zarrsVersion(void);
513 
517 uint32_t zarrsVersionMajor(void);
518 
522 uint32_t zarrsVersionMinor(void);
523 
527 uint32_t zarrsVersionPatch(void);
528 
529 #ifdef __cplusplus
530 } // extern "C"
531 #endif // __cplusplus
ZarrsResult
Definition: zarrs.h:55
@ ZARRS_ERROR_INVALID_METADATA
Definition: zarrs.h:64
@ ZARRS_ERROR_UNKNOWN_INTERSECTING_CHUNKS
Definition: zarrs.h:67
@ ZARRS_ERROR_STORAGE
Definition: zarrs.h:58
@ ZARRS_SUCCESS
Definition: zarrs.h:56
@ ZARRS_ERROR_BUFFER_LENGTH
Definition: zarrs.h:60
@ ZARRS_ERROR_ARRAY
Definition: zarrs.h:59
@ ZARRS_ERROR_NODE_PATH
Definition: zarrs.h:62
@ ZARRS_ERROR_INVALID_INDICES
Definition: zarrs.h:61
@ ZARRS_ERROR_STORAGE_CAPABILITY
Definition: zarrs.h:65
@ ZARRS_ERROR_STORE_PREFIX
Definition: zarrs.h:63
@ ZARRS_ERROR_NULL_PTR
Definition: zarrs.h:57
@ ZARRS_ERROR_UNKNOWN_CHUNK_GRID_SHAPE
Definition: zarrs.h:66
@ ZARRS_ERROR_UNSUPPORTED_DATA_TYPE
Definition: zarrs.h:68
ZarrsResult zarrsOpenArrayRW(ZarrsStorage storage, const char *path, ZarrsArray *pArray)
uint32_t zarrsVersionPatch(void)
ZarrsResult zarrsArrayGetInnerChunkGridShape(ZarrsArray array, size_t dimensionality, uint64_t *pInnerChunkGridShape)
uint32_t zarrsVersionMinor(void)
struct ZarrsArray_T * ZarrsArray
Definition: zarrs.h:83
ZarrsResult zarrsArrayGetInnerChunkShape(ZarrsArray array, size_t dimensionality, bool *pIsSharded, uint64_t *pInnerChunkShape)
struct ZarrsStorage_T * ZarrsStorage
Definition: zarrs.h:93
ZarrsResult zarrsDestroyArray(ZarrsArray array)
ZarrsResult zarrsCreateShardIndexCache(ZarrsArray array, ZarrsShardIndexCache *pShardIndexCache)
ZarrsResult zarrsArrayRetrieveSubsetSharded(ZarrsArray array, ZarrsShardIndexCache cache, size_t dimensionality, const uint64_t *pSubsetStart, const uint64_t *pSubsetShape, size_t subsetBytesCount, uint8_t *pSubsetBytes)
ZarrsResult zarrsFreeString(char *string)
struct ZarrsShardIndexCache_T ZarrsShardIndexCache_T
Definition: zarrs.h:76
ZarrsResult zarrsArrayGetChunksInSubset(ZarrsArray array, size_t dimensionality, const uint64_t *pSubsetStart, const uint64_t *pSubsetShape, uint64_t *pChunksStart, uint64_t *pChunksShape)
ZarrsResult zarrsArrayRetrieveChunk(ZarrsArray array, size_t dimensionality, const uint64_t *pChunkIndices, size_t chunkBytesCount, uint8_t *pChunkBytes)
ZarrsResult zarrsArrayGetMetadataString(ZarrsArray array, bool pretty, char **pMetadataString)
ZarrsResult zarrsArrayGetChunkGridShape(ZarrsArray array, size_t dimensionality, uint64_t *pChunkGridShape)
ZarrsResult zarrsArrayGetDimensionality(ZarrsArray array, size_t *dimensionality)
ZarrsResult zarrsArrayRetrieveSubset(ZarrsArray array, size_t dimensionality, const uint64_t *pSubsetStart, const uint64_t *pSubsetShape, size_t subsetBytesCount, uint8_t *pSubsetBytes)
ZarrsResult zarrsArrayGetChunkShape(ZarrsArray array, size_t dimensionality, const uint64_t *pChunkIndices, uint64_t *pChunkShape)
char * zarrsLastError(void)
ZarrsResult zarrsArrayRetrieveInnerChunk(ZarrsArray array, ZarrsShardIndexCache cache, size_t dimensionality, const uint64_t *pChunkIndices, size_t chunkBytesCount, uint8_t *pChunkBytes)
ZarrsResult zarrsDestroyStorage(ZarrsStorage storage)
ZarrsResult zarrsArrayStoreMetadata(ZarrsArray array)
ZarrsResult zarrsArrayGetSubsetSize(ZarrsArray array, size_t dimensionality, const uint64_t *pSubsetShape, size_t *subsetSize)
ZarrsResult zarrsArrayGetShape(ZarrsArray array, size_t dimensionality, uint64_t *pShape)
ZarrsResult zarrsArrayGetChunkSize(ZarrsArray array, size_t dimensionality, const uint64_t *pChunkIndices, size_t *chunkSize)
struct ZarrsStorage_T ZarrsStorage_T
Definition: zarrs.h:78
ZarrsResult zarrsDestroyShardIndexCache(ZarrsShardIndexCache shardIndexCache)
ZarrsResult zarrsArrayStoreChunk(ZarrsArray array, size_t dimensionality, const uint64_t *pChunkIndices, size_t chunkBytesCount, const uint8_t *pChunkBytes)
uint32_t zarrsVersion(void)
ZarrsResult zarrsArraySetAttributes(ZarrsArray array, const char *attributes)
struct ZarrsArray_T ZarrsArray_T
Definition: zarrs.h:74
uint32_t zarrsVersionMajor(void)
ZarrsResult zarrsArrayStoreSubset(ZarrsArray array, size_t dimensionality, const uint64_t *pSubsetStart, const uint64_t *pSubsetShape, size_t subsetBytesCount, const uint8_t *pSubsetBytes)
ZarrsDataType
Definition: zarrs.h:28
@ ZARRS_BFLOAT16
Definition: zarrs.h:45
@ ZARRS_INT8
Definition: zarrs.h:31
@ ZARRS_UNDEFINED
Definition: zarrs.h:29
@ ZARRS_INT16
Definition: zarrs.h:32
@ ZARRS_UINT32
Definition: zarrs.h:37
@ ZARRS_COMPLEX128
Definition: zarrs.h:43
@ ZARRS_RAW_BITS
Definition: zarrs.h:44
@ ZARRS_INT32
Definition: zarrs.h:33
@ ZARRS_UINT8
Definition: zarrs.h:35
@ ZARRS_FLOAT16
Definition: zarrs.h:39
@ ZARRS_INT64
Definition: zarrs.h:34
@ ZARRS_FLOAT32
Definition: zarrs.h:40
@ ZARRS_UINT16
Definition: zarrs.h:36
@ ZARRS_FLOAT64
Definition: zarrs.h:41
@ ZARRS_BOOL
Definition: zarrs.h:30
@ ZARRS_COMPLEX64
Definition: zarrs.h:42
@ ZARRS_UINT64
Definition: zarrs.h:38
struct ZarrsShardIndexCache_T * ZarrsShardIndexCache
Definition: zarrs.h:88
ZarrsResult zarrsCreateStorageFilesystem(const char *path, ZarrsStorage *pStorage)
ZarrsResult zarrsArrayGetDataType(ZarrsArray array, ZarrsDataType *pDataType)
ZarrsResult zarrsArrayGetAttributesString(ZarrsArray array, bool pretty, char **pAttributesString)
ZarrsResult zarrsCreateArrayRW(ZarrsStorage storage, const char *path, const char *metadata, ZarrsArray *pArray)
ZarrsResult zarrsArrayGetChunkOrigin(ZarrsArray array, size_t dimensionality, const uint64_t *pChunkIndices, uint64_t *pChunkOrigin)