summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_opttable.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2004-07-15 19:25:27 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2004-07-15 19:25:27 (GMT)
commita6cbc806638a682f0685c086feb87c32a8119ef2 (patch)
tree48537c01f5d7d637f624a03d01c5b45b5c6d7a8e /tools/h5repack/h5repack_opttable.c
parent89c9bfc05b97068c7b1649e85f9cfeff87be7441 (diff)
downloadhdf5-a6cbc806638a682f0685c086feb87c32a8119ef2.zip
hdf5-a6cbc806638a682f0685c086feb87c32a8119ef2.tar.gz
hdf5-a6cbc806638a682f0685c086feb87c32a8119ef2.tar.bz2
[svn-r8882] Purpose:
bug fix, new feature Description: fixed bug in the parse function: cases where we have an already inserted name but there is a new name also example: -f dset1:GZIP=1 -l dset1,dset2:CHUNK=20x20 dset1 is already inserted, but dset2 must also be (it was not) added a CHECK_SZIP symbol to enable/disable checking of library related szip parameters added the print of the filter name in verbose mode (confirms visually that the filter was applied ) Solution: Platforms tested: linux solaris AIX Misc. update:
Diffstat (limited to 'tools/h5repack/h5repack_opttable.c')
-rw-r--r--tools/h5repack/h5repack_opttable.c72
1 files changed, 54 insertions, 18 deletions
diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c
index 45dfac5..71cf1a8 100644
--- a/tools/h5repack/h5repack_opttable.c
+++ b/tools/h5repack/h5repack_opttable.c
@@ -72,6 +72,30 @@ static void aux_tblinsert_filter(pack_opttbl_t *table,
}
}
+/*-------------------------------------------------------------------------
+ * Function: aux_tblinsert_layout
+ *
+ * Purpose: auxiliary function, inserts the layout in object OBJS[ I ]
+ *
+ * Return: void
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void aux_tblinsert_layout(pack_opttbl_t *table,
+ int I,
+ pack_info_t *pack)
+{
+ int k;
+
+ table->objs[I].layout = pack->layout;
+ if (H5D_CHUNKED==pack->layout) {
+ table->objs[I].chunk.rank = pack->chunk.rank;
+ for (k = 0; k < pack->chunk.rank; k++)
+ table->objs[I].chunk.chunk_lengths[k] = pack->chunk.chunk_lengths[k];
+ }
+}
+
/*-------------------------------------------------------------------------
* Function: aux_inctable
@@ -189,7 +213,7 @@ int options_add_layout( obj_list_t *obj_list,
pack_info_t *pack,
pack_opttbl_t *table )
{
- int i, j, k, I, added=0, found=0;
+ int i, j, I, added=0, found=0;
/* increase the size of the collection by N_OBJS if necessary */
if (table->nelems+n_objs >= table->size)
@@ -219,12 +243,7 @@ int options_add_layout( obj_list_t *obj_list,
/* insert the layout info */
else
{
- table->objs[i].layout = pack->layout;
- if (H5D_CHUNKED==pack->layout) {
- table->objs[i].chunk.rank = pack->chunk.rank;
- for (k = 0; k < pack->chunk.rank; k++)
- table->objs[i].chunk.chunk_lengths[k] = pack->chunk.chunk_lengths[k];
- }
+ aux_tblinsert_layout(table,i,pack);
found=1;
break;
}
@@ -237,12 +256,20 @@ int options_add_layout( obj_list_t *obj_list,
I = table->nelems + added;
added++;
strcpy(table->objs[I].path,obj_list[j].obj);
- table->objs[I].layout = pack->layout;
- if (H5D_CHUNKED==pack->layout) {
- table->objs[I].chunk.rank = pack->chunk.rank;
- for (k = 0; k < pack->chunk.rank; k++)
- table->objs[I].chunk.chunk_lengths[k] = pack->chunk.chunk_lengths[k];
+ aux_tblinsert_layout(table,I,pack);
}
+ /* cases where we have an already inserted name but there is a new name also
+ example:
+ -f dset1:GZIP=1 -l dset1,dset2:CHUNK=20x20
+ dset1 is already inserted, but dset2 must also be
+ */
+ else if (found==1 && strcmp(obj_list[j].obj,table->objs[i].path)!=0)
+ {
+ /* keep the grow in a temp var */
+ I = table->nelems + added;
+ added++;
+ strcpy(table->objs[I].path,obj_list[j].obj);
+ aux_tblinsert_layout(table,I,pack);
}
} /* j */
}
@@ -256,12 +283,8 @@ int options_add_layout( obj_list_t *obj_list,
I = table->nelems + added;
added++;
strcpy(table->objs[I].path,obj_list[j].obj);
- table->objs[I].layout = pack->layout;
- if (H5D_CHUNKED==pack->layout) {
- table->objs[I].chunk.rank = pack->chunk.rank;
- for (k = 0; k < pack->chunk.rank; k++)
- table->objs[I].chunk.chunk_lengths[k] = pack->chunk.chunk_lengths[k];
- }
+ aux_tblinsert_layout(table,I,pack);
+
}
}
@@ -324,6 +347,19 @@ int options_add_filter(obj_list_t *obj_list,
strcpy(table->objs[I].path,obj_list[j].obj);
aux_tblinsert_filter(table,I,filt);
}
+ /* cases where we have an already inserted name but there is a new name also
+ example:
+ -l dset1:CHUNK=20x20 -f dset1,dset2:GZIP=1
+ dset1 is already inserted, but dset2 must also be
+ */
+ else if (found==1 && strcmp(obj_list[j].obj,table->objs[i].path)!=0)
+ {
+ /* keep the grow in a temp var */
+ I = table->nelems + added;
+ added++;
+ strcpy(table->objs[I].path,obj_list[j].obj);
+ aux_tblinsert_filter(table,I,filt);
+ }
} /* j */
}