summaryrefslogtreecommitdiffstats
path: root/src/H5RA.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-11-05 20:28:34 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-11-05 20:28:34 (GMT)
commit46f683cf14957d39550e826e374e1f3f5a64958c (patch)
treebbba7b3c43ed2b4af88b78dd8d06636919d5effc /src/H5RA.c
parentb7d05e45c85d44810ca1f63485329002feb14640 (diff)
downloadhdf5-46f683cf14957d39550e826e374e1f3f5a64958c.zip
hdf5-46f683cf14957d39550e826e374e1f3f5a64958c.tar.gz
hdf5-46f683cf14957d39550e826e374e1f3f5a64958c.tar.bz2
[svn-r876] Changes since 19981102
---------------------- ./bin/snapshot Made same fix as for the release script yesterday. ./src/H5D.c ./src/H5Dprivate.h ./src/H5G.c ./src/H5Gprivate.h ./src/H5Gpublic.h ./src/H5O.c ./src/H5Oprivate.h ./src/H5RA.c ./src/H5RAprivate.h ./src/H5T.c ./src/H5Tprivate.h Improved object type checking. Instead of determining the object type by trying to open each of the possible types, we keep a table of associations between object type number (like H5G_GROUP, H5G_DATASET, H5D_TYPE, and H5D_RAGGED) and an `isa' function that returns true if the object header has the right messages to make the object a particular type. This mechanism also allows specialization of object types by permitting an object to satisfy more than one `isa' function. Added `isa' functions for groups, datasets, ragged arrays, and committed data types. ./src/H5config.h.in Added HAVE_STAT_ST_BLOCKS. I thought this had already been added, but apparently not. ./tools/h5ls.c Removed system include files since they're already included by H5private.h and since I wasn't including them portably anyway. By default, 1-byte integer types are printed as integer values instead of ASCII characters. However, the `-s' or `--string' command-line switch causes the data to be interpretted as ASCII. String data types are always printed as character data. Ragged arrays are now identified as ragged arrays and h5ls doesn't descend into the group automatically. This uses the new object type specialization stuff. ./tools/h5tools.c ./tools/h5tools.h Added the ability to print 1-byte integer types as either ASCII or numeric data instead of always ASCII. The default is to print as numeric data.
Diffstat (limited to 'src/H5RA.c')
-rw-r--r--src/H5RA.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/H5RA.c b/src/H5RA.c
index c0ed491..11d02e9 100644
--- a/src/H5RA.c
+++ b/src/H5RA.c
@@ -398,6 +398,67 @@ H5RAopen(hid_t loc_id, const char *name)
/*-------------------------------------------------------------------------
+ * Function: H5RA_isa
+ *
+ * Purpose: Determines if an object is a ragged array.
+ *
+ * Return: Success: TRUE if the object is a ragged array; FALSE
+ * otherwise.
+ *
+ * Failure: Negative
+ *
+ * Programmer: Robb Matzke
+ * Wednesday, November 4, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+htri_t
+H5RA_isa(H5G_entry_t *ent)
+{
+ htri_t exists;
+ H5G_entry_t d_ent;
+
+ FUNC_ENTER(H5RA_isa, FAIL);
+
+ /* Open the container group */
+ if ((exists=H5G_isa(ent))<0) {
+ HRETURN_ERROR(H5E_RAGGED, H5E_CANTINIT, FAIL,
+ "unable to read object header");
+ } else if (!exists) {
+ HRETURN(FALSE);
+ }
+
+ /* Is `raw' a dataset? */
+ if (H5G_find(ent, "raw", NULL, &d_ent)<0 ||
+ (exists=H5D_isa(&d_ent))<0) {
+ HRETURN_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "not found");
+ } else if (!exists) {
+ HRETURN(FALSE);
+ }
+
+ /* Is `over' a dataset? */
+ if (H5G_find(ent, "over", NULL, &d_ent)<0 ||
+ (exists=H5D_isa(&d_ent))<0) {
+ HRETURN_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "not found");
+ } else if (!exists) {
+ HRETURN(FALSE);
+ }
+
+ /* Is `meta' a dataset? */
+ if (H5G_find(ent, "meta", NULL, &d_ent)<0 ||
+ (exists=H5D_isa(&d_ent))<0) {
+ HRETURN_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "not found");
+ } else if (!exists) {
+ HRETURN(FALSE);
+ }
+
+ FUNC_LEAVE(TRUE);
+}
+
+
+/*-------------------------------------------------------------------------
* Function: H5RA_open
*
* Purpose: Open a ragged array. The name of the array is the same as