diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2000-09-30 17:27:18 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2000-09-30 17:27:18 (GMT) |
commit | 375e1d4d7745f7115631901e5a34fdf6755c3658 (patch) | |
tree | 0744e2db99b2b21d101403b1a3215d5aa7346c4d /tools/h5tools.c | |
parent | 5e8a177dd825a0b955d8f91b88b18860771311fe (diff) | |
download | hdf5-375e1d4d7745f7115631901e5a34fdf6755c3658.zip hdf5-375e1d4d7745f7115631901e5a34fdf6755c3658.tar.gz hdf5-375e1d4d7745f7115631901e5a34fdf6755c3658.tar.bz2 |
[svn-r2626] Purpose:
New Feature
Description:
Add -o option to h5dumper. It displays the raw data of datasets to a
separate output file.
Add a feature to h5tools library that it uses the FILE *rawdatastream
as the stream for the display of datasets raw data.
Solution:
Define an "extern FILE *rawdatastream" in h5tools.h
and declare it in h5tools.c. This way, it would work
even if an application does not explicitely declare it.
Tried to initialized it to stdout as
FILE *rawdatastream = stdout;
but Linux gcc rejected it though all other platforms+compilers
accepted it fine. For now, put in a kludge to set it right
before it is used. Need a safer way to initialize it.
Platforms tested:
arabica, eirene, modi4 -64.
Diffstat (limited to 'tools/h5tools.c')
-rw-r--r-- | tools/h5tools.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/h5tools.c b/tools/h5tools.c index d4ece5c..197fc2f 100644 --- a/tools/h5tools.c +++ b/tools/h5tools.c @@ -23,6 +23,7 @@ int indent = 0; int compound_data=0; int nCols = 80; +FILE *rawdatastream = NULL; /* should be stdout but linux gcc moans about it*/ int print_data(hid_t oid, hid_t _p_type, int obj_data); @@ -1734,7 +1735,10 @@ h5dump_dset(FILE *stream, const h5dump_t *info, hid_t dset, hid_t _p_type, H5Sclose(f_space); /* Print the data */ - status = h5dump_simple_dset(stream, info, dset, p_type, indentlevel); + /* a kludge because linux gcc does not accept the initialization with sdtout */ + if (!rawdatastream) + rawdatastream=stdout; + status = h5dump_simple_dset(rawdatastream, info, dset, p_type, indentlevel); if (p_type!=_p_type) H5Tclose(p_type); return status; } |