summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--MANIFEST2
-rwxr-xr-xbin/trace201
-rw-r--r--config/commence.in3
-rw-r--r--config/depend.in7
-rwxr-xr-xconfigure239
-rw-r--r--configure.in15
-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
-rw-r--r--test/dsets.c2
-rw-r--r--test/dtypes.c4
29 files changed, 1406 insertions, 265 deletions
diff --git a/MANIFEST b/MANIFEST
index bc039f9..6ea1e83 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -17,6 +17,7 @@
./bin/errors
./bin/install-sh
./bin/release
+./bin/trace
./bin/versinc
./config/BlankForm
./config/alpha-dec
@@ -110,6 +111,7 @@
./html/study_p1.gif
./html/study_p1.obj
./html/symtab
+./html/tracing.html
./html/version.gif
./html/version.obj
./src/.distdep
diff --git a/bin/trace b/bin/trace
new file mode 100755
index 0000000..a124d5c
--- /dev/null
+++ b/bin/trace
@@ -0,0 +1,201 @@
+#!/usr/bin/perl -w
+require 5.003;
+$Source = "";
+
+##############################################################################
+# A map from type name to type letter. We use this map for two reasons:
+# 1. We want the debugging stuff in the source code to be as unobtrusive as
+# possible, which means as compact as possible.
+# 2. It's easier (faster) to parse these one and two-letter types in the C
+# functions that display debugging results.
+#
+# All type strings are one or two characters. One-character strings
+# are always lower case and should be used for common types.
+# Two-character strings begin with an upper-case letter which is
+# usually the same as the package name.
+#
+%TypeString = ("hbool_t" => "b",
+ "double" => "d",
+ "H5D_layout_t" => "Dl",
+ "H5D_transfer_t" => "Dt",
+ "herr_t" => "e",
+ "H5E_direction_t" => "Ed",
+ "H5E_error_t*" => "Ee",
+ "H5G_link_t" => "Gl",
+ "H5G_stat_t*" => "Gs",
+ "hsize_t" => "h",
+ "hssize_t" => "Hs",
+ "hid_t" => "i",
+ "int" => "Is",
+ "unsigned" => "Iu",
+ "unsigned int" => "Iu",
+ "MPI_Comm" => "Mc",
+ "MPI_Info" => "Mi",
+ "off_t" => "o",
+ "H5P_class_t" => "p",
+ "char*" => "s",
+ "H5T_cset_t", => "Tc",
+ "H5T_norm_t" => "Tn",
+ "H5T_order_t" => "To",
+ "H5T_pad_t" => "Tp",
+ "H5T_sign_t" => "Ts",
+ "H5T_class_t" => "Tt",
+ "H5T_str_t" => "Tz",
+ "void*" => "x",
+ "FILE*" => "x",
+ "H5A_operator_t" => "x",
+ "H5E_auto_t" => "x",
+ "H5E_walk_t" => "x",
+ "H5G_iterate_t" => "x",
+ "H5T_conv_t" => "x",
+ "H5Z_func_t" => "x",
+ "size_t" => "z",
+ "H5Z_method_t" => "Zm",
+ "ssize_t" => "Zs",
+ );
+
+##############################################################################
+# Print an error message.
+#
+sub errmesg ($$@) {
+ my ($file, $func, @mesg) = @_;
+ my ($mesg) = join "", @mesg;
+ my ($lineno) = 1;
+ if ($Source =~ /(.*?\n)($func)/s) {
+ local $_ = $1;
+ $lineno = tr/\n/\n/;
+ }
+
+ print "$file: in function \`$func\':\n";
+ print "$file:$lineno: $mesg\n";
+}
+
+##############################################################################
+# Given a C data type return the type string that goes with it.
+#
+sub argstring ($$$) {
+ my ($file, $func, $atype) = @_;
+ my ($ptr, $tstr) = (0,"!");
+
+ # Normalize the data type by removing redundant white space,
+ # certain type qualifiers, and indirection.
+ $atype =~ s/^\bconst\b//;
+ $atype =~ s/\b__unused__\b//g;
+ $atype =~ s/\s+/ /g;
+ $ptr = length $1 if $atype =~ s/(\*+)//;
+ $atype =~ s/^\s+//;
+ $atype =~ s/\s+$//;
+
+ if ($ptr>0 && exists $TypeString{"$atype*"}) {
+ --$ptr;
+ $tstr = $TypeString{"$atype*"};
+ } elsif (!exists $TypeString{$atype}) {
+ errmesg $file, $func, "unknown type \`$atype", '*'x$ptr, "\'";
+ } else {
+ $tstr = $TypeString{$atype};
+ }
+ return ("*" x $ptr) . $tstr;
+}
+
+##############################################################################
+# Given information about an API function, rewrite that function with
+# updated tracing information.
+#
+sub rewrite_func ($$$$$) {
+ my ($file, $type, $name, $args, $body) = @_;
+ my ($arg,$trace);
+ my (@arg_name, @arg_str);
+ local $_;
+
+ # Parse return value
+ my $rettype = argstring $file, $name, $type;
+ goto error if $rettype =~ /!/;
+
+ # Parse arguments
+ if ($args eq "void") {
+ $trace = "H5TRACE0(\"$rettype\", \"\");\n";
+ } else {
+ my @args = split /,[\s\n]*/, $args;
+ for $arg (@args) {
+ unless ($arg=~/^(([a-z_A-Z]\w*\s+)+\**)
+ ([a-z_A-Z]\w*)(\[\])?
+ (\s*\/\*\s*(in|out|in,\s*out)\s*\*\/)?\s*$/x) {
+ errmesg $file, $name, "unable to parse \`$arg\'";
+ goto error;
+ } else {
+ my ($atype, $aname, $array, $adir) = ($1, $3, $4, $6);
+ $adir ||= "in";
+ next if $adir eq "out";
+ $atype =~ s/\s+$//;
+ $atype .= "*" if $array;
+ push @arg_name, $aname;
+ push @arg_str, argstring $file, $name, $atype;
+ }
+ }
+ $trace = "H5TRACE" . scalar(@arg_str) . "(\"$rettype\",\"";
+ $trace .= join("", @arg_str) . "\"";
+ my $len = 4 + length $trace;
+ for (@arg_name) {
+ if ($len + length >= 78) {
+ $trace .= ",\n $_";
+ $len = 13 + length;
+ } else {
+ $trace .= ",$_";
+ $len += 1 + length;
+ }
+ }
+ $trace .= ");\n";
+ }
+ goto error if grep {/!/} @arg_str;
+
+ # The H5TRACE() statement
+ if ($body =~ /\/\*[ \t]*NO[ \t]*TRACE[ \t]*\*\//) {
+ if ($body =~ /\s*H5TRACE\d+\s*\(/) {
+ errmesg $file, $name, "warning: trace info was not updated";
+ } else {
+ errmesg $file, $name, "warning: trace info was not inserted";
+ }
+ } elsif ($body =~ s/((\n[ \t]*)H5TRACE\d+\s*\(.*?\);)\n/"$2$trace"/es) {
+ # Replaced an H5TRACE macro
+ } elsif ($body=~s/((\n[ \t]*)FUNC_ENTER\s*\([ \t]*?\);)\n/"$1$2$trace"/es) {
+ # Added an H5TRACE macro after a FUNC_ENTER macro.
+ } else {
+ errmesg $file, $name, "unable to insert tracing information";
+ goto error;
+ }
+
+
+ error:
+ return "\n$type\n$name ($args)$body";
+}
+
+##############################################################################
+# Process each source file, rewriting API functions with updated
+# tracing information.
+#
+my $total_api = 0;
+for $file (@ARGV) {
+ # Snarf up the entire file
+ open SOURCE, $file or die "$file: $!\n";
+ $Source = join "", <SOURCE>;
+ close SOURCE;
+
+ # Make modifications
+ my $original = $Source;
+ my $napi = $Source =~ s/\n([a-z]\w*(\s+[a-z]\w*)*)\s*\n #type
+ (H5[A-Z]{1,2}[^_A-Z]\w*) #name
+ \s*\((.*?)\) #args
+ (.*?\n\}[^\n]*) #body
+ /rewrite_func($file,$1,$3,$4,$5)/segx;
+ $total_api += $napi;
+
+ # If the source changed then print out the new version
+ if ($original ne $Source) {
+ printf "%s: instrumented %d API function%s\n",
+ $file, $napi, 1==$napi?"":"s";
+ rename $file, "$file~" or die "unable to make backup";
+ open SOURCE, ">$file" or die "unable to modify source";
+ print SOURCE $Source;
+ close SOURCE;
+ }
+}
diff --git a/config/commence.in b/config/commence.in
index 7b41932..8b33182 100644
--- a/config/commence.in
+++ b/config/commence.in
@@ -12,7 +12,7 @@
# Programs
SHELL=/bin/sh
CC=@CC@
-CFLAGS=@CFLAGS@
+CFLAGS=-D_POSIX_SOURCE @CFLAGS@
CPPFLAGS=@CPPFLAGS@
LIBS=@LIBS@
AR=@AR@
@@ -23,6 +23,7 @@ INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
INSTALL_DATA=@INSTALL_DATA@
RUNTEST=@RUNTEST@
+TRACE=:
# Installation points
ROOT=@ROOT@
diff --git a/config/depend.in b/config/depend.in
index dae45ce..2bd98af 100644
--- a/config/depend.in
+++ b/config/depend.in
@@ -14,6 +14,12 @@
# have dependency information rebuilt, and the Makefile is not
# modified.
#
+# This is also where tracing information is updated. The $(TRACE)
+# program is run on each source file to make sure that the H5TRACE()
+# macros are up to date. If they are then the file is not modified,
+# otherwise the file is changed and a backup is saved by appending a
+# tilde to the file name.
+#
.PRECIOUS: .depend .distdep
dep depend: .distdep
@@ -28,6 +34,7 @@ dep depend: .distdep
echo Building dependencies for $$dep; \
obj=`echo $$dep | sed 's/\.c/\\\\.o/'`; \
sed "/$$obj/,/[^\\]$$/d" <$@ >$@- && mv $@- $@; \
+ $(TRACE) $$dep; \
$(CC) -M -MG $(CPPFLAGS) $$dep >>$@; \
fi; \
done;
diff --git a/configure b/configure
index c2f79eb..efb2c49 100755
--- a/configure
+++ b/configure
@@ -27,6 +27,8 @@ ac_help="$ac_help
without the leading H5 or the word no. The default
is most packages."
ac_help="$ac_help
+--enable-tracing Cause the library to trace all API calls"
+ac_help="$ac_help
--enable-parallel=mpio Enable parallel support with MPIO"
# Initialize some variables set by options.
@@ -562,7 +564,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:566: checking host system type" >&5
+echo "configure:568: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -585,7 +587,7 @@ echo "$ac_t""$host" 1>&6
echo $ac_n "checking for cached host""... $ac_c" 1>&6
-echo "configure:589: checking for cached host" >&5
+echo "configure:591: checking for cached host" >&5
if eval "test \"`echo '$''{'hdf5_cv_host'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -604,7 +606,7 @@ fi
echo $ac_n "checking for site config file""... $ac_c" 1>&6
-echo "configure:608: checking for site config file" >&5
+echo "configure:610: checking for site config file" >&5
site_config="none"
for f in $host \
$host_vendor-$host_os \
@@ -627,7 +629,7 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:631: checking for $ac_word" >&5
+echo "configure:633: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -656,7 +658,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:660: checking for $ac_word" >&5
+echo "configure:662: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -704,7 +706,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:708: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:710: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -714,11 +716,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 718 "configure"
+#line 720 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -738,12 +740,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:742: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:744: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:747: checking whether we are using GNU C" >&5
+echo "configure:749: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -752,7 +754,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:758: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -767,7 +769,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:771: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:773: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -795,7 +797,7 @@ else
fi
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:799: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:801: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -832,7 +834,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:836: checking for a BSD compatible install" >&5
+echo "configure:838: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -884,7 +886,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:888: checking for $ac_word" >&5
+echo "configure:890: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -917,7 +919,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:921: checking for $ac_word" >&5
+echo "configure:923: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -950,7 +952,7 @@ fi
echo $ac_n "checking for GNU Make""... $ac_c" 1>&6
-echo "configure:954: checking for GNU Make" >&5
+echo "configure:956: checking for GNU Make" >&5
if test "`${MAKE-make} --version -f /dev/null 2>/dev/null |\
sed -n 1p|cut -c1-8`" = "GNU Make"; then
echo "$ac_t""yes" 1>&6
@@ -964,7 +966,7 @@ if test Xyes = "X$GCC"; then
fi
echo $ac_n "checking for production mode""... $ac_c" 1>&6
-echo "configure:968: checking for production mode" >&5
+echo "configure:970: checking for production mode" >&5
# Check whether --enable-production or --disable-production was given.
if test "${enable_production+set}" = set; then
enableval="$enable_production"
@@ -995,7 +997,7 @@ esac
echo $ac_n "checking for ceil in -lm""... $ac_c" 1>&6
-echo "configure:999: checking for ceil in -lm" >&5
+echo "configure:1001: checking for ceil in -lm" >&5
ac_lib_var=`echo m'_'ceil | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1003,7 +1005,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1007 "configure"
+#line 1009 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1014,7 +1016,7 @@ int main() {
ceil()
; return 0; }
EOF
-if { (eval echo configure:1018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1042,7 +1044,7 @@ else
fi
echo $ac_n "checking for main in -lcoug""... $ac_c" 1>&6
-echo "configure:1046: checking for main in -lcoug" >&5
+echo "configure:1048: checking for main in -lcoug" >&5
ac_lib_var=`echo coug'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1050,14 +1052,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcoug $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1054 "configure"
+#line 1056 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:1061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1084,7 +1086,7 @@ else
echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for compress2 in -lz""... $ac_c" 1>&6
-echo "configure:1088: checking for compress2 in -lz" >&5
+echo "configure:1090: checking for compress2 in -lz" >&5
ac_lib_var=`echo z'_'compress2 | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1092,7 +1094,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lz $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1096 "configure"
+#line 1098 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1103,7 +1105,7 @@ int main() {
compress2()
; return 0; }
EOF
-if { (eval echo configure:1107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1132,7 +1134,7 @@ fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1136: checking how to run the C preprocessor" >&5
+echo "configure:1138: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1147,13 +1149,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1151 "configure"
+#line 1153 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1164,13 +1166,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1168 "configure"
+#line 1170 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1193,12 +1195,12 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1197: checking for ANSI C header files" >&5
+echo "configure:1199: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1202 "configure"
+#line 1204 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1206,7 +1208,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1210: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1212: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1223,7 +1225,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1227 "configure"
+#line 1229 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1241,7 +1243,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1245 "configure"
+#line 1247 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1262,7 +1264,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1266 "configure"
+#line 1268 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1273,7 +1275,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1300,17 +1302,17 @@ for ac_hdr in unistd.h zlib.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1304: checking for $ac_hdr" >&5
+echo "configure:1306: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1309 "configure"
+#line 1311 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1314: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1339,12 +1341,12 @@ done
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1343: checking for off_t" >&5
+echo "configure:1345: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1348 "configure"
+#line 1350 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1372,12 +1374,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1376: checking for size_t" >&5
+echo "configure:1378: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1381 "configure"
+#line 1383 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1405,14 +1407,14 @@ EOF
fi
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:1409: checking whether byte ordering is bigendian" >&5
+echo "configure:1411: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
-#line 1416 "configure"
+#line 1418 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -1423,11 +1425,11 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:1427: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
# It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF
-#line 1431 "configure"
+#line 1433 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -1438,7 +1440,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:1442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -1458,7 +1460,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1462 "configure"
+#line 1464 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -1471,7 +1473,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:1475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian=no
else
@@ -1495,7 +1497,7 @@ EOF
fi
echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:1499: checking size of short" >&5
+echo "configure:1501: checking size of short" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1503,7 +1505,7 @@ else
ac_cv_sizeof_short=2
else
cat > conftest.$ac_ext <<EOF
-#line 1507 "configure"
+#line 1509 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1514,7 +1516,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_short=`cat conftestval`
else
@@ -1534,7 +1536,7 @@ EOF
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:1538: checking size of int" >&5
+echo "configure:1540: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1542,7 +1544,7 @@ else
ac_cv_sizeof_int=4
else
cat > conftest.$ac_ext <<EOF
-#line 1546 "configure"
+#line 1548 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1553,7 +1555,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_int=`cat conftestval`
else
@@ -1573,7 +1575,7 @@ EOF
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:1577: checking size of long" >&5
+echo "configure:1579: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1581,7 +1583,7 @@ else
ac_cv_sizeof_long=4
else
cat > conftest.$ac_ext <<EOF
-#line 1585 "configure"
+#line 1587 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1592,7 +1594,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long=`cat conftestval`
else
@@ -1612,7 +1614,7 @@ EOF
echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:1616: checking size of long long" >&5
+echo "configure:1618: checking size of long long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1620,7 +1622,7 @@ else
ac_cv_sizeof_long_long=8
else
cat > conftest.$ac_ext <<EOF
-#line 1624 "configure"
+#line 1626 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1631,7 +1633,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long_long=`cat conftestval`
else
@@ -1651,7 +1653,7 @@ EOF
echo $ac_n "checking size of float""... $ac_c" 1>&6
-echo "configure:1655: checking size of float" >&5
+echo "configure:1657: checking size of float" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1659,7 +1661,7 @@ else
ac_cv_sizeof_float=4
else
cat > conftest.$ac_ext <<EOF
-#line 1663 "configure"
+#line 1665 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1670,7 +1672,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_float=`cat conftestval`
else
@@ -1690,7 +1692,7 @@ EOF
echo $ac_n "checking size of double""... $ac_c" 1>&6
-echo "configure:1694: checking size of double" >&5
+echo "configure:1696: checking size of double" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1698,7 +1700,7 @@ else
ac_cv_sizeof_double=8
else
cat > conftest.$ac_ext <<EOF
-#line 1702 "configure"
+#line 1704 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1709,7 +1711,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_double=`cat conftestval`
else
@@ -1729,7 +1731,7 @@ EOF
echo $ac_n "checking size of long double""... $ac_c" 1>&6
-echo "configure:1733: checking size of long double" >&5
+echo "configure:1735: checking size of long double" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1737,7 +1739,7 @@ else
ac_cv_sizeof_long_double=8
else
cat > conftest.$ac_ext <<EOF
-#line 1741 "configure"
+#line 1743 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1748,7 +1750,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long_double=`cat conftestval`
else
@@ -1768,7 +1770,7 @@ EOF
echo $ac_n "checking size of size_t""... $ac_c" 1>&6
-echo "configure:1772: checking size of size_t" >&5
+echo "configure:1774: checking size of size_t" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1776,7 +1778,7 @@ else
ac_cv_sizeof_size_t=4
else
cat > conftest.$ac_ext <<EOF
-#line 1780 "configure"
+#line 1782 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1787,7 +1789,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_size_t=`cat conftestval`
else
@@ -1810,7 +1812,7 @@ cat >>confdefs.h <<\EOF
#include <sys/types.h> /*for off_t definition*/
EOF
echo $ac_n "checking size of off_t""... $ac_c" 1>&6
-echo "configure:1814: checking size of off_t" >&5
+echo "configure:1816: checking size of off_t" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1818,7 +1820,7 @@ else
ac_cv_sizeof_off_t=4
else
cat > conftest.$ac_ext <<EOF
-#line 1822 "configure"
+#line 1824 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1829,7 +1831,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_off_t=`cat conftestval`
else
@@ -1856,7 +1858,7 @@ if test "${enable_hsizet+set}" = set; then
fi
echo $ac_n "checking for sizeof hsize_t and hssize_t""... $ac_c" 1>&6
-echo "configure:1860: checking for sizeof hsize_t and hssize_t" >&5
+echo "configure:1862: checking for sizeof hsize_t and hssize_t" >&5
case $HSIZET in
no|small)
echo "$ac_t""small" 1>&6
@@ -1874,12 +1876,12 @@ esac
for ac_func in getpwuid gethostname system getrusage
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1878: checking for $ac_func" >&5
+echo "configure:1880: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1883 "configure"
+#line 1885 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1902,7 +1904,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1928,24 +1930,24 @@ done
cat > conftest.$ac_ext <<EOF
-#line 1932 "configure"
+#line 1934 "configure"
#include "confdefs.h"
#include<sys/types.h>
int main() {
off64_t n = 0;
; return 0; }
EOF
-if { (eval echo configure:1939: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
for ac_func in lseek64 fseek64
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1944: checking for $ac_func" >&5
+echo "configure:1946: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1949 "configure"
+#line 1951 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1968,7 +1970,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2003,12 +2005,12 @@ rm -f conftest*
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2007: checking for working const" >&5
+echo "configure:2009: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2012 "configure"
+#line 2014 "configure"
#include "confdefs.h"
int main() {
@@ -2057,7 +2059,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:2061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -2078,21 +2080,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2082: checking for inline" >&5
+echo "configure:2084: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 2089 "configure"
+#line 2091 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:2096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -2119,16 +2121,16 @@ esac
echo $ac_n "checking for __attribute__ extension""... $ac_c" 1>&6
-echo "configure:2123: checking for __attribute__ extension" >&5
+echo "configure:2125: checking for __attribute__ extension" >&5
cat > conftest.$ac_ext <<EOF
-#line 2125 "configure"
+#line 2127 "configure"
#include "confdefs.h"
int main() {
int __attribute__((unused)) f(void){return 1;}
; return 0; }
EOF
-if { (eval echo configure:2132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_ATTRIBUTE 1
@@ -2144,16 +2146,16 @@ fi
rm -f conftest*
echo $ac_n "checking for __FUNCTION__ extension""... $ac_c" 1>&6
-echo "configure:2148: checking for __FUNCTION__ extension" >&5
+echo "configure:2150: checking for __FUNCTION__ extension" >&5
cat > conftest.$ac_ext <<EOF
-#line 2150 "configure"
+#line 2152 "configure"
#include "confdefs.h"
int main() {
int f(void){return __FUNCTION__;}
; return 0; }
EOF
-if { (eval echo configure:2157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_FUNCTION 1
@@ -2169,7 +2171,7 @@ fi
rm -f conftest*
echo $ac_n "checking how to print long long""... $ac_c" 1>&6
-echo "configure:2173: checking how to print long long" >&5;
+echo "configure:2175: checking how to print long long" >&5
if eval "test \"`echo '$''{'hdf5_cv_printf_ll'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2178,7 +2180,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2182 "configure"
+#line 2184 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2189,7 +2191,7 @@ else
sprintf(s,"%${hdf5_cv_printf_ll}d",x);
exit (strcmp(s,"1099511627776"));}
EOF
-if { (eval echo configure:2193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
break
else
@@ -2210,7 +2212,7 @@ EOF
echo $ac_n "checking for debug flags""... $ac_c" 1>&6
-echo "configure:2214: checking for debug flags" >&5;
+echo "configure:2216: checking for debug flags" >&5
# Check whether --enable-debug or --disable-debug was given.
if test "${enable_debug+set}" = set; then
enableval="$enable_debug"
@@ -2241,6 +2243,19 @@ if test "X" != "X$DEBUG_PKG"; then
done
fi
+echo $ac_n "checking for API tracing""... $ac_c" 1>&6
+echo "configure:2248: checking for API tracing" >&5;
+# Check whether --enable-tracing or --disable-tracing was given.
+if test "${enable_tracing+set}" = set; then
+ enableval="$enable_tracing"
+ CPPFLAGS="$CPPFLAGS -DH5_DEBUG_API"
+ echo "$ac_t""yes" 1>&6
+else
+ CPPFLAGS="$CPPFLAGS -UH5_DEBUG_API"
+ echo "$ac_t""no" 1>&6
+fi
+
+
# Check whether --enable-parallel or --disable-parallel was given.
if test "${enable_parallel+set}" = set; then
enableval="$enable_parallel"
@@ -2248,7 +2263,7 @@ if test "${enable_parallel+set}" = set; then
fi
echo $ac_n "checking for parallel support""... $ac_c" 1>&6
-echo "configure:2252: checking for parallel support" >&5;
+echo "configure:2267: checking for parallel support" >&5;
case "X-$PARALLEL" in
@@ -2273,7 +2288,7 @@ EOF
CFLAGS="$CFLAGS $MPI_LIB"
RUNTEST="$RUNTEST"
echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6
-echo "configure:2277: checking for main in -lmpi" >&5
+echo "configure:2292: checking for main in -lmpi" >&5
ac_lib_var=`echo mpi'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2281,14 +2296,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lmpi $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2285 "configure"
+#line 2300 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2315,7 +2330,7 @@ else
echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for main in -lmpio""... $ac_c" 1>&6
-echo "configure:2319: checking for main in -lmpio" >&5
+echo "configure:2334: checking for main in -lmpio" >&5
ac_lib_var=`echo mpio'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2323,14 +2338,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lmpio $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2327 "configure"
+#line 2342 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
diff --git a/configure.in b/configure.in
index 1a096c0..0d0a8cf 100644
--- a/configure.in
+++ b/configure.in
@@ -210,7 +210,7 @@ dnl Try to figure out how to print `long long'. Some machines use `%lld'
dnl and others use `%qd'. There may be more! The final `l' is a
dnl default in case none of the others work.
dnl
-AC_MSG_CHECKING(how to print long long);
+AC_MSG_CHECKING(how to print long long)
AC_CACHE_VAL(hdf5_cv_printf_ll,
for hdf5_cv_printf_ll in ll q l; do
AC_TRY_RUN([
@@ -230,7 +230,7 @@ AC_DEFINE_UNQUOTED(PRINTF_LL_WIDTH,"$hdf5_cv_printf_ll")
dnl ----------------------------------------------------------------------
dnl Turn on debugging by setting compiler flags
dnl
-AC_MSG_CHECKING(for debug flags);
+AC_MSG_CHECKING(for debug flags)
AC_ARG_ENABLE(debug,
[--enable-debug=all Turn on debugging in all packages. One may also
specify a comma-separated list of package names
@@ -262,6 +262,17 @@ if test "X" != "X$DEBUG_PKG"; then
fi
dnl ----------------------------------------------------------------------
+dnl Enable tracing of the API
+dnl
+AC_MSG_CHECKING(for API tracing);
+AC_ARG_ENABLE(tracing,
+ --enable-tracing Cause the library to trace all API calls,
+ CPPFLAGS="$CPPFLAGS -DH5_DEBUG_API"
+ AC_MSG_RESULT(yes),
+ CPPFLAGS="$CPPFLAGS -UH5_DEBUG_API"
+ AC_MSG_RESULT(no))
+
+dnl ----------------------------------------------------------------------
dnl Check for parallel support
dnl
AC_ARG_ENABLE(parallel,
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@
diff --git a/test/dsets.c b/test/dsets.c
index 576a575..cc81319 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -694,7 +694,7 @@ test_compression(hid_t file)
static herr_t
test_multiopen (hid_t file)
{
- hid_t dcpl, space, dset1, dset2;
+ hid_t dcpl=-1, space=-1, dset1=-1, dset2=-1;
hsize_t cur_size[1] = {10};
static hsize_t max_size[1] = {H5S_UNLIMITED};
hsize_t tmp_size[1];
diff --git a/test/dtypes.c b/test/dtypes.c
index a2f9a76..f60efd7 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -227,7 +227,7 @@ static herr_t
test_transient (void)
{
static hsize_t ds_size[2] = {10, 20};
- hid_t file, type, space, dset, t2;
+ hid_t file=-1, type=-1, space=-1, dset=-1, t2=-1;
printf ("%-70s", "Testing transient data types");
if ((file=H5Fcreate (FILE_NAME_1, H5F_ACC_TRUNC|H5F_ACC_DEBUG,
@@ -342,7 +342,7 @@ test_transient (void)
static herr_t
test_named (void)
{
- hid_t file, type, space, dset, t2, attr1;
+ hid_t file=-1, type=-1, space=-1, dset=-1, t2=-1, attr1=-1;
herr_t status;
static hsize_t ds_size[2] = {10, 20};