summaryrefslogtreecommitdiffstats
path: root/tools/misc/h5debug.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-03-22 14:53:27 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-03-22 14:53:27 (GMT)
commit06ee92414dd1e9b5e64ee1c7f1fc4141ef01cdff (patch)
tree3174dcbf8cd52657fa66fd361f2baa9040d4ec14 /tools/misc/h5debug.c
parentb6f34ab3e50a455e8be4700c018404afa1adce26 (diff)
downloadhdf5-06ee92414dd1e9b5e64ee1c7f1fc4141ef01cdff.zip
hdf5-06ee92414dd1e9b5e64ee1c7f1fc4141ef01cdff.tar.gz
hdf5-06ee92414dd1e9b5e64ee1c7f1fc4141ef01cdff.tar.bz2
[svn-r6519] Purpose:
Bug fix/code cleanup/new feature Description: Fix h5debug to work correctly again, with all the changes over the past few months. Improved and cleaned up debugging output available in h5debug. Platforms tested: FreeBSD 4.7 (sleipnir)
Diffstat (limited to 'tools/misc/h5debug.c')
-rw-r--r--tools/misc/h5debug.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c
index c532e5d..145c553 100644
--- a/tools/misc/h5debug.c
+++ b/tools/misc/h5debug.c
@@ -54,7 +54,7 @@
int
main(int argc, char *argv[])
{
- hid_t fid, plist=H5P_DEFAULT;
+ hid_t fid, fapl, dxpl;
H5F_t *f;
haddr_t addr=0, extra=0;
uint8_t sig[16];
@@ -67,14 +67,27 @@ main(int argc, char *argv[])
HDexit(1);
}
+ /* Initialize the library */
+ if(H5open ()<0) {
+ fprintf(stderr, "cannot initialize the library\n");
+ HDexit(1);
+ }
+
/*
* Open the file and get the file descriptor.
*/
+ if((dxpl = H5Pcreate (H5P_DATASET_XFER))<0) {
+ fprintf(stderr, "cannot create dataset transfer property list\n");
+ HDexit(1);
+ }
+ if((fapl = H5Pcreate (H5P_FILE_ACCESS))<0) {
+ fprintf(stderr, "cannot create file access property list\n");
+ HDexit(1);
+ }
if (strchr (argv[1], '%')) {
- plist = H5Pcreate (H5P_FILE_ACCESS);
- H5Pset_fapl_family (plist, (hsize_t)0, H5P_DEFAULT);
+ H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT);
}
- if ((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, plist)) < 0) {
+ if ((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0) {
fprintf(stderr, "cannot open file\n");
HDexit(1);
}
@@ -97,7 +110,7 @@ main(int argc, char *argv[])
* Read the signature at the specified file position.
*/
HDfprintf(stdout, "Reading signature at address %a (rel)\n", addr);
- if (H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), H5P_DEFAULT, sig)<0) {
+ if (H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), dxpl, sig)<0) {
fprintf(stderr, "cannot read signature\n");
HDexit(3);
}
@@ -180,6 +193,8 @@ main(int argc, char *argv[])
fprintf(stderr, "An error occurred\n");
HDexit(5);
}
+ H5Pclose(dxpl);
+ H5Pclose(fapl);
H5Fclose(fid);
return 0;
}