diff options
author | James Laird <jlaird@hdfgroup.org> | 2006-09-26 18:25:03 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2006-09-26 18:25:03 (GMT) |
commit | 6aeb73dd44ed126dcb3f77b9ff4ff95c2403ea62 (patch) | |
tree | 2a600b3c00b8f554d0a09f4e29e5e0f831a8b356 /hl/src | |
parent | fdbdaf656bc91c4802dd4c58ceb622bb51f390a9 (diff) | |
download | hdf5-6aeb73dd44ed126dcb3f77b9ff4ff95c2403ea62.zip hdf5-6aeb73dd44ed126dcb3f77b9ff4ff95c2403ea62.tar.gz hdf5-6aeb73dd44ed126dcb3f77b9ff4ff95c2403ea62.tar.bz2 |
[svn-r12686] Added compression to Packet Tables. Now both C and C++ packet tables
have an extra parameter that sets the deflate filter.
Added tests, made examples use the new APIs.
Cleaned up include files a little and removed some casts that I hope are
superfluous. If anybody encounters strange errors in the packet table
tests where the chunk size is set to some extremely large value, please
let me know, but I was unable to reproduce this error on any system.
Tested on mir, heping, sol, juniper, VS 6.0. Looked for the chunk size
error on several other systems a month or two ago.
Diffstat (limited to 'hl/src')
-rw-r--r-- | hl/src/H5PT.c | 12 | ||||
-rw-r--r-- | hl/src/H5PTpublic.h | 3 |
2 files changed, 11 insertions, 4 deletions
diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c index da9bde6..ee03a1b 100644 --- a/hl/src/H5PT.c +++ b/hl/src/H5PT.c @@ -57,7 +57,7 @@ herr_t H5PT_get_index(htbl_t *table_id, hsize_t *pt_index); * * Date: March 12, 2004 * - * Comments: This function does not handle compression or fill data + * Comments: This function does not handle fill data * currently. Fill data is not necessary because the * table is initially of size 0. * @@ -69,7 +69,8 @@ herr_t H5PT_get_index(htbl_t *table_id, hsize_t *pt_index); hid_t H5PTcreate_fl ( hid_t loc_id, const char *dset_name, hid_t dtype_id, - hsize_t chunk_size ) + hsize_t chunk_size, + int compression ) { htbl_t * table = NULL; hid_t dset_id = H5I_BADID; @@ -99,6 +100,11 @@ hid_t H5PTcreate_fl ( hid_t loc_id, plist_id = H5Pcreate (H5P_DATASET_CREATE); if ( H5Pset_chunk ( plist_id, 1, dims_chunk ) < 0 ) goto out; + if(compression >= 0 && compression <= 9) + { + if( H5Pset_deflate(plist_id, compression) < 0) + goto out; + } /* Create the dataset. */ if ( (dset_id=H5Dcreate( loc_id, dset_name, dtype_id, space_id, plist_id))<0 ) @@ -175,7 +181,7 @@ hid_t H5PTcreate_vl ( hid_t loc_id, if (vltype < 0) goto out; - if((ret_value=H5PTcreate_fl(loc_id, dset_name, vltype, chunk_size)) <0) + if((ret_value=H5PTcreate_fl(loc_id, dset_name, vltype, chunk_size, 0)) <0) goto out; /* close the vltype */ diff --git a/hl/src/H5PTpublic.h b/hl/src/H5PTpublic.h index 43520d4..b0388e0 100644 --- a/hl/src/H5PTpublic.h +++ b/hl/src/H5PTpublic.h @@ -30,7 +30,8 @@ extern "C" { H5_HLDLL hid_t H5PTcreate_fl ( hid_t loc_id, const char *dset_name, hid_t dtype_id, - hsize_t chunk_size ); + hsize_t chunk_size, + int compression ); H5_HLDLL hid_t H5PTcreate_vl ( hid_t loc_id, const char *dset_name, |