level.h File Reference

Sorted storage for all the dba_msg_datum present on one level. More...

#include <dballe/msg/datum.h>
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  _dba_msg_level
 Store an array of physical data all on the same level. More...

Typedefs

typedef struct _dba_msg_leveldba_msg_level

Functions

dba_err dba_msg_level_create (int ltype1, int l1, int ltype2, int l2, dba_msg_level *l)
 Create a new dba_msg_level.
dba_err dba_msg_level_copy (dba_msg_level src, dba_msg_level *dst)
 Copy an existing level.
void dba_msg_level_delete (dba_msg_level l)
 Delete a dba_msg_level.
int dba_msg_level_compare (const dba_msg_level l1, const dba_msg_level l2)
 Compare two dba_msg_level strutures, for use in sorting.
int dba_msg_level_compare2 (const dba_msg_level l, int ltype1, int l1, int ltype2, int l2)
 Compare a dba_msg_level struture with some level information, for use in sorting.
dba_err dba_msg_level_set_nocopy (dba_msg_level l, dba_var var, int pind, int p1, int p2)
 Add a dba_var to the level, taking over its memory management.
dba_msg_datum dba_msg_level_find (dba_msg_level l, dba_varcode code, int pind, int p1, int p2)
 Find a datum given its description.
dba_msg_datum dba_msg_level_find_by_id (dba_msg_level l, int id)
 Find a datum given its shortcut ID.
void dba_msg_level_print (dba_msg_level l, FILE *out)
 Dump all the contents of the level to the given stream.
void dba_msg_level_diff (dba_msg_level l1, dba_msg_level l2, int *diffs, FILE *out)
 Print the differences between two dba_msg_level to a stream.


Detailed Description

Sorted storage for all the dba_msg_datum present on one level.


Typedef Documentation

typedef struct _dba_msg_level* dba_msg_level

Store an array of physical data all on the same level.


Function Documentation

int dba_msg_level_compare ( const dba_msg_level  l1,
const dba_msg_level  l2 
)

Compare two dba_msg_level strutures, for use in sorting.

Parameters:
l1 First dba_msg_level to compare
l2 Second dba_msg_level to compare
Returns:
-1 if l1 < l2, 0 if l1 == l2, 1 if l1 > l2

References _dba_msg_level::l1, _dba_msg_level::l2, _dba_msg_level::ltype1, and _dba_msg_level::ltype2.

int dba_msg_level_compare2 ( const dba_msg_level  l,
int  ltype1,
int  l1,
int  ltype2,
int  l2 
)

Compare a dba_msg_level struture with some level information, for use in sorting.

Parameters:
l First dba_msg_level to compare
ltype Type of the level. See Level type values.
l1 L1 value of the level. See Level type values.
l2 L2 value of the level. See Level type values.
Returns:
-1 if l < ltype,l1,l2; 0 if l == ltype,l1,l2; 1 if l > ltype,l1,l2

References _dba_msg_level::l1, _dba_msg_level::l2, _dba_msg_level::ltype1, and _dba_msg_level::ltype2.

dba_err dba_msg_level_copy ( dba_msg_level  src,
dba_msg_level dst 
)

Copy an existing level.

Parameters:
src The level to copy.
Return values:
dst The newly created duplicate.
Returns:
The error indicator for the function (See error.h)

References _dba_msg_level::data, _dba_msg_level::data_count, DBA_RUN_OR_GOTO, DBA_RUN_OR_RETURN, _dba_msg_level::l1, _dba_msg_level::l2, _dba_msg_level::ltype1, and _dba_msg_level::ltype2.

dba_err dba_msg_level_create ( int  ltype1,
int  l1,
int  ltype2,
int  l2,
dba_msg_level l 
)

Create a new dba_msg_level.

Return values:
l The newly created level.
Returns:
The error indicator for the function (See error.h)

References _dba_msg_level::data, _dba_msg_level::data_alloc, _dba_msg_level::data_count, _dba_msg_level::l1, _dba_msg_level::l2, _dba_msg_level::ltype1, and _dba_msg_level::ltype2.

void dba_msg_level_delete ( dba_msg_level  l  ) 

Delete a dba_msg_level.

Parameters:
l The level to delete.

References _dba_msg_level::data, _dba_msg_level::data_alloc, and _dba_msg_level::data_count.

void dba_msg_level_diff ( dba_msg_level  l1,
dba_msg_level  l2,
int *  diffs,
FILE *  out 
)

Print the differences between two dba_msg_level to a stream.

Parameters:
l1 First level to compare
l2 Second level to compare
Return values:
diffs Integer variable that will be incremented by the number of differences found.
Parameters:
out The stream to dump a description of the differences to.

References _dba_msg_level::data, _dba_msg_level::data_count, _dba_msg_level::l1, _dba_msg_level::l2, _dba_msg_level::ltype1, _dba_msg_level::ltype2, and _dba_msg_datum::var.

dba_msg_datum dba_msg_level_find ( dba_msg_level  l,
dba_varcode  code,
int  pind,
int  p1,
int  p2 
)

Find a datum given its description.

Parameters:
l The level to query
code The dba_varcode of the variable to query. See vartable.h
pind Time range type indicator. See Time range values.
p1 Time range P1 indicator. See Time range values.
p2 Time range P2 indicator. See Time range values.
Returns:
The value found, or NULL if it was not found.

References _dba_msg_level::data, and _dba_msg_level::data_count.

dba_msg_datum dba_msg_level_find_by_id ( dba_msg_level  l,
int  id 
)

Find a datum given its shortcut ID.

Parameters:
l The level to query
id Shortcut ID of the value to set (see vars.h)
Returns:
The value found, or NULL if it was not found.

References _dba_msg_var::code, _dba_msg_var::p1, _dba_msg_var::p2, and _dba_msg_var::pind.

void dba_msg_level_print ( dba_msg_level  l,
FILE *  out 
)

Dump all the contents of the level to the given stream.

Parameters:
l The level to dump
out The stream to dump the contents of the level to.

References _dba_msg_level::data, _dba_msg_level::data_count, _dba_msg_level::l1, _dba_msg_level::l2, _dba_msg_level::ltype1, _dba_msg_level::ltype2, _dba_msg_datum::p1, _dba_msg_datum::p2, _dba_msg_datum::pind, and _dba_msg_datum::var.

dba_err dba_msg_level_set_nocopy ( dba_msg_level  l,
dba_var  var,
int  pind,
int  p1,
int  p2 
)

Add a dba_var to the level, taking over its memory management.

Parameters:
l The level to add the variable to.
var The variable to add.
pind Time range type indicator. See Time range values.
p1 Time range P1 indicator. See Time range values.
p2 Time range P2 indicator. See Time range values.
Returns:
The error indicator for the function (See error.h)

References _dba_msg_level::data, _dba_msg_level::data_alloc, _dba_msg_level::data_count, DBA_RUN_OR_RETURN, and _dba_msg_datum::var.


Generated on Wed Mar 11 09:52:07 2009 for libdballe by  doxygen 1.5.8