bufr2synop 0.24.0
|
Include header file for bufrdeco library. More...
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <getopt.h>
#include <time.h>
#include <math.h>
#include <sys/stat.h>
Go to the source code of this file.
Data Structures | |
struct | bufr_descriptor |
BUFR descriptor. More... | |
struct | bufr_replicator |
store the information when parsing related to replicators More... | |
struct | bufr_atom_data |
Contains all the information for a single data related with a descriptor in a expanded squence. More... | |
struct | bufrdeco_subset_sequence_data |
Contains all the information for a subset in a expanded squence This is a version to use with bufrdeco parse library. More... | |
struct | bufrdeco_bitmap |
Stores all needed data for a bufr bitmap. More... | |
struct | bufrdeco_bitmap_array |
Stores all structs bufrdeco_bitmap for a bufr bitmap. More... | |
struct | bufrdeco_bitmap_related_vars |
Contains data related to a target variable with the aid of a bitmap. More... | |
struct | bufrdeco_decoding_data_state |
stores the state when expanding a sequence. More... | |
struct | bufr_sequence_index_range |
range of indexes in a struct bufr_sequence where a condition must me chequed or marked, as example no data present or event More... | |
struct | bufr_sequence |
Stores an unexpanded sequence of descriptors. More... | |
struct | bufrdeco_expanded_tree |
Array of structs bufr_sequence from which bufr expanded tree is made. More... | |
struct | bufrdeco_compressed_ref |
Struct to hold the needed reference bit offsets, descriptor tree and replications in a compressed BUFR. More... | |
struct | bufrdeco_compressed_data_references |
Manage an array of structs bufrdeco_compressed_ref. More... | |
struct | bufrdeco_subset_bit_offsets |
Array of offset in bits for every subset in a non-compressed bufr. Offset is counted in bits from the init of SEC4 data, usually bit 32. More... | |
struct | bufr_sec0 |
Store de parsed section 0. More... | |
struct | gts_header |
stores WMO GTS header info More... | |
struct | bufr_sec1 |
Store de parsed section 1 of a bufr file. More... | |
struct | bufr_sec2 |
Store a parsed sec2 from a bufr file including rawdata. More... | |
struct | bufr_sec3 |
Store a parsed sec3 from a bufr file including rawdata. More... | |
struct | bufr_sec4 |
Store a parsed sec4 from a bufr file including rawdata. More... | |
struct | bufr_tableB_decoded_item |
Store parameters for a descriptor in table b, i. e. with f = 0. More... | |
struct | bufr_tableB |
Store a table B readed from a file formated and named as ECMWF bufrdc package. More... | |
struct | bufr_tableC_decoded_item |
Store parameters for a descriptor in table C, i. e. for Table code and flags Remember this is NOT the C WMO tables. More... | |
struct | bufr_tableC |
Store a table C readed from a file formated and named as ECMWF bufrdc package. More... | |
struct | bufr_tableD_decoded_item |
Store parameters for a line in table D (sequence of descritors) More... | |
struct | bufr_tableD |
Store a table D readed from a file formated and named as ECMWF bufrdc package. More... | |
struct | bufr_tables |
Contains all tables needed to parse a bufr file. More... | |
struct | bufr_tables_cache |
Struct to store the cache of structs bufr_tables. More... | |
struct | bufrdeco |
This struct contains all needed data to parse and decode a BUFR file. More... | |
Macros | |
#define | _GNU_SOURCE |
#define | BUFRDECO "bufrdeco" |
Name of this library. More... | |
#define | BUFR_LEN (512000) |
Max length of a BUFR file. More... | |
#define | BUFR_OBS_DATA_MASK 128 |
Bit mask for Observed data. More... | |
#define | BUFR_COMPRESSED_DATA_MASK 64 |
Bit mask for compressed data. More... | |
#define | MISSING_REAL (1.7e38) |
The missing default value for real values. More... | |
#define | MISSING_INTEGER (2147483647) |
The missing default value for integer values. More... | |
#define | BUFR_MAXLINES_TABLEB (2048) |
The maximum expected lines in a Table B file. More... | |
#define | BUFR_MAXLINES_TABLEC (8192) |
The maximum expected lines in a Table C file. More... | |
#define | BUFR_MAXLINES_TABLED (8192) |
The maximum expected lines in a Table D file. More... | |
#define | MAXLINES_TABLEC BUFR_MAXLINES_TABLEC |
The maximum expected lines in a Table C file, legacy def used from ECMWF. More... | |
#define | BUFR_NMAXSEQ (2 * 16384) |
Maximum expected descriptors in a expanded sequence for a single subset. More... | |
#define | BUFR_EXPLAINED_LENGTH (512) |
Maximum length for a explained descriptor string. More... | |
#define | CSV_MAXL (2048) |
Maximum length in a string to be parsed as csv. More... | |
#define | NMAXSEQ_DESCRIPTORS (256) |
Maximum nuber of unexpanded descriptors in a struct bufr_sequence. More... | |
#define | DESCRIPTOR_VALUE_MISSING (1) |
Bit mask for a missing value in a struct bufr_atom_data. More... | |
#define | DESCRIPTOR_HAVE_REAL_VALUE (2) |
Bit mask for a real value in a struct bufr_atom_data. More... | |
#define | DESCRIPTOR_HAVE_STRING_VALUE (4) |
Bit mask for a string in a struct bufr_atom_data. More... | |
#define | DESCRIPTOR_IS_CODE_TABLE (8) |
Bit mask for a code table in a struct bufr_atom_data. More... | |
#define | DESCRIPTOR_HAVE_CODE_TABLE_STRING (16) |
Bit mask for a code table string in a struct bufr_atom_data. More... | |
#define | DESCRIPTOR_HAVE_FLAG_TABLE_STRING (32) |
Bit mask for a flag table string in a struct bufr_atom_data. More... | |
#define | DESCRIPTOR_IS_FLAG_TABLE (64) |
Bit mask for a flag table in a struct bufr_atom_data. More... | |
#define | DESCRIPTOR_IS_A_REPLICATOR (128) |
Bit mask for a replicator descriptor in a struct bufr_atom_data. More... | |
#define | DESCRIPTOR_IS_AN_OPERATOR (256) |
Bit mask for an operator data descriptor in a struct bufr_atom_data. More... | |
#define | DESCRIPTOR_IS_LOCAL (512) |
Bit mask for a flag table string in a struct bufr_atom_data. More... | |
#define | BUFR_LEN_SEC1 (8192) |
Max length in bytes for a sec1. More... | |
#define | BUFR_LEN_SEC2 (8192) |
Max length in bytes for a sec2. More... | |
#define | BUFR_LEN_UNEXPANDED_DESCRIPTOR (512) |
Max amount of unexpanded descriptors in a SEC3. More... | |
#define | BUFR_MAX_EXPANDED_SEQUENCES (128) |
Max amount of unexpanded sequences in a struct bufrdeco_expanded_tree. More... | |
#define | BUFR_MAX_QUALITY_DATA (8) |
Max amount of quality data which is maped by a struct bufrdeco_bitmap element. More... | |
#define | BUFR_MAX_BITMAP_PRESENT_DATA (4096) |
Max number of data present in a bitmap definition. More... | |
#define | BUFR_MAX_BITMAPS (8) |
Max number of structs bufrdeco_bitmap that can be allocated in a struct bufrdeco_bitmap_array. More... | |
#define | BUFR_MAX_SUBSETS (2048) |
Max number of subsets in the array off bitoffset subset marks the bufrdeco library can manage. More... | |
#define | BUFR_LEN_SEC3 (8 + 2 * BUFR_LEN_UNEXPANDED_DESCRIPTOR) |
Max length in bytes for a sec3. More... | |
#define | BUFRDECO_OUTPUT_HTML (1) |
Bit mask to the member mask for struct bufrdeco to format output as html for SECs 0 to 3. More... | |
#define | BUFRDECO_OUTPUT_XML (2) |
Bit mask to the member mask for struct bufrdeco to format output as xml for SECs 0 to 3. More... | |
#define | BUFRDECO_USE_TABLES_CACHE (4) |
Bit mask to the member mask of struct bufrdeco to mark the use of bufr_tables cache. More... | |
#define | BUFRDECO_OUTPUT_JSON_SEC0 (8) |
Bit mask to the member mask of struct bufrdeco to print info for SEC 0 in json format. More... | |
#define | BUFRDECO_OUTPUT_JSON_SEC1 (16) |
Bit mask to the member mask of struct bufrdeco to print info for SEC 1 in json format. More... | |
#define | BUFRDECO_OUTPUT_JSON_SEC2 (32) |
Bit mask to the member mask of struct bufrdeco to print bufr info for SEC 2 in json format. More... | |
#define | BUFRDECO_OUTPUT_JSON_SEC3 (64) |
Bit mask to the member mask of struct bufrdeco to print bufr info for SEC 3 in json format. More... | |
#define | BUFRDECO_OUTPUT_JSON_SUBSET_DATA (128) |
Bit mask to the member mask of struct bufrdeco to print bufr subset data in json format. More... | |
#define | BUFRDECO_OUTPUT_JSON_EXPANDED_TREE (256) |
Bit mask to the member mask of struct bufrdeco to print bufr expanded tree of descriptors. More... | |
#define | BUFRDECO_OUTPUT_JSON (BUFRDECO_OUTPUT_JSON_SEC0 | BUFRDECO_OUTPUT_JSON_SEC1 | BUFRDECO_OUTPUT_JSON_SEC2 | BUFRDECO_OUTPUT_JSON_SEC3 ) |
Bit mask to the member mask for struct bufrdeco to format output as json for SECs 0 to 3. More... | |
#define | BUFR_TABLEB_NAME_LENGTH (128) |
Max length (in chars) reserved for a name of variable in table B. More... | |
#define | BUFR_TABLEB_UNIT_LENGTH (64) |
#define | BUFR_CVAL_LENGTH (128) |
Max length (in chars) of a cval in a bufr_atom_data. More... | |
#define | BUFRDECO_PATH_LENGTH (256) |
Length for files/directory path strings. More... | |
#define | BUFRDECO_TABLES_CACHE_SIZE (16) |
Max number of structs bufr_tables in a bufr_tables_cache. More... | |
#define | strcpy_safe(_target_, _src_) |
Macro to make safely a strcpy when we know in calling function the size of string target with sizeof() More... | |
#define | strncpy_safe(_target_, _src_, _dim_) |
Macro to make safely a strcpy when we know in calling function the size of string target directly. More... | |
#define | bufrdeco_assert(__my_expr__) |
Check a expression and exit if it fails. More... | |
#define | bufrdeco_assert_with_return_val(__my_expr__, __returnval__) |
Check a expression and returns a given value if it fails. More... | |
#define | BUFRDECO_COMPRESSED_REF_SEQUENCE_INIT_BITMASK (1) |
Bitmask for struct bufrdeco_compressed_ref which marks the init of a descriptor sequence. More... | |
#define | BUFRDECO_COMPRESSED_REF_DATA_DESCRIPTOR_BITMASK (2) |
Bitmask for struct bufrdeco_compressed_ref which marks a data descriptor. More... | |
#define | BUFRDECO_COMPRESSED_REF_OPERATOR_DESCRIPTOR (4) |
Bitmask for struct bufrdeco_compressed_ref which marks an operator descriptor. More... | |
#define | BUFRDECO_COMPRESSED_REF_REPLICATOR_DESCRIPTOR (8) |
Bitmask for struct bufrdeco_compressed_ref which marks a replicator descriptor. More... | |
#define | BUFRDECO_COMPRESSED_REF_SEQUENCE_FINAL_BITMASK (16) |
Bitmask for struct bufrdeco_compressed_ref which marks the final of a descriptor sequence. More... | |
Typedefs | |
typedef uint32_t | buf_t |
Type to set offsets and dimension of arrays or counters used in bufrdeco. More... | |
typedef int32_t | ibuf_t |
Type to set offsets and dimension of arrays or counters used in bufrdeco. More... | |
Functions | |
char * | bufrdeco_get_version (char *version, size_t dversion, char *build, size_t dbuild, char *builder, size_t dbuilder, int *version_major, int *version_minor, int *version_patch) |
int | bufrdeco_parse_tree (struct bufrdeco *b) |
Parse the tree of descriptors without expand the replicators. More... | |
int | bufrdeco_init (struct bufrdeco *b) |
Inits and allocate memory for a struct bufrdeco. More... | |
int | bufrdeco_close (struct bufrdeco *b) |
Free all allocated memory. Needed when no more task to do with bufrdeco library. More... | |
int | bufrdeco_reset (struct bufrdeco *b) |
Reset an struct bufrdeco. This is needed when changing to another bufr. More... | |
int | bufrdeco_set_tables_dir (struct bufrdeco *b, char *tables_dir) |
Sets the directory path for BUFR tables. Needed if it is not any default directories. More... | |
int | bufrdeco_set_out_stream (FILE *out, struct bufrdeco *b) |
Set the library normal output stream. More... | |
int | bufrdeco_set_err_stream (FILE *err, struct bufrdeco *b) |
Set the error stream. More... | |
int | bufrdeco_get_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_bufr() More... | |
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. More... | |
int | bufrdeco_read_subset_offset_bits (struct bufrdeco *b, char *filename) |
Write offset bit array for subsets in a non-compressed bufr. More... | |
int | bufrdeco_write_subset_offset_bits (struct bufrdeco *b, char *filename) |
Write offset bit array for subsets in a non-compressed bufr. More... | |
int | bufrdeco_init_expanded_tree (struct bufrdeco_expanded_tree **t) |
Init a struct bufrdeco_expanded_tree allocating space. More... | |
int | bufrdeco_free_expanded_tree (struct bufrdeco_expanded_tree **t) |
Frees the allocated space for a struct bufrdeco_expanded_tree. More... | |
int | bufrdeco_init_tables (struct bufr_tables **t) |
Init a struct bufr_tables allocating space. More... | |
int | bufrdeco_free_tables (struct bufr_tables **t) |
Frees the allocated space for a struct bufr_tables. More... | |
int | bufrdeco_substitute_tables (struct bufr_tables **replaced, struct bufr_tables *source, struct bufrdeco *b) |
substitute an struct bufr_tables into a struct bufrdeco More... | |
int | bufrdeco_init_subset_sequence_data (struct bufrdeco_subset_sequence_data *ba) |
Init a struct bufrdeco_subset_sequence_data. More... | |
int | bufrdeco_clean_subset_sequence_data (struct bufrdeco_subset_sequence_data *ba) |
Cleans a struct bufrdeco_subset_sequence_data. More... | |
int | bufrdeco_free_subset_sequence_data (struct bufrdeco_subset_sequence_data *ba) |
Free the memory for sequence array in a struct bufrdeco_subset_sequence_data. More... | |
int | bufrdeco_free_compressed_data_references (struct bufrdeco_compressed_data_references *rf) |
Free the memory allocated for array of references in a struct bufrdeco_compressed_data_references. More... | |
int | bufrdeco_init_compressed_data_references (struct bufrdeco_compressed_data_references *rf) |
Init a struct bufrdeco_compressed_data_references. More... | |
int | bufrdeco_increase_data_array (struct bufrdeco_subset_sequence_data *s) |
doubles the allocated space for a struct bufrdeco_subset_sequence_data whenever is posible More... | |
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 to this element. More... | |
int | bufrdeco_cache_tables_search (struct bufr_tables_cache *c, uint8_t ver) |
Search a struct bufr_tables in bufr_tables_cache. More... | |
int | bufrdeco_free_cache_tables (struct bufr_tables_cache *c) |
deallocate and clean a bufr_tables_cache More... | |
int | bufrdeco_read_bufr (struct bufrdeco *b, char *filename) |
Read bufr file and does preliminary and first decode pass. More... | |
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() More... | |
int | bufrdeco_read_buffer (struct bufrdeco *b, uint8_t *bufrx, buf_t size) |
int | get_wmo_tablenames (struct bufrdeco *b) |
Get the complete pathnames for WMO csv table files needed by a bufr message. More... | |
int | bufr_read_tableB (struct bufrdeco *b) |
int | bufr_read_tableC (struct bufrdeco *b) |
Reads a file with table C content (Code table and bit flags) according with csv WMO format. More... | |
int | bufr_read_tableD (struct bufrdeco *b) |
Reads a file with table D content according with WMO csv format. More... | |
int | bufr_read_tables (struct bufrdeco *b) |
Read the tables according with bufr file data from a bufr table directory. More... | |
char * | csv_quoted_string (char *out, char *in) |
Transform a string to a quoted string to be inserted in a csv file. More... | |
int | parse_csv_line (int *nt, char *tk[], char *lin) |
Parse a csv line. More... | |
int | print_bufrdeco_compressed_ref (struct bufrdeco_compressed_ref *r) |
prints a struct bufrdeco_compressed_ref More... | |
int | fprint_bufrdeco_compressed_ref (FILE *f, struct bufrdeco_compressed_ref *r) |
prints a struct bufrdeco_compressed_ref More... | |
int | print_bufrdeco_compressed_data_references (struct bufrdeco_compressed_data_references *r) |
prints a struct bufrdeco_compressed_references More... | |
int | fprint_bufrdeco_compressed_data_references (FILE *f, struct bufrdeco_compressed_data_references *r) |
int | print_sec0_info (struct bufrdeco *b) |
Prints info from sec0. More... | |
int | print_sec1_info (struct bufrdeco *b) |
Prints info from sec1. More... | |
int | print_sec3_info (struct bufrdeco *b) |
Prints info from sec3. More... | |
int | print_sec4_info (struct bufrdeco *b) |
Prints info from sec3. More... | |
int | sprint_sec0_info (char *target, size_t lmax, struct bufrdeco *b) |
Prints info from sec0. More... | |
int | sprint_sec1_info (char *target, size_t lmax, struct bufrdeco *b) |
Prints info from sec1. More... | |
int | sprint_sec3_info (char *target, size_t lmax, struct bufrdeco *b) |
Prints info from sec3. More... | |
int | sprint_sec4_info (char *target, size_t lmax, struct bufrdeco *b) |
Prints info from sec4. More... | |
int | sprint_sec0_info_html (char *target, size_t lmax, struct bufrdeco *b) |
Prints info from sec0 in html format. More... | |
int | sprint_sec1_info_html (char *target, size_t lmax, struct bufrdeco *b) |
Prints info from sec1. More... | |
int | sprint_sec3_info_html (char *target, size_t lmax, struct bufrdeco *b) |
Prints info from sec3 formatted as html. More... | |
int | sprint_sec4_info_html (char *target, size_t lmax, struct bufrdeco *b) |
Prints info from sec4. More... | |
int | bufrdeco_print_tree (struct bufrdeco *b) |
Print a tree of descriptors. More... | |
int | bufrdeco_fprint_tree (FILE *f, struct bufrdeco *b) |
Print a tree of descriptors. More... | |
int | bufrdeco_print_atom_data_stdout (struct bufr_atom_data *a) |
print the data in a struct bufr_atom_data to stdout More... | |
int | bufrdeco_print_atom_data_file (FILE *f, struct bufr_atom_data *a) |
print the data in a struct bufr_atom_data to a file already open by caller More... | |
int | bufrdeco_print_subset_sequence_data (struct bufrdeco_subset_sequence_data *s) |
Prints a struct bufrdeco_subset_sequence_data. More... | |
int | bufrdeco_print_subset_sequence_data_html (struct bufrdeco_subset_sequence_data *s) |
int | bufrdeco_print_subset_sequence_data_tagged_html (struct bufrdeco_subset_sequence_data *s, char *id) |
int | bufrdeco_fprint_subset_sequence_data_html (FILE *f, struct bufrdeco_subset_sequence_data *s) |
int | bufrdeco_fprint_subset_sequence_data_tagged_html (FILE *f, struct bufrdeco_subset_sequence_data *s, char *id) |
int | bufrdeco_fprint_subset_sequence_data (FILE *f, struct bufrdeco_subset_sequence_data *s) |
char * | bufrdeco_print_atom_data (char *target, size_t lmax, struct bufr_atom_data *a) |
print the data in a struct bufr_atom_data to a string More... | |
char * | bufrdeco_print_atom_data_html (char *target, size_t lmax, struct bufr_atom_data *a, uint32_t ss) |
print the data in a struct bufr_atom_data to a string as cells of table rows More... | |
char * | get_formatted_value_from_escale (char *fmt, size_t dim, int32_t escale, double val) |
gets a string with formatted value depending of scale More... | |
char * | get_formatted_value_from_escale2 (char *fmt, size_t dim, int32_t escale, double val) |
gets a string with formatted value depending of scale More... | |
int | bufrdeco_parse_tree_recursive (struct bufrdeco *b, struct bufr_sequence *father, buf_t father_idesc, const char *key) |
Parse the descriptor tree in a recursive way. More... | |
int | bufrdeco_decode_data_subset (struct bufrdeco *b) |
User interface to decode a BUFR subset. More... | |
int | bufrdeco_decode_subset_data_recursive (struct bufrdeco_subset_sequence_data *d, struct bufr_sequence *l, struct bufrdeco *b) |
decode the data from a subset in a recursive way More... | |
int | bufrdeco_decode_replicated_subsequence (struct bufrdeco_subset_sequence_data *d, struct bufr_replicator *r, struct bufrdeco *b) |
Decodes a replicated sequence. More... | |
int | bufrdeco_parse_f2_descriptor (struct bufrdeco_subset_sequence_data *s, struct bufr_descriptor *d, struct bufrdeco *b) |
parse a descritor with f = 2 More... | |
int | bufrdeco_parse_compressed (struct bufrdeco_compressed_data_references *r, struct bufrdeco *b) |
Preliminary parse of a compressed data bufr. More... | |
int | bufrdeco_parse_compressed_recursive (struct bufrdeco_compressed_data_references *r, struct bufr_sequence *l, struct bufrdeco *b) |
Parse recursively the compressed data in a bufr report to get references where to get data for every descriptor in a subset. More... | |
int | bufr_decode_subset_data_compressed (struct bufrdeco_subset_sequence_data *s, struct bufrdeco_compressed_data_references *r, struct bufrdeco *b) |
Get data for a given subset in a compressed data bufr. More... | |
int | bufrdeco_decode_replicated_subsequence_compressed (struct bufrdeco_compressed_data_references *r, struct bufr_replicator *rep, struct bufrdeco *b) |
decodes a repicated subsequence More... | |
int | bufrdeco_parse_f2_compressed (struct bufrdeco_compressed_data_references *r, struct bufr_descriptor *d, struct bufrdeco *b) |
parse a descritor with f = 2 in case of compressed bufr More... | |
int | bufrdeco_tableB_compressed (struct bufrdeco_compressed_ref *r, struct bufrdeco *b, struct bufr_descriptor *d, int mode) |
get data from table B when parsing compressed data references More... | |
int | bufrdeco_get_atom_data_from_compressed_data_ref (struct bufr_atom_data *a, struct bufrdeco_compressed_ref *r, buf_t subset, struct bufrdeco *b) |
Get atom data from a descriptor for a given subset. More... | |
int | bufrdeco_increase_compressed_data_references_count (struct bufrdeco_compressed_data_references *r, struct bufrdeco *b) |
Increment the count of a struct bufrdeco_compressed_data_references. More... | |
struct bufrdeco_subset_sequence_data * | bufrdeco_get_subset_sequence_data (struct bufrdeco *b) |
Parse and get a struct bufrdeco_subset_sequence_data. More... | |
buf_t | bufrdeco_print_json_sec0 (FILE *out, struct bufrdeco *b) |
buf_t | bufrdeco_print_json_sec1 (FILE *out, struct bufrdeco *b) |
Print info form sec 1 in json format. More... | |
buf_t | bufrdeco_print_json_sec2 (FILE *out, struct bufrdeco *b) |
Print info form optional sec 2 in json format. More... | |
buf_t | bufrdeco_print_json_sec3 (FILE *out, struct bufrdeco *b) |
Print info form sec 3 in json format. More... | |
buf_t | bufrdeco_print_json_tree (struct bufrdeco *b) |
buf_t | bufrdeco_print_json_tree_recursive (FILE *out, struct bufrdeco *b, struct bufr_sequence *seq) |
Print a tree of descriptors to a file in a recursive way in json format. More... | |
buf_t | bufrdeco_print_json_subset_data_prologue (FILE *out, struct bufrdeco *b) |
buf_t | bufrdeco_print_json_subset_data_epilogue (FILE *out) |
buf_t | bufrdeco_print_json_object_atom_data (FILE *out, struct bufr_atom_data *a, char *aux) |
Print an json object with a descriptor data. More... | |
buf_t | bufrdeco_print_json_object_operator_descriptor (FILE *out, struct bufr_descriptor *d, char *aux) |
print an operator desciptor as a json object More... | |
buf_t | bufrdeco_print_json_object_replicator_descriptor (FILE *out, struct bufr_descriptor *d, char *aux) |
print an operator desciptor as a json object More... | |
buf_t | bufrdeco_print_json_sequence_descriptor_header (FILE *out, struct bufr_sequence *seq) |
Print the header of a sequence descriptor (f == 3) More... | |
buf_t | bufrdeco_print_json_sequence_descriptor_final (FILE *out) |
buf_t | bufrdeco_print_json_separator (FILE *out) |
Print the comma ',' separator in an output. More... | |
buf_t | bufrdeco_print_json_scape_string_cvals (FILE *out, char *source) |
prints a descriptor string value scaping the '"' for a json format More... | |
uint32_t | two_bytes_to_uint32 (const uint8_t *source) |
returns the uint32_t value from an array of two bytes, most significant first More... | |
uint32_t | three_bytes_to_uint32 (const uint8_t *source) |
returns the uint32_t value from an array of three bytes, most significant first More... | |
uint32_t | get_bits_as_uint32_t (uint32_t *target, uint8_t *has_data, uint8_t *source, buf_t *bit0_offset, buf_t bit_length) |
uint32_t | get_bits_as_char_array (char *target, uint8_t *has_data, uint8_t *source, buf_t *bit0_offset, buf_t bit_length) |
char * | bufrdeco_explained_table_val (char *expl, size_t dim, struct bufr_tableC *tc, uint32_t *index, struct bufr_descriptor *d, uint32_t ival) |
char * | bufrdeco_explained_flag_val (char *expl, size_t dim, struct bufr_tableC *tc, struct bufr_descriptor *d, uint64_t ival, uint8_t nbits) |
char * | bufrdeco_explained_table_csv_val (char *expl, size_t dim, struct bufr_tableC *tc, uint32_t *index, struct bufr_descriptor *d, uint32_t ival) |
char * | bufrdeco_explained_flag_csv_val (char *expl, size_t dim, struct bufr_tableC *tc, struct bufr_descriptor *d, uint64_t ival, uint8_t nbits) |
int | bufrdeco_tableD_get_descriptors_array (struct bufr_sequence *s, struct bufrdeco *b, const char *key) |
get the descriptors array for a descriptor sequence defined in table D with F = 3 More... | |
int | bufrdeco_tableB_val (struct bufr_atom_data *a, struct bufrdeco *b, struct bufr_descriptor *d) |
Get data from a table B descriptor. More... | |
int | bufr_find_tableB_index (buf_t *index, struct bufr_tableB *tb, const char *key) |
found a descriptor index in a struct bufr_tableB More... | |
int | get_table_b_reference_from_uint32_t (int32_t *target, uint8_t bits, uint32_t source) |
Get an int32_t from bits according with bufr criteria to change the reference of a descritor. Most significant bit in source is sign. More... | |
int | bufr_find_tableC_csv_index (buf_t *index, struct bufr_tableC *tc, const char *key, uint32_t code) |
char * | bufrdeco_get_f2_descriptor_explanation (char *e, size_t dim, struct bufr_descriptor *d) |
int | bufrdeco_allocate_bitmap (struct bufrdeco *b) |
allocate bitmap More... | |
int | bufrdeco_clean_bitmaps (struct bufrdeco *b) |
Clean all allocated bitmaps, but still is in memory. More... | |
int | bufrdeco_free_bitmap_array (struct bufrdeco_bitmap_array *a) |
Free an allocated bitmap array. More... | |
int | bufrdeco_add_to_bitmap (struct bufrdeco_bitmap *bm, buf_t index_to, buf_t index_by) |
Push a bitmap element in a bufrdeco_bitmap. More... | |
int | two_bytes_to_descriptor (struct bufr_descriptor *d, const uint8_t *source) |
set a struct bufr_descriptor from two consecutive bytes in bufr file More... | |
int | uint32_t_to_descriptor (struct bufr_descriptor *d, uint32_t id) |
parse an integer with a descriptor fom bufr ECWMF libary More... | |
int | is_a_delayed_descriptor (struct bufr_descriptor *d) |
check if a descriptor is a delayed descriptor More... | |
int | is_a_local_descriptor (struct bufr_descriptor *d) |
check if a descriptor is a local descriptor More... | |
int | is_a_short_delayed_descriptor (struct bufr_descriptor *d) |
check if a descriptor is a short delayed descriptor More... | |
char * | bufr_adjust_string (char *s) |
Supress trailing blanks of a string. More... | |
char * | bufr_charray_to_string (char *s, char *buf, size_t size) |
get a null termitated c-string from an array of unsigned chars More... | |
int | bufr_read_subset_offset_bits (FILE *f, struct bufrdeco_subset_bit_offsets *off) |
Write offset bit array for subsets in a non-compressed bufr. More... | |
int | bufr_write_subset_offset_bits (FILE *f, struct bufrdeco_subset_bit_offsets *off) |
Write offset bit array for subsets in a non-compressed bufr. More... | |
Variables | |
const char | DEFAULT_BUFRTABLES_ECMWF_DIR1 [] |
const char | DEFAULT_BUFRTABLES_ECMWF_DIR2 [] |
const char | DEFAULT_BUFRTABLES_WMO_CSV_DIR1 [] |
const char | DEFAULT_BUFRTABLES_WMO_CSV_DIR2 [] |
const double | pow10pos [8] |
const double | pow10neg [8] |
const int32_t | pow10pos_int [10] |
Include header file for bufrdeco library.
Definition in file bufrdeco.h.
#define _GNU_SOURCE |
Definition at line 28 of file bufrdeco.h.
#define BUFR_COMPRESSED_DATA_MASK 64 |
Bit mask for compressed data.
Definition at line 72 of file bufrdeco.h.
#define BUFR_CVAL_LENGTH (128) |
Max length (in chars) of a cval in a bufr_atom_data.
Definition at line 329 of file bufrdeco.h.
#define BUFR_EXPLAINED_LENGTH (512) |
Maximum length for a explained descriptor string.
Definition at line 122 of file bufrdeco.h.
#define BUFR_LEN (512000) |
Max length of a BUFR file.
Definition at line 60 of file bufrdeco.h.
#define BUFR_LEN_SEC1 (8192) |
Max length in bytes for a sec1.
Definition at line 200 of file bufrdeco.h.
#define BUFR_LEN_SEC2 (8192) |
Max length in bytes for a sec2.
Definition at line 206 of file bufrdeco.h.
#define BUFR_LEN_SEC3 (8 + 2 * BUFR_LEN_UNEXPANDED_DESCRIPTOR) |
Max length in bytes for a sec3.
Definition at line 250 of file bufrdeco.h.
#define BUFR_LEN_UNEXPANDED_DESCRIPTOR (512) |
Max amount of unexpanded descriptors in a SEC3.
Definition at line 213 of file bufrdeco.h.
#define BUFR_MAX_BITMAP_PRESENT_DATA (4096) |
Max number of data present in a bitmap definition.
Definition at line 232 of file bufrdeco.h.
#define BUFR_MAX_BITMAPS (8) |
Max number of structs bufrdeco_bitmap that can be allocated in a struct bufrdeco_bitmap_array.
Definition at line 238 of file bufrdeco.h.
#define BUFR_MAX_EXPANDED_SEQUENCES (128) |
Max amount of unexpanded sequences in a struct bufrdeco_expanded_tree.
Definition at line 220 of file bufrdeco.h.
#define BUFR_MAX_QUALITY_DATA (8) |
Max amount of quality data which is maped by a struct bufrdeco_bitmap element.
Definition at line 226 of file bufrdeco.h.
#define BUFR_MAX_SUBSETS (2048) |
Max number of subsets in the array off bitoffset subset marks the bufrdeco library can manage.
Definition at line 244 of file bufrdeco.h.
#define BUFR_MAXLINES_TABLEB (2048) |
The maximum expected lines in a Table B file.
Definition at line 90 of file bufrdeco.h.
#define BUFR_MAXLINES_TABLEC (8192) |
The maximum expected lines in a Table C file.
Definition at line 96 of file bufrdeco.h.
#define BUFR_MAXLINES_TABLED (8192) |
The maximum expected lines in a Table D file.
Definition at line 103 of file bufrdeco.h.
#define BUFR_NMAXSEQ (2 * 16384) |
Maximum expected descriptors in a expanded sequence for a single subset.
Definition at line 116 of file bufrdeco.h.
#define BUFR_OBS_DATA_MASK 128 |
Bit mask for Observed data.
Definition at line 66 of file bufrdeco.h.
#define BUFR_TABLEB_NAME_LENGTH (128) |
Max length (in chars) reserved for a name of variable in table B.
Max length (in chars) reserved for the unit string in table B.
#define BUFR_TABLEB_UNIT_LENGTH (64) |
Definition at line 323 of file bufrdeco.h.
#define BUFRDECO "bufrdeco" |
Name of this library.
Definition at line 54 of file bufrdeco.h.
#define bufrdeco_assert | ( | __my_expr__ | ) |
Check a expression and exit if it fails.
Definition at line 374 of file bufrdeco.h.
#define bufrdeco_assert_with_return_val | ( | __my_expr__, | |
__returnval__ | |||
) |
Check a expression and returns a given value if it fails.
Definition at line 385 of file bufrdeco.h.
#define BUFRDECO_COMPRESSED_REF_DATA_DESCRIPTOR_BITMASK (2) |
Bitmask for struct bufrdeco_compressed_ref which marks a data descriptor.
Definition at line 611 of file bufrdeco.h.
#define BUFRDECO_COMPRESSED_REF_OPERATOR_DESCRIPTOR (4) |
Bitmask for struct bufrdeco_compressed_ref which marks an operator descriptor.
Definition at line 617 of file bufrdeco.h.
#define BUFRDECO_COMPRESSED_REF_REPLICATOR_DESCRIPTOR (8) |
Bitmask for struct bufrdeco_compressed_ref which marks a replicator descriptor.
Definition at line 623 of file bufrdeco.h.
#define BUFRDECO_COMPRESSED_REF_SEQUENCE_FINAL_BITMASK (16) |
Bitmask for struct bufrdeco_compressed_ref which marks the final of a descriptor sequence.
Definition at line 629 of file bufrdeco.h.
#define BUFRDECO_COMPRESSED_REF_SEQUENCE_INIT_BITMASK (1) |
Bitmask for struct bufrdeco_compressed_ref which marks the init of a descriptor sequence.
Definition at line 605 of file bufrdeco.h.
#define BUFRDECO_OUTPUT_HTML (1) |
Bit mask to the member mask for struct bufrdeco to format output as html for SECs 0 to 3.
Definition at line 256 of file bufrdeco.h.
#define BUFRDECO_OUTPUT_JSON (BUFRDECO_OUTPUT_JSON_SEC0 | BUFRDECO_OUTPUT_JSON_SEC1 | BUFRDECO_OUTPUT_JSON_SEC2 | BUFRDECO_OUTPUT_JSON_SEC3 ) |
Bit mask to the member mask for struct bufrdeco to format output as json for SECs 0 to 3.
Definition at line 311 of file bufrdeco.h.
#define BUFRDECO_OUTPUT_JSON_EXPANDED_TREE (256) |
Bit mask to the member mask of struct bufrdeco to print bufr expanded tree of descriptors.
Definition at line 305 of file bufrdeco.h.
#define BUFRDECO_OUTPUT_JSON_SEC0 (8) |
Bit mask to the member mask of struct bufrdeco to print info for SEC 0 in json format.
Definition at line 275 of file bufrdeco.h.
#define BUFRDECO_OUTPUT_JSON_SEC1 (16) |
Bit mask to the member mask of struct bufrdeco to print info for SEC 1 in json format.
Definition at line 281 of file bufrdeco.h.
#define BUFRDECO_OUTPUT_JSON_SEC2 (32) |
Bit mask to the member mask of struct bufrdeco to print bufr info for SEC 2 in json format.
Definition at line 287 of file bufrdeco.h.
#define BUFRDECO_OUTPUT_JSON_SEC3 (64) |
Bit mask to the member mask of struct bufrdeco to print bufr info for SEC 3 in json format.
Definition at line 293 of file bufrdeco.h.
#define BUFRDECO_OUTPUT_JSON_SUBSET_DATA (128) |
Bit mask to the member mask of struct bufrdeco to print bufr subset data in json format.
Definition at line 299 of file bufrdeco.h.
#define BUFRDECO_OUTPUT_XML (2) |
Bit mask to the member mask for struct bufrdeco to format output as xml for SECs 0 to 3.
Definition at line 262 of file bufrdeco.h.
#define BUFRDECO_PATH_LENGTH (256) |
Length for files/directory path strings.
Definition at line 335 of file bufrdeco.h.
#define BUFRDECO_TABLES_CACHE_SIZE (16) |
Max number of structs bufr_tables in a bufr_tables_cache.
Definition at line 341 of file bufrdeco.h.
#define BUFRDECO_USE_TABLES_CACHE (4) |
Bit mask to the member mask of struct bufrdeco to mark the use of bufr_tables cache.
Definition at line 268 of file bufrdeco.h.
#define CSV_MAXL (2048) |
Maximum length in a string to be parsed as csv.
Definition at line 128 of file bufrdeco.h.
#define DESCRIPTOR_HAVE_CODE_TABLE_STRING (16) |
Bit mask for a code table string in a struct bufr_atom_data.
Definition at line 164 of file bufrdeco.h.
#define DESCRIPTOR_HAVE_FLAG_TABLE_STRING (32) |
Bit mask for a flag table string in a struct bufr_atom_data.
Definition at line 170 of file bufrdeco.h.
#define DESCRIPTOR_HAVE_REAL_VALUE (2) |
Bit mask for a real value in a struct bufr_atom_data.
Definition at line 146 of file bufrdeco.h.
#define DESCRIPTOR_HAVE_STRING_VALUE (4) |
Bit mask for a string in a struct bufr_atom_data.
Definition at line 152 of file bufrdeco.h.
#define DESCRIPTOR_IS_A_REPLICATOR (128) |
Bit mask for a replicator descriptor in a struct bufr_atom_data.
Definition at line 182 of file bufrdeco.h.
#define DESCRIPTOR_IS_AN_OPERATOR (256) |
Bit mask for an operator data descriptor in a struct bufr_atom_data.
Definition at line 188 of file bufrdeco.h.
#define DESCRIPTOR_IS_CODE_TABLE (8) |
Bit mask for a code table in a struct bufr_atom_data.
Definition at line 158 of file bufrdeco.h.
#define DESCRIPTOR_IS_FLAG_TABLE (64) |
Bit mask for a flag table in a struct bufr_atom_data.
Definition at line 176 of file bufrdeco.h.
#define DESCRIPTOR_IS_LOCAL (512) |
Bit mask for a flag table string in a struct bufr_atom_data.
Definition at line 194 of file bufrdeco.h.
#define DESCRIPTOR_VALUE_MISSING (1) |
Bit mask for a missing value in a struct bufr_atom_data.
Definition at line 140 of file bufrdeco.h.
#define MAXLINES_TABLEC BUFR_MAXLINES_TABLEC |
The maximum expected lines in a Table C file, legacy def used from ECMWF.
Definition at line 110 of file bufrdeco.h.
#define MISSING_INTEGER (2147483647) |
The missing default value for integer values.
Definition at line 84 of file bufrdeco.h.
#define MISSING_REAL (1.7e38) |
The missing default value for real values.
Definition at line 78 of file bufrdeco.h.
#define NMAXSEQ_DESCRIPTORS (256) |
Maximum nuber of unexpanded descriptors in a struct bufr_sequence.
Definition at line 134 of file bufrdeco.h.
#define strcpy_safe | ( | _target_, | |
_src_ | |||
) |
Macro to make safely a strcpy when we know in calling function the size of string target with sizeof()
Definition at line 358 of file bufrdeco.h.
#define strncpy_safe | ( | _target_, | |
_src_, | |||
_dim_ | |||
) |
Macro to make safely a strcpy when we know in calling function the size of string target directly.
Definition at line 366 of file bufrdeco.h.
Type to set offsets and dimension of arrays or counters used in bufrdeco.
Definition at line 346 of file bufrdeco.h.
Type to set offsets and dimension of arrays or counters used in bufrdeco.
Definition at line 351 of file bufrdeco.h.
char * bufr_adjust_string | ( | char * | s | ) |
Supress trailing blanks of a string.
s | string to process |
Definition at line 333 of file bufrdeco_utils.c.
Referenced by bufrdeco_print_json_object_atom_data(), bufrdeco_print_json_tree_recursive(), and main().
char * bufr_charray_to_string | ( | char * | s, |
char * | buf, | ||
size_t | size | ||
) |
get a null termitated c-string from an array of unsigned chars
s | resulting string |
buf | pointer to first element in array |
size | number of chars in array |
Definition at line 316 of file bufrdeco_utils.c.
Referenced by main().
int bufr_decode_subset_data_compressed | ( | struct bufrdeco_subset_sequence_data * | s, |
struct bufrdeco_compressed_data_references * | r, | ||
struct bufrdeco * | b | ||
) |
Get data for a given subset in a compressed data bufr.
s | pointer to a struct bufrdeco_subset_sequence_data where to set the results |
r | pointer to the struct bufrdeco_compressed_data_references with the info about how and where to get the data |
b | basic container struct bufrdeco |
Definition at line 965 of file bufrdeco_compressed.c.
References BUFRDECO_COMPRESSED_REF_DATA_DESCRIPTOR_BITMASK, BUFRDECO_COMPRESSED_REF_OPERATOR_DESCRIPTOR, BUFRDECO_COMPRESSED_REF_REPLICATOR_DESCRIPTOR, BUFRDECO_COMPRESSED_REF_SEQUENCE_FINAL_BITMASK, BUFRDECO_COMPRESSED_REF_SEQUENCE_INIT_BITMASK, bufrdeco_get_atom_data_from_compressed_data_ref(), bufrdeco_increase_data_array(), BUFRDECO_OUTPUT_JSON_SUBSET_DATA, bufrdeco_print_json_object_atom_data(), bufrdeco_print_json_object_operator_descriptor(), bufrdeco_print_json_object_replicator_descriptor(), bufrdeco_print_json_separator(), bufrdeco_print_json_sequence_descriptor_final(), bufrdeco_print_json_sequence_descriptor_header(), bufrdeco_print_json_subset_data_epilogue(), bufrdeco_print_json_subset_data_prologue(), bufrdeco_compressed_ref::desc, bufrdeco_subset_sequence_data::dim, bufrdeco::error, bufrdeco_compressed_ref::is_associated, bufrdeco_compressed_ref::mask, bufrdeco::mask, bufrdeco_subset_sequence_data::nd, bufrdeco_compressed_data_references::nd, bufrdeco::out, bufrdeco_compressed_data_references::refs, bufrdeco_compressed_ref::replicated_desc, bufrdeco_compressed_ref::replicated_loop, bufrdeco_compressed_ref::replicated_ndesc, bufrdeco_compressed_ref::replicated_nloop, bufrdeco_compressed_ref::seq, bufrdeco_subset_sequence_data::sequence, bufrdeco_subset_sequence_data::ss, bufrdeco::state, and bufrdeco_decoding_data_state::subset.
Referenced by bufrdeco_decode_data_subset().
int bufr_find_tableB_index | ( | buf_t * | index, |
struct bufr_tableB * | tb, | ||
const char * | key | ||
) |
found a descriptor index in a struct bufr_tableB
index | pointer to a size_t where to set the result if success |
tb | pointer to struct bufr_tableB where are stored all table B data |
key | descriptor string in format FXXYYY |
Definition at line 205 of file bufrdeco_tableB.c.
References bufr_descriptor::c, bufr_tableB::item, bufr_tableB::num, uint32_t_to_descriptor(), bufr_descriptor::x, bufr_tableB_decoded_item::x, bufr_tableB::x_start, bufr_descriptor::y, bufr_tableB_decoded_item::y, and bufr_tableB::y_ref.
Referenced by bufr_restore_original_tableB_item(), bufrdeco_fprint_tree_recursive(), and bufrdeco_print_json_tree_recursive().
int bufr_find_tableC_csv_index | ( | buf_t * | index, |
struct bufr_tableC * | tc, | ||
const char * | key, | ||
uint32_t | code | ||
) |
Definition at line 134 of file bufrdeco_tableC.c.
References bufrdeco_assert, bufr_descriptor::c, bufr_tableC::item, bufr_tableC_decoded_item::ival, bufr_tableC::num, uint32_t_to_descriptor(), bufr_descriptor::x, bufr_tableC::x_start, bufr_descriptor::y, and bufr_tableC_decoded_item::y.
Referenced by bufrdeco_explained_table_val().
int bufr_read_subset_offset_bits | ( | FILE * | f, |
struct bufrdeco_subset_bit_offsets * | off | ||
) |
Write offset bit array for subsets in a non-compressed bufr.
f | file pointer opened by caller |
off | pointer to the struct bufrdeco_subset_bit_offsets with the data to write into file |
Definition at line 577 of file bufrdeco_utils.c.
References bufrdeco_assert_with_return_val, bufrdeco_subset_bit_offsets::nr, and bufrdeco_subset_bit_offsets::ofs.
Referenced by bufrdeco_read_subset_offset_bits().
int bufr_read_tableB | ( | struct bufrdeco * | b | ) |
Definition at line 42 of file bufrdeco_tableB.c.
References bufr_tables::b, BUFR_MAXLINES_TABLEB, bufr_descriptor::c, bufr_tableB_decoded_item::changed, CSV_MAXL, bufrdeco::error, bufr_tableB::item, bufr_tableB_decoded_item::key, bufr_tableB_decoded_item::name, bufr_tableB_decoded_item::nbits, bufr_tableB_decoded_item::nbits_ori, bufr_tableB::nlines, bufr_tableB::num, bufr_tableB::old_path, parse_csv_line(), bufr_tableB::path, bufr_tableB_decoded_item::reference, bufr_tableB_decoded_item::reference_ori, bufr_tableB_decoded_item::scale, bufr_tableB_decoded_item::scale_ori, bufrdeco::tables, uint32_t_to_descriptor(), bufr_tableB_decoded_item::unit, bufr_tableB::wmo_table, bufr_descriptor::x, bufr_tableB_decoded_item::x, bufr_tableB::x_start, bufr_descriptor::y, bufr_tableB_decoded_item::y, and bufr_tableB::y_ref.
Referenced by bufr_read_tables().
int bufr_read_tableC | ( | struct bufrdeco * | b | ) |
Reads a file with table C content (Code table and bit flags) according with csv WMO format.
b | pointer to a target struct bufrdeco |
Definition at line 33 of file bufrdeco_tableC.c.
References BUFR_EXPLAINED_LENGTH, BUFR_MAXLINES_TABLEC, bufr_tables::c, CSV_MAXL, bufr_tableC_decoded_item::description, bufrdeco::error, bufr_tableC::item, bufr_tableC_decoded_item::ival, bufr_tableC_decoded_item::key, bufr_tableC::nlines, bufr_tableC::num, bufr_tableC::old_path, parse_csv_line(), bufr_tableC::path, bufrdeco::tables, uint32_t_to_descriptor(), bufr_tableC::wmo_table, bufr_descriptor::x, bufr_tableC_decoded_item::x, bufr_tableC::x_start, bufr_descriptor::y, bufr_tableC_decoded_item::y, and bufr_tableC::y_ref.
Referenced by bufr_read_tables().
int bufr_read_tableD | ( | struct bufrdeco * | b | ) |
Reads a file with table D content according with WMO csv format.
b | pointer to a target struct bufrdeco |
Definition at line 32 of file bufrdeco_tableD.c.
References BUFR_MAXLINES_TABLED, CSV_MAXL, bufr_tables::d, bufr_tableD_decoded_item::description, bufr_tableD_decoded_item::description2, bufrdeco::error, bufr_tableD::item, bufr_tableD_decoded_item::key, bufr_tableD_decoded_item::key2, bufr_tableD::l, bufr_tableD::nlines, bufr_tableD::num, bufr_tableD::old_path, parse_csv_line(), bufr_tableD::path, bufrdeco::tables, uint32_t_to_descriptor(), bufr_tableD::wmo_table, bufr_descriptor::x, and bufr_tableD::x_start.
Referenced by bufr_read_tables().
int bufr_read_tables | ( | struct bufrdeco * | b | ) |
Read the tables according with bufr file data from a bufr table directory.
b | basic struct with needed data |
The default directories where to search bufr tables are stored in DEFAULT_BUFRTABLES_WMO_CSV_DIR1 and DEFAULT_BUFRTABLES_WMO_CSV_DIR2
Definition at line 162 of file bufrdeco_wmo.c.
References bufr_tables::b, bufr_read_tableB(), bufr_read_tableC(), bufr_read_tableD(), bufrdeco_assert, bufrdeco_cache_tables_search(), bufrdeco_init_tables(), bufrdeco_store_tables(), BUFRDECO_USE_TABLES_CACHE, bufrdeco::cache, bufr_tableB_decoded_item::changed, bufrdeco::error, get_wmo_tablenames(), bufr_tableB::item, bufrdeco::mask, bufr_sec1::master_version, bufr_tableB_decoded_item::nbits, bufr_tableB_decoded_item::nbits_ori, bufr_tables_cache::next, bufr_tableB::nlines, bufr_tableB_decoded_item::reference, bufr_tableB_decoded_item::reference_ori, bufr_tableB_decoded_item::scale, bufr_tableB_decoded_item::scale_ori, bufrdeco::sec1, bufr_tables_cache::tab, and bufrdeco::tables.
Referenced by bufrdeco_read_buffer().
int bufr_write_subset_offset_bits | ( | FILE * | f, |
struct bufrdeco_subset_bit_offsets * | off | ||
) |
Write offset bit array for subsets in a non-compressed bufr.
f | file pointer opened by caller |
off | pointer to the struct bufrdeco_subset_bit_offsets with the data to write into file |
Definition at line 555 of file bufrdeco_utils.c.
References bufrdeco_assert_with_return_val, bufrdeco_subset_bit_offsets::nr, and bufrdeco_subset_bit_offsets::ofs.
Referenced by bufrdeco_write_subset_offset_bits().
int bufrdeco_add_to_bitmap | ( | struct bufrdeco_bitmap * | bm, |
buf_t | index_to, | ||
buf_t | index_by | ||
) |
Push a bitmap element in a bufrdeco_bitmap.
bm | target struct bufrdeco_bitmap where to push |
index_to | index of the bufrdeco_bitmap which this is bitmapping to |
index_by | index of the bufrdeco_bitmap which this is bitmapped by |
Definition at line 461 of file bufrdeco_utils.c.
References bufrdeco_bitmap::bitmap_to, bufrdeco_bitmap::bitmaped_by, BUFR_MAX_BITMAP_PRESENT_DATA, and bufrdeco_bitmap::nb.
Referenced by bufrdeco_decode_replicated_subsequence(), and bufrdeco_decode_replicated_subsequence_compressed().
int bufrdeco_allocate_bitmap | ( | struct bufrdeco * | b | ) |
allocate bitmap
b | the active struct bufrdeco |
Definition at line 269 of file bufrdeco_memory.c.
References bufrdeco::bitmap, bufrdeco_bitmap_array::bmap, BUFR_MAX_BITMAPS, bufrdeco_assert, bufrdeco::error, and bufrdeco_bitmap_array::nba.
Referenced by bufrdeco_parse_f2_compressed(), and bufrdeco_parse_f2_descriptor().
int bufrdeco_cache_tables_search | ( | struct bufr_tables_cache * | c, |
uint8_t | ver | ||
) |
Search a struct bufr_tables in bufr_tables_cache.
c | pointer to the struct bufr_tables_cache where to search |
ver | small int with the master version acting as a key in the seardch |
Definition at line 304 of file bufrdeco_wmo.c.
References BUFRDECO_TABLES_CACHE_SIZE, and bufr_tables_cache::ver.
Referenced by bufr_read_tables().
int bufrdeco_clean_bitmaps | ( | struct bufrdeco * | b | ) |
Clean all allocated bitmaps, but still is in memory.
b | the active struct bufrdeco |
Definition at line 308 of file bufrdeco_memory.c.
References bufrdeco::bitmap, bufrdeco_bitmap_array::bmap, bufrdeco_assert, and bufrdeco_bitmap_array::nba.
Referenced by bufrdeco_decode_data_subset().
int bufrdeco_clean_subset_sequence_data | ( | struct bufrdeco_subset_sequence_data * | ba | ) |
Cleans a struct bufrdeco_subset_sequence_data.
ba | Pointer to struct bufrdeco_subset_sequence_data to clean |
For eficience, if sequence in the struct bufrdeco_subset_sequence_data is allocated, just set the used elements to zero. If is still no allocated memory for sequence inits the struct
Definition at line 164 of file bufrdeco_memory.c.
References bufrdeco_assert, bufrdeco_init_subset_sequence_data(), bufrdeco_subset_sequence_data::nd, and bufrdeco_subset_sequence_data::sequence.
Referenced by bufrdeco_decode_data_subset().
int bufrdeco_close | ( | struct bufrdeco * | b | ) |
Free all allocated memory. Needed when no more task to do with bufrdeco library.
b | pointer to the target struct |
This function must be called at the end when no more calls to bufrdeco library is needed
b->out and b->err must be closed by caller if are not the default stdout or stderr
Definition at line 259 of file bufrdeco.c.
References bufrdeco::bitmap, bufrdeco_assert, bufrdeco_free_bitmap_array(), bufrdeco_free_cache_tables(), bufrdeco_free_compressed_data_references(), bufrdeco_free_expanded_tree(), bufrdeco_free_subset_sequence_data(), bufrdeco_free_tables(), BUFRDECO_USE_TABLES_CACHE, bufrdeco::cache, bufrdeco::mask, bufrdeco::refs, bufrdeco::seq, bufrdeco::tables, and bufrdeco::tree.
Referenced by main().
int bufrdeco_decode_data_subset | ( | struct bufrdeco * | b | ) |
User interface to decode a BUFR subset.
b | pointer to the base struct bufrdeco |
Note that if succeeded the counter to current subset index is increased. Remember that in case of non compressed data we must to decode all previous subsets to get the desired one. In case of compressed we can access directly to a the desired subset
Definition at line 62 of file bufrdeco_data.c.
References bufr_decode_subset_data_compressed(), bufrdeco_assert, bufrdeco_clean_bitmaps(), bufrdeco_clean_subset_sequence_data(), bufrdeco_decode_subset_data_recursive(), bufrdeco_parse_compressed(), bufr_sec3::compressed, bufrdeco::error, bufrdeco_compressed_data_references::nd, bufrdeco_expanded_tree::nseq, bufrdeco::refs, bufrdeco::sec3, bufrdeco::seq, bufrdeco::state, bufrdeco_decoding_data_state::subset, and bufrdeco::tree.
Referenced by bufrdeco_get_subset_sequence_data(), and bufrdeco_get_target_subset_sequence_data().
int bufrdeco_decode_replicated_subsequence | ( | struct bufrdeco_subset_sequence_data * | d, |
struct bufr_replicator * | r, | ||
struct bufrdeco * | b | ||
) |
Decodes a replicated sequence.
d | target struct bufrdeco_subset_sequence_data |
r | pointer to a struct bufr_replicator which manage the replication task |
b | pointer to the base struct bufrdeco |
Definition at line 509 of file bufrdeco_data.c.
References bufr_sequence_index_range::active, bufrdeco::bitmap, bufr_atom_data::bitmap_to, bufrdeco_bitmap::bitmap_to, bufrdeco_decoding_data_state::bitmaping, bufrdeco_bitmap_array::bmap, BUFR_MAX_QUALITY_DATA, bufrdeco_add_to_bitmap(), bufrdeco_assert, bufrdeco_decode_replicated_subsequence(), bufrdeco_decode_subset_data_recursive(), bufrdeco_increase_data_array(), BUFRDECO_OUTPUT_JSON_SUBSET_DATA, bufrdeco_parse_f2_descriptor(), bufrdeco_print_json_object_atom_data(), bufrdeco_print_json_object_operator_descriptor(), bufrdeco_print_json_object_replicator_descriptor(), bufrdeco_print_json_separator(), bufrdeco_tableB_val(), bufrdeco_decoding_data_state::data_repetition_factor, bufrdeco_subset_sequence_data::dim, bufrdeco_decoding_data_state::dstat_active, bufrdeco_bitmap::dstat_desc, bufrdeco::error, bufr_descriptor::f, bufr_sequence_index_range::first, bufr_atom_data::is_bitmaped_by, bufr_replicator::ixdel, bufr_replicator::ixrep, bufr_sequence::lseq, bufrdeco::mask, bufrdeco_bitmap_array::nba, bufrdeco_subset_sequence_data::nd, bufr_replicator::ndesc, bufrdeco_bitmap::nds, bufr_replicator::nloops, bufr_sequence::no_data_present, bufrdeco_bitmap::nq, bufrdeco_bitmap::ns1, bufrdeco::out, bufrdeco_bitmap::quality, bufrdeco_decoding_data_state::quality_active, bufr_atom_data::related_to, bufrdeco_bitmap::retain, bufrdeco_decoding_data_state::retained_active, bufr_replicator::s, bufrdeco_subset_sequence_data::sequence, bufr_sequence::sons, bufrdeco_bitmap::stat1, bufrdeco_decoding_data_state::stat1_active, bufrdeco_bitmap::stat1_desc, bufrdeco::state, bufrdeco_bitmap::subs, bufrdeco_decoding_data_state::subs_active, bufr_atom_data::val, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_decode_replicated_subsequence(), and bufrdeco_decode_subset_data_recursive().
int bufrdeco_decode_replicated_subsequence_compressed | ( | struct bufrdeco_compressed_data_references * | r, |
struct bufr_replicator * | rep, | ||
struct bufrdeco * | b | ||
) |
decodes a repicated subsequence
r | pointer to target struct bufrdeco_compressed_data_references where to set results |
rep | pointer to a replicator which contains the data for replication |
b | basic container struct bufrdeco |
Definition at line 352 of file bufrdeco_compressed.c.
References bufr_sequence_index_range::active, bufrdeco_decoding_data_state::assoc_bits, bufrdeco::bitmap, bufrdeco_bitmap::bitmap_to, bufrdeco_compressed_ref::bitmap_to, bufrdeco_decoding_data_state::bitmaping, bufrdeco_compressed_ref::bits, bufrdeco_bitmap_array::bmap, BUFR_MAX_QUALITY_DATA, bufrdeco_add_to_bitmap(), BUFRDECO_COMPRESSED_REF_DATA_DESCRIPTOR_BITMASK, BUFRDECO_COMPRESSED_REF_OPERATOR_DESCRIPTOR, BUFRDECO_COMPRESSED_REF_REPLICATOR_DESCRIPTOR, bufrdeco_decode_replicated_subsequence_compressed(), bufrdeco_increase_compressed_data_references_count(), bufrdeco_parse_compressed_recursive(), bufrdeco_parse_f2_compressed(), bufrdeco_tableB_compressed(), bufrdeco_compressed_ref::desc, bufrdeco_decoding_data_state::dstat_active, bufrdeco_bitmap::dstat_desc, bufrdeco::error, bufr_descriptor::f, bufr_sequence_index_range::first, bufrdeco_compressed_ref::is_bitmaped_by, bufr_replicator::ixdel, bufr_replicator::ixrep, bufr_sequence_index_range::last, bufr_sequence::lseq, bufrdeco_compressed_ref::mask, bufrdeco_bitmap_array::nba, bufrdeco_compressed_data_references::nd, bufr_replicator::ndesc, bufrdeco_bitmap::nds, bufr_replicator::nloops, bufr_sequence::no_data_present, bufrdeco_bitmap::nq, bufrdeco_bitmap::ns1, bufrdeco_bitmap::quality, bufrdeco_decoding_data_state::quality_active, bufrdeco_compressed_ref::ref, bufrdeco_compressed_ref::ref0, bufrdeco_compressed_data_references::refs, bufrdeco_compressed_ref::related_to, bufrdeco_compressed_ref::replicated_desc, bufrdeco_compressed_ref::replicated_loop, bufrdeco_compressed_ref::replicated_ndesc, bufrdeco_compressed_ref::replicated_nloop, bufrdeco_bitmap::retain, bufrdeco_decoding_data_state::retained_active, bufr_replicator::s, bufrdeco_compressed_ref::seq, bufr_sequence::sons, bufrdeco_bitmap::stat1, bufrdeco_decoding_data_state::stat1_active, bufrdeco_bitmap::stat1_desc, bufrdeco::state, bufrdeco_bitmap::subs, bufrdeco_decoding_data_state::subs_active, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_decode_replicated_subsequence_compressed(), and bufrdeco_parse_compressed_recursive().
int bufrdeco_decode_subset_data_recursive | ( | struct bufrdeco_subset_sequence_data * | d, |
struct bufr_sequence * | l, | ||
struct bufrdeco * | b | ||
) |
decode the data from a subset in a recursive way
d | pointer to the target struct bufrdeco_subset_sequence_data |
l | pointer to the source struct bufr_sequence |
b | pointer to the base struct bufrdeco |
Definition at line 171 of file bufrdeco_data.c.
References bufr_sequence_index_range::active, bufrdeco_decoding_data_state::added_bit_length, bufrdeco_decoding_data_state::added_reference, bufrdeco_decoding_data_state::added_scale, bufrdeco_decoding_data_state::assoc_bits, bufrdeco_decoding_data_state::bit_offset, bufrdeco_decoding_data_state::bitmap, bufrdeco::bitmap, bufrdeco_decoding_data_state::bitmaping, bufrdeco_bitmap_array::bmap, BUFR_MAX_QUALITY_DATA, BUFR_MAX_SUBSETS, bufrdeco_assert, bufrdeco_decode_replicated_subsequence(), bufrdeco_decode_subset_data_recursive(), bufrdeco_increase_data_array(), BUFRDECO_OUTPUT_JSON_SUBSET_DATA, bufrdeco_parse_f2_descriptor(), bufrdeco_print_json_object_atom_data(), bufrdeco_print_json_object_operator_descriptor(), bufrdeco_print_json_object_replicator_descriptor(), bufrdeco_print_json_separator(), bufrdeco_print_json_sequence_descriptor_final(), bufrdeco_print_json_sequence_descriptor_header(), bufrdeco_print_json_subset_data_epilogue(), bufrdeco_print_json_subset_data_prologue(), bufrdeco_tableB_val(), bufr_descriptor::c, bufrdeco_decoding_data_state::changing_reference, bufrdeco_decoding_data_state::data_repetition_factor, bufrdeco_subset_sequence_data::dim, bufrdeco_decoding_data_state::dstat_active, bufrdeco_bitmap::dstat_desc, bufrdeco::error, bufr_descriptor::f, bufrdeco_decoding_data_state::factor_reference, bufr_sequence_index_range::first, bufrdeco_decoding_data_state::fixed_ccitt, bufr_replicator::ixdel, bufr_replicator::ixrep, bufrdeco_decoding_data_state::local_bit_reserved, bufr_sequence::lseq, bufrdeco::mask, bufrdeco_bitmap_array::nba, bufrdeco_subset_sequence_data::nd, bufr_replicator::ndesc, bufr_sequence::ndesc, bufrdeco_bitmap::nds, bufr_replicator::nloops, bufr_sequence::no_data_present, bufrdeco_subset_bit_offsets::nr, bufr_atom_data::ns, bufrdeco_bitmap::ns1, bufrdeco::offsets, bufrdeco_subset_bit_offsets::ofs, bufrdeco::out, bufrdeco_decoding_data_state::quality_active, bufrdeco_decoding_data_state::retained_active, bufr_replicator::s, bufr_atom_data::seq, bufrdeco_expanded_tree::seq, bufrdeco_subset_sequence_data::sequence, bufr_sequence::sons, bufrdeco_subset_sequence_data::ss, bufrdeco_decoding_data_state::stat1_active, bufrdeco_bitmap::stat1_desc, bufrdeco::state, bufrdeco_decoding_data_state::subs_active, bufrdeco_decoding_data_state::subset, bufrdeco::tree, bufr_atom_data::val, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_decode_data_subset(), bufrdeco_decode_replicated_subsequence(), and bufrdeco_decode_subset_data_recursive().
char * bufrdeco_explained_flag_csv_val | ( | char * | expl, |
size_t | dim, | ||
struct bufr_tableC * | tc, | ||
struct bufr_descriptor * | d, | ||
uint64_t | ival, | ||
uint8_t | nbits | ||
) |
char * bufrdeco_explained_flag_val | ( | char * | expl, |
size_t | dim, | ||
struct bufr_tableC * | tc, | ||
struct bufr_descriptor * | d, | ||
uint64_t | ival, | ||
uint8_t | nbits | ||
) |
Definition at line 200 of file bufrdeco_tableC.c.
References bufrdeco_assert, bufr_tableC_decoded_item::description, bufr_tableC::item, bufr_tableC_decoded_item::ival, bufr_tableC::num, bufr_descriptor::x, bufr_tableC_decoded_item::x, bufr_tableC::x_start, bufr_descriptor::y, bufr_tableC_decoded_item::y, and bufr_tableC::y_ref.
Referenced by bufrdeco_get_atom_data_from_compressed_data_ref(), and bufrdeco_tableB_val().
char * bufrdeco_explained_table_csv_val | ( | char * | expl, |
size_t | dim, | ||
struct bufr_tableC * | tc, | ||
uint32_t * | index, | ||
struct bufr_descriptor * | d, | ||
uint32_t | ival | ||
) |
char * bufrdeco_explained_table_val | ( | char * | expl, |
size_t | dim, | ||
struct bufr_tableC * | tc, | ||
uint32_t * | index, | ||
struct bufr_descriptor * | d, | ||
uint32_t | ival | ||
) |
Definition at line 168 of file bufrdeco_tableC.c.
References bufr_find_tableC_csv_index(), bufrdeco_assert, bufr_descriptor::c, bufr_tableC_decoded_item::description, bufr_tableC::item, strncpy_safe, bufr_descriptor::x, bufr_tableC::x_start, bufr_descriptor::y, and bufr_tableC::y_ref.
Referenced by bufrdeco_get_atom_data_from_compressed_data_ref(), and bufrdeco_tableB_val().
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()
b | pointer to struct bufrdeco |
filename | complete path of BUFR file |
This function does the folowing tasks:
< pointer to a memory buffer where we write raw bufr file
Definition at line 120 of file bufrdeco_read.c.
References BUFR_LEN, bufrdeco_assert, bufrdeco_read_buffer(), and bufrdeco::error.
Referenced by bufrdeco_get_bufr(), and main().
int bufrdeco_fprint_subset_sequence_data | ( | FILE * | f, |
struct bufrdeco_subset_sequence_data * | s | ||
) |
Definition at line 520 of file bufrdeco_print.c.
References bufrdeco_assert, bufrdeco_print_atom_data(), bufrdeco_subset_sequence_data::nd, bufr_atom_data::seq, and bufrdeco_subset_sequence_data::sequence.
Referenced by bufrdeco_print_subset_sequence_data().
int bufrdeco_fprint_subset_sequence_data_html | ( | FILE * | f, |
struct bufrdeco_subset_sequence_data * | s | ||
) |
Definition at line 241 of file bufrdeco_print_html.c.
References bufrdeco_assert, bufrdeco_print_atom_data_html(), bufrdeco_subset_sequence_data::nd, bufrdeco_subset_sequence_data::sequence, and bufrdeco_subset_sequence_data::ss.
Referenced by bufrdeco_print_subset_sequence_data_html().
int bufrdeco_fprint_subset_sequence_data_tagged_html | ( | FILE * | f, |
struct bufrdeco_subset_sequence_data * | s, | ||
char * | id | ||
) |
Definition at line 279 of file bufrdeco_print_html.c.
References bufrdeco_assert, bufrdeco_print_atom_data_html(), bufrdeco_subset_sequence_data::nd, bufrdeco_subset_sequence_data::sequence, and bufrdeco_subset_sequence_data::ss.
Referenced by bufrdeco_print_subset_sequence_data_tagged_html().
int bufrdeco_fprint_tree | ( | FILE * | f, |
struct bufrdeco * | b | ||
) |
Print a tree of descriptors.
f | Pointer to file opened by caller |
b | pointer to a basic container struct bufrdeco |
Definition at line 360 of file bufrdeco_print.c.
References bufrdeco_assert, bufrdeco_fprint_tree_recursive(), BUFRDECO_OUTPUT_HTML, and bufrdeco::mask.
int bufrdeco_free_bitmap_array | ( | struct bufrdeco_bitmap_array * | a | ) |
Free an allocated bitmap array.
a | pointer to target struct bufrdeco_bitmap_array to free |
Definition at line 331 of file bufrdeco_memory.c.
References bufrdeco_bitmap_array::bmap, bufrdeco_assert, and bufrdeco_bitmap_array::nba.
Referenced by bufrdeco_close(), and bufrdeco_reset().
int bufrdeco_free_cache_tables | ( | struct bufr_tables_cache * | c | ) |
deallocate and clean a bufr_tables_cache
c | pointer to the struct to clean |
Definition at line 322 of file bufrdeco_wmo.c.
References BUFRDECO_TABLES_CACHE_SIZE, and bufr_tables_cache::tab.
Referenced by bufrdeco_close().
int bufrdeco_free_compressed_data_references | ( | struct bufrdeco_compressed_data_references * | rf | ) |
Free the memory allocated for array of references in a struct bufrdeco_compressed_data_references.
rf | pointer to the target struct bufrdeco_compressed_data_references to free |
Definition at line 250 of file bufrdeco_memory.c.
References bufrdeco_assert, and bufrdeco_compressed_data_references::refs.
Referenced by bufrdeco_close(), and bufrdeco_reset().
int bufrdeco_free_expanded_tree | ( | struct bufrdeco_expanded_tree ** | t | ) |
Frees the allocated space for a struct bufrdeco_expanded_tree.
t | pointer to the target pointer to struct bufrdeco_expanded_tree |
Definition at line 89 of file bufrdeco_memory.c.
References bufrdeco_assert.
Referenced by bufrdeco_close(), and bufrdeco_reset().
int bufrdeco_free_subset_sequence_data | ( | struct bufrdeco_subset_sequence_data * | ba | ) |
Free the memory for sequence array in a struct bufrdeco_subset_sequence_data.
ba | pointer to the target struct to free |
Definition at line 183 of file bufrdeco_memory.c.
References bufrdeco_assert, and bufrdeco_subset_sequence_data::sequence.
Referenced by bufrdeco_close(), and bufrdeco_reset().
int bufrdeco_free_tables | ( | struct bufr_tables ** | t | ) |
Frees the allocated space for a struct bufr_tables.
t | pointer to the target pointer to struct bufr_tables |
Definition at line 51 of file bufrdeco_memory.c.
References bufrdeco_assert.
Referenced by bufrdeco_close().
int bufrdeco_get_atom_data_from_compressed_data_ref | ( | struct bufr_atom_data * | a, |
struct bufrdeco_compressed_ref * | r, | ||
buf_t | subset, | ||
struct bufrdeco * | b | ||
) |
Get atom data from a descriptor for a given subset.
a | pointer to the target struct bufr_atom_data where to set the results |
r | pointer to the struct bufrdeco_compressed_ref with the info to know how and where get the data |
subset | index for solicited subset. First subset has index 0 |
b | basic container struct bufrdeco |
Definition at line 742 of file bufrdeco_compressed.c.
References bufr_atom_data::associated, bufr_tables::b, bufrdeco_compressed_ref::bit0, bufr_atom_data::bitmap_to, bufrdeco_compressed_ref::bitmap_to, bufrdeco_compressed_ref::bits, bufrdeco_explained_flag_val(), bufrdeco_explained_table_val(), bufr_descriptor::c, bufr_tables::c, bufrdeco_compressed_ref::cref0, bufr_atom_data::ctable, bufr_atom_data::cval, bufr_atom_data::desc, bufrdeco_compressed_ref::desc, DESCRIPTOR_HAVE_CODE_TABLE_STRING, DESCRIPTOR_HAVE_FLAG_TABLE_STRING, DESCRIPTOR_HAVE_STRING_VALUE, DESCRIPTOR_IS_CODE_TABLE, DESCRIPTOR_IS_FLAG_TABLE, DESCRIPTOR_IS_LOCAL, DESCRIPTOR_VALUE_MISSING, bufrdeco::error, bufr_atom_data::escale, bufrdeco_compressed_ref::escale, get_bits_as_char_array(), get_bits_as_uint32_t(), bufrdeco_compressed_ref::has_data, bufrdeco_compressed_ref::inc_bits, is_a_local_descriptor(), bufrdeco_compressed_ref::is_associated, bufr_atom_data::is_bitmaped_by, bufrdeco_compressed_ref::is_bitmaped_by, bufr_tableB::item, bufr_atom_data::mask, MISSING_INTEGER, MISSING_REAL, bufr_atom_data::name, bufrdeco_compressed_ref::name, bufr_sec4::raw, bufrdeco_compressed_ref::ref, bufrdeco_compressed_ref::ref0, bufr_atom_data::related_to, bufrdeco_compressed_ref::related_to, bufrdeco::sec4, bufr_tableB_decoded_item::tableC_ref, bufrdeco::tables, bufr_atom_data::unit, bufrdeco_compressed_ref::unit, bufr_atom_data::val, bufr_descriptor::x, bufr_tableB::x_start, bufr_descriptor::y, and bufr_tableB::y_ref.
Referenced by bufr_decode_subset_data_compressed().
int bufrdeco_get_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_bufr()
b | pointer to struct bufrdeco |
filename | complete path of BUFR file |
This function does the folowing tasks:
Definition at line 315 of file bufrdeco.c.
References bufrdeco_assert_with_return_val, and bufrdeco_extract_bufr().
char * bufrdeco_get_f2_descriptor_explanation | ( | char * | e, |
size_t | dim, | ||
struct bufr_descriptor * | d | ||
) |
Definition at line 773 of file bufrdeco_f2.c.
References bufrdeco_assert, bufr_descriptor::f, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_fprint_tree_recursive(), bufrdeco_print_json_object_operator_descriptor(), and bufrdeco_print_json_tree_recursive().
struct bufrdeco_subset_sequence_data * bufrdeco_get_subset_sequence_data | ( | struct bufrdeco * | b | ) |
Parse and get a struct bufrdeco_subset_sequence_data.
b | basic container struct bufrdeco |
Note that if succeeded the counter to current subset index is increased. Remember that in case of non compressed data we must to decode all previous subsets to get the desired one. In case of compressed we can access directly to a the desired subset
Definition at line 39 of file bufrdeco_data.c.
References bufrdeco_assert, bufrdeco_decode_data_subset(), and bufrdeco::seq.
Referenced by bufrdeco_get_target_subset_sequence_data().
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.
nset | index of subset we want to parse and get data. First subset in a BUFR file has index 0. |
b | pointer to the struct bufrdeco |
Definition at line 396 of file bufrdeco.c.
References bufrdeco_assert, bufrdeco_decode_data_subset(), bufrdeco_get_subset_sequence_data(), BUFRDECO_OUTPUT_JSON_SUBSET_DATA, bufrdeco_parse_compressed(), bufr_sec3::compressed, bufrdeco::error, bufrdeco::mask, bufrdeco_compressed_data_references::nd, bufrdeco_subset_bit_offsets::nr, bufrdeco::offsets, bufrdeco_subset_bit_offsets::ofs, bufrdeco::refs, bufrdeco::sec3, bufrdeco::state, bufrdeco_decoding_data_state::subset, and bufr_sec3::subsets.
Referenced by main().
char * bufrdeco_get_version | ( | char * | version, |
size_t | dversion, | ||
char * | build, | ||
size_t | dbuild, | ||
char * | builder, | ||
size_t | dbuilder, | ||
int * | version_major, | ||
int * | version_minor, | ||
int * | version_patch | ||
) |
Definition at line 50 of file bufrdeco.c.
References strncpy_safe, and VERSION.
Referenced by bufrtotac_print_version().
int bufrdeco_increase_compressed_data_references_count | ( | struct bufrdeco_compressed_data_references * | r, |
struct bufrdeco * | b | ||
) |
Increment the count of a struct bufrdeco_compressed_data_references.
r | pointer to the target struct |
b | pointer to the current active struct bufrdeco |
Definition at line 1089 of file bufrdeco_compressed.c.
References BUFR_NMAXSEQ, bufrdeco::error, and bufrdeco_compressed_data_references::nd.
Referenced by bufrdeco_decode_replicated_subsequence_compressed(), and bufrdeco_parse_compressed_recursive().
int bufrdeco_increase_data_array | ( | struct bufrdeco_subset_sequence_data * | d | ) |
doubles the allocated space for a struct bufrdeco_subset_sequence_data whenever is posible
d | pointer to source struct bufrdeco_subset_sequence_data |
The amount of data in a bufr must be huge. In a first moment, the dimension of a sequence of structs bufr_atom_data is BUFR_NMAXSEQ but may be increased. This function task is try to double the allocated dimension and reallocate it.
Definition at line 139 of file bufrdeco_data.c.
References BUFR_NMAXSEQ, bufrdeco_assert, bufrdeco_subset_sequence_data::dim, and bufrdeco_subset_sequence_data::sequence.
Referenced by bufr_decode_subset_data_compressed(), bufrdeco_decode_replicated_subsequence(), bufrdeco_decode_subset_data_recursive(), and bufrdeco_parse_f2_descriptor().
int bufrdeco_init | ( | struct bufrdeco * | b | ) |
Inits and allocate memory for a struct bufrdeco.
b | pointer to the target struct |
This function only must be called once. When finished the function bufrdeco_close must be called to free all needed memory
Definition at line 138 of file bufrdeco.c.
References bufrdeco_assert, bufrdeco_init_expanded_tree(), bufrdeco_init_tables(), bufrdeco::err, bufrdeco::error, bufrdeco::out, bufrdeco::tables, and bufrdeco::tree.
Referenced by main().
int bufrdeco_init_compressed_data_references | ( | struct bufrdeco_compressed_data_references * | rf | ) |
Init a struct bufrdeco_compressed_data_references.
rf | pointer ti the target struct |
If already memory is allocated for array of references then just adjust the used index to zero. Otherwise it allocate the needed memory and init the struct
Definition at line 205 of file bufrdeco_memory.c.
References BUFR_NMAXSEQ, bufrdeco_assert, bufrdeco_compressed_data_references::dim, bufrdeco_compressed_data_references::nd, and bufrdeco_compressed_data_references::refs.
Referenced by bufrdeco_clean_compressed_data_references(), and bufrdeco_parse_compressed().
int bufrdeco_init_expanded_tree | ( | struct bufrdeco_expanded_tree ** | t | ) |
Init a struct bufrdeco_expanded_tree allocating space.
t | pointer to the target pointer to struct bufrdeco_expanded_tree |
Definition at line 70 of file bufrdeco_memory.c.
References bufrdeco_assert.
Referenced by bufrdeco_init(), and bufrdeco_reset().
int bufrdeco_init_subset_sequence_data | ( | struct bufrdeco_subset_sequence_data * | ba | ) |
Init a struct bufrdeco_subset_sequence_data.
ba | pointer to the target struct |
It is supossed that no memory is allocated for sequence. If we are not sure better use function bufrdeco_clean_subset_sequence_data
Definition at line 140 of file bufrdeco_memory.c.
References BUFR_NMAXSEQ, bufrdeco_assert, bufrdeco_subset_sequence_data::dim, and bufrdeco_subset_sequence_data::sequence.
Referenced by bufrdeco_clean_subset_sequence_data().
int bufrdeco_init_tables | ( | struct bufr_tables ** | t | ) |
Init a struct bufr_tables allocating space.
t | pointer to the target pointer to struct bufr_tables |
Definition at line 32 of file bufrdeco_memory.c.
References bufrdeco_assert.
Referenced by bufr_read_tables(), bufrdeco_init(), bufrdeco_store_tables(), and bufrdeco_substitute_tables().
int bufrdeco_parse_compressed | ( | struct bufrdeco_compressed_data_references * | r, |
struct bufrdeco * | b | ||
) |
Preliminary parse of a compressed data bufr.
r | pointer to a struct bufrdeco_compressed_data_references where to set the results |
b | basic container struct bufrdeco |
When a bufr report has compressed data, it is needed to do a first parse step to get references about where to find the data for every descriptor in subsets. This is what this function does. If succeeded the struct r will have all needed data to decode individual subsets.
Also be mind that the descriptors tree have to be already parsed when calling this function
Definition at line 40 of file bufrdeco_compressed.c.
References bufrdeco_init_compressed_data_references(), bufrdeco_parse_compressed_recursive(), bufrdeco::error, bufrdeco_expanded_tree::nseq, and bufrdeco::tree.
Referenced by bufrdeco_decode_data_subset(), and bufrdeco_get_target_subset_sequence_data().
int bufrdeco_parse_compressed_recursive | ( | struct bufrdeco_compressed_data_references * | r, |
struct bufr_sequence * | l, | ||
struct bufrdeco * | b | ||
) |
Parse recursively the compressed data in a bufr report to get references where to get data for every descriptor in a subset.
r | pointer to target struct bufrdeco_compressed_data_references where to set results |
l | pointer to a struct bufr_sequence to parse in this call. If NULL then it is first root sequence |
b | basic container struct bufrdeco |
Definition at line 76 of file bufrdeco_compressed.c.
References bufr_sequence_index_range::active, bufrdeco_decoding_data_state::added_bit_length, bufrdeco_decoding_data_state::added_reference, bufrdeco_decoding_data_state::added_scale, bufrdeco_decoding_data_state::assoc_bits, bufrdeco_decoding_data_state::bit_offset, bufrdeco_decoding_data_state::bitmap, bufrdeco::bitmap, bufrdeco_decoding_data_state::bitmaping, bufrdeco_bitmap_array::bmap, BUFR_MAX_QUALITY_DATA, BUFRDECO_COMPRESSED_REF_DATA_DESCRIPTOR_BITMASK, BUFRDECO_COMPRESSED_REF_OPERATOR_DESCRIPTOR, BUFRDECO_COMPRESSED_REF_REPLICATOR_DESCRIPTOR, BUFRDECO_COMPRESSED_REF_SEQUENCE_FINAL_BITMASK, BUFRDECO_COMPRESSED_REF_SEQUENCE_INIT_BITMASK, bufrdeco_decode_replicated_subsequence_compressed(), bufrdeco_increase_compressed_data_references_count(), bufrdeco_parse_compressed_recursive(), bufrdeco_parse_f2_compressed(), bufrdeco_tableB_compressed(), bufr_descriptor::c, bufrdeco_decoding_data_state::changing_reference, bufrdeco_compressed_ref::desc, bufrdeco_decoding_data_state::dstat_active, bufrdeco_bitmap::dstat_desc, bufrdeco::error, bufr_descriptor::f, bufrdeco_decoding_data_state::factor_reference, bufr_sequence_index_range::first, bufrdeco_decoding_data_state::fixed_ccitt, bufr_replicator::ixdel, bufr_replicator::ixrep, bufrdeco_decoding_data_state::local_bit_reserved, bufr_sequence::lseq, bufrdeco_compressed_ref::mask, bufrdeco_bitmap_array::nba, bufrdeco_compressed_data_references::nd, bufr_replicator::ndesc, bufr_sequence::ndesc, bufrdeco_bitmap::nds, bufr_replicator::nloops, bufr_sequence::no_data_present, bufrdeco_bitmap::ns1, bufrdeco_decoding_data_state::quality_active, bufrdeco_compressed_ref::ref0, bufrdeco_compressed_data_references::refs, bufrdeco_decoding_data_state::retained_active, bufr_replicator::s, bufrdeco_expanded_tree::seq, bufrdeco_compressed_ref::seq, bufr_sequence::sons, bufrdeco_decoding_data_state::stat1_active, bufrdeco_bitmap::stat1_desc, bufrdeco::state, bufrdeco_decoding_data_state::subs_active, bufrdeco::tree, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_decode_replicated_subsequence_compressed(), bufrdeco_parse_compressed(), and bufrdeco_parse_compressed_recursive().
int bufrdeco_parse_f2_compressed | ( | struct bufrdeco_compressed_data_references * | r, |
struct bufr_descriptor * | d, | ||
struct bufrdeco * | b | ||
) |
parse a descritor with f = 2 in case of compressed bufr
r | pointer to a struct bufrdeco_compressed_data_references where to set data references if any |
d | pointer to the source descriptor |
b | pointer to the base struct bufrdeco |
Definition at line 406 of file bufrdeco_f2.c.
References bufrdeco_decoding_data_state::added_bit_length, bufrdeco_decoding_data_state::added_scale, bufrdeco_decoding_data_state::assoc_bits, bufrdeco_decoding_data_state::bit_offset, bufrdeco_decoding_data_state::bitmap, bufrdeco::bitmap, bufrdeco_decoding_data_state::bitmaping, bufrdeco_bitmap_array::bmap, BUFR_NMAXSEQ, bufrdeco_allocate_bitmap(), bufrdeco_assert, BUFRDECO_COMPRESSED_REF_DATA_DESCRIPTOR_BITMASK, bufr_descriptor::c, bufrdeco_decoding_data_state::changing_reference, bufrdeco_compressed_ref::cref0, bufrdeco_compressed_ref::desc, bufrdeco_decoding_data_state::dstat_active, bufrdeco::error, bufr_descriptor::f, bufrdeco_decoding_data_state::factor_reference, bufrdeco_decoding_data_state::fixed_ccitt, get_bits_as_char_array(), get_bits_as_uint32_t(), bufrdeco_compressed_ref::has_data, bufrdeco_compressed_ref::inc_bits, bufrdeco_decoding_data_state::local_bit_reserved, bufrdeco_compressed_ref::mask, bufrdeco_compressed_ref::name, bufrdeco_bitmap_array::nba, bufrdeco_compressed_data_references::nd, pow10pos_int, bufrdeco_decoding_data_state::quality_active, bufr_sec4::raw, bufrdeco_compressed_data_references::refs, bufrdeco_decoding_data_state::retained_active, bufrdeco::sec3, bufrdeco::sec4, bufrdeco_decoding_data_state::stat1_active, bufrdeco::state, bufrdeco_decoding_data_state::subs_active, bufr_sec3::subsets, bufrdeco_compressed_ref::unit, VERSION, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_decode_replicated_subsequence_compressed(), and bufrdeco_parse_compressed_recursive().
int bufrdeco_parse_f2_descriptor | ( | struct bufrdeco_subset_sequence_data * | s, |
struct bufr_descriptor * | d, | ||
struct bufrdeco * | b | ||
) |
parse a descritor with f = 2
s | pointer to a struct bufrdeco_subset_sequence_data where to set data if any |
d | pointer to the source descriptor |
b | pointer to the base struct bufrdeco |
Definition at line 39 of file bufrdeco_f2.c.
References bufrdeco_decoding_data_state::added_bit_length, bufrdeco_decoding_data_state::added_scale, bufrdeco_decoding_data_state::assoc_bits, bufrdeco_decoding_data_state::bit_offset, bufrdeco_decoding_data_state::bitmap, bufrdeco::bitmap, bufrdeco_decoding_data_state::bitmaping, bufrdeco_bitmap_array::bmap, bufrdeco_allocate_bitmap(), bufrdeco_assert, bufrdeco_increase_data_array(), BUFRDECO_OUTPUT_JSON_SUBSET_DATA, bufrdeco_print_json_object_atom_data(), bufrdeco_print_json_separator(), bufr_descriptor::c, bufrdeco_decoding_data_state::changing_reference, bufr_atom_data::cval, bufr_atom_data::desc, DESCRIPTOR_HAVE_STRING_VALUE, DESCRIPTOR_VALUE_MISSING, bufrdeco_subset_sequence_data::dim, bufrdeco_decoding_data_state::dstat_active, bufrdeco::error, bufr_descriptor::f, bufrdeco_decoding_data_state::factor_reference, bufrdeco_decoding_data_state::fixed_ccitt, get_bits_as_char_array(), bufrdeco_decoding_data_state::local_bit_reserved, bufr_atom_data::mask, bufrdeco::mask, bufr_atom_data::name, bufrdeco_bitmap_array::nba, bufrdeco_subset_sequence_data::nd, bufrdeco::out, pow10pos_int, bufrdeco_decoding_data_state::quality_active, bufr_sec4::raw, bufrdeco_decoding_data_state::retained_active, bufrdeco::sec4, bufrdeco_subset_sequence_data::sequence, bufrdeco_decoding_data_state::stat1_active, bufrdeco::state, bufrdeco_decoding_data_state::subs_active, bufr_atom_data::unit, VERSION, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_decode_replicated_subsequence(), and bufrdeco_decode_subset_data_recursive().
int bufrdeco_parse_tree | ( | struct bufrdeco * | b | ) |
Parse the tree of descriptors without expand the replicators.
b | Pointer to the source struct bufrdeco |
This is the user function to parse the descriptor structure of a BUFR report. This is the first task we need to perform after read the bufr report with the aid of bufrdeco_read_bufr function.
At the end we will get an array of structs bufr_sequence defining the tree
A sequence layer is needed when parsing expanded descriptor sec3 and sec4
First bufr_sequence is the sequence of descriptors in sec3 after byte 8. This is a bufr_sequence in level 0.
When a sequence descriptor is found in a layer, the sequence entries found in table D form this descriptor is a son bufr_sequence. This son has then a father and also can have one or more sons. The index level is incremented by one every step it go into decendents.
And so we go in a recursive way up to the end.
Definition at line 120 of file bufrdeco.c.
References bufrdeco_assert, and bufrdeco_parse_tree_recursive().
Referenced by main().
int bufrdeco_parse_tree_recursive | ( | struct bufrdeco * | b, |
struct bufr_sequence * | father, | ||
buf_t | father_idesc, | ||
const char * | key | ||
) |
Parse the descriptor tree in a recursive way.
key | string with descriptor in form 'FXXYYY' |
father | pointer to the father struct bufr_sequence |
father_idesc | index of sequence descriptor in father bufr_sequence which this sequence derived |
b | pointer to the base struct bufrdeco |
Definition at line 60 of file bufrdeco_tree.c.
References bufr_sequence_index_range::active, bufrdeco_parse_tree_recursive(), bufrdeco_tableD_get_descriptors_array(), bufr_descriptor::c, bufr_sequence::cat_forecast, bufr_sequence::cond_event, bufrdeco::error, bufr_sequence::event, bufr_descriptor::f, bufr_sequence::father, bufr_sequence::father_idesc, bufr_sequence_index_range::first, get_unexpanded_descriptor_array_from_sec3(), bufr_sequence::iseq, bufr_sequence::key, bufr_sequence_index_range::last, bufr_sequence::level, bufr_sequence::lseq, bufr_sequence::name, bufr_sequence::ndesc, NMAXSEQ_DESCRIPTORS, bufr_sequence::no_data_present, bufrdeco_expanded_tree::nseq, bufr_sequence::replicated, bufrdeco_expanded_tree::seq, bufr_sequence::sons, bufrdeco::tree, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_parse_tree(), and bufrdeco_parse_tree_recursive().
char * bufrdeco_print_atom_data | ( | char * | target, |
size_t | lmax, | ||
struct bufr_atom_data * | a | ||
) |
print the data in a struct bufr_atom_data to a string
target | string where to print the result |
lmax | size of allocated string target |
a | pointer to struct ref bufr_atom_data with data to print |
Definition at line 433 of file bufrdeco_print.c.
References bufr_atom_data::bitmap_to, BUFR_EXPLAINED_LENGTH, BUFR_TABLEB_NAME_LENGTH, bufrdeco_assert, bufr_atom_data::ctable, bufr_atom_data::cval, bufr_atom_data::desc, DESCRIPTOR_HAVE_CODE_TABLE_STRING, DESCRIPTOR_HAVE_FLAG_TABLE_STRING, DESCRIPTOR_HAVE_STRING_VALUE, DESCRIPTOR_VALUE_MISSING, bufr_atom_data::escale, bufr_descriptor::f, get_formatted_value_from_escale(), bufr_atom_data::is_bitmaped_by, bufr_atom_data::mask, bufr_atom_data::name, bufr_atom_data::related_to, strcpy_safe, bufr_atom_data::unit, bufr_atom_data::val, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_fprint_subset_sequence_data(), and bufrdeco_print_atom_data_file().
int bufrdeco_print_atom_data_file | ( | FILE * | f, |
struct bufr_atom_data * | a | ||
) |
print the data in a struct bufr_atom_data to a file already open by caller
f | Pointer to file opened by caller |
a | pointer to struct ref bufr_atom_data with data to print |
Definition at line 403 of file bufrdeco_print.c.
References bufrdeco_assert, and bufrdeco_print_atom_data().
Referenced by bufrdeco_print_atom_data_stdout().
char * bufrdeco_print_atom_data_html | ( | char * | target, |
size_t | lmax, | ||
struct bufr_atom_data * | a, | ||
uint32_t | ss | ||
) |
print the data in a struct bufr_atom_data to a string as cells of table rows
target | string where to print the result |
lmax | dimension of target |
a | pointer to struct ref bufr_atom_data with data to print |
ss | index of subset in bufr |
Definition at line 160 of file bufrdeco_print_html.c.
References bufr_atom_data::bitmap_to, bufrdeco_assert, bufr_atom_data::ctable, bufr_atom_data::cval, bufr_atom_data::desc, DESCRIPTOR_HAVE_CODE_TABLE_STRING, DESCRIPTOR_HAVE_FLAG_TABLE_STRING, DESCRIPTOR_HAVE_STRING_VALUE, DESCRIPTOR_VALUE_MISSING, bufr_atom_data::escale, bufr_descriptor::f, get_formatted_value_from_escale(), bufr_atom_data::is_bitmaped_by, bufr_atom_data::mask, bufr_atom_data::name, bufr_atom_data::related_to, bufr_atom_data::unit, bufr_atom_data::val, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_fprint_subset_sequence_data_html(), and bufrdeco_fprint_subset_sequence_data_tagged_html().
int bufrdeco_print_atom_data_stdout | ( | struct bufr_atom_data * | a | ) |
print the data in a struct bufr_atom_data to stdout
a | pointer to struct ref bufr_atom_data with data to print |
Definition at line 419 of file bufrdeco_print.c.
References bufrdeco_print_atom_data_file().
buf_t bufrdeco_print_json_object_atom_data | ( | FILE * | out, |
struct bufr_atom_data * | a, | ||
char * | add | ||
) |
Print an json object with a descriptor data.
out | output stream opened by caller |
a | pointer to target struct bufr_atom_data |
add | adtional optional info |
There are four cases of objects, depending of data type { "descriptor":"f xx yyy", "name":"name_of_descriptor" , "unit":"name_of_unit", "value":"string_value"} { "descriptor":"f xx yyy", "name":"name_of_descriptor" , "unit":"Code table", "value":"numeric_value", "meaning":"explanation_string} { "descriptor":"f xx yyy", "name":"name_of_descriptor" , "unit":"Flag value", "value":"numeric_value", "meaning":"explanation_string} { "descriptor":"f xx yyy", "name":"name_of_descriptor" , "unit":"name_of_unit", "value":"numeric_value"}
Definition at line 134 of file bufrdeco_json.c.
References bufr_adjust_string(), bufrdeco_print_json_scape_string_cvals(), bufr_atom_data::ctable, bufr_atom_data::cval, bufr_atom_data::desc, DESCRIPTOR_HAVE_STRING_VALUE, DESCRIPTOR_IS_CODE_TABLE, DESCRIPTOR_IS_FLAG_TABLE, DESCRIPTOR_VALUE_MISSING, bufr_atom_data::escale, bufr_descriptor::f, get_formatted_value_from_escale2(), bufr_atom_data::mask, bufr_atom_data::name, bufr_atom_data::unit, bufr_atom_data::val, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufr_decode_subset_data_compressed(), bufrdeco_decode_replicated_subsequence(), bufrdeco_decode_subset_data_recursive(), and bufrdeco_parse_f2_descriptor().
buf_t bufrdeco_print_json_object_operator_descriptor | ( | FILE * | out, |
struct bufr_descriptor * | d, | ||
char * | add | ||
) |
print an operator desciptor as a json object
out | output stream opened by caller |
d | pointer to operator descriptor |
add | adtional optional info |
Definition at line 203 of file bufrdeco_json.c.
References bufrdeco_get_f2_descriptor_explanation(), bufr_descriptor::f, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufr_decode_subset_data_compressed(), bufrdeco_decode_replicated_subsequence(), and bufrdeco_decode_subset_data_recursive().
buf_t bufrdeco_print_json_object_replicator_descriptor | ( | FILE * | out, |
struct bufr_descriptor * | d, | ||
char * | add | ||
) |
print an operator desciptor as a json object
out | string where to print |
d | pointer to operator descriptor |
add | additional info |
Definition at line 230 of file bufrdeco_json.c.
References bufr_descriptor::f, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufr_decode_subset_data_compressed(), bufrdeco_decode_replicated_subsequence(), and bufrdeco_decode_subset_data_recursive().
buf_t bufrdeco_print_json_scape_string_cvals | ( | FILE * | out, |
char * | source | ||
) |
prints a descriptor string value scaping the '"' for a json format
out | output stream |
source | source string |
Definition at line 33 of file bufrdeco_json.c.
Referenced by bufrdeco_print_json_object_atom_data().
Definition at line 280 of file bufrdeco_json.c.
References bufr_sec0::bufr_length, bufrdeco_assert, bufr_sec0::edition, and bufrdeco::sec0.
Referenced by bufrdeco_read_buffer().
bufrdeco_print_json_sec1 | ( | FILE * | out, |
struct bufrdeco * | b | ||
) |
Print info form sec 1 in json format.
out | string where to print |
b | actuve struct bufrdeco |
Definition at line 300 of file bufrdeco_json.c.
References bufr_tables::b, bufrdeco_assert, bufr_tables::c, bufr_sec1::category, bufr_sec1::centre, bufr_tables::d, bufr_sec1::day, bufr_sec0::edition, bufr_sec1::hour, bufr_sec1::length, bufr_sec1::master, bufr_sec1::master_local, bufr_sec1::master_version, bufr_sec1::minute, bufr_sec1::month, bufr_sec1::options, bufr_tableB::path, bufr_tableC::path, bufr_tableD::path, bufrdeco::sec0, bufrdeco::sec1, bufr_sec1::second, bufr_sec1::subcategory, bufr_sec1::subcategory_local, bufr_sec1::subcentre, bufrdeco::tables, bufr_sec1::update, and bufr_sec1::year.
Referenced by bufrdeco_read_buffer().
Print info form optional sec 2 in json format.
out | string where to print |
b | actuve struct bufrdeco |
Definition at line 350 of file bufrdeco_json.c.
References bufrdeco_assert, bufr_sec2::length, bufr_sec1::options, bufrdeco::sec1, and bufrdeco::sec2.
Referenced by bufrdeco_read_buffer().
bufrdeco_print_json_sec3 | ( | FILE * | out, |
struct bufrdeco * | b | ||
) |
Print info form sec 3 in json format.
out | string where to print |
b | actuve struct bufrdeco |
Definition at line 372 of file bufrdeco_json.c.
References bufrdeco_assert, bufr_sec3::compressed, bufr_descriptor::f, bufr_sec3::length, bufr_sec3::ndesc, bufr_sec3::observed, bufrdeco::sec3, bufr_sec3::subsets, bufr_sec3::unexpanded, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_read_buffer().
buf_t bufrdeco_print_json_separator | ( | FILE * | out | ) |
Print the comma ',' separator in an output.
out | string where to print |
Definition at line 267 of file bufrdeco_json.c.
Referenced by bufr_decode_subset_data_compressed(), bufrdeco_decode_replicated_subsequence(), bufrdeco_decode_subset_data_recursive(), and bufrdeco_parse_f2_descriptor().
buf_t bufrdeco_print_json_sequence_descriptor_final | ( | FILE * | out | ) |
Definition at line 110 of file bufrdeco_json.c.
Referenced by bufr_decode_subset_data_compressed(), and bufrdeco_decode_subset_data_recursive().
buf_t bufrdeco_print_json_sequence_descriptor_header | ( | FILE * | out, |
struct bufr_sequence * | seq | ||
) |
Print the header of a sequence descriptor (f == 3)
out | output stream opened by caller |
seq | pointer to a bufr_sequence bufr_sequence |
Definition at line 94 of file bufrdeco_json.c.
References bufr_sequence::key, and bufr_sequence::name.
Referenced by bufr_decode_subset_data_compressed(), and bufrdeco_decode_subset_data_recursive().
buf_t bufrdeco_print_json_subset_data_epilogue | ( | FILE * | out | ) |
Definition at line 77 of file bufrdeco_json.c.
Referenced by bufr_decode_subset_data_compressed(), and bufrdeco_decode_subset_data_recursive().
Definition at line 58 of file bufrdeco_json.c.
References bufrdeco_assert, gts_header::filename, bufrdeco::header, bufrdeco::seq, and bufrdeco_subset_sequence_data::ss.
Referenced by bufr_decode_subset_data_compressed(), and bufrdeco_decode_subset_data_recursive().
Definition at line 508 of file bufrdeco_json.c.
References bufrdeco_assert, BUFRDECO_OUTPUT_JSON_EXPANDED_TREE, bufrdeco_print_json_tree_recursive(), bufrdeco::mask, and bufrdeco::out.
Referenced by main().
int bufrdeco_print_json_tree_recursive | ( | FILE * | out, |
struct bufrdeco * | b, | ||
struct bufr_sequence * | seq | ||
) |
Print a tree of descriptors to a file in a recursive way in json format.
out | stream opened by caller |
b | pointer to the basic container struct bufrdeco |
seq | pointer to the struct bufr_sequence to print |
Definition at line 405 of file bufrdeco_json.c.
References bufr_tables::b, bufr_adjust_string(), bufr_find_tableB_index(), bufrdeco_assert, bufrdeco_get_f2_descriptor_explanation(), bufrdeco_print_json_tree_recursive(), bufr_descriptor::c, bufr_descriptor::f, is_a_delayed_descriptor(), is_a_short_delayed_descriptor(), bufr_tableB::item, bufr_sequence::lseq, bufr_sequence::name, bufr_tableB_decoded_item::name, bufr_sequence::ndesc, bufr_sequence::replicated, bufrdeco_expanded_tree::seq, bufr_sequence::sons, bufrdeco::tables, bufrdeco::tree, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_print_json_tree(), and bufrdeco_print_json_tree_recursive().
int bufrdeco_print_subset_sequence_data | ( | struct bufrdeco_subset_sequence_data * | s | ) |
Prints a struct bufrdeco_subset_sequence_data.
s | pointer to the struct to print |
Definition at line 545 of file bufrdeco_print.c.
References bufrdeco_assert, and bufrdeco_fprint_subset_sequence_data().
Referenced by main().
int bufrdeco_print_subset_sequence_data_html | ( | struct bufrdeco_subset_sequence_data * | s | ) |
Definition at line 265 of file bufrdeco_print_html.c.
References bufrdeco_assert, and bufrdeco_fprint_subset_sequence_data_html().
int bufrdeco_print_subset_sequence_data_tagged_html | ( | struct bufrdeco_subset_sequence_data * | s, |
char * | id | ||
) |
Definition at line 306 of file bufrdeco_print_html.c.
References bufrdeco_assert, and bufrdeco_fprint_subset_sequence_data_tagged_html().
Referenced by main().
int bufrdeco_print_tree | ( | struct bufrdeco * | b | ) |
Print a tree of descriptors.
b | pointer to a basic container struct bufrdeco |
b | pointer to a basic container struct bufrdeco |
Definition at line 381 of file bufrdeco_print.c.
References bufrdeco_assert, bufrdeco_fprint_tree_recursive(), BUFRDECO_OUTPUT_HTML, and bufrdeco::mask.
Referenced by main().
Definition at line 225 of file bufrdeco_read.c.
References bufr_sec4::bit_offset, BUFR_LEN, BUFR_LEN_UNEXPANDED_DESCRIPTOR, bufr_sec0::bufr_length, bufr_read_tables(), bufrdeco_assert, BUFRDECO_OUTPUT_JSON_SEC0, BUFRDECO_OUTPUT_JSON_SEC1, BUFRDECO_OUTPUT_JSON_SEC2, BUFRDECO_OUTPUT_JSON_SEC3, bufrdeco_print_json_sec0(), bufrdeco_print_json_sec1(), bufrdeco_print_json_sec2(), bufrdeco_print_json_sec3(), bufr_sec1::category, bufr_sec1::centre, bufr_sec3::compressed, bufr_sec1::day, bufr_sec0::edition, bufrdeco::error, bufr_descriptor::f, bufr_sec1::hour, bufr_sec1::length, bufr_sec2::length, bufr_sec3::length, bufr_sec4::length, bufrdeco::mask, bufr_sec1::master, bufr_sec1::master_local, bufr_sec1::master_version, bufr_sec1::minute, bufr_sec1::month, bufr_sec3::ndesc, bufr_sec3::observed, bufr_sec1::options, bufrdeco::out, bufr_sec0::raw, bufr_sec4::raw, bufr_sec1::raw, bufr_sec2::raw, bufr_sec3::raw, bufrdeco::sec0, bufrdeco::sec1, bufrdeco::sec2, bufrdeco::sec3, bufrdeco::sec4, bufr_sec1::second, bufr_sec1::subcategory, bufr_sec1::subcategory_local, bufr_sec1::subcentre, bufr_sec3::subsets, three_bytes_to_uint32(), two_bytes_to_descriptor(), two_bytes_to_uint32(), bufr_sec3::unexpanded, bufr_sec1::update, bufr_descriptor::x, bufr_descriptor::y, and bufr_sec1::year.
Referenced by bufrdeco_extract_bufr(), and bufrdeco_read_bufr().
int bufrdeco_read_bufr | ( | struct bufrdeco * | b, |
char * | filename | ||
) |
Read bufr file and does preliminary and first decode pass.
b | pointer to struct bufrdeco |
filename | complete path of BUFR file |
This function does the folowing tasks:
< pointer to a memory buffer where we write raw bufr file
Definition at line 41 of file bufrdeco_read.c.
References BUFR_LEN, bufrdeco_assert, bufrdeco_read_buffer(), and bufrdeco::error.
Referenced by main().
int bufrdeco_read_subset_offset_bits | ( | struct bufrdeco * | b, |
char * | filename | ||
) |
Write offset bit array for subsets in a non-compressed bufr.
filename | complete path of input file to open |
b | pointer to the struct bufrdeco |
Definition at line 358 of file bufrdeco.c.
References bufr_read_subset_offset_bits(), bufrdeco_assert_with_return_val, and bufrdeco::offsets.
Referenced by main().
int bufrdeco_reset | ( | struct bufrdeco * | b | ) |
Reset an struct bufrdeco. This is needed when changing to another bufr.
b | pointer to the target struct to be resed with another bufrfile |
This function must be called when parsing another BUFR report without calling bufrdeco_close and bufrdeco_init. It
Definition at line 180 of file bufrdeco.c.
References bufrdeco::bitmap, bufrdeco_assert, bufrdeco_free_bitmap_array(), bufrdeco_free_compressed_data_references(), bufrdeco_free_expanded_tree(), bufrdeco_free_subset_sequence_data(), bufrdeco_init_expanded_tree(), bufrdeco::cache, bufrdeco::err, bufrdeco::error, bufrdeco::mask, bufrdeco::out, bufrdeco::refs, bufrdeco::seq, bufrdeco::tables, and bufrdeco::tree.
Referenced by main().
int bufrdeco_set_err_stream | ( | FILE * | err, |
struct bufrdeco * | b | ||
) |
Set the error stream.
err | stream opened by caller |
b | pointer to current active struct bufrdeco |
Without calling to this funcion, the default is stderr
Definition at line 242 of file bufrdeco.c.
References bufrdeco::out.
int bufrdeco_set_out_stream | ( | FILE * | out, |
struct bufrdeco * | b | ||
) |
Set the library normal output stream.
out | stream opened by caller |
b | pointer to current active struct bufrdeco |
Without calling to this funcion, the default is stdout
Definition at line 227 of file bufrdeco.c.
References bufrdeco::out.
int bufrdeco_set_tables_dir | ( | struct bufrdeco * | b, |
char * | tables_dir | ||
) |
Sets the directory path for BUFR tables. Needed if it is not any default directories.
b | pointer to the target struct |
tables_dir | Source path of tables directory |
The default directories are '/usr/share/bufr2synop' and '/usr/local/share/bufr2synop'
Definition at line 291 of file bufrdeco.c.
References bufrdeco_assert_with_return_val, BUFRDECO_PATH_LENGTH, bufrdeco::bufrtables_dir, and strncpy_safe.
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 to this element.
t | pointer to array of struct bufr_tables |
c | pointer ti struct bufr_tables_cache |
ver | version of tables acting as key |
Definition at line 269 of file bufrdeco_wmo.c.
References bufrdeco_init_tables(), BUFRDECO_TABLES_CACHE_SIZE, bufr_tables_cache::next, bufr_tables_cache::nt, bufr_tables_cache::tab, and bufr_tables_cache::ver.
Referenced by bufr_read_tables().
int bufrdeco_substitute_tables | ( | struct bufr_tables ** | replaced, |
struct bufr_tables * | source, | ||
struct bufrdeco * | b | ||
) |
substitute an struct bufr_tables into a struct bufrdeco
replaced | Pointer where to set the replaced pointer |
source | Pointer to a struct bufr_tables |
b | pointer to the container basic struct bufrdeco |
Remember that the struct bufr_tables used in bufrdeco library is the one which pointer is in struct bufrdeco . To avoid problems the struct must be initialized before substituted in this fucntion. Both source and replaced structs are not modified.
This is useful if we do not want to read and parse tables again if the caller has a pool of already readed tables.
Definition at line 116 of file bufrdeco_memory.c.
References bufrdeco_assert, bufrdeco_init_tables(), and bufrdeco::tables.
int bufrdeco_tableB_compressed | ( | struct bufrdeco_compressed_ref * | r, |
struct bufrdeco * | b, | ||
struct bufr_descriptor * | d, | ||
int | mode | ||
) |
get data from table B when parsing compressed data references
r | pointer to a struct bufrdeco_compressed_ref where to set results |
b | basic container struct bufrdeco |
d | pointer to the reference struct bufr_descriptor |
mode | If 0 then we are getting the data itself for a descriptor. If mode = 1 then we are dealing with associated bits |
Definition at line 250 of file bufrdeco_tableB.c.
References bufrdeco_decoding_data_state::added_bit_length, bufrdeco_decoding_data_state::added_scale, bufrdeco_decoding_data_state::assoc_bits, bufr_tables::b, bufrdeco_compressed_ref::bit0, bufrdeco_decoding_data_state::bit_offset, bufrdeco_compressed_ref::bits, bufrdeco_assert, bufr_descriptor::c, bufrdeco_decoding_data_state::changing_reference, bufrdeco_compressed_ref::cref0, bufrdeco_compressed_ref::desc, bufrdeco::error, bufrdeco_compressed_ref::escale, bufrdeco_decoding_data_state::fixed_ccitt, get_bits_as_char_array(), get_bits_as_uint32_t(), get_table_b_reference_from_uint32_t(), bufrdeco_compressed_ref::has_data, bufrdeco_compressed_ref::inc_bits, is_a_delayed_descriptor(), is_a_local_descriptor(), is_a_short_delayed_descriptor(), bufrdeco_compressed_ref::is_associated, bufr_tableB::item, bufrdeco_decoding_data_state::local_bit_reserved, bufrdeco_compressed_ref::name, bufr_tableB_decoded_item::name, bufr_tableB_decoded_item::nbits, bufr_sec4::raw, bufrdeco_compressed_ref::ref, bufrdeco_compressed_ref::ref0, bufr_tableB_decoded_item::reference, bufr_tableB_decoded_item::reference_ori, bufr_tableB_decoded_item::scale, bufrdeco::sec3, bufrdeco::sec4, bufrdeco::state, strcpy_safe, bufr_sec3::subsets, bufrdeco::tables, bufrdeco_compressed_ref::unit, bufr_tableB_decoded_item::unit, bufr_descriptor::x, bufr_tableB::x_start, bufr_descriptor::y, and bufr_tableB::y_ref.
Referenced by bufrdeco_decode_replicated_subsequence_compressed(), and bufrdeco_parse_compressed_recursive().
int bufrdeco_tableB_val | ( | struct bufr_atom_data * | a, |
struct bufrdeco * | b, | ||
struct bufr_descriptor * | d | ||
) |
Get data from a table B descriptor.
a | pointer to a struct bufr_atom_data where to set the results |
b | pointer to the basic struct bufrdeco |
d | pointer to the target descriptor |
Definition at line 451 of file bufrdeco_tableB.c.
References bufrdeco_decoding_data_state::added_bit_length, bufrdeco_decoding_data_state::added_reference, bufrdeco_decoding_data_state::added_scale, bufrdeco_decoding_data_state::assoc_bits, bufr_atom_data::associated, bufr_tables::b, bufrdeco_decoding_data_state::bit_offset, bufrdeco_explained_flag_val(), bufrdeco_explained_table_val(), bufr_descriptor::c, bufr_tables::c, bufrdeco_decoding_data_state::changing_reference, bufr_atom_data::ctable, bufr_atom_data::cval, bufr_atom_data::desc, DESCRIPTOR_HAVE_CODE_TABLE_STRING, DESCRIPTOR_HAVE_FLAG_TABLE_STRING, DESCRIPTOR_HAVE_STRING_VALUE, DESCRIPTOR_IS_CODE_TABLE, DESCRIPTOR_IS_FLAG_TABLE, DESCRIPTOR_IS_LOCAL, DESCRIPTOR_VALUE_MISSING, bufrdeco_decoding_data_state::dstat_active, bufrdeco::error, bufr_atom_data::escale, bufrdeco_decoding_data_state::factor_reference, bufrdeco_decoding_data_state::fixed_ccitt, get_bits_as_char_array(), get_bits_as_uint32_t(), get_table_b_reference_from_uint32_t(), is_a_local_descriptor(), bufr_tableB::item, bufrdeco_decoding_data_state::local_bit_reserved, bufr_atom_data::mask, MISSING_INTEGER, MISSING_REAL, bufr_atom_data::name, bufr_tableB_decoded_item::name, bufr_tableB_decoded_item::nbits, pow10neg, pow10pos, bufr_sec4::raw, bufr_tableB_decoded_item::reference, bufr_tableB_decoded_item::scale, bufrdeco::sec4, bufrdeco::state, strcpy_safe, bufr_tableB_decoded_item::tableC_ref, bufrdeco::tables, bufr_atom_data::unit, bufr_tableB_decoded_item::unit, bufr_atom_data::val, bufr_descriptor::x, bufr_tableB::x_start, bufr_descriptor::y, and bufr_tableB::y_ref.
Referenced by bufrdeco_decode_replicated_subsequence(), and bufrdeco_decode_subset_data_recursive().
int bufrdeco_tableD_get_descriptors_array | ( | struct bufr_sequence * | s, |
struct bufrdeco * | b, | ||
const char * | key | ||
) |
get the descriptors array for a descriptor sequence defined in table D with F = 3
s | target struct bufr_sequence |
b | pointer to the basic container struct bufrdeco |
key | string in the form FXXYYY which is the key of descriptor we want to find out, F = 3 |
Definition at line 211 of file bufrdeco_tableD.c.
References bufr_find_tableD_index(), bufrdeco_assert, bufr_tables::d, bufr_tableD_decoded_item::description, bufrdeco::error, bufr_tableD::item, bufr_tableD::l, bufr_sequence::lseq, bufr_sequence::name, bufr_sequence::ndesc, bufr_tableD::nlines, bufrdeco::tables, and uint32_t_to_descriptor().
Referenced by bufrdeco_parse_tree_recursive().
int bufrdeco_write_subset_offset_bits | ( | struct bufrdeco * | b, |
char * | filename | ||
) |
Write offset bit array for subsets in a non-compressed bufr.
filename | complete path of output file to open |
b | pointer to the struct bufrdeco |
Definition at line 330 of file bufrdeco.c.
References bufr_write_subset_offset_bits(), bufrdeco_assert_with_return_val, and bufrdeco::offsets.
Referenced by main().
char * csv_quoted_string | ( | char * | out, |
char * | in | ||
) |
Transform a string to a quoted string to be inserted in a csv file.
out | resulting string |
in | input string |
Definition at line 48 of file bufrdeco_csv.c.
References CSV_MAXL.
Referenced by main().
int fprint_bufrdeco_compressed_data_references | ( | FILE * | f, |
struct bufrdeco_compressed_data_references * | r | ||
) |
Definition at line 619 of file bufrdeco_print.c.
References bufrdeco_assert, fprint_bufrdeco_compressed_ref(), bufrdeco_compressed_data_references::nd, and bufrdeco_compressed_data_references::refs.
int fprint_bufrdeco_compressed_ref | ( | FILE * | f, |
struct bufrdeco_compressed_ref * | r | ||
) |
prints a struct bufrdeco_compressed_ref
f | pointer to a file opened by caller |
r | pointer to the struct to print |
Definition at line 558 of file bufrdeco_print.c.
References bufrdeco_compressed_ref::bit0, bufrdeco_compressed_ref::bits, bufrdeco_assert, BUFRDECO_COMPRESSED_REF_DATA_DESCRIPTOR_BITMASK, bufr_descriptor::c, bufrdeco_compressed_ref::cref0, bufrdeco_compressed_ref::desc, bufrdeco_compressed_ref::escale, bufrdeco_compressed_ref::has_data, bufrdeco_compressed_ref::inc_bits, bufrdeco_compressed_ref::is_associated, bufrdeco_compressed_ref::mask, bufrdeco_compressed_ref::name, bufrdeco_compressed_ref::ref, bufrdeco_compressed_ref::ref0, and bufrdeco_compressed_ref::unit.
Referenced by fprint_bufrdeco_compressed_data_references(), and print_bufrdeco_compressed_ref().
uint32_t get_bits_as_char_array | ( | char * | target, |
uint8_t * | has_data, | ||
uint8_t * | source, | ||
buf_t * | bit0_offset, | ||
buf_t | bit_length | ||
) |
Definition at line 86 of file bufrdeco_utils.c.
Referenced by bufrdeco_get_atom_data_from_compressed_data_ref(), bufrdeco_parse_f2_compressed(), bufrdeco_parse_f2_descriptor(), bufrdeco_tableB_compressed(), and bufrdeco_tableB_val().
uint32_t get_bits_as_uint32_t | ( | uint32_t * | target, |
uint8_t * | has_data, | ||
uint8_t * | source, | ||
buf_t * | bit0_offset, | ||
buf_t | bit_length | ||
) |
Definition at line 182 of file bufrdeco_utils.c.
References biti, and get_bits_as_uint32_t2().
Referenced by bufrdeco_get_atom_data_from_compressed_data_ref(), bufrdeco_parse_f2_compressed(), bufrdeco_tableB_compressed(), and bufrdeco_tableB_val().
char * get_formatted_value_from_escale | ( | char * | fmt, |
size_t | dim, | ||
int32_t | escale, | ||
double | val | ||
) |
gets a string with formatted value depending of scale
fmt | The output target string |
dim | Size of available space (bytes) to write the result |
escale | value scale in descriptor |
val | double to printf |
Definition at line 410 of file bufrdeco_utils.c.
Referenced by bufrdeco_print_atom_data(), and bufrdeco_print_atom_data_html().
char * get_formatted_value_from_escale2 | ( | char * | fmt, |
size_t | dim, | ||
int32_t | escale, | ||
double | val | ||
) |
gets a string with formatted value depending of scale
fmt | The output target string |
dim | Size of available space (bytes) to write the result |
escale | value scale in descriptor |
val | double to printf |
Differs from get_formatted_value_from_escale that no blanks are written
Definition at line 436 of file bufrdeco_utils.c.
Referenced by bufrdeco_print_json_object_atom_data().
int get_table_b_reference_from_uint32_t | ( | int32_t * | target, |
uint8_t | bits, | ||
uint32_t | source | ||
) |
Get an int32_t from bits according with bufr criteria to change the reference of a descritor. Most significant bit in source is sign.
target | int32_t as result |
bits | number of bits to consider |
source | uint32_T with the data to transform |
Definition at line 221 of file bufrdeco_utils.c.
Referenced by bufrdeco_tableB_compressed(), and bufrdeco_tableB_val().
int get_wmo_tablenames | ( | struct bufrdeco * | b | ) |
Get the complete pathnames for WMO csv table files needed by a bufr message.
b | pointer for a struct bufrdeco |
For WMO files this format is adopted BUFR_XX_Y_Z_TableB_en for table B BUFR_XX_Y_Z_CodeFlag for Code table and Flag table. This is equivalent to table C in ECMWF package BUFR_XX_Y_Z_TableD_en for table D
XX is the Version number of master table used Y is the revision (currently ignored) Z is minor revision (currently ignored)
Definition at line 47 of file bufrdeco_wmo.c.
References bufr_tables::b, bufrdeco_assert, BUFRDECO_PATH_LENGTH, bufrdeco::bufrtables_dir, bufr_tables::c, bufr_tables::d, DEFAULT_BUFRTABLES_WMO_CSV_DIR1, DEFAULT_BUFRTABLES_WMO_CSV_DIR2, bufr_sec1::master_version, bufr_tableB::path, bufr_tableC::path, bufr_tableD::path, bufrdeco::sec1, and bufrdeco::tables.
Referenced by bufr_read_tables().
int is_a_delayed_descriptor | ( | struct bufr_descriptor * | d | ) |
check if a descriptor is a delayed descriptor
d | pointer to a struct bufr_descriptor to check |
Definition at line 351 of file bufrdeco_utils.c.
References bufr_descriptor::f, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_fprint_tree_recursive(), bufrdeco_print_json_tree_recursive(), and bufrdeco_tableB_compressed().
int is_a_local_descriptor | ( | struct bufr_descriptor * | d | ) |
check if a descriptor is a local descriptor
d | pointer to a struct bufr_descriptor to check |
Definition at line 388 of file bufrdeco_utils.c.
References bufr_descriptor::f, and bufr_descriptor::x.
Referenced by bufrdeco_get_atom_data_from_compressed_data_ref(), bufrdeco_tableB_compressed(), and bufrdeco_tableB_val().
int is_a_short_delayed_descriptor | ( | struct bufr_descriptor * | d | ) |
check if a descriptor is a short delayed descriptor
d | pointer to a struct bufr_descriptor to check |
Definition at line 369 of file bufrdeco_utils.c.
References bufr_descriptor::f, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_fprint_tree_recursive(), bufrdeco_print_json_tree_recursive(), and bufrdeco_tableB_compressed().
int parse_csv_line | ( | int * | nt, |
char * | tk[], | ||
char * | lin | ||
) |
Parse a csv line.
nt | pointer to a integer. On success is the number of items found |
tk | array of pointers. Every pointer is a item on success |
lin | input line which is modified in this routine to be splitted into items |
This is an optimization of routine parse_csv_line2(). Here we suppose: -All no void items are closed between "" and separed by comas ',' -No " in items. -No blank spaces at the end nor begin of items
NOTE that input line is modified
Definition at line 258 of file bufrdeco_csv.c.
References CSV_CITE, CSV_FINAL, CSV_MAXL, and CSV_SEPARATOR.
Referenced by bufr_read_tableB(), bufr_read_tableC(), bufr_read_tableD(), and main().
int print_bufrdeco_compressed_data_references | ( | struct bufrdeco_compressed_data_references * | r | ) |
prints a struct bufrdeco_compressed_references
r | pointer to the struct to print |
It is used mainly in debug stage
Definition at line 600 of file bufrdeco_print.c.
References bufrdeco_assert, bufrdeco_compressed_data_references::nd, print_bufrdeco_compressed_ref(), and bufrdeco_compressed_data_references::refs.
Referenced by main().
int print_bufrdeco_compressed_ref | ( | struct bufrdeco_compressed_ref * | r | ) |
prints a struct bufrdeco_compressed_ref
r | pointer to the struct to print |
Definition at line 585 of file bufrdeco_print.c.
References bufrdeco_assert, and fprint_bufrdeco_compressed_ref().
Referenced by print_bufrdeco_compressed_data_references().
int print_sec0_info | ( | struct bufrdeco * | b | ) |
Prints info from sec0.
b | pointer to the source struct bufrdeco |
Definition at line 62 of file bufrdeco_print.c.
References bufrdeco_assert, and sprint_sec0_info().
Referenced by main().
int print_sec1_info | ( | struct bufrdeco * | b | ) |
Prints info from sec1.
b | pointer to the source struct bufrdeco |
Definition at line 135 of file bufrdeco_print.c.
References bufrdeco_assert, and sprint_sec1_info().
Referenced by main().
int print_sec3_info | ( | struct bufrdeco * | b | ) |
Prints info from sec3.
b | pointer to the source struct bufrdeco |
Definition at line 192 of file bufrdeco_print.c.
References bufrdeco_assert, and sprint_sec3_info().
Referenced by main().
int print_sec4_info | ( | struct bufrdeco * | b | ) |
Prints info from sec3.
b | pointer to the source struct bufrdeco |
Definition at line 239 of file bufrdeco_print.c.
References bufrdeco_assert, and sprint_sec4_info().
Referenced by main().
int sprint_sec0_info | ( | char * | target, |
size_t | lmax, | ||
struct bufrdeco * | b | ||
) |
Prints info from sec0.
target | string target |
lmax | available size in target |
b | pointer to the source struct bufrdeco |
Definition at line 35 of file bufrdeco_print.c.
References bufr_sec0::bufr_length, bufrdeco_assert, BUFRDECO_OUTPUT_HTML, bufr_sec0::edition, bufrdeco::error, bufrdeco::mask, bufrdeco::sec0, and sprint_sec0_info_html().
Referenced by print_sec0_info().
void sprint_sec0_info_html | ( | char * | target, |
size_t | lmax, | ||
struct bufrdeco * | b | ||
) |
Prints info from sec0 in html format.
target | string target |
lmax | available size in target |
b | pointer to the source struct bufrdeco |
Definition at line 34 of file bufrdeco_print_html.c.
References bufr_sec0::bufr_length, bufrdeco_assert, bufr_sec0::edition, and bufrdeco::sec0.
Referenced by sprint_sec0_info().
int_bits sprint_sec1_info | ( | char * | target, |
size_t | lmax, | ||
struct bufrdeco * | b | ||
) |
Prints info from sec1.
target | string target |
lmax | available size in target |
b | pointer to the source struct bufrdeco |
Definition at line 83 of file bufrdeco_print.c.
References bufr_tables::b, bufrdeco_assert, BUFRDECO_OUTPUT_HTML, bufr_tables::c, bufr_sec1::category, bufr_sec1::centre, bufr_tables::d, bufr_sec1::day, bufr_sec0::edition, bufrdeco::error, bufr_sec1::hour, bufr_sec1::length, bufrdeco::mask, bufr_sec1::master, bufr_sec1::master_local, bufr_sec1::master_version, bufr_sec1::minute, bufr_sec1::month, bufr_sec1::options, bufr_tableB::path, bufr_tableC::path, bufr_tableD::path, bufrdeco::sec0, bufrdeco::sec1, bufr_sec1::second, sprint_sec1_info_html(), bufr_sec1::subcategory, bufr_sec1::subcategory_local, bufr_sec1::subcentre, bufrdeco::tables, bufr_sec1::update, and bufr_sec1::year.
Referenced by print_sec1_info().
int sprint_sec1_info_html | ( | char * | target, |
size_t | lmax, | ||
struct bufrdeco * | b | ||
) |
Prints info from sec1.
target | string target |
lmax | available size in target |
b | pointer to the source struct bufrdeco |
Definition at line 55 of file bufrdeco_print_html.c.
References bufr_tables::b, bufrdeco_assert, bufr_tables::c, bufr_sec1::category, bufr_sec1::centre, bufr_tables::d, bufr_sec1::day, bufr_sec0::edition, bufr_sec1::hour, bufr_sec1::length, bufr_sec1::master, bufr_sec1::master_local, bufr_sec1::master_version, bufr_sec1::minute, bufr_sec1::month, bufr_sec1::options, bufr_tableB::path, bufr_tableC::path, bufr_tableD::path, bufrdeco::sec0, bufrdeco::sec1, bufr_sec1::second, bufr_sec1::subcategory, bufr_sec1::subcategory_local, bufr_sec1::subcentre, bufrdeco::tables, bufr_sec1::update, and bufr_sec1::year.
Referenced by sprint_sec1_info().
int sprint_sec3_info | ( | char * | target, |
size_t | lmax, | ||
struct bufrdeco * | b | ||
) |
Prints info from sec3.
target | string target |
lmax | available size in target |
b | pointer to the source struct bufrdeco |
Definition at line 155 of file bufrdeco_print.c.
References bufrdeco_assert, BUFRDECO_OUTPUT_HTML, bufr_sec3::compressed, bufrdeco::error, bufr_descriptor::f, bufr_sec3::length, bufrdeco::mask, bufr_sec3::ndesc, bufr_sec3::observed, bufrdeco::sec3, sprint_sec3_info_html(), bufr_sec3::subsets, bufr_sec3::unexpanded, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by print_sec3_info().
int sprint_sec3_info_html | ( | char * | target, |
size_t | lmax, | ||
struct bufrdeco * | b | ||
) |
Prints info from sec3 formatted as html.
target | string target |
lmax | available size in target |
b | pointer to the source struct bufrdeco |
Definition at line 104 of file bufrdeco_print_html.c.
References bufrdeco_assert, bufr_sec3::compressed, bufr_descriptor::f, bufr_sec3::length, bufr_sec3::ndesc, bufr_sec3::observed, bufrdeco::sec3, bufr_sec3::subsets, bufr_sec3::unexpanded, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by sprint_sec3_info().
int sprint_sec4_info | ( | char * | target, |
size_t | lmax, | ||
struct bufrdeco * | b | ||
) |
Prints info from sec4.
target | string target |
lmax | available size in target |
b | pointer to the source struct bufrdeco |
Definition at line 213 of file bufrdeco_print.c.
References bufrdeco_assert, BUFRDECO_OUTPUT_HTML, bufrdeco::error, bufr_sec4::length, bufrdeco::mask, bufrdeco::sec4, and sprint_sec4_info_html().
Referenced by print_sec4_info().
int sprint_sec4_info_html | ( | char * | target, |
size_t | lmax, | ||
struct bufrdeco * | b | ||
) |
Prints info from sec4.
target | string target |
lmax | available size in target |
b | pointer to the source struct bufrdeco |
Definition at line 136 of file bufrdeco_print_html.c.
References bufrdeco_assert, bufr_sec4::length, and bufrdeco::sec4.
Referenced by sprint_sec4_info().
uint32_t three_bytes_to_uint32 | ( | const uint8_t * | source | ) |
returns the uint32_t value from an array of three bytes, most significant first
source | pointer to source uint8_t |
Definition at line 265 of file bufrdeco_utils.c.
Referenced by bufrdeco_read_buffer().
int two_bytes_to_descriptor | ( | struct bufr_descriptor * | d, |
const uint8_t * | source | ||
) |
set a struct bufr_descriptor from two consecutive bytes in bufr file
source | pointer to first byte (most significant) |
d | pointer to the resulting descriptor |
Definition at line 297 of file bufrdeco_utils.c.
References bufr_descriptor::c, bufr_descriptor::f, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_read_buffer().
uint32_t two_bytes_to_uint32 | ( | const uint8_t * | source | ) |
returns the uint32_t value from an array of two bytes, most significant first
source | pointer to source uint8_t |
Definition at line 250 of file bufrdeco_utils.c.
Referenced by bufrdeco_read_buffer().
int uint32_t_to_descriptor | ( | struct bufr_descriptor * | d, |
uint32_t | id | ||
) |
parse an integer with a descriptor fom bufr ECWMF libary
d | pointer to a struct bufr_descriptor where to set the result on output |
id | integer with the descriptor from ewcwf |
Definition at line 278 of file bufrdeco_utils.c.
References bufr_descriptor::c, bufr_descriptor::f, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufr_find_tableB_index(), bufr_find_tableC_csv_index(), bufr_read_tableB(), bufr_read_tableC(), bufr_read_tableD(), bufrdeco_tableD_get_descriptors_array(), and main().
|
extern |
|
extern |
|
extern |
And these are the default directories when using WMO csv table files
Definition at line 29 of file bufrdeco_wmo.c.
Referenced by get_wmo_tablenames().
|
extern |
Definition at line 30 of file bufrdeco_wmo.c.
Referenced by get_wmo_tablenames().
|
extern |
Definition at line 32 of file bufrdeco_tableB.c.
Referenced by bufrdeco_tableB_val().
|
extern |
Definition at line 31 of file bufrdeco_tableB.c.
Referenced by bufrdeco_tableB_val().
|
extern |
Definition at line 30 of file bufrdeco_tableB.c.
Referenced by bufrdeco_parse_f2_compressed(), and bufrdeco_parse_f2_descriptor().