summaryrefslogtreecommitdiffstats
path: root/tools/h5dump
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5dump')
-rw-r--r--tools/h5dump/h5dump.c182
-rw-r--r--tools/h5dump/h5dump_xml.c18
2 files changed, 100 insertions, 100 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index ac9d1d3..80351d1 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -231,34 +231,34 @@ static void
usage(const char *prog)
{
fflush(stdout);
- fprintf(stdout, "usage: %s [OPTIONS] file\n", prog);
- fprintf(stdout, " OPTIONS\n");
- fprintf(stdout, " -h, --help Print a usage message and exit\n");
- fprintf(stdout, " -n, --contents Print a list of the file contents and exit\n");
- fprintf(stdout, " -B, --superblock Print the content of the super block\n");
- fprintf(stdout, " -H, --header Print the header only; no data is displayed\n");
- fprintf(stdout, " -A, --onlyattr Print the header and value of attributes\n");
- fprintf(stdout, " -i, --object-ids Print the object ids\n");
- fprintf(stdout, " -r, --string Print 1-byte integer datasets as ASCII\n");
- fprintf(stdout, " -e, --escape Escape non printing characters\n");
- fprintf(stdout, " -V, --version Print version number and exit\n");
- fprintf(stdout, " -a P, --attribute=P Print the specified attribute\n");
- fprintf(stdout, " -d P, --dataset=P Print the specified dataset\n");
- fprintf(stdout, " -y, --noindex Do not print array indices with the data\n");
- fprintf(stdout, " -p, --properties Print dataset filters, storage layout and fill value\n");
- fprintf(stdout, " -f D, --filedriver=D Specify which driver to open the file with\n");
- fprintf(stdout, " -g P, --group=P Print the specified group and all members\n");
- fprintf(stdout, " -l P, --soft-link=P Print the value(s) of the specified soft link\n");
- fprintf(stdout, " -o F, --output=F Output raw data into file F\n");
- fprintf(stdout, " -b B, --binary=B Binary file output, of form B\n");
- fprintf(stdout, " -t P, --datatype=P Print the specified named datatype\n");
- fprintf(stdout, " -w N, --width=N Set the number of columns of output. A value of 0 (zero)\n");
- fprintf(stdout, " sets the number of columns to the maximum (65535).\n");
- fprintf(stdout, " Default width is 80 columns.\n");
- fprintf(stdout, " -m T, --format=T Set the floating point output format\n");
- fprintf(stdout, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n");
- fprintf(stdout, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n");
- fprintf(stdout,
+ HDfprintf(stdout, "usage: %s [OPTIONS] file\n", prog);
+ HDfprintf(stdout, " OPTIONS\n");
+ HDfprintf(stdout, " -h, --help Print a usage message and exit\n");
+ HDfprintf(stdout, " -n, --contents Print a list of the file contents and exit\n");
+ HDfprintf(stdout, " -B, --superblock Print the content of the super block\n");
+ HDfprintf(stdout, " -H, --header Print the header only; no data is displayed\n");
+ HDfprintf(stdout, " -A, --onlyattr Print the header and value of attributes\n");
+ HDfprintf(stdout, " -i, --object-ids Print the object ids\n");
+ HDfprintf(stdout, " -r, --string Print 1-byte integer datasets as ASCII\n");
+ HDfprintf(stdout, " -e, --escape Escape non printing characters\n");
+ HDfprintf(stdout, " -V, --version Print version number and exit\n");
+ HDfprintf(stdout, " -a P, --attribute=P Print the specified attribute\n");
+ HDfprintf(stdout, " -d P, --dataset=P Print the specified dataset\n");
+ HDfprintf(stdout, " -y, --noindex Do not print array indices with the data\n");
+ HDfprintf(stdout, " -p, --properties Print dataset filters, storage layout and fill value\n");
+ HDfprintf(stdout, " -f D, --filedriver=D Specify which driver to open the file with\n");
+ HDfprintf(stdout, " -g P, --group=P Print the specified group and all members\n");
+ HDfprintf(stdout, " -l P, --soft-link=P Print the value(s) of the specified soft link\n");
+ HDfprintf(stdout, " -o F, --output=F Output raw data into file F\n");
+ HDfprintf(stdout, " -b B, --binary=B Binary file output, of form B\n");
+ HDfprintf(stdout, " -t P, --datatype=P Print the specified named datatype\n");
+ HDfprintf(stdout, " -w N, --width=N Set the number of columns of output. A value of 0 (zero)\n");
+ HDfprintf(stdout, " sets the number of columns to the maximum (65535).\n");
+ HDfprintf(stdout, " Default width is 80 columns.\n");
+ HDfprintf(stdout, " -m T, --format=T Set the floating point output format\n");
+ HDfprintf(stdout, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n");
+ HDfprintf(stdout, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n");
+ HDfprintf(stdout,
" -M L, --packedbits=L Print packed bits as unsigned integers, using mask\n"
" format L for an integer dataset specified with\n"
" option -d. L is a list of offset,length values,\n"
@@ -266,69 +266,69 @@ usage(const char *prog)
" the data value and length is the number of bits of\n"
" the mask.\n"
);
- fprintf(stdout, " -R, --region Print dataset pointed by region references\n");
- fprintf(stdout, " -x, --xml Output in XML using Schema\n");
- fprintf(stdout, " -u, --use-dtd Output in XML using DTD\n");
- fprintf(stdout, " -D U, --xml-dtd=U Use the DTD or schema at U\n");
- fprintf(stdout, " -X S, --xml-ns=S (XML Schema) Use qualified names n the XML\n");
- fprintf(stdout, " \":\": no namespace, default: \"hdf5:\"\n");
- fprintf(stdout, " E.g., to dump a file called `-f', use h5dump -- -f\n");
- fprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they\n");
- fprintf(stdout, " occur.\n");
- fprintf(stdout, " --no-compact-subset Disable compact form of subsetting and allow the use\n");
- fprintf(stdout, " of \"[\" in datset names.\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " Subsetting is available by using the following options with a dataset\n");
- fprintf(stdout, " attribute. Subsetting is done by selecting a hyperslab from the data.\n");
- fprintf(stdout, " Thus, the options mirror those for performing a hyperslab selection.\n");
- fprintf(stdout, " One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting.\n");
- fprintf(stdout, " The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in\n");
- fprintf(stdout, " each dimension. START is optional and will default to 0 in each dimension.\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " -s START, --start=START Offset of start of subsetting selection\n");
- fprintf(stdout, " -S STRIDE, --stride=STRIDE Hyperslab stride\n");
- fprintf(stdout, " -c COUNT, --count=COUNT Number of blocks to include in selection\n");
- fprintf(stdout, " -k BLOCK, --block=BLOCK Size of block in hyperslab\n");
- fprintf(stdout, " START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the\n");
- fprintf(stdout, " number of dimensions in the dataspace being queried\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " D - is the file driver to use in opening the file. Acceptable values\n");
- fprintf(stdout, " are \"sec2\", \"family\", \"split\", \"multi\", \"direct\", and \"stream\". Without\n");
- fprintf(stdout, " the file driver flag, the file will be opened with each driver in\n");
- fprintf(stdout, " turn and in the order specified above until one driver succeeds\n");
- fprintf(stdout, " in opening the file.\n");
- fprintf(stdout, " F - is a filename.\n");
- fprintf(stdout, " P - is the full path from the root group to the object.\n");
- fprintf(stdout, " N - is an integer greater than 1.\n");
- fprintf(stdout, " T - is a string containing the floating point format, e.g '%%.3f'\n");
- fprintf(stdout, " U - is a URI reference (as defined in [IETF RFC 2396],\n");
- fprintf(stdout, " updated by [IETF RFC 2732])\n");
- fprintf(stdout, " B - is the form of binary output: NATIVE for a memory type, FILE for the\n");
- fprintf(stdout, " file type, LE or BE for pre-existing little or big endian types.\n");
- fprintf(stdout, " Must be used with -o (output file) and it is recommended that\n");
- fprintf(stdout, " -d (dataset) is used. B is an optional argument, defaults to NATIVE\n");
- fprintf(stdout, " Q - is the sort index type. It can be \"creation_order\" or \"name\" (default)\n");
- fprintf(stdout, " Z - is the sort order type. It can be \"descending\" or \"ascending\" (default)\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " Examples:\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " 1) Attribute foo of the group /bar_none in file quux.h5\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " h5dump -a /bar_none/foo quux.h5\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " 2) Selecting a subset from dataset /foo in file quux.h5\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " h5dump -d /foo -s \"0,1\" -S \"1,1\" -c \"2,3\" -k \"2,2\" quux.h5\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin'\n");
- fprintf(stdout, " using a little-endian type\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " h5dump -d /dset -b LE -o out.bin quux.h5\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " h5dump -d /dset -M 0,1,4,3 quux.h5\n");
- fprintf(stdout, "\n");
+ HDfprintf(stdout, " -R, --region Print dataset pointed by region references\n");
+ HDfprintf(stdout, " -x, --xml Output in XML using Schema\n");
+ HDfprintf(stdout, " -u, --use-dtd Output in XML using DTD\n");
+ HDfprintf(stdout, " -D U, --xml-dtd=U Use the DTD or schema at U\n");
+ HDfprintf(stdout, " -X S, --xml-ns=S (XML Schema) Use qualified names n the XML\n");
+ HDfprintf(stdout, " \":\": no namespace, default: \"hdf5:\"\n");
+ HDfprintf(stdout, " E.g., to dump a file called `-f', use h5dump -- -f\n");
+ HDfprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they\n");
+ HDfprintf(stdout, " occur.\n");
+ HDfprintf(stdout, " --no-compact-subset Disable compact form of subsetting and allow the use\n");
+ HDfprintf(stdout, " of \"[\" in datset names.\n");
+ HDfprintf(stdout, "\n");
+ HDfprintf(stdout, " Subsetting is available by using the following options with a dataset\n");
+ HDfprintf(stdout, " attribute. Subsetting is done by selecting a hyperslab from the data.\n");
+ HDfprintf(stdout, " Thus, the options mirror those for performing a hyperslab selection.\n");
+ HDfprintf(stdout, " One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting.\n");
+ HDfprintf(stdout, " The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in\n");
+ HDfprintf(stdout, " each dimension. START is optional and will default to 0 in each dimension.\n");
+ HDfprintf(stdout, "\n");
+ HDfprintf(stdout, " -s START, --start=START Offset of start of subsetting selection\n");
+ HDfprintf(stdout, " -S STRIDE, --stride=STRIDE Hyperslab stride\n");
+ HDfprintf(stdout, " -c COUNT, --count=COUNT Number of blocks to include in selection\n");
+ HDfprintf(stdout, " -k BLOCK, --block=BLOCK Size of block in hyperslab\n");
+ HDfprintf(stdout, " START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the\n");
+ HDfprintf(stdout, " number of dimensions in the dataspace being queried\n");
+ HDfprintf(stdout, "\n");
+ HDfprintf(stdout, " D - is the file driver to use in opening the file. Acceptable values\n");
+ HDfprintf(stdout, " are \"sec2\", \"family\", \"split\", \"multi\", \"direct\", and \"stream\". Without\n");
+ HDfprintf(stdout, " the file driver flag, the file will be opened with each driver in\n");
+ HDfprintf(stdout, " turn and in the order specified above until one driver succeeds\n");
+ HDfprintf(stdout, " in opening the file.\n");
+ HDfprintf(stdout, " F - is a filename.\n");
+ HDfprintf(stdout, " P - is the full path from the root group to the object.\n");
+ HDfprintf(stdout, " N - is an integer greater than 1.\n");
+ HDfprintf(stdout, " T - is a string containing the floating point format, e.g '%%.3f'\n");
+ HDfprintf(stdout, " U - is a URI reference (as defined in [IETF RFC 2396],\n");
+ HDfprintf(stdout, " updated by [IETF RFC 2732])\n");
+ HDfprintf(stdout, " B - is the form of binary output: NATIVE for a memory type, FILE for the\n");
+ HDfprintf(stdout, " file type, LE or BE for pre-existing little or big endian types.\n");
+ HDfprintf(stdout, " Must be used with -o (output file) and it is recommended that\n");
+ HDfprintf(stdout, " -d (dataset) is used. B is an optional argument, defaults to NATIVE\n");
+ HDfprintf(stdout, " Q - is the sort index type. It can be \"creation_order\" or \"name\" (default)\n");
+ HDfprintf(stdout, " Z - is the sort order type. It can be \"descending\" or \"ascending\" (default)\n");
+ HDfprintf(stdout, "\n");
+ HDfprintf(stdout, " Examples:\n");
+ HDfprintf(stdout, "\n");
+ HDfprintf(stdout, " 1) Attribute foo of the group /bar_none in file quux.h5\n");
+ HDfprintf(stdout, "\n");
+ HDfprintf(stdout, " h5dump -a /bar_none/foo quux.h5\n");
+ HDfprintf(stdout, "\n");
+ HDfprintf(stdout, " 2) Selecting a subset from dataset /foo in file quux.h5\n");
+ HDfprintf(stdout, "\n");
+ HDfprintf(stdout, " h5dump -d /foo -s \"0,1\" -S \"1,1\" -c \"2,3\" -k \"2,2\" quux.h5\n");
+ HDfprintf(stdout, "\n");
+ HDfprintf(stdout, " 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin'\n");
+ HDfprintf(stdout, " using a little-endian type\n");
+ HDfprintf(stdout, "\n");
+ HDfprintf(stdout, " h5dump -d /dset -b LE -o out.bin quux.h5\n");
+ HDfprintf(stdout, "\n");
+ HDfprintf(stdout, " 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset\n");
+ HDfprintf(stdout, "\n");
+ HDfprintf(stdout, " h5dump -d /dset -M 0,1,4,3 quux.h5\n");
+ HDfprintf(stdout, "\n");
}
diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c
index b92ccdb..94e4d28 100644
--- a/tools/h5dump/h5dump_xml.c
+++ b/tools/h5dump/h5dump_xml.c
@@ -601,27 +601,27 @@ xml_escape_the_name(const char *str)
for (i = 0; i < len; i++) {
if (*cp == '\'') {
- strncpy(ncp, apos, HDstrlen(apos));
+ HDstrncpy(ncp, apos, HDstrlen(apos));
ncp += HDstrlen(apos);
cp++;
}
else if (*cp == '<') {
- strncpy(ncp, lt, HDstrlen(lt));
+ HDstrncpy(ncp, lt, HDstrlen(lt));
ncp += HDstrlen(lt);
cp++;
}
else if (*cp == '>') {
- strncpy(ncp, gt, HDstrlen(gt));
+ HDstrncpy(ncp, gt, HDstrlen(gt));
ncp += HDstrlen(gt);
cp++;
}
else if (*cp == '\"') {
- strncpy(ncp, quote, HDstrlen(quote));
+ HDstrncpy(ncp, quote, HDstrlen(quote));
ncp += HDstrlen(quote);
cp++;
}
else if (*cp == '&') {
- strncpy(ncp, amp, HDstrlen(amp));
+ HDstrncpy(ncp, amp, HDstrlen(amp));
ncp += HDstrlen(amp);
cp++;
}
@@ -708,22 +708,22 @@ xml_escape_the_string(const char *str, int slen)
*ncp++ = *cp++;
}
else if (*cp == '\'') {
- strncpy(ncp, apos, HDstrlen(apos));
+ HDstrncpy(ncp, apos, HDstrlen(apos));
ncp += HDstrlen(apos);
cp++;
}
else if (*cp == '<') {
- strncpy(ncp, lt, HDstrlen(lt));
+ HDstrncpy(ncp, lt, HDstrlen(lt));
ncp += HDstrlen(lt);
cp++;
}
else if (*cp == '>') {
- strncpy(ncp, gt, HDstrlen(gt));
+ HDstrncpy(ncp, gt, HDstrlen(gt));
ncp += HDstrlen(gt);
cp++;
}
else if (*cp == '&') {
- strncpy(ncp, amp, HDstrlen(amp));
+ HDstrncpy(ncp, amp, HDstrlen(amp));
ncp += HDstrlen(amp);
cp++;
}