diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-05-01 05:16:50 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-05-01 05:16:50 (GMT) |
commit | 65bb86375cfecac3e95ad1285db627a4a19eaabb (patch) | |
tree | 48151aa76db2a93929e682f3e7626d1b881364ca /src/H5Epublic.h | |
parent | 59ea5ff28fb23ab4bd00f36da3268b2a0518c42c (diff) | |
download | hdf5-65bb86375cfecac3e95ad1285db627a4a19eaabb.zip hdf5-65bb86375cfecac3e95ad1285db627a4a19eaabb.tar.gz hdf5-65bb86375cfecac3e95ad1285db627a4a19eaabb.tar.bz2 |
[svn-r383] ./src/H5A.c
./src/H5F.c
./src/H5G.c
./src/H5O.c
./src/H5Osdspace.c
./src/H5T.c
./src/H5Tconv.c
./src/H5Z.c
./test/big.c
./test/cmpd_dset.c
./test/dsets.c
./test/extend.c
./test/istore.c
Now that I have a home-grown version of Purify I fixed all the
leaks in all the test files.
Diffstat (limited to 'src/H5Epublic.h')
-rw-r--r-- | src/H5Epublic.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/H5Epublic.h b/src/H5Epublic.h index 9a07ad5..85c7b60 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -23,6 +23,31 @@ #include <H5Ipublic.h> /* + * One often needs to temporarily disable automatic error reporting when + * trying something that's likely or expected to fail. For instance, to + * determine if an object exists one can call H5Gstat() which will fail if + * the object doesn't exist. The code to try can be nested between calls to + * H5Eget_auto() and H5Eset_auto(), but it's easier just to use this macro + * like: + * H5E_BEGIN_TRY { + * ...stuff here that's likely to fail... + * } H5E_END_TRY + * + * Warning: don't break, return, or longjmp() from the body of the loop or + * the error reporting won't be properly restored! + */ +#define H5T_BEGIN_TRY do { \ + herr_t (*H5E_saved_efunc)(void*); \ + void *H5E_saved_edata; \ + H5Eget_auto (&H5E_saved_efunc, &H5E_saved_edata); \ + H5Eset_auto (NULL, NULL); + +#define H5T_END_TRY \ + H5Eset_auto (H5E_saved_efunc, H5E_saved_edata); \ +} + + +/* * Declare an enumerated type which holds all the valid major HDF error codes. */ typedef enum H5E_major_t { |