Go to the source code of this file.
Data Structures | |
| struct | bufr_t |
| Structure that holds the encoded bufr message. More... | |
| struct | bufrval_t |
| Structure holding values for callbacks bufr_val_from_global and bufr_val_to_global. More... | |
Defines | |
| #define | MAX_DESCS 1000 |
| Maximum number of data descriptors in a BUFR message. | |
Typedefs | |
| typedef char * | bd_t |
| one bufr data element is a string | |
Functions | |
| int | bufr_create_msg (dd *descs, int ndescs, varfl *vals, void **datasec, void **ddsec, size_t *datasecl, size_t *ddescl) |
| Creates section 3 and 4 of BUFR message from arrays of data and data descriptors. | |
| int | bufr_encode_sections34 (dd *descs, int ndescs, varfl *vals, bufr_t *msg) |
| Creates section 3 and 4 of BUFR message from arrays of data and data descriptors. | |
| int | bufr_encode_sections0125 (sect_1_t *s1, bufr_t *msg) |
| This function creates sections 0, 1, 2 and 5. | |
| int | bufr_write_file (bufr_t *msg, char *file) |
| This functions saves the encoded BUFR-message to a binary file. | |
| 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 **desc, int *ndescs, varfl **vals, size_t *nvals) |
| Decode BUFR data and descriptor section and write values and descriptors to arrays. | |
| void | bufr_sect_1_from_file (sect_1_t *s1, char *file) |
| Reads section 1 from a file and stores data read in s1. | |
| int | bufr_open_descsec_w () |
| Open bitstream for section 3 for writing and set default values. | |
| int | bufr_out_descsec (dd *descp, int ndescs, int desch) |
| Write descriptor section of a BUFR message to the bitsream. | |
| void | bufr_close_descsec_w (bufr_t *bufr, int desch) |
| Write length of section 3 and close bitstream. | |
| int | bufr_parse_in (dd *descs, int start, int end, int(*inputfkt)(varfl *val, int ind), int callback_descs) |
| Parse data descriptors and call user defined input function for each element or for each descriptor. | |
| int | bufr_open_descsec_r (bufr_t *msg) |
| Open bitstream of section 3 for reading. | |
| int | bufr_get_ndescs (bufr_t *msg) |
| Calculate number of data descriptors in a BUFR message. | |
| int | bufr_in_descsec (dd **descs, int ndescs, int desch) |
| Read descriptor section of a BUFR message from the bitsream. | |
| void | bufr_close_descsec_r (int desch) |
| close bitstream for section 3 | |
| int | bufr_parse_out (dd *descs, int start, int end, int(*outputfkt)(varfl val, int ind), int callback_all_descs) |
| Parse data descriptors and call user defined output function for each element or for each descriptor. | |
| int | bufr_sect_1_to_file (sect_1_t *s1, char *file) |
| Writes section 1 data to an ASCII file. | |
| void | bufr_free_data (bufr_t *d) |
| Frees memory allocated for a BUFR message. | |
| int | bufr_check_fxy (dd *d, int ff, int xx, int yy) |
| Tests equality of descriptor d with (f,x,y). | |
| void | bufr_get_date_time (long *year, long *mon, long *day, long *hour, long *min) |
| Recall date/time info of the last BUFR-message created. | |
| int | bufr_val_to_array (varfl **vals, varfl v, int *nvals) |
| Store a value to an array of floats. | |
| int | bufr_desc_to_array (dd *descs, dd d, int *ndescs) |
| Store a descriptor to an array. | |
| int | bufr_parse_new (dd *descs, int start, int end, int(*inputfkt)(varfl *val, int ind), int(*outputfkt)(varfl val, int ind), int callback_all_descs) |
| Parse data descriptors and call user defined functions for each data element or for each descriptor. | |
| int | bufr_parse (dd *descs, int start, int end, varfl *vals, unsigned *vali, int(*userfkt)(varfl val, int ind)) |
| Parse data descriptors and call user-function for each element. | |
| bufrval_t * | bufr_open_val_array () |
| Opens global array of values for read/write. | |
| void | bufr_close_val_array () |
| Closes global array of values and frees all memory. | |
| int | bufr_open_datasect_w () |
| Opens bitstream for section 4 writing. | |
| void | bufr_close_datasect_w (bufr_t *msg) |
| Closes bitstream for section 4 and adds data to BUFR message. | |
| int | bufr_open_datasect_r (bufr_t *msg) |
| Opens bitstream for reading section 4. | |
| void | bufr_close_datasect_r () |
| Closes bitstream for section 4. | |
| int | bufr_val_from_global (varfl *val, int ind) |
| Get one value from global array of values. | |
| int | bufr_val_to_global (varfl val, int ind) |
| Write one value to global array of values. | |
| void | bufr_clean () |
| int | val_to_array (varfl **vals, varfl v, size_t *nvals) |
| int | setup_sec0125 (char *sec[], size_t secl[], sect_1_t s1) |
Variables | |
| int | _bufr_edition |
| global bufr edition number | |
| int | _replicating |
| global replication indicator | |
Definition in file bufr.h.
| int bufr_create_msg | ( | dd * | descs, | |
| int | ndescs, | |||
| varfl * | vals, | |||
| void ** | datasec, | |||
| void ** | ddsec, | |||
| size_t * | datasecl, | |||
| size_t * | ddescl | |||
| ) |
This function codes data from an array data descriptors descs and an array of varfl-values vals to a data section and a data descripor section of a BUFR message. Memory for both sections is allocated in this function and must be freed by the calling functions.
| [in] | descs | Data-descriptors corresponding to vals. For each descriptor there must be a data-vaule stored in vals. descs may also include replication factors and sequence descriptors. In that case there must be a larger number of vals then of descs. |
| [in] | ndescs | Number of data descriptos contained in descs. |
| [in] | vals | Data-values to be coded in the data section. For each entry in descs there must be an entry in vals. If there are relication factors in descs, of course there must be as much vals as definded by the replication factor. |
| [out] | datasec | Is where the data-section (section 4) is stored. The memory-area for the data-section is allocated by this function and must be freed by the calling function. |
| [out] | ddsec | Is where the data-descriptor-section (section 3) in stored. The memory needed is allocated by this function and must be freed by the calling function. |
| [out] | datasecl | Number of bytes in datasec. |
| [out] | ddescl | Number of bytes in ddsec. |
| int _bufr_edition |
The bufr edition number is stored in section 0 of the BUFR message. It is used by the software for determining the format of section 1.
| int _replicating |
This flag is used to indicate an ongoing data replication and is set by bufr_parse_new. It can be used for different output formating when a replication occurs.
1.5.4