summaryrefslogtreecommitdiffstats
path: root/tools/h5jam/getub.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2010-05-11 20:10:25 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2010-05-11 20:10:25 (GMT)
commit68fa42f3360945d07a0443289025a6a91618aac5 (patch)
treeca90a2cf0244915347d531bddd78e7e7d898825d /tools/h5jam/getub.c
parentfe49632588af7cafdd220998be6006d91ed0247c (diff)
downloadhdf5-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/h5jam/getub.c')
-rw-r--r--tools/h5jam/getub.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c
index 2fb5833..293aa17 100644
--- a/tools/h5jam/getub.c
+++ b/tools/h5jam/getub.c
@@ -28,7 +28,8 @@ void parse_command_line (int argc, const char *argv[]);
#define TRUE 1
#define FALSE 0
-static const char *progname="getub";
+/* Name of tool */
+#define PROGRAMNAME "getub"
char *nbytes = NULL;
static const char *s_opts = "c:"; /* add more later ? */
@@ -89,15 +90,15 @@ parse_command_line (int argc, const char *argv[])
break;
case '?':
default:
- usage (progname);
+ usage (h5tools_getprogname());
exit (EXIT_FAILURE);
}
}
if (argc <= opt_ind)
{
- error_msg (progname, "missing file name\n");
- usage (progname);
+ error_msg("missing file name\n");
+ usage (h5tools_getprogname());
exit (EXIT_FAILURE);
}
}
@@ -111,19 +112,22 @@ main (int argc, const char *argv[])
long res;
char *buf;
+ h5tools_setprogname(PROGRAMNAME);
+ h5tools_setstatus(EXIT_SUCCESS);
+
parse_command_line (argc, argv);
if (nbytes == NULL)
{
/* missing arg */
- error_msg (progname, "missing size\n");
- usage (progname);
+ error_msg("missing size\n");
+ usage (h5tools_getprogname());
exit (EXIT_FAILURE);
}
if (argc <= (opt_ind))
{
- error_msg (progname, "missing file name\n");
- usage (progname);
+ error_msg("missing file name\n");
+ usage (h5tools_getprogname());
exit (EXIT_FAILURE);
}
filename = HDstrdup (argv[opt_ind]);
@@ -133,15 +137,15 @@ main (int argc, const char *argv[])
if (res == EOF)
{
/* fail */
- error_msg (progname, "missing file name\n");
- usage (progname);
+ error_msg("missing file name\n");
+ usage (h5tools_getprogname());
exit (EXIT_FAILURE);
}
fd = HDopen (filename, O_RDONLY, 0);
if (fd < 0)
{
- error_msg (progname, "can't open file %s\n", filename);
+ error_msg("can't open file %s\n", filename);
exit (EXIT_FAILURE);
}