Extended functions for encoding to BUFR


Functions

int bufr_out_descsec (dd *descp, int ndescs, int desch)
 Write descriptor section of a BUFR message to the bitsream.
int bufr_open_descsec_w ()
 Open bitstream for section 3 for writing and set default values.
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.
void bufr_sect_1_from_file (sect_1_t *s1, char *file)
 Reads section 1 from a file and stores data read in s1.

Function Documentation

int bufr_out_descsec ( dd descp,
int  ndescs,
int  desch 
)

This function writes the descriptor section of a BUFR message to the section 3 bitstream which has already been opened using bufr_open_descsec_w

Parameters:
[in] descp Array holding the data descriptors
[in] ndescs Number of descriptors
[in] desch Handle to the bitstream
Returns:
1 on success, 0 on error
See also:
bufr_open_descsec_w, bufr_out_descsec

Definition at line 514 of file bufr.c.

int bufr_open_descsec_w (  ) 

This function opens the bitstream for section 3 and sets default values. The bistream must be closed using bufr_close_descsec_w.

Returns:
Returns handle for the bitstream or -1 on error.
See also:
bufr_close_descsec_w, bufr_out_descsec

Definition at line 546 of file bufr.c.

void bufr_close_descsec_w ( bufr_t bufr,
int  desch 
)

This function calculates and writes the length of section 3, then closes the bitstream.

Parameters:
[in,out] bufr BUFR message to hold the section.
[in] desch Handle to the bitstream
See also:
bufr_open_descsec_w, bufr_out_descsec

Definition at line 584 of file bufr.c.

int bufr_parse_in ( dd descs,
int  start,
int  end,
int(*)(varfl *val, int ind)  inputfkt,
int  callback_descs 
)

This function, derived from bufr_parse_new, parses a descriptor or a sequence of descriptors and calls the user defined function inputfkt for reading 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 wrote out to the global data section bitstream (see bufr_open_datasect_w).

Optionally inputfkt is called also for sequence descriptors and ccitt descriptors

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

Definition at line 1114 of file bufr.c.

void bufr_sect_1_from_file ( sect_1_t s1,
char *  file 
)

This function reads section 1 from an ASCII file and stores the data read in a structure s1 . If the file can not be read, s1 is filled with internally defined default values.

Parameters:
[in,out] s1 Structure where section 1 data is stored.
[in] file Filename of the input file.
See also:
bufr_sect_1_to_file

Definition at line 1184 of file bufr.c.


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