diff options
author | MuQun Yang <ymuqun@hdfgroup.org> | 2005-01-06 19:04:15 (GMT) |
---|---|---|
committer | MuQun Yang <ymuqun@hdfgroup.org> | 2005-01-06 19:04:15 (GMT) |
commit | ad633eafcc9f1961bcd56d0508263caf9931b3b0 (patch) | |
tree | b99b65a80700e9a982bf2fc76f636bd9aefae960 /src/H5Pdcpl.c | |
parent | 48822308a7e5f25f203c99e3da13dac585b90b02 (diff) | |
download | hdf5-ad633eafcc9f1961bcd56d0508263caf9931b3b0.zip hdf5-ad633eafcc9f1961bcd56d0508263caf9931b3b0.tar.gz hdf5-ad633eafcc9f1961bcd56d0508263caf9931b3b0.tar.bz2 |
[svn-r9758] Purpose:
Adding framework of N-bit filter
Description:
N-bit filter is required for NetCDF project.
To add N-bit filter, configure.in configure, Makefile.in under src and other
filter-related source code needs to be updated.
Currently, N-bit tests are turned off from the library. So the change will affect daily test.
Solution:
Platforms tested:
sol 2.7, linux 2.4, aix 5.1
Misc. update:
Diffstat (limited to 'src/H5Pdcpl.c')
-rw-r--r-- | src/H5Pdcpl.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 7a71c29..3d7c2e7 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -1219,6 +1219,52 @@ done: /*------------------------------------------------------------------------- + * Function: H5Pset_nbit + * + * Purpose: Sets nbit filter for a dataset creation property list + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Kent Yang + * Wednesday, November 13, 2002 + * + * Modifications: + * Xiaowen Wu + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_nbit(hid_t plist_id) +{ + H5O_pline_t pline; + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value=SUCCEED; /* return value */ + + FUNC_ENTER_API(H5Pset_nbit, FAIL); + H5TRACE1("e","i",plist_id); + + /* Check arguments */ + if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) + HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); + + /* Get the plist structure */ + if(NULL == (plist = H5I_object(plist_id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + + /* Add the nbit filter */ + if(H5P_get(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline"); + if(H5Z_append(&pline, H5Z_FILTER_NBIT, H5Z_FLAG_OPTIONAL, 0, NULL)<0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to add nbit filter to pipeline"); + if(H5P_set(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to set pipeline"); + +done: + FUNC_LEAVE_API(ret_value); +} /* end H5Pset_nbit() */ + + +/*------------------------------------------------------------------------- * Function: H5Pset_fletcher32 * * Purpose: Sets Fletcher32 checksum of EDC for a dataset creation |