diff options
Diffstat (limited to 'tools/h5repack/h5repack.c')
-rw-r--r-- | tools/h5repack/h5repack.c | 20 |
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); } } |