diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 1998-01-27 21:11:07 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 1998-01-27 21:11:07 (GMT) |
commit | 6b2d17d4bba013f6dca151334ff951424090c67e (patch) | |
tree | 4292f8249f2cdfbd9e91760ce9a780915a776c2d | |
parent | 9a8e8a659dd9c1c1f32940087d2796df07d98b5b (diff) | |
download | hdf5-6b2d17d4bba013f6dca151334ff951424090c67e.zip hdf5-6b2d17d4bba013f6dca151334ff951424090c67e.tar.gz hdf5-6b2d17d4bba013f6dca151334ff951424090c67e.tar.bz2 |
[svn-r173] ifdef'ed out H5Pcreate function and put in H5Pcreate_simple function.
-rw-r--r-- | src/H5P.c | 58 | ||||
-rw-r--r-- | src/H5Ppublic.h | 3 |
2 files changed, 61 insertions, 0 deletions
@@ -31,6 +31,7 @@ static intn interface_initialize_g = FALSE; static herr_t H5P_init_interface(void); static void H5P_term_interface(void); + /*-------------------------------------------------------------------------- NAME H5P_init_interface -- Initialize interface-specific information @@ -58,6 +59,7 @@ H5P_init_interface(void) FUNC_LEAVE(ret_value); } + /*-------------------------------------------------------------------------- NAME H5P_term_interface @@ -82,6 +84,57 @@ H5P_term_interface(void) } /*------------------------------------------------------------------------- + * Function: H5Pcreate_simple + * + * Purpose: Creates a new simple data space object and opens it for access. + * + * Return: Success: The ID for the new simple data space object. + * + * Failure: FAIL + * + * Errors: + * + * Programmer: Quincey Koziol + * Tuesday, January 27, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +hid_t +H5Pcreate_simple(intn rank, size_t dims[]) +{ + H5P_t *ds = NULL; + hid_t ret_value = FAIL; + + FUNC_ENTER(H5Pcreate, FAIL); + H5ECLEAR; + + ds = H5MM_xcalloc(1, sizeof(H5P_t)); + ds->type = H5P_SIMPLE; + + /* Initialize rank and dimensions */ + ds->u.simple.rank = rank; + ds->u.simple.dim_flags = 0; /* max & perm information is not valid/useful */ + ds->u.simple.size = H5MM_xcalloc(1, rank*sizeof(size_t)); + HDmemcpy(ds->u.simple.size, dims, rank*sizeof(size_t)); + ds->u.simple.max = H5MM_xcalloc(1, rank*sizeof(size_t)); + ds->u.simple.perm = H5MM_xcalloc(1, rank*sizeof(intn)); + + /* Register the new data space and get an ID for it */ + if ((ret_value = H5A_register(H5_DATASPACE, ds)) < 0) { + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, + "unable to register data space for ID"); + } + done: + if (ret_value < 0) { + H5MM_xfree(ds); + } + FUNC_LEAVE(ret_value); +} + +#ifdef OLD_WAY +/*------------------------------------------------------------------------- * Function: H5Pcreate * * Purpose: Creates a new data space object and opens it for access. @@ -140,6 +193,7 @@ H5Pcreate(H5P_class_t type) } FUNC_LEAVE(ret_value); } +#endif /* OLD_WAY */ /*------------------------------------------------------------------------- * Function: H5Pclose @@ -717,6 +771,7 @@ H5P_cmp(const H5P_t *ds1, const H5P_t *ds2) FUNC_LEAVE(0); } + /*-------------------------------------------------------------------------- NAME H5P_is_simple @@ -747,6 +802,7 @@ H5P_is_simple(const H5P_t *sdim) FUNC_LEAVE(ret_value); } + /*-------------------------------------------------------------------------- NAME H5Pis_simple @@ -785,6 +841,7 @@ H5Pis_simple(hid_t sid) FUNC_LEAVE(ret_value); } + /*-------------------------------------------------------------------------- NAME H5Pset_space @@ -893,6 +950,7 @@ H5Pset_space(hid_t sid, intn rank, const size_t *dims) FUNC_LEAVE(ret_value); } + /*------------------------------------------------------------------------- * Function: H5P_find * diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index e7b1dab..e5c800f 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -36,7 +36,10 @@ extern "C" { #endif /* Functions in H5P.c */ +#ifdef OLD_WAY hid_t H5Pcreate (H5P_class_t type); +#endif /* OLD_WAY */ +hid_t H5Pcreate_simple (intn rank, size_t dims[]); herr_t H5Pclose (hid_t space_id); size_t H5Pget_npoints (hid_t space_id); intn H5Pget_ndims (hid_t space_id); |