summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMuQun Yang <ymuqun@hdfgroup.org>2001-04-28 23:02:12 (GMT)
committerMuQun Yang <ymuqun@hdfgroup.org>2001-04-28 23:02:12 (GMT)
commitcfc0f7c02b7267c520275fd5d32ecbfee2e580c5 (patch)
treed770817e6f3b7531b9ee1390a9924a6a2e9c52e4
parent7b6e64686372deaaf1aab77ae01e2876109dd924 (diff)
downloadhdf5-cfc0f7c02b7267c520275fd5d32ecbfee2e580c5.zip
hdf5-cfc0f7c02b7267c520275fd5d32ecbfee2e580c5.tar.gz
hdf5-cfc0f7c02b7267c520275fd5d32ecbfee2e580c5.tar.bz2
[svn-r3869]
Purpose: a bug fix Description: User can define "Real Vdata" as user-defined attribute. By using VSisattr, we can check this out. In order to keep this piece of information, We use "Vdata attribute" in the converted HDF5 file to distingush this kind of Vdata from independent Vdata. Solution: see above Platforms tested: eirene(Linux)
-rw-r--r--tools/h4toh5/h4toh5vdata.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/h4toh5/h4toh5vdata.c b/tools/h4toh5/h4toh5vdata.c
index 55a8bf9..e1b20d1 100644
--- a/tools/h4toh5/h4toh5vdata.c
+++ b/tools/h4toh5/h4toh5vdata.c
@@ -72,7 +72,7 @@ int Vdata_h4_to_h5(int32 file_id,int32 vdata_id, hid_t group_id) {
VOIDP vd_data;
- char vdlabel[10];
+ char vdlabel[LABEL_LENG];
char vdata_name[MAX_NC_NAME];
char fieldname[MAX_NC_NAME];
char vdata_class[VSNAMELENMAX];
@@ -387,7 +387,16 @@ int Vdata_h4_to_h5(int32 file_id,int32 vdata_id, hid_t group_id) {
}
/* converting predefined attributes. */
- strcpy(vdlabel,VDATALABEL);
+
+ istat = VSisattr(vdata_id);
+ if (istat == FAIL) {
+ printf("error in checking vdata attribute. \n");
+ VSdetach(vdata_id);
+ return FAIL;
+ }
+
+ if(istat) strcpy(vdlabel,VDATTRLAB);
+ else strcpy(vdlabel,VDATALABEL);
if(h4_transpredattrs(h5dset,HDF4_OBJECT_TYPE,vdlabel)==FAIL){
printf("error in transfering vdata attributes.\n");
free(h5memtype);
@@ -409,7 +418,7 @@ int Vdata_h4_to_h5(int32 file_id,int32 vdata_id, hid_t group_id) {
return FAIL;
}
}
-
+
if(h4_transnumattr(h5dset,HDF4_REF_NUM,vdata_ref)==FAIL){
printf("error in transfering vdata attributes.\n");
free(h5memtype);