diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Oattr.c | 2 | ||||
-rw-r--r-- | src/H5S.c | 46 | ||||
-rw-r--r-- | src/H5Sprivate.h | 2 |
3 files changed, 49 insertions, 1 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 99551ee..eaa80ba 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -429,7 +429,7 @@ H5O_attr_debug(H5F_t *f, const void *_mesg, FILE * stream, intn indent, "Data space size:", (unsigned long)(mesg->ds_size)); fprintf(stream, "%*sData space...\n", indent, ""); - (H5O_SDSPACE->debug)(f, mesg->ds, stream, indent+3, MAX(0, fwidth-3)); + H5S_debug(f, mesg->ds, stream, indent+3, MAX(0, fwidth-3)); FUNC_LEAVE(SUCCEED); } @@ -1429,3 +1429,49 @@ H5Screate_simple (int rank, const hsize_t *dims, const hsize_t *maxdims) if (ret_value<0 && space) H5S_close(space); FUNC_LEAVE(ret_value); } + + +/*------------------------------------------------------------------------- + * Function: H5S_debug + * + * Purpose: Prints debugging information about a data space. + * + * Return: Success: SUCCEED + * + * Failure: FAIL + * + * Programmer: Robb Matzke + * Tuesday, July 21, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5S_debug(H5F_t *f, const void *_mesg, FILE *stream, intn indent, intn fwidth) +{ + const H5S_t *mesg = (const H5S_t*)_mesg; + + FUNC_ENTER(H5S_debug, FAIL); + + switch (mesg->extent.type) { + case H5S_SCALAR: + fprintf(stream, "%*s%-*s H5S_SCALAR\n", indent, "", fwidth, + "Space class:"); + break; + + case H5S_SIMPLE: + fprintf(stream, "%*s%-*s H5S_SIMPLE\n", indent, "", fwidth, + "Space class:"); + (H5O_SDSPACE->debug)(f, &(mesg->extent.u.simple), stream, + indent+3, MAX(0, fwidth-3)); + break; + + default: + fprintf(stream, "%*s%-*s **UNKNOWN-%ld**\n", indent, "", fwidth, + "Space class:", (long)(mesg->extent.type)); + break; + } + + FUNC_LEAVE(SUCCEED); +} diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index 35371ba..e5aeabc 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -226,6 +226,8 @@ hsize_t H5S_select_npoints (const H5S_t *space); intn H5S_extend (H5S_t *space, const hsize_t *size); herr_t H5S_set_extent_simple (H5S_t *space, int rank, const hsize_t *dims, const hsize_t *max); +herr_t H5S_debug(H5F_t *f, const void *_mesg, FILE *stream, intn indent, + intn fwidth); /* Conversion functions for simple data spaces */ size_t H5S_simp_init (const struct H5O_layout_t *layout, |