diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2010-05-11 20:10:25 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2010-05-11 20:10:25 (GMT) |
commit | 68fa42f3360945d07a0443289025a6a91618aac5 (patch) | |
tree | ca90a2cf0244915347d531bddd78e7e7d898825d /tools/h5repack/h5repack_parse.c | |
parent | fe49632588af7cafdd220998be6006d91ed0247c (diff) | |
download | hdf5-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/h5repack/h5repack_parse.c')
-rw-r--r-- | tools/h5repack/h5repack_parse.c | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index 2d8f040..d3a7419 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -21,8 +21,6 @@ #include "h5repack.h" #include "h5tools_utils.h" -extern char *progname; - /*------------------------------------------------------------------------- * Function: parse_filter * @@ -98,7 +96,7 @@ obj_list_t* parse_filter(const char *str, obj_list = (obj_list_t*) malloc(n*sizeof(obj_list_t)); if (obj_list==NULL) { - error_msg(progname, "could not allocate object list\n"); + error_msg("could not allocate object list\n"); return NULL; } *n_objs=n; @@ -121,7 +119,7 @@ obj_list_t* parse_filter(const char *str, if (end_obj+1==(int)len) { if (obj_list) free(obj_list); - error_msg(progname, "input Error: Invalid compression type in <%s>\n",str); + error_msg("input Error: Invalid compression type in <%s>\n",str); exit(EXIT_FAILURE); } @@ -159,7 +157,7 @@ obj_list_t* parse_filter(const char *str, c = str[u]; if (!isdigit(c) && l==-1){ if (obj_list) free(obj_list); - error_msg(progname, "compression parameter not digit in <%s>\n",str); + error_msg("compression parameter not digit in <%s>\n",str); exit(EXIT_FAILURE); } if (l==-1) @@ -179,7 +177,7 @@ obj_list_t* parse_filter(const char *str, filt->cd_values[j++]=H5_SZIP_EC_OPTION_MASK; else { - error_msg(progname, "szip mask must be 'NN' or 'EC' \n"); + error_msg("szip mask must be 'NN' or 'EC' \n"); exit(EXIT_FAILURE); } @@ -219,7 +217,7 @@ obj_list_t* parse_filter(const char *str, c = str[u]; if (!isdigit(c) && l==-1){ if (obj_list) free(obj_list); - error_msg(progname, "compression parameter is not a digit in <%s>\n",str); + error_msg("compression parameter is not a digit in <%s>\n",str); exit(EXIT_FAILURE); } if (l==-1) @@ -239,7 +237,7 @@ obj_list_t* parse_filter(const char *str, filt->cd_values[j++]=H5Z_SO_FLOAT_DSCALE; else { - error_msg(progname, "scale type must be 'IN' or 'DS' \n"); + error_msg("scale type must be 'IN' or 'DS' \n"); exit(EXIT_FAILURE); } @@ -263,7 +261,7 @@ obj_list_t* parse_filter(const char *str, c = str[u]; if (!isdigit(c)){ if (obj_list) free(obj_list); - error_msg(progname, "compression parameter is not a digit in <%s>\n",str); + error_msg("compression parameter is not a digit in <%s>\n",str); exit(EXIT_FAILURE); } stype[m]=c; @@ -309,7 +307,7 @@ obj_list_t* parse_filter(const char *str, if (no_param) { /*no more parameters, GZIP must have parameter */ if (obj_list) free(obj_list); - error_msg(progname, "missing compression parameter in <%s>\n",str); + error_msg("missing compression parameter in <%s>\n",str); exit(EXIT_FAILURE); } } @@ -325,7 +323,7 @@ obj_list_t* parse_filter(const char *str, if (no_param) { /*no more parameters, SZIP must have parameter */ if (obj_list) free(obj_list); - error_msg(progname, "missing compression parameter in <%s>\n",str); + error_msg("missing compression parameter in <%s>\n",str); exit(EXIT_FAILURE); } } @@ -341,7 +339,7 @@ obj_list_t* parse_filter(const char *str, if (m>0) { /*shuffle does not have parameter */ if (obj_list) free(obj_list); - error_msg(progname, "extra parameter in SHUF <%s>\n",str); + error_msg("extra parameter in SHUF <%s>\n",str); exit(EXIT_FAILURE); } } @@ -356,7 +354,7 @@ obj_list_t* parse_filter(const char *str, if (m>0) { /*shuffle does not have parameter */ if (obj_list) free(obj_list); - error_msg(progname, "extra parameter in FLET <%s>\n",str); + error_msg("extra parameter in FLET <%s>\n",str); exit(EXIT_FAILURE); } } @@ -371,7 +369,7 @@ obj_list_t* parse_filter(const char *str, if (m>0) { /*nbit does not have parameter */ if (obj_list) free(obj_list); - error_msg(progname, "extra parameter in NBIT <%s>\n",str); + error_msg("extra parameter in NBIT <%s>\n",str); exit(EXIT_FAILURE); } } @@ -386,13 +384,13 @@ obj_list_t* parse_filter(const char *str, if (no_param) { /*no more parameters, SOFF must have parameter */ if (obj_list) free(obj_list); - error_msg(progname, "missing compression parameter in <%s>\n",str); + error_msg("missing compression parameter in <%s>\n",str); exit(EXIT_FAILURE); } } else { if (obj_list) free(obj_list); - error_msg(progname, "invalid filter type in <%s>\n",str); + error_msg("invalid filter type in <%s>\n",str); exit(EXIT_FAILURE); } } @@ -415,7 +413,7 @@ obj_list_t* parse_filter(const char *str, if (filt->cd_values[0]>9 ) { if (obj_list) free(obj_list); - error_msg(progname, "invalid compression parameter in <%s>\n",str); + error_msg("invalid compression parameter in <%s>\n",str); exit(EXIT_FAILURE); } break; @@ -430,19 +428,19 @@ obj_list_t* parse_filter(const char *str, if ((pixels_per_block%2)==1) { if (obj_list) free(obj_list); - error_msg(progname, "pixels_per_block is not even in <%s>\n",str); + error_msg("pixels_per_block is not even in <%s>\n",str); exit(EXIT_FAILURE); } if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK) { if (obj_list) free(obj_list); - error_msg(progname, "pixels_per_block is too large in <%s>\n",str); + error_msg("pixels_per_block is too large in <%s>\n",str); exit(EXIT_FAILURE); } if ( (strcmp(smask,"NN")!=0) && (strcmp(smask,"EC")!=0) ) { if (obj_list) free(obj_list); - error_msg(progname, "szip mask must be 'NN' or 'EC' \n"); + error_msg("szip mask must be 'NN' or 'EC' \n"); exit(EXIT_FAILURE); } break; @@ -519,7 +517,7 @@ obj_list_t* parse_layout(const char *str, obj_list = (obj_list_t*) malloc(n*sizeof(obj_list_t)); if (obj_list==NULL) { - error_msg(progname, "could not allocate object list\n"); + error_msg("could not allocate object list\n"); return NULL; } *n_objs=n; @@ -543,7 +541,7 @@ obj_list_t* parse_layout(const char *str, if (end_obj+1==(int)len) { if (obj_list) free(obj_list); - error_msg(progname, "in parse layout, no characters after : in <%s>\n",str); + error_msg("in parse layout, no characters after : in <%s>\n",str); exit(EXIT_FAILURE); } @@ -560,7 +558,7 @@ obj_list_t* parse_layout(const char *str, else if (strcmp(slayout,"CHUNK")==0) pack->layout=H5D_CHUNKED; else { - error_msg(progname, "in parse layout, not a valid layout in <%s>\n",str); + error_msg("in parse layout, not a valid layout in <%s>\n",str); exit(EXIT_FAILURE); } } @@ -584,7 +582,7 @@ obj_list_t* parse_layout(const char *str, if (j>(int)len) { if (obj_list) free(obj_list); - error_msg(progname, "in parse layout, <%s> Chunk dimensions missing\n",str); + error_msg("in parse layout, <%s> Chunk dimensions missing\n",str); exit(EXIT_FAILURE); } @@ -598,7 +596,7 @@ obj_list_t* parse_layout(const char *str, && c!='N' && c!='O' && c!='N' && c!='E' ){ if (obj_list) free(obj_list); - error_msg(progname, "in parse layout, <%s> Not a valid character in <%s>\n", + error_msg("in parse layout, <%s> Not a valid character in <%s>\n", sdim,str); exit(EXIT_FAILURE); } @@ -611,7 +609,7 @@ obj_list_t* parse_layout(const char *str, pack->chunk.chunk_lengths[c_index]=atoi(sdim); if (pack->chunk.chunk_lengths[c_index]==0) { if (obj_list) free(obj_list); - error_msg(progname, "in parse layout, <%s> conversion to number in <%s>\n", + error_msg("in parse layout, <%s> conversion to number in <%s>\n", sdim,str); exit(EXIT_FAILURE); } @@ -629,7 +627,7 @@ obj_list_t* parse_layout(const char *str, pack->chunk.chunk_lengths[c_index]=atoi(sdim); if (pack->chunk.chunk_lengths[c_index]==0){ if (obj_list) free(obj_list); - error_msg(progname, "in parse layout, <%s> conversion to number in <%s>\n", + error_msg("in parse layout, <%s> conversion to number in <%s>\n", sdim,str); exit(EXIT_FAILURE); } |