summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_filters.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2003-12-30 22:59:33 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2003-12-30 22:59:33 (GMT)
commitd8531b84827b78bc481ccdac77693fb9247ba979 (patch)
treee16e1dd108cccef622c4e1f4c459fba6fc224cbe /tools/h5repack/h5repack_filters.c
parent95da5842dfd4caaca02460a6ff1ffa22b8b9a312 (diff)
downloadhdf5-d8531b84827b78bc481ccdac77693fb9247ba979.zip
hdf5-d8531b84827b78bc481ccdac77693fb9247ba979.tar.gz
hdf5-d8531b84827b78bc481ccdac77693fb9247ba979.tar.bz2
[svn-r7997] Purpose:
h5repack new features Description: added support for layout options Solution: Platforms tested: linux solaris AIX Misc. update:
Diffstat (limited to 'tools/h5repack/h5repack_filters.c')
-rw-r--r--tools/h5repack/h5repack_filters.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c
index 09e2e75..5f7f641 100644
--- a/tools/h5repack/h5repack_filters.c
+++ b/tools/h5repack/h5repack_filters.c
@@ -16,6 +16,63 @@
#include "h5test.h"
#include "h5repack.h"
+/*-------------------------------------------------------------------------
+ * Function: filter_this
+ *
+ * Purpose: find the object name NAME (got from the traverse list)
+ * in the repack options list; assign the filter information OBJ
+ *
+ * Return: 0 not found, 1 found
+ *
+ * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ *
+ * Date: December 19, 2003
+ *
+ *-------------------------------------------------------------------------
+ */
+
+int filter_this(const char* name, /* object name from traverse list */
+ pack_opt_t *options, /* repack options */
+ pack_info_t *obj) /* info about object to filter */
+{
+ char *pdest;
+ int result;
+ int i;
+
+ /* if we are applying to all objects just return true */
+ if (options->all_filter)
+ {
+ /* assign the global filter and chunk info to the OBJ info */
+ obj->filter=options->filter_g;
+ obj->chunk=options->chunk_g;
+ return 1;
+ }
+
+ for ( i=0; i<options->op_tbl->nelems; i++)
+ {
+ if (options->op_tbl->objs[i].filter.filtn != -1 )
+ {
+ if (strcmp(options->op_tbl->objs[i].path,name)==0)
+ {
+ *obj=options->op_tbl->objs[i];
+ return 1;
+ }
+
+ pdest = strstr(name,options->op_tbl->objs[i].path);
+ result = (int)(pdest - name);
+
+ /* found at position 1, meaning without '/' */
+ if( pdest != NULL && result==1 )
+ {
+ *obj=options->op_tbl->objs[i];
+ return 1;
+ }
+ }
+ }
+
+ return 0;
+}
+
/*-------------------------------------------------------------------------