summaryrefslogtreecommitdiffstats
path: root/src/H5P.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-08-06 19:39:22 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-08-06 19:39:22 (GMT)
commitde875442351b3ddd204b65d371536e63de6be8ff (patch)
tree70a5b576c5335e57b8ae210741c14f255a301c13 /src/H5P.c
parent430b1a9c84257bac574fddd09d90cb8676d02cb7 (diff)
downloadhdf5-de875442351b3ddd204b65d371536e63de6be8ff.zip
hdf5-de875442351b3ddd204b65d371536e63de6be8ff.tar.gz
hdf5-de875442351b3ddd204b65d371536e63de6be8ff.tar.bz2
[svn-r578] Changes since 19980805
---------------------- ./MANIFEST Replaced Compression.html with Filters.html ./doc/html/Filters.html ./src/H5Ocomp.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5Z.c ./src/H5Zprivate.h Added two extra arguments to H5Pget_filter() in order to retrieve the filter name. The name is the name registered for the filter with H5Zregister(), but if the dataset creation property originally came from an existing file then the name is that which is stored in the file. ./tools/h5ls.c The `-v' option now prints the names of the filters. ./src/H5B.c ./src/H5Fistore.c ./src/H5O.c ./src/H5Oefl.c ./src/H5Oprivate.h ./src/H5P.c Plugged a memory leak. ./src/H5MMprivate.h H5MM_malloc(0) and H5MM_calloc(0) actually allocate a single byte in order to be sure that we get a valid pointer. ./src/H5S.c ./src/H5Sselect.c Fixed pointer->integer conversions in error return values in three places.
Diffstat (limited to 'src/H5P.c')
-rw-r--r--src/H5P.c47
1 files changed, 30 insertions, 17 deletions
diff --git a/src/H5P.c b/src/H5P.c
index a509486..63e5844 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -346,7 +346,8 @@ H5P_close (H5P_class_t type, void *plist)
break;
case H5P_DATASET_CREATE:
- H5O_reset (H5O_EFL, &(dc_list->efl));
+ H5O_reset(H5O_EFL, &(dc_list->efl));
+ H5O_reset(H5O_PLINE, &(dc_list->pline));
break;
case H5P_DATASET_XFER:
@@ -2302,13 +2303,15 @@ H5Pget_nfilters (hid_t plist_id)
*/
H5Z_filter_t
H5Pget_filter (hid_t plist_id, int idx, unsigned int *flags/*out*/,
- size_t *cd_nelmts/*in_out*/, unsigned cd_values[]/*out*/)
+ size_t *cd_nelmts/*in_out*/, unsigned cd_values[]/*out*/,
+ size_t namelen, char name[]/*out*/)
{
H5D_create_t *plist = NULL;
size_t i;
FUNC_ENTER (H5Pget_filter, FAIL);
- H5TRACE5("Zf","iIsx*zx",plist_id,idx,flags,cd_nelmts,cd_values);
+ H5TRACE7("Zf","iIsx*zxzx",plist_id,idx,flags,cd_nelmts,cd_values,namelen,
+ name);
/* Check arguments */
if (H5P_DATASET_XFER==H5P_get_class(plist_id)) {
@@ -2355,6 +2358,16 @@ H5Pget_filter (hid_t plist_id, int idx, unsigned int *flags/*out*/,
}
if (cd_nelmts) *cd_nelmts = plist->pline.filter[idx].cd_nelmts;
+ if (namelen>0 && name) {
+ const char *s = plist->pline.filter[idx].name;
+ if (!s) {
+ H5Z_class_t *cls = H5Z_find(plist->pline.filter[idx].id);
+ if (cls) s = cls->name;
+ }
+ if (s) strncpy(name, s, namelen);
+ else name[0] = '\0';
+ }
+
FUNC_LEAVE (plist->pline.filter[idx].id);
}
@@ -2737,7 +2750,6 @@ H5P_copy (H5P_class_t type, const void *src)
{
size_t size;
void *dst = NULL;
- int i;
const H5D_create_t *dc_src = NULL;
H5D_create_t *dc_dst = NULL;
const H5F_access_t *fa_src = NULL;
@@ -2809,20 +2821,21 @@ H5P_copy (H5P_class_t type, const void *src)
case H5P_DATASET_CREATE:
dc_src = (const H5D_create_t*)src;
dc_dst = (H5D_create_t*)dst;
-
- if (dc_src->efl.nalloc>0) {
- dc_dst->efl.slot = H5MM_malloc (dc_dst->efl.nalloc *
- sizeof(H5O_efl_entry_t));
- if (NULL==dc_dst->efl.slot) {
- HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL,
- "memory allocation failed");
- }
- for (i=0; i<dc_src->efl.nused; i++) {
- char *s = H5MM_xstrdup (dc_src->efl.slot[i].name);
- dc_dst->efl.slot[i] = dc_src->efl.slot[i];
- dc_dst->efl.slot[i].name = s;
- }
+
+ /* Copy the external file list */
+ HDmemset(&(dc_dst->efl), 0, sizeof(dc_dst->efl));
+ if (NULL==H5O_copy(H5O_EFL, &(dc_src->efl), &(dc_dst->efl))) {
+ HRETURN_ERROR(H5E_TEMPLATE, H5E_CANTINIT, NULL,
+ "unable to copy external file list message");
+ }
+
+ /* Copy the filter pipeline */
+ if (NULL==H5O_copy(H5O_PLINE, &(dc_src->pline), &(dc_dst->pline))) {
+ HRETURN_ERROR(H5E_TEMPLATE, H5E_CANTINIT, NULL,
+ "unable to copy filter pipeline message");
}
+
+
break;
case H5P_DATASET_XFER: