summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1997-08-01 21:23:21 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1997-08-01 21:23:21 (GMT)
commit12ebf40c4e8ce421b103a7443428d13c7f2f23b6 (patch)
tree1b141a81528488d7d3598eebe274f4d1d56c99f7 /src
parent332b6fd6765b28bfd1083af6e366ccc621feea1e (diff)
downloadhdf5-12ebf40c4e8ce421b103a7443428d13c7f2f23b6.zip
hdf5-12ebf40c4e8ce421b103a7443428d13c7f2f23b6.tar.gz
hdf5-12ebf40c4e8ce421b103a7443428d13c7f2f23b6.tar.bz2
[svn-r8] Hooked the dimensionality objects into the "meta-object" interface.
Diffstat (limited to 'src')
-rw-r--r--src/H5P.c66
-rw-r--r--src/H5Pprivate.h1
-rw-r--r--src/H5Pproto.h6
3 files changed, 35 insertions, 38 deletions
diff --git a/src/H5P.c b/src/H5P.c
index ad24b07..e15063a 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -72,44 +72,42 @@ static herr_t H5P_init_interface(void)
FUNC_LEAVE(H5P_mask, ID_H5P_init_interface, ret_value);
} /* H5P_init_interface */
-#ifdef NOT_YET
/*--------------------------------------------------------------------------
NAME
- H5Tcreate
+ H5P_create
PURPOSE
- Create a new HDF5 data-type object
+ Create a new HDF5 dimensionality object
USAGE
- hatom_t H5Tcreate(owner_id, type, name)
+ hatom_t H5P_create(owner_id, type, name)
hatom_t owner_id; IN: Group/file which owns this object
hobjtype_t type; IN: Type of object to create
const char *name; IN: Name of the object
RETURNS
Returns ID (atom) on success, FAIL on failure
DESCRIPTION
- This function actually creates the data-type object.
+ This function actually creates the dimensionality object.
--------------------------------------------------------------------------*/
-hatom_t H5T_create(hatom_t owner_id, hobjtype_t type, const char *name)
+hatom_t H5P_create(hatom_t owner_id, hobjtype_t type, const char *name)
{
- CONSTR(FUNC, "H5T_create"); /* for HERROR */
- h5_datatype_t *new_dt; /* new data-type object to create */
+ CONSTR(FUNC, "H5P_create"); /* for HERROR */
+ H5P_dim_t *new_dim; /* new dimensionality object to create */
hatom_t ret_value = SUCCEED;
- FUNC_ENTER(H5T_mask, ID_H5Tcreate, H5T_init_interface, FAIL);
+ FUNC_ENTER(H5P_mask, ID_H5P_create, H5P_init_interface, FAIL);
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
/* Allocate space for the new data-type */
- if((new_dt=HDmalloc(sizeof(h5_datatype_t)))==NULL)
+ if((new_dim=HDmalloc(sizeof(H5P_dim_t)))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL);
- /* Initialize the datatype */
- new_dt->dt.base=0; /* No Default datatype */
- new_dt->name=HDstrdup(name); /* Make a copy of the datatype's name */
- new_dt->ci=NULL; /* Set the complex information to NULL */
+ /* Initialize the dimensionality object */
+ new_dim->rank=0;
+ new_dim->dims=NULL;
/* Register the new datatype and get an ID for it */
- if((ret_value=H5Aregister_atom(H5_DATATYPE, (const VOIDP)new_dt))==FAIL)
+ if((ret_value=H5Aregister_atom(H5_DATASPACE, (const VOIDP)new_dim))==FAIL)
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL);
done:
@@ -120,9 +118,8 @@ done:
/* Normal function cleanup */
- FUNC_LEAVE(H5T_mask, ID_H5Tcreate, ret_value);
-} /* end H5T_create() */
-#endif /* NOT_YET */
+ FUNC_LEAVE(H5P_mask, ID_H5P_create, ret_value);
+} /* end H5P_create() */
/*--------------------------------------------------------------------------
NAME
@@ -167,40 +164,36 @@ done:
FUNC_LEAVE(H5P_mask, ID_H5Pnelem, ret_value);
} /* end H5Pnelem() */
-#ifdef NOT_YET
/*--------------------------------------------------------------------------
NAME
- H5Trelease
+ H5P_release
PURPOSE
- Release access to an HDF5 datatype object.
+ Release access to an HDF5 dimensionality object.
USAGE
- herr_t H5Trelease(oid)
+ herr_t H5P_release(oid)
hatom_t oid; IN: Object to release access to
RETURNS
SUCCEED/FAIL
DESCRIPTION
- This function releases a datatype from active use by a user.
+ This function releases a dimensionality from active use by a user.
--------------------------------------------------------------------------*/
-herr_t H5T_release(hatom_t oid)
+herr_t H5P_release(hatom_t oid)
{
- CONSTR(FUNC, "H5T_release"); /* for HERROR */
- h5_datatype_t *dt; /* new data-type object to create */
+ CONSTR(FUNC, "H5P_release"); /* for HERROR */
+ H5P_dim_t *dim; /* dimensionality object to release */
herr_t ret_value = SUCCEED;
- FUNC_ENTER(H5T_mask, ID_H5Trelease, H5T_init_interface, FAIL);
+ FUNC_ENTER(H5P_mask, ID_H5Prelease, H5P_init_interface, FAIL);
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
/* Chuck the object! :-) */
- if((dt=H5Aremove_atom(oid))==NULL)
+ if((dim=H5Aremove_atom(oid))==NULL)
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL);
- if(dt->name!=NULL)
- HDfree(dt->name);
- if(dt->ci!=NULL)
- {
- } /* end if */
- HDfree(dt);
+ if(dim->rank>0)
+ HDfree(dim->dims);
+ HDfree(dim);
done:
if(ret_value == FAIL)
@@ -210,7 +203,6 @@ done:
/* Normal function cleanup */
- FUNC_LEAVE(H5T_mask, ID_H5Trelease, ret_value);
-} /* end H5T_release() */
-#endif /* NOT_YET */
+ FUNC_LEAVE(H5P_mask, ID_H5P_release, ret_value);
+} /* end H5P_release() */
diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h
index bad8702..776367d 100644
--- a/src/H5Pprivate.h
+++ b/src/H5Pprivate.h
@@ -27,4 +27,3 @@ static herr_t H5P_init_interface(void);
#endif /* H5PPRIVATE_H */
-
diff --git a/src/H5Pproto.h b/src/H5Pproto.h
index 218949a..b0337a0 100644
--- a/src/H5Pproto.h
+++ b/src/H5Pproto.h
@@ -22,6 +22,10 @@
/* Define atomic datatypes */
#define H5P_SCALAR MAKE_ATOM(H5_DATASPACE,0)
+typedef struct {
+ uintn rank;
+ uint32 *dims;
+ } H5P_dim_t;
#if defined c_plusplus || defined __cplusplus
extern "C"
@@ -29,7 +33,9 @@ extern "C"
#endif /* c_plusplus || __cplusplus */
/* Functions in H5P.c */
+hatom_t H5P_create(hatom_t owner_id, hobjtype_t type, const char *name);
uintn H5Pnelem(hatom_t dim_id);
+herr_t H5P_release(hatom_t oid);
#if defined c_plusplus || defined __cplusplus
}