Commit b880bd39 authored by gsell's avatar gsell
Browse files

C-API:

- use new H5hut type enumeration, not HDF5 types
parent cd2c9031
...@@ -49,7 +49,9 @@ H5BlockGetNumFieldAttribs ( ...@@ -49,7 +49,9 @@ H5BlockGetNumFieldAttribs (
H5_API_ENTER (h5_ssize_t, H5_API_ENTER (h5_ssize_t,
"f=%p, field_name='%s'", "f=%p, field_name='%s'",
(h5_file_p)f, field_name); (h5_file_p)f, field_name);
H5_API_RETURN (h5b_get_num_field_attribs (f, field_name)); H5_API_RETURN (
h5b_get_num_field_attribs (
f, field_name));
} }
/** /**
...@@ -187,13 +189,14 @@ H5Block3dSetFieldOrigin ( ...@@ -187,13 +189,14 @@ H5Block3dSetFieldOrigin (
(h5_file_p)f, field_name, (h5_file_p)f, field_name,
x_origin, y_origin, z_origin); x_origin, y_origin, z_origin);
h5_float64_t origin[3] = { x_origin, y_origin, z_origin }; h5_float64_t origin[3] = { x_origin, y_origin, z_origin };
H5_API_RETURN (h5b_write_field_attrib ( H5_API_RETURN (
f, h5b_write_field_attrib (
field_name, f,
H5BLOCK_FIELD_ORIGIN_NAME, field_name,
(hid_t)H5_FLOAT64, H5BLOCK_FIELD_ORIGIN_NAME,
origin, H5_FLOAT64_T,
3)); origin,
3));
} }
/** /**
...@@ -219,7 +222,7 @@ H5Block3dGetFieldOrigin ( ...@@ -219,7 +222,7 @@ H5Block3dGetFieldOrigin (
f, f,
field_name, field_name,
H5BLOCK_FIELD_ORIGIN_NAME, H5BLOCK_FIELD_ORIGIN_NAME,
H5_FLOAT64, H5_FLOAT64_T,
origin)); origin));
*x_origin = origin[0]; *x_origin = origin[0];
...@@ -249,13 +252,14 @@ H5Block3dSetFieldSpacing ( ...@@ -249,13 +252,14 @@ H5Block3dSetFieldSpacing (
(h5_file_p)f, field_name, (h5_file_p)f, field_name,
x_spacing, y_spacing, z_spacing); x_spacing, y_spacing, z_spacing);
h5_float64_t spacing[3] = { x_spacing, y_spacing, z_spacing }; h5_float64_t spacing[3] = { x_spacing, y_spacing, z_spacing };
H5_API_RETURN (h5b_write_field_attrib ( H5_API_RETURN (
f, h5b_write_field_attrib (
field_name, f,
H5BLOCK_FIELD_SPACING_NAME, field_name,
(hid_t)H5_FLOAT64, H5BLOCK_FIELD_SPACING_NAME,
spacing, H5_FLOAT64_T,
3)); spacing,
3));
} }
/** /**
...@@ -281,7 +285,7 @@ H5Block3dGetFieldSpacing ( ...@@ -281,7 +285,7 @@ H5Block3dGetFieldSpacing (
f, f,
field_name, field_name,
H5BLOCK_FIELD_SPACING_NAME, H5BLOCK_FIELD_SPACING_NAME,
H5_FLOAT64, H5_FLOAT64_T,
spacing)); spacing));
*x_spacing = spacing[0]; *x_spacing = spacing[0];
*y_spacing = spacing[1]; *y_spacing = spacing[1];
...@@ -341,9 +345,10 @@ H5Block3dSetFieldXCoords ( ...@@ -341,9 +345,10 @@ H5Block3dSetFieldXCoords (
(h5_file_p)f, (h5_file_p)f,
field_name, field_name,
coords, (long long unsigned)n_coords); coords, (long long unsigned)n_coords);
H5_API_RETURN (h5b_set_3d_field_coords ( H5_API_RETURN (
f, 0, field_name, H5BLOCK_FIELD_XCOORD_NAME, h5b_set_3d_field_coords (
coords, n_coords)); f, 0, field_name, H5BLOCK_FIELD_XCOORD_NAME,
coords, n_coords));
} }
static inline h5_err_t static inline h5_err_t
...@@ -360,11 +365,12 @@ H5Block3dSetFieldYCoords ( ...@@ -360,11 +365,12 @@ H5Block3dSetFieldYCoords (
(h5_file_p)f, (h5_file_p)f,
field_name, field_name,
coords, (long long unsigned)n_coords); coords, (long long unsigned)n_coords);
H5_API_RETURN (h5b_set_3d_field_coords ( H5_API_RETURN (
f, 1, field_name, H5BLOCK_FIELD_YCOORD_NAME, h5b_set_3d_field_coords (
coords, n_coords)); f, 1, field_name, H5BLOCK_FIELD_YCOORD_NAME,
coords, n_coords));
} }
static inline h5_err_t static inline h5_err_t
H5Block3dSetFieldZCoords ( H5Block3dSetFieldZCoords (
const h5_file_t f, const h5_file_t f,
...@@ -379,9 +385,10 @@ H5Block3dSetFieldZCoords ( ...@@ -379,9 +385,10 @@ H5Block3dSetFieldZCoords (
(h5_file_p)f, (h5_file_p)f,
field_name, field_name,
coords, (long long unsigned)n_coords); coords, (long long unsigned)n_coords);
H5_API_RETURN (h5b_set_3d_field_coords ( H5_API_RETURN (
f, 2, field_name, H5BLOCK_FIELD_ZCOORD_NAME, h5b_set_3d_field_coords (
coords, n_coords)); f, 2, field_name, H5BLOCK_FIELD_ZCOORD_NAME,
coords, n_coords));
} }
/** /**
...@@ -436,9 +443,10 @@ H5Block3dGetFieldXCoords ( ...@@ -436,9 +443,10 @@ H5Block3dGetFieldXCoords (
(h5_file_p)f, (h5_file_p)f,
field_name, field_name,
coords, (long long unsigned)n_coords); coords, (long long unsigned)n_coords);
H5_API_RETURN (h5b_get_3d_field_coords ( H5_API_RETURN (
f, 0, field_name, H5BLOCK_FIELD_XCOORD_NAME, h5b_get_3d_field_coords (
coords, n_coords)); f, 0, field_name, H5BLOCK_FIELD_XCOORD_NAME,
coords, n_coords));
} }
static inline h5_err_t static inline h5_err_t
...@@ -455,9 +463,10 @@ H5Block3dGetFieldYCoords ( ...@@ -455,9 +463,10 @@ H5Block3dGetFieldYCoords (
(h5_file_p)f, (h5_file_p)f,
field_name, field_name,
coords, (long long unsigned)n_coords); coords, (long long unsigned)n_coords);
H5_API_RETURN (h5b_get_3d_field_coords ( H5_API_RETURN (
f, 1, field_name, H5BLOCK_FIELD_YCOORD_NAME, h5b_get_3d_field_coords (
coords, n_coords)); f, 1, field_name, H5BLOCK_FIELD_YCOORD_NAME,
coords, n_coords));
} }
static inline h5_err_t static inline h5_err_t
...@@ -474,9 +483,10 @@ H5Block3dGetFieldZCoords ( ...@@ -474,9 +483,10 @@ H5Block3dGetFieldZCoords (
(h5_file_p)f, (h5_file_p)f,
field_name, field_name,
coords, (long long unsigned)n_coords); coords, (long long unsigned)n_coords);
H5_API_RETURN (h5b_get_3d_field_coords ( H5_API_RETURN (
f, 2, field_name, H5BLOCK_FIELD_ZCOORD_NAME, h5b_get_3d_field_coords (
coords, n_coords)); f, 2, field_name, H5BLOCK_FIELD_ZCOORD_NAME,
coords, n_coords));
} }
/* /*
...@@ -572,7 +582,7 @@ H5BlockWriteFieldAttribString ( ...@@ -572,7 +582,7 @@ H5BlockWriteFieldAttribString (
f, f,
field_name, field_name,
attrib_name, attrib_name,
H5T_NATIVE_CHAR, H5_STRING_T,
buffer, buffer,
strlen(buffer) + 1)); strlen(buffer) + 1));
} }
...@@ -590,13 +600,14 @@ H5BlockWriteFieldAttribFloat64 ( ...@@ -590,13 +600,14 @@ H5BlockWriteFieldAttribFloat64 (
"f=%p, field_name='%s', attrib_name='%s', " "f=%p, field_name='%s', attrib_name='%s', "
"buffer=%p, nelems=%lld", "buffer=%p, nelems=%lld",
(h5_file_p)f, field_name, attrib_name, buffer, (long long)nelems); (h5_file_p)f, field_name, attrib_name, buffer, (long long)nelems);
H5_API_RETURN (h5b_write_field_attrib ( H5_API_RETURN (
f, h5b_write_field_attrib (
field_name, f,
attrib_name, field_name,
H5T_NATIVE_DOUBLE, attrib_name,
buffer, H5_FLOAT64_T,
nelems )); buffer,
nelems));
} }
static inline h5_err_t static inline h5_err_t
...@@ -612,13 +623,14 @@ H5BlockWriteFieldAttribFloat32 ( ...@@ -612,13 +623,14 @@ H5BlockWriteFieldAttribFloat32 (
"f=%p, field_name='%s', attrib_name='%s', " "f=%p, field_name='%s', attrib_name='%s', "
"buffer=%p, nelems=%lld", "buffer=%p, nelems=%lld",
(h5_file_p)f, field_name, attrib_name, buffer, (long long)nelems); (h5_file_p)f, field_name, attrib_name, buffer, (long long)nelems);
H5_API_RETURN (h5b_write_field_attrib ( H5_API_RETURN (
f, h5b_write_field_attrib (
field_name, f,
attrib_name, field_name,
H5T_NATIVE_FLOAT, attrib_name,
buffer, H5_FLOAT32_T,
nelems )); buffer,
nelems));
} }
static inline h5_err_t static inline h5_err_t
...@@ -633,13 +645,14 @@ H5BlockWriteFieldAttribInt64 ( ...@@ -633,13 +645,14 @@ H5BlockWriteFieldAttribInt64 (
H5_API_ENTER (h5_err_t, H5_API_ENTER (h5_err_t,
"f=%p, field_name='%s', attrib_name='%s', buffer=%p, nelems=%lld", "f=%p, field_name='%s', attrib_name='%s', buffer=%p, nelems=%lld",
(h5_file_p)f, field_name, attrib_name, buffer, (long long)nelems); (h5_file_p)f, field_name, attrib_name, buffer, (long long)nelems);
H5_API_RETURN (h5b_write_field_attrib ( H5_API_RETURN (
f, h5b_write_field_attrib (
field_name, f,
attrib_name, field_name,
H5T_NATIVE_INT64, attrib_name,
buffer, H5_INT64_T,
nelems )); buffer,
nelems));
} }
static inline h5_err_t static inline h5_err_t
...@@ -655,13 +668,14 @@ H5BlockWriteFieldAttribInt32 ( ...@@ -655,13 +668,14 @@ H5BlockWriteFieldAttribInt32 (
"f=%p, field_name='%s', attrib_name='%s', " "f=%p, field_name='%s', attrib_name='%s', "
"buffer=%p, nelems=%lld", "buffer=%p, nelems=%lld",
(h5_file_p)f, field_name, attrib_name, buffer, (long long)nelems); (h5_file_p)f, field_name, attrib_name, buffer, (long long)nelems);
H5_API_RETURN (h5b_write_field_attrib ( H5_API_RETURN (
f, h5b_write_field_attrib (
field_name, f,
attrib_name, field_name,
H5T_NATIVE_INT32, attrib_name,
buffer, H5_INT32_T,
nelems )); buffer,
nelems));
} }
/* /*
...@@ -750,7 +764,7 @@ H5BlockReadFieldAttribString ( ...@@ -750,7 +764,7 @@ H5BlockReadFieldAttribString (
f, f,
field_name, field_name,
attrib_name, attrib_name,
H5_STRING, H5_STRING_T,
(void*)buffer)); (void*)buffer));
} }
...@@ -765,12 +779,13 @@ H5BlockReadFieldAttribFloat64 ( ...@@ -765,12 +779,13 @@ H5BlockReadFieldAttribFloat64 (
H5_API_ENTER (h5_err_t, H5_API_ENTER (h5_err_t,
"f=%p, field_name='%s', attrib_name='%s', buffer=%p", "f=%p, field_name='%s', attrib_name='%s', buffer=%p",
(h5_file_p)f, field_name, attrib_name, buffer); (h5_file_p)f, field_name, attrib_name, buffer);
H5_API_RETURN (h5b_read_field_attrib ( H5_API_RETURN (
f, h5b_read_field_attrib (
field_name, f,
attrib_name, field_name,
H5T_NATIVE_DOUBLE, attrib_name,
(void*)buffer )); H5_FLOAT64_T,
(void*)buffer));
} }
static inline h5_err_t static inline h5_err_t
...@@ -784,12 +799,13 @@ H5BlockReadFieldAttribFloat32 ( ...@@ -784,12 +799,13 @@ H5BlockReadFieldAttribFloat32 (
H5_API_ENTER (h5_err_t, H5_API_ENTER (h5_err_t,
"f=%p, field_name='%s', attrib_name='%s', buffer=%p", "f=%p, field_name='%s', attrib_name='%s', buffer=%p",
(h5_file_p)f, field_name, attrib_name, buffer); (h5_file_p)f, field_name, attrib_name, buffer);
H5_API_RETURN (h5b_read_field_attrib ( H5_API_RETURN (
f, h5b_read_field_attrib (
field_name, f,
attrib_name, field_name,
H5T_NATIVE_FLOAT, attrib_name,
buffer )); H5_FLOAT32_T,
buffer));
} }
static inline h5_err_t static inline h5_err_t
...@@ -803,12 +819,13 @@ H5BlockReadFieldAttribInt64 ( ...@@ -803,12 +819,13 @@ H5BlockReadFieldAttribInt64 (
H5_API_ENTER (h5_err_t, H5_API_ENTER (h5_err_t,
"f=%p, field_name='%s', attrib_name='%s', buffer=%p", "f=%p, field_name='%s', attrib_name='%s', buffer=%p",
(h5_file_p)f, field_name, attrib_name, buffer); (h5_file_p)f, field_name, attrib_name, buffer);
H5_API_RETURN (h5b_read_field_attrib ( H5_API_RETURN (
f, h5b_read_field_attrib (
field_name, f,
attrib_name, field_name,
H5T_NATIVE_INT64, attrib_name,
buffer )); H5_INT64_T,
buffer));
} }
static inline h5_err_t static inline h5_err_t
...@@ -821,12 +838,13 @@ H5BlockReadFieldAttribInt32 ( ...@@ -821,12 +838,13 @@ H5BlockReadFieldAttribInt32 (
H5_API_ENTER (h5_err_t, H5_API_ENTER (h5_err_t,
"f=%p, field_name='%s', attrib_name='%s', buffer=%p", "f=%p, field_name='%s', attrib_name='%s', buffer=%p",
(h5_file_p)f, field_name, attrib_name, buffer); (h5_file_p)f, field_name, attrib_name, buffer);
H5_API_RETURN (h5b_read_field_attrib ( H5_API_RETURN (
f, h5b_read_field_attrib (
field_name, f,
attrib_name, field_name,
H5T_NATIVE_INT32, attrib_name,
(void*)buffer )); H5_INT32_T,
(void*)buffer));
} }
///< @} ///< @}
......
...@@ -92,7 +92,8 @@ H5Block3dWriteScalarFieldFloat64 ( ...@@ -92,7 +92,8 @@ H5Block3dWriteScalarFieldFloat64 (
(h5_file_p)f, name, buffer); (h5_file_p)f, name, buffer);
H5_API_RETURN ( H5_API_RETURN (
h5b_write_scalar_data ( h5b_write_scalar_data (
f, name, (void*)buffer, H5T_NATIVE_DOUBLE )); f, name, (void*)buffer,
H5_FLOAT64_T));
} }
static inline h5_err_t static inline h5_err_t
...@@ -107,7 +108,8 @@ H5Block3dWriteScalarFieldFloat32 ( ...@@ -107,7 +108,8 @@ H5Block3dWriteScalarFieldFloat32 (
(h5_file_p)f, name, buffer); (h5_file_p)f, name, buffer);
H5_API_RETURN ( H5_API_RETURN (
h5b_write_scalar_data ( h5b_write_scalar_data (
f, name, buffer, H5T_NATIVE_FLOAT )); f, name, buffer,
H5_FLOAT32_T));
} }
static inline h5_err_t static inline h5_err_t
...@@ -122,7 +124,7 @@ H5Block3dWriteScalarFieldInt64 ( ...@@ -122,7 +124,7 @@ H5Block3dWriteScalarFieldInt64 (
(h5_file_p)f, name, buffer); (h5_file_p)f, name, buffer);
H5_API_RETURN ( H5_API_RETURN (
h5b_write_scalar_data ( h5b_write_scalar_data (
f, name, buffer, H5T_NATIVE_INT64 )); f, name, buffer, H5_INT64_T));
} }
static inline h5_err_t static inline h5_err_t
...@@ -137,7 +139,8 @@ H5Block3dWriteScalarFieldInt32 ( ...@@ -137,7 +139,8 @@ H5Block3dWriteScalarFieldInt32 (
(h5_file_p)f, name, buffer); (h5_file_p)f, name, buffer);
H5_API_RETURN ( H5_API_RETURN (
h5b_write_scalar_data ( h5b_write_scalar_data (
f, name, buffer, H5T_NATIVE_INT32 )); f, name, buffer,
H5_INT32_T));
} }
/* /*
...@@ -200,7 +203,8 @@ H5Block3dReadScalarFieldFloat64 ( ...@@ -200,7 +203,8 @@ H5Block3dReadScalarFieldFloat64 (
(h5_file_p)f, name, buffer); (h5_file_p)f, name, buffer);
H5_API_RETURN ( H5_API_RETURN (
h5b_read_scalar_data ( h5b_read_scalar_data (
f, name, (void*)buffer, H5T_NATIVE_DOUBLE)); f, name, (void*)buffer,
H5_FLOAT64_T));
} }
static inline h5_err_t static inline h5_err_t
...@@ -215,7 +219,8 @@ H5Block3dReadScalarFieldFloat32 ( ...@@ -215,7 +219,8 @@ H5Block3dReadScalarFieldFloat32 (
(h5_file_p)f, name, buffer); (h5_file_p)f, name, buffer);
H5_API_RETURN ( H5_API_RETURN (
h5b_read_scalar_data ( h5b_read_scalar_data (
f, name, buffer, H5T_NATIVE_FLOAT)); f, name, buffer,
H5_FLOAT32_T));
} }
static inline h5_err_t static inline h5_err_t
...@@ -230,7 +235,7 @@ H5Block3dReadScalarFieldInt64 ( ...@@ -230,7 +235,7 @@ H5Block3dReadScalarFieldInt64 (
(h5_file_p)f, name, buffer); (h5_file_p)f, name, buffer);
H5_API_RETURN ( H5_API_RETURN (
h5b_read_scalar_data ( h5b_read_scalar_data (
f, name, buffer, H5T_NATIVE_INT64)); f, name, buffer, H5_INT64_T));
} }
static inline h5_err_t static inline h5_err_t
...@@ -245,7 +250,8 @@ H5Block3dReadScalarFieldInt32 ( ...@@ -245,7 +250,8 @@ H5Block3dReadScalarFieldInt32 (
(h5_file_p)f, name, buffer); (h5_file_p)f, name, buffer);
H5_API_RETURN ( H5_API_RETURN (
h5b_read_scalar_data ( h5b_read_scalar_data (
f, name, buffer, H5T_NATIVE_INT32)); f, name, buffer,
H5_INT32_T));
} }
/* /*
...@@ -332,7 +338,7 @@ H5Block3dWriteVector3dFieldFloat64 ( ...@@ -332,7 +338,7 @@ H5Block3dWriteVector3dFieldFloat64 (
h5b_write_vector3d_data( h5b_write_vector3d_data(
f, name, f, name,
(void*)x_buf, (void*)y_buf, (void*)z_buf, (void*)x_buf, (void*)y_buf, (void*)z_buf,
H5T_NATIVE_DOUBLE)); H5_FLOAT64_T));
} }
static inline h5_err_t static inline h5_err_t
...@@ -351,7 +357,7 @@ H5Block3dWriteVector3dFieldFloat32 ( ...@@ -351,7 +357,7 @@ H5Block3dWriteVector3dFieldFloat32 (
h5b_write_vector3d_data ( h5b_write_vector3d_data (
f, name, f, name,
x_buf, y_buf, z_buf, x_buf, y_buf, z_buf,
H5T_NATIVE_FLOAT)); H5_FLOAT32_T));
} }
static inline h5_err_t static inline h5_err_t
...@@ -370,7 +376,7 @@ H5Block3dWriteVector3dFieldInt64 ( ...@@ -370,7 +376,7 @@ H5Block3dWriteVector3dFieldInt64 (
h5b_write_vector3d_data ( h5b_write_vector3d_data (
f, name, f, name,
x_buf, y_buf, z_buf, x_buf, y_buf, z_buf,
H5T_NATIVE_INT64)); H5_INT64_T));
} }
static inline h5_err_t static inline h5_err_t
...@@ -389,7 +395,7 @@ H5Block3dWriteVector3dFieldInt32 ( ...@@ -389,7 +395,7 @@ H5Block3dWriteVector3dFieldInt32 (
h5b_write_vector3d_data( h5b_write_vector3d_data(
f, name, f, name,
x_buf, y_buf, z_buf, x_buf, y_buf, z_buf,
H5T_NATIVE_INT32)); H5_INT32_T));
} }
/* /*
...@@ -470,7 +476,7 @@ H5Block3dReadVector3dFieldFloat64 ( ...@@ -470,7 +476,7 @@ H5Block3dReadVector3dFieldFloat64 (
h5b_read_vector3d_data ( h5b_read_vector3d_data (
f, name, f, name,
x_buf, y_buf, z_buf, x_buf, y_buf, z_buf,
H5T_NATIVE_DOUBLE)); H5_FLOAT64_T));
} }
static inline h5_err_t static inline h5_err_t
...@@ -489,7 +495,7 @@ H5Block3dReadVector3dFieldFloat32 ( ...@@ -489,7 +495,7 @@ H5Block3dReadVector3dFieldFloat32 (
h5b_read_vector3d_data ( h5b_read_vector3d_data (
f, name, f, name,
x_buf, y_buf, z_buf, x_buf, y_buf, z_buf,
H5T_NATIVE_FLOAT)); H5_FLOAT32_T));
} }
static inline h5_err_t static inline h5_err_t
...@@ -508,7 +514,7 @@ H5Block3dReadVector3dFieldInt64 ( ...@@ -508,7 +514,7 @@ H5Block3dReadVector3dFieldInt64 (
h5b_read_vector3d_data ( h5b_read_vector3d_data (
f, name, f, name,
x_buf, y_buf, z_buf, x_buf, y_buf, z_buf,
H5T_NATIVE_INT64)); H5_INT64_T));
} }
static inline h5_err_t static inline h5_err_t
...@@ -527,7 +533,7 @@ H5Block3dReadVector3dFieldInt32 ( ...@@ -527,7 +533,7 @@ H5Block3dReadVector3dFieldInt32 (
h5b_read_vector3d_data ( h5b_read_vector3d_data (
f, name, f, name,
x_buf, y_buf, z_buf, x_buf, y_buf, z_buf,
H5T_NATIVE_INT32)); H5_INT32_T));
} }
///< @} ///< @}