summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-06-17 20:46:29 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-06-17 20:46:29 (GMT)
commit22538a0c799bcb82b40346849776e354fbc18fee (patch)
treedcefb55f7e1a6632c89fdd8592588747f16fa9e1 /src
parent53916f4e5935ae7c36d7dd6e04d1c5e51b7e78ea (diff)
downloadhdf5-22538a0c799bcb82b40346849776e354fbc18fee.zip
hdf5-22538a0c799bcb82b40346849776e354fbc18fee.tar.gz
hdf5-22538a0c799bcb82b40346849776e354fbc18fee.tar.bz2
[svn-r429] Changes since 19980616
---------------------- ./html/tracing.html NEW This entire update is to make it possible for the library to print the name, arguments, and return value of every API call without requiring any extra work from developers or app programmers. This file describes how this all works. ./configure.in Added the `--enable-tracing' switch. If you use it then the library will include code to print API function names, argument names and values, and function return values. However, you must then turn on the tracing by setting the HDF5_TRACE environment variable to a file descriptor number. The default is `--disable-tracing' since enabling it causes a slight increase in library size and a slowdown resulting from an extra function call for each API function call (I couldn't even measure the slowdown :-) ./bin/trace NEW A perl script that synchronizes the H5TRACE() macro calls in the *.c files with the function return type and formal argument names and types. If you use GNU make and gcc then this will be done automatically, otherwise just invoke this script with the names of one or more .c files. You could do it by hand to, but encoding argument types is a little tricky at first. ./config/commence.in Added the $(TRACE) macro, which defaults to the no-op. Added -D_POSIX_SOURCE to the compiler command line. ./src/Makefile.in Override the default for $(TRACE). ./config/depend.in Automatically calls $(TRACE) to synchronize the H5TRACE() macros in any source file that changed. As with makefile dependencies, one way to force synchronization of all files is to remove the `.depend' file. ./MANIFEST Added new files. ./src/H5Eprivate.h Modified HRETURN_ERROR() and HRETURN() for tracing. ./src/H5.c ./src/H5private.h This is where the real tracing work really happens, in H5_trace(). ./src/H5A.c ./src/H5D.c ./src/H5G.c ./src/H5P.c ./src/H5S.c ./src/H5Z.c Added H5TRACE() calls to all API functions. You don't really need these changes if you don't want to merge your stuff because they can be generated automatically by going to the hdf5/src directory and saying ../bin/trace *.c ./src/H5T.c Added H5TRACE() calls. Other stuff below. ./src/H5E.c ./src/H5Epublic.h Added H5TRACE() calls. Created a type H5E_auto_t for the `func' argument of H5Eset_auto() and H5Eget_auto() to make those arguments easier to parse for tracing. It should also make it clearer for users that don't know how to read complicated ANSI data types. ./src/H5F.c Added H5TRACE() calls. Changed a couple `uintn' argument types in API functions to `unsigned int' since `uintn' part of the API. Changed a few "can't" and "cant" error messages to "unable to". ./src/H5Ipublic.h Removed H5_DIRECTORY from the H5I_group_t enum. It wasn't used anywhere. ./src/H5Tconv.c Removed an unused label. ./src/H5Fistore.c ./src/H5Oattr.c ./src/H5Odtype.c ./src/H5T.c ./test/dsets.c ./test/dtypes.c Fixed a warning about a variable possibly used before it's initialized. Added __unused__ to turn off some unused argument warnings that pop up when debugging is turned off and optimizations are turned on.
Diffstat (limited to 'src')
-rw-r--r--src/H5.c722
-rw-r--r--src/H5A.c38
-rw-r--r--src/H5D.c21
-rw-r--r--src/H5Distore.c3
-rw-r--r--src/H5E.c13
-rw-r--r--src/H5Eprivate.h5
-rw-r--r--src/H5Epublic.h5
-rw-r--r--src/H5F.c55
-rw-r--r--src/H5Fistore.c3
-rw-r--r--src/H5Flow.c4
-rw-r--r--src/H5G.c24
-rw-r--r--src/H5Ipublic.h1
-rw-r--r--src/H5Oattr.c7
-rw-r--r--src/H5Odtype.c13
-rw-r--r--src/H5P.c73
-rw-r--r--src/H5S.c28
-rw-r--r--src/H5T.c109
-rw-r--r--src/H5Tconv.c2
-rw-r--r--src/H5Z.c1
-rw-r--r--src/H5private.h70
-rw-r--r--src/Makefile.in1
21 files changed, 1051 insertions, 147 deletions
diff --git a/src/H5.c b/src/H5.c
index aad036c..3372250 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -38,24 +38,27 @@ static char RcsId[] = "@(#)$Revision$";
#include <ctype.h>
#include <errno.h>
#include <stdarg.h>
+#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
/* private headers */
-#include <H5private.h> /*library */
-#include <H5ACprivate.h> /*cache */
-#include <H5Bprivate.h> /*B-link trees */
-#include <H5Eprivate.h> /*error handling */
-#include <H5MMprivate.h> /*memory management */
-#include <H5Tprivate.h> /*data types */
+#include <H5private.h> /*library */
+#include <H5ACprivate.h> /*cache */
+#include <H5Bprivate.h> /*B-link trees */
+#include <H5Eprivate.h> /*error handling */
+#include <H5Iprivate.h> /*atoms */
+#include <H5MMprivate.h> /*memory management */
+#include <H5Pprivate.h> /*property lists */
+#include <H5Tprivate.h> /*data types */
+#include <H5Zprivate.h> /*compression */
#define PABLO_MASK H5_mask
-/*--------------------- Locally scoped variables -----------------------------*/
-
hbool_t library_initialize_g = FALSE;
hbool_t thread_initialize_g = FALSE;
hbool_t install_atexit_g = TRUE;
+static FILE *H5_trace_g = NULL;
typedef struct H5_exit {
void (*func) (void); /* Interface function to call during exit */
@@ -86,6 +89,17 @@ H5_init_library(void)
{
FUNC_ENTER_INIT(H5_init_library, NULL, FAIL);
+#ifdef H5_DEBUG_API
+ {
+ /* Turn on tracing? */
+ const char *s = getenv ("HDF5_TRACE");
+ if (s && isdigit(*s)) {
+ int fd = HDstrtol (s, NULL, 0);
+ H5_trace_g = fdopen (fd, "w");
+ }
+ }
+#endif
+
/* Install atexit() library cleanup routine */
if (install_atexit_g == TRUE)
if (HDatexit(&H5_term_library) != 0)
@@ -908,3 +922,695 @@ H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/)
}
}
+
+/*-------------------------------------------------------------------------
+ * Function: H5_trace
+ *
+ * Purpose: This function is called whenever an API function is called
+ * and tracing is turned on. If RETURNING is non-zero then
+ * the caller is about to return. Otherwise we print the
+ * function name and the arguments.
+ *
+ * The TYPE argument is a string which gives the type of each of
+ * the following argument pairs. Each type is zero or more
+ * asterisks (one for each level of indirection, although some
+ * types have one level of indirection already implied) followed
+ * by either one letter (lower case) or two letters (first one
+ * uppercase).
+ *
+ * The variable argument list consists of pairs of values. Each
+ * pair is a string which is the formal argument name in the
+ * calling function, followed by the argument value. The type
+ * of the argument value is given by the TYPE string.
+ *
+ * Note: The TYPE string is meant to be terse and is generated by a
+ * separate perl script.
+ *
+ * Return: void
+ *
+ * Programmer: Robb Matzke
+ * Tuesday, June 16, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+void
+H5_trace (hbool_t returning, const char *func, const char *type, ...)
+{
+ va_list ap;
+ char buf[64];
+ const char *argname;
+ intn argno=0, ptr, n;
+ void *vp = NULL;
+ FILE *out = H5_trace_g;
+
+ if (!out) return; /*tracing is off*/
+ va_start (ap, type);
+
+ if (returning) {
+ fprintf (out, " = ");
+ } else {
+ fprintf (out, "%s(", func);
+ }
+
+ while (*type) {
+ /* Count levels of indirection */
+ for (ptr=0; '*'==*type; type++) ptr++;
+
+ /*
+ * The argument name. Leave off the `_id' part. If the argument
+ * name is the null pointer then don't print the argument or the
+ * following `='. This is used for return values.
+ */
+ argname = va_arg (ap, char*);
+ if (argname) {
+ n = MAX (0, (int)strlen(argname)-3);
+ if (!strcmp (argname+n, "_id")) {
+ strncpy (buf, argname, MIN ((int)sizeof(buf)-1, n));
+ buf[MIN((int)sizeof(buf)-1, n)] = '\0';
+ argname = buf;
+ }
+ fprintf (out, "%s%s=", argno++?", ":"", argname);
+ } else {
+ argname = "";
+ }
+
+ /* The value */
+ if (ptr) vp = va_arg (ap, void*);
+ switch (type[0]) {
+ case 'b':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ hbool_t bool = va_arg (ap, hbool_t);
+ if (TRUE==bool) fprintf (out, "TRUE");
+ else if (!bool) fprintf (out, "FALSE");
+ else fprintf (out, "TRUE(%u)", (unsigned)bool);
+ }
+ break;
+
+ case 'd':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ double dbl = va_arg (ap, double);
+ fprintf (out, "%g", dbl);
+ }
+ break;
+
+ case 'D':
+ switch (type[1]) {
+ case 'l':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ H5D_layout_t layout = va_arg (ap, H5D_layout_t);
+ switch (layout) {
+ case H5D_LAYOUT_ERROR:
+ fprintf (out, "H5D_LAYOUT_ERROR");
+ break;
+ case H5D_COMPACT:
+ fprintf (out, "H5D_COMPACT");
+ break;
+ case H5D_CONTIGUOUS:
+ fprintf (out, "H5D_CONTIGUOUS");
+ break;
+ case H5D_CHUNKED:
+ fprintf (out, "H5D_CHUNKED");
+ break;
+ default:
+ fprintf (out, "%ld", (long)layout);
+ break;
+ }
+ }
+ break;
+
+ case 't':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ H5D_transfer_t transfer = va_arg (ap, H5D_transfer_t);
+ switch (transfer) {
+ case H5D_XFER_INDEPENDENT:
+ fprintf (out, "H5D_XFER_INDEPENDENT");
+ break;
+ case H5D_XFER_COLLECTIVE:
+ fprintf (out, "H5D_XFER_COLLECTIVE");
+ break;
+ case H5D_XFER_DFLT:
+ fprintf (out, "H5D_XFER_DFLT");
+ break;
+ default:
+ fprintf (out, "%ld", (long)transfer);
+ break;
+ }
+ }
+ break;
+
+ default:
+ fprintf (out, "BADTYPE(D%c)", type[1]);
+ goto error;
+ }
+ break;
+
+ case 'e':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ herr_t status = va_arg (ap, herr_t);
+ if (SUCCEED==status) fprintf (out, "SUCCEED");
+ else if (FAIL==status) fprintf (out, "FAIL");
+ else fprintf (out, "%d", (int)status);
+ }
+ break;
+
+ case 'E':
+ switch (type[1]) {
+ case 'd':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ H5E_direction_t direction = va_arg (ap, H5E_direction_t);
+ switch (direction) {
+ case H5E_WALK_UPWARD:
+ fprintf (out, "H5E_WALK_UPWARD");
+ break;
+ case H5E_WALK_DOWNWARD:
+ fprintf (out, "H5E_WALK_DOWNWARD");
+ break;
+ default:
+ fprintf (out, "%ld", (long)direction);
+ break;
+ }
+ }
+ break;
+
+ case 'e':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ H5E_error_t *error = va_arg (ap, H5E_error_t*);
+ fprintf (out, "0x%lx", (unsigned long)error);
+ }
+ break;
+
+ default:
+ fprintf (out, "BADTYPE(E%c)", type[1]);
+ goto error;
+ }
+ break;
+
+ case 'G':
+ switch (type[1]) {
+ case 'l':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ H5G_link_t link_type = va_arg (ap, H5G_link_t);
+ switch (link_type) {
+ case H5G_LINK_ERROR:
+ fprintf (out, "H5G_LINK_ERROR");
+ break;
+ case H5G_LINK_HARD:
+ fprintf (out, "H5G_LINK_HARD");
+ break;
+ case H5G_LINK_SOFT:
+ fprintf (out, "H5G_LINK_SOFT");
+ break;
+ default:
+ fprintf (out, "%ld", (long)link_type);
+ break;
+ }
+ }
+ break;
+
+ case 's':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ H5G_stat_t *statbuf = va_arg (ap, H5G_stat_t*);
+ fprintf (out, "0x%lx", (unsigned long)statbuf);
+ }
+ break;
+
+ default:
+ fprintf (out, "BADTYPE(G%c)", type[1]);
+ goto error;
+ }
+ break;
+
+ case 'h':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ hsize_t hsize = va_arg (ap, hsize_t);
+ HDfprintf (out, "%Hu", hsize);
+ }
+ break;
+
+ case 'H':
+ switch (type[1]) {
+ case 's':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ hssize_t hssize = va_arg (ap, hssize_t);
+ HDfprintf (out, "%Hd", hssize);
+ }
+ break;
+
+ default:
+ fprintf (out, "BADTYPE(H%c)", type[1]);
+ goto error;
+ }
+ break;
+
+ case 'i':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ hid_t obj = va_arg (ap, hid_t);
+ if (-2 == obj) {
+ fprintf (out, "H5P_DEFAULT");
+ } else if (FAIL==obj) {
+ fprintf (out, "FAIL");
+ } else {
+ fprintf (out, "%ld", (long)obj);
+ switch (H5I_group (obj)) {
+ case BADGROUP:
+ fprintf (out, " (error)");
+ break;
+ case H5_FILE:
+ if (strcmp (argname, "file")) {
+ fprintf (out, " (file)");
+ }
+ break;
+ case H5_TEMPLATE_0:
+ case H5_TEMPLATE_1:
+ case H5_TEMPLATE_2:
+ case H5_TEMPLATE_3:
+ case H5_TEMPLATE_4:
+ case H5_TEMPLATE_5:
+ case H5_TEMPLATE_6:
+ case H5_TEMPLATE_7:
+ if (strcmp (argname, "plist")) {
+ fprintf (out, " (plist)");
+ }
+ break;
+ case H5_GROUP:
+ if (strcmp (argname, "group")) {
+ fprintf (out, " (group)");
+ }
+ break;
+ case H5_DATATYPE:
+ if (strcmp (argname, "type")) {
+ fprintf (out, " (type)");
+ }
+ break;
+ case H5_DATASPACE:
+ if (strcmp (argname, "space")) {
+ fprintf (out, " (space)");
+ }
+ break;
+ case H5_DATASET:
+ if (strcmp (argname, "dset")) {
+ fprintf (out, " (dset)");
+ }
+ break;
+ case H5_ATTR:
+ if (strcmp (argname, "attr")) {
+ fprintf (out, " (attr)");
+ }
+ break;
+ default:
+ fprintf (out, " (unknown class)");
+ break;
+ }
+ }
+ }
+ break;
+
+ case 'I':
+ switch (type[1]) {
+ case 's':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ int is = va_arg (ap, int);
+ fprintf (out, "%d", is);
+ }
+ break;
+
+ case 'u':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ unsigned iu = va_arg (ap, unsigned);
+ fprintf (out, "%u", iu);
+ }
+ break;
+
+ default:
+ fprintf (out, "BADTYPE(I%c)", type[1]);
+ goto error;
+ }
+ break;
+
+ case 'M':
+ switch (type[1]) {
+#ifdef HAVE_PARALLEL
+ case 'c':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ MPI_Comm comm = va_arg (ap, MPI_Comm);
+ fprintf (out, "%ld", (long)comm);
+ }
+ break;
+ case 'i':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ MPI_Info info = va_arg (ap, MPI_Info);
+ fprintf (out, "%ld", (long)info);
+ }
+ break;
+#endif
+ default:
+ goto error;
+ }
+ break;
+
+ case 'o':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ off_t offset = va_arg (ap, off_t);
+ fprintf (out, "%ld", (long)offset);
+ }
+ break;
+
+ case 'p':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ H5P_class_t plist_class = va_arg (ap, H5P_class_t);
+ switch (plist_class) {
+ case H5P_NO_CLASS:
+ fprintf (out, "H5P_NO_CLASS");
+ break;
+ case H5P_FILE_CREATE:
+ fprintf (out, "H5P_FILE_CREATE");
+ break;
+ case H5P_FILE_ACCESS:
+ fprintf (out, "H5P_FILE_ACCESS");
+ break;
+ case H5P_DATASET_CREATE:
+ fprintf (out, "H5P_DATASET_CREATE");
+ break;
+ case H5P_DATASET_XFER:
+ fprintf (out, "H5P_DATASET_XFER");
+ break;
+ default:
+ fprintf (out, "%ld", (long)plist_class);
+ break;
+ }
+ }
+ break;
+
+ case 's':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ const char *str = va_arg (ap, const char*);
+ fprintf (out, "\"%s\"", str);
+ }
+ break;
+
+ case 'T':
+ switch (type[1]) {
+ case 'c':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ H5T_cset_t cset = va_arg (ap, H5T_cset_t);
+ switch (cset) {
+ case H5T_CSET_ERROR:
+ fprintf (out, "H5T_CSET_ERROR");
+ break;
+ case H5T_CSET_ASCII:
+ fprintf (out, "H5T_CSET_ASCII");
+ break;
+ default:
+ fprintf (out, "%ld", (long)cset);
+ break;
+ }
+ }
+ break;
+
+ case 'n':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ H5T_norm_t norm = va_arg (ap, H5T_norm_t);
+ switch (norm) {
+ case H5T_NORM_ERROR:
+ fprintf (out, "H5T_NORM_ERROR");
+ break;
+ case H5T_NORM_IMPLIED:
+ fprintf (out, "H5T_NORM_IMPLIED");
+ break;
+ case H5T_NORM_MSBSET:
+ fprintf (out, "H5T_NORM_MSBSET");
+ break;
+ case H5T_NORM_NONE:
+ fprintf (out, "H5T_NORM_NONE");
+ break;
+ default:
+ fprintf (out, "%ld", (long)norm);
+ break;
+ }
+ }
+ break;
+
+ case 'o':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ H5T_order_t order = va_arg (ap, H5T_order_t);
+ switch (order) {
+ case H5T_ORDER_ERROR:
+ fprintf (out, "H5T_ORDER_ERROR");
+ break;
+ case H5T_ORDER_LE:
+ fprintf (out, "H5T_ORDER_LE");
+ break;
+ case H5T_ORDER_BE:
+ fprintf (out, "H5T_ORDER_BE");
+ break;
+ case H5T_ORDER_VAX:
+ fprintf (out, "H5T_ORDER_VAX");
+ break;
+ case H5T_ORDER_NONE:
+ fprintf (out, "H5T_ORDER_NONE");
+ break;
+ default:
+ fprintf (out, "%ld", (long)order);
+ break;
+ }
+ }
+ break;
+
+ case 'p':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ H5T_pad_t pad = va_arg (ap, H5T_pad_t);
+ switch (pad) {
+ case H5T_PAD_ERROR:
+ fprintf (out, "H5T_PAD_ERROR");
+ break;
+ case H5T_PAD_ZERO:
+ fprintf (out, "H5T_PAD_ZERO");
+ break;
+ case H5T_PAD_ONE:
+ fprintf (out, "H5T_PAD_ONE");
+ break;
+ case H5T_PAD_BACKGROUND:
+ fprintf (out, "H5T_PAD_BACKGROUND");
+ break;
+ default:
+ fprintf (out, "%ld", (long)pad);
+ break;
+ }
+ }
+ break;
+
+ case 's':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ H5T_sign_t sign = va_arg (ap, H5T_sign_t);
+ switch (sign) {
+ case H5T_SGN_ERROR:
+ fprintf (out, "H5T_SGN_ERROR");
+ break;
+ case H5T_SGN_NONE:
+ fprintf (out, "H5T_SGN_NONE");
+ break;
+ case H5T_SGN_2:
+ fprintf (out, "H5T_SGN_2");
+ break;
+ default:
+ fprintf (out, "%ld", (long)sign);
+ break;
+ }
+ }
+ break;
+
+ case 't':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ H5T_class_t type_class = va_arg (ap, H5T_class_t);
+ switch (type_class) {
+ case H5T_NO_CLASS:
+ fprintf (out, "H5T_NO_CLASS");
+ break;
+ case H5T_INTEGER:
+ fprintf (out, "H5T_INTEGER");
+ break;
+ case H5T_FLOAT:
+ fprintf (out, "H5T_FLOAT");
+ break;
+ case H5T_TIME:
+ fprintf (out, "H5T_TIME");
+ break;
+ case H5T_STRING:
+ fprintf (out, "H5T_STRING");
+ break;
+ case H5T_BITFIELD:
+ fprintf (out, "H5T_BITFIELD");
+ break;
+ case H5T_OPAQUE:
+ fprintf (out, "H5T_OPAQUE");
+ break;
+ case H5T_COMPOUND:
+ fprintf (out, "H5T_COMPOUND");
+ break;
+ default:
+ fprintf (out, "%ld", (long)type_class);
+ break;
+ }
+ }
+ break;
+
+ case 'z':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ H5T_str_t str = va_arg (ap, H5T_str_t);
+ switch (str) {
+ case H5T_STR_ERROR:
+ fprintf (out, "H5T_STR_ERROR");
+ break;
+ case H5T_STR_NULL:
+ fprintf (out, "H5T_STR_NULL");
+ break;
+ case H5T_STR_SPACE:
+ fprintf (out, "H5T_STR_SPACE");
+ break;
+ default:
+ fprintf (out, "%ld", (long)str);
+ break;
+ }
+ }
+ break;
+
+ default:
+ fprintf (out, "BADTYPE(T%c)", type[1]);
+ goto error;
+ }
+ break;
+
+ case 'x':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ vp = va_arg (ap, void*);
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ }
+ break;
+
+ case 'z':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ size_t size = va_arg (ap, size_t);
+ HDfprintf (out, "%Zu", size);
+ }
+ break;
+
+ case 'Z':
+ switch (type[1]) {
+ case 'm':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ H5Z_method_t zmeth = va_arg (ap, H5Z_method_t);
+ if (zmeth<0) {
+ fprintf (out, "%d (range)", (int)zmeth);
+ } else if (H5Z_NONE==zmeth) {
+ fprintf (out, "H5Z_NONE");
+ } else if (H5Z_DEFLATE==zmeth) {
+ fprintf (out, "H5Z_DEFLATE");
+ } else if (zmeth<H5Z_USERDEF_MIN) {
+ fprintf (out, "H5Z_RES_%d", (int)zmeth);
+ } else if (zmeth<=H5Z_USERDEF_MAX) {
+ fprintf (out, "%d", (int)zmeth);
+ } else {
+ fprintf (out, "%d (range)", (int)zmeth);
+ }
+ }
+ break;
+
+ case 's':
+ if (ptr) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ ssize_t ssize = va_arg (ap, ssize_t);
+ HDfprintf (out, "%Zd", ssize);
+ }
+ break;
+
+ default:
+ fprintf (out, "BADTYPE(Z%c)", type[1]);
+ goto error;
+ }
+ break;
+
+ default:
+ if (isupper (type[0])) {
+ fprintf (out, "BADTYPE(%c%c)", type[0], type[1]);
+ } else {
+ fprintf (out, "BADTYPE(%c)", type[0]);
+ }
+ goto error;
+ }
+
+ type += isupper(*type)?2:1;
+ }
+
+ error:
+ va_end (ap);
+ if (returning) {
+ fprintf (out, ";\n");
+ } else {
+ fprintf (out, ")");
+ }
+ fflush (out);
+ return;
+}
+
+
diff --git a/src/H5A.c b/src/H5A.c
index efe8b2d..9a12ffb 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -150,8 +150,8 @@ H5A_term_interface(void)
*
--------------------------------------------------------------------------*/
hid_t
-H5Acreate(hid_t loc_id, const char *name, hid_t datatype, hid_t dataspace,
- hid_t create_plist)
+H5Acreate (hid_t loc_id, const char *name, hid_t datatype, hid_t dataspace,
+ hid_t create_plist)
{
void *obj = NULL;
H5G_entry_t *ent = NULL;
@@ -161,6 +161,7 @@ H5Acreate(hid_t loc_id, const char *name, hid_t datatype, hid_t dataspace,
hid_t ret_value = FAIL;
FUNC_ENTER(H5Acreate, FAIL);
+ H5TRACE5("i","isiii",loc_id,name,datatype,dataspace,create_plist);
/* check arguments */
if (NULL==(obj=H5I_object (loc_id))) {
@@ -399,7 +400,7 @@ H5A_get_index(H5G_entry_t *ent, const char *name)
* The LOC_ID can also be a named (committed) data type.
--------------------------------------------------------------------------*/
hid_t
-H5Aopen_name(hid_t loc_id, const char *name)
+H5Aopen_name (hid_t loc_id, const char *name)
{
H5G_entry_t *ent = NULL; /*Symtab entry of object to attribute*/
void *obj = NULL;
@@ -407,6 +408,7 @@ H5Aopen_name(hid_t loc_id, const char *name)
hid_t ret_value = FAIL;
FUNC_ENTER(H5Aopen_name, FAIL);
+ H5TRACE2("i","is",loc_id,name);
/* check arguments */
if(NULL == (obj = H5I_object(loc_id))) {
@@ -475,13 +477,14 @@ H5Aopen_name(hid_t loc_id, const char *name)
*
--------------------------------------------------------------------------*/
hid_t
-H5Aopen_idx(hid_t loc_id, unsigned idx)
+H5Aopen_idx (hid_t loc_id, unsigned idx)
{
H5G_entry_t *ent = NULL; /*Symtab entry of object to attribute */
void *obj = NULL;
hid_t ret_value = FAIL;
FUNC_ENTER(H5Aopen_idx, FAIL);
+ H5TRACE2("i","iIu",loc_id,idx);
/* check arguments */
if(NULL == (obj = H5I_object(loc_id))) {
@@ -595,13 +598,14 @@ done:
This function writes a complete attribute to disk.
--------------------------------------------------------------------------*/
herr_t
-H5Awrite(hid_t attr_id, hid_t mem_dt, void *buf)
+H5Awrite (hid_t attr_id, hid_t mem_dt, void *buf)
{
H5A_t *attr = NULL;
const H5T_t *mem_type = NULL;
herr_t ret_value = FAIL;
FUNC_ENTER(H5Awrite, FAIL);
+ H5TRACE3("e","iix",attr_id,mem_dt,buf);
/* check arguments */
if (H5_ATTR != H5I_group(attr_id) ||
@@ -762,13 +766,14 @@ done:
This function reads a complete attribute from disk.
--------------------------------------------------------------------------*/
herr_t
-H5Aread(hid_t attr_id, hid_t mem_dt, void *buf)
+H5Aread (hid_t attr_id, hid_t mem_dt, void *buf)
{
H5A_t *attr = NULL;
const H5T_t *mem_type = NULL;
herr_t ret_value = FAIL;
FUNC_ENTER(H5Aread, FAIL);
+ H5TRACE3("e","iix",attr_id,mem_dt,buf);
/* check arguments */
if (H5_ATTR != H5I_group(attr_id) ||
@@ -913,13 +918,14 @@ done:
or resource leaks will develop.
--------------------------------------------------------------------------*/
hid_t
-H5Aget_space(hid_t attr_id)
+H5Aget_space (hid_t attr_id)
{
H5A_t *attr = NULL;
H5S_t *dst = NULL;
hid_t ret_value = FAIL;
FUNC_ENTER(H5Aget_space, FAIL);
+ H5TRACE1("i","i",attr_id);
/* check arguments */
if (H5_ATTR != H5I_group(attr_id) ||
@@ -969,13 +975,14 @@ H5Aget_space(hid_t attr_id)
* then the data type is closed.
--------------------------------------------------------------------------*/
hid_t
-H5Aget_type(hid_t attr_id)
+H5Aget_type (hid_t attr_id)
{
H5A_t *attr = NULL;
H5T_t *dst = NULL;
hid_t ret_value = FAIL;
FUNC_ENTER(H5Aget_type, FAIL);
+ H5TRACE1("i","i",attr_id);
/* check arguments */
if (H5_ATTR != H5I_group(attr_id) ||
@@ -1033,13 +1040,14 @@ H5Aget_type(hid_t attr_id)
properly terminate the string.
--------------------------------------------------------------------------*/
size_t
-H5Aget_name(hid_t attr_id, char *buf, size_t buf_size)
+H5Aget_name (hid_t attr_id, char *buf, size_t buf_size)
{
H5A_t *attr = NULL;
size_t copy_len=0;
size_t ret_value = FAIL;
FUNC_ENTER(H5Aget_name, FAIL);
+ H5TRACE3("z","isz",attr_id,buf,buf_size);
/* check arguments */
if (H5_ATTR != H5I_group(attr_id) ||
@@ -1088,13 +1096,14 @@ H5Aget_name(hid_t attr_id, char *buf, size_t buf_size)
* The LOC_ID can also be a named (committed) data type.
--------------------------------------------------------------------------*/
int
-H5Anum_attrs(hid_t loc_id)
+H5Anum_attrs (hid_t loc_id)
{
H5G_entry_t *ent = NULL; /*symtab ent of object to attribute */
void *obj = NULL;
int ret_value = 0;
FUNC_ENTER(H5Anum_attrs, FAIL);
+ H5TRACE1("Is","i",loc_id);
/* check arguments */
if(NULL == (obj = H5I_object(loc_id))) {
@@ -1172,7 +1181,7 @@ H5Anum_attrs(hid_t loc_id)
*
--------------------------------------------------------------------------*/
int
-H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data)
+H5Aiterate (hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data)
{
H5G_entry_t *ent = NULL; /*symtab ent of object to attribute */
void *obj = NULL;
@@ -1181,6 +1190,7 @@ H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data)
intn idx;
FUNC_ENTER(H5Aiterate, FAIL);
+ H5TRACE4("Is","i*Iuxx",loc_id,attr_num,op,op_data);
/* check arguments */
if(NULL == (obj = H5I_object(loc_id))) {
@@ -1259,7 +1269,7 @@ H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data)
*
--------------------------------------------------------------------------*/
herr_t
-H5Adelete(hid_t loc_id, const char *name)
+H5Adelete (hid_t loc_id, const char *name)
{
H5A_t found_attr;
H5G_entry_t *ent = NULL; /*symtab ent of object to attribute */
@@ -1268,6 +1278,7 @@ H5Adelete(hid_t loc_id, const char *name)
herr_t ret_value = FAIL;
FUNC_ENTER(H5Aopen_name, FAIL);
+ H5TRACE2("e","is",loc_id,name);
/* check arguments */
if(NULL == (obj = H5I_object(loc_id))) {
@@ -1342,9 +1353,10 @@ H5Adelete(hid_t loc_id, const char *name)
attribute ID will result in undefined behavior.
--------------------------------------------------------------------------*/
herr_t
-H5Aclose(hid_t attr_id)
+H5Aclose (hid_t attr_id)
{
FUNC_ENTER(H5Aclose, FAIL);
+ H5TRACE1("e","i",attr_id);
/* check arguments */
if (H5_ATTR != H5I_group(attr_id) || NULL == H5I_object(attr_id)) {
diff --git a/src/H5D.c b/src/H5D.c
index d56930b..b33d38a 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -178,7 +178,7 @@ H5D_term_interface(void)
*-------------------------------------------------------------------------
*/
hid_t
-H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
+H5Dcreate (hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
hid_t create_parms_id)
{
H5G_t *loc = NULL;
@@ -189,6 +189,7 @@ H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
const H5D_create_t *create_parms = NULL;
FUNC_ENTER(H5Dcreate, FAIL);
+ H5TRACE5("i","isiii",loc_id,name,type_id,space_id,create_parms_id);
/* Check arguments */
if (NULL == (loc = H5G_loc(loc_id))) {
@@ -252,13 +253,14 @@ H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
*-------------------------------------------------------------------------
*/
hid_t
-H5Dopen(hid_t loc_id, const char *name)
+H5Dopen (hid_t loc_id, const char *name)
{
H5G_t *loc = NULL; /*location holding the dataset */
H5D_t *dataset = NULL; /*the dataset */
hid_t ret_value = FAIL;
FUNC_ENTER(H5Dopen, FAIL);
+ H5TRACE2("i","is",loc_id,name);
/* Check args */
if (NULL == (loc = H5G_loc(loc_id))) {
@@ -305,11 +307,12 @@ H5Dopen(hid_t loc_id, const char *name)
*-------------------------------------------------------------------------
*/
herr_t
-H5Dclose(hid_t dataset_id)
+H5Dclose (hid_t dataset_id)
{
H5D_t *dataset = NULL; /* dataset object to release */
FUNC_ENTER(H5Dclose, FAIL);
+ H5TRACE1("e","i",dataset_id);
/* Check args */
if (H5_DATASET != H5I_group(dataset_id) ||
@@ -355,6 +358,7 @@ H5Dget_space (hid_t dataset_id)
hid_t ret_value = FAIL;
FUNC_ENTER (H5Dget_space, FAIL);
+ H5TRACE1("i","i",dataset_id);
/* Check args */
if (H5_DATASET!=H5I_group (dataset_id) ||
@@ -411,6 +415,7 @@ H5Dget_type (hid_t dataset_id)
hid_t ret_value = FAIL;
FUNC_ENTER (H5Dget_type, FAIL);
+ H5TRACE1("i","i",dataset_id);
/* Check args */
if (H5_DATASET!=H5I_group (dataset_id) ||
@@ -466,6 +471,7 @@ H5Dget_create_plist (hid_t dataset_id)
hid_t ret_value = FAIL;
FUNC_ENTER (H5Dget_create_plist, FAIL);
+ H5TRACE1("i","i",dataset_id);
/* Check args */
if (H5_DATASET!=H5I_group (dataset_id) ||
@@ -534,7 +540,7 @@ H5Dget_create_plist (hid_t dataset_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5Dread(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
+H5Dread (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
hid_t file_space_id, hid_t xfer_parms_id, void *buf/*out*/)
{
H5D_t *dataset = NULL;
@@ -544,6 +550,8 @@ H5Dread(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
const H5D_xfer_t *xfer_parms = NULL;
FUNC_ENTER(H5Dread, FAIL);
+ H5TRACE5("e","iiiii",dataset_id,mem_type_id,mem_space_id,file_space_id,
+ xfer_parms_id);
/* check arguments */
if (H5_DATASET != H5I_group(dataset_id) ||
@@ -623,7 +631,7 @@ H5Dread(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
*-------------------------------------------------------------------------
*/
herr_t
-H5Dwrite(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
+H5Dwrite (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
hid_t file_space_id, hid_t xfer_parms_id, const void *buf)
{
H5D_t *dataset = NULL;
@@ -633,6 +641,8 @@ H5Dwrite(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
const H5D_xfer_t *xfer_parms = NULL;
FUNC_ENTER(H5Dwrite, FAIL);
+ H5TRACE6("e","iiiiix",dataset_id,mem_type_id,mem_space_id,file_space_id,
+ xfer_parms_id,buf);
/* check arguments */
if (H5_DATASET != H5I_group(dataset_id) ||
@@ -698,6 +708,7 @@ H5Dextend (hid_t dataset_id, const hsize_t *size)
H5D_t *dataset = NULL;
FUNC_ENTER (H5Dextend, FAIL);
+ H5TRACE2("e","i*h",dataset_id,size);
/* Check args */
if (H5_DATASET!=H5I_group (dataset_id) ||
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 54b797d..9634457 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -958,7 +958,7 @@ H5F_istore_lock (H5F_t *f, const H5O_layout_t *layout,
H5F_rdcc_ent_t *ent = NULL;
intn i, j, found = -1;
H5F_istore_ud1_t udata; /*B-tree pass-through */
- size_t chunk_size; /*size of a chunk */
+ size_t chunk_size=0; /*size of a chunk */
herr_t status; /*func return status */
void *chunk=NULL; /*the uncompressed chunk*/
void *temp=NULL; /*temporary chunk buffer*/
@@ -1052,6 +1052,7 @@ H5F_istore_lock (H5F_t *f, const H5O_layout_t *layout,
}
}
+ assert (chunk_size>0);
if (found<0 && chunk_size<=f->shared->access_parms->rdcc_nbytes) {
/*
* Add the chunk to the beginning of the cache after pruning the cache
diff --git a/src/H5E.c b/src/H5E.c
index 75318b3..0c189f0 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -157,9 +157,10 @@ void *H5E_auto_data_g = stderr;
*-------------------------------------------------------------------------
*/
herr_t
-H5Eset_auto (herr_t (*func)(void*client_data), void *client_data)
+H5Eset_auto (H5E_auto_t func, void *client_data)
{
FUNC_ENTER (H5Eset_auto, FAIL);
+ H5TRACE2("e","xx",func,client_data);
H5E_auto_g = func;
H5E_auto_data_g = client_data;
@@ -187,9 +188,10 @@ H5Eset_auto (herr_t (*func)(void*client_data), void *client_data)
*-------------------------------------------------------------------------
*/
herr_t
-H5Eget_auto (herr_t (**func)(void*), void **client_data)
+H5Eget_auto (H5E_auto_t *func, void **client_data)
{
FUNC_ENTER (H5Eget_auto, FAIL);
+ H5TRACE2("e","*x*x",func,client_data);
if (func) *func = H5E_auto_g;
if (client_data) *client_data = H5E_auto_data_g;
@@ -220,6 +222,7 @@ herr_t
H5Eclear (void)
{
FUNC_ENTER (H5Eclear, FAIL);
+ H5TRACE0("e", "");
/* FUNC_ENTER() does all the work */
FUNC_LEAVE (SUCCEED);
}
@@ -252,6 +255,7 @@ H5Eprint (FILE *stream)
herr_t status = FAIL;
FUNC_ENTER (H5Eprint, FAIL);
+ /*NO TRACE*/
if (!stream) stream = stderr;
fprintf (stream, "HDF5-DIAG: Error detected in thread 0.");
@@ -288,6 +292,7 @@ H5Ewalk (H5E_direction_t direction, H5E_walk_t func, void *client_data)
herr_t status = FAIL;
FUNC_ENTER (H5Ewalk, FAIL);
+ H5TRACE3("e","Edxx",direction,func,client_data);
status = H5E_walk (direction, func, client_data);
FUNC_LEAVE (status);
}
@@ -329,13 +334,15 @@ H5Ewalk (H5E_direction_t direction, H5E_walk_t func, void *client_data)
*-------------------------------------------------------------------------
*/
herr_t
-H5Ewalk_cb(int n, H5E_error_t *err_desc, void *client_data)
+H5Ewalk_cb (int n, H5E_error_t *err_desc, void *client_data)
{
FILE *stream = (FILE *)client_data;
const char *maj_str = NULL;
const char *min_str = NULL;
const int indent = 2;
+ /*NO TRACE*/
+
/* Check arguments */
assert (err_desc);
if (!client_data) client_data = stderr;
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h
index 819a401..830b426 100644
--- a/src/H5Eprivate.h
+++ b/src/H5Eprivate.h
@@ -38,10 +38,11 @@
*/
#define HRETURN_ERROR(maj, min, ret_val, str) { \
HERROR (maj, min, str); \
+ PABLO_TRACE_OFF (PABLO_MASK, pablo_func_id); \
+ H5TRACE_RETURN(ret_val); \
if (H5_IS_API(FUNC) && H5E_auto_g) { \
(H5E_auto_g)(H5E_auto_data_g); \
} \
- PABLO_TRACE_OFF (PABLO_MASK, pablo_func_id); \
return (ret_val); \
}
@@ -52,6 +53,7 @@
*/
#define HRETURN(ret_val) { \
PABLO_TRACE_OFF (PABLO_MASK, pablo_func_id); \
+ H5TRACE_RETURN(ret_val); \
return (ret_val); \
}
@@ -64,6 +66,7 @@
*/
#define HGOTO_ERROR(maj, min, ret_val, str) { \
HERROR (maj, min, str); \
+ H5TRACE_RETURN(ret_val); \
if (H5_IS_API(FUNC) && H5E_auto_g) { \
(H5E_auto_g)(H5E_auto_data_g); \
} \
diff --git a/src/H5Epublic.h b/src/H5Epublic.h
index 9be3ed0..4096179 100644
--- a/src/H5Epublic.h
+++ b/src/H5Epublic.h
@@ -165,13 +165,14 @@ typedef enum H5E_direction_t {
/* Error stack traversal callback function */
typedef herr_t (*H5E_walk_t)(int n, H5E_error_t *err_desc, void *client_data);
+typedef herr_t (*H5E_auto_t)(void *client_data);
#ifdef __cplusplus
extern "C" {
#endif
-herr_t H5Eset_auto (herr_t (*func)(void*client_data), void *client_data);
-herr_t H5Eget_auto (herr_t (**func)(void*client_data), void **client_data);
+herr_t H5Eset_auto (H5E_auto_t func, void *client_data);
+herr_t H5Eget_auto (H5E_auto_t *func, void **client_data);
herr_t H5Eclear (void);
herr_t H5Eprint (FILE *stream);
herr_t H5Ewalk (H5E_direction_t direction, H5E_walk_t func, void *client_data);
diff --git a/src/H5F.c b/src/H5F.c
index ad26fc9..6065d5d 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -250,13 +250,14 @@ H5F_encode_length_unusual(const H5F_t *f, uint8 **p, uint8 *l)
*-------------------------------------------------------------------------
*/
hid_t
-H5Fget_create_template(hid_t fid)
+H5Fget_create_template (hid_t fid)
{
H5F_t *file = NULL;
hid_t ret_value = FAIL;
H5F_create_t *tmpl = NULL;
FUNC_ENTER(H5Fget_create_template, FAIL);
+ H5TRACE1("i","i",fid);
/* check args */
if (H5_FILE != H5I_group(fid) || NULL==(file=H5I_object (fid))) {
@@ -307,6 +308,7 @@ H5Fget_access_template (hid_t file_id)
hid_t ret_value = FAIL;
FUNC_ENTER (H5Fget_access_template, FAIL);
+ H5TRACE1("i","i",file_id);
/* Check args */
if (H5_FILE!=H5I_group (file_id) || NULL==(f=H5I_object (file_id))) {
@@ -396,7 +398,7 @@ H5F_locate_signature(H5F_low_t *f_handle, const H5F_access_t *access_parms,
while (H5F_addr_lt(addr, &max_addr)) {
if (H5F_low_read(f_handle, access_parms, H5D_XFER_DFLT, addr,
H5F_SIGNATURE_LEN, buf) < 0) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "can't read file");
+ HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read file");
}
if (!HDmemcmp(buf, H5F_SIGNATURE, H5F_SIGNATURE_LEN))
break;
@@ -431,8 +433,8 @@ H5F_locate_signature(H5F_low_t *f_handle, const H5F_access_t *access_parms,
DESCRIPTION
This function determines if a file is an HDF5 format file.
--------------------------------------------------------------------------*/
-hbool_t
-H5Fis_hdf5(const char *filename)
+hbool_t
+H5Fis_hdf5 (const char *filename)
{
H5F_low_t *f_handle = NULL; /* file handle */
haddr_t addr; /* Address of file signature & header */
@@ -440,6 +442,7 @@ H5Fis_hdf5(const char *filename)
const H5F_low_class_t *type = NULL;
FUNC_ENTER(H5Fis_hdf5, FAIL);
+ H5TRACE1("b","s",filename);
/* Check args and all the boring stuff. */
if (filename == NULL) {
@@ -779,13 +782,13 @@ H5F_open(const char *name, uintn flags,
/* Truncate existing file */
if (0 == (flags & H5F_ACC_RDWR)) {
HRETURN_ERROR(H5E_FILE, H5E_BADVALUE, NULL,
- "can't truncate without write intent");
+ "unable to truncate without write intent");
}
fd = H5F_low_open(type, name, access_parms,
H5F_ACC_RDWR | H5F_ACC_TRUNC, NULL);
if (!fd) {
HRETURN_ERROR(H5E_FILE, H5E_CANTCREATE, NULL,
- "can't truncate file");
+ "unable to truncate file");
}
f = H5F_new(NULL, create_parms, access_parms);
f->shared->key = search;
@@ -809,7 +812,7 @@ H5F_open(const char *name, uintn flags,
} else if (flags & H5F_ACC_CREAT) {
if (0 == (flags & H5F_ACC_RDWR)) {
HRETURN_ERROR(H5E_FILE, H5E_BADVALUE, NULL,
- "can't create file without write intent");
+ "unable to create file without write intent");
}
#ifdef HAVE_PARALLEL
/*
@@ -830,7 +833,7 @@ H5F_open(const char *name, uintn flags,
#endif /*HAVE_PARALLEL*/
if (!fd) {
HRETURN_ERROR(H5E_FILE, H5E_CANTCREATE, NULL,
- "can't create file");
+ "unable to create file");
}
f = H5F_new(NULL, create_parms, access_parms);
f->shared->key = search;
@@ -883,7 +886,7 @@ H5F_open(const char *name, uintn flags,
f->shared->consist_flags = 0x03;
if (H5F_flush(f, FALSE) < 0) {
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL,
- "can't write file boot block");
+ "unable to write file boot block");
}
} else if (1 == f->shared->nrefs) {
@@ -891,11 +894,13 @@ H5F_open(const char *name, uintn flags,
if (H5F_locate_signature(f->shared->lf,
f->shared->access_parms,
&(f->shared->boot_addr)) < 0) {
- HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, NULL, "can't find signature");
+ HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, NULL,
+ "unable to find signature");
}
if (H5F_low_read(f->shared->lf, access_parms, H5D_XFER_DFLT,
&(f->shared->boot_addr), fixed_size, buf) < 0) {
- HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "can't read boot block");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL,
+ "unable to read boot block");
}
/*
@@ -975,7 +980,7 @@ H5F_open(const char *name, uintn flags,
if (H5F_low_read(f->shared->lf, access_parms, H5D_XFER_DFLT,
&addr1, variable_size, buf) < 0) {
HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, NULL,
- "can't read boot block");
+ "unable to read boot block");
}
p = buf;
H5F_addr_decode(f, &p, &(f->shared->base_addr));
@@ -983,7 +988,7 @@ H5F_open(const char *name, uintn flags,
H5F_addr_decode(f, &p, &(f->shared->hdf5_eof));
if (H5G_ent_decode(f, &p, &root_ent) < 0) {
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL,
- "can't read root symbol entry");
+ "unable to read root symbol entry");
}
if (H5G_mkroot (f, &root_ent)<0) {
HGOTO_ERROR (H5E_FILE, H5E_CANTOPENFILE, NULL,
@@ -1094,8 +1099,8 @@ H5F_open(const char *name, uintn flags,
*
*-------------------------------------------------------------------------
*/
-hid_t
-H5Fcreate(const char *filename, uintn flags, hid_t create_id,
+hid_t
+H5Fcreate (const char *filename, unsigned flags, hid_t create_id,
hid_t access_id)
{
@@ -1110,6 +1115,7 @@ H5Fcreate(const char *filename, uintn flags, hid_t create_id,
hid_t ret_value = FAIL;
FUNC_ENTER(H5Fcreate, FAIL);
+ H5TRACE4("i","sIuii",filename,flags,create_id,access_id);
/* Check/fix arguments */
if (!filename || !*filename) {
@@ -1207,8 +1213,8 @@ H5Fcreate(const char *filename, uintn flags, hid_t create_id,
*
*-------------------------------------------------------------------------
*/
-hid_t
-H5Fopen(const char *filename, uintn flags, hid_t access_id)
+hid_t
+H5Fopen (const char *filename, unsigned flags, hid_t access_id)
{
H5F_t *new_file = NULL; /* file struct for new file */
const H5F_access_t *access_parms; /* pointer to the file access
@@ -1218,6 +1224,7 @@ H5Fopen(const char *filename, uintn flags, hid_t access_id)
hid_t ret_value = FAIL;
FUNC_ENTER(H5Fopen, FAIL);
+ H5TRACE3("i","sIui",filename,flags,access_id);
/* Check/fix arguments. */
if (!filename || !*filename) {
@@ -1237,12 +1244,13 @@ H5Fopen(const char *filename, uintn flags, hid_t access_id)
/* Open the file */
if (NULL==(new_file=H5F_open(filename, flags, NULL, access_parms))) {
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "cant open file");
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to open file");
}
/* Get an atom for the file */
if ((ret_value = H5I_register(H5_FILE, new_file)) < 0) {
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "can't atomize file");
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL,
+ "unable to atomize file handle");
}
done:
@@ -1339,7 +1347,7 @@ H5F_flush(H5F_t *f, hbool_t invalidate)
if (H5F_low_write(f->shared->lf, f->shared->access_parms,
H5D_XFER_DFLT,
&(f->shared->boot_addr), (size_t)(p-buf), buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "can't write header");
+ HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write header");
}
/* Flush file buffers to disk */
@@ -1462,19 +1470,20 @@ H5F_close(H5F_t *f)
The file boot block is flushed to disk since it's contents may have
changed.
--------------------------------------------------------------------------*/
-herr_t
-H5Fclose(hid_t fid)
+herr_t
+H5Fclose (hid_t fid)
{
herr_t ret_value = SUCCEED;
FUNC_ENTER(H5Fclose, FAIL);
+ H5TRACE1("e","i",fid);
/* Check/fix arguments. */
if (H5_FILE != H5I_group(fid)) {
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file atom");
}
if (NULL == H5I_object(fid)) {
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't unatomize file");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "unable to unatomize file");
}
/*
diff --git a/src/H5Fistore.c b/src/H5Fistore.c
index 54b797d..9634457 100644
--- a/src/H5Fistore.c
+++ b/src/H5Fistore.c
@@ -958,7 +958,7 @@ H5F_istore_lock (H5F_t *f, const H5O_layout_t *layout,
H5F_rdcc_ent_t *ent = NULL;
intn i, j, found = -1;
H5F_istore_ud1_t udata; /*B-tree pass-through */
- size_t chunk_size; /*size of a chunk */
+ size_t chunk_size=0; /*size of a chunk */
herr_t status; /*func return status */
void *chunk=NULL; /*the uncompressed chunk*/
void *temp=NULL; /*temporary chunk buffer*/
@@ -1052,6 +1052,7 @@ H5F_istore_lock (H5F_t *f, const H5O_layout_t *layout,
}
}
+ assert (chunk_size>0);
if (found<0 && chunk_size<=f->shared->access_parms->rdcc_nbytes) {
/*
* Add the chunk to the beginning of the cache after pruning the cache
diff --git a/src/H5Flow.c b/src/H5Flow.c
index 91fb495..dc4195f 100644
--- a/src/H5Flow.c
+++ b/src/H5Flow.c
@@ -753,7 +753,7 @@ H5F_addr_zerop(const haddr_t *addr)
void
H5F_addr_encode(H5F_t *f, uint8 **pp, const haddr_t *addr)
{
- uint i;
+ uintn i;
haddr_t tmp;
assert(f);
@@ -797,7 +797,7 @@ H5F_addr_encode(H5F_t *f, uint8 **pp, const haddr_t *addr)
void
H5F_addr_decode(H5F_t *f, const uint8 **pp, haddr_t *addr/*out*/)
{
- uint i;
+ uintn i;
haddr_t tmp;
uint8 c;
hbool_t all_zero = TRUE;
diff --git a/src/H5G.c b/src/H5G.c
index 4c44212..e4760a8 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -125,13 +125,14 @@ static void H5G_term_interface(void);
*-------------------------------------------------------------------------
*/
hid_t
-H5Gcreate(hid_t loc_id, const char *name, size_t size_hint)
+H5Gcreate (hid_t loc_id, const char *name, size_t size_hint)
{
H5G_t *loc = NULL;
H5G_t *grp = NULL;
hid_t ret_value = FAIL;
FUNC_ENTER(H5Gcreate, FAIL);
+ H5TRACE3("i","isz",loc_id,name,size_hint);
/* Check arguments */
if (NULL==(loc=H5G_loc (loc_id))) {
@@ -174,13 +175,14 @@ H5Gcreate(hid_t loc_id, const char *name, size_t size_hint)
*-------------------------------------------------------------------------
*/
hid_t
-H5Gopen(hid_t loc_id, const char *name)
+H5Gopen (hid_t loc_id, const char *name)
{
hid_t ret_value = FAIL;
H5G_t *grp = NULL;
H5G_t *loc = NULL;
FUNC_ENTER(H5Gopen, FAIL);
+ H5TRACE2("i","is",loc_id,name);
/* Check args */
if (NULL==(loc=H5G_loc(loc_id))) {
@@ -222,9 +224,10 @@ H5Gopen(hid_t loc_id, const char *name)
*-------------------------------------------------------------------------
*/
herr_t
-H5Gclose(hid_t grp_id)
+H5Gclose (hid_t grp_id)
{
FUNC_ENTER(H5Gclose, FAIL);
+ H5TRACE1("e","i",grp_id);
/* Check args */
if (H5_GROUP != H5I_group(grp_id) ||
@@ -272,12 +275,13 @@ H5Gclose(hid_t grp_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5Gset(hid_t loc_id, const char *name)
+H5Gset (hid_t loc_id, const char *name)
{
H5G_t *grp = NULL;
H5G_t *loc = NULL;
FUNC_ENTER(H5Gset, FAIL);
+ H5TRACE2("e","is",loc_id,name);
/* Check/fix arguments */
if (NULL==(loc=H5G_loc(loc_id))) {
@@ -332,12 +336,13 @@ H5Gset(hid_t loc_id, const char *name)
*-------------------------------------------------------------------------
*/
herr_t
-H5Gpush(hid_t loc_id, const char *name)
+H5Gpush (hid_t loc_id, const char *name)
{
H5G_t *grp = NULL;
H5G_t *loc = NULL;
FUNC_ENTER(H5Gpush, FAIL);
+ H5TRACE2("e","is",loc_id,name);
/* Check arguments */
if (NULL == (loc = H5G_loc(loc_id))) {
@@ -396,11 +401,12 @@ H5Gpush(hid_t loc_id, const char *name)
*-------------------------------------------------------------------------
*/
herr_t
-H5Gpop(hid_t loc_id)
+H5Gpop (hid_t loc_id)
{
H5G_t *loc = NULL;
FUNC_ENTER(H5Gpop, FAIL);
+ H5TRACE1("e","i",loc_id);
/* Check arguments */
if (NULL == (loc = H5G_loc(loc_id))) {
@@ -452,6 +458,7 @@ H5Giterate (hid_t loc_id, const char *name, int *idx,
H5G_t *loc = NULL;
FUNC_ENTER (H5Giterate, FAIL);
+ H5TRACE5("e","is*Isxx",loc_id,name,idx,op,op_data);
/* Check args */
if (NULL==(loc=H5G_loc (loc_id))) {
@@ -518,6 +525,7 @@ H5Gmove (hid_t __unused__ loc_id, const char __unused__ *src,
const char __unused__ *dst)
{
FUNC_ENTER (H5Gmove, FAIL);
+ H5TRACE3("e","iss",loc_id,src,dst);
HRETURN_ERROR (H5E_SYM, H5E_UNSUPPORTED, FAIL,
"unable to rename object (not implemented yet)");
@@ -561,6 +569,7 @@ H5Glink (hid_t loc_id, H5G_link_t type, const char *cur_name,
H5G_t *loc = NULL;
FUNC_ENTER (H5Glink, FAIL);
+ H5TRACE4("e","iGlss",loc_id,type,cur_name,new_name);
/* Check arguments */
if (NULL==(loc=H5G_loc (loc_id))) {
@@ -610,6 +619,7 @@ herr_t
H5Gunlink (hid_t __unused__ loc_id, const char __unused__ *name)
{
FUNC_ENTER (H5Gunlink, FAIL);
+ H5TRACE2("e","is",loc_id,name);
HRETURN_ERROR (H5E_SYM, H5E_UNSUPPORTED, FAIL,
"unable to unlink name (not implemented yet)");
@@ -644,6 +654,7 @@ H5Gstat (hid_t loc_id, const char *name, hbool_t follow_link,
H5G_t *loc = NULL;
FUNC_ENTER (H5Gstat, FAIL);
+ H5TRACE3("e","isb",loc_id,name,follow_link);
/* Check arguments */
if (NULL==(loc=H5G_loc (loc_id))) {
@@ -686,6 +697,7 @@ H5Gget_linkval (hid_t loc_id, const char *name, size_t size, char *buf/*out*/)
H5G_t *loc = NULL;
FUNC_ENTER (H5Gget_linkval, FAIL);
+ H5TRACE3("e","isz",loc_id,name,size);
/* Check arguments */
if (NULL==(loc=H5G_loc (loc_id))) {
diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h
index eb8b804..96442a7 100644
--- a/src/H5Ipublic.h
+++ b/src/H5Ipublic.h
@@ -39,7 +39,6 @@ typedef enum {
H5_DATATYPE, /*group ID for Datatype objects */
H5_DATASPACE, /*group ID for Dataspace objects */
H5_DATASET, /*group ID for Dataset objects */
- H5_DIRECTORY, /*group ID for Directory objects */
H5_ATTR, /*group ID for Attribute objects */
MAXGROUP /*highest group in group_t (Invalid as true group)*/
} H5I_group_t;
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index ed629fd..e252ff0 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -324,10 +324,10 @@ H5O_attr_reset(void *_mesg)
parameter.
--------------------------------------------------------------------------*/
static herr_t
-H5O_attr_debug(H5F_t __unused__ *f, const void __unused__ *mesg, FILE __unused__ * stream,
- intn __unused__ indent, intn __unused__ fwidth)
+H5O_attr_debug(H5F_t __unused__ *f, const void __unused__ *mesg,
+ FILE __unused__ * stream, intn __unused__ indent,
+ intn __unused__ fwidth)
{
- const H5A_t *attr = (const H5A_t *) mesg;
#ifdef LATER
const char *s;
char buf[256];
@@ -338,7 +338,6 @@ H5O_attr_debug(H5F_t __unused__ *f, const void __unused__ *mesg, FILE __unused__
/* check args */
assert(f);
- assert(attr);
assert(stream);
assert(indent >= 0);
assert(fwidth >= 0);
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index 9ea0713..c53152e 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -441,16 +441,15 @@ H5O_dtype_encode_helper(uint8 **pp, const H5T_t *dt)
function using malloc() and is returned to the caller.
--------------------------------------------------------------------------*/
static void *
-H5O_dtype_decode(H5F_t *f, const uint8 *p, H5O_shared_t *sh)
+H5O_dtype_decode(H5F_t __unused__ *f, const uint8 *p,
+ H5O_shared_t __unused__ *sh)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5O_dtype_decode, NULL);
/* check args */
- assert(f);
assert(p);
- assert (!sh);
dt = H5MM_xcalloc(1, sizeof(H5T_t));
H5F_addr_undef (&(dt->ent.header));
@@ -646,12 +645,12 @@ H5O_dtype_reset(void *_mesg)
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_dtype_get_share (H5F_t *f, const void *_mesg, H5O_shared_t *sh/*out*/)
+H5O_dtype_get_share (H5F_t __unused__ *f, const void *_mesg,
+ H5O_shared_t *sh/*out*/)
{
const H5T_t *dt = (const H5T_t *)_mesg;
FUNC_ENTER (H5O_dtype_get_share, FAIL);
- assert (f);
assert (dt);
assert (sh);
@@ -685,12 +684,12 @@ H5O_dtype_get_share (H5F_t *f, const void *_mesg, H5O_shared_t *sh/*out*/)
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_dtype_set_share (H5F_t *f, void *_mesg/*in,out*/, const H5O_shared_t *sh)
+H5O_dtype_set_share (H5F_t __unused__ *f, void *_mesg/*in,out*/,
+ const H5O_shared_t *sh)
{
H5T_t *dt = (H5T_t *)_mesg;
FUNC_ENTER (H5O_dtype_set_share, FAIL);
- assert (f);
assert (dt);
assert (sh);
assert (!sh->in_gh);
diff --git a/src/H5P.c b/src/H5P.c
index 095bfa9..4e74e45 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -146,12 +146,13 @@ H5P_term_interface(void)
* lists.
--------------------------------------------------------------------------*/
hid_t
-H5Pcreate(H5P_class_t type)
+H5Pcreate (H5P_class_t type)
{
hid_t ret_value = FAIL;
void *tmpl = NULL;
FUNC_ENTER(H5Pcreate, FAIL);
+ H5TRACE1("i","p",type);
/* Allocate a new property list and initialize it with default values */
switch (type) {
@@ -241,12 +242,13 @@ H5P_create(H5P_class_t type, void *tmpl)
This function releases access to a property list object
--------------------------------------------------------------------------*/
herr_t
-H5Pclose(hid_t tid)
+H5Pclose (hid_t tid)
{
H5P_class_t type;
void *tmpl = NULL;
FUNC_ENTER(H5Pclose, FAIL);
+ H5TRACE1("e","i",tid);
/* Check arguments */
if ((type=H5Pget_class (tid))<0 ||
@@ -413,12 +415,13 @@ H5Pget_class(hid_t tid)
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_version(hid_t tid, int *boot/*out*/, int *freelist/*out*/,
+H5Pget_version (hid_t tid, int *boot/*out*/, int *freelist/*out*/,
int *stab/*out*/, int *shhdr/*out*/)
{
H5F_create_t *tmpl = NULL;
FUNC_ENTER(H5Pget_version, FAIL);
+ H5TRACE1("e","i",tid);
/* Check arguments */
if (H5P_FILE_CREATE != H5Pget_class(tid) ||
@@ -453,12 +456,13 @@ H5Pget_version(hid_t tid, int *boot/*out*/, int *freelist/*out*/,
*-------------------------------------------------------------------------
*/
herr_t
-H5Pset_userblock(hid_t tid, hsize_t size)
+H5Pset_userblock (hid_t tid, hsize_t size)
{
uintn i;
H5F_create_t *tmpl = NULL;
FUNC_ENTER(H5Pset_userblock, FAIL);
+ H5TRACE2("e","ih",tid,size);
/* Check arguments */
if (H5P_FILE_CREATE != H5Pget_class(tid) ||
@@ -498,11 +502,12 @@ H5Pset_userblock(hid_t tid, hsize_t size)
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_userblock(hid_t tid, hsize_t *size)
+H5Pget_userblock (hid_t tid, hsize_t *size)
{
H5F_create_t *tmpl = NULL;
FUNC_ENTER(H5Pget_userblock, FAIL);
+ H5TRACE2("e","i*h",tid,size);
/* Check args */
if (H5P_FILE_CREATE != H5Pget_class(tid) ||
@@ -551,6 +556,7 @@ H5Pset_alignment (hid_t fapl_id, hsize_t threshold, hsize_t alignment)
H5F_access_t *fapl = NULL;
FUNC_ENTER (H5Pset_alignment, FAIL);
+ H5TRACE3("e","ihh",fapl_id,threshold,alignment);
/* Check args */
if (H5P_FILE_ACCESS != H5Pget_class (fapl_id) ||
@@ -596,6 +602,7 @@ H5Pget_alignment (hid_t fapl_id, hsize_t *threshold/*out*/,
H5F_access_t *fapl = NULL;
FUNC_ENTER (H5Pget_alignment, FAIL);
+ H5TRACE1("e","i",fapl_id);
/* Check args */
if (H5P_FILE_ACCESS != H5Pget_class (fapl_id) ||
@@ -631,11 +638,12 @@ H5Pget_alignment (hid_t fapl_id, hsize_t *threshold/*out*/,
*-------------------------------------------------------------------------
*/
herr_t
-H5Pset_sizes(hid_t tid, size_t sizeof_addr, size_t sizeof_size)
+H5Pset_sizes (hid_t tid, size_t sizeof_addr, size_t sizeof_size)
{
H5F_create_t *tmpl = NULL;
FUNC_ENTER(H5Pset_sizeof_addr, FAIL);
+ H5TRACE3("e","izz",tid,sizeof_addr,sizeof_size);
/* Check arguments */
if (H5P_FILE_CREATE != H5Pget_class(tid) ||
@@ -685,12 +693,13 @@ H5Pset_sizes(hid_t tid, size_t sizeof_addr, size_t sizeof_size)
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_sizes(hid_t tid,
+H5Pget_sizes (hid_t tid,
size_t *sizeof_addr /*out */ , size_t *sizeof_size /*out */ )
{
H5F_create_t *tmpl = NULL;
FUNC_ENTER(H5Pget_sizes, FAIL);
+ H5TRACE1("e","i",tid);
/* Check args */
if (H5P_FILE_CREATE != H5Pget_class(tid) ||
@@ -737,11 +746,12 @@ H5Pget_sizes(hid_t tid,
*-------------------------------------------------------------------------
*/
herr_t
-H5Pset_sym_k(hid_t tid, int ik, int lk)
+H5Pset_sym_k (hid_t tid, int ik, int lk)
{
H5F_create_t *tmpl = NULL;
FUNC_ENTER(H5Pset_sym_k, FAIL);
+ H5TRACE3("e","iIsIs",tid,ik,lk);
/* Check arguments */
if (H5P_FILE_CREATE != H5Pget_class(tid) ||
@@ -779,11 +789,12 @@ H5Pset_sym_k(hid_t tid, int ik, int lk)
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_sym_k(hid_t tid, int *ik /*out */ , int *lk /*out */ )
+H5Pget_sym_k (hid_t tid, int *ik /*out */ , int *lk /*out */ )
{
H5F_create_t *tmpl = NULL;
FUNC_ENTER(H5Pget_sym_k, FAIL);
+ H5TRACE1("e","i",tid);
/* Check arguments */
if (H5P_FILE_CREATE != H5Pget_class(tid) ||
@@ -819,11 +830,12 @@ H5Pget_sym_k(hid_t tid, int *ik /*out */ , int *lk /*out */ )
*-------------------------------------------------------------------------
*/
herr_t
-H5Pset_istore_k(hid_t tid, int ik)
+H5Pset_istore_k (hid_t tid, int ik)
{
H5F_create_t *tmpl = NULL;
FUNC_ENTER(H5Pset_istore_k, FAIL);
+ H5TRACE2("e","iIs",tid,ik);
/* Check arguments */
if (H5P_FILE_CREATE != H5Pget_class(tid) ||
@@ -860,11 +872,12 @@ H5Pset_istore_k(hid_t tid, int ik)
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_istore_k(hid_t tid, int *ik /*out */ )
+H5Pget_istore_k (hid_t tid, int *ik /*out */ )
{
H5F_create_t *tmpl = NULL;
FUNC_ENTER(H5Pget_istore_k, FAIL);
+ H5TRACE1("e","i",tid);
/* Check arguments */
if (H5P_FILE_CREATE != H5Pget_class(tid) ||
@@ -896,11 +909,12 @@ H5Pget_istore_k(hid_t tid, int *ik /*out */ )
*-------------------------------------------------------------------------
*/
herr_t
-H5Pset_layout(hid_t tid, H5D_layout_t layout)
+H5Pset_layout (hid_t tid, H5D_layout_t layout)
{
H5D_create_t *tmpl = NULL;
FUNC_ENTER(H5Pset_layout, FAIL);
+ H5TRACE2("e","iDl",tid,layout);
/* Check arguments */
if (H5P_DATASET_CREATE != H5Pget_class(tid) ||
@@ -972,12 +986,13 @@ H5Pget_layout(hid_t tid)
*-------------------------------------------------------------------------
*/
herr_t
-H5Pset_chunk(hid_t tid, int ndims, const hsize_t dim[])
+H5Pset_chunk (hid_t tid, int ndims, const hsize_t dim[])
{
int i;
H5D_create_t *tmpl = NULL;
FUNC_ENTER(H5Pset_chunk, FAIL);
+ H5TRACE3("e","iIs*h",tid,ndims,dim);
/* Check arguments */
if (H5P_DATASET_CREATE != H5Pget_class(tid) ||
@@ -1034,12 +1049,13 @@ H5Pset_chunk(hid_t tid, int ndims, const hsize_t dim[])
*-------------------------------------------------------------------------
*/
int
-H5Pget_chunk(hid_t tid, int max_ndims, hsize_t dim[]/*out*/)
+H5Pget_chunk (hid_t tid, int max_ndims, hsize_t dim[]/*out*/)
{
int i;
H5D_create_t *tmpl = NULL;
FUNC_ENTER(H5Pget_chunk, FAIL);
+ H5TRACE2("Is","iIs",tid,max_ndims);
/* Check arguments */
if (H5P_DATASET_CREATE != H5Pget_class(tid) ||
@@ -1094,6 +1110,7 @@ H5Pset_external (hid_t plist_id, const char *name, off_t offset, hsize_t size)
H5D_create_t *plist = NULL;
FUNC_ENTER(H5Pset_external, FAIL);
+ H5TRACE4("e","isoh",plist_id,name,offset,size);
/* Check arguments */
if (H5P_DATASET_CREATE != H5Pget_class(plist_id) ||
@@ -1168,6 +1185,7 @@ H5Pget_external_count (hid_t plist_id)
H5D_create_t *plist = NULL;
FUNC_ENTER (H5Pget_external_count, FAIL);
+ H5TRACE1("Is","i",plist_id);
/* Check arguments */
if (H5P_DATASET_CREATE != H5Pget_class(plist_id) ||
@@ -1216,6 +1234,7 @@ H5Pget_external (hid_t plist_id, int idx, size_t name_size, char *name/*out*/,
H5D_create_t *plist = NULL;
FUNC_ENTER (H5Pget_external, FAIL);
+ H5TRACE3("e","iIsz",plist_id,idx,name_size);
/* Check arguments */
if (H5P_DATASET_CREATE != H5Pget_class(plist_id) ||
@@ -1298,6 +1317,7 @@ H5Pset_stdio (hid_t tid)
H5F_access_t *tmpl = NULL;
FUNC_ENTER (H5Pset_stdio, FAIL);
+ H5TRACE1("e","i",tid);
/* Check arguments */
if (H5P_FILE_ACCESS != H5Pget_class(tid) ||
@@ -1338,6 +1358,7 @@ H5Pget_stdio (hid_t tid)
H5F_access_t *tmpl = NULL;
FUNC_ENTER (H5Pget_stdio, FAIL);
+ H5TRACE1("e","i",tid);
/* Check arguments */
if (H5P_FILE_ACCESS != H5Pget_class (tid) ||
@@ -1378,6 +1399,7 @@ H5Pset_sec2 (hid_t tid)
H5F_access_t *tmpl = NULL;
FUNC_ENTER (H5Pset_sec2, FAIL);
+ H5TRACE1("e","i",tid);
/* Check arguments */
if (H5P_FILE_ACCESS != H5Pget_class(tid) ||
@@ -1418,6 +1440,7 @@ H5Pget_sec2 (hid_t tid)
H5F_access_t *tmpl = NULL;
FUNC_ENTER (H5Pget_sec2, FAIL);
+ H5TRACE1("e","i",tid);
/* Check arguments */
if (H5P_FILE_ACCESS != H5Pget_class (tid) ||
@@ -1462,6 +1485,7 @@ H5Pset_core (hid_t tid, size_t increment)
H5F_access_t *tmpl = NULL;
FUNC_ENTER (H5Pset_core, FAIL);
+ H5TRACE2("e","iz",tid,increment);
/* Check arguments */
if (H5P_FILE_ACCESS != H5Pget_class(tid) ||
@@ -1509,6 +1533,7 @@ H5Pget_core (hid_t tid, size_t *increment/*out*/)
H5F_access_t *tmpl = NULL;
FUNC_ENTER (H5Pget_core, FAIL);
+ H5TRACE1("e","i",tid);
/* Check arguments */
if (H5P_FILE_ACCESS != H5Pget_class (tid) ||
@@ -1556,6 +1581,7 @@ H5Pset_split (hid_t tid, const char *meta_ext, hid_t meta_tid,
H5F_access_t *raw_tmpl = &H5F_access_dflt;
FUNC_ENTER (H5Pset_split, FAIL);
+ H5TRACE5("e","isisi",tid,meta_ext,meta_tid,raw_ext,raw_tid);
/* Check arguments */
if (H5P_FILE_ACCESS != H5Pget_class(tid) ||
@@ -1623,6 +1649,7 @@ H5Pget_split (hid_t tid, size_t meta_ext_size, char *meta_ext/*out*/,
H5F_access_t *tmpl = NULL;
FUNC_ENTER (H5Pget_split, FAIL);
+ H5TRACE3("e","izz",tid,meta_ext_size,raw_ext_size);
/* Check arguments */
if (H5P_FILE_ACCESS != H5Pget_class (tid) ||
@@ -1701,6 +1728,7 @@ H5Pset_family (hid_t tid, hsize_t memb_size, hid_t memb_tid)
H5F_access_t *memb_tmpl = &H5F_access_dflt;
FUNC_ENTER (H5Pset_family, FAIL);
+ H5TRACE3("e","ihi",tid,memb_size,memb_tid);
/* Check arguments */
if (H5P_FILE_ACCESS != H5Pget_class(tid) ||
@@ -1757,6 +1785,7 @@ H5Pget_family (hid_t tid, hsize_t *memb_size/*out*/, hid_t *memb_tid/*out*/)
H5F_access_t *tmpl = NULL;
FUNC_ENTER (H5Pget_family, FAIL);
+ H5TRACE1("e","i",tid);
/* Check arguments */
if (H5P_FILE_ACCESS != H5Pget_class (tid) ||
@@ -1815,6 +1844,7 @@ H5Pset_cache (hid_t tid, int mdc_nelmts, size_t rdcc_nbytes,
H5F_access_t *fapl = NULL;
FUNC_ENTER (H5Pset_cache, FAIL);
+ H5TRACE4("e","iIszd",tid,mdc_nelmts,rdcc_nbytes,rdcc_w0);
/* Check arguments */
if (H5P_FILE_ACCESS!=H5Pget_class (tid) ||
@@ -1867,6 +1897,7 @@ H5Pget_cache (hid_t tid, int *mdc_nelmts, size_t *rdcc_nbytes,
H5F_access_t *fapl = NULL;
FUNC_ENTER (H5Pget_cache, FAIL);
+ H5TRACE4("e","i*Is*z*d",tid,mdc_nelmts,rdcc_nbytes,rdcc_w0);
/* Check arguments */
if (H5P_FILE_ACCESS!=H5Pget_class (tid) ||
@@ -1919,6 +1950,7 @@ H5Pset_buffer (hid_t plist_id, size_t size, void *tconv, void *bkg)
H5D_xfer_t *plist = NULL;
FUNC_ENTER (H5Pset_buffer, FAIL);
+ H5TRACE4("e","izxx",plist_id,size,tconv,bkg);
/* Check arguments */
if (H5P_DATASET_XFER != H5Pget_class (plist_id) ||
@@ -1962,6 +1994,7 @@ H5Pget_buffer (hid_t plist_id, void **tconv/*out*/, void **bkg/*out*/)
H5D_xfer_t *plist = NULL;
FUNC_ENTER (H5Pget_buffer, 0);
+ H5TRACE1("z","i",plist_id);
/* Check arguments */
if (H5P_DATASET_XFER != H5Pget_class (plist_id) ||
@@ -2004,6 +2037,7 @@ H5Pset_preserve (hid_t plist_id, hbool_t status)
H5D_xfer_t *plist = NULL;
FUNC_ENTER (H5Pset_preserve, FAIL);
+ H5TRACE2("e","ib",plist_id,status);
/* Check arguments */
if (H5P_DATASET_XFER != H5Pget_class (plist_id) ||
@@ -2041,6 +2075,7 @@ H5Pget_preserve (hid_t plist_id)
H5D_xfer_t *plist = NULL;
FUNC_ENTER (H5Pset_preserve, FAIL);
+ H5TRACE1("Is","i",plist_id);
/* Check arguments */
if (H5P_DATASET_XFER != H5Pget_class (plist_id) ||
@@ -2085,6 +2120,7 @@ H5Pset_compression (hid_t plist_id, H5Z_method_t method, unsigned int flags,
H5D_create_t *plist = NULL;
FUNC_ENTER (H5Pset_compression, FAIL);
+ H5TRACE5("e","iZmIuzx",plist_id,method,flags,cd_size,client_data);
/* Check arguments */
if (H5P_DATASET_CREATE!=H5Pget_class (plist_id) ||
@@ -2187,6 +2223,7 @@ H5Pset_deflate (hid_t plist_id, int level)
H5D_create_t *plist = NULL;
FUNC_ENTER (H5Pset_deflate, FAIL);
+ H5TRACE2("e","iIs",plist_id,level);
/* Check arguments */
if (H5P_DATASET_CREATE!=H5Pget_class (plist_id) ||
@@ -2234,6 +2271,7 @@ H5Pget_deflate (hid_t plist_id)
H5D_create_t *plist = NULL;
FUNC_ENTER (H5Pget_deflate, FAIL);
+ H5TRACE1("Is","i",plist_id);
/* Check arguments */
if (H5P_DATASET_CREATE!=H5Pget_class (plist_id) ||
@@ -2309,6 +2347,7 @@ H5Pset_mpi (hid_t tid, MPI_Comm comm, MPI_Info info)
H5F_access_t *tmpl = NULL;
FUNC_ENTER(H5Pset_mpi, FAIL);
+ H5TRACE3("e","iMcMi",tid,comm,info);
/* Check arguments */
if (H5P_FILE_ACCESS != H5Pget_class(tid) ||
@@ -2363,6 +2402,7 @@ H5Pget_mpi (hid_t tid, MPI_Comm *comm, MPI_Info *info)
H5F_access_t *tmpl = NULL;
FUNC_ENTER (H5Pget_mpi, FAIL);
+ H5TRACE3("e","i*Mc*Mi",tid,comm,info);
/* Check arguments */
if (H5P_FILE_ACCESS != H5Pget_class (tid) ||
@@ -2424,6 +2464,7 @@ H5Pset_xfer (hid_t tid, H5D_transfer_t data_xfer_mode)
H5D_xfer_t *plist = NULL;
FUNC_ENTER(H5Pset_xfer, FAIL);
+ H5TRACE2("e","iDt",tid,data_xfer_mode);
/* Check arguments */
if (H5P_DATASET_XFER != H5Pget_class(tid) ||
@@ -2473,6 +2514,7 @@ H5Pget_xfer (hid_t tid, H5D_transfer_t *data_xfer_mode)
H5D_xfer_t *plist = NULL;
FUNC_ENTER (H5Pget_xfer, FAIL);
+ H5TRACE2("e","i*Dt",tid,data_xfer_mode);
/* Check arguments */
if (H5P_DATASET_XFER != H5Pget_class(tid) ||
@@ -2512,7 +2554,7 @@ H5Pget_xfer (hid_t tid, H5D_transfer_t *data_xfer_mode)
* parameter settings.
--------------------------------------------------------------------------*/
hid_t
-H5Pcopy(hid_t tid)
+H5Pcopy (hid_t tid)
{
const void *tmpl = NULL;
void *new_tmpl = NULL;
@@ -2521,6 +2563,7 @@ H5Pcopy(hid_t tid)
H5I_group_t group;
FUNC_ENTER(H5Pcopy, FAIL);
+ H5TRACE1("i","i",tid);
/* Check args */
if (NULL == (tmpl = H5I_object(tid)) ||
diff --git a/src/H5S.c b/src/H5S.c
index 0d44675..7923f31 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -108,13 +108,14 @@ H5S_term_interface(void)
*-------------------------------------------------------------------------
*/
hid_t
-H5Screate_simple(int rank, const hsize_t *dims, const hsize_t *maxdims)
+H5Screate_simple (int rank, const hsize_t *dims, const hsize_t *maxdims)
{
H5S_t *ds = NULL;
hid_t ret_value = FAIL;
int i;
FUNC_ENTER(H5Screate, FAIL);
+ H5TRACE3("i","Is*h*h",rank,dims,maxdims);
/* Check arguments */
if (rank<0) {
@@ -190,9 +191,10 @@ H5Screate_simple(int rank, const hsize_t *dims, const hsize_t *maxdims)
*-------------------------------------------------------------------------
*/
herr_t
-H5Sclose(hid_t space_id)
+H5Sclose (hid_t space_id)
{
FUNC_ENTER(H5Sclose, FAIL);
+ H5TRACE1("e","i",space_id);
/* Check args */
if (H5_DATASPACE != H5I_group(space_id) ||
@@ -311,6 +313,7 @@ H5Scopy (hid_t space_id)
hid_t ret_value = FAIL;
FUNC_ENTER (H5Scopy, FAIL);
+ H5TRACE1("i","i",space_id);
/* Check args */
if (H5_DATASPACE!=H5I_group (space_id) ||
@@ -419,12 +422,13 @@ H5S_copy(const H5S_t *src)
*-------------------------------------------------------------------------
*/
hsize_t
-H5Sget_npoints(hid_t space_id)
+H5Sget_npoints (hid_t space_id)
{
H5S_t *ds = NULL;
hsize_t ret_value = 0;
FUNC_ENTER(H5Sget_npoints, 0);
+ H5TRACE1("h","i",space_id);
/* Check args */
if (H5_DATASPACE != H5I_group(space_id) ||
@@ -583,12 +587,13 @@ H5S_get_npoints_max(const H5S_t *ds)
*-------------------------------------------------------------------------
*/
int
-H5Sget_ndims(hid_t space_id)
+H5Sget_ndims (hid_t space_id)
{
H5S_t *ds = NULL;
intn ret_value = 0;
FUNC_ENTER(H5Sget_ndims, FAIL);
+ H5TRACE1("Is","i",space_id);
/* Check args */
if (H5_DATASPACE != H5I_group(space_id) ||
@@ -668,12 +673,13 @@ H5S_get_ndims(const H5S_t *ds)
*-------------------------------------------------------------------------
*/
int
-H5Sget_dims(hid_t space_id, hsize_t dims[]/*out*/)
+H5Sget_dims (hid_t space_id, hsize_t dims[]/*out*/)
{
H5S_t *ds = NULL;
intn ret_value = 0;
FUNC_ENTER(H5Sget_dims, FAIL);
+ H5TRACE1("Is","i",space_id);
/* Check args */
if (H5_DATASPACE != H5I_group(space_id) ||
@@ -974,13 +980,14 @@ H5S_is_simple(const H5S_t *sdim)
This function determines the if a dataspace is "simple". ie. if it
has orthogonal, evenly spaced dimensions.
--------------------------------------------------------------------------*/
-hbool_t
-H5Sis_simple(hid_t sid)
+hbool_t
+H5Sis_simple (hid_t sid)
{
H5S_t *space = NULL; /* dataspace to modify */
hbool_t ret_value = FAIL;
FUNC_ENTER(H5Sis_simple, FAIL);
+ H5TRACE1("b","i",sid);
/* Check args and all the boring stuff. */
if ((space = H5I_object(sid)) == NULL)
@@ -1019,13 +1026,14 @@ H5Sis_simple(hid_t sid)
be unlimited in size.
--------------------------------------------------------------------------*/
herr_t
-H5Sset_space(hid_t sid, int rank, const hsize_t *dims)
+H5Sset_space (hid_t sid, int rank, const hsize_t *dims)
{
H5S_t *space = NULL; /* dataspace to modify */
intn u; /* local counting variable */
herr_t ret_value = SUCCEED;
FUNC_ENTER(H5Sset_space, FAIL);
+ H5TRACE3("e","iIs*h",sid,rank,dims);
/* Check args */
if ((space = H5I_object(sid)) == NULL) {
@@ -1117,7 +1125,7 @@ H5Sset_space(hid_t sid, int rank, const hsize_t *dims)
datasets which extend in arbitrary directions.
--------------------------------------------------------------------------*/
herr_t
-H5Sset_hyperslab(hid_t sid, const hssize_t *start, const hsize_t *count,
+H5Sset_hyperslab (hid_t sid, const hssize_t *start, const hsize_t *count,
const hsize_t *stride)
{
H5S_t *space = NULL; /* dataspace to modify */
@@ -1126,6 +1134,7 @@ H5Sset_hyperslab(hid_t sid, const hssize_t *start, const hsize_t *count,
herr_t ret_value = SUCCEED;
FUNC_ENTER(H5Sset_hyperslab, FAIL);
+ H5TRACE4("e","i*Hs*h*h",sid,start,count,stride);
/* Get the object */
if (H5_DATASPACE != H5I_group(sid) || (space = H5I_object(sid)) == NULL) {
@@ -1212,6 +1221,7 @@ H5Sget_hyperslab (hid_t sid, hssize_t offset[]/*out*/, hsize_t size[]/*out*/,
intn ret_value = FAIL;
FUNC_ENTER (H5Sget_hyperslab, FAIL);
+ H5TRACE1("Is","i",sid);
/* Check args */
if (H5_DATASPACE!=H5I_group (sid) || NULL==(ds=H5I_object (sid))) {
diff --git a/src/H5T.c b/src/H5T.c
index 7bb0046..3f24960 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -657,12 +657,13 @@ H5T_term_interface(void)
*-------------------------------------------------------------------------
*/
hid_t
-H5Tcreate(H5T_class_t type, size_t size)
+H5Tcreate (H5T_class_t type, size_t size)
{
H5T_t *dt = NULL;
hid_t ret_value = FAIL;
FUNC_ENTER(H5Tcreate, FAIL);
+ H5TRACE2("i","Ttz",type,size);
/* check args */
if (size <= 0) {
@@ -708,6 +709,7 @@ H5Topen (hid_t loc_id, const char *name)
hid_t ret_value = FAIL;
FUNC_ENTER (H5Topen, FAIL);
+ H5TRACE2("i","is",loc_id,name);
/* Check args */
if (NULL==(loc=H5G_loc (loc_id))) {
@@ -758,6 +760,7 @@ H5Tcommit (hid_t loc_id, const char *name, hid_t type_id)
H5T_t *type = NULL;
FUNC_ENTER (H5Tcommit, FAIL);
+ H5TRACE3("e","isi",loc_id,name,type_id);
/* Check arguments */
if (NULL==(loc=H5G_loc (loc_id))) {
@@ -803,6 +806,7 @@ H5Tcommitted (hid_t type_id)
H5T_t *type = NULL;
FUNC_ENTER (H5Tcommitted, FAIL);
+ H5TRACE1("b","i",type_id);
/* Check arguments */
if (H5_DATATYPE!=H5I_group (type_id) ||
@@ -839,7 +843,7 @@ H5Tcommitted (hid_t type_id)
*-------------------------------------------------------------------------
*/
hid_t
-H5Tcopy(hid_t type_id)
+H5Tcopy (hid_t type_id)
{
H5T_t *dt = NULL;
H5T_t *new_dt = NULL;
@@ -847,6 +851,7 @@ H5Tcopy(hid_t type_id)
hid_t ret_value = FAIL;
FUNC_ENTER(H5Tcopy, FAIL);
+ H5TRACE1("i","i",type_id);
switch (H5I_group (type_id)) {
case H5_DATATYPE:
@@ -905,11 +910,12 @@ H5Tcopy(hid_t type_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tclose(hid_t type_id)
+H5Tclose (hid_t type_id)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5Tclose, FAIL);
+ H5TRACE1("e","i",type_id);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -948,13 +954,14 @@ H5Tclose(hid_t type_id)
*-------------------------------------------------------------------------
*/
hbool_t
-H5Tequal(hid_t type1_id, hid_t type2_id)
+H5Tequal (hid_t type1_id, hid_t type2_id)
{
const H5T_t *dt1 = NULL;
const H5T_t *dt2 = NULL;
hbool_t ret_value = FAIL;
FUNC_ENTER(H5Tequal, FAIL);
+ H5TRACE2("b","ii",type1_id,type2_id);
/* check args */
if (H5_DATATYPE != H5I_group(type1_id) ||
@@ -996,11 +1003,12 @@ H5Tequal(hid_t type1_id, hid_t type2_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tlock(hid_t type_id)
+H5Tlock (hid_t type_id)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5Tlock, FAIL);
+ H5TRACE1("e","i",type_id);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -1073,12 +1081,13 @@ H5Tget_class(hid_t type_id)
*-------------------------------------------------------------------------
*/
size_t
-H5Tget_size(hid_t type_id)
+H5Tget_size (hid_t type_id)
{
H5T_t *dt = NULL;
size_t size;
FUNC_ENTER(H5Tget_size, 0);
+ H5TRACE1("z","i",type_id);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -1122,12 +1131,13 @@ H5Tget_size(hid_t type_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tset_size(hid_t type_id, size_t size)
+H5Tset_size (hid_t type_id, size_t size)
{
H5T_t *dt = NULL;
size_t prec, offset;
FUNC_ENTER(H5Tset_size, FAIL);
+ H5TRACE2("e","iz",type_id,size);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -1258,11 +1268,12 @@ H5Tget_order(hid_t type_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tset_order(hid_t type_id, H5T_order_t order)
+H5Tset_order (hid_t type_id, H5T_order_t order)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5Tset_order, FAIL);
+ H5TRACE2("e","iTo",type_id,order);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -1304,12 +1315,13 @@ H5Tset_order(hid_t type_id, H5T_order_t order)
*-------------------------------------------------------------------------
*/
size_t
-H5Tget_precision(hid_t type_id)
+H5Tget_precision (hid_t type_id)
{
H5T_t *dt = NULL;
size_t prec;
FUNC_ENTER(H5Tget_precision, 0);
+ H5TRACE1("z","i",type_id);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -1356,12 +1368,13 @@ H5Tget_precision(hid_t type_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tset_precision(hid_t type_id, size_t prec)
+H5Tset_precision (hid_t type_id, size_t prec)
{
H5T_t *dt = NULL;
size_t offset, size;
FUNC_ENTER(H5Tset_prec, FAIL);
+ H5TRACE2("e","iz",type_id,prec);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -1464,12 +1477,13 @@ H5Tset_precision(hid_t type_id, size_t prec)
*-------------------------------------------------------------------------
*/
size_t
-H5Tget_offset(hid_t type_id)
+H5Tget_offset (hid_t type_id)
{
H5T_t *dt = NULL;
size_t offset;
FUNC_ENTER(H5Tget_offset, 0);
+ H5TRACE1("z","i",type_id);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -1525,11 +1539,12 @@ H5Tget_offset(hid_t type_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tset_offset(hid_t type_id, size_t offset)
+H5Tset_offset (hid_t type_id, size_t offset)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5Tset_offset, FAIL);
+ H5TRACE2("e","iz",type_id,offset);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -1576,11 +1591,12 @@ H5Tset_offset(hid_t type_id, size_t offset)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tget_pad(hid_t type_id, H5T_pad_t *lsb/*out*/, H5T_pad_t *msb/*out*/)
+H5Tget_pad (hid_t type_id, H5T_pad_t *lsb/*out*/, H5T_pad_t *msb/*out*/)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5Tget_pad, FAIL);
+ H5TRACE1("e","i",type_id);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -1614,11 +1630,12 @@ H5Tget_pad(hid_t type_id, H5T_pad_t *lsb/*out*/, H5T_pad_t *msb/*out*/)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tset_pad(hid_t type_id, H5T_pad_t lsb, H5T_pad_t msb)
+H5Tset_pad (hid_t type_id, H5T_pad_t lsb, H5T_pad_t msb)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5Tset_pad, FAIL);
+ H5TRACE3("e","iTpTp",type_id,lsb,msb);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -1697,11 +1714,12 @@ H5Tget_sign(hid_t type_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tset_sign(hid_t type_id, H5T_sign_t sign)
+H5Tset_sign (hid_t type_id, H5T_sign_t sign)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5Tset_sign, FAIL);
+ H5TRACE2("e","iTs",type_id,sign);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -1745,13 +1763,14 @@ H5Tset_sign(hid_t type_id, H5T_sign_t sign)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tget_fields(hid_t type_id, size_t *spos/*out*/,
+H5Tget_fields (hid_t type_id, size_t *spos/*out*/,
size_t *epos/*out*/, size_t *esize/*out*/,
size_t *mpos/*out*/, size_t *msize/*out*/)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5Tget_fields, FAIL);
+ H5TRACE1("e","i",type_id);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -1795,12 +1814,13 @@ H5Tget_fields(hid_t type_id, size_t *spos/*out*/,
*-------------------------------------------------------------------------
*/
herr_t
-H5Tset_fields(hid_t type_id, size_t spos, size_t epos, size_t esize,
+H5Tset_fields (hid_t type_id, size_t spos, size_t epos, size_t esize,
size_t mpos, size_t msize)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5Tset_fields, FAIL);
+ H5TRACE6("e","izzzzz",type_id,spos,epos,esize,mpos,msize);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -1868,12 +1888,13 @@ H5Tset_fields(hid_t type_id, size_t spos, size_t epos, size_t esize,
*-------------------------------------------------------------------------
*/
size_t
-H5Tget_ebias(hid_t type_id)
+H5Tget_ebias (hid_t type_id)
{
H5T_t *dt = NULL;
size_t ebias;
FUNC_ENTER(H5Tget_ebias, 0);
+ H5TRACE1("z","i",type_id);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -1907,11 +1928,12 @@ H5Tget_ebias(hid_t type_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tset_ebias(hid_t type_id, size_t ebias)
+H5Tset_ebias (hid_t type_id, size_t ebias)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5Tset_ebias, FAIL);
+ H5TRACE2("e","iz",type_id,ebias);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -1989,11 +2011,12 @@ H5Tget_norm(hid_t type_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tset_norm(hid_t type_id, H5T_norm_t norm)
+H5Tset_norm (hid_t type_id, H5T_norm_t norm)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5Tset_norm, FAIL);
+ H5TRACE2("e","iTn",type_id,norm);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -2077,11 +2100,12 @@ H5Tget_inpad(hid_t type_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tset_inpad(hid_t type_id, H5T_pad_t pad)
+H5Tset_inpad (hid_t type_id, H5T_pad_t pad)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5Tset_inpad, FAIL);
+ H5TRACE2("e","iTp",type_id,pad);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -2164,11 +2188,12 @@ H5Tget_cset(hid_t type_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tset_cset(hid_t type_id, H5T_cset_t cset)
+H5Tset_cset (hid_t type_id, H5T_cset_t cset)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5Tset_cset, FAIL);
+ H5TRACE2("e","iTc",type_id,cset);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -2252,11 +2277,12 @@ H5Tget_strpad(hid_t type_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tset_strpad(hid_t type_id, H5T_str_t strpad)
+H5Tset_strpad (hid_t type_id, H5T_str_t strpad)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5Tset_strpad, FAIL);
+ H5TRACE2("e","iTz",type_id,strpad);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -2297,12 +2323,13 @@ H5Tset_strpad(hid_t type_id, H5T_str_t strpad)
*-------------------------------------------------------------------------
*/
int
-H5Tget_nmembers(hid_t type_id)
+H5Tget_nmembers (hid_t type_id)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5Tget_num_members, FAIL);
+ H5TRACE1("Is","i",type_id);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -2380,12 +2407,13 @@ H5Tget_member_name(hid_t type_id, int membno)
*-------------------------------------------------------------------------
*/
size_t
-H5Tget_member_offset(hid_t type_id, int membno)
+H5Tget_member_offset (hid_t type_id, int membno)
{
H5T_t *dt = NULL;
size_t offset = 0;
FUNC_ENTER(H5Tget_member_offset, 0);
+ H5TRACE2("z","iIs",type_id,membno);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -2424,13 +2452,14 @@ H5Tget_member_offset(hid_t type_id, int membno)
*-------------------------------------------------------------------------
*/
int
-H5Tget_member_dims(hid_t type_id, int membno,
+H5Tget_member_dims (hid_t type_id, int membno,
size_t dims[]/*out*/, int perm[]/*out*/)
{
H5T_t *dt = NULL;
intn ndims, i;
FUNC_ENTER(H5Tget_member_dims, FAIL);
+ H5TRACE2("Is","iIs",type_id,membno);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -2478,12 +2507,13 @@ H5Tget_member_dims(hid_t type_id, int membno,
*-------------------------------------------------------------------------
*/
hid_t
-H5Tget_member_type(hid_t type_id, int membno)
+H5Tget_member_type (hid_t type_id, int membno)
{
H5T_t *dt = NULL, *memb_dt = NULL;
hid_t memb_type_id;
FUNC_ENTER(H5Tget_member_type, FAIL);
+ H5TRACE2("i","iIs",type_id,membno);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -2540,12 +2570,13 @@ H5Tget_member_type(hid_t type_id, int membno)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tinsert(hid_t parent_id, const char *name, size_t offset, hid_t member_id)
+H5Tinsert (hid_t parent_id, const char *name, size_t offset, hid_t member_id)
{
H5T_t *parent = NULL; /*the compound parent data type */
H5T_t *member = NULL; /*the atomic member type */
FUNC_ENTER(H5Tinsert, FAIL);
+ H5TRACE4("e","iszi",parent_id,name,offset,member_id);
/* Check args */
if (H5_DATATYPE != H5I_group(parent_id) ||
@@ -2592,11 +2623,12 @@ H5Tinsert(hid_t parent_id, const char *name, size_t offset, hid_t member_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tpack(hid_t type_id)
+H5Tpack (hid_t type_id)
{
H5T_t *dt = NULL;
FUNC_ENTER(H5Tpack, FAIL);
+ H5TRACE1("e","i",type_id);
/* Check args */
if (H5_DATATYPE != H5I_group(type_id) ||
@@ -2644,7 +2676,7 @@ H5Tpack(hid_t type_id)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tregister_hard(const char *name, hid_t src_id, hid_t dst_id, H5T_conv_t func)
+H5Tregister_hard (const char *name, hid_t src_id, hid_t dst_id, H5T_conv_t func)
{
H5T_t *src = NULL;
H5T_t *dst = NULL;
@@ -2652,6 +2684,7 @@ H5Tregister_hard(const char *name, hid_t src_id, hid_t dst_id, H5T_conv_t func)
intn i;
FUNC_ENTER(H5Tregister_hard, FAIL);
+ H5TRACE4("e","siix",name,src_id,dst_id,func);
/* Check args */
if (!name || !*name) {
@@ -2706,7 +2739,7 @@ H5Tregister_hard(const char *name, hid_t src_id, hid_t dst_id, H5T_conv_t func)
*-------------------------------------------------------------------------
*/
herr_t
-H5Tregister_soft(const char *name, H5T_class_t src_cls, H5T_class_t dst_cls,
+H5Tregister_soft (const char *name, H5T_class_t src_cls, H5T_class_t dst_cls,
H5T_conv_t func)
{
intn i;
@@ -2714,6 +2747,7 @@ H5Tregister_soft(const char *name, H5T_class_t src_cls, H5T_class_t dst_cls,
H5T_cdata_t cdata;
FUNC_ENTER(H5Tregister_soft, FAIL);
+ H5TRACE4("e","sTtTtx",name,src_cls,dst_cls,func);
/* Check args */
if (!name || !*name) {
@@ -2822,13 +2856,14 @@ H5Tregister_soft(const char *name, H5T_class_t src_cls, H5T_class_t dst_cls,
*-------------------------------------------------------------------------
*/
herr_t
-H5Tunregister(H5T_conv_t func)
+H5Tunregister (H5T_conv_t func)
{
intn i, j;
H5T_path_t *path = NULL;
hid_t src_id, dst_id;
FUNC_ENTER(H5Tunregister, FAIL);
+ H5TRACE1("e","x",func);
/* Check args */
if (!func) {
@@ -3003,6 +3038,7 @@ H5Tconvert (hid_t src_id, hid_t dst_id, size_t nelmts, void *buf,
#endif
FUNC_ENTER (H5Tconvert, FAIL);
+ H5TRACE5("e","iizxx",src_id,dst_id,nelmts,buf,background);
if (NULL==(tconv_func=H5Tfind (src_id, dst_id, &cdata))) {
HRETURN_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL,
@@ -4145,11 +4181,11 @@ H5T_entof (H5T_t *dt)
*-------------------------------------------------------------------------
*/
void
-H5T_timer_begin (H5_timer_t *timer, H5T_cdata_t *cdata)
+H5T_timer_begin (H5_timer_t __unused__ *timer, H5T_cdata_t __unused__ *cdata)
{
+#ifdef H5T_DEBUG
assert (timer);
assert (cdata);
-#ifdef H5T_DEBUG
assert (cdata->stats);
H5_timer_begin (timer);
#endif
@@ -4171,11 +4207,12 @@ H5T_timer_begin (H5_timer_t *timer, H5T_cdata_t *cdata)
*-------------------------------------------------------------------------
*/
void
-H5T_timer_end (H5_timer_t *timer, H5T_cdata_t *cdata, size_t nelmts)
+H5T_timer_end (H5_timer_t __unused__ *timer, H5T_cdata_t __unused__ *cdata,
+ size_t __unused__ nelmts)
{
+#ifdef H5T_DEBUG
assert (timer);
assert (cdata);
-#ifdef H5T_DEBUG
assert (cdata->stats);
H5_timer_end (&(cdata->stats->timer), timer);
cdata->stats->ncalls++;
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index f32c310..3f393d2 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -839,8 +839,6 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
* should copy the value to the true destination buffer.
*/
if (d==dbuf) HDmemcpy (dp, d, dst->size);
-
- next:
sp += direction * src->size;
dp += direction * dst->size;
}
diff --git a/src/H5Z.c b/src/H5Z.c
index 227d7d8..c4f6a5f 100644
--- a/src/H5Z.c
+++ b/src/H5Z.c
@@ -196,6 +196,7 @@ H5Zregister (H5Z_method_t method, const char *name, H5Z_func_t cfunc,
H5Z_func_t ufunc)
{
FUNC_ENTER (H5Zregister, FAIL);
+ H5TRACE4("e","Zmsxx",method,name,cfunc,ufunc);
/* Check args */
if (method<0 || method>H5Z_USERDEF_MAX) {
diff --git a/src/H5private.h b/src/H5private.h
index db7ca1e..e079682 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -461,10 +461,67 @@ int64 HDstrtoll (const char *s, const char **rest, int base);
/*
* And now for a couple non-Posix functions...
*/
-extern char *strdup(const char *s);
+extern char *strdup(const char *s);
#define HDstrdup(S) strdup(S)
/*-------------------------------------------------------------------------
+ * Purpose: These macros are inserted automatically just after the
+ * FUNC_ENTER() macro of API functions and are used to trace
+ * application program execution. Unless H5_DEBUG_API has been
+ * defined they are no-ops.
+ *
+ * Arguments: R - Return type encoded as a string
+ * T - Argument types encoded as a string
+ * A0-An - Arguments. The number at the end of the macro name
+ * indicates the number of arguments.
+ *
+ * Programmer: Robb Matzke
+ *
+ * Modifications:
+ *-------------------------------------------------------------------------
+ */
+#ifdef H5_DEBUG_API
+#define H5TRACE_DECL const char *RTYPE=NULL
+#define H5TRACE0(R,T) RTYPE=R; \
+ H5_trace(0,FUNC,T)
+#define H5TRACE1(R,T,A0) RTYPE=R; \
+ H5_trace(0,FUNC,T,#A0,A0)
+#define H5TRACE2(R,T,A0,A1) RTYPE=R; \
+ H5_trace(0,FUNC,T,#A0,A0,#A1,A1)
+#define H5TRACE3(R,T,A0,A1,A2) RTYPE=R; \
+ H5_trace(0,FUNC,T,#A0,A0,#A1,A1, \
+ #A2,A2)
+#define H5TRACE4(R,T,A0,A1,A2,A3) RTYPE=R; \
+ H5_trace(0,FUNC,T,#A0,A0,#A1,A1, \
+ #A2,A2,#A3,A3)
+#define H5TRACE5(R,T,A0,A1,A2,A3,A4) RTYPE=R; \
+ H5_trace(0,FUNC,T,#A0,A0,#A1,A1, \
+ #A2,A2,#A3,A3,#A4,A4)
+#define H5TRACE6(R,T,A0,A1,A2,A3,A4,A5) RTYPE=R; \
+ H5_trace(0,FUNC,T,#A0,A0,#A1,A1, \
+ #A2,A2,#A3,A3,#A4,A4, \
+ #A5,A5)
+#define H5TRACE_RETURN(V) if (RTYPE) { \
+ H5_trace(1,NULL,RTYPE,NULL,V); \
+ RTYPE=NULL; \
+ }
+#else
+#define H5TRACE_DECL /*void*/
+#define H5TRACE0(R,T) /*void*/
+#define H5TRACE1(R,T,A0) /*void*/
+#define H5TRACE2(R,T,A0,A1) /*void*/
+#define H5TRACE3(R,T,A0,A1,A2) /*void*/
+#define H5TRACE4(R,T,A0,A1,A2,A3) /*void*/
+#define H5TRACE5(R,T,A0,A1,A2,A3,A4) /*void*/
+#define H5TRACE6(R,T,A0,A1,A2,A3,A4,A5) /*void*/
+#define H5TRACE_RETURN(V) /*void*/
+#endif
+
+extern FILE *H5_trace_g;
+void H5_trace (hbool_t returning, const char *func, const char *type, ...);
+
+
+/*-------------------------------------------------------------------------
* Purpose: Register function entry for library initialization and code
* profiling.
*
@@ -508,17 +565,13 @@ extern char *strdup(const char *s);
* function comes from the `INTERFACE_INIT' constant which must be
* defined in every source file.
*
+ * Robb Matzke, 17 Jun 1998
+ * Added auto variable RTYPE which is initialized by the tracing macros.
*-------------------------------------------------------------------------
*/
extern hbool_t library_initialize_g; /*good thing C's lazy about extern! */
extern hbool_t thread_initialize_g; /*don't decl interface_initialize_g */
-/* Print S on file N followed by a newline */
-#define H5_PRINT(N,S) { \
- write ((N), (S), strlen((S))); \
- write ((N), "\n", 1); \
-}
-
/* Is `S' the name of an API function? */
#define H5_IS_API(S) ('_'!=S[2] && '_'!=S[3] && (!S[4] || '_'!=S[4]))
@@ -526,6 +579,7 @@ extern hbool_t thread_initialize_g; /*don't decl interface_initialize_g */
#define FUNC_ENTER_INIT(func_name,interface_init_func,err) { \
CONSTR (FUNC, #func_name); \
+ H5TRACE_DECL; \
PABLO_SAVE (ID_ ## func_name); \
\
PABLO_TRACE_ON (PABLO_MASK, pablo_func_id); \
@@ -560,7 +614,6 @@ extern hbool_t thread_initialize_g; /*don't decl interface_initialize_g */
\
/* Clear thread error stack entering public functions */ \
if (H5E_clearable_g && H5_IS_API (FUNC)) { \
- H5_PRINT (55, #func_name); \
H5E_clear (); \
} \
{
@@ -582,6 +635,7 @@ extern hbool_t thread_initialize_g; /*don't decl interface_initialize_g */
*/
#define FUNC_LEAVE(return_value) HRETURN(return_value)}}
+
/*
* The FUNC_ENTER() and FUNC_LEAVE() macros make calls to Pablo functions
* through one of these two sets of macros.
diff --git a/src/Makefile.in b/src/Makefile.in
index 2ac1511..eb054b4 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -5,6 +5,7 @@
#
#
@COMMENCE@
+TRACE=perl ../bin/trace
# Add `-I.' to the C preprocessor flags.
CPPFLAGS=-I. @CPPFLAGS@