ECC-323: bufr_dump should fail if decoding fails

This commit is contained in:
Shahram Najm 2016-08-30 13:45:02 +01:00
parent e46bce1dea
commit 556104df42
37 changed files with 249 additions and 203 deletions

View File

@ -1280,7 +1280,7 @@ static int compare_handles(grib_handle* handle1, grib_handle* handle2, grib_runt
return err;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -115,7 +115,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -136,15 +136,17 @@ int grib_tool_new_filename_action(grib_runtime_options* options,const char* file
int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file)
{
char tmp[1024];
if (!options->current_infile->name) return 0;
if (json) return 0;
if (grib_options_on("E:")) {
} else {
sprintf(tmp,"FILE: %s ",options->current_infile->name);
if (!grib_options_on("C"))
fprintf(stdout,"***** %s\n",tmp);
/* No action */
}
else {
char tmp[1024];
sprintf(tmp,"FILE: %s ",options->current_infile->name);
if (!grib_options_on("C"))
fprintf(stdout,"***** %s\n",tmp);
}
return 0;
@ -153,7 +155,6 @@ int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* fil
int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
{
long length=0;
char tmp[1024];
int i,err=0;
grib_accessor* a=NULL;
grib_accessors_list* al=NULL;
@ -163,7 +164,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
if (!options->skip) {
if (options->set_values_count != 0)
err=grib_set_values(h,options->set_values,options->set_values_count);
if( err != GRIB_SUCCESS && options->fail) exit(err);
if (err != GRIB_SUCCESS && options->fail) exit(err);
}
for (i=0;i<options->print_keys_count;i++)
@ -182,9 +183,15 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
case 'f':
err=grib_set_long(h,"unpack",2);
if (err) {
fprintf(stdout,"\"ERROR: unable to unpack data section\"");
options->error=err;
return err;
if (options->fail) {
fprintf(stderr, "ERROR: unable to unpack data section: %s (message=%d)\n",
grib_get_error_message(err), options->handle_count);
exit(err);
} else {
fprintf(stdout,"\"ERROR: unable to unpack data section\"");
options->error=err;
return err;
}
}
a=grib_find_accessor(h,"numericValues");
al=accessor_bufr_data_array_get_dataAccessors(a);
@ -194,18 +201,30 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
case 's':
err=grib_set_long(h,"unpack",1);
if (err) {
fprintf(stdout,"\"ERROR: unable to unpack data section\"");
options->error=err;
return err;
if (options->fail) {
fprintf(stderr, "ERROR: unable to unpack data section: %s (message=%d)\n",
grib_get_error_message(err), options->handle_count);
exit(err);
} else {
fprintf(stdout,"\"ERROR: unable to unpack data section\"");
options->error=err;
return err;
}
}
grib_dump_content(h,stdout,options->dump_mode,options->dump_flags,0);
break;
case 'a':
err=grib_set_long(h,"unpack",1);
if (err) {
fprintf(stdout,"\"ERROR: unable to unpack data section\"");
options->error=err;
return err;
if (options->fail) {
fprintf(stderr, "ERROR: unable to unpack data section: %s (message=%d)\n",
grib_get_error_message(err), options->handle_count);
exit(err);
} else {
fprintf(stdout,"\"ERROR: unable to unpack data section\"");
options->error=err;
return err;
}
}
options->dump_flags=GRIB_DUMP_FLAG_ALL_ATTRIBUTES;
grib_dump_content(h,stdout,options->dump_mode,options->dump_flags,0);
@ -214,28 +233,40 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
printf("Unknown JSON option %s\n",json_option);
exit(1);
}
if (!strcmp(options->dump_mode,"default"))
printf("}\n");
if (!strcmp(options->dump_mode,"default")) {
printf("}\n");
}
} else if (grib_options_on("O")) {
char tmp[1024];
sprintf(tmp,"MESSAGE %d ( length=%ld )",options->handle_count,length);
if (!grib_options_on("C"))
fprintf(stdout,"#============== %-38s ==============\n",tmp);
err=grib_set_long(h,"unpack",1);
if (err) {
fprintf(stdout,"\"ERROR: unable to unpack data section\"");
options->error=err;
return err;
if (options->fail) {
fprintf(stderr, "ERROR: unable to unpack data section: %s\n",grib_get_error_message(err));
exit(err);
} else {
fprintf(stdout,"\"ERROR: unable to unpack data section\"");
options->error=err;
return err;
}
}
grib_dump_content(h,stdout,options->dump_mode,options->dump_flags,0);
} else {
err=grib_set_long(h,"unpack",1);
if (err) {
fprintf(stdout,"\"ERROR: unable to unpack data section\"");
options->error=err;
return err;
}
dumper=grib_dump_content_with_dumper(h,dumper,stdout,options->dump_mode,options->dump_flags,0);
if (!dumper) exit(1);
err=grib_set_long(h,"unpack",1);
if (err) {
if (options->fail) {
fprintf(stderr, "ERROR: unable to unpack data section: %s\n",grib_get_error_message(err));
exit(err);
} else {
fprintf(stdout,"\"ERROR: unable to unpack data section\"");
options->error=err;
return err;
}
}
dumper=grib_dump_content_with_dumper(h,dumper,stdout,options->dump_mode,options->dump_flags,0);
if (!dumper) exit(1);
}
return 0;
@ -256,28 +287,29 @@ int grib_tool_finalise_action(grib_runtime_options* options)
{
if (json) fprintf(stdout,"\n]}\n");
if (!strcmp(options->dump_mode,"filter")) {
fprintf(stdout,"set pack=1;\nwrite;\n");
fprintf(stdout,"set pack=1;\nwrite;\n");
}
if (!strcmp(options->dump_mode,"fortran")) {
fprintf(stdout,"end program bufr_create_message\n");
fprintf(stdout,"end program bufr_create_message\n");
}
if (!strcmp(options->dump_mode,"python")) {
fprintf(stdout,"\n\n");
fprintf(stdout,"def main():\n");
fprintf(stdout," try:\n");
fprintf(stdout," bufr_create_message()\n");
fprintf(stdout," except CodesInternalError as err:\n");
fprintf(stdout," traceback.print_exc(file=sys.stderr)\n");
fprintf(stdout," return 1\n");
fprintf(stdout,"\n\n");
fprintf(stdout,"if __name__ == \"__main__\":\n");
fprintf(stdout," sys.exit(main())\n");
fprintf(stdout,"\n\n");
fprintf(stdout,"def main():\n");
fprintf(stdout," try:\n");
fprintf(stdout," bufr_create_message()\n");
fprintf(stdout," except CodesInternalError as err:\n");
fprintf(stdout," traceback.print_exc(file=sys.stderr)\n");
fprintf(stdout," return 1\n");
fprintf(stdout,"\n\n");
fprintf(stdout,"if __name__ == \"__main__\":\n");
fprintf(stdout," sys.exit(main())\n");
}
return 0;
}
int grib_no_handle_action(int err) {
int grib_no_handle_action(grib_runtime_options* options, int err)
{
if (json ){
if (first_handle) {
fprintf(dump_file,"{ \"messages\" : [ \n");
@ -287,5 +319,8 @@ int grib_no_handle_action(int err) {
}
}
fprintf(dump_file,"\"ERROR: unreadable message\"\n");
if (options->fail) {
exit(1);
}
return 0;
}

View File

@ -114,8 +114,8 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err) {
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
}

View File

@ -214,8 +214,9 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err) {
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
}

View File

@ -148,8 +148,8 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err) {
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
}

View File

@ -374,8 +374,8 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err) {
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
}

View File

@ -168,8 +168,8 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err) {
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
}

View File

@ -1126,7 +1126,7 @@ static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options*
return err;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -142,7 +142,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -211,7 +211,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -118,8 +118,8 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err) {
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
}

View File

@ -217,7 +217,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -285,9 +285,8 @@ static grib_values* get_key_values(grib_runtime_options* options,grib_handle* h)
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
}

View File

@ -148,7 +148,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -390,7 +390,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -29,68 +29,75 @@ char* grib_tool_name="grib_merge";
char* grib_tool_usage="[options] file file ... output_file";
grib_option grib_options[]={
/* {id, args, help}, on, command_line, value */
{"f",0,0,0,1,0},
{"c",0,0,1,0,0},
{"r",0,0,0,1,0},
{"q",0,0,1,0,0},
{"p:",0,0,1,1,0},
{"P:",0,0,0,1,0},
{"B:",0,0,1,1,"md5Product"},
{"V",0,0,0,1,0},
{"W:",0,0,0,1,0},
{"M",0,0,0,1,0},
{"U",0,0,1,0,0},
{"H",0,0,1,0,0},
{"T:",0,0,1,0,"G"},
{"S",0,0,1,0,0},
{"g",0,0,0,1,0},
{"G",0,0,0,1,0},
{"7",0,0,0,1,0},
{"v",0,0,0,1,0}
/* {id, args, help}, on, command_line, value */
{"f",0,0,0,1,0},
{"c",0,0,1,0,0},
{"r",0,0,0,1,0},
{"q",0,0,1,0,0},
{"p:",0,0,1,1,0},
{"P:",0,0,0,1,0},
{"B:",0,0,1,1,"md5Product"},
{"V",0,0,0,1,0},
{"W:",0,0,0,1,0},
{"M",0,0,0,1,0},
{"U",0,0,1,0,0},
{"H",0,0,1,0,0},
{"T:",0,0,1,0,"G"},
{"S",0,0,1,0,0},
{"g",0,0,0,1,0},
{"G",0,0,0,1,0},
{"7",0,0,0,1,0},
{"v",0,0,0,1,0}
};
int grib_options_count=sizeof(grib_options)/sizeof(grib_option);
int main(int argc, char *argv[]) {
int ret=grib_tool(argc,argv);
return ret;
int main(int argc, char *argv[])
{
int ret=grib_tool(argc,argv);
return ret;
}
int grib_tool_before_getopt(grib_runtime_options* options) {
return 0;
int grib_tool_before_getopt(grib_runtime_options* options)
{
return 0;
}
int grib_tool_init(grib_runtime_options* options) {
return 0;
int grib_tool_init(grib_runtime_options* options)
{
return 0;
}
int grib_tool_new_filename_action(grib_runtime_options* options,const char* file) {
return 0;
int grib_tool_new_filename_action(grib_runtime_options* options,const char* file)
{
return 0;
}
int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file) {
return 0;
int grib_tool_new_file_action(grib_runtime_options* options,grib_tools_file* file)
{
return 0;
}
int idx(double lat,double lon,double latFirst,double lonFirst,double latLast,double lonLast,
long Ni,double di,double dj) {
long ilon,ilat;
if ((ilon=(lon-lonFirst)/di) < 0 ) return -1;
if ((ilat=(latFirst-lat)/dj) < 0 ) return -1;
if (lon>lonLast) {
if (lonLast==180) {
lon-=360;
ilon=(lon-lonFirst)/di;
} else
return -1;
}
if (lat<latLast) return -1;
if ((ilat=(latFirst-lat)/dj) < 0 ) return -1;
return ilon+ilat*Ni;
long Ni,double di,double dj)
{
long ilon,ilat;
if ((ilon=(lon-lonFirst)/di) < 0 ) return -1;
if ((ilat=(latFirst-lat)/dj) < 0 ) return -1;
if (lon>lonLast) {
if (lonLast==180) {
lon-=360;
ilon=(lon-lonFirst)/di;
} else
return -1;
}
if (lat<latLast) return -1;
if ((ilat=(latFirst-lat)/dj) < 0 ) return -1;
return ilon+ilat*Ni;
}
grib_handle* merge(grib_handle* h1,grib_handle* h2) {
grib_handle* merge(grib_handle* h1,grib_handle* h2)
{
char s1[100]={0,};
size_t len1;
char s2[100]={0,};
@ -116,11 +123,11 @@ grib_handle* merge(grib_handle* h1,grib_handle* h2) {
| GRIB_DUMP_FLAG_VALUES
| GRIB_DUMP_FLAG_READ_ONLY;
*/
*/
/* same products? */
if (grib_key_equal(h1,h2,"md5Product",GRIB_TYPE_STRING,&err)==0 && err==0) {
return NULL;
return NULL;
}
/* can we do it?*/
@ -141,12 +148,12 @@ grib_handle* merge(grib_handle* h1,grib_handle* h2) {
if (!grib_key_equal(h1,h2,"iDirectionIncrementInDegrees",GRIB_TYPE_DOUBLE,&err) ) {
grib_context_log(h1->context,GRIB_LOG_WARNING,
"unable to merge: different iDirectionIncrementInDegrees");
"unable to merge: different iDirectionIncrementInDegrees");
return NULL;
}
if (!grib_key_equal(h1,h2,"jDirectionIncrementInDegrees",GRIB_TYPE_DOUBLE,&err) ) {
grib_context_log(h1->context,GRIB_LOG_WARNING,
"unable to merge: different jDirectionIncrementInDegrees");
"unable to merge: different jDirectionIncrementInDegrees");
return NULL;
}
@ -171,10 +178,10 @@ grib_handle* merge(grib_handle* h1,grib_handle* h2) {
/* do we have something to do?*/
if ( grib_key_equal(h1,h2,"latitudeOfFirstGridPointInDegrees",GRIB_TYPE_DOUBLE,&err) &&
grib_key_equal(h1,h2,"latitudeOfLastGridPointInDegrees",GRIB_TYPE_DOUBLE,&err) &&
grib_key_equal(h1,h2,"longitudeOfFirstGridPointInDegrees",GRIB_TYPE_DOUBLE,&err) &&
grib_key_equal(h1,h2,"longitudeOfLastGridPointInDegrees",GRIB_TYPE_DOUBLE,&err)
) {
grib_key_equal(h1,h2,"latitudeOfLastGridPointInDegrees",GRIB_TYPE_DOUBLE,&err) &&
grib_key_equal(h1,h2,"longitudeOfFirstGridPointInDegrees",GRIB_TYPE_DOUBLE,&err) &&
grib_key_equal(h1,h2,"longitudeOfLastGridPointInDegrees",GRIB_TYPE_DOUBLE,&err)
) {
/* no we don't */
return NULL;
}
@ -221,8 +228,8 @@ grib_handle* merge(grib_handle* h1,grib_handle* h2) {
if (lonFirst==0 && lonLast==360) lonLast-=di;
if (lonFirst==-180 && lonLast==180) {
lonFirst=0;
lonLast=360-di;
lonFirst=0;
lonLast=360-di;
}
/* create new grib for bigger area*/
@ -272,11 +279,11 @@ grib_handle* merge(grib_handle* h1,grib_handle* h2) {
grib_get_double_array(h2,"values",v2,&sn);
for (i=0;i<n;i++) {
if ((j=idx(lat[i],lon[i],latFirst1,lonFirst1,latLast1,lonLast1,Ni1,di1,dj1)) >=0 ) {
v[i]=v1[j];
} else if ( (j=idx(lat[i],lon[i],latFirst2,lonFirst2,latLast2,lonLast2,Ni2,di2,dj2))>=0) {
v[i]=v2[j];
}
if ((j=idx(lat[i],lon[i],latFirst1,lonFirst1,latLast1,lonLast1,Ni1,di1,dj1)) >=0 ) {
v[i]=v1[j];
} else if ( (j=idx(lat[i],lon[i],latFirst2,lonFirst2,latLast2,lonLast2,Ni2,di2,dj2))>=0) {
v[i]=v2[j];
}
}
grib_set_double_array(h,"values",v,n);
@ -284,50 +291,54 @@ grib_handle* merge(grib_handle* h1,grib_handle* h2) {
return h;
}
int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) {
int err=0;
grib_handle* hm=0;
char md5[200]={0,};
char fname[210]={0,};
size_t lmd5;
int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
{
int err=0;
grib_handle* hm=0;
char md5[200]={0,};
char fname[210]={0,};
size_t lmd5;
if (!hh) { hh=grib_handle_clone(h); return 0; }
grib_get_string(h,"md5Product",md5,&lmd5);
sprintf(fname,"_%s.orig.grib",md5);
grib_write_message(h,fname,"a");
if (!hh) { hh=grib_handle_clone(h); return 0; }
grib_get_string(h,"md5Product",md5,&lmd5);
sprintf(fname,"_%s.orig.grib",md5);
grib_write_message(h,fname,"a");
if ((hm=merge(h,hh))==NULL ) {
grib_tools_write_message(options,hh);
lmd5=sizeof(md5)/sizeof(*md5);
grib_get_string(hh,"md5Product",md5,&lmd5);
sprintf(fname,"_%s.merge.grib",md5);
grib_write_message(hh,fname,"a");
}
grib_handle_delete(hh);
hh = hm!=NULL ? hm : grib_handle_clone(h) ;
if ((hm=merge(h,hh))==NULL ) {
grib_tools_write_message(options,hh);
lmd5=sizeof(md5)/sizeof(*md5);
grib_get_string(hh,"md5Product",md5,&lmd5);
sprintf(fname,"_%s.merge.grib",md5);
grib_write_message(hh,fname,"a");
}
grib_handle_delete(hh);
hh = hm!=NULL ? hm : grib_handle_clone(h) ;
return err;
return err;
}
int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) {
grib_handle_delete(h);
return 0;
int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h)
{
grib_handle_delete(h);
return 0;
}
void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h) {
grib_print_key_values(options,h);
void grib_tool_print_key_values(grib_runtime_options* options,grib_handle* h)
{
grib_print_key_values(options,h);
}
int grib_tool_finalise_action(grib_runtime_options* options) {
grib_tools_write_message(options,hh);
if (options->outfile->file) {
fclose(options->outfile->file);
}
return 0;
int grib_tool_finalise_action(grib_runtime_options* options)
{
grib_tools_write_message(options,hh);
if (options->outfile->file) {
fclose(options->outfile->file);
}
return 0;
}
int grib_no_handle_action(int err) {
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
}

View File

@ -169,7 +169,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -4243,7 +4243,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -228,7 +228,7 @@ static int grib_tool_with_orderby(grib_runtime_options* options)
options->error=err;
if (!h) {
grib_no_handle_action(err);
grib_no_handle_action(options, err);
failed=(grib_failed*)grib_context_malloc_clear(c,sizeof(grib_failed));
failed->count=infile->handle_count;
@ -327,7 +327,7 @@ static int grib_tool_without_orderby(grib_runtime_options* options)
if (!h) {
/* fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n"); */
grib_no_handle_action(err);
grib_no_handle_action(options, err);
failed=(grib_failed*)grib_context_malloc_clear(c,sizeof(grib_failed));
failed->count=infile->handle_count;

View File

@ -194,7 +194,7 @@ int grib_get_runtime_options(int argc,char** argv,grib_runtime_options* options)
int grib_process_runtime_options(grib_context* c,int argc,char** argv,grib_runtime_options* options);
void grib_tools_write_message(grib_runtime_options* options, grib_handle* h);
int grib_tool_new_filename_action(grib_runtime_options* options,const char* file);
int grib_no_handle_action(int err);
int grib_no_handle_action(grib_runtime_options* options,int err);
#endif

View File

@ -951,8 +951,8 @@ static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options*
return err;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
}

View File

@ -111,7 +111,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -152,8 +152,8 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
}

View File

@ -102,7 +102,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -98,7 +98,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -119,7 +119,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -1166,8 +1166,8 @@ static int compare_handles(grib_handle* h1,grib_handle* h2,grib_runtime_options*
return err;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
}

View File

@ -111,7 +111,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -157,8 +157,8 @@ int grib_tool_finalise_action(grib_runtime_options* options) {
return 0;
}
int grib_no_handle_action(int err) {
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
}

View File

@ -100,7 +100,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -101,7 +101,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -349,8 +349,8 @@ int grib_tool_finalise_action(grib_runtime_options* options) {
return 0;
}
int grib_no_handle_action(int err) {
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;
}

View File

@ -158,7 +158,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -102,7 +102,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -212,7 +212,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;

View File

@ -269,7 +269,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
return 0;
}
int grib_no_handle_action(int err)
int grib_no_handle_action(grib_runtime_options* options, int err)
{
fprintf(dump_file,"\t\t\"ERROR: unreadable message\"\n");
return 0;