mirror of https://github.com/ecmwf/eccodes.git
Testing: grib_read_any_headers_only_from_file
This commit is contained in:
parent
be94fed831
commit
d7a090264b
|
@ -689,7 +689,6 @@ static int read_WRAP(reader* r)
|
|||
tmp[i++] = 'P';
|
||||
|
||||
if ((r->read(r->read_data, buf, 8, &err) != 8) || err) {
|
||||
printf("error\n");
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,13 @@ int main(int argc, char** argv)
|
|||
in = fopen(argv[1], "r");
|
||||
if (!in) return 1;
|
||||
|
||||
grib_context* c = grib_context_get_default();
|
||||
err = grib_read_any_headers_only_from_file(c, in, buffer, &len);
|
||||
printf("ANY (headers only): err=%s, len=%zu\n", grib_get_error_message(err), len);
|
||||
|
||||
rewind(in);
|
||||
len = SIZE;
|
||||
|
||||
err = wmo_read_any_from_file(in, buffer, &len);
|
||||
if (err == GRIB_END_OF_FILE && len == 0)
|
||||
printf("end of file\n");
|
||||
|
|
Loading…
Reference in New Issue