diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 1998-07-06 21:01:13 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 1998-07-06 21:01:13 (GMT) |
commit | 43f13aeca28a722d6436d43dcd84a59918dc0950 (patch) | |
tree | 1ee94e4f1b64a7d027112d616d8617992c09520a /src/H5Osdspace.c | |
parent | d70e61b1dbd7ff16aa4ac5cad4a69bf87b84f208 (diff) | |
download | hdf5-43f13aeca28a722d6436d43dcd84a59918dc0950.zip hdf5-43f13aeca28a722d6436d43dcd84a59918dc0950.tar.gz hdf5-43f13aeca28a722d6436d43dcd84a59918dc0950.tar.bz2 |
[svn-r451] Completely tore out existing dataspace API and replaced with code to match
API defined in the html/Dataspaces.html document. This code does not include
support for strides, merging selections, or permutations of coordinates yet,
but it's a drop-in replacement for the existing API with the same features.
Diffstat (limited to 'src/H5Osdspace.c')
-rw-r--r-- | src/H5Osdspace.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index a780af3..117dcf3 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -102,7 +102,7 @@ H5O_sdspace_decode(H5F_t *f, const uint8 *p, H5O_shared_t __unused__ *sh) for (u = 0; u < sdim->rank; u++) { H5F_decode_length (f, p, sdim->size[u]); } - if (flags & 0x01) { + if (flags & H5S_VALID_MAX) { if (NULL==(sdim->max=H5MM_malloc(sizeof(sdim->max[0])* sdim->rank))) { HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, @@ -112,7 +112,8 @@ H5O_sdspace_decode(H5F_t *f, const uint8 *p, H5O_shared_t __unused__ *sh) H5F_decode_length (f, p, sdim->max[u]); } } - if (flags & 0x02) { +#ifdef LATER + if (flags & H5S_VALID_PERM) { if (NULL==(sdim->perm=H5MM_malloc(sizeof(sdim->perm[0])* sdim->rank))) { HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, @@ -121,6 +122,7 @@ H5O_sdspace_decode(H5F_t *f, const uint8 *p, H5O_shared_t __unused__ *sh) for (u = 0; u < sdim->rank; u++) UINT32DECODE(p, sdim->perm[u]); } +#endif } } @@ -171,8 +173,10 @@ H5O_sdspace_encode(H5F_t *f, uint8 *p, const void *mesg) assert(sdim); /* set flags */ - if (sdim->max) flags |= 0x01; - if (sdim->perm) flags |= 0x02; + if (sdim->max) flags |= H5S_VALID_MAX; +#ifdef LATER + if (sdim->perm) flags |= H5S_VALID_PERM; +#endif /* encode */ UINT32ENCODE(p, sdim->rank); @@ -181,15 +185,17 @@ H5O_sdspace_encode(H5F_t *f, uint8 *p, const void *mesg) for (u = 0; u < sdim->rank; u++) { H5F_encode_length (f, p, sdim->size[u]); } - if (flags & 0x01) { + if (flags & H5S_VALID_MAX) { for (u = 0; u < sdim->rank; u++) { H5F_encode_length (f, p, sdim->max[u]); } } - if (flags & 0x02) { +#ifdef LATER + if (flags & H5S_VALID_PERM) { for (u = 0; u < sdim->rank; u++) UINT32ENCODE(p, sdim->perm[u]); } +#endif } FUNC_LEAVE(SUCCEED); } @@ -241,6 +247,7 @@ H5O_sdspace_copy(const void *mesg, void *dest) } HDmemcpy (dst->max, src->max, src->rank*sizeof(src->max[0])); } +#ifdef LATER if (src->perm) { if (NULL==(dst->perm=H5MM_calloc(src->rank*sizeof(src->perm[0])))) { HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, @@ -248,6 +255,7 @@ H5O_sdspace_copy(const void *mesg, void *dest) } HDmemcpy (dst->perm, src->perm, src->rank*sizeof(src->perm[0])); } +#endif FUNC_LEAVE((void *) dst); } @@ -278,7 +286,9 @@ H5O_sdspace_reset(void *_mesg) FUNC_ENTER (H5O_sdspace_reset, FAIL); mesg->size = H5MM_xfree (mesg->size); mesg->max = H5MM_xfree (mesg->max); +#ifdef LATER mesg->perm = H5MM_xfree (mesg->perm); +#endif FUNC_LEAVE (SUCCEED); } @@ -321,8 +331,10 @@ H5O_sdspace_size(H5F_t *f, const void *mesg) /* add in the space for the maximum dimensions, if they are present */ ret_value += sdim->max ? sdim->rank * H5F_SIZEOF_SIZE (f) : 0; +#ifdef LATER /* add in the space for the dimension permutations, if they are present */ ret_value += sdim->perm ? sdim->rank * 4 : 0; +#endif FUNC_LEAVE(ret_value); } @@ -386,6 +398,7 @@ H5O_sdspace_debug(H5F_t __unused__ *f, const void *mesg, HDfprintf (stream, "CONSTANT\n"); } +#ifdef LATER if (sdim->perm) { HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Dim Perm:"); for (u = 0; u < sdim->rank; u++) { @@ -393,6 +406,7 @@ H5O_sdspace_debug(H5F_t __unused__ *f, const void *mesg, (unsigned long) (sdim->perm[u])); } } +#endif FUNC_LEAVE(SUCCEED); } |