desc.h File Reference

Data structures needed for holding the supported data-descriptors. More...

Go to the source code of this file.

Data Structures

struct  sect_1_t
 Holds the information contained in section 1. More...
struct  dd
 Describes one data descriptor. More...
struct  del
 Defines an element descriptor. More...
struct  dseq
 Structure that defines a sequence of descriptors. More...
struct  desc
 Structure that defines one descriptor. This can be an element descriptor or a sequence descriptor. More...

Defines

#define MISSVAL   99999.999999
#define SEQDESC   0
 Identifier for a sequence descriptor.
#define ELDESC   1
 Identifier for an element descriptor.
#define MAXDESC   2000
 Max. number of descriptors in the global descriptor-array (des).

Typedefs

typedef double varfl
 Defines the internal float-variable type.

Functions

int read_tab_b (char *fname)
 Reads bufr table b from a csv-files.
int read_tab_d (char *fname)
 Reads bufr table d from a csv-files.
char * get_unit (dd *d)
 Returns the unit for a given data descriptor.
int get_index (int typ, dd *d)
 Returns the index for the given descriptor and typ.
void free_descs (void)
 Frees all memory that has been allocated for data descriptors.
void trim (char *buf)
 Deletes all terminating blanks in a string.
int read_tables (char *dir, int vm, int vl, int subcenter, int gencenter)
 Reads bufr tables from csv-files.
void show_desc (int f, int x, int y)
 Prints the specified descriptor or all if f = 999.
int desc_is_codetable (int ind)
int desc_is_flagtable (int ind)

Variables

int ndes
 Total number of descriptors found.
descdes [MAXDESC+OPTDESC]
 Array holding all data descriptors.
int dw
 Current data width modification factor (default: 128).
int sc
 Current scale modification factor (default: 128).
int addfields
 Number of associated fields to be added to any data-item.
int ccitt_special
 Special index for ccitt characters.
int add_f_special
 Special index for associated fields.
int _desc_special
 Special index for descriptors without data.


Detailed Description

This file defines the data-structures needed to hold the supported data-descriptors. Also defines all functions used for reading the decriptor tables and utilites for managing the data descriptors.

Definition in file desc.h.


Define Documentation

#define MISSVAL   99999.999999

This is the internal missing value indicator. Missing values are indicated as "missing" and if we find such a value we set it internally to MISSVAL

Examples:
apisample.c.

Definition at line 108 of file desc.h.


Typedef Documentation

typedef double varfl

Defines the internal float-variable type. This can be float or double. Float needs less memory than double. Double-floats need not to be converted by your machine before operation (software runs faster). The default is double.

Note:
The format-string in all scanf-calls must be changed for varfl-values !
Examples:
apisample.c.

Definition at line 91 of file desc.h.


Function Documentation

void trim ( char *  buf  ) 

This functions deletes all terminating blanks in a string.

Parameters:
[in,out] buf Our string.

Definition at line 879 of file desc.c.

int desc_is_codetable ( int  ind  ) 

Checks if a descriptor is a code-table.

Parameters:
[in] ind Index to the global array des[] holding the description of known data-descriptors.
Returns:
1 if descriptor is a code-table, 0 if not.
See also:
desc_is_flagtable

Definition at line 824 of file desc.c.

int desc_is_flagtable ( int  ind  ) 

Checks if a descriptor is a flag-table.

Parameters:
[in] ind Index to the global array des[] holding the description of known data-descriptors.
Returns:
1 if descriptor is a flag-table, 0 if not.
See also:
desc_is_codetable

Definition at line 800 of file desc.c.


Variable Documentation

desc* des[MAXDESC+OPTDESC]

Array holding all data descriptors. The descriptors are read from the descriptor table files using read_tables or read_tab_b and read_tab_d

See also:
read_tables, read_tab_b, read_tab_d, get_index
Examples:
apisample.c.

int dw

Current data width modification factor (default: 128) Add dw - 128 to the data-width (dw can be optionally set by 2 01 YYY)

int sc

Current scale modification factor (default: 128). Add sc - 128 to the scale-factor (sc can be optionally set by 2 02 YYY)

int addfields

Number of associated fields to be added to any data-item. addfields can be set by 2 04 YYY and canceled by 2 04 000

int ccitt_special

This index is used by bufr_parse_new and its derivates to indicate that a value is a CCITT character

See also:
bufr_parse_new, Callback functions for encoding to BUFR, Callback functions for decoding from BUFR

int add_f_special

This index is used by bufr_parse_new and its derivates to indicate that a value is an associated field.

See also:
bufr_parse_new, Callback functions for encoding to BUFR, Callback functions for decoding from BUFR

int _desc_special

This index is used by bufr_parse_new and its derivates to indicate that we have a descriptor without value for output.

See also:
bufr_parse_new, Callback functions for decoding from BUFR
Examples:
apisample.c.


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