summaryrefslogtreecommitdiffstats
path: root/tools/h5jam/getub.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2010-05-11 17:49:41 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2010-05-11 17:49:41 (GMT)
commit05d75af8b88cc13232eda2b1660c1bb9ae0bb831 (patch)
tree6f103b56a01c45a3b98bd914f4cccb996bbc931e /tools/h5jam/getub.c
parent9e595dec197d2812b13c4b86cf3389549c54fbb5 (diff)
downloadhdf5-05d75af8b88cc13232eda2b1660c1bb9ae0bb831.zip
hdf5-05d75af8b88cc13232eda2b1660c1bb9ae0bb831.tar.gz
hdf5-05d75af8b88cc13232eda2b1660c1bb9ae0bb831.tar.bz2
[svn-r18757] 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 windows - H5pubconf.h for packed bits function 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..7468db2 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 (h5tools_getprogname(), "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 (h5tools_getprogname(), "missing size\n");
+ usage (h5tools_getprogname());
exit (EXIT_FAILURE);
}
if (argc <= (opt_ind))
{
- error_msg (progname, "missing file name\n");
- usage (progname);
+ error_msg (h5tools_getprogname(), "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 (h5tools_getprogname(), "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 (h5tools_getprogname(), "can't open file %s\n", filename);
exit (EXIT_FAILURE);
}