From ae5c998516c2235ef1334c76718109506dcc480c Mon Sep 17 00:00:00 2001 From: Patrick Lu Date: Wed, 3 May 2000 10:48:20 -0500 Subject: [svn-r2211] took the development branch code and moved it into the release. had to add some conditional compile statements in the code to compile for the release. defined a VERSION12 and VERSION13 macro. all changes were surrounded by these statements --- tools/h5debug.c | 27 +++++++++++++++++++++++++-- tools/h5import.c | 15 +++++++++++++++ tools/h5ls.c | 13 +++++++++---- tools/h5repart.c | 18 ++++++++++++++++++ tools/h5tools.h | 8 +++++++- 5 files changed, 74 insertions(+), 7 deletions(-) diff --git a/tools/h5debug.c b/tools/h5debug.c index c2364a1..13826d5 100644 --- a/tools/h5debug.c +++ b/tools/h5debug.c @@ -23,10 +23,11 @@ #include #include #include - +#include /* File drivers */ +#ifdef VERSION13 #include - +#endif #define INDENT 3 #define VCOL 50 @@ -54,17 +55,30 @@ main(int argc, char *argv[]) { hid_t fid, plist=H5P_DEFAULT; H5F_t *f; +#if defined VERSION13 haddr_t addr=0, extra=0; +#elif defined VERSION12 + haddr_t *addr,*extra; +#endif uint8_t sig[16]; intn i, ndims; herr_t status = SUCCEED; +#if defined VERSION12 + addr = malloc(sizeof(haddr_t)); + extra = malloc(sizeof(haddr_t)); + addr->offset = 0; + extra->offset = 0; +#endif + /* * Open the file and get the file descriptor. */ if (strchr (argv[1], '%')) { plist = H5Pcreate (H5P_FILE_ACCESS); +#if defined VERSION13 H5Pset_fapl_family (plist, 0, H5P_DEFAULT); +#endif } if ((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, plist)) < 0) { fprintf(stderr, "cannot open file\n"); @@ -80,15 +94,24 @@ main(int argc, char *argv[]) */ if (argc > 2) { printf("New address: %s\n", argv[2]); +#if defined VERSION13 addr = HDstrtoll(argv[2], NULL, 0); +#elif defined VERSION12 + addr->offset = HDstrtoll(argv[2], NULL, 0); +#endif } if (argc > 3) { +#if defined VERSION13 extra = HDstrtoll(argv[3], NULL, 0); +#elif defined VERSION12 + extra->offset = HDstrtoll(argv[3], NULL, 0); +#endif } /* * Read the signature at the specified file position. */ HDfprintf(stdout, "Reading signature at address %a (rel)\n", addr); + if (H5F_block_read(f, addr, (hsize_t)sizeof(sig), H5P_DEFAULT, sig)<0) { fprintf(stderr, "cannot read signature\n"); HDexit(3); diff --git a/tools/h5import.c b/tools/h5import.c index 53fae0b..a54c98f 100644 --- a/tools/h5import.c +++ b/tools/h5import.c @@ -10,21 +10,36 @@ /* See H5private.h for how to include system headers */ #include +#include #ifdef H5_STDC_HEADERS # include # include # include # include +#elif defined STDC_HEADERS +# include +# include +# include +# include #endif #ifdef H5_HAVE_UNISTD_H # include # include +#elif defined HAVE_UNISTD_H +# include +# include #endif +#if defined VERSION12 +#ifdef HAVE_SYS_STAT_H +# include +#endif +#elif defined VERSION13 #ifdef H5_HAVE_SYS_STAT_H # include #endif +#endif diff --git a/tools/h5ls.c b/tools/h5ls.c index d523cf0..1cad442 100644 --- a/tools/h5ls.c +++ b/tools/h5ls.c @@ -18,11 +18,15 @@ /* * File drivers */ +#if defined VERSION13 #include #include #include -#define NDRIVERS 10 +#elif defined VERSION12 +#include +#endif +#define NDRIVERS 10 /* * If defined then include the file name as part of the object name when * printing full object names. Otherwise leave the file name off. @@ -1912,11 +1916,12 @@ main (int argc, char *argv[]) static char root_name[] = "/"; int ndrivers=0; + struct { const char *name; hid_t fapl; } driver[NDRIVERS]; - + /* Build display table */ DISPATCH(H5G_DATASET, "Dataset", H5Dopen, H5Dclose, @@ -2081,7 +2086,7 @@ main (int argc, char *argv[]) driver[ndrivers].name = "sec2"; driver[ndrivers].fapl = H5P_DEFAULT; ndrivers++; - +#if defined VERSION13 driver[ndrivers].name = "family"; driver[ndrivers].fapl = fapl = H5Pcreate(H5P_FILE_ACCESS); H5Pset_fapl_family(fapl, 0, H5P_DEFAULT); @@ -2096,7 +2101,7 @@ main (int argc, char *argv[]) driver[ndrivers].fapl = fapl = H5Pcreate(H5P_FILE_ACCESS); H5Pset_fapl_multi(fapl, NULL, NULL, NULL, NULL, TRUE); ndrivers++; - +#endif /* * Each remaining argument is an hdf5 file followed by an optional slash * and object name. diff --git a/tools/h5repart.c b/tools/h5repart.c index 6704f38..74acb26 100644 --- a/tools/h5repart.c +++ b/tools/h5repart.c @@ -14,6 +14,7 @@ /* See H5private.h for how to include system headers */ #include +#include #ifdef H5_STDC_HEADERS # include # include @@ -21,16 +22,33 @@ # include # include # include +#elif defined STDC_HEADERS +# include +# include +# include +# include +# include +# include #endif #ifdef H5_HAVE_UNISTD_H # include # include +#elif defined HAVE_UNISTD_H +# include +# include #endif + +#if defined VERSION12 +#ifdef HAVE_SYS_STAT_H +# include +#endif +#elif defined VERSION13 #ifdef H5_HAVE_SYS_STAT_H # include #endif +#endif #ifndef FALSE #define FALSE 0 diff --git a/tools/h5tools.h b/tools/h5tools.h index e6c4e40..0cbdc84 100644 --- a/tools/h5tools.h +++ b/tools/h5tools.h @@ -12,7 +12,13 @@ #include #include - +#if H5_VERS_MAJOR == 1 +#if H5_VERS_MINOR == 2 +#define VERSION12 +#elif H5_VERS_MINOR == 3 +#define VERSION13 +#endif +#endif #define ESCAPE_HTML 1 -- cgit v0.12