diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-07-06 19:45:35 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-07-06 19:45:35 (GMT) |
commit | 98754fa9d12090f5e048fdb05cc5e9ce9111676f (patch) | |
tree | 407e611b19ee551d8153779104022dd886a467e5 /tools/misc/h5mkgrp.c | |
parent | 29321bcafa9f1c6108bb92b5a844a9d4d9c2c8e7 (diff) | |
download | hdf5-98754fa9d12090f5e048fdb05cc5e9ce9111676f.zip hdf5-98754fa9d12090f5e048fdb05cc5e9ce9111676f.tar.gz hdf5-98754fa9d12090f5e048fdb05cc5e9ce9111676f.tar.bz2 |
[svn-r19050] Description:
Bring r18704:19049 from trunk to revise_chunks branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.3 (amazon) in debug mode
Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Diffstat (limited to 'tools/misc/h5mkgrp.c')
-rw-r--r-- | tools/misc/h5mkgrp.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c index a6fdc56..09f23ef 100644 --- a/tools/misc/h5mkgrp.c +++ b/tools/misc/h5mkgrp.c @@ -21,7 +21,7 @@ #include <stdlib.h> /* Name of tool */ -const char *progname = "h5mkgrp"; +#define PROGRAMNAME "h5mkgrp" /* Exit status for tools library routines */ int d_status = EXIT_SUCCESS; @@ -141,7 +141,7 @@ parse_command_line(int argc, const char *argv[], param_t *params) /* Display version */ case 'V': - print_version(progname); + print_version(h5tools_getprogname()); leave(EXIT_SUCCESS); /* Bad command line argument */ @@ -153,7 +153,7 @@ parse_command_line(int argc, const char *argv[], param_t *params) /* Check for file name to be processed */ if(argc <= opt_ind) { - error_msg(progname, "missing file name\n"); + error_msg("missing file name\n"); usage(); leave(EXIT_FAILURE); } /* end if */ @@ -164,7 +164,7 @@ parse_command_line(int argc, const char *argv[], param_t *params) /* Check for group(s) to be created */ if(argc <= opt_ind) { - error_msg(progname, "missing group name(s)\n"); + error_msg("missing group name(s)\n"); usage(); leave(EXIT_FAILURE); } /* end if */ @@ -212,6 +212,9 @@ main(int argc, const char *argv[]) hid_t lcpl_id; /* Link creation property list ID */ size_t curr_group; /* Current group to create */ + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + /* Disable the HDF5 library's error reporting */ H5Eset_auto2(H5E_DEFAULT, NULL, NULL); @@ -221,13 +224,13 @@ main(int argc, const char *argv[]) /* Parse command line */ HDmemset(¶ms, 0, sizeof(params)); if(parse_command_line(argc, argv, ¶ms) < 0) { - error_msg(progname, "unable to parse command line arguments\n"); + error_msg("unable to parse command line arguments\n"); leave(EXIT_FAILURE); } /* end if */ /* Create file access property list */ if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - error_msg(progname, "Could not create file access property list\n"); + error_msg("Could not create file access property list\n"); leave(EXIT_FAILURE); } /* end if */ @@ -235,13 +238,13 @@ main(int argc, const char *argv[]) if(params.latest) { /* Set the "use the latest version of the format" bounds */ if(H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) { - error_msg(progname, "Could not set property for using latest version of the format\n"); + error_msg("Could not set property for using latest version of the format\n"); leave(EXIT_FAILURE); } /* end if */ /* Display some output if requested */ if(params.verbose) - printf("%s: Creating groups with latest version of the format\n", progname); + printf("%s: Creating groups with latest version of the format\n", h5tools_getprogname()); } /* end if */ /* Attempt to open an existing HDF5 file first */ @@ -254,13 +257,13 @@ main(int argc, const char *argv[]) /* Test for error in opening file */ if(fid < 0) { - error_msg(progname, "Could not open output file '%s'\n", params.fname); + error_msg("Could not open output file '%s'\n", params.fname); leave(EXIT_FAILURE); } /* end if */ /* Create link creation property list */ if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) { - error_msg(progname, "Could not create link creation property list\n"); + error_msg("Could not create link creation property list\n"); leave(EXIT_FAILURE); } /* end if */ @@ -268,13 +271,13 @@ main(int argc, const char *argv[]) if(params.parents) { /* Set the intermediate group creation property */ if(H5Pset_create_intermediate_group(lcpl_id, TRUE) < 0) { - error_msg(progname, "Could not set property for creating parent groups\n"); + error_msg("Could not set property for creating parent groups\n"); leave(EXIT_FAILURE); } /* end if */ /* Display some output if requested */ if(params.verbose) - printf("%s: Creating parent groups\n", progname); + printf("%s: Creating parent groups\n", h5tools_getprogname()); } /* end if */ /* Loop over creating requested groups */ @@ -283,36 +286,36 @@ main(int argc, const char *argv[]) /* Attempt to create a group */ if((gid = H5Gcreate2(fid, params.groups[curr_group], lcpl_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - error_msg(progname, "Could not create group '%s'\n", params.groups[curr_group]); + error_msg("Could not create group '%s'\n", params.groups[curr_group]); leave(EXIT_FAILURE); } /* end if */ /* Close the group */ if(H5Gclose(gid) < 0) { - error_msg(progname, "Could not close group '%s'??\n", params.groups[curr_group]); + error_msg("Could not close group '%s'??\n", params.groups[curr_group]); leave(EXIT_FAILURE); } /* end if */ /* Display some output if requested */ if(params.verbose) - printf("%s: created group '%s'\n", progname, params.groups[curr_group]); + printf("%s: created group '%s'\n", h5tools_getprogname(), params.groups[curr_group]); } /* end for */ /* Close link creation property list */ if(H5Pclose(lcpl_id) < 0) { - error_msg(progname, "Could not close link creation property list\n"); + error_msg("Could not close link creation property list\n"); leave(EXIT_FAILURE); } /* end if */ /* Close file */ if(H5Fclose(fid) < 0) { - error_msg(progname, "Could not close output file '%s'??\n", params.fname); + error_msg("Could not close output file '%s'??\n", params.fname); leave(EXIT_FAILURE); } /* end if */ /* Close file access property list */ if(H5Pclose(fapl_id) < 0) { - error_msg(progname, "Could not close file access property list\n"); + error_msg("Could not close file access property list\n"); leave(EXIT_FAILURE); } /* end if */ |