2003-12-30 04:26:21 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
* Copyright by The HDF Group. *
|
2003-12-30 04:26:21 +08:00
|
|
|
* Copyright by the Board of Trustees of the University of Illinois. *
|
|
|
|
* All rights reserved. *
|
|
|
|
* *
|
|
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
|
|
* terms governing use, modification, and redistribution, is contained in *
|
|
|
|
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
|
|
|
* of the source code distribution tree; Copyright.html can be found at the *
|
|
|
|
* root level of an installed copy of the electronic HDF5 document set and *
|
|
|
|
* is linked from the top-level documents page. It can also be found at *
|
2007-02-07 22:56:24 +08:00
|
|
|
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
|
|
|
* access to either file, you may request a copy from help@hdfgroup.org. *
|
2003-12-30 04:26:21 +08:00
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
2007-04-05 04:25:42 +08:00
|
|
|
#include "h5repack.h"
|
2012-02-29 02:26:34 +08:00
|
|
|
#include "h5tools.h"
|
2006-10-05 22:35:40 +08:00
|
|
|
#include "h5tools_utils.h"
|
2003-12-30 04:26:21 +08:00
|
|
|
|
2010-03-18 05:38:20 +08:00
|
|
|
/* number of members in an array */
|
|
|
|
#ifndef NELMTS
|
2012-02-29 02:26:34 +08:00
|
|
|
# define NELMTS(X) (sizeof(X)/sizeof(X[0]))
|
2010-03-18 05:38:20 +08:00
|
|
|
#endif
|
|
|
|
|
2012-02-29 02:26:34 +08:00
|
|
|
static int verify_layout(hid_t pid, pack_info_t *obj);
|
|
|
|
static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter);
|
|
|
|
|
2003-12-30 04:26:21 +08:00
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2007-12-04 02:55:32 +08:00
|
|
|
* Function: h5repack_verify
|
2003-12-30 04:26:21 +08:00
|
|
|
*
|
2007-12-21 05:31:34 +08:00
|
|
|
* Purpose: verify if filters and layout in the input file match the output file
|
2003-12-30 04:26:21 +08:00
|
|
|
*
|
2008-09-16 23:52:51 +08:00
|
|
|
* Return:
|
2007-12-21 05:31:34 +08:00
|
|
|
* 1 match
|
|
|
|
* 0 do not match
|
|
|
|
* -1 error
|
2003-12-30 04:26:21 +08:00
|
|
|
*
|
2007-12-21 05:31:34 +08:00
|
|
|
* Programmer: Pedro Vicente, pvn@hdfgroup.org
|
2003-12-30 04:26:21 +08:00
|
|
|
*
|
|
|
|
* Date: December 19, 2003
|
2007-12-21 05:31:34 +08:00
|
|
|
* Modified: December, 19, 2007 (exactly 4 years later :-) )
|
|
|
|
* Separate into 3 cases
|
|
|
|
* 1) no filter input, get all datasets and compare DCPLs. TO DO
|
|
|
|
* 2) filter input on selected datasets, get each one trough OBJ and match
|
2008-09-16 23:52:51 +08:00
|
|
|
* 3) filter input on all datasets, get all objects and match
|
2003-12-30 04:26:21 +08:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
int
|
|
|
|
h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options)
|
2003-12-30 04:26:21 +08:00
|
|
|
{
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
hid_t fidin; /* file ID for input file*/
|
|
|
|
hid_t fidout; /* file ID for output file*/
|
|
|
|
hid_t did; /* dataset ID */
|
|
|
|
hid_t pid; /* dataset creation property list ID */
|
|
|
|
hid_t sid; /* space ID */
|
|
|
|
hid_t tid; /* type ID */
|
2007-12-04 02:55:32 +08:00
|
|
|
unsigned int i;
|
2007-12-05 03:59:54 +08:00
|
|
|
trav_table_t *travt = NULL;
|
|
|
|
int ok = 1;
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
hid_t fcpl_in; /* file creation property for input file */
|
|
|
|
hid_t fcpl_out; /* file creation property for output file */
|
|
|
|
H5F_file_space_type_t in_strat, out_strat; /* file space handling strategy for in/output file */
|
|
|
|
hsize_t in_thresh, out_thresh; /* free space section threshold for in/output file */
|
2008-09-16 23:52:51 +08:00
|
|
|
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
/* open the output file */
|
|
|
|
if((fidout = H5Fopen(out_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 )
|
2007-12-04 02:55:32 +08:00
|
|
|
return -1;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
|
|
for(i = 0; i < options->op_tbl->nelems; i++)
|
2007-12-04 02:55:32 +08:00
|
|
|
{
|
|
|
|
char* name = options->op_tbl->objs[i].path;
|
|
|
|
pack_info_t *obj = &options->op_tbl->objs[i];
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* open
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
if((did = H5Dopen2(fidout, name, H5P_DEFAULT)) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
2008-01-03 03:40:20 +08:00
|
|
|
if((sid = H5Dget_space(did)) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
2008-01-03 03:40:20 +08:00
|
|
|
if((pid = H5Dget_create_plist(did)) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
2008-01-03 03:40:20 +08:00
|
|
|
if((tid = H5Dget_type(did)) < 0)
|
|
|
|
goto error;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* filter check
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2009-06-18 02:32:04 +08:00
|
|
|
if(verify_filters(pid, tid, obj->nfilters, obj->filter) <= 0)
|
2007-12-15 05:38:23 +08:00
|
|
|
ok = 0;
|
2008-01-03 03:40:20 +08:00
|
|
|
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* layout check
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2009-06-18 02:32:04 +08:00
|
|
|
if((obj->layout != -1) && (verify_layout(pid, obj) == 0))
|
2007-12-05 03:59:54 +08:00
|
|
|
ok = 0;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-05 03:59:54 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* close
|
|
|
|
*-------------------------------------------------------------------------
|
2007-12-04 02:55:32 +08:00
|
|
|
*/
|
2008-01-03 03:40:20 +08:00
|
|
|
if(H5Pclose(pid) < 0)
|
|
|
|
goto error;
|
|
|
|
if (H5Sclose(sid) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
2008-01-03 03:40:20 +08:00
|
|
|
if (H5Dclose(did) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
2008-01-03 03:40:20 +08:00
|
|
|
if (H5Tclose(tid) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
}
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* check for the "all" objects option
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
|
|
if(options->all_filter == 1 || options->all_layout == 1)
|
2007-12-04 02:55:32 +08:00
|
|
|
{
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/* init table */
|
|
|
|
trav_table_init(&travt);
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/* get the list of objects in the file */
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
if(h5trav_gettable(fidout, travt) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
|
|
for(i = 0; i < travt->nobjs; i++)
|
2007-12-04 02:55:32 +08:00
|
|
|
{
|
|
|
|
char *name = travt->objs[i].name;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
|
|
if(travt->objs[i].type == H5TRAV_TYPE_DATASET)
|
2007-12-04 02:55:32 +08:00
|
|
|
{
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* open
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
if((did = H5Dopen2(fidout, name, H5P_DEFAULT)) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
2008-01-03 03:40:20 +08:00
|
|
|
if((sid = H5Dget_space(did)) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
2008-01-03 03:40:20 +08:00
|
|
|
if((pid = H5Dget_create_plist(did)) < 0)
|
|
|
|
goto error;
|
|
|
|
if((tid = H5Dget_type(did)) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* filter check
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
if(options->all_filter == 1)
|
|
|
|
{
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2009-06-18 02:32:04 +08:00
|
|
|
if(verify_filters(pid, tid, options->n_filter_g, options->filter_g) <= 0)
|
2007-12-05 03:59:54 +08:00
|
|
|
ok = 0;
|
2007-12-04 02:55:32 +08:00
|
|
|
}
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* layout check
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2008-09-16 23:52:51 +08:00
|
|
|
if(options->all_layout == 1)
|
2007-12-04 02:55:32 +08:00
|
|
|
{
|
|
|
|
pack_info_t pack;
|
|
|
|
init_packobject(&pack);
|
|
|
|
pack.layout = options->layout_g;
|
|
|
|
pack.chunk = options->chunk_g;
|
2009-06-18 02:32:04 +08:00
|
|
|
if(verify_layout(pid, &pack) == 0)
|
2007-12-05 03:59:54 +08:00
|
|
|
ok = 0;
|
2007-12-04 02:55:32 +08:00
|
|
|
}
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* close
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2008-01-03 03:40:20 +08:00
|
|
|
if (H5Pclose(pid) < 0)
|
|
|
|
goto error;
|
|
|
|
if (H5Sclose(sid) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
2008-01-03 03:40:20 +08:00
|
|
|
if (H5Dclose(did) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
2008-01-03 03:40:20 +08:00
|
|
|
if (H5Tclose(tid) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
|
|
|
} /* if */
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
} /* i */
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/* free table */
|
|
|
|
trav_table_free(travt);
|
|
|
|
}
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
* Verify that file space strategy and free space threshold
|
|
|
|
* are set as expected
|
2007-12-04 02:55:32 +08:00
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2008-09-16 23:52:51 +08:00
|
|
|
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
/* open the input file */
|
|
|
|
if((fidin = H5Fopen(in_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 )
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
/* Get file creation property list for input file */
|
|
|
|
if((fcpl_in = H5Fget_create_plist(fidin)) < 0) {
|
2010-05-12 04:10:25 +08:00
|
|
|
error_msg("failed to retrieve file creation property list\n");
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get file space management info for input file */
|
|
|
|
if(H5Pget_file_space(fcpl_in, &in_strat, &in_thresh) < 0) {
|
2010-05-12 04:10:25 +08:00
|
|
|
error_msg("failed to retrieve file space strategy & threshold\n");
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Output file is already opened */
|
|
|
|
/* Get file creation property list for output file */
|
|
|
|
if((fcpl_out = H5Fget_create_plist(fidout)) < 0) {
|
2010-05-12 04:10:25 +08:00
|
|
|
error_msg("failed to retrieve file creation property list\n");
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get file space management info for output file */
|
|
|
|
if(H5Pget_file_space(fcpl_out, &out_strat, &out_thresh) < 0) {
|
2010-05-12 04:10:25 +08:00
|
|
|
error_msg("failed to retrieve file space strategy & threshold\n");
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2010-01-30 12:29:13 +08:00
|
|
|
/*
|
|
|
|
* If the strategy option is not set,
|
|
|
|
* file space handling strategy should be the same for both
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
* input & output files.
|
2010-01-30 12:29:13 +08:00
|
|
|
* If the strategy option is set,
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
* the output file's file space handling strategy should be the same
|
2010-01-30 12:29:13 +08:00
|
|
|
* as what is set via the strategy option
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
*/
|
|
|
|
if(!options->fs_strategy && out_strat != in_strat) {
|
2010-05-12 04:10:25 +08:00
|
|
|
error_msg("file space strategy not set as unexpected\n");
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
goto error;
|
|
|
|
|
|
|
|
} else if(options->fs_strategy && out_strat!= options->fs_strategy) {
|
2010-05-12 04:10:25 +08:00
|
|
|
error_msg("file space strategy not set as unexpectec\n");
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2010-01-30 12:29:13 +08:00
|
|
|
/*
|
|
|
|
* If the threshold option is not set,
|
|
|
|
* the free space section threshold should be the same for both
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
* input & output files.
|
2010-01-30 12:29:13 +08:00
|
|
|
* If the threshold option is set,
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
* the output file's free space section threshold should be the same
|
|
|
|
* as what is set via the threshold option.
|
|
|
|
*/
|
|
|
|
if(!options->fs_threshold && out_thresh != in_thresh) {
|
2010-05-12 04:10:25 +08:00
|
|
|
error_msg("free space threshold not set as unexpected\n");
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
goto error;
|
|
|
|
|
|
|
|
} else if(options->fs_threshold && out_thresh != options->fs_threshold) {
|
2010-05-12 04:10:25 +08:00
|
|
|
error_msg("free space threshold not set as unexpectec\n");
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Closing */
|
|
|
|
if (H5Pclose(fcpl_in) < 0)
|
|
|
|
goto error;
|
|
|
|
if (H5Pclose(fcpl_out) < 0)
|
|
|
|
goto error;
|
|
|
|
if (H5Fclose(fidin) < 0)
|
|
|
|
goto error;
|
|
|
|
if (H5Fclose(fidout) < 0)
|
|
|
|
goto error;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-05 03:59:54 +08:00
|
|
|
return ok;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
error:
|
|
|
|
H5E_BEGIN_TRY {
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
H5Pclose(fcpl_in);
|
|
|
|
H5Pclose(fcpl_out);
|
2008-01-03 03:40:20 +08:00
|
|
|
H5Pclose(pid);
|
|
|
|
H5Sclose(sid);
|
|
|
|
H5Dclose(did);
|
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
|
|
|
H5Fclose(fidin);
|
|
|
|
H5Fclose(fidout);
|
2007-12-04 02:55:32 +08:00
|
|
|
if (travt)
|
|
|
|
trav_table_free(travt);
|
|
|
|
} H5E_END_TRY;
|
|
|
|
return -1;
|
[svn-r17553] Description:
Bring general fixes/improvements from file_free_space branch back to
trunk.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-30 04:08:01 +08:00
|
|
|
} /* h5repack_verify() */
|
2003-12-30 04:26:21 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2009-06-18 02:32:04 +08:00
|
|
|
* Function: verify_layout
|
2003-12-30 04:26:21 +08:00
|
|
|
*
|
2007-12-04 02:55:32 +08:00
|
|
|
* Purpose: verify which layout is present in the property list DCPL_ID
|
|
|
|
*
|
2012-02-29 02:26:34 +08:00
|
|
|
* H5D_COMPACT = 0
|
|
|
|
* H5D_CONTIGUOUS = 1
|
|
|
|
* H5D_CHUNKED = 2
|
2003-12-30 04:26:21 +08:00
|
|
|
*
|
2007-12-04 02:55:32 +08:00
|
|
|
* Return: 1 has, 0 does not, -1 error
|
2003-12-30 04:26:21 +08:00
|
|
|
*
|
2004-07-21 03:21:03 +08:00
|
|
|
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
2003-12-30 04:26:21 +08:00
|
|
|
*
|
2007-12-04 02:55:32 +08:00
|
|
|
* Date: December 30, 2003
|
2003-12-30 04:26:21 +08:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2009-06-18 02:32:04 +08:00
|
|
|
int verify_layout(hid_t pid,
|
|
|
|
pack_info_t *obj)
|
2003-12-30 04:26:21 +08:00
|
|
|
{
|
2007-12-04 02:55:32 +08:00
|
|
|
hsize_t chsize[64]; /* chunk size in elements */
|
|
|
|
H5D_layout_t layout; /* layout */
|
|
|
|
int nfilters; /* number of filters */
|
|
|
|
int rank; /* rank */
|
|
|
|
int i; /* index */
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/* check if we have filters in the input object */
|
2008-01-03 03:40:20 +08:00
|
|
|
if ((nfilters = H5Pget_nfilters(pid)) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
return -1;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2009-06-18 02:32:04 +08:00
|
|
|
/* a non chunked layout was requested on a filtered object */
|
2007-12-04 02:55:32 +08:00
|
|
|
if (nfilters && obj->layout!=H5D_CHUNKED)
|
2009-06-18 02:32:04 +08:00
|
|
|
return 0;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/* get layout */
|
2008-01-03 03:40:20 +08:00
|
|
|
if ((layout = H5Pget_layout(pid)) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
return -1;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
if (obj->layout != layout)
|
|
|
|
return 0;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
if (layout==H5D_CHUNKED)
|
2007-11-29 04:30:43 +08:00
|
|
|
{
|
2008-01-03 03:40:20 +08:00
|
|
|
if ((rank = H5Pget_chunk(pid,NELMTS(chsize),chsize/*out*/)) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
return -1;
|
|
|
|
if (obj->chunk.rank != rank)
|
|
|
|
return 0;
|
|
|
|
for ( i=0; i<rank; i++)
|
|
|
|
if (chsize[i] != obj->chunk.chunk_lengths[i])
|
|
|
|
return 0;
|
2007-11-29 04:30:43 +08:00
|
|
|
}
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
return 1;
|
|
|
|
}
|
2003-12-31 06:59:33 +08:00
|
|
|
|
2004-01-07 01:49:00 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
2009-04-03 04:17:10 +08:00
|
|
|
* Function: h5repack_cmp_pl
|
2004-01-07 01:49:00 +08:00
|
|
|
*
|
|
|
|
* Purpose: compare 2 files for identical property lists of all objects
|
|
|
|
*
|
|
|
|
* Return: 1=identical, 0=not identical, -1=error
|
|
|
|
*
|
2004-07-21 03:21:03 +08:00
|
|
|
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
2004-01-07 01:49:00 +08:00
|
|
|
*
|
|
|
|
* Date: December 31, 2003
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2009-04-03 04:17:10 +08:00
|
|
|
int h5repack_cmp_pl(const char *fname1,
|
2004-01-07 01:49:00 +08:00
|
|
|
const char *fname2)
|
|
|
|
{
|
2009-04-03 04:17:10 +08:00
|
|
|
hid_t fid1=-1; /* file ID */
|
|
|
|
hid_t fid2=-1; /* file ID */
|
|
|
|
hid_t dset1=-1; /* dataset ID */
|
|
|
|
hid_t dset2=-1; /* dataset ID */
|
|
|
|
hid_t gid=-1; /* group ID */
|
|
|
|
hid_t dcpl1=-1; /* dataset creation property list ID */
|
|
|
|
hid_t dcpl2=-1; /* dataset creation property list ID */
|
|
|
|
hid_t gcplid=-1; /* group creation property list */
|
|
|
|
unsigned crt_order_flag1; /* group creation order flag */
|
|
|
|
unsigned crt_order_flag2; /* group creation order flag */
|
|
|
|
trav_table_t *trav=NULL;
|
2007-12-04 02:55:32 +08:00
|
|
|
int ret=1;
|
|
|
|
unsigned int i;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
2008-09-16 23:52:51 +08:00
|
|
|
* open the files
|
2007-12-04 02:55:32 +08:00
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/* disable error reporting */
|
2008-09-16 23:52:51 +08:00
|
|
|
H5E_BEGIN_TRY
|
2007-12-04 02:55:32 +08:00
|
|
|
{
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/* Open the files */
|
|
|
|
if ((fid1=H5Fopen(fname1,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 )
|
|
|
|
{
|
2010-05-12 04:10:25 +08:00
|
|
|
error_msg("<%s>: %s\n", fname1, H5FOPENERROR );
|
2007-12-04 02:55:32 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if ((fid2=H5Fopen(fname2,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 )
|
|
|
|
{
|
2010-05-12 04:10:25 +08:00
|
|
|
error_msg("<%s>: %s\n", fname2, H5FOPENERROR );
|
2007-12-04 02:55:32 +08:00
|
|
|
H5Fclose(fid1);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
/* enable error reporting */
|
|
|
|
} H5E_END_TRY;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* get file table list of objects
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2009-04-03 04:17:10 +08:00
|
|
|
trav_table_init(&trav);
|
|
|
|
if(h5trav_gettable(fid1, trav) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
2010-01-30 12:29:13 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* traverse the suppplied object list
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2009-04-03 04:17:10 +08:00
|
|
|
for(i = 0; i < trav->nobjs; i++)
|
2007-12-04 02:55:32 +08:00
|
|
|
{
|
2009-04-03 04:17:10 +08:00
|
|
|
|
|
|
|
if(trav->objs[i].type == H5TRAV_TYPE_GROUP)
|
|
|
|
{
|
|
|
|
|
|
|
|
if ((gid = H5Gopen2(fid1, trav->objs[i].name, H5P_DEFAULT)) < 0)
|
|
|
|
goto error;
|
|
|
|
if ((gcplid = H5Gget_create_plist(gid)) < 0)
|
|
|
|
goto error;
|
|
|
|
if (H5Pget_link_creation_order(gcplid, &crt_order_flag1) < 0)
|
|
|
|
goto error;
|
|
|
|
if (H5Pclose(gcplid) < 0)
|
|
|
|
goto error;
|
|
|
|
if (H5Gclose(gid) < 0)
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
if ((gid = H5Gopen2(fid2, trav->objs[i].name, H5P_DEFAULT)) < 0)
|
|
|
|
goto error;
|
|
|
|
if ((gcplid = H5Gget_create_plist(gid)) < 0)
|
|
|
|
goto error;
|
|
|
|
if (H5Pget_link_creation_order(gcplid, &crt_order_flag2) < 0)
|
|
|
|
goto error;
|
|
|
|
if (H5Pclose(gcplid) < 0)
|
|
|
|
goto error;
|
|
|
|
if (H5Gclose(gid) < 0)
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
if ( crt_order_flag1 != crt_order_flag2 )
|
|
|
|
{
|
2010-05-12 04:10:25 +08:00
|
|
|
error_msg("property lists for <%s> are different\n",trav->objs[i].name);
|
2009-04-03 04:17:10 +08:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else if(trav->objs[i].type == H5TRAV_TYPE_DATASET)
|
2007-12-04 02:55:32 +08:00
|
|
|
{
|
2009-04-03 04:17:10 +08:00
|
|
|
if((dset1 = H5Dopen2(fid1, trav->objs[i].name, H5P_DEFAULT)) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
2009-04-03 04:17:10 +08:00
|
|
|
if((dset2 = H5Dopen2(fid2, trav->objs[i].name, H5P_DEFAULT)) < 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
|
|
|
if((dcpl1 = H5Dget_create_plist(dset1)) < 0)
|
|
|
|
goto error;
|
|
|
|
if((dcpl2 = H5Dget_create_plist(dset2)) < 0)
|
|
|
|
goto error;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* compare the property lists
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
if((ret = H5Pequal(dcpl1, dcpl2)) < 0)
|
|
|
|
goto error;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
|
|
if(ret == 0)
|
2007-12-04 02:55:32 +08:00
|
|
|
{
|
2010-05-12 04:10:25 +08:00
|
|
|
error_msg("property lists for <%s> are different\n",trav->objs[i].name);
|
2007-12-04 02:55:32 +08:00
|
|
|
goto error;
|
|
|
|
}
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* close
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
if(H5Pclose(dcpl1) < 0)
|
|
|
|
goto error;
|
|
|
|
if(H5Pclose(dcpl2) < 0)
|
|
|
|
goto error;
|
|
|
|
if(H5Dclose(dset1) < 0)
|
|
|
|
goto error;
|
|
|
|
if(H5Dclose(dset2) < 0)
|
|
|
|
goto error;
|
|
|
|
} /*if*/
|
|
|
|
} /*i*/
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* free
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2009-04-03 04:17:10 +08:00
|
|
|
trav_table_free(trav);
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* close
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
H5Fclose(fid1);
|
|
|
|
H5Fclose(fid2);
|
|
|
|
return ret;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-04 02:55:32 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* error
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2004-01-07 01:49:00 +08:00
|
|
|
error:
|
2008-09-16 23:52:51 +08:00
|
|
|
H5E_BEGIN_TRY
|
2007-12-04 02:55:32 +08:00
|
|
|
{
|
|
|
|
H5Pclose(dcpl1);
|
|
|
|
H5Pclose(dcpl2);
|
|
|
|
H5Dclose(dset1);
|
|
|
|
H5Dclose(dset2);
|
|
|
|
H5Fclose(fid1);
|
|
|
|
H5Fclose(fid2);
|
2009-04-03 04:17:10 +08:00
|
|
|
H5Pclose(gcplid);
|
|
|
|
H5Gclose(gid);
|
|
|
|
trav_table_free(trav);
|
2007-12-04 02:55:32 +08:00
|
|
|
} H5E_END_TRY;
|
|
|
|
return -1;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2004-01-07 01:49:00 +08:00
|
|
|
}
|
2007-12-05 03:59:54 +08:00
|
|
|
|
|
|
|
|
2007-12-15 05:38:23 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
2009-06-18 02:32:04 +08:00
|
|
|
* Function: verify_filters
|
2007-12-15 05:38:23 +08:00
|
|
|
*
|
2008-01-03 03:40:20 +08:00
|
|
|
* Purpose: verify if all requested filters in the array FILTER obtained
|
|
|
|
* from user input are present in the property list PID obtained from
|
|
|
|
* the output file
|
2007-12-15 05:38:23 +08:00
|
|
|
*
|
2008-09-16 23:52:51 +08:00
|
|
|
* Return:
|
2008-01-03 03:40:20 +08:00
|
|
|
* 1 match
|
|
|
|
* 0 do not match
|
|
|
|
* -1 error
|
2007-12-15 05:38:23 +08:00
|
|
|
*
|
|
|
|
* Programmer: Pedro Vicente, pvn@hdfgroup.org
|
|
|
|
*
|
2008-01-03 03:40:20 +08:00
|
|
|
* Date: December 21, 2007
|
2007-12-15 05:38:23 +08:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2010-01-30 12:29:13 +08:00
|
|
|
static
|
2009-06-18 02:32:04 +08:00
|
|
|
int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter)
|
2007-12-15 05:38:23 +08:00
|
|
|
{
|
2008-09-19 02:08:04 +08:00
|
|
|
int nfilters_dcpl; /* number of filters in DCPL*/
|
2007-12-15 05:38:23 +08:00
|
|
|
unsigned filt_flags; /* filter flags */
|
|
|
|
H5Z_filter_t filtn; /* filter identification number */
|
|
|
|
unsigned cd_values[20]; /* filter client data values */
|
|
|
|
size_t cd_nelmts; /* filter client number of values */
|
|
|
|
char f_name[256]; /* filter name */
|
2008-01-03 03:40:20 +08:00
|
|
|
size_t size; /* type size */
|
2008-09-19 02:08:04 +08:00
|
|
|
int i; /* index */
|
|
|
|
unsigned j; /* index */
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-15 05:38:23 +08:00
|
|
|
/* get information about filters */
|
2008-01-03 03:40:20 +08:00
|
|
|
if((nfilters_dcpl = H5Pget_nfilters(pid)) < 0)
|
2007-12-15 05:38:23 +08:00
|
|
|
return -1;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-15 05:38:23 +08:00
|
|
|
/* if we do not have filters and the requested filter is NONE, return 1 */
|
2008-09-16 23:52:51 +08:00
|
|
|
if(!nfilters_dcpl &&
|
|
|
|
nfilters == 1 &&
|
2008-01-03 03:40:20 +08:00
|
|
|
filter[0].filtn == H5Z_FILTER_NONE )
|
2007-12-15 05:38:23 +08:00
|
|
|
return 1;
|
|
|
|
|
2008-01-03 03:40:20 +08:00
|
|
|
/* else the numbers of filters must match */
|
|
|
|
if (nfilters_dcpl != nfilters )
|
|
|
|
return 0;
|
|
|
|
|
2007-12-15 05:38:23 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* build a list with DCPL filters
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2008-09-16 23:52:51 +08:00
|
|
|
for( i = 0; i < nfilters_dcpl; i++)
|
2007-12-15 05:38:23 +08:00
|
|
|
{
|
|
|
|
cd_nelmts = NELMTS(cd_values);
|
2008-09-19 02:08:04 +08:00
|
|
|
filtn = H5Pget_filter2(pid, (unsigned)i, &filt_flags, &cd_nelmts,
|
2007-12-15 05:38:23 +08:00
|
|
|
cd_values, sizeof(f_name), f_name, NULL);
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2008-01-03 03:40:20 +08:00
|
|
|
/* filter ID */
|
|
|
|
if (filtn != filter[i].filtn)
|
2007-12-15 05:38:23 +08:00
|
|
|
return 0;
|
|
|
|
|
2008-01-03 03:40:20 +08:00
|
|
|
/* compare client data values. some filters do return local values */
|
|
|
|
switch (filtn)
|
2007-12-05 03:59:54 +08:00
|
|
|
{
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-21 05:31:34 +08:00
|
|
|
case H5Z_FILTER_SHUFFLE:
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-21 05:31:34 +08:00
|
|
|
/* 1 private client value is returned by DCPL */
|
2008-01-05 03:52:19 +08:00
|
|
|
if ( cd_nelmts != H5Z_SHUFFLE_TOTAL_NPARMS && filter[i].cd_nelmts != H5Z_SHUFFLE_USER_NPARMS )
|
2008-01-03 03:40:20 +08:00
|
|
|
return 0;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2008-01-03 03:40:20 +08:00
|
|
|
/* get dataset's type size */
|
|
|
|
if((size = H5Tget_size(tid)) <= 0)
|
2007-12-21 05:31:34 +08:00
|
|
|
return -1;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2008-01-03 03:40:20 +08:00
|
|
|
/* the private client value holds the dataset's type size */
|
|
|
|
if ( size != cd_values[0] )
|
|
|
|
return 0;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
|
|
|
2007-12-21 05:31:34 +08:00
|
|
|
break;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-21 05:31:34 +08:00
|
|
|
case H5Z_FILTER_SZIP:
|
|
|
|
|
2008-01-04 04:03:38 +08:00
|
|
|
/* 4 private client values are returned by DCPL */
|
2008-01-04 03:59:25 +08:00
|
|
|
if ( cd_nelmts != H5Z_SZIP_TOTAL_NPARMS && filter[i].cd_nelmts != H5Z_SZIP_USER_NPARMS )
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* "User" parameter for pixels-per-block (index 1) */
|
|
|
|
if ( cd_values[H5Z_SZIP_PARM_PPB] != filter[i].cd_values[H5Z_SZIP_PARM_PPB] )
|
|
|
|
return 0;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
|
|
|
2007-12-21 05:31:34 +08:00
|
|
|
break;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-21 05:31:34 +08:00
|
|
|
case H5Z_FILTER_NBIT:
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2008-01-08 03:16:29 +08:00
|
|
|
/* only client data values number of values checked */
|
|
|
|
if ( H5Z_NBIT_USER_NPARMS != filter[i].cd_nelmts)
|
|
|
|
return 0;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2007-12-21 05:31:34 +08:00
|
|
|
break;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-21 05:31:34 +08:00
|
|
|
case H5Z_FILTER_SCALEOFFSET:
|
2008-01-05 03:52:19 +08:00
|
|
|
|
2008-01-08 03:16:29 +08:00
|
|
|
/* only client data values checked */
|
2008-09-16 23:52:51 +08:00
|
|
|
for( j = 0; j < H5Z_SCALEOFFSET_USER_NPARMS; j++)
|
2008-01-08 03:16:29 +08:00
|
|
|
{
|
|
|
|
if (cd_values[j] != filter[i].cd_values[j])
|
|
|
|
{
|
2008-09-16 23:52:51 +08:00
|
|
|
return 0;
|
2008-01-08 03:16:29 +08:00
|
|
|
}
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2008-01-08 03:16:29 +08:00
|
|
|
}
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
|
|
|
2007-12-21 05:31:34 +08:00
|
|
|
break;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2008-01-03 03:40:20 +08:00
|
|
|
/* for these filters values must match, no local values set in DCPL */
|
2007-12-21 05:31:34 +08:00
|
|
|
case H5Z_FILTER_FLETCHER32:
|
|
|
|
case H5Z_FILTER_DEFLATE:
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2008-01-03 03:40:20 +08:00
|
|
|
if ( cd_nelmts != filter[i].cd_nelmts)
|
|
|
|
return 0;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
|
|
for( j = 0; j < cd_nelmts; j++)
|
2007-12-05 03:59:54 +08:00
|
|
|
{
|
2008-01-03 03:40:20 +08:00
|
|
|
if (cd_values[j] != filter[i].cd_values[j])
|
2007-12-21 05:31:34 +08:00
|
|
|
{
|
2008-09-16 23:52:51 +08:00
|
|
|
return 0;
|
2007-12-21 05:31:34 +08:00
|
|
|
}
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2007-12-05 03:59:54 +08:00
|
|
|
}
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2007-12-21 05:31:34 +08:00
|
|
|
break;
|
2008-09-16 23:52:51 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2007-12-21 05:31:34 +08:00
|
|
|
} /* switch */
|
2007-12-05 03:59:54 +08:00
|
|
|
|
2008-01-03 03:40:20 +08:00
|
|
|
}
|
2008-09-16 23:52:51 +08:00
|
|
|
|
2008-01-03 03:40:20 +08:00
|
|
|
return 1;
|
2007-12-05 03:59:54 +08:00
|
|
|
}
|
|
|
|
|