Dead code removal: TAF and METAR

This commit is contained in:
Shahram Najm 2024-01-07 14:07:23 +00:00
parent 25ca99dc0b
commit b5470b2297
2 changed files with 42 additions and 51 deletions

View File

@ -1020,8 +1020,6 @@ int wmo_read_any_from_file(FILE* f, void* buffer, size_t* len);
int wmo_read_grib_from_file(FILE* f, void* buffer, size_t* len); int wmo_read_grib_from_file(FILE* f, void* buffer, size_t* len);
int wmo_read_bufr_from_file(FILE* f, void* buffer, size_t* len); int wmo_read_bufr_from_file(FILE* f, void* buffer, size_t* len);
int wmo_read_gts_from_file(FILE* f, void* buffer, size_t* len); int wmo_read_gts_from_file(FILE* f, void* buffer, size_t* len);
int wmo_read_taf_from_file(FILE* f, void* buffer, size_t* len);
int wmo_read_metar_from_file(FILE* f, void* buffer, size_t* len);
int wmo_read_any_from_file_fast(FILE* f, size_t* msg_len, off_t* msg_offset); int wmo_read_any_from_file_fast(FILE* f, size_t* msg_len, off_t* msg_offset);
int wmo_read_grib_from_file_fast(FILE* f, size_t* msg_len, off_t* msg_offset); int wmo_read_grib_from_file_fast(FILE* f, size_t* msg_len, off_t* msg_offset);
int wmo_read_bufr_from_file_fast(FILE* f, size_t* msg_len, off_t* msg_offset); int wmo_read_bufr_from_file_fast(FILE* f, size_t* msg_len, off_t* msg_offset);

View File

@ -1267,57 +1267,50 @@ int wmo_read_gts_from_file(FILE* f, void* buffer, size_t* len)
return err; return err;
} }
int wmo_read_taf_from_file(FILE* f, void* buffer, size_t* len) // int wmo_read_taf_from_file(FILE* f, void* buffer, size_t* len)
{ // {
int err; // int err;
user_buffer_t u; // user_buffer_t u;
reader r; // reader r;
// u.user_buffer = buffer;
// u.buffer_size = *len;
u.user_buffer = buffer; // r.read_data = f;
u.buffer_size = *len; // r.read = &stdio_read;
// r.alloc_data = &u;
// r.alloc = &user_provider_buffer;
// r.headers_only = 0;
// r.seek = &stdio_seek;
// r.seek_from_start = &stdio_seek_from_start;
// r.tell = &stdio_tell;
// r.offset = 0;
// r.message_size = 0;
// err = read_any_taf(&r);
// *len = r.message_size;
// return err;
// }
r.read_data = f; // int wmo_read_metar_from_file(FILE* f, void* buffer, size_t* len)
r.read = &stdio_read; // {
r.alloc_data = &u; // int err;
r.alloc = &user_provider_buffer; // user_buffer_t u;
r.headers_only = 0; // reader r;
r.seek = &stdio_seek; // u.user_buffer = buffer;
r.seek_from_start = &stdio_seek_from_start; // u.buffer_size = *len;
r.tell = &stdio_tell; // r.read_data = f;
r.offset = 0; // r.read = &stdio_read;
r.message_size = 0; // r.alloc_data = &u;
// r.alloc = &user_provider_buffer;
err = read_any_taf(&r); // r.headers_only = 0;
*len = r.message_size; // r.seek = &stdio_seek;
// r.seek_from_start = &stdio_seek_from_start;
return err; // r.tell = &stdio_tell;
} // r.offset = 0;
// r.message_size = 0;
int wmo_read_metar_from_file(FILE* f, void* buffer, size_t* len) // err = read_any_metar(&r);
{ // *len = r.message_size;
int err; // return err;
user_buffer_t u; // }
reader r;
u.user_buffer = buffer;
u.buffer_size = *len;
r.read_data = f;
r.read = &stdio_read;
r.alloc_data = &u;
r.alloc = &user_provider_buffer;
r.headers_only = 0;
r.seek = &stdio_seek;
r.seek_from_start = &stdio_seek_from_start;
r.tell = &stdio_tell;
r.offset = 0;
r.message_size = 0;
err = read_any_metar(&r);
*len = r.message_size;
return err;
}
/*================== */ /*================== */