Testing: grib_read_any_headers_only_from_file

This commit is contained in:
Shahram Najm 2024-01-26 14:16:25 +00:00
parent be94fed831
commit d7a090264b
2 changed files with 7 additions and 1 deletions

View File

@ -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;
}

View File

@ -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");