48 if ( d == NULL || s == NULL )
50 snprintf ( b->
error, sizeof ( b->
error ),
"%s(): Unspected NULL argument(s)\n", __func__ );
115 snprintf ( b->
error, sizeof ( b->
error ),
"%s(): Cannot get %u uchars from '%s'\n", __func__, d->
y, d->
c );
128 strcpy ( a->
name,
"SIGNIFY CHARACTER" );
129 strcpy ( a->
unit,
"CCITTIA5" );
136 if ( s->
nd < ( s->
dim - 1 ) )
146 snprintf ( b->
error, sizeof ( b->
error ),
"%s(): No more bufr_atom_data available. Check BUFR_NMAXSEQ\n", __func__ );
173 snprintf ( b->
error, sizeof ( b->
error ),
"%s(): Too much %u increase bits for operator '%s'", __func__, d->
y,
325 else if ( d->
y == 255 )
390 snprintf ( b->
error, sizeof ( b->
error ),
"%s(): Still no proccessed descriptor '%s' in "
391 "current library version %s\n", __func__, d->
c,
VERSION );
416 if ( d == NULL || r == NULL )
418 snprintf ( b->
error, sizeof ( b->
error ),
"%s(): Unspected NULL argument(s)\n", __func__ );
479 rf = & ( r->
refs[r->
nd] );
484 snprintf ( b->
error, sizeof ( b->
error ),
"%s(): Cannot get %u uchars from '%s'\n", __func__, d->
y, d->
c );
489 strcpy ( rf->
name,
"SIGNIFY CHARACTER" );
490 strcpy ( rf->
unit,
"CCITTIA5" );
496 snprintf ( b->
error, sizeof ( b->
error ),
"%s(): Cannot get 6 bits for inc_bits from '%s'\n", __func__, d->
c );
501 snprintf ( b->
error, sizeof ( b->
error ),
"%s(): Bad length in inc_bits for a 2 05 YYY descriptor from '%s'\n", __func__, d->
c );
512 snprintf ( b->
error, sizeof ( b->
error ),
"%s(): Reached limit. Consider increas BUFR_NMAXSEQ\n", __func__ );
539 snprintf ( b->
error, sizeof ( b->
error ),
"%s(): Too much %u increase bits for operator '%s'", __func__, d->
y,
692 else if ( d->
y == 255 )
758 snprintf ( b->
error, sizeof ( b->
error ),
"%s(): Still no proccessed descriptor '%s' in "
759 "current library version %s \n", __func__, d->
c,
VERSION );
782 snprintf ( e, dim,
"Change data width %d bits.", d->
y - 128 );
784 snprintf ( e, dim,
"Change data width 0 bits.");
789 snprintf ( e, dim,
"Change scale %d units.", d->
y - 128 );
791 snprintf ( e, dim,
"Change scale 0 units.");
796 snprintf ( e, dim,
"Change reference values. Each new reference value has %d bits width.", d->
y );
798 snprintf ( e, dim,
"Change reference values concluded." );
802 snprintf ( e, dim,
"Add associated field. Precede each data element with %d bits of information.", d->
y );
806 snprintf ( e, dim,
"Signify character. %d characters CCITT IA5 are inserted as a data field of %d x 8 bits in length.", d->
y, d->
y );
810 snprintf ( e, dim,
"Signify data width. %d bits of data are described by immediately following descsriptor", d->
y );
814 snprintf ( e, dim,
"Increase scale, reference value and data width." );
818 snprintf ( e, dim,
"Change width of CCITT IA5 field to %d characters instead of the indicated in table B", d->
y );
822 snprintf ( e, dim,
"**** Next %d descriptor(s) on this sequence level do not have data present ****", d->
y );
826 snprintf ( e, dim,
"Quality information follows. The values of Class 33 elements which follow relate to the data defined by the data present bit-map." );
831 snprintf ( e, dim,
"Substituted values operator. The substituted values which follow relate to the data defined by the data present bit-map." );
832 else if ( d->
y == 255 )
833 snprintf ( e, dim,
"Substituted values marker operator. This operator shall signify a data item containing a substituted value." );
838 snprintf ( e, dim,
"First-order statistical values follow." );
839 else if ( d->
y == 255 )
840 snprintf ( e, dim,
"First-order statistical values marker operator" );
845 snprintf ( e, dim,
"Replaced/retained values follow." );
846 else if ( d->
y == 255 )
847 snprintf ( e, dim,
"Replaced/retained value marker operator" );
852 snprintf ( e, dim,
"Difference statistical values follow." );
853 else if ( d->
y == 255 )
854 snprintf ( e, dim,
"Difference statistical values marker operator" );
858 snprintf ( e, dim,
"Cancel backward data reference" );
862 snprintf ( e, dim,
"Define data present bit-map" );
866 snprintf ( e, dim,
" Use defined data present bit-map" );
871 snprintf ( e, dim,
"@@@@ Event definition begins in next descriptor of this sequence level @@@@" );
873 snprintf ( e, dim,
"@@@@ Event definition ends here @@@@" );
878 snprintf ( e, dim,
"!!!! Conditioning event definition begins in next descriptor of this sequence level !!!!" );
880 snprintf ( e, dim,
"!!!! Conditioning event definition ends here !!!!" );
885 snprintf ( e, dim,
"&&&& Categorical forecast follow in next descriptor of this sequence level &&&&" );
887 snprintf ( e, dim,
"&&&& Categorical forecast ends here &&&&" );
Include header file for bufrdeco library.
#define BUFR_NMAXSEQ
Maximum expected descriptors in a expanded sequence for a single subset.
uint32_t buf_t
Type to set offsets and dimension of arrays or counters used in bufrdeco.
#define bufrdeco_assert(__my_expr__)
Check a expression and exit if it fails.
buf_t bufrdeco_print_json_separator(FILE *out)
Print the comma ',' separator in an output.
int bufrdeco_allocate_bitmap(struct bufrdeco *b)
allocate bitmap
uint32_t get_bits_as_char_array(char *target, uint8_t *has_data, uint8_t *source, buf_t *bit0_offset, buf_t bit_length)
#define BUFRDECO_COMPRESSED_REF_DATA_DESCRIPTOR_BITMASK
Bitmask for struct bufrdeco_compressed_ref which marks a data descriptor.
#define BUFRDECO_OUTPUT_JSON_SUBSET_DATA
Bit mask to the member mask of struct bufrdeco to print bufr subset data in json format.
#define DESCRIPTOR_HAVE_STRING_VALUE
Bit mask for a string in a struct bufr_atom_data.
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)
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
#define DESCRIPTOR_VALUE_MISSING
Bit mask for a missing value in a struct bufr_atom_data.
const int32_t pow10pos_int[10]
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.
int bufrdeco_parse_f2_descriptor(struct bufrdeco_subset_sequence_data *s, struct bufr_descriptor *d, struct bufrdeco *b)
parse a descritor with f = 2
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
char * bufrdeco_get_f2_descriptor_explanation(char *e, size_t dim, struct bufr_descriptor *d)
Contains all the information for a single data related with a descriptor in a expanded squence.
char name[BUFR_TABLEB_NAME_LENGTH]
struct bufr_descriptor desc
char unit[BUFR_TABLEB_UNIT_LENGTH]
char cval[BUFR_CVAL_LENGTH]
struct bufrdeco_bitmap * bmap[BUFR_MAX_BITMAPS]
Manage an array of structs bufrdeco_compressed_ref.
struct bufrdeco_compressed_ref * refs
Struct to hold the needed reference bit offsets, descriptor tree and replications in a compressed BUF...
char unit[BUFR_TABLEB_UNIT_LENGTH]
char name[BUFR_TABLEB_NAME_LENGTH]
struct bufr_descriptor * desc
uint8_t changing_reference
uint8_t local_bit_reserved
struct bufrdeco_bitmap * bitmap
Contains all the information for a subset in a expanded squence This is a version to use with bufrdec...
struct bufr_atom_data * sequence
This struct contains all needed data to parse and decode a BUFR file.
struct bufrdeco_bitmap_array bitmap
struct bufrdeco_decoding_data_state state