summaryrefslogtreecommitdiffstats
path: root/tools/h5tools.h
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1999-09-30 16:14:14 (GMT)
committerRobb Matzke <matzke@llnl.gov>1999-09-30 16:14:14 (GMT)
commitbdf0dbf7ed9a671cf915de65006ae5a5379c6941 (patch)
tree2117c72f7f589bd030d32dbc398c836e8a4524c8 /tools/h5tools.h
parent03d438979b7bc6a08d25d121676bbd2083254c80 (diff)
downloadhdf5-bdf0dbf7ed9a671cf915de65006ae5a5379c6941.zip
hdf5-bdf0dbf7ed9a671cf915de65006ae5a5379c6941.tar.gz
hdf5-bdf0dbf7ed9a671cf915de65006ae5a5379c6941.tar.bz2
[svn-r1697] Changes since 19990915
---------------------- ./src/H5public.h We undefine a bunch of things that could get redefined in the config file because some customers have applications that include headers from multiple packages, all of which might be using autoconf. Include <stdint.h> for the C9x types. ./test/h5test.h More flushing of stdout for when testing is redirected down a pipe. ./tools/h5ls.c Added a `-S' or `--simple' switch which causes the output to be simplified somewhat for easier parsing by other scripts. For instance, characters are escaped using a very simple mechanism instead of C's more complicated backslash notation, data doesn't have `{}' or `[]' characters interspersed for compound and array types, and data is printed with exactly one element per line. This switch is now used by an HDF5-to-HTML CGI script being developed for the DMF people. ./tools/h5tools.c ./tools/h5tools.h The repeat threshold which controls how strings are printed when a character repeats a bunch of times is now settable at runtime instead of compile time. The default is to show all characters, like "abceeeeeeeeeeeeeeeeeeeeeeeeeeeeeefgh" But if you set it to something like 5 then any sequence of 5 or more characters is replaced by something shorter, like: "abc" 'e'x30 "fgh" or Added an `str_locale' property which describes how to escape special characters in strings. The default is C-like escapes but an alternative is ESCAPE_HTML which replaces all non-alphanumeric characters with a 3-character HTML escape of the form `%XX' Fixed a bug where empty strings didn't even have the quote characters printed. Now empty strings show up as `""' instead of absolutely nothing. Added a `per_line' property which controls the maximum number of elements which will appear per line of output. The default is infinity but in practice the right margin causes line breaks. By setting the `per_line' value to one and the right margin to a very large value one can achieve output with exactly one element per line.
Diffstat (limited to 'tools/h5tools.h')
-rw-r--r--tools/h5tools.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/tools/h5tools.h b/tools/h5tools.h
index da63be0..d962cee 100644
--- a/tools/h5tools.h
+++ b/tools/h5tools.h
@@ -13,6 +13,8 @@
#include <hdf5.h>
#include <stdio.h>
+#define ESCAPE_HTML 1
+
/*
* Information about how to format output.
*/
@@ -77,6 +79,15 @@ typedef struct h5dump_t {
* escape. If `ascii' is zero then then 1-byte integers are
* printed as numeric values. The default is zero.
*
+ * str_locale: Determines how strings are printed. If zero then strings
+ * are printed like in C except. If set to ESCAPE_HTML then
+ * strings are printed using HTML encoding where each
+ * character not in the class [a-zA-Z0-9] is substituted
+ * with `%XX' where `X' is a hexadecimal digit.
+ *
+ * str_repeat: If set to non-zero then any character value repeated N
+ * or more times is printed as 'C'*N
+ *
* Numeric data is also subject to the formats for individual elements.
*/
hbool_t raw;
@@ -94,6 +105,8 @@ typedef struct h5dump_t {
const char *fmt_double;
const char *fmt_float;
int ascii;
+ int str_locale;
+ int str_repeat;
/*
* Fields associated with compound array members.
@@ -178,7 +191,10 @@ typedef struct h5dump_t {
/*
* Fields associated with entire lines.
*
- * ncols: Number of columns per line defaults to 80.
+ * ncols: Number of columns per line defaults to 80.
+ *
+ * per_line: If this field has a positive value then every Nth element
+ * will be printed at the beginning of a line.
*
* pre: Each line of output contains an optional prefix area
* before the data. This area can contain the index for the
@@ -224,6 +240,7 @@ typedef struct h5dump_t {
* unless it wouldn't fit.
*/
int line_ncols; /*columns of output */
+ size_t line_per_line; /*max elements per line */
const char *line_pre; /*prefix at front of each line */
const char *line_1st; /*alternate pre. on first line */
const char *line_cont; /*alternate pre. on continuation*/