summaryrefslogtreecommitdiffstats
path: root/tools/h4toh5/h4toh5vgroup.c
diff options
context:
space:
mode:
authorMuQun Yang <ymuqun@hdfgroup.org>2001-06-11 21:20:10 (GMT)
committerMuQun Yang <ymuqun@hdfgroup.org>2001-06-11 21:20:10 (GMT)
commit1a5197918c0ef3e9f26af8538cf8c278bfa09fe2 (patch)
tree69beb8b96244f379cc524d7d8fac3a66559b3886 /tools/h4toh5/h4toh5vgroup.c
parent1b484c377cfb56b4f36840f74a85bf86211f71e6 (diff)
downloadhdf5-1a5197918c0ef3e9f26af8538cf8c278bfa09fe2.zip
hdf5-1a5197918c0ef3e9f26af8538cf8c278bfa09fe2.tar.gz
hdf5-1a5197918c0ef3e9f26af8538cf8c278bfa09fe2.tar.bz2
[svn-r3988]
Purpose: new features Description: 1. add an option to convert HDF4 file without HDF4 specified attributes such as HDF4_OBJECT_TYPE, HDF4_REF_NUM etc. it can be done by inputting "h4toh5 -na input.hdf" The default converter will still keep HDF4 specfied attributes. 2. Add compression features (gzip) for image too. Now the compressed HDF4 image can be supported by using HDF5 gzip. Not sure whether tools can read it. Need to be tested. 3. Change SPACEPAD to NULLTERM for HDF4 dimensional name list. We can use variable length HDF5 string to represent these names, however currently H5dump and H5view cannot support variable length HDF5 string. converter will wait for other tools' update. Solution: Platforms tested: eirene(Red Hat 6.2) and arabica(solaris 2.7)
Diffstat (limited to 'tools/h4toh5/h4toh5vgroup.c')
-rw-r--r--tools/h4toh5/h4toh5vgroup.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/tools/h4toh5/h4toh5vgroup.c b/tools/h4toh5/h4toh5vgroup.c
index 1605ec8..9d3bbef 100644
--- a/tools/h4toh5/h4toh5vgroup.c
+++ b/tools/h4toh5/h4toh5vgroup.c
@@ -54,7 +54,7 @@ Author: Kent Yang(ymuqun@ncsa.uiuc.edu)
*/
-int Vgroup_h4_to_h5(int32 file_id,int32 vgroup_id,int32 sd_id,hid_t h5_group,hid_t h5_dimgroup,hid_t h5_palgroup)
+int Vgroup_h4_to_h5(int32 file_id,int32 vgroup_id,int32 sd_id,hid_t h5_group,hid_t h5_dimgroup,hid_t h5_palgroup,int h4_attr)
{
@@ -138,7 +138,7 @@ int Vgroup_h4_to_h5(int32 file_id,int32 vgroup_id,int32 sd_id,hid_t h5_group,hid
}
/* vgroup attributes into corresponding hdf5 group attributes.*/
- if(vg_transattrs(vgroup_id,h5_pgroup)==FAIL) {
+ if(vg_transattrs(vgroup_id,h5_pgroup,h4_attr)==FAIL) {
printf("error in translating vgroup attributes into hdf5 group attr.\n");
H5Gclose(h5_pgroup);
free(h5pgroup_name);
@@ -182,7 +182,7 @@ int Vgroup_h4_to_h5(int32 file_id,int32 vgroup_id,int32 sd_id,hid_t h5_group,hid
if (Visvg(vgroup_id,obj_ref)) {
if(convert_vgroup(file_id,sd_id,obj_ref,h5pgroup_name,h5_pgroup,
- h5_dimgroup,h5_palgroup)== FAIL) {
+ h5_dimgroup,h5_palgroup,h4_attr)== FAIL) {
printf("convert_vgroup routine failed,");
printf("cannot convert vgroup into hdf5 group successfully.\n");
free(h5pgroup_name);
@@ -193,7 +193,7 @@ int Vgroup_h4_to_h5(int32 file_id,int32 vgroup_id,int32 sd_id,hid_t h5_group,hid
}
/* the object is independent vdata. */
else if(Visvs(vgroup_id,obj_ref)) {
- if(convert_vdata(file_id,obj_ref,h5pgroup_name,h5_pgroup)==FAIL){
+ if(convert_vdata(file_id,obj_ref,h5pgroup_name,h5_pgroup,h4_attr)==FAIL){
printf("fail to convert vdata into hdf5 dataset.\n");
free(h5pgroup_name);
H5Gclose(h5_pgroup);
@@ -202,7 +202,7 @@ int Vgroup_h4_to_h5(int32 file_id,int32 vgroup_id,int32 sd_id,hid_t h5_group,hid
}
else if(obj_tag == DFTAG_NDG || obj_tag == DFTAG_SDG) {
if(convert_sds(file_id,sd_id,obj_ref,h5pgroup_name,h5_pgroup,
- h5_dimgroup)==FAIL){
+ h5_dimgroup,h4_attr)==FAIL){
printf("fail to convert sds into hdf5 dataset.\n");
H5Gclose(h5_pgroup);
free(h5pgroup_name);
@@ -211,7 +211,7 @@ int Vgroup_h4_to_h5(int32 file_id,int32 vgroup_id,int32 sd_id,hid_t h5_group,hid
}
else if(obj_tag == DFTAG_RIG) {
if(convert_image(file_id,obj_ref,h5pgroup_name,
- h5_pgroup,h5_palgroup)==FAIL){
+ h5_pgroup,h5_palgroup,h4_attr)==FAIL){
printf("fail to convert image into hdf5 dataset.\n");
H5Gclose(h5_pgroup);
free(h5pgroup_name);
@@ -250,7 +250,7 @@ int Vgroup_h4_to_h5(int32 file_id,int32 vgroup_id,int32 sd_id,hid_t h5_group,hid
int convert_vgroup(int32 file_id,int32 sd_id, int32 obj_ref,
char* h5pgroup_name,hid_t h5_pgroup,hid_t h5_dimgroup,
- hid_t h5_palgroup) {
+ hid_t h5_palgroup,int h4_attr) {
int32 vgroup_cid;
int32 istat;
@@ -316,7 +316,7 @@ int convert_vgroup(int32 file_id,int32 sd_id, int32 obj_ref,
return FAIL;
}
if(Vgroup_h4_to_h5(file_id,vgroup_cid,sd_id,h5_pgroup,
- h5_dimgroup,h5_palgroup)== FAIL) {
+ h5_dimgroup,h5_palgroup,h4_attr)== FAIL) {
printf("error in transferring vgroup into hdf5 group.\n");
Vdetach(vgroup_cid);
free(h5cgroup_name);
@@ -390,7 +390,7 @@ int convert_vgroup(int32 file_id,int32 sd_id, int32 obj_ref,
*/
int convert_vdata(int32 file_id,int32 obj_ref,char * h5pgroup_name,
- hid_t h5_pgroup) {
+ hid_t h5_pgroup,int h4_attr) {
int32 vdata_id;
int check_vdata;
@@ -462,7 +462,7 @@ int convert_vdata(int32 file_id,int32 obj_ref,char * h5pgroup_name,
return FAIL;
}
- if(Vdata_h4_to_h5(file_id,vdata_id,h5_pgroup)==FAIL){
+ if(Vdata_h4_to_h5(file_id,vdata_id,h5_pgroup,h4_attr)==FAIL){
printf("failed to transfer vdata into hdf5 dataset.\n");
VSdetach(vdata_id);
free(h5cvdata_name);
@@ -536,7 +536,7 @@ int convert_vdata(int32 file_id,int32 obj_ref,char * h5pgroup_name,
*-------------------------------------------------------------------------
*/
int convert_sds(int32 file_id,int32 sd_id,int32 obj_ref,char * h5pgroup_name,
- hid_t h5_pgroup,hid_t h5_dimgroup) {
+ hid_t h5_pgroup,hid_t h5_dimgroup,int h4_attr) {
int32 sd_index;
int32 sds_id;
@@ -609,7 +609,7 @@ int convert_sds(int32 file_id,int32 sd_id,int32 obj_ref,char * h5pgroup_name,
return FAIL;
}
/* convert the sds object into hdf5 dataset.*/
- if(Sds_h4_to_h5(file_id,sds_id,h5_pgroup,h5_dimgroup)==FAIL){
+ if(Sds_h4_to_h5(file_id,sds_id,h5_pgroup,h5_dimgroup,h4_attr)==FAIL){
printf("error in translating sds into hdf5 dataset.\n");
SDendaccess(sds_id);
free(h5csds_name);
@@ -673,7 +673,7 @@ int convert_sds(int32 file_id,int32 sd_id,int32 obj_ref,char * h5pgroup_name,
*-------------------------------------------------------------------------
*/
int convert_image(int32 file_id,int32 obj_ref,char * h5pgroup_name,
- hid_t h5_pgroup,hid_t h5_palgroup) {
+ hid_t h5_pgroup,hid_t h5_palgroup,int h4_attr) {
int32 gr_id;
int32 gr_index;
@@ -754,7 +754,7 @@ int convert_image(int32 file_id,int32 obj_ref,char * h5pgroup_name,
free(h5cimage_name);
return FAIL;
}
- if(Image_h4_to_h5(file_id,ri_id,h5_pgroup,h5_palgroup)==FAIL) {
+ if(Image_h4_to_h5(file_id,ri_id,h5_pgroup,h5_palgroup,h4_attr)==FAIL) {
printf("error in transferring image name into hdf5 dataset.\n");
GRendaccess(ri_id);
free(h5cimage_name);
@@ -810,3 +810,11 @@ int convert_image(int32 file_id,int32 obj_ref,char * h5pgroup_name,
+
+
+
+
+
+
+
+