65 if ( S_ISDIR ( st.st_mode ) )
73 if ( S_ISDIR ( st.st_mode ) )
176 printf (
"# Found tables in cache for version %u index %d\n", b->
sec1.
master_version, index );
182 for ( i = 0; i < tb->
nlines ; i++ )
204 snprintf ( b->
error, sizeof ( b->
error ),
"%s(): Cannot find bufr tables\n", __func__ );
231 snprintf ( b->
error, sizeof ( b->
error ),
"%s(): Cannot allocate memory for tables\n", __func__ );
237 snprintf ( b->
error, sizeof ( b->
error ),
"%s(): Cannot find bufr tables\n", __func__ );
310 if ( c->
ver[i] == ver )
330 free ( (
void * ) c->
tab[i] );
Include header file for bufrdeco library.
int bufrdeco_init_tables(struct bufr_tables **t)
Init a struct bufr_tables allocating space.
uint32_t buf_t
Type to set offsets and dimension of arrays or counters used in bufrdeco.
#define bufrdeco_assert(__my_expr__)
Check a expression and exit if it fails.
int bufr_read_tableC(struct bufrdeco *b)
Reads a file with table C content (Code table and bit flags) according with csv WMO format.
#define BUFRDECO_TABLES_CACHE_SIZE
Max number of structs bufr_tables in a bufr_tables_cache.
int bufr_read_tableD(struct bufrdeco *b)
Reads a file with table D content according with WMO csv format.
#define BUFRDECO_PATH_LENGTH
Length for files/directory path strings.
#define BUFRDECO_USE_TABLES_CACHE
Bit mask to the member mask of struct bufrdeco to mark the use of bufr_tables cache.
int bufr_read_tableB(struct bufrdeco *b)
const char DEFAULT_BUFRTABLES_WMO_CSV_DIR2[]
int bufrdeco_free_cache_tables(struct bufr_tables_cache *c)
deallocate and clean a bufr_tables_cache
int bufr_read_tables(struct bufrdeco *b)
Read the tables according with bufr file data from a bufr table directory.
int get_wmo_tablenames(struct bufrdeco *b)
Get the complete pathnames for WMO csv table files needed by a bufr message.
int bufrdeco_store_tables(struct bufr_tables **t, struct bufr_tables_cache *c, uint8_t ver)
Init an element of array c->tab[] if still not allocated. If allocated clean it and set *t pointing t...
const char DEFAULT_BUFRTABLES_WMO_CSV_DIR1[]
int bufrdeco_cache_tables_search(struct bufr_tables_cache *c, uint8_t ver)
Search a struct bufr_tables in bufr_tables_cache.
Store a table B readed from a file formated and named as ECMWF bufrdc package.
struct bufr_tableB_decoded_item item[BUFR_MAXLINES_TABLEB]
char path[BUFRDECO_PATH_LENGTH]
char path[BUFRDECO_PATH_LENGTH]
char path[BUFRDECO_PATH_LENGTH]
Struct to store the cache of structs bufr_tables.
int8_t ver[BUFRDECO_TABLES_CACHE_SIZE]
struct bufr_tables * tab[BUFRDECO_TABLES_CACHE_SIZE]
Contains all tables needed to parse a bufr file.
This struct contains all needed data to parse and decode a BUFR file.
struct bufr_tables_cache cache
struct bufr_tables * tables
char bufrtables_dir[BUFRDECO_PATH_LENGTH]