diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2010-05-11 20:10:25 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2010-05-11 20:10:25 (GMT) |
commit | 68fa42f3360945d07a0443289025a6a91618aac5 (patch) | |
tree | ca90a2cf0244915347d531bddd78e7e7d898825d /tools/h5ls/h5ls.c | |
parent | fe49632588af7cafdd220998be6006d91ed0247c (diff) | |
download | hdf5-68fa42f3360945d07a0443289025a6a91618aac5.zip hdf5-68fa42f3360945d07a0443289025a6a91618aac5.tar.gz hdf5-68fa42f3360945d07a0443289025a6a91618aac5.tar.bz2 |
[svn-r18759] pull r18757 from 1.8 branch
Enable tools lib to be built as a dll on windows. Added two get/set functions for progname and d_status.
Also add windows import/export declarations to functions.
Updated error_mesg() and warn_mesg() to remove progname argument and use get functions
Tested:
Windows, linux
Diffstat (limited to 'tools/h5ls/h5ls.c')
-rw-r--r-- | tools/h5ls/h5ls.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index ab3a110..c856642 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -29,6 +29,9 @@ #include "h5tools_utils.h" #include "h5trav.h" +/* Name of tool */ +#define PROGRAMNAME "h5ls" + #define NAME_BUF_SIZE 2048 /* Struct to keep track of external link targets visited */ @@ -88,9 +91,6 @@ static struct dispatch_t { static void display_type(hid_t type, int ind); static herr_t visit_obj(hid_t file, const char *oname, iter_t *iter); -const char *progname="h5ls"; -int d_status; - /*------------------------------------------------------------------------- * Function: usage @@ -135,7 +135,7 @@ usage: %s [OPTIONS] [OBJECTS...]\n\ within the file then the contents of the root group are displayed).\n\ The file name may include a printf(3C) integer format such as\n\ \"%%05d\" to open a file family.\n", - progname); + h5tools_getprogname()); } @@ -2182,6 +2182,9 @@ main(int argc, const char *argv[]) const char *preferred_driver = NULL; int err_openfile = 0; + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + /* Initialize h5tools lib */ h5tools_init(); @@ -2249,7 +2252,7 @@ main(int argc, const char *argv[]) } else if(!HDstrcmp(argv[argno], "--verbose")) { verbose_g++; } else if(!HDstrcmp(argv[argno], "--version")) { - print_version(progname); + print_version(h5tools_getprogname()); leave(EXIT_SUCCESS); } else if(!HDstrcmp(argv[argno], "--hexdump")) { hexdump_g = TRUE; @@ -2325,7 +2328,7 @@ main(int argc, const char *argv[]) break; case 'V': /* --version */ - print_version(progname); + print_version(h5tools_getprogname()); leave(EXIT_SUCCESS); case 'x': /* --hexdump */ |