ESDM
Middleware for Earth System Data
kdsa.h
1 /*
2  * This file is a primitive stub for the KDSA API to allow testing of the KDSA backend without having the proprietary XPD library.
3  */
4 #ifndef __XPD_DUMMY_H
5 #define __XPD_DUMMY_H
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 #include <stdint.h>
11 
12 #define KDSA_FLAGS_HANDLE_USE_EVENT 1L<<0
13 #define KDSA_FLAGS_HANDLE_IO_NOSPIN 1L<<1
14 
15 typedef uint64_t kdsa_vol_offset_t;
16 typedef uint64_t kdsa_size_t;
17 typedef int* kdsa_vol_handle_t;
18 
19 int kdsa_write_unregistered(kdsa_vol_handle_t handle, kdsa_vol_offset_t off, void* buf, kdsa_size_t bytes);
20 int kdsa_read_unregistered(kdsa_vol_handle_t handle, kdsa_vol_offset_t off, void* buf, kdsa_size_t bytes);
21 int kdsa_compare_and_swap(kdsa_vol_handle_t handle, kdsa_vol_offset_t off, uint64_t compare, uint64_t swap, uint64_t *out_res);
22 int kdsa_get_volume_size(kdsa_vol_handle_t handle, kdsa_size_t *out_size);
23 
24 int kdsa_connect(char* connection_string, uint32_t flags, kdsa_vol_handle_t *out_handle);
25 int kdsa_disconnect(kdsa_vol_handle_t handle);
26 
27 #ifdef __cplusplus
28 }
29 #endif
30 
31 #endif