Extended functions for decoding from BUFR


Functions

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.
int bufr_in_descsec (dd **descs, int ndescs, int desch)
 Read descriptor section of a BUFR message from the bitsream.
int bufr_open_descsec_r (bufr_t *msg)
 Open bitstream of section 3 for reading.
void bufr_close_descsec_r (int desch)
 close bitstream for section 3
int bufr_get_ndescs (bufr_t *msg)
 Calculate number of data descriptors in a BUFR message.

Function Documentation

int bufr_parse_out ( dd descs,
int  start,
int  end,
int(*)(varfl val, int ind)  outputfkt,
int  callback_all_descs 
)

This function, derived from bufr_parse_new, parses a descriptor or a sequence of descriptors and calls the user defined function outputfkt for each data-value corresponding to an element descriptor. In case of CCITT (ASCII) data it calls the user-function for each character of the string.

Data values are read from the global data section bitstream (see bufr_open_datasect_r).

Optionally outputfkt is called for all descriptors including sequence descriptors, repetition descriptors, ...

Parameters:
[in] descs Pointer to the data-descriptors.
[in] start First data-descriptor for output.
[in] end Last data-descriptor for output.
[in] outputfkt User defined output function to be called for each data-element or descriptor
[in] callback_all_descs Flag that indictes when the user-functions are to be called:
0 for normal behaviour (call outputfkt for each element descriptor and each CCITT character)
1 for extended behaviour (call outputfkt for all descriptors)
Returns:
The function returns 1 on success, 0 on error
See also:
bufr_parse, bufr_parse_new, bufr_parse_in, Callback functions for decoding from BUFR, bufr_open_datasect_r
Examples:
apisample.c.

Definition at line 1160 of file bufr.c.

int bufr_sect_1_to_file ( sect_1_t s1,
char *  file 
)

This function writes section 1 data to an ASCII file

Parameters:
[in] s1 Structure where section 1 data is stored.
[in] file Filename of the output file.
See also:
bufr_sect_1_from_file
Examples:
apisample.c.

Definition at line 1569 of file bufr.c.

int bufr_in_descsec ( dd **  descs,
int  ndescs,
int  desch 
)

This function reads the descriptor section of a BUFR message from the bitsream which was opened using bufr_open_descsec_r

Parameters:
[in,out] descs Array to hold the data descriptors
[in] ndescs Number of descriptors
[in] desch Handle to the bitstream
Returns:
1 on success, 0 on error
See also:
bufr_get_ndescs, bufr_open_descsec_r, bufr_out_descsec
Examples:
apisample.c.

Definition at line 1728 of file bufr.c.

int bufr_open_descsec_r ( bufr_t msg  ) 

This function opens a bitstream for reading of section 3. It must be closed by bufr_close_descsec_r.

Parameters:
[in] msg The encoded BUFR message
Returns:
Returns handle to the bitstream or -1 on error
See also:
bufr_close_descsec_r, bufr_in_descsec
Examples:
apisample.c.

Definition at line 1780 of file bufr.c.

void bufr_close_descsec_r ( int  desch  ) 

This functin closes the input bitstream of section 3 which was opened by bufr_open_descsec_r.

Parameters:
[in] desch Handle to the bitstream
See also:
bufr_open_descsec_r, bufr_in_descsec
Examples:
apisample.c.

Definition at line 1814 of file bufr.c.

int bufr_get_ndescs ( bufr_t msg  ) 

This function calculates the number of data descriptors in a BUFR message.

Parameters:
[in] msg The complete BUFR message
Returns:
Returns the number of data descriptors.
See also:
bufr_in_descsec
Examples:
apisample.c.

Definition at line 1974 of file bufr.c.


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