summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/misc/talign.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/tools/misc/talign.c b/tools/misc/talign.c
index 6c1bd81..24420bf 100644
--- a/tools/misc/talign.c
+++ b/tools/misc/talign.c
@@ -23,7 +23,6 @@
#include "hdf5.h"
#include "H5private.h"
-#include "h5tools.h"
const char *fname = "talign.h5";
const char *setname = "align";
@@ -189,3 +188,35 @@ int main(void)
return result;
}
+/*-------------------------------------------------------------------------
+ * Function: h5tools_get_native_type
+ *
+ * Purpose: Wrapper around H5Tget_native_type() to work around
+ * Problems with bitfields.
+ *
+ * Return: Success: datatype ID
+ *
+ * Failure: FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Tuesday, October 5, 2004
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+hid_t
+h5tools_get_native_type(hid_t type)
+{
+ hid_t p_type;
+ H5T_class_t type_class;
+
+ type_class = H5Tget_class(type);
+ if(type_class==H5T_BITFIELD)
+ p_type=H5Tcopy(type);
+ else
+ p_type = H5Tget_native_type(type,H5T_DIR_DEFAULT);
+
+ return(p_type);
+}
+