summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools_utils.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-07-06 19:45:35 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-07-06 19:45:35 (GMT)
commit98754fa9d12090f5e048fdb05cc5e9ce9111676f (patch)
tree407e611b19ee551d8153779104022dd886a467e5 /tools/lib/h5tools_utils.c
parent29321bcafa9f1c6108bb92b5a844a9d4d9c2c8e7 (diff)
downloadhdf5-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/lib/h5tools_utils.c')
-rw-r--r--tools/lib/h5tools_utils.c38
1 files changed, 34 insertions, 4 deletions
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index a51a286..ca1caa1 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -39,6 +39,8 @@ int nCols = 80;
int opt_err = 1; /*get_option prints errors if this is on */
int opt_ind = 1; /*token pointer */
const char *opt_arg; /*flag argument (or value) */
+static int h5tools_d_status = 0;
+static const char *h5tools_progname = "h5tools";
/* local functions */
static void init_table(table_t **tbl);
@@ -64,13 +66,13 @@ static void add_obj(table_t *table, haddr_t objno, const char *objname, hbool_t
*-------------------------------------------------------------------------
*/
void
-error_msg(const char *progname, const char *fmt, ...)
+error_msg(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
HDfflush(stdout);
- HDfprintf(stderr, "%s error: ", progname);
+ HDfprintf(stderr, "%s error: ", h5tools_getprogname());
HDvfprintf(stderr, fmt, ap);
va_end(ap);
@@ -93,13 +95,13 @@ error_msg(const char *progname, const char *fmt, ...)
*-------------------------------------------------------------------------
*/
void
-warn_msg(const char *progname, const char *fmt, ...)
+warn_msg(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
HDfflush(stdout);
- HDfprintf(stderr, "%s warning: ", progname);
+ HDfprintf(stderr, "%s warning: ", h5tools_getprogname());
HDvfprintf(stderr, fmt, ap);
va_end(ap);
}
@@ -758,3 +760,31 @@ out:
return Ret;
}
+
+/*-------------------------------------------------------------------------
+ * Audience: Public
+ * Chapter: H5Tools Library
+ * Purpose: Initialize the name and operation status of the H5 Tools library
+ * Description:
+ * These are utility functions to set/get the program name and operation status.
+ *-------------------------------------------------------------------------
+ */
+void h5tools_setprogname(const char *Progname)
+{
+ h5tools_progname = Progname;
+}
+
+void h5tools_setstatus(int D_status)
+{
+ h5tools_d_status = D_status;
+}
+
+const char*h5tools_getprogname()
+{
+ return h5tools_progname;
+}
+
+int h5tools_getstatus()
+{
+ return h5tools_d_status;
+}