summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-11-15 02:55:39 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-11-15 02:55:39 (GMT)
commita1708eb023f2c8f8ac6c2c17bf1e598c8dff956e (patch)
tree34c87a3753b36c4c8d689d58bf456eaf261cd235 /src/H5S.c
parentbea1e576c5ef5500678f7ce913d835341b625e8f (diff)
downloadhdf5-a1708eb023f2c8f8ac6c2c17bf1e598c8dff956e.zip
hdf5-a1708eb023f2c8f8ac6c2c17bf1e598c8dff956e.tar.gz
hdf5-a1708eb023f2c8f8ac6c2c17bf1e598c8dff956e.tar.bz2
[svn-r11712] Purpose:
New feature Description: Check in baseline for compact group revisions, which radically revises the source code for managing groups and object headers. WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! This initiates the "unstable" phase of the 1.7.x branch, leading up to the 1.8.0 release. Please test this code, but do _NOT_ keep files created with it - the format will change again before the release and you will not be able to read your old files!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! WARNING!!!! Solution: There's too many changes to really describe them all, but some of them include: - Stop abusing the H5G_entry_t structure and split it into two separate structures for non-symbol table node use within the library: H5O_loc_t for object locations in a file and H5G_name_t to store the path to an opened object. H5G_entry_t is now only used for storing symbol table entries on disk. - Retire H5G_namei() in favor of a more general mechanism for traversing group paths and issuing callbacks on objects located. This gets us out of the business of hacking H5G_namei() for new features, generally. - Revised H5O* routines to take a H5O_loc_t instead of H5G_entry_t - Lots more... Platforms tested: h5committested and maybe another dozen configurations.... :-)
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c71
1 files changed, 35 insertions, 36 deletions
diff --git a/src/H5S.c b/src/H5S.c
index 4190ca4..bc58fb8 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -30,6 +30,11 @@
#include "H5Spkg.h" /* Dataspaces */
/* Local macro definitions */
+
+/* Number of reserved IDs in ID group */
+#define H5S_RESERVED_ATOMS 2
+
+/* Version of datatype encoding */
#define H5S_ENCODE_VERSION 0
/* Local static function prototypes */
@@ -1042,39 +1047,37 @@ done:
* Programmer: Robb Matzke
* Tuesday, December 9, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
-H5S_modify(H5G_entry_t *ent, const H5S_t *ds, hbool_t update_time, hid_t dxpl_id)
+H5S_modify(H5O_loc_t *loc, const H5S_t *ds, hbool_t update_time, hid_t dxpl_id)
{
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5S_modify, FAIL);
+ FUNC_ENTER_NOAPI(H5S_modify, FAIL)
- assert(ent);
- assert(ds);
+ HDassert(loc);
+ HDassert(ds);
- switch (H5S_GET_EXTENT_TYPE(ds)) {
+ switch(H5S_GET_EXTENT_TYPE(ds)) {
case H5S_NULL:
case H5S_SCALAR:
case H5S_SIMPLE:
- if (H5O_modify(ent, H5O_SDSPACE_ID, 0, 0, update_time, &(ds->extent), dxpl_id)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update simple data space message");
+ if(H5O_modify(loc, H5O_SDSPACE_ID, 0, 0, update_time, &(ds->extent), dxpl_id) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update simple dataspace message")
break;
case H5S_COMPLEX:
- HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "complex data spaces are not implemented yet");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "complex dataspaces are not implemented yet")
default:
- assert("unknown data space class" && 0);
+ HDassert("unknown dataspace class" && 0);
break;
- }
+ } /* end switch */
done:
- FUNC_LEAVE_NOAPI(ret_value);
-}
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5S_modify() */
/*-------------------------------------------------------------------------
@@ -1143,44 +1146,40 @@ done:
* Programmer: Robb Matzke
* Tuesday, December 9, 1997
*
- * Modifications:
- * Robb Matzke, 9 Jun 1998
- * Removed the unused file argument since the file is now part of the
- * ENT argument.
*-------------------------------------------------------------------------
*/
H5S_t *
-H5S_read(const H5G_entry_t *ent, hid_t dxpl_id)
+H5S_read(const H5O_loc_t *loc, hid_t dxpl_id)
{
- H5S_t *ds = NULL; /* Dataspace to return */
- H5S_t *ret_value; /* Return value */
+ H5S_t *ds = NULL; /* Dataspace to return */
+ H5S_t *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5S_read, NULL);
+ FUNC_ENTER_NOAPI(H5S_read, NULL)
/* check args */
- assert(ent);
+ HDassert(loc);
- if (NULL==(ds = H5FL_CALLOC(H5S_t)))
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
+ if(NULL == (ds = H5FL_CALLOC(H5S_t)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
- if (H5O_read(ent, H5O_SDSPACE_ID, 0, &(ds->extent), dxpl_id) == NULL)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to load dataspace info from dataset header");
+ if(H5O_read(loc, H5O_SDSPACE_ID, 0, &(ds->extent), dxpl_id) == NULL)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to load dataspace info from dataset header")
/* Default to entire dataspace being selected */
- if(H5S_select_all(ds,0)<0)
- HGOTO_ERROR (H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection");
+ if(H5S_select_all(ds, 0) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection")
/* Set the value for successful return */
- ret_value=ds;
+ ret_value = ds;
done:
- if(ret_value==NULL) {
- if(ds!=NULL)
- H5FL_FREE(H5S_t,ds);
+ if(ret_value == NULL) {
+ if(ds != NULL)
+ H5FL_FREE(H5S_t, ds);
} /* end if */
- FUNC_LEAVE_NOAPI(ret_value);
-}
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5S_read() */
/*--------------------------------------------------------------------------