summaryrefslogtreecommitdiffstats
path: root/src/H5P.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-01-21 20:01:02 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-01-21 20:01:02 (GMT)
commitf5cc0548b8dacfefee4878075f568b5f124e9dc3 (patch)
tree8dc8edc28b7cde4a01e4cb650d2483aa46c2ecdd /src/H5P.c
parentb7f919cccb89f991e3ddc625bba675c2ea483b15 (diff)
downloadhdf5-f5cc0548b8dacfefee4878075f568b5f124e9dc3.zip
hdf5-f5cc0548b8dacfefee4878075f568b5f124e9dc3.tar.gz
hdf5-f5cc0548b8dacfefee4878075f568b5f124e9dc3.tar.bz2
[svn-r161] Changes since 19980121
---------------------- ./MANIFEST ./src/H5Psimp.c [NEW] ./src/Makefile.in Added H5Psimp.c and populated it with some conversion functions. Eventually the parts of H5P.c that operate on simple data spaces will be migrated to H5Psimp.c and other files will be created for other types of data spaces. ./src/H5D.c The read pipeline, H5Dread(), has been updated to handle data space conversion although the actual simple data space conversion functions don't do anything yet. But we're getting really close! ./src/H5P.c ./src/H5Pprivate.h Added H5P_find() to locate data space conversion functions. Added typedefs for structs related to data space conversion.
Diffstat (limited to 'src/H5P.c')
-rw-r--r--src/H5P.c61
1 files changed, 59 insertions, 2 deletions
diff --git a/src/H5P.c b/src/H5P.c
index 4ea8117..f6b0ff1 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -23,11 +23,11 @@ static char RcsId[] = "@(#)$Revision$";
#include <H5Oprivate.h> /*object headers */
#include <H5Pprivate.h> /* Data-space functions */
-#define PABLO_MASK H5P_mask
/* Interface initialization */
-static intn interface_initialize_g = FALSE;
+#define PABLO_MASK H5P_mask
#define INTERFACE_INIT H5P_init_interface
+static intn interface_initialize_g = FALSE;
static herr_t H5P_init_interface(void);
static void H5P_term_interface(void);
@@ -892,3 +892,60 @@ H5Pset_space(hid_t sid, intn rank, const size_t *dims)
/* Normal function cleanup */
FUNC_LEAVE(ret_value);
}
+
+/*-------------------------------------------------------------------------
+ * Function: H5P_find
+ *
+ * Purpose: Given source and destination data spaces (SRC and DST) this
+ * function locates the data space conversion functions and
+ * initializes CONV to point to them.
+ *
+ * Return: Success: Pointer to a data space conversion callback
+ * list.
+ *
+ * Failure: NULL
+ *
+ * Programmer: Robb Matzke
+ * Wednesday, January 21, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+const H5P_conv_t *
+H5P_find (const H5P_t *src, const H5P_t *dst)
+{
+ static H5P_conv_t _conv;
+ static const H5P_conv_t *conv = NULL;
+
+ FUNC_ENTER (H5P_find, NULL);
+
+ /* Check args */
+ assert (src && H5P_SIMPLE==src->type);
+ assert (dst && H5P_SIMPLE==dst->type);
+
+ /*
+ * We can't do conversion if the source and destination select a
+ * different number of data points.
+ */
+ if (H5P_get_npoints (src) != H5P_get_npoints (dst)) {
+ HRETURN_ERROR (H5E_DATASPACE, H5E_BADRANGE, NULL,
+ "src and dest data spaces are different sizes");
+ }
+
+ /*
+ * Initialize pointers. This will eventually be a table lookup based
+ * on the source and destination data spaces, similar to H5T_find(), but
+ * for now we only support simple data spaces.
+ */
+ if (!conv) {
+ _conv.init = H5P_simp_init;
+ _conv.fgath = H5P_simp_fgath;
+ _conv.mscat = H5P_simp_mscat;
+ _conv.mgath = H5P_simp_mgath;
+ _conv.fscat = H5P_simp_fscat;
+ conv = &_conv;
+ }
+
+ FUNC_LEAVE (conv);
+}