21
21
22
22
// Write an array to a dataset / file
23
23
// Returns 0 on success, nonzero on error.
24
- int bsp_write_array (hid_t f , const char * label , bsp_array_t array ,
25
- int compression_level ) {
24
+ static inline int bsp_write_array (hid_t f , const char * label , bsp_array_t array ,
25
+ int compression_level ) {
26
26
if (array .type == BSP_COMPLEX_FLOAT32 || array .type == BSP_COMPLEX_FLOAT64 ) {
27
27
array = bsp_complex_array_to_fp (array );
28
28
}
@@ -76,8 +76,8 @@ int bsp_write_array(hid_t f, const char* label, bsp_array_t array,
76
76
}
77
77
78
78
#if __STDC_VERSION__ >= 201112L
79
- bsp_array_t bsp_read_array_parallel (hid_t f , const char * label ,
80
- int num_threads ) {
79
+ static inline bsp_array_t bsp_read_array_parallel (hid_t f , const char * label ,
80
+ int num_threads ) {
81
81
hid_t dset = H5Dopen2 (f , label , H5P_DEFAULT );
82
82
83
83
if (dset == H5I_INVALID_HID ) {
@@ -173,7 +173,7 @@ bsp_array_t bsp_read_array_parallel(hid_t f, const char* label,
173
173
}
174
174
#endif
175
175
176
- bsp_array_t bsp_read_array (hid_t f , const char * label ) {
176
+ static inline bsp_array_t bsp_read_array (hid_t f , const char * label ) {
177
177
hid_t dset = H5Dopen2 (f , label , H5P_DEFAULT );
178
178
179
179
if (dset == H5I_INVALID_HID ) {
@@ -212,7 +212,8 @@ bsp_array_t bsp_read_array(hid_t f, const char* label) {
212
212
return array ;
213
213
}
214
214
215
- void bsp_write_attribute (hid_t f , const char * label , const char * string ) {
215
+ static inline void bsp_write_attribute (hid_t f , const char * label ,
216
+ const char * string ) {
216
217
hid_t strtype = H5Tcopy (H5T_C_S1 );
217
218
H5Tset_size (strtype , strlen (string ));
218
219
H5Tset_cset (strtype , H5T_CSET_UTF8 );
@@ -228,7 +229,7 @@ void bsp_write_attribute(hid_t f, const char* label, const char* string) {
228
229
H5Sclose (dataspace );
229
230
}
230
231
231
- char * bsp_read_attribute (hid_t f , const char * label ) {
232
+ static inline char * bsp_read_attribute (hid_t f , const char * label ) {
232
233
hid_t attribute = H5Aopen (f , label , H5P_DEFAULT );
233
234
hid_t strtype = H5Aget_type (attribute );
234
235
0 commit comments