bufr2synop 0.24.0
bufrdeco_json.c
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (C) 2013-2022 by Guillermo Ballester Valor *
3 * gbv@ogimet.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20/*!
21 \file bufrdeco_json.c
22 \brief This file has the code which functions to print BUFR data in json format
23*/
24#include "bufrdeco.h"
25
26/*!
27 * \fn buf_t bufrdeco_print_json_scape_string_cvals ( FILE *out, char *source )
28 * \brief prints a descriptor string value scaping the '"' for a json format
29 * \param out output stream
30 * \param source source string
31 * \return The amount of bytes sent to out
32 */
34{
35 buf_t i = 0, used = 0;
36 while ( source[i] )
37 {
38 switch ( source[i] )
39 {
40 case '"':
41 used += fprintf ( out, "%c%c", '\\', source[i++] );
42 break;
43 default:
44 used += fprintf ( out, "%c", source[i++] );
45 break;
46 }
47 }
48 return used;
49}
50
51/*!
52 * \fn buf_t bufrdeco_print_subset_data_prologue (FILE *out, struct bufrdeco *b )
53 * \brief Prints the prologue of object with a subset data in json format
54 * \param out output stream opened by caller
55 * \param b pointer to active struct \ref bufrdeco
56 * \return The amount of bytes sent to out
57 */
59{
60 buf_t used = 0;
61
62 bufrdeco_assert ( b != NULL );
63
64 // print prologue
65 used += fprintf ( out, "{\"BUFR File\":\"%s\",\"Subset\":%u,\"Decoded data\":",b->header.filename, b->seq.ss );
66
67 return used;
68}
69
70/*!
71 * \fn buf_t bufrdeco_print_subset_data_epilogue ( FILE *out )
72 * \brief Prints the prologue of object with a subset data in json format
73 * \param out output stream opened by caller
74 *
75 * \return The amount of bytes sent to out
76 */
78{
79 buf_t used = 0;
80
81 // print prologue
82 used += fprintf ( out, "}\n" );
83 return used;
84}
85
86/*!
87 * \fn buf_t bufrdeco_print_json_sequence_descriptor_header (FILE *out, struct bufr_sequence *seq )
88 * \brief Print the header of a sequence descriptor (f == 3)
89 * \param out output stream opened by caller
90 * \param seq pointer to a bufr_sequence \ref bufr_sequence
91 *
92 * \return The amount of bytes sent to out
93 */
95{
96 buf_t used = 0;
97
98 used += fprintf ( out, "{\"Descriptor\":\"%c %c%c %c%c%c\",", seq->key[0], seq->key[1], seq->key[2], seq->key[3], seq->key[4], seq->key[5] );
99 used += fprintf ( out, "\"Sequence description\":\"%s\",\"Expanded sequence\":[", seq->name );
100 return used;
101}
102
103/*!
104 * \fn buf_t bufrdeco_print_json_sequence_descriptor_header (FILE *out )
105 * \brief Print the final of a sequence descriptor (f == 3)
106 * \param out output stream opened by caller
107 *
108 * \return The amount of bytes sent to out
109 */
111{
112 buf_t used = 0;
113 // print final
114 used += fprintf ( out, "]}" );
115 return used;
116}
117
118
119/*!
120 * \fn buf_t bufrdeco_print_json_object_atom_data (FILE *out, struct bufr_atom_data *a, char *add )
121 * \brief Print an json object with a descriptor data
122 * \param out output stream opened by caller
123 * \param a pointer to target struct \ref bufr_atom_data
124 * \param add adtional optional info
125 *
126 * \return The amount of bytes sent to out
127 *
128 * There are four cases of objects, depending of data type
129 * { "descriptor":"f xx yyy", "name":"name_of_descriptor" , "unit":"name_of_unit", "value":"string_value"}
130 * { "descriptor":"f xx yyy", "name":"name_of_descriptor" , "unit":"Code table", "value":"numeric_value", "meaning":"explanation_string}
131 * { "descriptor":"f xx yyy", "name":"name_of_descriptor" , "unit":"Flag value", "value":"numeric_value", "meaning":"explanation_string}
132 * { "descriptor":"f xx yyy", "name":"name_of_descriptor" , "unit":"name_of_unit", "value":"numeric_value"}
133 */
135{
136 char aux[256];
137 buf_t used = 0;
138
139 used += fprintf ( out, "{\"Descriptor\":\"%u %02u %03u\",\"Name\":\"%s\",", a->desc.f, a->desc.x, a->desc.y, bufr_adjust_string ( a->name ) );
140
141 // add aditional info keys
142 if ( add != NULL && add[0] )
143 used += fprintf ( out, "%s,", add );
144
146 {
147 // string data case
149 used += fprintf ( out, "\"Unit\":\"CCITT5\",\"Value\":\"MISSING\"}" ) ;
150 else
151 {
152 used += fprintf ( out, "\"Unit\":\"CCITT5\",\"Value\":\"" ) ;
154 used += fprintf ( out, "\"}" );
155 }
156 }
157 else if ( a->mask & DESCRIPTOR_IS_CODE_TABLE )
158 {
159 // code table case
161 used += fprintf ( out, "\"Unit\":\"Code table\",\"Value\":\"MISSING\"}" ) ;
162 else
163 {
164 used += fprintf ( out, "\"Unit\":\"Code table\",\"Value\":%u,", ( uint32_t ) ( a->val + 0.5 ) ) ;
165 used += fprintf ( out, "\"Meaning\":\"%s\"}", bufr_adjust_string ( a->ctable ) );
166 }
167 }
168 else if ( a->mask & DESCRIPTOR_IS_FLAG_TABLE )
169 {
170 // flag table case
172 used += fprintf ( out, "\"Unit\":\"Flag table\",\"Value\":\"MISSING\"}" ) ;
173 else
174 {
175 used += fprintf ( out, "\"Unit\":\"Flag table\",\"Value\":\"0x%08X\",", ( uint32_t ) ( a->val ) ) ;
176 used += fprintf ( out, "\"Meaning\":\"%s\"}", bufr_adjust_string ( a->ctable ) );
177 }
178 }
179 else
180 {
181 // numeric data case
183 used += fprintf ( out, "\"Unit\":\"%s\",\"Value\":\"MISSING\"}", a->unit ) ;
184 else
185 {
186 used += fprintf ( out, "\"Unit\":\"%s\",\"Value\":%s}", a->unit,
187 get_formatted_value_from_escale2 ( aux, sizeof ( aux ), a->escale, a->val ) );
188
189 }
190 }
191 return used;
192}
193
194/*!
195 * \fn buf_t bufrdeco_print_json_object_operator_descriptor (FILE *out, struct bufr_descriptor *d, char *add )
196 * \brief print an operator desciptor as a json object
197 * \param out output stream opened by caller
198 * \param d pointer to operator descriptor
199 * \param add adtional optional info
200 *
201 * \return The amount of bytes sent to out
202 */
204{
205 buf_t used = 0;
206 char explanation[256];
207
208 if ( d->f == 2 )
209 {
210 // only prints if f == 2
211 used += fprintf ( out, "{\"Descriptor\":\"%u %02u %03u\",", d->f, d->x, d->y );
212 // add aditional info keys
213 if ( add != NULL && add[0] )
214 used += fprintf ( out, "%s,", add );
215
216 used += fprintf ( out, "\"Operator\": \"%s\"}", bufrdeco_get_f2_descriptor_explanation ( explanation, sizeof ( explanation ), d ) );
217 }
218 return used;
219}
220
221/*!
222 * \fn buf_t bufrdeco_print_json_object_replicator_descriptor (FILE *out, struct bufr_descriptor *d, char *add )
223 * \brief print an operator desciptor as a json object
224 * \param out string where to print
225 * \param d pointer to operator descriptor
226 * \param add additional info
227 *
228 * \return The amount of bytes sent to out
229 */
231{
232 buf_t used = 0;
233
234 if ( d->f == 1 )
235 {
236 used += fprintf ( out, "{\"Descriptor\":\"%u %02u %03u\",", d->f, d->x, d->y );
237 // add aditional info keys
238 if ( add != NULL && add[0] )
239 used += fprintf ( out, "%s,", add );
240
241 if ( d->y == 0 )
242 {
243 if ( d->x == 1 )
244 used += fprintf ( out, "\"Replicator\":\"Replicator for %d descriptor after next delayed descriptor which set the number of replications.\"}", d->x );
245 else
246 used += fprintf ( out, "\"Replicator\":\"Replicator for %d descriptors after next delayed descriptor which set the number of replications.\"}", d->x );
247 }
248 else
249 {
250 if ( d->x == 1 )
251 used += fprintf ( out, "\"Replicator\":\"Replicator for next descriptor %d times.\"}", d->y );
252 else
253 used += fprintf ( out, "\"Replicator\":\"Replicator for next %d descriptors %d times\"}", d->x, d->y );
254 }
255
256 }
257 return used;
258}
259
260/*!
261 * \fn buf_t bufrdeco_print_json_separator( FILE *out)
262 * \brief Print the comma ',' separator in an output
263 * \param out string where to print
264 *
265 * \return The amount of bytes sent to out
266 */
268{
269 return fprintf ( out, "," );
270}
271
272/*!
273 \fn int sprint_sec0_info( FILE *out, struct bufrdeco *b )
274* \brief Print info form sec 0 in json format
275 * \param out string where to print
276 * \param b actuve struct \ref bufrdeco
277 *
278 * \return The amount of bytes sent to out
279*/
281{
282 size_t used = 0;
283
284 bufrdeco_assert ( b != NULL );
285 used += fprintf ( out, "{\"Sec 0\":{" );
286 used += fprintf ( out, "\"Bufr length\":%u,", b->sec0.bufr_length );
287 used += fprintf ( out, "\"Bufr edition\":%u}}", b->sec0.edition );
288 return used;
289}
290
291
292/*!
293 * \fn bufrdeco_print_json_sec1 (FILE *out, struct bufrdeco *b)
294 * \brief Print info form sec 1 in json format
295 * \param out string where to print
296 * \param b actuve struct \ref bufrdeco
297 *
298 * \return The amount of bytes sent to out
299*/
301{
302 size_t used = 0;
303
304 bufrdeco_assert ( b != NULL );
305 used += fprintf ( out, "{\"Sec 1\":{" );
306 used += fprintf ( out, "\"Length\":%u", b->sec1.length );
307 used += fprintf ( out, ",\"Bufr master table\":%u", b->sec1.master );
308 used += fprintf ( out, ",\"Centre\":%u", b->sec1.centre );
309 used += fprintf ( out, ",\"Sub-Centre\":%u", b->sec1.subcentre );
310 used += fprintf ( out, ",\"Update sequence\":%u", b->sec1.update );
311 used += fprintf ( out, ",\"Options\":\"0x%x\"", b->sec1.options );
312 used += fprintf ( out, ",\"Category\":%u", b->sec1.category );
313 used += fprintf ( out, ",\"Subcategory\":%u", b->sec1.subcategory );
314 used += fprintf ( out, ",\"Sub-category local\":%u", b->sec1.subcategory_local );
315 used += fprintf ( out, ",\"Master table version\":%u", b->sec1.master_version );
316 used += fprintf ( out, ",\"Master table local\":%u", b->sec1.master_local );
317 used += fprintf ( out, ",\"Year\":%u", b->sec1.year );
318 used += fprintf ( out, ",\"Month\":%u", b->sec1.month );
319 used += fprintf ( out, ",\"Day\":%u", b->sec1.day );
320 used += fprintf ( out, ",\"Hour\":%u", b->sec1.hour );
321 used += fprintf ( out, ",\"Minute\":%u", b->sec1.minute );
322 used += fprintf ( out, ",\"Second\":%u", b->sec1.second );
323 if ( b->sec0.edition == 3 )
324 used += fprintf ( out, ",\"Aditional space\":%u", b->sec1.length - 17 );
325 else
326 used += fprintf ( out, ",\"Aditional space\":%u", b->sec1.length - 22 );
327 used += fprintf ( out, "}" );
328
329 if ( b->tables->b.path[0] )
330 {
331 used += fprintf ( out, ",{\"Used tables\":{" );
332 used += fprintf ( out, ",\"TableB file\":\"%s\"", b->tables->b.path );
333 used += fprintf ( out, ",\"tableC file\":\"%s\"", b->tables->c.path );
334 used += fprintf ( out, ",\"tableD file\":\"%s\"", b->tables->d.path );
335 used += fprintf ( out, "}" );
336 }
337 used += fprintf ( out, "}" );
338
339 return used;
340}
341
342/*!
343 \fn buf_t bufrdeco_print_json_sec2( FILE *out, struct bufrdeco *b )
344* \brief Print info form optional sec 2 in json format
345 * \param out string where to print
346 * \param b actuve struct \ref bufrdeco
347 *
348 * \return The amount of bytes sent to out
349*/
351{
352 size_t used = 0;
353
354 bufrdeco_assert ( b != NULL );
355 used += fprintf ( out, "{\"Sec 2\":{" );
356 if ( b->sec1.options & 0x80 )
357 used += fprintf ( out, "\"Length\":%u}}", b->sec2.length );
358 else
359 used += fprintf ( out, "\"Length\":0}}" );
360
361 return used;
362}
363
364/*!
365 * \fn bufrdeco_print_json_sec3 (FILE *out, struct bufrdeco *b)
366 * \brief Print info form sec 3 in json format
367 * \param out string where to print
368 * \param b actuve struct \ref bufrdeco
369 *
370 * \return The amount of bytes sent to out
371*/
373{
374 buf_t used = 0, i;
375
376 bufrdeco_assert ( b != NULL );
377 used += fprintf ( out, "{\"Sec 3\":{" );
378 used += fprintf ( out, "\"Sec3 length\":%u", b->sec3.length );
379 used += fprintf ( out, ",\"Subsets\":%u", b->sec3.subsets );
380 used += fprintf ( out, ",\"Observed\":%u", b->sec3.observed );
381 used += fprintf ( out, ",\"Compressed\":%u", b->sec3.compressed );
382 used += fprintf ( out, ",\"Unexpanded descriptors\":%u", b->sec3.ndesc );
383 used += fprintf ( out, ",\"Unexpanded array\":" );
384
385 used += fprintf ( out,"[" );
386 for ( i = 0; i < b->sec3.ndesc; i++ )
387 {
388 if ( i )
389 used += fprintf ( out,"," );
390 used += fprintf ( out, "{\"%u\":\"%u %02u %03u\"}", i, b->sec3.unexpanded[i].f, b->sec3.unexpanded[i].x, b->sec3.unexpanded[i].y );
391 }
392 used += fprintf ( out,"]}}" );
393
394 return used;
395}
396
397/*!
398 \fn int bufrdeco_print_json_tree_recursive ( FILE *out, struct bufrdeco *b, struct bufr_sequence *seq )
399 \brief Print a tree of descriptors to a file in a recursive way in json format
400 \param out stream opened by caller
401 \param b pointer to the basic container struct \ref bufrdeco
402 \param seq pointer to the struct \ref bufr_sequence to print
403 \return The amount of bytes sent to out
404*/
406{
407 buf_t i, k, used = 0;
408 struct bufr_sequence *l;
409 char explanation[256];
410
411 bufrdeco_assert ( out != NULL && b != NULL );
412
413 if ( seq == NULL )
414 {
415 l = & ( b->tree->seq[0] );
416 }
417 else
418 {
419 l = seq;
420 }
421
422 // begins the array
423 for ( i = 0; i < l->ndesc; i++ )
424 {
425 if ( i )
426 used += fprintf ( out, "," );
427 fprintf ( out, "{\"%u %02u %03u\"", l->lseq[i].f, l->lseq[i].x,l->lseq[i].y );
428
429 if ( l->lseq[i].f != 3 )
430 {
431 if ( l->lseq[i].f == 0 )
432 {
433 if ( bufr_find_tableB_index ( &k, & ( b->tables->b ), l->lseq[i].c ) )
434 used += fprintf ( out, "\"Not found in tables\"}" );
435 else
436 {
437 used += fprintf ( out, ":\"" );
438 if ( l->replicated[i] )
439 {
440 if ( l->replicated[i] )
441 {
442 if ( l->replicated[i] == 1 )
443 used += fprintf ( out, "Replicated | " );
444 else
445 used += fprintf ( out, "Replicated depth %u | ", l->replicated[i] );
446 }
447 }
448 if ( is_a_delayed_descriptor ( & l->lseq[i] ) ||
450 used += fprintf ( out, "* %s\"}", b->tables->b.item[k].name );
451 else
452 used += fprintf ( out, "%s\"}", b->tables->b.item[k].name );
453 }
454 }
455 else if ( l->lseq[i].f == 2 )
456 {
457 used += fprintf ( out, ":\"%s\"}", bufrdeco_get_f2_descriptor_explanation ( explanation, sizeof ( explanation ), & ( l->lseq[i] ) ) );
458 }
459 else if ( l->lseq[i].f == 1 )
460 {
461 if ( l->lseq[i].y == 0 )
462 {
463 if ( l->lseq[i].x == 1 )
464 used += fprintf ( out, ":\"* Replicator for %d descriptor after next delayed descriptor which set the number of replications.\"}", l->lseq[i].x );
465 else
466 used += fprintf ( out, ":\"* Replicator for %d descriptors after next delayed descriptor which set the number of replications.\"}", l->lseq[i].x );
467 }
468 else
469 {
470 if ( l->lseq[i].x == 1 )
471 used += fprintf ( out, ":\"* Replicator for next descriptor %d times\"}", l->lseq[i].y );
472 else
473 used += fprintf ( out, ":\"* Replicator for next %d descriptors %d times\"}", l->lseq[i].x, l->lseq[i].y );
474 }
475 }
476 else
477 used += fprintf ( out, "\n" );
478 continue;
479 }
480 else
481 {
482 // f == 3
483 used += fprintf ( out, ":\"" );
484 if ( l->replicated[i] )
485 {
486 if ( l->replicated[i] == 1 )
487 used += fprintf ( out, "Replicated | " );
488 else
489 used += fprintf ( out, "Replicated depth %u | ", l->replicated[i] );
490 }
491 used += fprintf ( out, "%s\"", bufr_adjust_string ( l->name ) );
492 used += fprintf ( out, ",\"Expanded\":[" );
493 // parse de son
494 used += bufrdeco_print_json_tree_recursive ( out, b, l->sons[i] );
495 used += fprintf ( out, "]}" );
496 // we then recursively parse the son
497 }
498 }
499 return used;
500}
501
502/*!
503 \fn int bufrdeco_print_tree ( struct bufrdeco *b )
504 \brief Print a tree of descriptors
505 \param b pointer to a basic container struct \ref bufrdeco
506 \return The amount of bytes sent to out
507*/
509{
510 buf_t used = 0;
511 bufrdeco_assert ( b != NULL );
512
514 used += bufrdeco_print_json_tree_recursive ( b->out, b, NULL );
515 return used;
516};
buf_t bufrdeco_print_json_subset_data_prologue(FILE *out, struct bufrdeco *b)
Definition: bufrdeco_json.c:58
buf_t bufrdeco_print_json_sec1(FILE *out, struct bufrdeco *b)
Print info form sec 1 in json format.
buf_t bufrdeco_print_json_sec2(FILE *out, struct bufrdeco *b)
Print info form optional sec 2 in json format.
buf_t bufrdeco_print_json_separator(FILE *out)
Print the comma ',' separator in an output.
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.
buf_t bufrdeco_print_json_sequence_descriptor_final(FILE *out)
buf_t bufrdeco_print_json_object_operator_descriptor(FILE *out, struct bufr_descriptor *d, char *add)
print an operator desciptor as a json object
buf_t bufrdeco_print_json_sec0(FILE *out, struct bufrdeco *b)
buf_t bufrdeco_print_json_sequence_descriptor_header(FILE *out, struct bufr_sequence *seq)
Print the header of a sequence descriptor (f == 3)
Definition: bufrdeco_json.c:94
buf_t bufrdeco_print_json_sec3(FILE *out, struct bufrdeco *b)
Print info form sec 3 in json format.
buf_t bufrdeco_print_json_object_replicator_descriptor(FILE *out, struct bufr_descriptor *d, char *add)
print an operator desciptor as a json object
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.
buf_t bufrdeco_print_json_subset_data_epilogue(FILE *out)
Definition: bufrdeco_json.c:77
buf_t bufrdeco_print_json_scape_string_cvals(FILE *out, char *source)
prints a descriptor string value scaping the '"' for a json format
Definition: bufrdeco_json.c:33
Include header file for bufrdeco library.
uint32_t buf_t
Type to set offsets and dimension of arrays or counters used in bufrdeco.
Definition: bufrdeco.h:346
#define bufrdeco_assert(__my_expr__)
Check a expression and exit if it fails.
Definition: bufrdeco.h:374
int bufr_find_tableB_index(buf_t *index, struct bufr_tableB *tb, const char *key)
found a descriptor index in a struct bufr_tableB
#define BUFRDECO_OUTPUT_JSON_EXPANDED_TREE
Bit mask to the member mask of struct bufrdeco to print bufr expanded tree of descriptors.
Definition: bufrdeco.h:305
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
buf_t bufrdeco_print_json_tree(struct bufrdeco *b)
#define DESCRIPTOR_HAVE_STRING_VALUE
Bit mask for a string in a struct bufr_atom_data.
Definition: bufrdeco.h:152
#define DESCRIPTOR_IS_FLAG_TABLE
Bit mask for a flag table in a struct bufr_atom_data.
Definition: bufrdeco.h:176
#define DESCRIPTOR_IS_CODE_TABLE
Bit mask for a code table in a struct bufr_atom_data.
Definition: bufrdeco.h:158
int is_a_delayed_descriptor(struct bufr_descriptor *d)
check if a descriptor is a delayed descriptor
#define DESCRIPTOR_VALUE_MISSING
Bit mask for a missing value in a struct bufr_atom_data.
Definition: bufrdeco.h:140
char * bufr_adjust_string(char *s)
Supress trailing blanks of a string.
int is_a_short_delayed_descriptor(struct bufr_descriptor *d)
check if a descriptor is a short delayed descriptor
char * bufrdeco_get_f2_descriptor_explanation(char *e, size_t dim, struct bufr_descriptor *d)
Definition: bufrdeco_f2.c:773
Contains all the information for a single data related with a descriptor in a expanded squence.
Definition: bufrdeco.h:435
int32_t escale
Definition: bufrdeco.h:441
uint32_t mask
Definition: bufrdeco.h:437
char name[BUFR_TABLEB_NAME_LENGTH]
Definition: bufrdeco.h:438
char ctable[BUFR_EXPLAINED_LENGTH]
Definition: bufrdeco.h:444
struct bufr_descriptor desc
Definition: bufrdeco.h:436
double val
Definition: bufrdeco.h:440
char unit[BUFR_TABLEB_UNIT_LENGTH]
Definition: bufrdeco.h:439
char cval[BUFR_CVAL_LENGTH]
Definition: bufrdeco.h:443
BUFR descriptor.
Definition: bufrdeco.h:409
char c[12]
Definition: bufrdeco.h:414
uint8_t edition
Definition: bufrdeco.h:698
uint32_t bufr_length
Definition: bufrdeco.h:697
uint8_t month
Definition: bufrdeco.h:785
uint32_t year
Definition: bufrdeco.h:784
uint8_t master_local
Definition: bufrdeco.h:783
uint32_t subcentre
Definition: bufrdeco.h:776
uint32_t centre
Definition: bufrdeco.h:775
uint8_t category
Definition: bufrdeco.h:779
uint8_t options
Definition: bufrdeco.h:778
uint8_t minute
Definition: bufrdeco.h:788
uint8_t subcategory
Definition: bufrdeco.h:780
uint8_t master_version
Definition: bufrdeco.h:782
uint8_t second
Definition: bufrdeco.h:789
uint8_t day
Definition: bufrdeco.h:786
uint32_t length
Definition: bufrdeco.h:773
uint8_t subcategory_local
Definition: bufrdeco.h:781
uint8_t hour
Definition: bufrdeco.h:787
uint8_t update
Definition: bufrdeco.h:777
uint8_t master
Definition: bufrdeco.h:774
uint32_t length
Definition: bufrdeco.h:799
uint8_t observed
Definition: bufrdeco.h:811
uint8_t compressed
Definition: bufrdeco.h:812
struct bufr_descriptor unexpanded[BUFR_LEN_UNEXPANDED_DESCRIPTOR]
Definition: bufrdeco.h:814
uint32_t ndesc
Definition: bufrdeco.h:813
uint32_t length
Definition: bufrdeco.h:809
uint32_t subsets
Definition: bufrdeco.h:810
Stores an unexpanded sequence of descriptors.
Definition: bufrdeco.h:572
struct bufr_descriptor lseq[NMAXSEQ_DESCRIPTORS]
Definition: bufrdeco.h:583
buf_t ndesc
Definition: bufrdeco.h:575
char key[8]
Definition: bufrdeco.h:573
uint8_t replicated[NMAXSEQ_DESCRIPTORS]
Definition: bufrdeco.h:582
struct bufr_sequence * sons[NMAXSEQ_DESCRIPTORS]
Definition: bufrdeco.h:584
char name[BUFR_EXPLAINED_LENGTH]
Definition: bufrdeco.h:588
char name[BUFR_TABLEB_NAME_LENGTH]
Definition: bufrdeco.h:842
struct bufr_tableB_decoded_item item[BUFR_MAXLINES_TABLEB]
Definition: bufrdeco.h:867
char path[BUFRDECO_PATH_LENGTH]
Definition: bufrdeco.h:861
char path[BUFRDECO_PATH_LENGTH]
Definition: bufrdeco.h:893
char path[BUFRDECO_PATH_LENGTH]
Definition: bufrdeco.h:922
struct bufr_tableD d
Definition: bufrdeco.h:941
struct bufr_tableB b
Definition: bufrdeco.h:939
struct bufr_tableC c
Definition: bufrdeco.h:940
struct bufr_sequence seq[BUFR_MAX_EXPANDED_SEQUENCES]
Definition: bufrdeco.h:598
This struct contains all needed data to parse and decode a BUFR file.
Definition: bufrdeco.h:965
struct bufr_sec0 sec0
Definition: bufrdeco.h:968
struct bufrdeco_subset_sequence_data seq
Definition: bufrdeco.h:979
uint32_t mask
Definition: bufrdeco.h:966
struct bufr_sec2 sec2
Definition: bufrdeco.h:970
struct bufr_tables * tables
Definition: bufrdeco.h:973
struct bufr_sec3 sec3
Definition: bufrdeco.h:971
struct gts_header header
Definition: bufrdeco.h:967
FILE * out
Definition: bufrdeco.h:984
struct bufrdeco_expanded_tree * tree
Definition: bufrdeco.h:975
struct bufr_sec1 sec1
Definition: bufrdeco.h:969
char filename[BUFRDECO_PATH_LENGTH]
Definition: bufrdeco.h:712