summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-02-03 17:03:13 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-02-03 17:03:13 (GMT)
commit137bc83f7a8f1f552b53a97d21d89269c844a051 (patch)
tree202ed34e5641d70c810a3f53e09d65b913b25402 /src/H5D.c
parent6cbd6722513cede31afd1826cb842b947ae8b996 (diff)
downloadhdf5-137bc83f7a8f1f552b53a97d21d89269c844a051.zip
hdf5-137bc83f7a8f1f552b53a97d21d89269c844a051.tar.gz
hdf5-137bc83f7a8f1f552b53a97d21d89269c844a051.tar.bz2
[svn-r213] Changes since 19980130
---------------------- ./MANIFEST Added H5Fmpio.c. One way to check that you've properly included new files is to run `./bin/release none', then unpack the resulting tar file somewhere and try to compile it. The tar file will be ./releases/hdf-5.0.0a.tar. ./config/freebsd2.2.1 ./config/linux Added `-ansi' ./acconfig.h Added definitions for PHDF5 and HAVE_PARALLEL. ./configure.in Added minimal support for parallel build. Kim and Albert will have to flesh this out or I can do it if they're more specific about what they need. ./config/commence.in Added default value for $(RUNTEST) ./config/conclude.in `make test' uses value of $(RUNTEST) to run test cases. ./src/Makefile.in Added PARALLEL_SRC for conditional compilation of H5Fmpio.c ./src/H5D.c ./src/H5Dpublic.h Added H5Dget_type() for Elena NOTE: These changes require that configure be rerun. If you're using GNU make it will happen automatically, otherwise do it by hand.
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c52
1 files changed, 51 insertions, 1 deletions
diff --git a/src/H5D.c b/src/H5D.c
index ef88f00..86e7fdb 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -317,7 +317,7 @@ H5Dclose(hid_t dataset_id)
*
* Return: Success: ID for a copy of the data space. The data
* space should be released by calling
- * H5Dclose().
+ * H5Pclose().
*
* Failure: FAIL
*
@@ -357,6 +357,56 @@ H5Dget_space (hid_t dataset_id)
FUNC_LEAVE (ret_value);
}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Dget_type
+ *
+ * Purpose: Returns a copy of the file data type for a dataset.
+ *
+ * Return: Success: ID for a copy of the data type. The data
+ * type should be released by calling
+ * H5Tclose().
+ *
+ * Failure: FAIL
+ *
+ * Programmer: Robb Matzke
+ * Tuesday, February 3, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+hid_t
+H5Dget_type (hid_t dataset_id)
+{
+
+ H5D_t *dataset = NULL;
+ H5T_t *copied_type = NULL;
+ hid_t ret_value = FAIL;
+
+ FUNC_ENTER (H5Dget_type, FAIL);
+
+ /* Check args */
+ if (H5_DATASET!=H5A_group (dataset_id) ||
+ NULL==(dataset=H5A_object (dataset_id))) {
+ HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset");
+ }
+
+ /* Copy the data type */
+ if (NULL==(copied_type=H5T_copy (dataset->type))) {
+ HRETURN_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL,
+ "unable to copy the data type");
+ }
+
+ /* Create an atom */
+ if ((ret_value=H5A_register (H5_DATATYPE, copied_type))<0) {
+ HRETURN_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL,
+ "unable to register data type");
+ }
+
+ FUNC_LEAVE (ret_value);
+}
/*-------------------------------------------------------------------------
* Function: H5Dread