summaryrefslogtreecommitdiffstats
path: root/tools/h5dump.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2000-11-02 04:59:51 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2000-11-02 04:59:51 (GMT)
commit48b4b454816677b3b79d03bb4d4dc7b1eef90e30 (patch)
tree5335b3f7ab3b8c2d8beb914cc4cd7030c6065696 /tools/h5dump.c
parent180a47a037320fc8fcf48cf3114e1f548d019659 (diff)
downloadhdf5-48b4b454816677b3b79d03bb4d4dc7b1eef90e30.zip
hdf5-48b4b454816677b3b79d03bb4d4dc7b1eef90e30.tar.gz
hdf5-48b4b454816677b3b79d03bb4d4dc7b1eef90e30.tar.bz2
[svn-r2790] Purpose:
new feature Description: h5tools.c: Created h5tools_init() and h5tools_close() for the initialization of the h5tools library and closing of it. With this, the rawdatastream and other internal structures can be initialized properly. h5tools.h: added prototypes for h5tools_init and h5tools_close. h5dump.c: h5ls.c: Added the calls for h5tools_init() and h5tools_close(). Platforms tested: IRIX64 -64 parallel and Linux
Diffstat (limited to 'tools/h5dump.c')
-rw-r--r--tools/h5dump.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/tools/h5dump.c b/tools/h5dump.c
index 882cc85..6272ca4 100644
--- a/tools/h5dump.c
+++ b/tools/h5dump.c
@@ -215,7 +215,7 @@ usage(void)
Usage of HDF5 Dumper:\n\
\n\
h5dump [-h] [-bb] [-header] [-v] [-V] [-a <names>] [-d <names>] [-g <names>]\n\
- [-l <names>] [-t <names>] [-w <number>] <file>\n\
+ [-l <names>] [-o <fname>] [-t <names>] [-w <number>] <file>\n\
\n\
-h Print information on this command and exit.\n\
-bb Display the conent of the boot block. [Default: don't display]\n\
@@ -1295,10 +1295,10 @@ dump_data(hid_t obj_id, int obj_data)
* Function: set_output_file
*
* Purpose: Open fname as the output file for dataset raw data.
- * Set rawdatastream as its file stream.
+ * Set rawdatastream as its file stream.
*
* Return: 0 -- succeeded
- * negative -- failed
+ * negative -- failed
*
* Programmer: Albert Cheng, 2000/09/30
*
@@ -1359,6 +1359,9 @@ main(int argc, char *argv[])
H5Eget_auto(&func, &edata);
H5Eset_auto(NULL, NULL);
+ /* Initialize h5tools lib */
+ h5tools_init();
+
opts = malloc((argc / 2) * sizeof(int));
opts[0] = -1;
@@ -1712,23 +1715,20 @@ main(int argc, char *argv[])
end_obj(dump_header_format->fileend, dump_header_format->fileblockend);
done:
- H5Eset_auto(func, edata);
- free(opts);
-
if (H5Fclose(fid) < 0)
d_status = 1;
- if (rawdatastream && rawdatastream != stdout)
- if (fclose(rawdatastream))
- perror("fclose");
-
-
free(group_table->objs);
free(dset_table->objs);
free(type_table->objs);
free(prefix);
free(info->prefix);
free(info);
+ free(opts);
+
+ h5tools_close();
+ H5Eset_auto(func, edata);
+
return d_status;
}