94const char SELF[]=
"bufrtotac";
131 clock_t clk_start, clk_end;
134int main (
int argc,
char *argv[] )
136 int first_subset, last_subset;
142 exit ( EXIT_FAILURE );
146 clk_start = clock ();
150 printf (
"%s(): Cannot init bufr struct\n",
SELF );
169 printf (
"####### %s ######\n",
INPUTFILE );
183 clk_start = clock ();
206 clk_start = clock ();
232 clk_start = clock ();
259 if ( last_subset < first_subset)
265 clk_start = clock ();
284 sprintf ( subset_id,
"subset_%d",
SUBSET );
295 clk_start = clock ();
300 fprintf ( stderr,
"# %s\n",
ERR );
311 fprintf (
OUT,
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" );
321 fprintf (
OUT,
"TYPE,FILE,DATETIME,INDEX,NAME,COUNTRY,LATITUDE,LONGITUDE,ALTITUDE,REPORT\n" );
346 clk_start = clock ();
362 exit ( EXIT_SUCCESS );
int guess_gts_header(struct gts_header *h, const char *f)
Guess the WMO GTS header from filename.
int print_json(FILE *f, struct metreport *m)
prints a struct metreport in json format
int print_csv(FILE *f, struct metreport *m)
prints a struct metreport in labeled csv format
int print_xml(FILE *f, struct metreport *m)
prints a struct metreport in xml format
int print_plain(FILE *f, struct metreport *m)
Print in a file the report decoded to Traditional Alphanumeric Code in plain text format....
int print_html(FILE *f, struct metreport *m)
Print in a file the report decoded to Traditional Alphanumeric Code in plain html format....
int bufrdeco_reset(struct bufrdeco *b)
Reset an struct bufrdeco. This is needed when changing to another bufr.
int bufrdeco_close(struct bufrdeco *b)
Free all allocated memory. Needed when no more task to do with bufrdeco library.
int bufrdeco_write_subset_offset_bits(struct bufrdeco *b, char *filename)
Write offset bit array for subsets in a non-compressed bufr.
int bufrdeco_parse_tree(struct bufrdeco *b)
Parse the tree of descriptors without expand the replicators.
int bufrdeco_read_subset_offset_bits(struct bufrdeco *b, char *filename)
Write offset bit array for subsets in a non-compressed bufr.
struct bufrdeco_subset_sequence_data * bufrdeco_get_target_subset_sequence_data(buf_t nset, struct bufrdeco *b)
Prepare the struct bufrdeco to get data from the solicited subset.
int bufrdeco_init(struct bufrdeco *b)
Inits and allocate memory for a struct bufrdeco.
int bufrdeco_print_subset_sequence_data(struct bufrdeco_subset_sequence_data *s)
Prints a struct bufrdeco_subset_sequence_data.
buf_t bufrdeco_print_json_tree(struct bufrdeco *b)
int print_sec0_info(struct bufrdeco *b)
Prints info from sec0.
int print_bufrdeco_compressed_data_references(struct bufrdeco_compressed_data_references *r)
prints a struct bufrdeco_compressed_references
#define BUFRDECO_OUTPUT_HTML
Bit mask to the member mask for struct bufrdeco to format output as html for SECs 0 to 3.
#define BUFRDECO_PATH_LENGTH
Length for files/directory path strings.
int print_sec3_info(struct bufrdeco *b)
Prints info from sec3.
int bufrdeco_print_subset_sequence_data_tagged_html(struct bufrdeco_subset_sequence_data *s, char *id)
int bufrdeco_extract_bufr(struct bufrdeco *b, char *filename)
Read file and try to find a bufr report inserted in. Once found do the same that bufrdeco_read_file()
int bufrdeco_print_tree(struct bufrdeco *b)
Print a tree of descriptors.
int print_sec4_info(struct bufrdeco *b)
Prints info from sec3.
int bufrdeco_read_bufr(struct bufrdeco *b, char *filename)
Read bufr file and does preliminary and first decode pass.
int print_sec1_info(struct bufrdeco *b)
Prints info from sec1.
int PRINT_JSON_EXPANDED_TREE
int main(int argc, char *argv[])
struct bufr2tac_error_stack ERRS
struct bufr2tac_subset_state STATE
char OFFSETFILE[BUFRDECO_PATH_LENGTH+8]
Include header file for binary bufrtotac.
int bufrtotac_parse_subset_sequence(struct metreport *m, struct bufr2tac_subset_state *st, struct bufrdeco *b, char *err)
char * get_bufrfile_path(char *filename, char *fileoffset, char *err)
int bufrtotac_set_bufrdeco_bitmask(struct bufrdeco *b)
Set the bufrdeco struct bitmask according with readed args from shell.
int bufrtotac_read_args(int _argc, char *_argv[])
A stack of structs bufr2tac_error.
stores information needed to parse a sequential list of expanded descriptors for a subset
Contains all the information for a subset in a expanded squence This is a version to use with bufrdec...
This struct contains all needed data to parse and decode a BUFR file.
struct bufrdeco_compressed_data_references refs
char bufrtables_dir[BUFRDECO_PATH_LENGTH]
all the information for a meteorological report in WMO text format from a BUFR file