1998-03-25 07:18:34 +08:00
|
|
|
|
/*
|
|
|
|
|
* Copyright (C) 1998 NCSA
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Robb Matzke <matzke@llnl.gov>
|
|
|
|
|
* Monday, March 23, 1998
|
|
|
|
|
*/
|
[svn-r526] Changes since 19980721
----------------------
./tools/h5ls.c
If the dataset is of type H5T_NATIVE_CHAR then we print the
value as a string. This is temporary -- I plan to add better
control of this later but needed something now for debugging.
./src/H5Fistore.c
Squashed a bug in the chunk caching code that caused the wrong
chunk to be returned.
./bin/trace
./src/H5.c
Added support for printing values of array arguments when the
size of the array is supplied by some previous argument. You
must declare the argument as an array in order for the
automatic tracing stuff to work. For instance, the third
argument of H5Pset_chunk() is an array whose size is
determined by the second argument `ndims'. Here's how you
should declare it:
herr_t
H5Pset_chunk(hid_t plist_id, intn rank, hsize_t dims[/*rank*/])
The comment inside the `[]' is the name of some previous
integer argument (int, unsigned, size_t, ssize_t, hsize_t,
hssize_t). The trace output will look something like:
H5Pset_chunk(plist=1234567, rank=2, dims=0x112233 {11, 22})
Changed tracing so that data types are printed out
symbolically when possible.
Changed tracing so data type initializations are not printed.
This used to be confusing because lots of H5Tcopy() and
H5Tregister...() calls showed up before the applications first
explicit API call.
./src/H5Ipublic.h
Changed the file atom group from zero to one so printing of
atoms during tracing is more consistent -- they're all big
numbers now.
./src/H5A.c
./src/H5E.c
./src/H5F.c
./src/H5G.c
./src/H5Sselect.c
./src/H5T.c
./src/H5TB.c
./src/H5Z.c
Accidently modified these when working on the tracing, but
nothing should have changed.
./src/H5P.c
Changed the definition of H5Pset_chunk() for tracing.
./src/H5S.c
./src/H5Spublic.h
Changed the definitions of H5Sset_extent_simple() and
H5Screate_simple() for tracing. Changed the FUNC_ENTER() name
for H5Screate_simple() so tracing shows the correct name.
1998-07-22 21:51:51 +08:00
|
|
|
|
#include <ctype.h>
|
[svn-r537] Changes since 19980722
----------------------
./src/H5A.c
./src/H5Apublic.h
./test/tattr.c
Switched the order of the second and third argument of
H5Aget_name() to make it consistent with other functions that
take buffers and buffer sizes.
./src/H5G.c
./src/H5Gpublic.h
./src/H5Gprivate.h
The H5Gget_comment() function returns the size of the comment
including the null terminator. If the object has no comment
then zero is returned. If an error occurs then a negative
value is returned.
./MANIFEST
./tools/Makefile.in
./tools/h5tools.h [NEW]
./tools/h5dump.c [NEW]
Created a library for printing values of datasets in a way
that looks nice. It's not done yet, but I needed it for
debugging the contents of files from Jim Reus.
./tools/h5ls.c
Added the `-d' and `--dump' options which cause the contents
of a dataset to be printed. Added `-w N' and `--width=N'
options to control how wide the raw data output should be. If
you want single-column output then say `-w1'.
Printing dataset values can now handle datasets of any integer
or floating point atomic type. As a special case, integers
which are one byte wide are treated a character strings for
now.
Sample output:
$ h5ls --dump --width=60 banana.hdf
ARCHIVE 0:0:0:744 Dataset {52/Inf}
Data:
(0) "U struct complex { double R; double I; };\012V"
(43) " double;\012"
U 0:0:0:2500 Dataset {256/512}
Data: printing of compound data types is not implemented yet
V 0:0:0:3928 Dataset {256/512}
Data:
(0) 0, 0.015625, 0.03125, 0.046875, 0.0625,
(5) 0.078125, 0.09375, 0.109375, 0.125, 0.140625,
(10) 0.15625, 0.171875, 0.1875, 0.203125, 0.21875,
(15) 0.234375, 0.25, 0.265625, 0.28125, 0.296875,
...
1998-07-24 05:19:17 +08:00
|
|
|
|
#include <h5tools.h>
|
1998-03-25 07:18:34 +08:00
|
|
|
|
#include <hdf5.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
1998-04-09 05:43:02 +08:00
|
|
|
|
#include <string.h>
|
1998-03-25 07:18:34 +08:00
|
|
|
|
|
[svn-r339] Changes since 19980408
----------------------
./src/H5Osdspace.c
./html/H5.format.html
In the past we were allowed to have >2GB files on a 32-bit
machine as long as no dataset within the file was larger than
4GB (or whatever sizeof(size_t) is). That's been fixed now.
All dataset size calculations are done with `hsize_t' which is
normally defined as `unsigned long long'.
./src/H5F.c
./src/H5Ffamily.c
./src/H5Fprivate.h
./src/H5P.c
./src/H5Ppublic.h
The file family member size can now be set/queried. The
default is still 64MB, but it can be set to 1GB by saying:
H5Pset_family (plist, 30, H5P_DEFAULT);
When opening an existing file family the specified
bits-per-member is ignored and the first member of the family
determines the bits-per-member, which can be retrieved with
H5Pget_family().
./acconfig.h
./configure.in
./src/H5config.h
./src/H5public.h
Added `--disable-hsizet' so that those with old GCC compilers
(<2.8.1) can still compile the code.
./src/H5.c
./src/H5private.h
Added HDfprintf() which works just like fprintf() except you
can give `H' as a size modifier for the integer conversions
and supply an `hsize_t' or `hssize_t' argument without casting
it. For instance:
hsize_t npoints = H5Sget_npoints(space);
HDfprintf(stdout,"Dataset has %Hd (%#018Hx) points\n",
npoints, npoints);
You can now give `%a' as a format to print an address, but all
formating flags are ignored and it causes the return value of
HDfprintf() to not include the characters in the address (but
who uses the return value anyway :-). Example:
H5G_t *grp;
HDfprintf(stdout, "Group object header at %a\n",
&(grp->ent.header));
Added HDstrtoll() which works exactly like [HD]strtol() except
the result is an int64.
./src/debug.c
Large addresses can now be entered from the command-line. Use
either decimal, octal (leading `0') or hexadecimal (leading
`0x') when giving the address.
./src/h5ls.c
The printf format for dataset dimensions was changed to `%Hu'
to support large datasets.
./test/big.c [NEW]
A test for big datasets on 32-bit machines. This test is not
run by default. Don't try to run it on an nfs-mounted file
system or other file system that doesn't support holes because
it creates two 32GB datasets of all zero.
1998-04-10 04:22:11 +08:00
|
|
|
|
#include <H5private.h>
|
1998-04-07 23:34:16 +08:00
|
|
|
|
#ifndef HAVE_ATTRIBUTE
|
|
|
|
|
# undef __attribute__
|
|
|
|
|
# define __attribute__(X) /*void*/
|
1998-04-09 05:43:02 +08:00
|
|
|
|
# define __unused__ /*void*/
|
|
|
|
|
#else
|
|
|
|
|
# define __unused__ __attribute__((unused))
|
1998-04-07 23:34:16 +08:00
|
|
|
|
#endif
|
1998-03-25 07:18:34 +08:00
|
|
|
|
|
[svn-r537] Changes since 19980722
----------------------
./src/H5A.c
./src/H5Apublic.h
./test/tattr.c
Switched the order of the second and third argument of
H5Aget_name() to make it consistent with other functions that
take buffers and buffer sizes.
./src/H5G.c
./src/H5Gpublic.h
./src/H5Gprivate.h
The H5Gget_comment() function returns the size of the comment
including the null terminator. If the object has no comment
then zero is returned. If an error occurs then a negative
value is returned.
./MANIFEST
./tools/Makefile.in
./tools/h5tools.h [NEW]
./tools/h5dump.c [NEW]
Created a library for printing values of datasets in a way
that looks nice. It's not done yet, but I needed it for
debugging the contents of files from Jim Reus.
./tools/h5ls.c
Added the `-d' and `--dump' options which cause the contents
of a dataset to be printed. Added `-w N' and `--width=N'
options to control how wide the raw data output should be. If
you want single-column output then say `-w1'.
Printing dataset values can now handle datasets of any integer
or floating point atomic type. As a special case, integers
which are one byte wide are treated a character strings for
now.
Sample output:
$ h5ls --dump --width=60 banana.hdf
ARCHIVE 0:0:0:744 Dataset {52/Inf}
Data:
(0) "U struct complex { double R; double I; };\012V"
(43) " double;\012"
U 0:0:0:2500 Dataset {256/512}
Data: printing of compound data types is not implemented yet
V 0:0:0:3928 Dataset {256/512}
Data:
(0) 0, 0.015625, 0.03125, 0.046875, 0.0625,
(5) 0.078125, 0.09375, 0.109375, 0.125, 0.140625,
(10) 0.15625, 0.171875, 0.1875, 0.203125, 0.21875,
(15) 0.234375, 0.25, 0.265625, 0.28125, 0.296875,
...
1998-07-24 05:19:17 +08:00
|
|
|
|
/* Command-line switches */
|
1998-07-18 03:03:43 +08:00
|
|
|
|
static int verbose_g = 0;
|
[svn-r537] Changes since 19980722
----------------------
./src/H5A.c
./src/H5Apublic.h
./test/tattr.c
Switched the order of the second and third argument of
H5Aget_name() to make it consistent with other functions that
take buffers and buffer sizes.
./src/H5G.c
./src/H5Gpublic.h
./src/H5Gprivate.h
The H5Gget_comment() function returns the size of the comment
including the null terminator. If the object has no comment
then zero is returned. If an error occurs then a negative
value is returned.
./MANIFEST
./tools/Makefile.in
./tools/h5tools.h [NEW]
./tools/h5dump.c [NEW]
Created a library for printing values of datasets in a way
that looks nice. It's not done yet, but I needed it for
debugging the contents of files from Jim Reus.
./tools/h5ls.c
Added the `-d' and `--dump' options which cause the contents
of a dataset to be printed. Added `-w N' and `--width=N'
options to control how wide the raw data output should be. If
you want single-column output then say `-w1'.
Printing dataset values can now handle datasets of any integer
or floating point atomic type. As a special case, integers
which are one byte wide are treated a character strings for
now.
Sample output:
$ h5ls --dump --width=60 banana.hdf
ARCHIVE 0:0:0:744 Dataset {52/Inf}
Data:
(0) "U struct complex { double R; double I; };\012V"
(43) " double;\012"
U 0:0:0:2500 Dataset {256/512}
Data: printing of compound data types is not implemented yet
V 0:0:0:3928 Dataset {256/512}
Data:
(0) 0, 0.015625, 0.03125, 0.046875, 0.0625,
(5) 0.078125, 0.09375, 0.109375, 0.125, 0.140625,
(10) 0.15625, 0.171875, 0.1875, 0.203125, 0.21875,
(15) 0.234375, 0.25, 0.265625, 0.28125, 0.296875,
...
1998-07-24 05:19:17 +08:00
|
|
|
|
static int dump_g = 0;
|
|
|
|
|
static int width_g = 80;
|
1998-07-18 03:03:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: usage
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Prints a usage message on stderr and then returns.
|
|
|
|
|
*
|
|
|
|
|
* Return: void
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Thursday, July 16, 1998
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
1998-05-14 01:58:24 +08:00
|
|
|
|
static void
|
|
|
|
|
usage (const char *progname)
|
|
|
|
|
{
|
1998-07-18 03:03:43 +08:00
|
|
|
|
fprintf(stderr, "\
|
|
|
|
|
usage: %s [OPTIONS] FILE [GROUP]\n\
|
|
|
|
|
OPTIONS\n\
|
|
|
|
|
-h, -?, --help Print a usage message and exit\n\
|
[svn-r537] Changes since 19980722
----------------------
./src/H5A.c
./src/H5Apublic.h
./test/tattr.c
Switched the order of the second and third argument of
H5Aget_name() to make it consistent with other functions that
take buffers and buffer sizes.
./src/H5G.c
./src/H5Gpublic.h
./src/H5Gprivate.h
The H5Gget_comment() function returns the size of the comment
including the null terminator. If the object has no comment
then zero is returned. If an error occurs then a negative
value is returned.
./MANIFEST
./tools/Makefile.in
./tools/h5tools.h [NEW]
./tools/h5dump.c [NEW]
Created a library for printing values of datasets in a way
that looks nice. It's not done yet, but I needed it for
debugging the contents of files from Jim Reus.
./tools/h5ls.c
Added the `-d' and `--dump' options which cause the contents
of a dataset to be printed. Added `-w N' and `--width=N'
options to control how wide the raw data output should be. If
you want single-column output then say `-w1'.
Printing dataset values can now handle datasets of any integer
or floating point atomic type. As a special case, integers
which are one byte wide are treated a character strings for
now.
Sample output:
$ h5ls --dump --width=60 banana.hdf
ARCHIVE 0:0:0:744 Dataset {52/Inf}
Data:
(0) "U struct complex { double R; double I; };\012V"
(43) " double;\012"
U 0:0:0:2500 Dataset {256/512}
Data: printing of compound data types is not implemented yet
V 0:0:0:3928 Dataset {256/512}
Data:
(0) 0, 0.015625, 0.03125, 0.046875, 0.0625,
(5) 0.078125, 0.09375, 0.109375, 0.125, 0.140625,
(10) 0.15625, 0.171875, 0.1875, 0.203125, 0.21875,
(15) 0.234375, 0.25, 0.265625, 0.28125, 0.296875,
...
1998-07-24 05:19:17 +08:00
|
|
|
|
-d, --dump Print the values of datasets\n\
|
|
|
|
|
-wN, --width=N Set the number of columns of output\n\
|
1998-07-18 03:03:43 +08:00
|
|
|
|
-v, --verbose Generate more verbose output\n\
|
1998-07-21 00:05:43 +08:00
|
|
|
|
-V, --version Print version number and exit\n\
|
1998-07-18 03:03:43 +08:00
|
|
|
|
FILE\n\
|
|
|
|
|
The file name may include a printf(3C) integer format such as\n\
|
|
|
|
|
\"%%05d\" to open a file family.\n\
|
|
|
|
|
GROUP\n\
|
|
|
|
|
If a group name is not specified then the contents of the root group\n\
|
|
|
|
|
\"/\" are displayed.\n", progname);
|
1998-05-14 01:58:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
[svn-r526] Changes since 19980721
----------------------
./tools/h5ls.c
If the dataset is of type H5T_NATIVE_CHAR then we print the
value as a string. This is temporary -- I plan to add better
control of this later but needed something now for debugging.
./src/H5Fistore.c
Squashed a bug in the chunk caching code that caused the wrong
chunk to be returned.
./bin/trace
./src/H5.c
Added support for printing values of array arguments when the
size of the array is supplied by some previous argument. You
must declare the argument as an array in order for the
automatic tracing stuff to work. For instance, the third
argument of H5Pset_chunk() is an array whose size is
determined by the second argument `ndims'. Here's how you
should declare it:
herr_t
H5Pset_chunk(hid_t plist_id, intn rank, hsize_t dims[/*rank*/])
The comment inside the `[]' is the name of some previous
integer argument (int, unsigned, size_t, ssize_t, hsize_t,
hssize_t). The trace output will look something like:
H5Pset_chunk(plist=1234567, rank=2, dims=0x112233 {11, 22})
Changed tracing so that data types are printed out
symbolically when possible.
Changed tracing so data type initializations are not printed.
This used to be confusing because lots of H5Tcopy() and
H5Tregister...() calls showed up before the applications first
explicit API call.
./src/H5Ipublic.h
Changed the file atom group from zero to one so printing of
atoms during tracing is more consistent -- they're all big
numbers now.
./src/H5A.c
./src/H5E.c
./src/H5F.c
./src/H5G.c
./src/H5Sselect.c
./src/H5T.c
./src/H5TB.c
./src/H5Z.c
Accidently modified these when working on the tracing, but
nothing should have changed.
./src/H5P.c
Changed the definition of H5Pset_chunk() for tracing.
./src/H5S.c
./src/H5Spublic.h
Changed the definitions of H5Sset_extent_simple() and
H5Screate_simple() for tracing. Changed the FUNC_ENTER() name
for H5Screate_simple() so tracing shows the correct name.
1998-07-22 21:51:51 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: dump_dataset_values
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Prints all values of a dataset.
|
|
|
|
|
*
|
|
|
|
|
* Return: void
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Tuesday, July 21, 1998
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static void
|
|
|
|
|
dump_dataset_values(hid_t dset)
|
|
|
|
|
{
|
1998-07-24 22:28:32 +08:00
|
|
|
|
hid_t f_type = H5Dget_type(dset);
|
|
|
|
|
size_t size = H5Tget_size(f_type);
|
[svn-r537] Changes since 19980722
----------------------
./src/H5A.c
./src/H5Apublic.h
./test/tattr.c
Switched the order of the second and third argument of
H5Aget_name() to make it consistent with other functions that
take buffers and buffer sizes.
./src/H5G.c
./src/H5Gpublic.h
./src/H5Gprivate.h
The H5Gget_comment() function returns the size of the comment
including the null terminator. If the object has no comment
then zero is returned. If an error occurs then a negative
value is returned.
./MANIFEST
./tools/Makefile.in
./tools/h5tools.h [NEW]
./tools/h5dump.c [NEW]
Created a library for printing values of datasets in a way
that looks nice. It's not done yet, but I needed it for
debugging the contents of files from Jim Reus.
./tools/h5ls.c
Added the `-d' and `--dump' options which cause the contents
of a dataset to be printed. Added `-w N' and `--width=N'
options to control how wide the raw data output should be. If
you want single-column output then say `-w1'.
Printing dataset values can now handle datasets of any integer
or floating point atomic type. As a special case, integers
which are one byte wide are treated a character strings for
now.
Sample output:
$ h5ls --dump --width=60 banana.hdf
ARCHIVE 0:0:0:744 Dataset {52/Inf}
Data:
(0) "U struct complex { double R; double I; };\012V"
(43) " double;\012"
U 0:0:0:2500 Dataset {256/512}
Data: printing of compound data types is not implemented yet
V 0:0:0:3928 Dataset {256/512}
Data:
(0) 0, 0.015625, 0.03125, 0.046875, 0.0625,
(5) 0.078125, 0.09375, 0.109375, 0.125, 0.140625,
(10) 0.15625, 0.171875, 0.1875, 0.203125, 0.21875,
(15) 0.234375, 0.25, 0.265625, 0.28125, 0.296875,
...
1998-07-24 05:19:17 +08:00
|
|
|
|
h5dump_t info;
|
[svn-r526] Changes since 19980721
----------------------
./tools/h5ls.c
If the dataset is of type H5T_NATIVE_CHAR then we print the
value as a string. This is temporary -- I plan to add better
control of this later but needed something now for debugging.
./src/H5Fistore.c
Squashed a bug in the chunk caching code that caused the wrong
chunk to be returned.
./bin/trace
./src/H5.c
Added support for printing values of array arguments when the
size of the array is supplied by some previous argument. You
must declare the argument as an array in order for the
automatic tracing stuff to work. For instance, the third
argument of H5Pset_chunk() is an array whose size is
determined by the second argument `ndims'. Here's how you
should declare it:
herr_t
H5Pset_chunk(hid_t plist_id, intn rank, hsize_t dims[/*rank*/])
The comment inside the `[]' is the name of some previous
integer argument (int, unsigned, size_t, ssize_t, hsize_t,
hssize_t). The trace output will look something like:
H5Pset_chunk(plist=1234567, rank=2, dims=0x112233 {11, 22})
Changed tracing so that data types are printed out
symbolically when possible.
Changed tracing so data type initializations are not printed.
This used to be confusing because lots of H5Tcopy() and
H5Tregister...() calls showed up before the applications first
explicit API call.
./src/H5Ipublic.h
Changed the file atom group from zero to one so printing of
atoms during tracing is more consistent -- they're all big
numbers now.
./src/H5A.c
./src/H5E.c
./src/H5F.c
./src/H5G.c
./src/H5Sselect.c
./src/H5T.c
./src/H5TB.c
./src/H5Z.c
Accidently modified these when working on the tracing, but
nothing should have changed.
./src/H5P.c
Changed the definition of H5Pset_chunk() for tracing.
./src/H5S.c
./src/H5Spublic.h
Changed the definitions of H5Sset_extent_simple() and
H5Screate_simple() for tracing. Changed the FUNC_ENTER() name
for H5Screate_simple() so tracing shows the correct name.
1998-07-22 21:51:51 +08:00
|
|
|
|
|
[svn-r537] Changes since 19980722
----------------------
./src/H5A.c
./src/H5Apublic.h
./test/tattr.c
Switched the order of the second and third argument of
H5Aget_name() to make it consistent with other functions that
take buffers and buffer sizes.
./src/H5G.c
./src/H5Gpublic.h
./src/H5Gprivate.h
The H5Gget_comment() function returns the size of the comment
including the null terminator. If the object has no comment
then zero is returned. If an error occurs then a negative
value is returned.
./MANIFEST
./tools/Makefile.in
./tools/h5tools.h [NEW]
./tools/h5dump.c [NEW]
Created a library for printing values of datasets in a way
that looks nice. It's not done yet, but I needed it for
debugging the contents of files from Jim Reus.
./tools/h5ls.c
Added the `-d' and `--dump' options which cause the contents
of a dataset to be printed. Added `-w N' and `--width=N'
options to control how wide the raw data output should be. If
you want single-column output then say `-w1'.
Printing dataset values can now handle datasets of any integer
or floating point atomic type. As a special case, integers
which are one byte wide are treated a character strings for
now.
Sample output:
$ h5ls --dump --width=60 banana.hdf
ARCHIVE 0:0:0:744 Dataset {52/Inf}
Data:
(0) "U struct complex { double R; double I; };\012V"
(43) " double;\012"
U 0:0:0:2500 Dataset {256/512}
Data: printing of compound data types is not implemented yet
V 0:0:0:3928 Dataset {256/512}
Data:
(0) 0, 0.015625, 0.03125, 0.046875, 0.0625,
(5) 0.078125, 0.09375, 0.109375, 0.125, 0.140625,
(10) 0.15625, 0.171875, 0.1875, 0.203125, 0.21875,
(15) 0.234375, 0.25, 0.265625, 0.28125, 0.296875,
...
1998-07-24 05:19:17 +08:00
|
|
|
|
/* Set to all default values and then override */
|
|
|
|
|
memset(&info, 0, sizeof info);
|
|
|
|
|
info.idx_fmt = " (%s) ";
|
|
|
|
|
info.line_ncols = width_g;
|
1998-07-30 00:43:59 +08:00
|
|
|
|
if (verbose_g) info.cmpd_name = "%s=";
|
[svn-r526] Changes since 19980721
----------------------
./tools/h5ls.c
If the dataset is of type H5T_NATIVE_CHAR then we print the
value as a string. This is temporary -- I plan to add better
control of this later but needed something now for debugging.
./src/H5Fistore.c
Squashed a bug in the chunk caching code that caused the wrong
chunk to be returned.
./bin/trace
./src/H5.c
Added support for printing values of array arguments when the
size of the array is supplied by some previous argument. You
must declare the argument as an array in order for the
automatic tracing stuff to work. For instance, the third
argument of H5Pset_chunk() is an array whose size is
determined by the second argument `ndims'. Here's how you
should declare it:
herr_t
H5Pset_chunk(hid_t plist_id, intn rank, hsize_t dims[/*rank*/])
The comment inside the `[]' is the name of some previous
integer argument (int, unsigned, size_t, ssize_t, hsize_t,
hssize_t). The trace output will look something like:
H5Pset_chunk(plist=1234567, rank=2, dims=0x112233 {11, 22})
Changed tracing so that data types are printed out
symbolically when possible.
Changed tracing so data type initializations are not printed.
This used to be confusing because lots of H5Tcopy() and
H5Tregister...() calls showed up before the applications first
explicit API call.
./src/H5Ipublic.h
Changed the file atom group from zero to one so printing of
atoms during tracing is more consistent -- they're all big
numbers now.
./src/H5A.c
./src/H5E.c
./src/H5F.c
./src/H5G.c
./src/H5Sselect.c
./src/H5T.c
./src/H5TB.c
./src/H5Z.c
Accidently modified these when working on the tracing, but
nothing should have changed.
./src/H5P.c
Changed the definition of H5Pset_chunk() for tracing.
./src/H5S.c
./src/H5Spublic.h
Changed the definitions of H5Sset_extent_simple() and
H5Screate_simple() for tracing. Changed the FUNC_ENTER() name
for H5Screate_simple() so tracing shows the correct name.
1998-07-22 21:51:51 +08:00
|
|
|
|
|
[svn-r537] Changes since 19980722
----------------------
./src/H5A.c
./src/H5Apublic.h
./test/tattr.c
Switched the order of the second and third argument of
H5Aget_name() to make it consistent with other functions that
take buffers and buffer sizes.
./src/H5G.c
./src/H5Gpublic.h
./src/H5Gprivate.h
The H5Gget_comment() function returns the size of the comment
including the null terminator. If the object has no comment
then zero is returned. If an error occurs then a negative
value is returned.
./MANIFEST
./tools/Makefile.in
./tools/h5tools.h [NEW]
./tools/h5dump.c [NEW]
Created a library for printing values of datasets in a way
that looks nice. It's not done yet, but I needed it for
debugging the contents of files from Jim Reus.
./tools/h5ls.c
Added the `-d' and `--dump' options which cause the contents
of a dataset to be printed. Added `-w N' and `--width=N'
options to control how wide the raw data output should be. If
you want single-column output then say `-w1'.
Printing dataset values can now handle datasets of any integer
or floating point atomic type. As a special case, integers
which are one byte wide are treated a character strings for
now.
Sample output:
$ h5ls --dump --width=60 banana.hdf
ARCHIVE 0:0:0:744 Dataset {52/Inf}
Data:
(0) "U struct complex { double R; double I; };\012V"
(43) " double;\012"
U 0:0:0:2500 Dataset {256/512}
Data: printing of compound data types is not implemented yet
V 0:0:0:3928 Dataset {256/512}
Data:
(0) 0, 0.015625, 0.03125, 0.046875, 0.0625,
(5) 0.078125, 0.09375, 0.109375, 0.125, 0.140625,
(10) 0.15625, 0.171875, 0.1875, 0.203125, 0.21875,
(15) 0.234375, 0.25, 0.265625, 0.28125, 0.296875,
...
1998-07-24 05:19:17 +08:00
|
|
|
|
/*
|
1998-07-24 22:28:32 +08:00
|
|
|
|
* If the dataset is a 1-byte integer type then format it as an ASCI
|
|
|
|
|
* character string instead of integers.
|
[svn-r537] Changes since 19980722
----------------------
./src/H5A.c
./src/H5Apublic.h
./test/tattr.c
Switched the order of the second and third argument of
H5Aget_name() to make it consistent with other functions that
take buffers and buffer sizes.
./src/H5G.c
./src/H5Gpublic.h
./src/H5Gprivate.h
The H5Gget_comment() function returns the size of the comment
including the null terminator. If the object has no comment
then zero is returned. If an error occurs then a negative
value is returned.
./MANIFEST
./tools/Makefile.in
./tools/h5tools.h [NEW]
./tools/h5dump.c [NEW]
Created a library for printing values of datasets in a way
that looks nice. It's not done yet, but I needed it for
debugging the contents of files from Jim Reus.
./tools/h5ls.c
Added the `-d' and `--dump' options which cause the contents
of a dataset to be printed. Added `-w N' and `--width=N'
options to control how wide the raw data output should be. If
you want single-column output then say `-w1'.
Printing dataset values can now handle datasets of any integer
or floating point atomic type. As a special case, integers
which are one byte wide are treated a character strings for
now.
Sample output:
$ h5ls --dump --width=60 banana.hdf
ARCHIVE 0:0:0:744 Dataset {52/Inf}
Data:
(0) "U struct complex { double R; double I; };\012V"
(43) " double;\012"
U 0:0:0:2500 Dataset {256/512}
Data: printing of compound data types is not implemented yet
V 0:0:0:3928 Dataset {256/512}
Data:
(0) 0, 0.015625, 0.03125, 0.046875, 0.0625,
(5) 0.078125, 0.09375, 0.109375, 0.125, 0.140625,
(10) 0.15625, 0.171875, 0.1875, 0.203125, 0.21875,
(15) 0.234375, 0.25, 0.265625, 0.28125, 0.296875,
...
1998-07-24 05:19:17 +08:00
|
|
|
|
*/
|
1998-07-24 22:28:32 +08:00
|
|
|
|
if (1==size && H5T_INTEGER==H5Tget_class(f_type)) {
|
|
|
|
|
info.elmt_suf1 = "";
|
|
|
|
|
info.elmt_suf2 = "";
|
|
|
|
|
info.idx_fmt = " (%s) \"";
|
|
|
|
|
info.line_suf = "\"";
|
[svn-r537] Changes since 19980722
----------------------
./src/H5A.c
./src/H5Apublic.h
./test/tattr.c
Switched the order of the second and third argument of
H5Aget_name() to make it consistent with other functions that
take buffers and buffer sizes.
./src/H5G.c
./src/H5Gpublic.h
./src/H5Gprivate.h
The H5Gget_comment() function returns the size of the comment
including the null terminator. If the object has no comment
then zero is returned. If an error occurs then a negative
value is returned.
./MANIFEST
./tools/Makefile.in
./tools/h5tools.h [NEW]
./tools/h5dump.c [NEW]
Created a library for printing values of datasets in a way
that looks nice. It's not done yet, but I needed it for
debugging the contents of files from Jim Reus.
./tools/h5ls.c
Added the `-d' and `--dump' options which cause the contents
of a dataset to be printed. Added `-w N' and `--width=N'
options to control how wide the raw data output should be. If
you want single-column output then say `-w1'.
Printing dataset values can now handle datasets of any integer
or floating point atomic type. As a special case, integers
which are one byte wide are treated a character strings for
now.
Sample output:
$ h5ls --dump --width=60 banana.hdf
ARCHIVE 0:0:0:744 Dataset {52/Inf}
Data:
(0) "U struct complex { double R; double I; };\012V"
(43) " double;\012"
U 0:0:0:2500 Dataset {256/512}
Data: printing of compound data types is not implemented yet
V 0:0:0:3928 Dataset {256/512}
Data:
(0) 0, 0.015625, 0.03125, 0.046875, 0.0625,
(5) 0.078125, 0.09375, 0.109375, 0.125, 0.140625,
(10) 0.15625, 0.171875, 0.1875, 0.203125, 0.21875,
(15) 0.234375, 0.25, 0.265625, 0.28125, 0.296875,
...
1998-07-24 05:19:17 +08:00
|
|
|
|
}
|
1998-07-24 22:28:32 +08:00
|
|
|
|
|
[svn-r537] Changes since 19980722
----------------------
./src/H5A.c
./src/H5Apublic.h
./test/tattr.c
Switched the order of the second and third argument of
H5Aget_name() to make it consistent with other functions that
take buffers and buffer sizes.
./src/H5G.c
./src/H5Gpublic.h
./src/H5Gprivate.h
The H5Gget_comment() function returns the size of the comment
including the null terminator. If the object has no comment
then zero is returned. If an error occurs then a negative
value is returned.
./MANIFEST
./tools/Makefile.in
./tools/h5tools.h [NEW]
./tools/h5dump.c [NEW]
Created a library for printing values of datasets in a way
that looks nice. It's not done yet, but I needed it for
debugging the contents of files from Jim Reus.
./tools/h5ls.c
Added the `-d' and `--dump' options which cause the contents
of a dataset to be printed. Added `-w N' and `--width=N'
options to control how wide the raw data output should be. If
you want single-column output then say `-w1'.
Printing dataset values can now handle datasets of any integer
or floating point atomic type. As a special case, integers
which are one byte wide are treated a character strings for
now.
Sample output:
$ h5ls --dump --width=60 banana.hdf
ARCHIVE 0:0:0:744 Dataset {52/Inf}
Data:
(0) "U struct complex { double R; double I; };\012V"
(43) " double;\012"
U 0:0:0:2500 Dataset {256/512}
Data: printing of compound data types is not implemented yet
V 0:0:0:3928 Dataset {256/512}
Data:
(0) 0, 0.015625, 0.03125, 0.046875, 0.0625,
(5) 0.078125, 0.09375, 0.109375, 0.125, 0.140625,
(10) 0.15625, 0.171875, 0.1875, 0.203125, 0.21875,
(15) 0.234375, 0.25, 0.265625, 0.28125, 0.296875,
...
1998-07-24 05:19:17 +08:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Print all the values.
|
|
|
|
|
*/
|
|
|
|
|
printf(" Data:\n");
|
1998-07-24 22:28:32 +08:00
|
|
|
|
if (h5dump(stdout, &info, dset, -1)<0) {
|
|
|
|
|
printf(" Unable to print data.\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
H5Tclose(f_type);
|
[svn-r526] Changes since 19980721
----------------------
./tools/h5ls.c
If the dataset is of type H5T_NATIVE_CHAR then we print the
value as a string. This is temporary -- I plan to add better
control of this later but needed something now for debugging.
./src/H5Fistore.c
Squashed a bug in the chunk caching code that caused the wrong
chunk to be returned.
./bin/trace
./src/H5.c
Added support for printing values of array arguments when the
size of the array is supplied by some previous argument. You
must declare the argument as an array in order for the
automatic tracing stuff to work. For instance, the third
argument of H5Pset_chunk() is an array whose size is
determined by the second argument `ndims'. Here's how you
should declare it:
herr_t
H5Pset_chunk(hid_t plist_id, intn rank, hsize_t dims[/*rank*/])
The comment inside the `[]' is the name of some previous
integer argument (int, unsigned, size_t, ssize_t, hsize_t,
hssize_t). The trace output will look something like:
H5Pset_chunk(plist=1234567, rank=2, dims=0x112233 {11, 22})
Changed tracing so that data types are printed out
symbolically when possible.
Changed tracing so data type initializations are not printed.
This used to be confusing because lots of H5Tcopy() and
H5Tregister...() calls showed up before the applications first
explicit API call.
./src/H5Ipublic.h
Changed the file atom group from zero to one so printing of
atoms during tracing is more consistent -- they're all big
numbers now.
./src/H5A.c
./src/H5E.c
./src/H5F.c
./src/H5G.c
./src/H5Sselect.c
./src/H5T.c
./src/H5TB.c
./src/H5Z.c
Accidently modified these when working on the tracing, but
nothing should have changed.
./src/H5P.c
Changed the definition of H5Pset_chunk() for tracing.
./src/H5S.c
./src/H5Spublic.h
Changed the definitions of H5Sset_extent_simple() and
H5Screate_simple() for tracing. Changed the FUNC_ENTER() name
for H5Screate_simple() so tracing shows the correct name.
1998-07-22 21:51:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
1998-06-06 05:03:49 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: list_attr
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Prints information about attributes.
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: 0
|
|
|
|
|
*
|
|
|
|
|
* Failure: -1
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Friday, June 5, 1998
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
|
|
|
|
list_attr (hid_t obj, const char *attr_name, void __unused__ *op_data)
|
|
|
|
|
{
|
|
|
|
|
hid_t attr;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
printf ("%*s%s", 26, "", attr_name);
|
|
|
|
|
if ((attr = H5Aopen_name (obj, attr_name))) {
|
|
|
|
|
hid_t space = H5Aget_space (attr);
|
|
|
|
|
hsize_t size[64];
|
1998-07-15 05:14:22 +08:00
|
|
|
|
int ndims = H5Sextent_dims (space, size, NULL);
|
1998-06-06 05:03:49 +08:00
|
|
|
|
H5Sclose (space);
|
|
|
|
|
printf (" {");
|
|
|
|
|
for (i=0; i<ndims; i++) {
|
|
|
|
|
HDfprintf (stdout, "%s%Hu", i?", ":"", size[i]);
|
|
|
|
|
}
|
|
|
|
|
putchar ('}');
|
|
|
|
|
H5Aclose (attr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
putchar ('\n');
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
1998-05-14 01:58:24 +08:00
|
|
|
|
|
1998-03-25 07:18:34 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: list
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Prints the group member name.
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: 0
|
|
|
|
|
*
|
|
|
|
|
* Failure: -1
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Monday, March 23, 1998
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
1998-04-09 05:43:02 +08:00
|
|
|
|
list (hid_t group, const char *name, void __unused__ *op_data)
|
1998-03-25 07:18:34 +08:00
|
|
|
|
{
|
|
|
|
|
hid_t obj;
|
|
|
|
|
hid_t (*func)(void*);
|
|
|
|
|
void *edata;
|
|
|
|
|
int i;
|
1998-07-21 05:01:32 +08:00
|
|
|
|
char buf[512], comment[50];
|
1998-04-15 00:44:46 +08:00
|
|
|
|
H5G_stat_t statbuf;
|
1998-07-30 00:43:59 +08:00
|
|
|
|
struct tm *tm;
|
1998-04-15 00:44:46 +08:00
|
|
|
|
|
1998-03-25 07:18:34 +08:00
|
|
|
|
/* Disable error reporting */
|
|
|
|
|
H5Eget_auto (&func, &edata);
|
|
|
|
|
H5Eset_auto (NULL, NULL);
|
|
|
|
|
|
|
|
|
|
/* Print info about each name */
|
1998-04-18 05:29:43 +08:00
|
|
|
|
printf ("%-25s ", name);
|
1998-04-15 00:44:46 +08:00
|
|
|
|
|
1998-03-25 07:18:34 +08:00
|
|
|
|
if ((obj=H5Dopen (group, name))>=0) {
|
1998-04-09 05:43:02 +08:00
|
|
|
|
hsize_t size[64];
|
1998-06-19 23:26:36 +08:00
|
|
|
|
hsize_t maxsize[64];
|
1998-03-25 07:18:34 +08:00
|
|
|
|
hid_t space = H5Dget_space (obj);
|
1998-07-15 05:14:22 +08:00
|
|
|
|
int ndims = H5Sextent_dims(space, size, maxsize);
|
1998-04-18 05:29:43 +08:00
|
|
|
|
printf ("Dataset {");
|
1998-03-25 07:18:34 +08:00
|
|
|
|
for (i=0; i<ndims; i++) {
|
1998-07-18 03:03:43 +08:00
|
|
|
|
HDfprintf (stdout, "%s%Hu", i?", ":"", size[i]);
|
|
|
|
|
if (maxsize[i]==H5S_UNLIMITED) {
|
1998-06-19 23:26:36 +08:00
|
|
|
|
HDfprintf (stdout, "/%s", "Inf");
|
1998-07-18 03:03:43 +08:00
|
|
|
|
} else if (maxsize[i]!=size[i] || verbose_g>0) {
|
|
|
|
|
HDfprintf(stdout, "/%Hu", maxsize[i]);
|
|
|
|
|
}
|
1998-03-25 07:18:34 +08:00
|
|
|
|
}
|
|
|
|
|
printf ("}\n");
|
|
|
|
|
H5Dclose (space);
|
1998-06-06 05:03:49 +08:00
|
|
|
|
H5Aiterate (obj, NULL, list_attr, NULL);
|
1998-03-25 07:18:34 +08:00
|
|
|
|
H5Dclose (obj);
|
|
|
|
|
} else if ((obj=H5Gopen (group, name))>=0) {
|
1998-04-18 05:29:43 +08:00
|
|
|
|
printf ("Group\n");
|
1998-06-06 05:03:49 +08:00
|
|
|
|
H5Aiterate (obj, NULL, list_attr, NULL);
|
1998-03-25 07:18:34 +08:00
|
|
|
|
H5Gclose (obj);
|
1998-04-18 05:29:43 +08:00
|
|
|
|
} else if (H5Gget_linkval (group, name, sizeof(buf), buf)>=0) {
|
|
|
|
|
if (NULL==HDmemchr (buf, 0, sizeof(buf))) {
|
|
|
|
|
strcpy (buf+sizeof(buf)-4, "...");
|
1998-04-15 00:44:46 +08:00
|
|
|
|
}
|
1998-04-18 05:29:43 +08:00
|
|
|
|
printf (" -> %s\n", buf);
|
1998-06-05 06:27:11 +08:00
|
|
|
|
} else if ((obj=H5Topen (group, name))>=0) {
|
|
|
|
|
printf ("Data type\n");
|
1998-06-06 05:03:49 +08:00
|
|
|
|
H5Aiterate (obj, NULL, list_attr, NULL);
|
1998-06-05 06:27:11 +08:00
|
|
|
|
H5Tclose (obj);
|
1998-03-25 07:18:34 +08:00
|
|
|
|
} else {
|
1998-04-18 05:29:43 +08:00
|
|
|
|
printf ("Unknown Type\n");
|
1998-03-25 07:18:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
1998-07-30 00:43:59 +08:00
|
|
|
|
if (verbose_g>0) {
|
|
|
|
|
if (H5Gstat(group, name, TRUE, &statbuf)>=0) {
|
|
|
|
|
printf(" %-10s %lu:%lu:%lu:%lu\n",
|
|
|
|
|
"Location:", statbuf.fileno[1], statbuf.fileno[0],
|
|
|
|
|
statbuf.objno[1], statbuf.objno[0]);
|
|
|
|
|
if (statbuf.mtime>0 && NULL!=(tm = localtime(&(statbuf.mtime)))) {
|
|
|
|
|
strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm);
|
|
|
|
|
printf(" %-10s %s\n", "Modtime:", buf);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Display the comment if the object has one */
|
|
|
|
|
comment[0] = '\0';
|
|
|
|
|
H5Gget_comment(group, name, sizeof(comment), comment);
|
|
|
|
|
strcpy(comment+sizeof(comment)-4, "...");
|
|
|
|
|
if (comment[0]) printf(" %-10s %s\n", "Comment:", comment);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (dump_g && (obj=H5Dopen(group, name))) {
|
|
|
|
|
/* Turn on error reporting before dumping the data */
|
|
|
|
|
H5Eset_auto(func, edata);
|
|
|
|
|
dump_dataset_values(obj);
|
|
|
|
|
H5Dclose(obj);
|
|
|
|
|
}
|
1998-07-21 05:01:32 +08:00
|
|
|
|
|
1998-03-25 07:18:34 +08:00
|
|
|
|
/* Restore error reporting */
|
|
|
|
|
H5Eset_auto (func, edata);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: main
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Opens a file and lists the specified group
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: 0
|
|
|
|
|
*
|
|
|
|
|
* Failure: 1
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Monday, March 23, 1998
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
int
|
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
|
{
|
1998-04-09 05:43:02 +08:00
|
|
|
|
hid_t file, plist=H5P_DEFAULT;
|
|
|
|
|
const char *fname = NULL;
|
|
|
|
|
const char *gname = "/";
|
1998-05-14 01:58:24 +08:00
|
|
|
|
const char *progname;
|
1998-07-18 03:03:43 +08:00
|
|
|
|
const char *s;
|
[svn-r537] Changes since 19980722
----------------------
./src/H5A.c
./src/H5Apublic.h
./test/tattr.c
Switched the order of the second and third argument of
H5Aget_name() to make it consistent with other functions that
take buffers and buffer sizes.
./src/H5G.c
./src/H5Gpublic.h
./src/H5Gprivate.h
The H5Gget_comment() function returns the size of the comment
including the null terminator. If the object has no comment
then zero is returned. If an error occurs then a negative
value is returned.
./MANIFEST
./tools/Makefile.in
./tools/h5tools.h [NEW]
./tools/h5dump.c [NEW]
Created a library for printing values of datasets in a way
that looks nice. It's not done yet, but I needed it for
debugging the contents of files from Jim Reus.
./tools/h5ls.c
Added the `-d' and `--dump' options which cause the contents
of a dataset to be printed. Added `-w N' and `--width=N'
options to control how wide the raw data output should be. If
you want single-column output then say `-w1'.
Printing dataset values can now handle datasets of any integer
or floating point atomic type. As a special case, integers
which are one byte wide are treated a character strings for
now.
Sample output:
$ h5ls --dump --width=60 banana.hdf
ARCHIVE 0:0:0:744 Dataset {52/Inf}
Data:
(0) "U struct complex { double R; double I; };\012V"
(43) " double;\012"
U 0:0:0:2500 Dataset {256/512}
Data: printing of compound data types is not implemented yet
V 0:0:0:3928 Dataset {256/512}
Data:
(0) 0, 0.015625, 0.03125, 0.046875, 0.0625,
(5) 0.078125, 0.09375, 0.109375, 0.125, 0.140625,
(10) 0.15625, 0.171875, 0.1875, 0.203125, 0.21875,
(15) 0.234375, 0.25, 0.265625, 0.28125, 0.296875,
...
1998-07-24 05:19:17 +08:00
|
|
|
|
char *rest;
|
1998-07-18 03:03:43 +08:00
|
|
|
|
int argno;
|
1998-05-14 01:58:24 +08:00
|
|
|
|
|
1998-07-18 03:03:43 +08:00
|
|
|
|
/* Name of this program without the path */
|
1998-05-14 01:58:24 +08:00
|
|
|
|
if ((progname=strrchr (argv[0], '/'))) progname++;
|
|
|
|
|
else progname = argv[0];
|
1998-07-18 03:03:43 +08:00
|
|
|
|
|
|
|
|
|
/* Switches come before non-switch arguments */
|
|
|
|
|
for (argno=1; argno<argc && '-'==argv[argno][0]; argno++) {
|
|
|
|
|
if (!strcmp(argv[argno], "--")) {
|
|
|
|
|
/* Last switch */
|
|
|
|
|
argno++;
|
|
|
|
|
break;
|
|
|
|
|
} else if (!strcmp(argv[argno], "--help")) {
|
|
|
|
|
usage(progname);
|
|
|
|
|
exit(0);
|
[svn-r537] Changes since 19980722
----------------------
./src/H5A.c
./src/H5Apublic.h
./test/tattr.c
Switched the order of the second and third argument of
H5Aget_name() to make it consistent with other functions that
take buffers and buffer sizes.
./src/H5G.c
./src/H5Gpublic.h
./src/H5Gprivate.h
The H5Gget_comment() function returns the size of the comment
including the null terminator. If the object has no comment
then zero is returned. If an error occurs then a negative
value is returned.
./MANIFEST
./tools/Makefile.in
./tools/h5tools.h [NEW]
./tools/h5dump.c [NEW]
Created a library for printing values of datasets in a way
that looks nice. It's not done yet, but I needed it for
debugging the contents of files from Jim Reus.
./tools/h5ls.c
Added the `-d' and `--dump' options which cause the contents
of a dataset to be printed. Added `-w N' and `--width=N'
options to control how wide the raw data output should be. If
you want single-column output then say `-w1'.
Printing dataset values can now handle datasets of any integer
or floating point atomic type. As a special case, integers
which are one byte wide are treated a character strings for
now.
Sample output:
$ h5ls --dump --width=60 banana.hdf
ARCHIVE 0:0:0:744 Dataset {52/Inf}
Data:
(0) "U struct complex { double R; double I; };\012V"
(43) " double;\012"
U 0:0:0:2500 Dataset {256/512}
Data: printing of compound data types is not implemented yet
V 0:0:0:3928 Dataset {256/512}
Data:
(0) 0, 0.015625, 0.03125, 0.046875, 0.0625,
(5) 0.078125, 0.09375, 0.109375, 0.125, 0.140625,
(10) 0.15625, 0.171875, 0.1875, 0.203125, 0.21875,
(15) 0.234375, 0.25, 0.265625, 0.28125, 0.296875,
...
1998-07-24 05:19:17 +08:00
|
|
|
|
} else if (!strcmp(argv[argno], "--dump")) {
|
|
|
|
|
dump_g++;
|
|
|
|
|
} else if (!strncmp(argv[argno], "--width=", 8)) {
|
|
|
|
|
width_g = strtol(argv[argno]+8, &rest, 0);
|
|
|
|
|
if (width_g<=0 || *rest) {
|
|
|
|
|
usage(progname);
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
1998-07-18 03:03:43 +08:00
|
|
|
|
} else if (!strcmp(argv[argno], "--verbose")) {
|
|
|
|
|
verbose_g++;
|
|
|
|
|
} else if (!strcmp(argv[argno], "--version")) {
|
|
|
|
|
printf("This is %s version %u.%u release %u\n",
|
|
|
|
|
progname, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE);
|
|
|
|
|
exit(0);
|
[svn-r537] Changes since 19980722
----------------------
./src/H5A.c
./src/H5Apublic.h
./test/tattr.c
Switched the order of the second and third argument of
H5Aget_name() to make it consistent with other functions that
take buffers and buffer sizes.
./src/H5G.c
./src/H5Gpublic.h
./src/H5Gprivate.h
The H5Gget_comment() function returns the size of the comment
including the null terminator. If the object has no comment
then zero is returned. If an error occurs then a negative
value is returned.
./MANIFEST
./tools/Makefile.in
./tools/h5tools.h [NEW]
./tools/h5dump.c [NEW]
Created a library for printing values of datasets in a way
that looks nice. It's not done yet, but I needed it for
debugging the contents of files from Jim Reus.
./tools/h5ls.c
Added the `-d' and `--dump' options which cause the contents
of a dataset to be printed. Added `-w N' and `--width=N'
options to control how wide the raw data output should be. If
you want single-column output then say `-w1'.
Printing dataset values can now handle datasets of any integer
or floating point atomic type. As a special case, integers
which are one byte wide are treated a character strings for
now.
Sample output:
$ h5ls --dump --width=60 banana.hdf
ARCHIVE 0:0:0:744 Dataset {52/Inf}
Data:
(0) "U struct complex { double R; double I; };\012V"
(43) " double;\012"
U 0:0:0:2500 Dataset {256/512}
Data: printing of compound data types is not implemented yet
V 0:0:0:3928 Dataset {256/512}
Data:
(0) 0, 0.015625, 0.03125, 0.046875, 0.0625,
(5) 0.078125, 0.09375, 0.109375, 0.125, 0.140625,
(10) 0.15625, 0.171875, 0.1875, 0.203125, 0.21875,
(15) 0.234375, 0.25, 0.265625, 0.28125, 0.296875,
...
1998-07-24 05:19:17 +08:00
|
|
|
|
} else if (!strncmp(argv[argno], "-w", 2)) {
|
|
|
|
|
if (argv[argno][2]) {
|
|
|
|
|
s = argv[argno]+2;
|
|
|
|
|
} else if (argno+1>=argc) {
|
|
|
|
|
usage(progname);
|
|
|
|
|
exit(1);
|
|
|
|
|
} else {
|
|
|
|
|
s = argv[++argno];
|
|
|
|
|
}
|
|
|
|
|
width_g = strtol(s, &rest, 0);
|
|
|
|
|
if (width_g<=0 || *rest) {
|
|
|
|
|
usage(progname);
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
1998-07-18 03:03:43 +08:00
|
|
|
|
} else if ('-'!=argv[argno][1]) {
|
|
|
|
|
/* Single-letter switches */
|
|
|
|
|
for (s=argv[argno]+1; *s; s++) {
|
|
|
|
|
switch (*s) {
|
|
|
|
|
case '?':
|
|
|
|
|
case 'h': /* --help */
|
|
|
|
|
usage(progname);
|
|
|
|
|
exit(0);
|
[svn-r537] Changes since 19980722
----------------------
./src/H5A.c
./src/H5Apublic.h
./test/tattr.c
Switched the order of the second and third argument of
H5Aget_name() to make it consistent with other functions that
take buffers and buffer sizes.
./src/H5G.c
./src/H5Gpublic.h
./src/H5Gprivate.h
The H5Gget_comment() function returns the size of the comment
including the null terminator. If the object has no comment
then zero is returned. If an error occurs then a negative
value is returned.
./MANIFEST
./tools/Makefile.in
./tools/h5tools.h [NEW]
./tools/h5dump.c [NEW]
Created a library for printing values of datasets in a way
that looks nice. It's not done yet, but I needed it for
debugging the contents of files from Jim Reus.
./tools/h5ls.c
Added the `-d' and `--dump' options which cause the contents
of a dataset to be printed. Added `-w N' and `--width=N'
options to control how wide the raw data output should be. If
you want single-column output then say `-w1'.
Printing dataset values can now handle datasets of any integer
or floating point atomic type. As a special case, integers
which are one byte wide are treated a character strings for
now.
Sample output:
$ h5ls --dump --width=60 banana.hdf
ARCHIVE 0:0:0:744 Dataset {52/Inf}
Data:
(0) "U struct complex { double R; double I; };\012V"
(43) " double;\012"
U 0:0:0:2500 Dataset {256/512}
Data: printing of compound data types is not implemented yet
V 0:0:0:3928 Dataset {256/512}
Data:
(0) 0, 0.015625, 0.03125, 0.046875, 0.0625,
(5) 0.078125, 0.09375, 0.109375, 0.125, 0.140625,
(10) 0.15625, 0.171875, 0.1875, 0.203125, 0.21875,
(15) 0.234375, 0.25, 0.265625, 0.28125, 0.296875,
...
1998-07-24 05:19:17 +08:00
|
|
|
|
case 'd': /* --dump */
|
|
|
|
|
dump_g++;
|
|
|
|
|
break;
|
1998-07-18 03:03:43 +08:00
|
|
|
|
case 'v': /* --verbose */
|
|
|
|
|
verbose_g++;
|
|
|
|
|
break;
|
|
|
|
|
case 'V': /* --version */
|
|
|
|
|
printf("This is %s version %u.%u release %u\n",
|
|
|
|
|
progname, H5_VERS_MAJOR, H5_VERS_MINOR,
|
|
|
|
|
H5_VERS_RELEASE);
|
|
|
|
|
exit(0);
|
|
|
|
|
default:
|
|
|
|
|
usage(progname);
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
usage(progname);
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
1998-03-25 07:18:34 +08:00
|
|
|
|
|
1998-07-18 03:03:43 +08:00
|
|
|
|
/* Non-switch arguments */
|
|
|
|
|
if (argno<argc) {
|
|
|
|
|
fname = argv[argno++];
|
|
|
|
|
} else {
|
|
|
|
|
usage(progname);
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
if (argno<argc) gname = argv[argno++];
|
|
|
|
|
if (argno<argc) {
|
|
|
|
|
usage(progname);
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
|
1998-04-09 05:43:02 +08:00
|
|
|
|
/*
|
|
|
|
|
* Open the file. If the file name contains a `%' then assume that a
|
|
|
|
|
* file family is being opened.
|
|
|
|
|
*/
|
|
|
|
|
if (strchr (fname, '%')) {
|
|
|
|
|
plist = H5Pcreate (H5P_FILE_ACCESS);
|
[svn-r339] Changes since 19980408
----------------------
./src/H5Osdspace.c
./html/H5.format.html
In the past we were allowed to have >2GB files on a 32-bit
machine as long as no dataset within the file was larger than
4GB (or whatever sizeof(size_t) is). That's been fixed now.
All dataset size calculations are done with `hsize_t' which is
normally defined as `unsigned long long'.
./src/H5F.c
./src/H5Ffamily.c
./src/H5Fprivate.h
./src/H5P.c
./src/H5Ppublic.h
The file family member size can now be set/queried. The
default is still 64MB, but it can be set to 1GB by saying:
H5Pset_family (plist, 30, H5P_DEFAULT);
When opening an existing file family the specified
bits-per-member is ignored and the first member of the family
determines the bits-per-member, which can be retrieved with
H5Pget_family().
./acconfig.h
./configure.in
./src/H5config.h
./src/H5public.h
Added `--disable-hsizet' so that those with old GCC compilers
(<2.8.1) can still compile the code.
./src/H5.c
./src/H5private.h
Added HDfprintf() which works just like fprintf() except you
can give `H' as a size modifier for the integer conversions
and supply an `hsize_t' or `hssize_t' argument without casting
it. For instance:
hsize_t npoints = H5Sget_npoints(space);
HDfprintf(stdout,"Dataset has %Hd (%#018Hx) points\n",
npoints, npoints);
You can now give `%a' as a format to print an address, but all
formating flags are ignored and it causes the return value of
HDfprintf() to not include the characters in the address (but
who uses the return value anyway :-). Example:
H5G_t *grp;
HDfprintf(stdout, "Group object header at %a\n",
&(grp->ent.header));
Added HDstrtoll() which works exactly like [HD]strtol() except
the result is an int64.
./src/debug.c
Large addresses can now be entered from the command-line. Use
either decimal, octal (leading `0') or hexadecimal (leading
`0x') when giving the address.
./src/h5ls.c
The printf format for dataset dimensions was changed to `%Hu'
to support large datasets.
./test/big.c [NEW]
A test for big datasets on 32-bit machines. This test is not
run by default. Don't try to run it on an nfs-mounted file
system or other file system that doesn't support holes because
it creates two 32GB datasets of all zero.
1998-04-10 04:22:11 +08:00
|
|
|
|
H5Pset_family (plist, 0, H5P_DEFAULT);
|
1998-04-09 05:43:02 +08:00
|
|
|
|
}
|
1998-05-14 01:58:24 +08:00
|
|
|
|
if ((file = H5Fopen (fname, H5F_ACC_RDONLY, plist))<0) exit (1);
|
|
|
|
|
if (H5Giterate (file, gname, NULL, list, NULL)<0) exit (1);
|
|
|
|
|
if (H5Fclose (file)<0) exit (1);
|
1998-03-25 07:18:34 +08:00
|
|
|
|
return 0;
|
|
|
|
|
}
|