summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-08-10 18:15:14 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-08-10 18:15:14 (GMT)
commit9754e9373b731856dbf61fdb9c99501f452ca552 (patch)
tree0bb99d2caf87b9ec8e4dfd2a52bf03b5c7d06055 /src
parent1d0b2915c2d492ecf35b83ff65287d5d95bf5f7c (diff)
downloadhdf5-9754e9373b731856dbf61fdb9c99501f452ca552.zip
hdf5-9754e9373b731856dbf61fdb9c99501f452ca552.tar.gz
hdf5-9754e9373b731856dbf61fdb9c99501f452ca552.tar.bz2
[svn-r584] Changes since 19980806
---------------------- ./doc/html/Datatypes.html ./doc/html/H5.format.html ./src/H5.c ./src/H5Odtype.c ./src/H5T.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5Tpublic.h ./test/dtypes.c Changed the values of the H5T_str_t type in order to make a distinction between C's null terminated strings and strings which are not null terminated. The string character set and padding method are saved to the hdf5 file instead of using defaults. Added conversion function from one fixed-length string type to another. ./test/chunk.c Fixed to work with new filter API
Diffstat (limited to 'src')
-rw-r--r--src/.distdep98
-rw-r--r--src/H5.c17
-rw-r--r--src/H5Odtype.c10
-rw-r--r--src/H5T.c49
-rw-r--r--src/H5Tconv.c228
-rw-r--r--src/H5Tpkg.h2
-rw-r--r--src/H5Tpublic.h49
7 files changed, 363 insertions, 90 deletions
diff --git a/src/.distdep b/src/.distdep
index 499fcc6..917a475 100644
--- a/src/.distdep
+++ b/src/.distdep
@@ -341,29 +341,6 @@ H5Ocont.o: \
H5HGpublic.h \
H5Tprivate.h \
H5Tpublic.h
-H5Odtype.o: \
- H5Odtype.c \
- H5private.h \
- H5public.h \
- H5config.h \
- H5Eprivate.h \
- H5Epublic.h \
- H5Ipublic.h \
- H5Gprivate.h \
- H5Gpublic.h \
- H5Bprivate.h \
- H5Bpublic.h \
- H5Fprivate.h \
- H5Fpublic.h \
- H5Dpublic.h \
- H5MMprivate.h \
- H5MMpublic.h \
- H5Oprivate.h \
- H5Opublic.h \
- H5HGprivate.h \
- H5HGpublic.h \
- H5Tprivate.h \
- H5Tpublic.h
H5Olayout.o: \
H5Olayout.c \
H5private.h \
@@ -630,29 +607,6 @@ H5Tbit.o: \
H5Tprivate.h \
H5Tpublic.h \
H5Gprivate.h
-H5Tconv.o: \
- H5Tconv.c \
- H5Iprivate.h \
- H5Ipublic.h \
- H5public.h \
- H5config.h \
- H5private.h \
- H5Eprivate.h \
- H5Epublic.h \
- H5MMprivate.h \
- H5MMpublic.h \
- H5Tpkg.h \
- H5HGprivate.h \
- H5HGpublic.h \
- H5Fprivate.h \
- H5Fpublic.h \
- H5Dpublic.h \
- H5Tprivate.h \
- H5Tpublic.h \
- H5Gprivate.h \
- H5Gpublic.h \
- H5Bprivate.h \
- H5Bpublic.h
H5Tinit.o: \
H5Tinit.c \
H5private.h \
@@ -979,6 +933,19 @@ H5S.o: \
H5HGprivate.h \
H5HGpublic.h \
H5Tprivate.h
+H5Flow.o: \
+ H5Flow.c \
+ H5private.h \
+ H5public.h \
+ H5config.h \
+ H5Eprivate.h \
+ H5Epublic.h \
+ H5Ipublic.h \
+ H5Fprivate.h \
+ H5Fpublic.h \
+ H5Dpublic.h \
+ H5MMprivate.h \
+ H5MMpublic.h
H5.o: \
H5.c \
H5private.h \
@@ -1076,19 +1043,29 @@ H5F.o: \
H5Epublic.h \
H5MMprivate.h \
H5MMpublic.h
-H5Flow.o: \
- H5Flow.c \
+H5Odtype.o: \
+ H5Odtype.c \
H5private.h \
H5public.h \
H5config.h \
H5Eprivate.h \
H5Epublic.h \
H5Ipublic.h \
+ H5Gprivate.h \
+ H5Gpublic.h \
+ H5Bprivate.h \
+ H5Bpublic.h \
H5Fprivate.h \
H5Fpublic.h \
H5Dpublic.h \
H5MMprivate.h \
- H5MMpublic.h
+ H5MMpublic.h \
+ H5Oprivate.h \
+ H5Opublic.h \
+ H5HGprivate.h \
+ H5HGpublic.h \
+ H5Tprivate.h \
+ H5Tpublic.h
H5T.o: \
H5T.c \
H5private.h \
@@ -1117,3 +1094,26 @@ H5T.o: \
H5Eprivate.h \
H5Epublic.h \
H5MMprivate.h
+H5Tconv.o: \
+ H5Tconv.c \
+ H5Iprivate.h \
+ H5Ipublic.h \
+ H5public.h \
+ H5config.h \
+ H5private.h \
+ H5Eprivate.h \
+ H5Epublic.h \
+ H5MMprivate.h \
+ H5MMpublic.h \
+ H5Tpkg.h \
+ H5HGprivate.h \
+ H5HGpublic.h \
+ H5Fprivate.h \
+ H5Fpublic.h \
+ H5Dpublic.h \
+ H5Tprivate.h \
+ H5Tpublic.h \
+ H5Gprivate.h \
+ H5Gpublic.h \
+ H5Bprivate.h \
+ H5Bpublic.h
diff --git a/src/H5.c b/src/H5.c
index 94291c0..b035ab3 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -1987,19 +1987,22 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5T_str_t str = va_arg (ap, H5T_str_t);
+ H5T_str_t str = va_arg(ap, H5T_str_t);
switch (str) {
case H5T_STR_ERROR:
- fprintf (out, "H5T_STR_ERROR");
+ fprintf(out, "H5T_STR_ERROR");
break;
- case H5T_STR_NULL:
- fprintf (out, "H5T_STR_NULL");
+ case H5T_STR_NULLTERM:
+ fprintf(out, "H5T_STR_NULLTERM");
break;
- case H5T_STR_SPACE:
- fprintf (out, "H5T_STR_SPACE");
+ case H5T_STR_NULLPAD:
+ fprintf(out, "H5T_STR_NULLPAD");
+ break;
+ case H5T_STR_SPACEPAD:
+ fprintf(out, "H5T_STR_SPACEPAD");
break;
default:
- fprintf (out, "%ld", (long)str);
+ fprintf(out, "%ld", (long)str);
break;
}
}
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index 8e44223..d4a4d6f 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -122,8 +122,9 @@ H5O_dtype_decode_helper(const uint8 **pp, H5T_t *dt)
dt->u.atomic.offset = 0;
dt->u.atomic.lsb_pad = H5T_PAD_ZERO;
dt->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->u.atomic.u.s.cset = H5T_CSET_ASCII;
- dt->u.atomic.u.s.pad = H5T_STR_NULL;
+
+ dt->u.atomic.u.s.pad = flags & 0x0f;
+ dt->u.atomic.u.s.cset = (flags>>4) & 0x0f;
break;
case H5T_FLOAT:
@@ -327,8 +328,9 @@ H5O_dtype_encode_helper(uint8 **pp, const H5T_t *dt)
assert (dt->u.atomic.offset == 0);
assert (dt->u.atomic.lsb_pad == H5T_PAD_ZERO);
assert (dt->u.atomic.msb_pad == H5T_PAD_ZERO);
- assert (dt->u.atomic.u.s.cset == H5T_CSET_ASCII);
- assert (dt->u.atomic.u.s.pad == H5T_STR_NULL);
+
+ flags |= (dt->u.atomic.u.s.pad & 0x0f);
+ flags |= (dt->u.atomic.u.s.cset & 0x0f) << 4;
break;
case H5T_FLOAT:
diff --git a/src/H5T.c b/src/H5T.c
index 78b6b51..ca7e571 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -534,7 +534,7 @@ H5T_init_interface(void)
dt->u.atomic.lsb_pad = H5T_PAD_ZERO;
dt->u.atomic.msb_pad = H5T_PAD_ZERO;
dt->u.atomic.u.s.cset = H5T_CSET_ASCII;
- dt->u.atomic.u.s.pad = H5T_STR_NULL;
+ dt->u.atomic.u.s.pad = H5T_STR_NULLTERM;
if ((H5T_C_S1_g = H5I_register(H5_DATATYPE, dt)) < 0) {
HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL,
"can't initialize H5T layer");
@@ -560,7 +560,7 @@ H5T_init_interface(void)
dt->u.atomic.lsb_pad = H5T_PAD_ZERO;
dt->u.atomic.msb_pad = H5T_PAD_ZERO;
dt->u.atomic.u.s.cset = H5T_CSET_ASCII;
- dt->u.atomic.u.s.pad = H5T_STR_SPACE;
+ dt->u.atomic.u.s.pad = H5T_STR_SPACEPAD;
if ((H5T_FORTRAN_S1_g = H5I_register(H5_DATATYPE, dt)) < 0) {
HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL,
"can't initialize H5T layer");
@@ -570,22 +570,23 @@ H5T_init_interface(void)
* Register conversion functions beginning with the most general and
* ending with the most specific.
*/
- if (H5Tregister_soft ("i_i", H5T_INTEGER, H5T_INTEGER,
- H5T_conv_i_i) < 0) {
+ if (H5Tregister_soft ("i_i", H5T_INTEGER, H5T_INTEGER, H5T_conv_i_i)<0) {
HRETURN_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL,
"unable to register conversion function");
}
- if (H5Tregister_soft ("f_f", H5T_FLOAT, H5T_FLOAT,
- H5T_conv_f_f) < 0) {
+ if (H5Tregister_soft ("f_f", H5T_FLOAT, H5T_FLOAT, H5T_conv_f_f)<0) {
HRETURN_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL,
"unable to register conversion function");
}
- if (H5Tregister_soft("ibo", H5T_INTEGER, H5T_INTEGER,
- H5T_conv_order) < 0) {
+ if (H5Tregister_soft("s_s", H5T_STRING, H5T_STRING, H5T_conv_s_s)<0) {
HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL,
"unable to register conversion function");
}
- if (H5Tregister_soft("fbo", H5T_FLOAT, H5T_FLOAT, H5T_conv_order) < 0) {
+ if (H5Tregister_soft("ibo", H5T_INTEGER, H5T_INTEGER, H5T_conv_order)<0) {
+ HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL,
+ "unable to register conversion function");
+ }
+ if (H5Tregister_soft("fbo", H5T_FLOAT, H5T_FLOAT, H5T_conv_order)<0) {
HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL,
"unable to register conversion function");
}
@@ -1503,8 +1504,7 @@ H5Tget_precision (hid_t type_id)
* and then the size is increased to insure that significant
* bits do not "hang over" the edge of the data type.
*
- * Changing the precision of an H5T_STRING automatically changes
- * the size as well. The precision must be a multiple of 8.
+ * The precision property of strings is read-only.
*
* When decreasing the precision of a floating point type, set
* the locations and sizes of the sign, mantissa, and exponent
@@ -1564,13 +1564,8 @@ H5Tset_precision (hid_t type_id, size_t prec)
break;
case H5T_STRING:
- if (prec % 8) {
- HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "precision for this type must be a multiple of 8");
- }
- offset = 0;
- size = prec / 8;
- break;
+ HRETURN_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL,
+ "precision for this type is read-only");
case H5T_FLOAT:
/*
@@ -2424,6 +2419,16 @@ H5Tget_strpad (hid_t type_id)
* Fortran left-justifies and space-pads strings. This property
* defines the storage mechanism for the string.
*
+ * When converting from a long string to a short string if the
+ * short string is H5T_STR_NULLPAD or H5T_STR_SPACEPAD then the
+ * string is simply truncated; otherwise if the short string is
+ * H5T_STR_NULLTERM it will be truncated and a null terminator
+ * is appended.
+ *
+ * When converting from a short string to a long string, the
+ * long string is padded on the end by appending nulls or
+ * spaces.
+ *
* Return: Success: SUCCEED
*
* Failure: FAIL
@@ -4245,17 +4250,17 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2)
break;
case H5T_STRING:
- if (dt1->u.atomic.u.s.cset < dt1->u.atomic.u.s.cset) {
+ if (dt1->u.atomic.u.s.cset < dt2->u.atomic.u.s.cset) {
HGOTO_DONE(-1);
}
- if (dt1->u.atomic.u.s.cset > dt1->u.atomic.u.s.cset) {
+ if (dt1->u.atomic.u.s.cset > dt2->u.atomic.u.s.cset) {
HGOTO_DONE(1);
}
- if (dt1->u.atomic.u.s.pad < dt1->u.atomic.u.s.pad) {
+ if (dt1->u.atomic.u.s.pad < dt2->u.atomic.u.s.pad) {
HGOTO_DONE(-1);
}
- if (dt1->u.atomic.u.s.pad > dt1->u.atomic.u.s.pad) {
+ if (dt1->u.atomic.u.s.pad > dt2->u.atomic.u.s.pad) {
HGOTO_DONE(1);
}
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index c940474..ce0df3e 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -1321,6 +1321,234 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
/*-------------------------------------------------------------------------
+ * Function: H5T_conv_s_s
+ *
+ * Purpose: Convert one fixed-length string type to another.
+ *
+ * Return: Success: SUCCEED
+ *
+ * Failure: FAIL
+ *
+ * Programmer: Robb Matzke
+ * Friday, August 7, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5T_conv_s_s (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
+ void *buf, void __unused__ *bkg)
+{
+ H5T_t *src=NULL; /*source data type */
+ H5T_t *dst=NULL; /*destination data type */
+ intn direction; /*direction of traversal */
+ size_t elmtno; /*element number */
+ size_t olap; /*num overlapping elements */
+ size_t nchars; /*number of characters copied */
+ uint8 *s, *sp, *d, *dp; /*src and dst traversal pointers*/
+ uint8 *dbuf=NULL; /*temp buf for overlap convers. */
+ herr_t ret_value=FAIL; /*return value */
+
+ FUNC_ENTER(H5T_conv_s_s, FAIL);
+
+ switch (cdata->command) {
+ case H5T_CONV_INIT:
+ if (H5_DATATYPE!=H5I_group(src_id) ||
+ NULL==(src=H5I_object(src_id)) ||
+ H5_DATATYPE!=H5I_group(dst_id) ||
+ NULL==(dst=H5I_object(dst_id))) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ }
+ if (8*src->size != src->u.atomic.prec ||
+ 8*dst->size != dst->u.atomic.prec) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad precision");
+ }
+ if (0 != src->u.atomic.offset ||
+ 0 != dst->u.atomic.offset) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad offset");
+ }
+ if (H5T_CSET_ASCII != src->u.atomic.u.s.cset ||
+ H5T_CSET_ASCII != dst->u.atomic.u.s.cset) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad character set");
+ }
+ if (src->u.atomic.u.s.pad<0 || src->u.atomic.u.s.pad>=H5T_NPAD ||
+ dst->u.atomic.u.s.pad<0 || dst->u.atomic.u.s.pad>=H5T_NPAD) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad character padding");
+ }
+ cdata->need_bkg = H5T_BKG_NO;
+ break;
+
+ case H5T_CONV_FREE:
+ break;
+
+ case H5T_CONV_CONV:
+ /* Get the data types */
+ if (H5_DATATYPE!=H5I_group(src_id) ||
+ NULL==(src=H5I_object(src_id)) ||
+ H5_DATATYPE!=H5I_group(dst_id) ||
+ NULL==(dst=H5I_object(dst_id))) {
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ }
+
+ /*
+ * Do we process the values from beginning to end or vice versa? Also,
+ * how many of the elements have the source and destination areas
+ * overlapping?
+ */
+ if (src->size==dst->size) {
+ /*
+ * When the source and destination are the same size we can do
+ * all the conversions in place.
+ */
+ sp = dp = (uint8*)buf;
+ direction = 1;
+ olap = 0;
+ } else if (src->size>=dst->size) {
+ sp = dp = (uint8*)buf;
+ direction = 1;
+ olap = (size_t)(ceil((double)(src->size)/
+ (double)(src->size-dst->size))-1);
+ } else {
+ sp = (uint8*)buf + (nelmts-1) * src->size;
+ dp = (uint8*)buf + (nelmts-1) * dst->size;
+ direction = -1;
+ olap = (size_t)(ceil((double)(dst->size)/
+ (double)(dst->size-src->size))-1);
+ }
+
+ /* Allocate the overlap buffer */
+ if (NULL==(dbuf=H5MM_malloc(dst->size))) {
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
+ "memory allocation failed for string conversion");
+ }
+
+ /* The conversion loop. */
+ for (elmtno=0; elmtno<nelmts; elmtno++) {
+
+ /*
+ * If the source and destination buffers overlap then use a
+ * temporary buffer fot eh destination.
+ */
+ if (direction>0) {
+ s = sp;
+ d = elmtno<olap ? dbuf : dp;
+ } else {
+ s = sp;
+ d = elmtno >= nelmts-olap ? dbuf : dp;
+ }
+#ifndef NDEBUG
+ /* I don't quite trust the overlap calculations yet --rpm */
+ if (src->size==dst->size) {
+ assert(s==d);
+ } else if (d==dbuf) {
+ assert((dp>=sp && dp<sp+src->size) ||
+ (sp>=dp && sp<dp+dst->size));
+ } else {
+ assert((dp<sp && dp+dst->size<=sp) ||
+ (sp<dp && sp+src->size<=dp));
+ }
+#endif
+
+ /* Copy characters from source to destination */
+ switch (src->u.atomic.u.s.pad) {
+ case H5T_STR_NULLTERM:
+ for (nchars=0;
+ nchars<dst->size && nchars<src->size && s[nchars];
+ nchars++) {
+ d[nchars] = s[nchars];
+ }
+ break;
+
+ case H5T_STR_NULLPAD:
+ for (nchars=0;
+ nchars<dst->size && nchars<src->size && s[nchars];
+ nchars++) {
+ d[nchars] = s[nchars];
+ }
+ break;
+
+ case H5T_STR_SPACEPAD:
+ nchars = src->size;
+ while (nchars>0 && ' '==s[nchars-1]) --nchars;
+ nchars = MIN(dst->size, nchars);
+ memcpy(d, s, nchars);
+ break;
+
+ case H5T_STR_RESERVED_3:
+ case H5T_STR_RESERVED_4:
+ case H5T_STR_RESERVED_5:
+ case H5T_STR_RESERVED_6:
+ case H5T_STR_RESERVED_7:
+ case H5T_STR_RESERVED_8:
+ case H5T_STR_RESERVED_9:
+ case H5T_STR_RESERVED_10:
+ case H5T_STR_RESERVED_11:
+ case H5T_STR_RESERVED_12:
+ case H5T_STR_RESERVED_13:
+ case H5T_STR_RESERVED_14:
+ case H5T_STR_RESERVED_15:
+ case H5T_STR_ERROR:
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL,
+ "source string padding method not supported");
+ }
+
+ /* Terminate or pad the destination */
+ switch (dst->u.atomic.u.s.pad) {
+ case H5T_STR_NULLTERM:
+ while (nchars<dst->size) d[nchars++] = '\0';
+ d[dst->size-1] = '\0';
+ break;
+
+ case H5T_STR_NULLPAD:
+ while (nchars<dst->size) d[nchars++] = '\0';
+ break;
+
+ case H5T_STR_SPACEPAD:
+ while (nchars<dst->size) d[nchars++] = ' ';
+ break;
+
+ case H5T_STR_RESERVED_3:
+ case H5T_STR_RESERVED_4:
+ case H5T_STR_RESERVED_5:
+ case H5T_STR_RESERVED_6:
+ case H5T_STR_RESERVED_7:
+ case H5T_STR_RESERVED_8:
+ case H5T_STR_RESERVED_9:
+ case H5T_STR_RESERVED_10:
+ case H5T_STR_RESERVED_11:
+ case H5T_STR_RESERVED_12:
+ case H5T_STR_RESERVED_13:
+ case H5T_STR_RESERVED_14:
+ case H5T_STR_RESERVED_15:
+ case H5T_STR_ERROR:
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL,
+ "destination string padding method not supported");
+ }
+
+ /*
+ * If we used a temporary buffer for the destination then we
+ * should copy the value to the true destination buffer.
+ */
+ if (d==dbuf) HDmemcpy(dp, d, dst->size);
+ sp += direction * src->size;
+ dp += direction * dst->size;
+ }
+ break;
+
+ default:
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL,
+ "unknown converson command");
+ }
+ ret_value = SUCCEED;
+
+ done:
+ H5MM_xfree(dbuf);
+ FUNC_LEAVE(ret_value);
+}
+
+
+/*-------------------------------------------------------------------------
* Function: H5T_conv_float_double
*
* Purpose: Convert native `float' to native `double' using hardware.
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index 05c36a4..8068069 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -133,6 +133,8 @@ herr_t H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, void *_buf, void __unused__ *bkg);
herr_t H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, void *_buf, void __unused__ *bkg);
+herr_t H5T_conv_s_s (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
+ size_t nelmts, void *_buf, void __unused__ *bkg);
herr_t H5T_conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, void *buf, void __unused__ *bkg);
herr_t H5T_conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h
index 822e053..f9d417b 100644
--- a/src/H5Tpublic.h
+++ b/src/H5Tpublic.h
@@ -64,22 +64,55 @@ typedef enum H5T_norm_t {
/*H5T_NORM_NONE must be last */
} H5T_norm_t;
-/* Character set to use for text strings */
+/*
+ * Character set to use for text strings. Do not change these values since
+ * they appear in HDF5 files!
+ */
typedef enum H5T_cset_t {
H5T_CSET_ERROR = -1, /*error */
H5T_CSET_ASCII = 0, /*US ASCII */
-
- H5T_NCSET = 1 /*this must be last! */
+ H5T_CSET_RESERVED_1 = 1, /*reserved for later use */
+ H5T_CSET_RESERVED_2 = 2, /*reserved for later use */
+ H5T_CSET_RESERVED_3 = 3, /*reserved for later use */
+ H5T_CSET_RESERVED_4 = 4, /*reserved for later use */
+ H5T_CSET_RESERVED_5 = 5, /*reserved for later use */
+ H5T_CSET_RESERVED_6 = 6, /*reserved for later use */
+ H5T_CSET_RESERVED_7 = 7, /*reserved for later use */
+ H5T_CSET_RESERVED_8 = 8, /*reserved for later use */
+ H5T_CSET_RESERVED_9 = 9, /*reserved for later use */
+ H5T_CSET_RESERVED_10 = 10, /*reserved for later use */
+ H5T_CSET_RESERVED_11 = 11, /*reserved for later use */
+ H5T_CSET_RESERVED_12 = 12, /*reserved for later use */
+ H5T_CSET_RESERVED_13 = 13, /*reserved for later use */
+ H5T_CSET_RESERVED_14 = 14, /*reserved for later use */
+ H5T_CSET_RESERVED_15 = 15 /*reserved for later use */
} H5T_cset_t;
+#define H5T_NCSET 1 /*Number of character sets actually defined */
-/* Type of padding to use in character strings */
+/*
+ * Type of padding to use in character strings. Do not change these values
+ * since they appear in HDF5 files!
+ */
typedef enum H5T_str_t {
H5T_STR_ERROR = -1, /*error */
- H5T_STR_NULL = 0, /*pad with null term like in C */
- H5T_STR_SPACE = 1, /*pad with spaces like in Fortran */
-
- H5T_NSTR = 2 /*this must be last! */
+ H5T_STR_NULLTERM = 0, /*null terminate like in C */
+ H5T_STR_NULLPAD = 1, /*pad with nulls */
+ H5T_STR_SPACEPAD = 2, /*pad with spaces like in Fortran */
+ H5T_STR_RESERVED_3 = 3, /*reserved for later use */
+ H5T_STR_RESERVED_4 = 4, /*reserved for later use */
+ H5T_STR_RESERVED_5 = 5, /*reserved for later use */
+ H5T_STR_RESERVED_6 = 6, /*reserved for later use */
+ H5T_STR_RESERVED_7 = 7, /*reserved for later use */
+ H5T_STR_RESERVED_8 = 8, /*reserved for later use */
+ H5T_STR_RESERVED_9 = 9, /*reserved for later use */
+ H5T_STR_RESERVED_10 = 10, /*reserved for later use */
+ H5T_STR_RESERVED_11 = 11, /*reserved for later use */
+ H5T_STR_RESERVED_12 = 12, /*reserved for later use */
+ H5T_STR_RESERVED_13 = 13, /*reserved for later use */
+ H5T_STR_RESERVED_14 = 14, /*reserved for later use */
+ H5T_STR_RESERVED_15 = 15 /*reserved for later use */
} H5T_str_t;
+#define H5T_NSTR 3 /*num H5T_str_t types actually defined */
/* Type of padding to use in other atomic types */
typedef enum H5T_pad_t {