summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2006-10-05 14:35:40 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2006-10-05 14:35:40 (GMT)
commit5df5ee8956c9613793908169676de0fb47582c71 (patch)
treea48346c4a0d1e6284ad916807030e288a6979577 /tools/h5repack/h5repack.c
parent4d8a0f4c54b95c5b865ebdee6e82cf42c7b44c5a (diff)
downloadhdf5-5df5ee8956c9613793908169676de0fb47582c71.zip
hdf5-5df5ee8956c9613793908169676de0fb47582c71.tar.gz
hdf5-5df5ee8956c9613793908169676de0fb47582c71.tar.bz2
[svn-r12720]
added output of error messages using the tools library function error_msg, that prints the program name and error on the message tested: kagiso
Diffstat (limited to 'tools/h5repack/h5repack.c')
-rw-r--r--tools/h5repack/h5repack.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c
index 4b0bb7e..cc39201 100644
--- a/tools/h5repack/h5repack.c
+++ b/tools/h5repack/h5repack.c
@@ -14,8 +14,12 @@
#include <stdlib.h>
#include <string.h>
+#include "h5tools_utils.h"
#include "h5repack.h"
+extern char *progname;
+
+
/*-------------------------------------------------------------------------
* File: h5repack.c
* Purpose: Public API functions
@@ -137,7 +141,7 @@ int h5repack_addfilter(const char* str,
int n_objs; /*number of objects in the current -f or -c option entry */
if (options->all_filter==1){
- printf("Error: Invalid compression input: all option is present \
+ error_msg(progname, "invalid compression input: 'all' option is present \
with other objects <%s>\n",str);
return -1;
}
@@ -187,7 +191,7 @@ int h5repack_addlayout(const char* str,
init_packobject(&pack);
if (options->all_layout==1){
- printf("Error: Invalid layout input: all option \
+ error_msg(progname, "invalid layout input: 'all' option \
is present with other objects <%s>\n",str);
return -1;
}
@@ -304,7 +308,7 @@ static int check_options(pack_opt_t *options)
}
if (options->all_layout==1 && has_ck){
- printf("Error: Invalid chunking input: all option\
+ error_msg(progname, "invalid chunking input: 'all' option\
is present with other objects\n");
return -1;
}
@@ -359,7 +363,7 @@ static int check_options(pack_opt_t *options)
} /* i */
if (options->all_filter==1 && has_cp){
- printf("Error: Invalid compression input: all option\
+ error_msg(progname, "invalid compression input: 'all' option\
is present with other objects\n");
return -1;
}
@@ -403,7 +407,7 @@ void read_info(const char *filename,
if ((fp = fopen(data_file, "r")) == (FILE *)NULL) {
- printf( "Cannot open options file %s", filename);
+ error_msg(progname, "cannot open options file %s", filename);
exit(1);
}
@@ -440,7 +444,7 @@ void read_info(const char *filename,
comp_info[i-1]='\0'; /*cut the last " */
if (h5repack_addfilter(comp_info,options)==-1){
- printf( "Could not add compression option. Exiting\n");
+ error_msg(progname, "could not add compression option\n");
exit(1);
}
}
@@ -470,7 +474,7 @@ void read_info(const char *filename,
comp_info[i-1]='\0'; /*cut the last " */
if (h5repack_addlayout(comp_info,options)==-1){
- printf( "Could not add chunck option. Exiting\n");
+ error_msg(progname, "could not add chunck option\n");
exit(1);
}
}
@@ -479,7 +483,7 @@ void read_info(const char *filename,
*-------------------------------------------------------------------------
*/
else {
- printf( "Bad file format for %s", filename);
+ error_msg(progname, "bad file format for %s", filename);
exit(1);
}
}