mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
[svn-r21981] Correct HD prefix in tools for fprintf
Checked for HD support.
This commit is contained in:
parent
5b1c9ffe2d
commit
cec338c647
@ -75,7 +75,7 @@ leave(int ret)
|
|||||||
static void
|
static void
|
||||||
usage (void)
|
usage (void)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "\
|
HDfprintf(stdout, "\
|
||||||
usage: h5copy [OPTIONS] [OBJECTS...]\n\
|
usage: h5copy [OPTIONS] [OBJECTS...]\n\
|
||||||
OBJECTS\n\
|
OBJECTS\n\
|
||||||
-i, --input input file name\n\
|
-i, --input input file name\n\
|
||||||
|
@ -355,7 +355,7 @@ check_n_input( const char *str )
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
for ( i = 0; i < HDstrlen(str); i++)
|
for ( i = 0; i < strlen(str); i++)
|
||||||
{
|
{
|
||||||
c = str[i];
|
c = str[i];
|
||||||
if ( i==0 )
|
if ( i==0 )
|
||||||
@ -394,7 +394,7 @@ check_p_input( const char *str )
|
|||||||
the atof return value on a hexadecimal input is different
|
the atof return value on a hexadecimal input is different
|
||||||
on some systems; we do a character check for this
|
on some systems; we do a character check for this
|
||||||
*/
|
*/
|
||||||
if (HDstrlen(str)>2 && str[0]=='0' && str[1]=='x')
|
if (strlen(str)>2 && str[0]=='0' && str[1]=='x')
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
x=atof(str);
|
x=atof(str);
|
||||||
@ -428,7 +428,7 @@ check_d_input( const char *str )
|
|||||||
the atof return value on a hexadecimal input is different
|
the atof return value on a hexadecimal input is different
|
||||||
on some systems; we do a character check for this
|
on some systems; we do a character check for this
|
||||||
*/
|
*/
|
||||||
if (HDstrlen(str)>2 && str[0]=='0' && str[1]=='x')
|
if (strlen(str)>2 && str[0]=='0' && str[1]=='x')
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
x=atof(str);
|
x=atof(str);
|
||||||
|
@ -231,34 +231,34 @@ static void
|
|||||||
usage(const char *prog)
|
usage(const char *prog)
|
||||||
{
|
{
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
fprintf(stdout, "usage: %s [OPTIONS] file\n", prog);
|
HDfprintf(stdout, "usage: %s [OPTIONS] file\n", prog);
|
||||||
fprintf(stdout, " OPTIONS\n");
|
HDfprintf(stdout, " OPTIONS\n");
|
||||||
fprintf(stdout, " -h, --help Print a usage message and exit\n");
|
HDfprintf(stdout, " -h, --help Print a usage message and exit\n");
|
||||||
fprintf(stdout, " -n, --contents Print a list of the file contents and exit\n");
|
HDfprintf(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");
|
HDfprintf(stdout, " -B, --superblock Print the content of the super block\n");
|
||||||
fprintf(stdout, " -H, --header Print the header only; no data is displayed\n");
|
HDfprintf(stdout, " -H, --header Print the header only; no data is displayed\n");
|
||||||
fprintf(stdout, " -A, --onlyattr Print the header and value of attributes\n");
|
HDfprintf(stdout, " -A, --onlyattr Print the header and value of attributes\n");
|
||||||
fprintf(stdout, " -i, --object-ids Print the object ids\n");
|
HDfprintf(stdout, " -i, --object-ids Print the object ids\n");
|
||||||
fprintf(stdout, " -r, --string Print 1-byte integer datasets as ASCII\n");
|
HDfprintf(stdout, " -r, --string Print 1-byte integer datasets as ASCII\n");
|
||||||
fprintf(stdout, " -e, --escape Escape non printing characters\n");
|
HDfprintf(stdout, " -e, --escape Escape non printing characters\n");
|
||||||
fprintf(stdout, " -V, --version Print version number and exit\n");
|
HDfprintf(stdout, " -V, --version Print version number and exit\n");
|
||||||
fprintf(stdout, " -a P, --attribute=P Print the specified attribute\n");
|
HDfprintf(stdout, " -a P, --attribute=P Print the specified attribute\n");
|
||||||
fprintf(stdout, " -d P, --dataset=P Print the specified dataset\n");
|
HDfprintf(stdout, " -d P, --dataset=P Print the specified dataset\n");
|
||||||
fprintf(stdout, " -y, --noindex Do not print array indices with the data\n");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(stdout, " -b B, --binary=B Binary file output, of form B\n");
|
||||||
fprintf(stdout, " -t P, --datatype=P Print the specified named datatype\n");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(stdout, " sets the number of columns to the maximum (65535).\n");
|
||||||
fprintf(stdout, " Default width is 80 columns.\n");
|
HDfprintf(stdout, " Default width is 80 columns.\n");
|
||||||
fprintf(stdout, " -m T, --format=T Set the floating point output format\n");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(stdout, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n");
|
||||||
fprintf(stdout,
|
HDfprintf(stdout,
|
||||||
" -M L, --packedbits=L Print packed bits as unsigned integers, using mask\n"
|
" -M L, --packedbits=L Print packed bits as unsigned integers, using mask\n"
|
||||||
" format L for an integer dataset specified with\n"
|
" format L for an integer dataset specified with\n"
|
||||||
" option -d. L is a list of offset,length values,\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 data value and length is the number of bits of\n"
|
||||||
" the mask.\n"
|
" the mask.\n"
|
||||||
);
|
);
|
||||||
fprintf(stdout, " -R, --region Print dataset pointed by region references\n");
|
HDfprintf(stdout, " -R, --region Print dataset pointed by region references\n");
|
||||||
fprintf(stdout, " -x, --xml Output in XML using Schema\n");
|
HDfprintf(stdout, " -x, --xml Output in XML using Schema\n");
|
||||||
fprintf(stdout, " -u, --use-dtd Output in XML using DTD\n");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(stdout, " -X S, --xml-ns=S (XML Schema) Use qualified names n the XML\n");
|
||||||
fprintf(stdout, " \":\": no namespace, default: \"hdf5:\"\n");
|
HDfprintf(stdout, " \":\": no namespace, default: \"hdf5:\"\n");
|
||||||
fprintf(stdout, " E.g., to dump a file called `-f', use h5dump -- -f\n");
|
HDfprintf(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");
|
HDfprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they\n");
|
||||||
fprintf(stdout, " occur.\n");
|
HDfprintf(stdout, " occur.\n");
|
||||||
fprintf(stdout, " --no-compact-subset Disable compact form of subsetting and allow the use\n");
|
HDfprintf(stdout, " --no-compact-subset Disable compact form of subsetting and allow the use\n");
|
||||||
fprintf(stdout, " of \"[\" in datset names.\n");
|
HDfprintf(stdout, " of \"[\" in datset names.\n");
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
fprintf(stdout, " Subsetting is available by using the following options with a dataset\n");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(stdout, " each dimension. START is optional and will default to 0 in each dimension.\n");
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
fprintf(stdout, " -s START, --start=START Offset of start of subsetting selection\n");
|
HDfprintf(stdout, " -s START, --start=START Offset of start of subsetting selection\n");
|
||||||
fprintf(stdout, " -S STRIDE, --stride=STRIDE Hyperslab stride\n");
|
HDfprintf(stdout, " -S STRIDE, --stride=STRIDE Hyperslab stride\n");
|
||||||
fprintf(stdout, " -c COUNT, --count=COUNT Number of blocks to include in selection\n");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(stdout, " number of dimensions in the dataspace being queried\n");
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
fprintf(stdout, " D - is the file driver to use in opening the file. Acceptable values\n");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(stdout, " turn and in the order specified above until one driver succeeds\n");
|
||||||
fprintf(stdout, " in opening the file.\n");
|
HDfprintf(stdout, " in opening the file.\n");
|
||||||
fprintf(stdout, " F - is a filename.\n");
|
HDfprintf(stdout, " F - is a filename.\n");
|
||||||
fprintf(stdout, " P - is the full path from the root group to the object.\n");
|
HDfprintf(stdout, " P - is the full path from the root group to the object.\n");
|
||||||
fprintf(stdout, " N - is an integer greater than 1.\n");
|
HDfprintf(stdout, " N - is an integer greater than 1.\n");
|
||||||
fprintf(stdout, " T - is a string containing the floating point format, e.g '%%.3f'\n");
|
HDfprintf(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");
|
HDfprintf(stdout, " U - is a URI reference (as defined in [IETF RFC 2396],\n");
|
||||||
fprintf(stdout, " updated by [IETF RFC 2732])\n");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(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");
|
HDfprintf(stdout, " Z - is the sort order type. It can be \"descending\" or \"ascending\" (default)\n");
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
fprintf(stdout, " Examples:\n");
|
HDfprintf(stdout, " Examples:\n");
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
fprintf(stdout, " 1) Attribute foo of the group /bar_none in file quux.h5\n");
|
HDfprintf(stdout, " 1) Attribute foo of the group /bar_none in file quux.h5\n");
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
fprintf(stdout, " h5dump -a /bar_none/foo quux.h5\n");
|
HDfprintf(stdout, " h5dump -a /bar_none/foo quux.h5\n");
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
fprintf(stdout, " 2) Selecting a subset from dataset /foo in file quux.h5\n");
|
HDfprintf(stdout, " 2) Selecting a subset from dataset /foo in file quux.h5\n");
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
fprintf(stdout, " h5dump -d /foo -s \"0,1\" -S \"1,1\" -c \"2,3\" -k \"2,2\" quux.h5\n");
|
HDfprintf(stdout, " h5dump -d /foo -s \"0,1\" -S \"1,1\" -c \"2,3\" -k \"2,2\" quux.h5\n");
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
fprintf(stdout, " 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin'\n");
|
HDfprintf(stdout, " 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin'\n");
|
||||||
fprintf(stdout, " using a little-endian type\n");
|
HDfprintf(stdout, " using a little-endian type\n");
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
fprintf(stdout, " h5dump -d /dset -b LE -o out.bin quux.h5\n");
|
HDfprintf(stdout, " h5dump -d /dset -b LE -o out.bin quux.h5\n");
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
fprintf(stdout, " 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset\n");
|
HDfprintf(stdout, " 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset\n");
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
fprintf(stdout, " h5dump -d /dset -M 0,1,4,3 quux.h5\n");
|
HDfprintf(stdout, " h5dump -d /dset -M 0,1,4,3 quux.h5\n");
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -601,27 +601,27 @@ xml_escape_the_name(const char *str)
|
|||||||
|
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
if (*cp == '\'') {
|
if (*cp == '\'') {
|
||||||
strncpy(ncp, apos, HDstrlen(apos));
|
HDstrncpy(ncp, apos, HDstrlen(apos));
|
||||||
ncp += HDstrlen(apos);
|
ncp += HDstrlen(apos);
|
||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
else if (*cp == '<') {
|
else if (*cp == '<') {
|
||||||
strncpy(ncp, lt, HDstrlen(lt));
|
HDstrncpy(ncp, lt, HDstrlen(lt));
|
||||||
ncp += HDstrlen(lt);
|
ncp += HDstrlen(lt);
|
||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
else if (*cp == '>') {
|
else if (*cp == '>') {
|
||||||
strncpy(ncp, gt, HDstrlen(gt));
|
HDstrncpy(ncp, gt, HDstrlen(gt));
|
||||||
ncp += HDstrlen(gt);
|
ncp += HDstrlen(gt);
|
||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
else if (*cp == '\"') {
|
else if (*cp == '\"') {
|
||||||
strncpy(ncp, quote, HDstrlen(quote));
|
HDstrncpy(ncp, quote, HDstrlen(quote));
|
||||||
ncp += HDstrlen(quote);
|
ncp += HDstrlen(quote);
|
||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
else if (*cp == '&') {
|
else if (*cp == '&') {
|
||||||
strncpy(ncp, amp, HDstrlen(amp));
|
HDstrncpy(ncp, amp, HDstrlen(amp));
|
||||||
ncp += HDstrlen(amp);
|
ncp += HDstrlen(amp);
|
||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
@ -708,22 +708,22 @@ xml_escape_the_string(const char *str, int slen)
|
|||||||
*ncp++ = *cp++;
|
*ncp++ = *cp++;
|
||||||
}
|
}
|
||||||
else if (*cp == '\'') {
|
else if (*cp == '\'') {
|
||||||
strncpy(ncp, apos, HDstrlen(apos));
|
HDstrncpy(ncp, apos, HDstrlen(apos));
|
||||||
ncp += HDstrlen(apos);
|
ncp += HDstrlen(apos);
|
||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
else if (*cp == '<') {
|
else if (*cp == '<') {
|
||||||
strncpy(ncp, lt, HDstrlen(lt));
|
HDstrncpy(ncp, lt, HDstrlen(lt));
|
||||||
ncp += HDstrlen(lt);
|
ncp += HDstrlen(lt);
|
||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
else if (*cp == '>') {
|
else if (*cp == '>') {
|
||||||
strncpy(ncp, gt, HDstrlen(gt));
|
HDstrncpy(ncp, gt, HDstrlen(gt));
|
||||||
ncp += HDstrlen(gt);
|
ncp += HDstrlen(gt);
|
||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
else if (*cp == '&') {
|
else if (*cp == '&') {
|
||||||
strncpy(ncp, amp, HDstrlen(amp));
|
HDstrncpy(ncp, amp, HDstrlen(amp));
|
||||||
ncp += HDstrlen(amp);
|
ncp += HDstrlen(amp);
|
||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -176,7 +176,7 @@ static herr_t visit_obj(hid_t file, const char *oname, iter_t *iter);
|
|||||||
static void
|
static void
|
||||||
usage (void)
|
usage (void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "\
|
HDfprintf(stderr, "\
|
||||||
usage: %s [OPTIONS] [OBJECTS...]\n\
|
usage: %s [OPTIONS] [OBJECTS...]\n\
|
||||||
OPTIONS\n\
|
OPTIONS\n\
|
||||||
-h, -?, --help Print a usage message and exit\n\
|
-h, -?, --help Print a usage message and exit\n\
|
||||||
@ -263,39 +263,39 @@ display_string(FILE *stream, const char *s, hbool_t escape_spaces)
|
|||||||
for (/*void*/; s && *s; s++) {
|
for (/*void*/; s && *s; s++) {
|
||||||
switch (*s) {
|
switch (*s) {
|
||||||
case '"':
|
case '"':
|
||||||
if (stream) fprintf(stream, "\\\"");
|
if (stream) HDfprintf(stream, "\\\"");
|
||||||
nprint += 2;
|
nprint += 2;
|
||||||
break;
|
break;
|
||||||
case '\\':
|
case '\\':
|
||||||
if (stream) fprintf(stream, "\\\\");
|
if (stream) HDfprintf(stream, "\\\\");
|
||||||
nprint += 2;
|
nprint += 2;
|
||||||
break;
|
break;
|
||||||
case '\b':
|
case '\b':
|
||||||
if (stream) fprintf(stream, "\\b");
|
if (stream) HDfprintf(stream, "\\b");
|
||||||
nprint += 2;
|
nprint += 2;
|
||||||
break;
|
break;
|
||||||
case '\f':
|
case '\f':
|
||||||
if (stream) fprintf(stream, "\\f");
|
if (stream) HDfprintf(stream, "\\f");
|
||||||
nprint += 2;
|
nprint += 2;
|
||||||
break;
|
break;
|
||||||
case '\n':
|
case '\n':
|
||||||
if (stream) fprintf(stream, "\\n");
|
if (stream) HDfprintf(stream, "\\n");
|
||||||
nprint += 2;
|
nprint += 2;
|
||||||
break;
|
break;
|
||||||
case '\r':
|
case '\r':
|
||||||
if (stream) fprintf(stream, "\\r");
|
if (stream) HDfprintf(stream, "\\r");
|
||||||
nprint += 2;
|
nprint += 2;
|
||||||
break;
|
break;
|
||||||
case '\t':
|
case '\t':
|
||||||
if (stream) fprintf(stream, "\\t");
|
if (stream) HDfprintf(stream, "\\t");
|
||||||
nprint += 2;
|
nprint += 2;
|
||||||
break;
|
break;
|
||||||
case ' ':
|
case ' ':
|
||||||
if (escape_spaces) {
|
if (escape_spaces) {
|
||||||
if (stream) fprintf(stream, "\\ ");
|
if (stream) HDfprintf(stream, "\\ ");
|
||||||
nprint += 2;
|
nprint += 2;
|
||||||
} else {
|
} else {
|
||||||
if (stream) fprintf(stream, " ");
|
if (stream) HDfprintf(stream, " ");
|
||||||
nprint++;
|
nprint++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -305,7 +305,7 @@ display_string(FILE *stream, const char *s, hbool_t escape_spaces)
|
|||||||
nprint++;
|
nprint++;
|
||||||
} else {
|
} else {
|
||||||
if (stream) {
|
if (stream) {
|
||||||
fprintf(stream, "\\%03o", *((const unsigned char*)s));
|
HDfprintf(stream, "\\%03o", *((const unsigned char*)s));
|
||||||
}
|
}
|
||||||
nprint += 4;
|
nprint += 4;
|
||||||
}
|
}
|
||||||
@ -2515,7 +2515,7 @@ dump_dataset_values(hid_t dset)
|
|||||||
|
|
||||||
H5Tclose(f_type);
|
H5Tclose(f_type);
|
||||||
|
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
|
|
||||||
h5tools_str_close(&buffer);
|
h5tools_str_close(&buffer);
|
||||||
}
|
}
|
||||||
@ -2694,14 +2694,14 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo,
|
|||||||
HDfree(buf);
|
HDfree(buf);
|
||||||
H5Tclose(p_type);
|
H5Tclose(p_type);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
|
|
||||||
H5Sclose(space);
|
H5Sclose(space);
|
||||||
H5Tclose(type);
|
H5Tclose(type);
|
||||||
H5Aclose(attr);
|
H5Aclose(attr);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
h5tools_str_close(&buffer);
|
h5tools_str_close(&buffer);
|
||||||
@ -3296,7 +3296,7 @@ visit_obj(hid_t file, const char *oname, iter_t *iter)
|
|||||||
if(H5O_TYPE_GROUP == oi.type && !grp_literal_g) {
|
if(H5O_TYPE_GROUP == oi.type && !grp_literal_g) {
|
||||||
/* Get ID for group */
|
/* Get ID for group */
|
||||||
if(!iter->symlink_target && (iter->gid = H5Gopen2(file, oname, H5P_DEFAULT)) < 0) {
|
if(!iter->symlink_target && (iter->gid = H5Gopen2(file, oname, H5P_DEFAULT)) < 0) {
|
||||||
fprintf(stderr, "%s: unable to open '%s' as group\n", iter->fname, oname);
|
HDfprintf(stderr, "%s: unable to open '%s' as group\n", iter->fname, oname);
|
||||||
return 0; /* Previously "continue", when this code was in main().
|
return 0; /* Previously "continue", when this code was in main().
|
||||||
* We don't "continue" here in order to close the file
|
* We don't "continue" here in order to close the file
|
||||||
* and free the file name properly. */
|
* and free the file name properly. */
|
||||||
@ -3424,14 +3424,14 @@ is_valid_args(void)
|
|||||||
|
|
||||||
if(recursive_g && grp_literal_g)
|
if(recursive_g && grp_literal_g)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Error: 'recursive' option not compatible with 'group info' option!\n\n");
|
HDfprintf(stderr, "Error: 'recursive' option not compatible with 'group info' option!\n\n");
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(no_dangling_link_g && !follow_symlink_g)
|
if(no_dangling_link_g && !follow_symlink_g)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Error: --no-dangling-links must be used along with --follow-symlinks option!\n\n");
|
HDfprintf(stderr, "Error: --no-dangling-links must be used along with --follow-symlinks option!\n\n");
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@ -3727,7 +3727,7 @@ main(int argc, const char *argv[])
|
|||||||
} /* end while */
|
} /* end while */
|
||||||
|
|
||||||
if(file < 0) {
|
if(file < 0) {
|
||||||
fprintf(stderr, "%s: unable to open file\n", argv[argno-1]);
|
HDfprintf(stderr, "%s: unable to open file\n", argv[argno-1]);
|
||||||
HDfree(fname);
|
HDfree(fname);
|
||||||
err_exit = 1;
|
err_exit = 1;
|
||||||
continue;
|
continue;
|
||||||
@ -3740,7 +3740,7 @@ main(int argc, const char *argv[])
|
|||||||
iter.base_len -= oname[iter.base_len-1] == '/';
|
iter.base_len -= oname[iter.base_len-1] == '/';
|
||||||
x = oname;
|
x = oname;
|
||||||
if(NULL == (oname = HDstrdup(oname))) {
|
if(NULL == (oname = HDstrdup(oname))) {
|
||||||
fprintf(stderr, "memory allocation failed\n");
|
HDfprintf(stderr, "memory allocation failed\n");
|
||||||
leave(EXIT_FAILURE);
|
leave(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
*x = '\0';
|
*x = '\0';
|
||||||
|
@ -239,21 +239,21 @@ leave(int ret)
|
|||||||
static void usage(const char *prog)
|
static void usage(const char *prog)
|
||||||
{
|
{
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
fprintf(stdout, "Usage: %s [OPTIONS] file\n", prog);
|
HDfprintf(stdout, "Usage: %s [OPTIONS] file\n", prog);
|
||||||
fprintf(stdout, "\n");
|
HDfprintf(stdout, "\n");
|
||||||
fprintf(stdout, " OPTIONS\n");
|
HDfprintf(stdout, " OPTIONS\n");
|
||||||
fprintf(stdout, " -h, --help Print a usage message and exit\n");
|
HDfprintf(stdout, " -h, --help Print a usage message and exit\n");
|
||||||
fprintf(stdout, " -V, --version Print version number and exit\n");
|
HDfprintf(stdout, " -V, --version Print version number and exit\n");
|
||||||
fprintf(stdout, " -f, --file Print file information\n");
|
HDfprintf(stdout, " -f, --file Print file information\n");
|
||||||
fprintf(stdout, " -F, --filemetadata Print file space information for file's metadata\n");
|
HDfprintf(stdout, " -F, --filemetadata Print file space information for file's metadata\n");
|
||||||
fprintf(stdout, " -g, --group Print group information\n");
|
HDfprintf(stdout, " -g, --group Print group information\n");
|
||||||
fprintf(stdout, " -G, --groupmetadata Print file space information for groups' metadata\n");
|
HDfprintf(stdout, " -G, --groupmetadata Print file space information for groups' metadata\n");
|
||||||
fprintf(stdout, " -d, --dset Print dataset information\n");
|
HDfprintf(stdout, " -d, --dset Print dataset information\n");
|
||||||
fprintf(stdout, " -D, --dsetmetadata Print file space information for datasets' metadata\n");
|
HDfprintf(stdout, " -D, --dsetmetadata Print file space information for datasets' metadata\n");
|
||||||
fprintf(stdout, " -T, --dtypemetadata Print datasets' datatype information\n");
|
HDfprintf(stdout, " -T, --dtypemetadata Print datasets' datatype information\n");
|
||||||
fprintf(stdout, " -A, --attribute Print attribute information\n");
|
HDfprintf(stdout, " -A, --attribute Print attribute information\n");
|
||||||
fprintf(stdout, " -s, --freespace Print free space information\n");
|
HDfprintf(stdout, " -s, --freespace Print free space information\n");
|
||||||
fprintf(stdout, " -S, --summary Print summary of file space information\n");
|
HDfprintf(stdout, " -S, --summary Print summary of file space information\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,11 +25,11 @@
|
|||||||
* Debug printf macros. The prefix allows output filtering by test scripts.
|
* Debug printf macros. The prefix allows output filtering by test scripts.
|
||||||
*/
|
*/
|
||||||
#ifdef H5DIFF_DEBUG
|
#ifdef H5DIFF_DEBUG
|
||||||
#define h5diffdebug(x) fprintf(stderr, "h5diff debug: " x)
|
#define h5diffdebug(x) HDfprintf(stderr, "h5diff debug: " x)
|
||||||
#define h5diffdebug2(x1, x2) fprintf(stderr, "h5diff debug: " x1, x2)
|
#define h5diffdebug2(x1, x2) HDfprintf(stderr, "h5diff debug: " x1, x2)
|
||||||
#define h5diffdebug3(x1, x2, x3) fprintf(stderr, "h5diff debug: " x1, x2, x3)
|
#define h5diffdebug3(x1, x2, x3) HDfprintf(stderr, "h5diff debug: " x1, x2, x3)
|
||||||
#define h5diffdebug4(x1, x2, x3, x4) fprintf(stderr, "h5diff debug: " x1, x2, x3, x4)
|
#define h5diffdebug4(x1, x2, x3, x4) HDfprintf(stderr, "h5diff debug: " x1, x2, x3, x4)
|
||||||
#define h5diffdebug5(x1, x2, x3, x4, x5) fprintf(stderr, "h5diff debug: " x1, x2, x3, x4, x5)
|
#define h5diffdebug5(x1, x2, x3, x4, x5) HDfprintf(stderr, "h5diff debug: " x1, x2, x3, x4, x5)
|
||||||
#else
|
#else
|
||||||
#define h5diffdebug(x)
|
#define h5diffdebug(x)
|
||||||
#define h5diffdebug2(x1, x2)
|
#define h5diffdebug2(x1, x2)
|
||||||
@ -159,7 +159,7 @@ void print_manager_output(void)
|
|||||||
}
|
}
|
||||||
else if( (outBuffOffset>0) && !g_Parallel)
|
else if( (outBuffOffset>0) && !g_Parallel)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "h5diff error: outBuffOffset>0, but we're not in parallel!\n");
|
HDfprintf(stderr, "h5diff error: outBuffOffset>0, but we're not in parallel!\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -995,7 +995,7 @@ hsize_t h5diff(const char *fname1,
|
|||||||
if((HDstrlen(fname1) > MAX_FILENAME) ||
|
if((HDstrlen(fname1) > MAX_FILENAME) ||
|
||||||
(HDstrlen(fname2) > MAX_FILENAME))
|
(HDstrlen(fname2) > MAX_FILENAME))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "The parallel diff only supports path names up to %d characters\n", MAX_FILENAME);
|
HDfprintf(stderr, "The parallel diff only supports path names up to %d characters\n", MAX_FILENAME);
|
||||||
MPI_Abort(MPI_COMM_WORLD, 0);
|
MPI_Abort(MPI_COMM_WORLD, 0);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
|
@ -23,34 +23,34 @@
|
|||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
#define H5A_PACKAGE /*suppress error about including H5Apkg */
|
#define H5A_PACKAGE /*suppress error about including H5Apkg */
|
||||||
#define H5B2_PACKAGE /*suppress error about including H5B2pkg */
|
#define H5B2_PACKAGE /*suppress error about including H5B2pkg */
|
||||||
#define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/
|
#define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/
|
||||||
#define H5EA_PACKAGE /*suppress error about including H5EApkg */
|
#define H5EA_PACKAGE /*suppress error about including H5EApkg */
|
||||||
#define H5EA_TESTING /*suppress warning about H5EA testing funcs*/
|
#define H5EA_TESTING /*suppress warning about H5EA testing funcs*/
|
||||||
#define H5FA_PACKAGE /*suppress error about including H5FApkg */
|
#define H5FA_PACKAGE /*suppress error about including H5FApkg */
|
||||||
#define H5FA_TESTING /*suppress warning about H5FA testing funcs*/
|
#define H5FA_TESTING /*suppress warning about H5FA testing funcs*/
|
||||||
#define H5F_PACKAGE /*suppress error about including H5Fpkg */
|
#define H5F_PACKAGE /*suppress error about including H5Fpkg */
|
||||||
#define H5G_PACKAGE /*suppress error about including H5Gpkg */
|
#define H5G_PACKAGE /*suppress error about including H5Gpkg */
|
||||||
#define H5HF_PACKAGE /*suppress error about including H5HFpkg */
|
#define H5HF_PACKAGE /*suppress error about including H5HFpkg */
|
||||||
#define H5O_PACKAGE /*suppress error about including H5Opkg */
|
#define H5O_PACKAGE /*suppress error about including H5Opkg */
|
||||||
#define H5SM_PACKAGE /*suppress error about including H5SMpkg */
|
#define H5SM_PACKAGE /*suppress error about including H5SMpkg */
|
||||||
|
|
||||||
#include "H5private.h" /* Generic Functions */
|
#include "H5private.h" /* Generic Functions */
|
||||||
#include "H5Apkg.h" /* Attributes */
|
#include "H5Apkg.h" /* Attributes */
|
||||||
#include "H5B2pkg.h" /* v2 B-trees */
|
#include "H5B2pkg.h" /* v2 B-trees */
|
||||||
#include "H5Dprivate.h" /* Datasets */
|
#include "H5Dprivate.h" /* Datasets */
|
||||||
#include "H5Eprivate.h" /* Error handling */
|
#include "H5Eprivate.h" /* Error handling */
|
||||||
#include "H5EApkg.h" /* Extensible Arrays */
|
#include "H5EApkg.h" /* Extensible Arrays */
|
||||||
#include "H5FApkg.h" /* Fixed Arrays */
|
#include "H5FApkg.h" /* Fixed Arrays */
|
||||||
#include "H5Fpkg.h" /* File access */
|
#include "H5Fpkg.h" /* File access */
|
||||||
#include "H5FSprivate.h" /* Free space manager */
|
#include "H5FSprivate.h" /* Free space manager */
|
||||||
#include "H5Gpkg.h" /* Groups */
|
#include "H5Gpkg.h" /* Groups */
|
||||||
#include "H5HFpkg.h" /* Fractal heaps */
|
#include "H5HFpkg.h" /* Fractal heaps */
|
||||||
#include "H5HGprivate.h" /* Global Heaps */
|
#include "H5HGprivate.h" /* Global Heaps */
|
||||||
#include "H5Iprivate.h" /* IDs */
|
#include "H5Iprivate.h" /* IDs */
|
||||||
#include "H5Opkg.h" /* Object headers */
|
#include "H5Opkg.h" /* Object headers */
|
||||||
#include "H5SMpkg.h" /* Implicitly shared messages */
|
#include "H5SMpkg.h" /* Implicitly shared messages */
|
||||||
|
|
||||||
/* File drivers */
|
/* File drivers */
|
||||||
#include "H5FDfamily.h"
|
#include "H5FDfamily.h"
|
||||||
@ -61,15 +61,15 @@
|
|||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
* Function: get_H5B2_class
|
* Function: get_H5B2_class
|
||||||
*
|
*
|
||||||
* Purpose: Determine the v2 B-tree class from the buffer read in.
|
* Purpose: Determine the v2 B-tree class from the buffer read in.
|
||||||
* B-trees are debugged through the B-tree subclass. The subclass
|
* B-trees are debugged through the B-tree subclass. The subclass
|
||||||
* identifier is two bytes after the B-tree signature.
|
* identifier is two bytes after the B-tree signature.
|
||||||
*
|
*
|
||||||
* Return: Non-NULL on success/NULL on failure
|
* Return: Non-NULL on success/NULL on failure
|
||||||
*
|
*
|
||||||
* Programmer: Quincey Koziol
|
* Programmer: Quincey Koziol
|
||||||
* koziol@hdfgroup.org
|
* koziol@hdfgroup.org
|
||||||
* Sep 11 2008
|
* Sep 11 2008
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -121,7 +121,7 @@ get_H5B2_class(const uint8_t *sig)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype));
|
HDfprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype));
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end switch */
|
} /* end switch */
|
||||||
|
|
||||||
@ -132,15 +132,15 @@ get_H5B2_class(const uint8_t *sig)
|
|||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
* Function: get_H5EA_class
|
* Function: get_H5EA_class
|
||||||
*
|
*
|
||||||
* Purpose: Determine the extensible array class from the buffer read in.
|
* Purpose: Determine the extensible array class from the buffer read in.
|
||||||
* Extensible arrays are debugged through the array subclass.
|
* Extensible arrays are debugged through the array subclass.
|
||||||
* The subclass identifier is two bytes after the signature.
|
* The subclass identifier is two bytes after the signature.
|
||||||
*
|
*
|
||||||
* Return: Non-NULL on success/NULL on failure
|
* Return: Non-NULL on success/NULL on failure
|
||||||
*
|
*
|
||||||
* Programmer: Quincey Koziol
|
* Programmer: Quincey Koziol
|
||||||
* koziol@hdfgroup.org
|
* koziol@hdfgroup.org
|
||||||
* Sep 11 2008
|
* Sep 11 2008
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -156,7 +156,7 @@ get_H5EA_class(const uint8_t *sig)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid));
|
HDfprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid));
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end switch */
|
} /* end switch */
|
||||||
|
|
||||||
@ -167,15 +167,15 @@ get_H5EA_class(const uint8_t *sig)
|
|||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
* Function: get_H5FA_class
|
* Function: get_H5FA_class
|
||||||
*
|
*
|
||||||
* Purpose: Determine the fixed array class from the buffer read in.
|
* Purpose: Determine the fixed array class from the buffer read in.
|
||||||
* Extensible arrays are debugged through the array subclass.
|
* Extensible arrays are debugged through the array subclass.
|
||||||
* The subclass identifier is two bytes after the signature.
|
* The subclass identifier is two bytes after the signature.
|
||||||
*
|
*
|
||||||
* Return: Non-NULL on success/NULL on failure
|
* Return: Non-NULL on success/NULL on failure
|
||||||
*
|
*
|
||||||
* Programmer: Quincey Koziol
|
* Programmer: Quincey Koziol
|
||||||
* koziol@hdfgroup.org
|
* koziol@hdfgroup.org
|
||||||
* Sep 11 2008
|
* Sep 11 2008
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -191,7 +191,7 @@ get_H5FA_class(const uint8_t *sig)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid));
|
HDfprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid));
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end switch */
|
} /* end switch */
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ get_H5FA_class(const uint8_t *sig)
|
|||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
hid_t fid, fapl, dxpl;
|
hid_t fid, fapl, dxpl;
|
||||||
H5F_t *f;
|
H5F_t *f;
|
||||||
haddr_t addr = 0, extra = 0, extra2 = 0, extra3 = 0, extra4 = 0;
|
haddr_t addr = 0, extra = 0, extra2 = 0, extra3 = 0, extra4 = 0;
|
||||||
uint8_t sig[H5F_SIGNATURE_LEN];
|
uint8_t sig[H5F_SIGNATURE_LEN];
|
||||||
@ -225,13 +225,13 @@ main(int argc, char *argv[])
|
|||||||
herr_t status = SUCCEED;
|
herr_t status = SUCCEED;
|
||||||
|
|
||||||
if(argc == 1) {
|
if(argc == 1) {
|
||||||
fprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]);
|
HDfprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]);
|
||||||
HDexit(1);
|
HDexit(1);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
/* Initialize the library */
|
/* Initialize the library */
|
||||||
if(H5open() < 0) {
|
if(H5open() < 0) {
|
||||||
fprintf(stderr, "cannot initialize the library\n");
|
HDfprintf(stderr, "cannot initialize the library\n");
|
||||||
HDexit(1);
|
HDexit(1);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
@ -239,27 +239,27 @@ main(int argc, char *argv[])
|
|||||||
* Open the file and get the file descriptor.
|
* Open the file and get the file descriptor.
|
||||||
*/
|
*/
|
||||||
if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) {
|
if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) {
|
||||||
fprintf(stderr, "cannot create dataset transfer property list\n");
|
HDfprintf(stderr, "cannot create dataset transfer property list\n");
|
||||||
HDexit(1);
|
HDexit(1);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
|
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
|
||||||
fprintf(stderr, "cannot create file access property list\n");
|
HDfprintf(stderr, "cannot create file access property list\n");
|
||||||
HDexit(1);
|
HDexit(1);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
if(strchr(argv[1], '%'))
|
if(strchr(argv[1], '%'))
|
||||||
H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT);
|
H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT);
|
||||||
if((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0) {
|
if((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0) {
|
||||||
fprintf(stderr, "cannot open file\n");
|
HDfprintf(stderr, "cannot open file\n");
|
||||||
HDexit(1);
|
HDexit(1);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
if(NULL == (f = (H5F_t *)H5I_object(fid))) {
|
if(NULL == (f = (H5F_t *)H5I_object(fid))) {
|
||||||
fprintf(stderr, "cannot obtain H5F_t pointer\n");
|
HDfprintf(stderr, "cannot obtain H5F_t pointer\n");
|
||||||
HDexit(2);
|
HDexit(2);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
/* Ignore metadata tags while using h5debug */
|
/* Ignore metadata tags while using h5debug */
|
||||||
if(H5AC_ignore_tags(f) < 0) {
|
if(H5AC_ignore_tags(f) < 0) {
|
||||||
fprintf(stderr, "cannot ignore metadata tags\n");
|
HDfprintf(stderr, "cannot ignore metadata tags\n");
|
||||||
HDexit(1);
|
HDexit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,7 +282,7 @@ main(int argc, char *argv[])
|
|||||||
*/
|
*/
|
||||||
HDfprintf(stdout, "Reading signature at address %a (rel)\n", addr);
|
HDfprintf(stdout, "Reading signature at address %a (rel)\n", addr);
|
||||||
if(H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), dxpl, sig) < 0) {
|
if(H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), dxpl, sig) < 0) {
|
||||||
fprintf(stderr, "cannot read signature\n");
|
HDfprintf(stderr, "cannot read signature\n");
|
||||||
HDexit(3);
|
HDexit(3);
|
||||||
}
|
}
|
||||||
if(!HDmemcmp(sig, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN)) {
|
if(!HDmemcmp(sig, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN)) {
|
||||||
@ -298,10 +298,10 @@ main(int argc, char *argv[])
|
|||||||
status = H5HL_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL);
|
status = H5HL_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL);
|
||||||
|
|
||||||
} else if(!HDmemcmp (sig, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
|
} else if(!HDmemcmp (sig, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
|
||||||
/*
|
/*
|
||||||
* Debug a global heap collection.
|
* Debug a global heap collection.
|
||||||
*/
|
*/
|
||||||
status = H5HG_debug (f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL);
|
status = H5HG_debug (f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL);
|
||||||
|
|
||||||
} else if(!HDmemcmp(sig, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
|
} else if(!HDmemcmp(sig, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
|
||||||
/*
|
/*
|
||||||
@ -310,9 +310,9 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Check for extra parameters */
|
/* Check for extra parameters */
|
||||||
if(extra == 0) {
|
if(extra == 0) {
|
||||||
fprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n");
|
HDfprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n");
|
||||||
fprintf(stderr, "Symbol table node usage:\n");
|
HDfprintf(stderr, "Symbol table node usage:\n");
|
||||||
fprintf(stderr, "\th5debug <filename> <Symbol table node address> <address of local heap>\n\n");
|
HDfprintf(stderr, "\th5debug <filename> <Symbol table node address> <address of local heap>\n\n");
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra);
|
status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra);
|
||||||
@ -330,9 +330,9 @@ main(int argc, char *argv[])
|
|||||||
case H5B_SNODE_ID:
|
case H5B_SNODE_ID:
|
||||||
/* Check for extra parameters */
|
/* Check for extra parameters */
|
||||||
if(extra == 0) {
|
if(extra == 0) {
|
||||||
fprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n");
|
HDfprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n");
|
||||||
fprintf(stderr, "B-tree symbol table node usage:\n");
|
HDfprintf(stderr, "B-tree symbol table node usage:\n");
|
||||||
fprintf(stderr, "\th5debug <filename> <B-tree node address> <address of local heap>\n\n");
|
HDfprintf(stderr, "\th5debug <filename> <B-tree node address> <address of local heap>\n\n");
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra);
|
status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra);
|
||||||
@ -341,9 +341,9 @@ main(int argc, char *argv[])
|
|||||||
case H5B_CHUNK_ID:
|
case H5B_CHUNK_ID:
|
||||||
/* Check for extra parameters */
|
/* Check for extra parameters */
|
||||||
if(extra == 0) {
|
if(extra == 0) {
|
||||||
fprintf(stderr, "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n");
|
HDfprintf(stderr, "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n");
|
||||||
fprintf(stderr, "B-tree chunked storage node usage:\n");
|
HDfprintf(stderr, "B-tree chunked storage node usage:\n");
|
||||||
fprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions>\n");
|
HDfprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions>\n");
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ main(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype));
|
HDfprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype));
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -374,10 +374,10 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Check for enough valid parameters */
|
/* Check for enough valid parameters */
|
||||||
if(extra == 0 || extra2 == 0 || extra3 == 0) {
|
if(extra == 0 || extra2 == 0 || extra3 == 0) {
|
||||||
fprintf(stderr, "ERROR: Need v2 B-tree header address and the node's number of records and depth in order to dump internal node\n");
|
HDfprintf(stderr, "ERROR: Need v2 B-tree header address and the node's number of records and depth in order to dump internal node\n");
|
||||||
fprintf(stderr, "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n");
|
HDfprintf(stderr, "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n");
|
||||||
fprintf(stderr, "v2 B-tree internal node usage:\n");
|
HDfprintf(stderr, "v2 B-tree internal node usage:\n");
|
||||||
fprintf(stderr, "\th5debug <filename> <internal node address> <v2 B-tree header address> <number of records> <depth>\n");
|
HDfprintf(stderr, "\th5debug <filename> <internal node address> <v2 B-tree header address> <number of records> <depth>\n");
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
@ -392,9 +392,9 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Check for enough valid parameters */
|
/* Check for enough valid parameters */
|
||||||
if(extra == 0 || extra2 == 0) {
|
if(extra == 0 || extra2 == 0) {
|
||||||
fprintf(stderr, "ERROR: Need v2 B-tree header address and number of records in order to dump leaf node\n");
|
HDfprintf(stderr, "ERROR: Need v2 B-tree header address and number of records in order to dump leaf node\n");
|
||||||
fprintf(stderr, "v2 B-tree leaf node usage:\n");
|
HDfprintf(stderr, "v2 B-tree leaf node usage:\n");
|
||||||
fprintf(stderr, "\th5debug <filename> <leaf node address> <v2 B-tree header address> <number of records>\n");
|
HDfprintf(stderr, "\th5debug <filename> <leaf node address> <v2 B-tree header address> <number of records>\n");
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
@ -413,9 +413,9 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Check for enough valid parameters */
|
/* Check for enough valid parameters */
|
||||||
if(extra == 0 || extra2 == 0) {
|
if(extra == 0 || extra2 == 0) {
|
||||||
fprintf(stderr, "ERROR: Need fractal heap header address and size of direct block in order to dump direct block\n");
|
HDfprintf(stderr, "ERROR: Need fractal heap header address and size of direct block in order to dump direct block\n");
|
||||||
fprintf(stderr, "Fractal heap direct block usage:\n");
|
HDfprintf(stderr, "Fractal heap direct block usage:\n");
|
||||||
fprintf(stderr, "\th5debug <filename> <direct block address> <heap header address> <size of direct block>\n");
|
HDfprintf(stderr, "\th5debug <filename> <direct block address> <heap header address> <size of direct block>\n");
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
@ -428,9 +428,9 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Check for enough valid parameters */
|
/* Check for enough valid parameters */
|
||||||
if(extra == 0 || extra2 == 0) {
|
if(extra == 0 || extra2 == 0) {
|
||||||
fprintf(stderr, "ERROR: Need fractal heap header address and number of rows in order to dump indirect block\n");
|
HDfprintf(stderr, "ERROR: Need fractal heap header address and number of rows in order to dump indirect block\n");
|
||||||
fprintf(stderr, "Fractal heap indirect block usage:\n");
|
HDfprintf(stderr, "Fractal heap indirect block usage:\n");
|
||||||
fprintf(stderr, "\th5debug <filename> <indirect block address> <heap header address> <number of rows>\n");
|
HDfprintf(stderr, "\th5debug <filename> <indirect block address> <heap header address> <number of rows>\n");
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
@ -450,9 +450,9 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Check for enough valid parameters */
|
/* Check for enough valid parameters */
|
||||||
if(extra == 0 || extra2 == 0) {
|
if(extra == 0 || extra2 == 0) {
|
||||||
fprintf(stderr, "ERROR: Need free space header address and client address in order to dump serialized sections\n");
|
HDfprintf(stderr, "ERROR: Need free space header address and client address in order to dump serialized sections\n");
|
||||||
fprintf(stderr, "Free space serialized sections usage:\n");
|
HDfprintf(stderr, "Free space serialized sections usage:\n");
|
||||||
fprintf(stderr, "\th5debug <filename> <serialized sections address> <free space header address> <client address>\n");
|
HDfprintf(stderr, "\th5debug <filename> <serialized sections address> <free space header address> <client address>\n");
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
@ -472,9 +472,9 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Check for enough valid parameters */
|
/* Check for enough valid parameters */
|
||||||
if(extra2 == 0) {
|
if(extra2 == 0) {
|
||||||
fprintf(stderr, "ERROR: Need list format version and number of messages in order to shared message list\n");
|
HDfprintf(stderr, "ERROR: Need list format version and number of messages in order to shared message list\n");
|
||||||
fprintf(stderr, "Shared message list usage:\n");
|
HDfprintf(stderr, "Shared message list usage:\n");
|
||||||
fprintf(stderr, "\th5debug <filename> <shared message list address> <list format version> <number of mesages in list>\n");
|
HDfprintf(stderr, "\th5debug <filename> <shared message list address> <list format version> <number of mesages in list>\n");
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
@ -487,11 +487,11 @@ main(int argc, char *argv[])
|
|||||||
const H5EA_class_t *cls = get_H5EA_class(sig);
|
const H5EA_class_t *cls = get_H5EA_class(sig);
|
||||||
HDassert(cls);
|
HDassert(cls);
|
||||||
|
|
||||||
/* Check for enough valid parameters */
|
/* Check for enough valid parameters */
|
||||||
if(extra == 0) {
|
if(extra == 0) {
|
||||||
fprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n");
|
HDfprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n");
|
||||||
fprintf(stderr, "Extensible array header block usage:\n");
|
HDfprintf(stderr, "Extensible array header block usage:\n");
|
||||||
fprintf(stderr, "\th5debug <filename> <Extensible Array header address> <object header address>\n");
|
HDfprintf(stderr, "\th5debug <filename> <Extensible Array header address> <object header address>\n");
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
@ -506,9 +506,9 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Check for enough valid parameters */
|
/* Check for enough valid parameters */
|
||||||
if(extra == 0 || extra2 == 0) {
|
if(extra == 0 || extra2 == 0) {
|
||||||
fprintf(stderr, "ERROR: Need extensible array header address and object header address containing the layout message in order to dump index block\n");
|
HDfprintf(stderr, "ERROR: Need extensible array header address and object header address containing the layout message in order to dump index block\n");
|
||||||
fprintf(stderr, "Extensible array index block usage:\n");
|
HDfprintf(stderr, "Extensible array index block usage:\n");
|
||||||
fprintf(stderr, "\th5debug <filename> <index block address> <array header address> <object header address\n");
|
HDfprintf(stderr, "\th5debug <filename> <index block address> <array header address> <object header address\n");
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
@ -523,9 +523,9 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Check for enough valid parameters */
|
/* Check for enough valid parameters */
|
||||||
if(extra == 0 || extra2 == 0 || extra3 == 0) {
|
if(extra == 0 || extra2 == 0 || extra3 == 0) {
|
||||||
fprintf(stderr, "ERROR: Need extensible array header address, super block index and object header address containing the layout message in order to dump super block\n");
|
HDfprintf(stderr, "ERROR: Need extensible array header address, super block index and object header address containing the layout message in order to dump super block\n");
|
||||||
fprintf(stderr, "Extensible array super block usage:\n");
|
HDfprintf(stderr, "Extensible array super block usage:\n");
|
||||||
fprintf(stderr, "\th5debug <filename> <super block address> <array header address> <super block index> <object header address>\n");
|
HDfprintf(stderr, "\th5debug <filename> <super block address> <array header address> <super block index> <object header address>\n");
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
@ -540,9 +540,9 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Check for enough valid parameters */
|
/* Check for enough valid parameters */
|
||||||
if(extra == 0 || extra2 == 0 || extra3 == 0) {
|
if(extra == 0 || extra2 == 0 || extra3 == 0) {
|
||||||
fprintf(stderr, "ERROR: Need extensible array header address, # of elements in data block and object header address containing the layout message in order to dump data block\n");
|
HDfprintf(stderr, "ERROR: Need extensible array header address, # of elements in data block and object header address containing the layout message in order to dump data block\n");
|
||||||
fprintf(stderr, "Extensible array data block usage:\n");
|
HDfprintf(stderr, "Extensible array data block usage:\n");
|
||||||
fprintf(stderr, "\th5debug <filename> <data block address> <array header address> <# of elements in data block> <object header address\n");
|
HDfprintf(stderr, "\th5debug <filename> <data block address> <array header address> <# of elements in data block> <object header address\n");
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
@ -555,11 +555,11 @@ main(int argc, char *argv[])
|
|||||||
const H5FA_class_t *cls = get_H5FA_class(sig);
|
const H5FA_class_t *cls = get_H5FA_class(sig);
|
||||||
HDassert(cls);
|
HDassert(cls);
|
||||||
|
|
||||||
/* Check for enough valid parameters */
|
/* Check for enough valid parameters */
|
||||||
if(extra == 0) {
|
if(extra == 0) {
|
||||||
fprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n");
|
HDfprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n");
|
||||||
fprintf(stderr, "Fixed array header block usage:\n");
|
HDfprintf(stderr, "Fixed array header block usage:\n");
|
||||||
fprintf(stderr, "\th5debug <filename> <Fixed Array header address> <object header address>\n");
|
HDfprintf(stderr, "\th5debug <filename> <Fixed Array header address> <object header address>\n");
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
@ -574,9 +574,9 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Check for enough valid parameters */
|
/* Check for enough valid parameters */
|
||||||
if(extra == 0 || extra2 == 0) {
|
if(extra == 0 || extra2 == 0) {
|
||||||
fprintf(stderr, "ERROR: Need fixed array header address and object header address containing the layout message in order to dump data block\n");
|
HDfprintf(stderr, "ERROR: Need fixed array header address and object header address containing the layout message in order to dump data block\n");
|
||||||
fprintf(stderr, "fixed array data block usage:\n");
|
HDfprintf(stderr, "fixed array data block usage:\n");
|
||||||
fprintf(stderr, "\th5debug <filename> <data block address> <array header address> <object header address>\n");
|
HDfprintf(stderr, "\th5debug <filename> <data block address> <array header address> <object header address>\n");
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
@ -612,13 +612,13 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
HDputchar('\n');
|
HDputchar('\n');
|
||||||
|
|
||||||
fprintf(stderr, "unknown signature\n");
|
HDfprintf(stderr, "unknown signature\n");
|
||||||
HDexit(4);
|
HDexit(4);
|
||||||
} /* end else */
|
} /* end else */
|
||||||
|
|
||||||
/* Check for an error when dumping information */
|
/* Check for an error when dumping information */
|
||||||
if(status < 0) {
|
if(status < 0) {
|
||||||
fprintf(stderr, "An error occurred!\n");
|
HDfprintf(stderr, "An error occurred!\n");
|
||||||
H5Eprint2(H5E_DEFAULT, stderr);
|
H5Eprint2(H5E_DEFAULT, stderr);
|
||||||
HDexit(5);
|
HDexit(5);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
@ -81,7 +81,7 @@ leave(int ret)
|
|||||||
static void
|
static void
|
||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "\
|
HDfprintf(stdout, "\
|
||||||
usage: h5mkgrp [OPTIONS] FILE GROUP...\n\
|
usage: h5mkgrp [OPTIONS] FILE GROUP...\n\
|
||||||
OPTIONS\n\
|
OPTIONS\n\
|
||||||
-h, --help Print a usage message and exit\n\
|
-h, --help Print a usage message and exit\n\
|
||||||
@ -97,8 +97,8 @@ usage: h5mkgrp [OPTIONS] FILE GROUP...\n\
|
|||||||
*
|
*
|
||||||
* Purpose: Parses command line and sets up global variable to control output
|
* Purpose: Parses command line and sets up global variable to control output
|
||||||
*
|
*
|
||||||
* Return: Success: 0
|
* Return: Success: 0
|
||||||
* Failure: -1
|
* Failure: -1
|
||||||
*
|
*
|
||||||
* Programmer: Quincey Koziol, 2/13/2007
|
* Programmer: Quincey Koziol, 2/13/2007
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user