Basic functions for encoding to BUFR


Functions

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.

Function Documentation

int bufr_encode_sections34 ( dd descs,
int  ndescs,
varfl vals,
bufr_t msg 
)

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.

Parameters:
[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] msg The BUFR message where to store the coded descriptor and data sections. The memory-area for both sections is allocated by this function and must be freed by the calling function using bufr_free_data.
Returns:
The return-value is 1 if data was successfully stored, 0 if not.
See also:
bufr_encode_sections0125, bufr_data_from_file, bufr_read_msg
Examples:
apisample.c.

Definition at line 325 of file bufr.c.

int bufr_encode_sections0125 ( sect_1_t s1,
bufr_t msg 
)

This function creates sections 0, 1, 2 and 5 of a BUFR message. Memory for this section is allocated by this function and must be freed by the calling function using bufr_free_data.
The total length of the message is calculeted out of the single section length, thus sections 3 and 4 must already be present in the bufr message when calling this function. The BUFR edition is wrote into section 0 and is taken from the global _bufr_edition parameter.
If section 1 data and time parameters are set to 999 (no value), the current system time is taken for coding date and time information.

Parameters:
[in] s1 sect_1_t structure containing section 1 data
[in,out] msg BUFR message where the sections are to be stored. Must already contain section 3 and 4.
Returns:
1 on success, 0 on error.
Examples:
apisample.c.

Definition at line 1266 of file bufr.c.

int bufr_write_file ( bufr_t msg,
char *  file 
)

This function takes the encoded BUFR message and writes it to a binary file.

Parameters:
[in] msg The complete BUFR message
[in] file The filename of the destination file
Returns:
1 on success, 0 on error
See also:
bufr_read_file
Examples:
apisample.c.

Definition at line 1396 of file bufr.c.


Generated on Tue Dec 18 16:52:45 2007 for OPERA BUFR software by  doxygen 1.5.4