Functions | |
| int | bufr_read_file (bufr_t *msg, char *file) |
| This functions reads the encoded BUFR-message to a binary file. | |
| int | bufr_get_sections (char *bm, int len, bufr_t *msg) |
| Calculates the section length of a BUFR message and allocates memory for each section. | |
| int | bufr_decode_sections01 (sect_1_t *s1, bufr_t *msg) |
| This function decodes sections 0 and 1. | |
| int | bufr_read_msg (void *datasec, void *ddsec, size_t datasecl, size_t ddescl, dd **descr, int *ndescs, varfl **vals, size_t *nvals) |
| Decode BUFR data and descriptor section and write values and descriptors to arrays. | |
| int bufr_read_file | ( | bufr_t * | msg, | |
| char * | file | |||
| ) |
This function reads the encoded BUFR message from a binary file, calculates the section length and writes each section to a memory block. Memory for the sections is allocated by this function and must be freed by the calling function using bufr_free_data.
| [in] | msg | The complete BUFR message |
| [in] | file | The filename of the binary file |
| int bufr_get_sections | ( | char * | bm, | |
| int | len, | |||
| bufr_t * | msg | |||
| ) |
This function calculates the sections length of a BUFR message and allocates memory for each section. The memory has to be freed by the calling function using bufr_free_data.
| [in] | bm | Pointer to the memory where the raw BUFR message is stored |
| [in] | len | Length of bm |
| [in,out] | msg | The BUFR message containing the single sections and section length |
This function decodes sections 0 and 1 of a BUFR message. The BUFR edition is read from section 0 and is written to the global _bufr_edition parameter.
| [in,out] | s1 | sect_1_t structure to contain section 1 data |
| [in] | msg | BUFR message where the sections are stored. |
| int bufr_read_msg | ( | void * | datasec, | |
| void * | ddsec, | |||
| size_t | datasecl, | |||
| size_t | ddescl, | |||
| dd ** | descr, | |||
| int * | ndescs, | |||
| varfl ** | vals, | |||
| size_t * | nvals | |||
| ) |
This function decodes the data and descriptor sections of a BUFR message and stored them into arrays descr and vals. Memory for storing descriptor- and data-array is allocated by this function and has to be freed by the calling function.
| [in] | datasec | Is where the data-section is stored. |
| [in] | ddsec | Is where the data-descriptor-section is stored. |
| [in] | datasecl | Number of bytes of the data-section. |
| [in] | ddescl | Number of bytes of the data-descriptor-section. |
| [out] | descr | Array where the data-descriptors are stored after reading them from the data-descriptor section. This memory area is allocated by this function and has to be freed by the calling function. |
| [out] | ndescs | Number of data-descriptors in descs |
| [out] | vals | Array where the data corresponding to the data-descriptors is stored. |
| [out] | nvals | Number of values in vals |
1.5.4