[cig-commits] r13829 - cs/cigma/trunk/src
luis at geodynamics.org
luis at geodynamics.org
Mon Jan 12 14:09:52 PST 2009
Author: luis
Date: 2009-01-12 14:09:52 -0800 (Mon, 12 Jan 2009)
New Revision: 13829
Modified:
cs/cigma/trunk/src/h5attr.cpp
Log:
Allow hdf5-1.8.0
Modified: cs/cigma/trunk/src/h5attr.cpp
===================================================================
--- cs/cigma/trunk/src/h5attr.cpp 2009-01-12 22:09:51 UTC (rev 13828)
+++ cs/cigma/trunk/src/h5attr.cpp 2009-01-12 22:09:52 UTC (rev 13829)
@@ -14,8 +14,8 @@
#include "H5Cpp.h"
#include "hdf5.h"
-#if ((H5_VERS_MAJOR >= 1) && (H5_VERS_MINOR >= 8) && (H5_VERS_RELEASE >= 2))
-#define HAVE_HDF5_1_8_2
+#if ((H5_VERS_MAJOR >= 1) && (H5_VERS_MINOR >= 8) && (H5_VERS_RELEASE >= 0))
+#define HAVE_HDF5_1_8_0
#endif
using namespace std;
@@ -287,7 +287,7 @@
cout << "\t" << name << endl;
}
-#ifdef HAVE_HDF5_1_8_2
+#ifdef HAVE_HDF5_1_8_0
herr_t listAttrOp(hid_t loc_id, const char *attr_name, const H5A_info_t *ainfo, void *op_data)
{
@@ -303,6 +303,14 @@
}
}
+void listAttrOp01(H5::H5Object& loc, const string name, void *data)
+{
+ string dtype, value;
+ getattr(&loc, name, dtype, value);
+ print_attr(name, dtype, value);
+}
+
+
#else
herr_t listAttrOp00(hid_t loc_id, const char *attr_name, void *op_data)
@@ -317,14 +325,6 @@
}
}
-void listAttrOp01(H5::H5Object& loc, const string name, void *data)
-{
- string dtype, value;
- getattr(&loc, name, dtype, value);
- print_attr(name, dtype, value);
-}
-
-
#endif
@@ -482,6 +482,7 @@
{
const char *prefix = location.c_str();
cout << indent << "Groups" << endl;
+ #ifdef HAVE_HDF5_1_8_0
try
{
int idx = 0;
@@ -492,6 +493,14 @@
} catch(H5::Exception e)
{
}
+ #else
+ hid_t oid = obj->getId();
+ int _idx = 0;
+ while ((status = H5Giterate(oid, location.c_str(), &_idx, listGroupOp, (void *)prefix)) > 0)
+ {
+ //TRI_LOG(status);
+ }
+ #endif
}
else if (objtype == H5I_DATASET)
{
@@ -499,7 +508,7 @@
}
- #ifdef HAVE_HDF5_1_8_2
+ #ifdef HAVE_HDF5_1_8_0
H5O_info_t oinfo;
hid_t oid = obj->getId();
status = H5Oget_info(oid, &oinfo);
@@ -517,7 +526,7 @@
cout << indent << "Attributes" << endl;
if (num_attrs > 0)
{
- #ifdef HAVE_HDF5_1_8_2
+ #ifdef HAVE_HDF5_1_8_0
hsize_t _idx = 0;
while ((status = H5Aiterate2(oid, H5_INDEX_NAME, H5_ITER_INC, &_idx, listAttrOp, obj)) > 0)
{
More information about the CIG-COMMITS
mailing list