mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-31 17:10:47 +08:00
[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
This commit is contained in:
parent
043b7c4ec5
commit
ae5c998516
@ -23,10 +23,11 @@
|
||||
#include <H5HGprivate.h>
|
||||
#include <H5HLprivate.h>
|
||||
#include <H5Oprivate.h>
|
||||
|
||||
#include <h5tools.h>
|
||||
/* File drivers */
|
||||
#ifdef VERSION13
|
||||
#include <H5FDfamily.h>
|
||||
|
||||
#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);
|
||||
|
@ -10,21 +10,36 @@
|
||||
|
||||
/* See H5private.h for how to include system headers */
|
||||
#include <hdf5.h>
|
||||
#include <h5tools.c>
|
||||
#ifdef H5_STDC_HEADERS
|
||||
# include <fcntl.h>
|
||||
# include <string.h>
|
||||
# include <stdlib.h>
|
||||
# include <stdio.h>
|
||||
#elif defined STDC_HEADERS
|
||||
# include <fcntl.h>
|
||||
# include <string.h>
|
||||
# include <stdlib.h>
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifdef H5_HAVE_UNISTD_H
|
||||
# include <sys/types.h>
|
||||
# include <unistd.h>
|
||||
#elif defined HAVE_UNISTD_H
|
||||
# include <sys/types.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined VERSION12
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
#elif defined VERSION13
|
||||
#ifdef H5_HAVE_SYS_STAT_H
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
13
tools/h5ls.c
13
tools/h5ls.c
@ -18,11 +18,15 @@
|
||||
/*
|
||||
* File drivers
|
||||
*/
|
||||
#if defined VERSION13
|
||||
#include <H5FDsec2.h>
|
||||
#include <H5FDmulti.h>
|
||||
#include <H5FDfamily.h>
|
||||
#define NDRIVERS 10
|
||||
#elif defined VERSION12
|
||||
#include <H5Fpublic.h>
|
||||
#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.
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
/* See H5private.h for how to include system headers */
|
||||
#include <hdf5.h>
|
||||
#include <h5tools.h>
|
||||
#ifdef H5_STDC_HEADERS
|
||||
# include <ctype.h>
|
||||
# include <errno.h>
|
||||
@ -21,16 +22,33 @@
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
#elif defined STDC_HEADERS
|
||||
# include <ctype.h>
|
||||
# include <errno.h>
|
||||
# include <fcntl.h>
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
#ifdef H5_HAVE_UNISTD_H
|
||||
# include <sys/types.h>
|
||||
# include <unistd.h>
|
||||
#elif defined HAVE_UNISTD_H
|
||||
# include <sys/types.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if defined VERSION12
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
#elif defined VERSION13
|
||||
#ifdef H5_HAVE_SYS_STAT_H
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
|
@ -12,7 +12,13 @@
|
||||
|
||||
#include <hdf5.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user