record.h File Reference


Detailed Description

Implement a storage object for a group of related observation data.

#include <dballe/core/error.h>
#include <dballe/core/var.h>

Go to the source code of this file.

Typedefs

typedef enum _dba_keyword dba_keyword
 Keyword used to quickly access context and query information from a record.
typedef struct _dba_record * dba_record
 Opaque structure representing a DBALLE record.
typedef struct _dba_item * dba_record_cursor
 Opaque structure representing a cursor used to iterate a dba_record.

Enumerations

enum  _dba_keyword {
  DBA_KEY_ERROR = -1, DBA_KEY_PRIORITY = 0, DBA_KEY_PRIOMAX = 1, DBA_KEY_PRIOMIN = 2,
  DBA_KEY_REP_COD = 3, DBA_KEY_REP_MEMO = 4, DBA_KEY_ANA_ID = 5, DBA_KEY_MOBILE = 6,
  DBA_KEY_IDENT = 7, DBA_KEY_LAT = 8, DBA_KEY_LON = 9, DBA_KEY_LATMAX = 10,
  DBA_KEY_LATMIN = 11, DBA_KEY_LONMAX = 12, DBA_KEY_LONMIN = 13, DBA_KEY_YEAR = 14,
  DBA_KEY_MONTH = 15, DBA_KEY_DAY = 16, DBA_KEY_HOUR = 17, DBA_KEY_MIN = 18,
  DBA_KEY_SEC = 19, DBA_KEY_YEARMAX = 20, DBA_KEY_YEARMIN = 21, DBA_KEY_MONTHMAX = 22,
  DBA_KEY_MONTHMIN = 23, DBA_KEY_DAYMAX = 24, DBA_KEY_DAYMIN = 25, DBA_KEY_HOURMAX = 26,
  DBA_KEY_HOURMIN = 27, DBA_KEY_MINUMAX = 28, DBA_KEY_MINUMIN = 29, DBA_KEY_SECMAX = 30,
  DBA_KEY_SECMIN = 31, DBA_KEY_LEVELTYPE1 = 32, DBA_KEY_L1 = 33, DBA_KEY_LEVELTYPE2 = 34,
  DBA_KEY_L2 = 35, DBA_KEY_PINDICATOR = 36, DBA_KEY_P1 = 37, DBA_KEY_P2 = 38,
  DBA_KEY_VAR = 39, DBA_KEY_VARLIST = 40, DBA_KEY_CONTEXT_ID = 41, DBA_KEY_QUERY = 42,
  DBA_KEY_ANA_FILTER = 43, DBA_KEY_DATA_FILTER = 44, DBA_KEY_ATTR_FILTER = 45, DBA_KEY_LIMIT = 46,
  DBA_KEY_VAR_RELATED = 47, DBA_KEY_COUNT = 48
}
 Keyword used to quickly access context and query information from a record.

Functions

const char * dba_record_keyword_name (dba_keyword keyword)
 Return the name of a dba_keyword.
dba_err dba_record_keyword_info (dba_keyword keyword, dba_varinfo *info)
 Return informations about a keyword.
dba_keyword dba_record_keyword_byname (const char *tag)
 Get the dba_keyword corresponding to the given name.
dba_keyword dba_record_keyword_byname_len (const char *tag, int len)
 Get the dba_keyword corresponding to the given name.
dba_err dba_record_create (dba_record *rec)
 Create a new record.
void dba_record_delete (dba_record rec)
 Delete an existing record, freeing all the resources used by it.
void dba_record_clear (dba_record rec)
 Remove all data from the record.
void dba_record_clear_vars (dba_record rec)
 Remove all variables from the record, leaving the keywords intact.
dba_err dba_record_copy (dba_record dest, dba_record source)
 Copy all data from the record source into dest.
dba_err dba_record_add (dba_record dest, dba_record source)
 Copy all data from the record source into dest.
dba_err dba_record_difference (dba_record dest, dba_record source1, dba_record source2)
 Copy in dest only those fields that change source1 into source2.
int dba_record_equals (dba_record rec1, dba_record rec2)
 Check if two records have the same content.
dba_var dba_record_key_peek (dba_record rec, dba_keyword parameter)
 Look at the value of a parameter, as dba_var.
dba_var dba_record_var_peek (dba_record rec, dba_varcode code)
 Look at the value of a parameter, as dba_var.
const char * dba_record_key_peek_value (dba_record rec, dba_keyword parameter)
 Look at the raw value of a keyword in the record, without raising errors.
const char * dba_record_var_peek_value (dba_record rec, dba_varcode code)
 Look at the raw value of a variable in the record, without raising errors.
dba_err dba_record_contains (dba_record rec, const char *name, int *found)
 Check if a keyword or value is set.
dba_err dba_record_contains_key (dba_record rec, dba_keyword parameter, int *found)
 Check if a keyword is set.
dba_err dba_record_contains_var (dba_record rec, dba_varcode code, int *found)
 Check if a variable is set.
dba_err dba_record_enq (dba_record rec, const char *name, dba_var *var)
 Get the value of an item, as dba_var.
dba_err dba_record_key_enq (dba_record rec, dba_keyword parameter, dba_var *var)
 Get the value of a parameter, as dba_var.
dba_err dba_record_var_enq (dba_record rec, dba_varcode code, dba_var *var)
 Get the value of a parameter, as dba_var.
dba_err dba_record_enqi (dba_record rec, const char *name, int *value, int *found)
 Get the value of an item, as an unscaled integer.
dba_err dba_record_key_enqi (dba_record rec, dba_keyword parameter, int *value, int *found)
 Get the value of a parameter, as an unscaled integer.
dba_err dba_record_var_enqi (dba_record rec, dba_varcode code, int *value, int *found)
 Get the value of a parameter, as an unscaled integer.
dba_err dba_record_enqd (dba_record rec, const char *name, double *value, int *found)
 Get the value of an item, correctly scaled, in double precision.
dba_err dba_record_key_enqd (dba_record rec, dba_keyword parameter, double *value, int *found)
 Get the value of a parameter, correctly scaled, in double precision.
dba_err dba_record_var_enqd (dba_record rec, dba_varcode code, double *value, int *found)
 Get the value of a parameter, correctly scaled, in double precision.
dba_err dba_record_enqc (dba_record rec, const char *name, const char **value)
 Get the value of an item.
dba_err dba_record_key_enqc (dba_record rec, dba_keyword parameter, const char **value)
 Get the value of a parameter.
dba_err dba_record_var_enqc (dba_record rec, dba_varcode code, const char **value)
 Get the value of a parameter.
dba_err dba_record_key_set (dba_record rec, dba_keyword parameter, dba_var var)
 Set the value of a parameter, from a dba_var.
dba_err dba_record_var_set (dba_record rec, dba_varcode code, dba_var var)
 Set the value of a parameter, from a dba_var.
dba_err dba_record_var_set_direct (dba_record rec, dba_var var)
 Set the value of a parameter, from a dba_var.
dba_err dba_record_set_ana_context (dba_record rec)
 Set the date, level and timerange values to match the anagraphical context.
dba_err dba_record_key_seti (dba_record rec, dba_keyword parameter, int value)
 Set the value of a parameter.
dba_err dba_record_var_seti (dba_record rec, dba_varcode code, int value)
 Set the value of a parameter.
dba_err dba_record_key_setd (dba_record rec, dba_keyword parameter, double value)
 Set the value of a parameter, in double precision.
dba_err dba_record_var_setd (dba_record rec, dba_varcode code, double value)
 Set the value of a parameter, in double precision.
dba_err dba_record_key_setc (dba_record rec, dba_keyword parameter, const char *value)
 Set the value of a parameter.
dba_err dba_record_var_setc (dba_record rec, dba_varcode code, const char *value)
 Set the value of a parameter.
dba_err dba_record_set_from_string (dba_record rec, const char *str)
 Set a value in the record according to an assignment encoded in a string.
dba_err dba_record_key_unset (dba_record rec, dba_keyword parameter)
 Remove a parameter from the record.
dba_err dba_record_var_unset (dba_record rec, dba_varcode code)
 Remove a parameter from the record.
void dba_record_print (dba_record rec, FILE *out)
 Print the contents of this record to the given file descriptor.
void dba_record_diff (dba_record rec1, dba_record rec2, int *diffs, FILE *out)
 Print the difference between two records to an output stream.
dba_record_cursor dba_record_iterate_first (dba_record rec)
 Start iterating through the values in a record.
dba_record_cursor dba_record_iterate_next (dba_record rec, dba_record_cursor cur)
 Continue iterating through the values in a record.
dba_var dba_record_cursor_variable (dba_record_cursor cur)
 Get the variable pointed by a dba_record_cursor.
dba_err dba_record_parse_date_extremes (dba_record rec, int *minvalues, int *maxvalues)
 Parse the date extremes set in the dba_record.


Typedef Documentation

typedef struct _dba_record* dba_record

Opaque structure representing a DBALLE record.

A DBALLE record is a container for one observation of meteorological value, that includes anagraphical informations, physical location of the observation in time and space, and all the observed variables.

This object is created with dba_record_create() and deleted with dba_record_delete().

typedef struct _dba_item* dba_record_cursor

Opaque structure representing a cursor used to iterate a dba_record.

This object is a pointer to internal structures that does not need to be explicitly created or deallocated.


Function Documentation

dba_err dba_record_add ( dba_record  dest,
dba_record  source 
)

Copy all data from the record source into dest.

At the end of the function, dest will contain its previous values, plus the values in source. If a value is present both in source and in dest, the one in dest will be overwritten.

Parameters:
dest The record to copy data into.
source The record to copy data from.
Returns:
The error indicator for the function.

References DBA_RUN_OR_RETURN.

void dba_record_clear ( dba_record  rec  ) 

Remove all data from the record.

Parameters:
rec The record to empty.

void dba_record_clear_vars ( dba_record  rec  ) 

Remove all variables from the record, leaving the keywords intact.

Parameters:
rec The record to operate on.

dba_err dba_record_contains ( dba_record  rec,
const char *  name,
int *  found 
)

Check if a keyword or value is set.

Parameters:
rec The record to get the value from.
name The name of the item to check.
Return values:
found true if the record contains a value for the parameter, else false.
Returns:
The error indicator for the function (See error.h).

References dba_error_notfound, dba_record_keyword_byname(), and DBA_STRING_TO_VAR.

dba_err dba_record_contains_key ( dba_record  rec,
dba_keyword  parameter,
int *  found 
)

Check if a keyword is set.

Parameters:
rec The record to get the value from.
parameter The key to check.
Return values:
found true if the record contains a value for the parameter, else false.
Returns:
The error indicator for the function (See error.h).

References dba_error_notfound.

dba_err dba_record_contains_var ( dba_record  rec,
dba_varcode  code,
int *  found 
)

Check if a variable is set.

Parameters:
rec The record to get the value from.
code The variable to check.
Return values:
found true if the record contains a value for the parameter, else false.
Returns:
The error indicator for the function (See error.h).

dba_err dba_record_copy ( dba_record  dest,
dba_record  source 
)

Copy all data from the record source into dest.

At the end of the function, dest will contain the same data as source.

Parameters:
dest The record to copy data into.
source The record to copy data from.
Returns:
The error indicator for the function.

References DBA_RUN_OR_RETURN.

dba_err dba_record_create ( dba_record rec  ) 

Create a new record.

Return values:
rec The record variable to initialize.
Returns:
The error indicator for the function.

dba_var dba_record_cursor_variable ( dba_record_cursor  cur  ) 

Get the variable pointed by a dba_record_cursor.

Parameters:
cur The cursor returned by dba_record_iterate_first or dba_record_iterate_next
Returns:
The variable pointed by the cursor

void dba_record_delete ( dba_record  rec  ) 

Delete an existing record, freeing all the resources used by it.

Parameters:
rec The record to delete.

void dba_record_diff ( dba_record  rec1,
dba_record  rec2,
int *  diffs,
FILE *  out 
)

Print the difference between two records to an output stream.

If there is no difference, it does not print anything.

Parameters:
rec1 The first record to compare
rec2 The second record to compare
Return values:
diffs Incremented by 1 if the variables differ
Parameters:
out The output stream to use for printing

References DBA_VAR_F, DBA_VAR_X, and DBA_VAR_Y.

dba_err dba_record_difference ( dba_record  dest,
dba_record  source1,
dba_record  source2 
)

Copy in dest only those fields that change source1 into source2.

If a field has been deleted from source1 to source2, it will not be copied in dest.

Parameters:
dest The record to copy data into.
source1 The original record to compute the changes from.
source2 The new record that has changes over source1.
Returns:
The error indicator for the function.

References DBA_RUN_OR_RETURN.

dba_err dba_record_enq ( dba_record  rec,
const char *  name,
dba_var var 
)

Get the value of an item, as dba_var.

Parameters:
rec The record to get the value from.
name The name of the item to get the value for.
Return values:
var A copy of the internal dba_var with the parameter. You need to deallocate it with dba_var_delete().
Returns:
The error indicator for the function (See error.h).

References dba_error_notfound, dba_record_keyword_byname(), DBA_RUN_OR_RETURN, and DBA_STRING_TO_VAR.

dba_err dba_record_enqc ( dba_record  rec,
const char *  name,
const char **  value 
)

Get the value of an item.

The function will return a string representation of the uncaled number if the value is a number instead of a string.

Parameters:
rec The record to get the value from.
name The name of the item to get the value for.
Return values:
value The variable where the value, if found, should be stored. It will be set to NULL if the value is unset.
Returns:
The error indicator for the function.

References DBA_RUN_OR_RETURN.

dba_err dba_record_enqd ( dba_record  rec,
const char *  name,
double *  value,
int *  found 
)

Get the value of an item, correctly scaled, in double precision.

The function will fail if the value is a string instead of a number.

Parameters:
rec The record to get the value from.
name The name of the item to get the value for.
Return values:
value The variable where the value, if found, should be stored.
found 1 if the value is set, 0 otherwise.
Returns:
The error indicator for the function.

References DBA_RUN_OR_RETURN.

dba_err dba_record_enqi ( dba_record  rec,
const char *  name,
int *  value,
int *  found 
)

Get the value of an item, as an unscaled integer.

The function will fail if the value is a string instead of a number.

Parameters:
rec The record to get the value from.
name The name of the item to get the value for.
Return values:
value The variable where the value, if found, should be stored.
found 1 if the value is set, 0 otherwise.
Returns:
The error indicator for the function.

References DBA_RUN_OR_RETURN.

int dba_record_equals ( dba_record  rec1,
dba_record  rec2 
)

Check if two records have the same content.

Parameters:
rec1 The first record to compare
rec2 The second record to compare
Returns:
1 if the two records have the same contents, else 0

dba_record_cursor dba_record_iterate_first ( dba_record  rec  ) 

Start iterating through the values in a record.

Parameters:
rec The record to iterate on.
Returns:
The cursor pointing to the first item in the record, or NULL if the record is empty.

dba_record_cursor dba_record_iterate_next ( dba_record  rec,
dba_record_cursor  cur 
)

Continue iterating through the values in a record.

Parameters:
rec The record to iterate on.
cur The cursor returned by dba_record_iterate_first or dba_record_iterate_next
Returns:
The cursor pointing to the next item in the record, or NULL if there are no more items.

dba_err dba_record_key_enq ( dba_record  rec,
dba_keyword  parameter,
dba_var var 
)

Get the value of a parameter, as dba_var.

Parameters:
rec The record to get the value from.
parameter The parameter to get the value for.
Return values:
var A copy of the internal dba_var with the parameter. You need to deallocate it with dba_var_delete().
Returns:
The error indicator for the function (See error.h).

References DBA_RUN_OR_RETURN.

dba_err dba_record_key_enqc ( dba_record  rec,
dba_keyword  parameter,
const char **  value 
)

Get the value of a parameter.

The function will return a string representation of the uncaled number if the value is a number instead of a string.

Parameters:
rec The record to get the value from.
parameter The parameter to get the value for.
Return values:
value The variable where the value, if found, should be stored. It will be set to NULL if the value is unset.
Returns:
The error indicator for the function.

References DBA_RUN_OR_RETURN.

dba_err dba_record_key_enqd ( dba_record  rec,
dba_keyword  parameter,
double *  value,
int *  found 
)

Get the value of a parameter, correctly scaled, in double precision.

The function will fail if the value is a string instead of a number.

Parameters:
rec The record to get the value from.
parameter The parameter to get the value for.
Return values:
value The variable where the value, if found, should be stored.
found 1 if the value is set, 0 otherwise.
Returns:
The error indicator for the function.

References DBA_RUN_OR_RETURN.

dba_err dba_record_key_enqi ( dba_record  rec,
dba_keyword  parameter,
int *  value,
int *  found 
)

Get the value of a parameter, as an unscaled integer.

The function will fail if the value is a string instead of a number.

Parameters:
rec The record to get the value from.
parameter The parameter to get the value for.
Return values:
value The variable where the value, if found, should be stored.
found 1 if the value is set, 0 otherwise.
Returns:
The error indicator for the function.

References DBA_RUN_OR_RETURN.

dba_var dba_record_key_peek ( dba_record  rec,
dba_keyword  parameter 
)

Look at the value of a parameter, as dba_var.

Parameters:
rec The record to get the value from.
parameter The parameter to get the value for.
Returns:
A const pointer to the internal variable, or NULL if the variable has not been found.

const char* dba_record_key_peek_value ( dba_record  rec,
dba_keyword  parameter 
)

Look at the raw value of a keyword in the record, without raising errors.

Deprecated:
This function is not to be considered a stable part of the API, but it is used by higher level to have a value lookup function that does not trigger error callbacks if nothing is found.
Parameters:
rec The record to get the value from.
parameter The keyword to get the value for.
Returns:
The raw string value, or NULL if the keyword has no value.

dba_err dba_record_key_set ( dba_record  rec,
dba_keyword  parameter,
dba_var  var 
)

Set the value of a parameter, from a dba_var.

If dba_var has a value for a different parameter, it will be converted.

Parameters:
rec The record where the value is to be set.
parameter The parameter to set the value for. It can be the code of a WMO variable prefixed by "B" (such as "B01023") or a keyword among the ones defined in Keywords used by dba_record
var A the dba_var with the parameter which will be copied inside the record. The record will copy the variable and will not take ownership of it: memory management will remain in charge of the caller.
Returns:
The error indicator for the function (See error.h).

References dba_error_notfound, and DBA_RUN_OR_RETURN.

dba_err dba_record_key_setc ( dba_record  rec,
dba_keyword  parameter,
const char *  value 
)

Set the value of a parameter.

Parameters:
rec The record where the value is to be set.
parameter The parameter to set the value for.
value The value to set. If the parameter is numeric, value will be taken as a string representing the unscaled integer with the value.
Returns:
The error indicator for the function.

References dba_error_notfound.

dba_err dba_record_key_setd ( dba_record  rec,
dba_keyword  parameter,
double  value 
)

Set the value of a parameter, in double precision.

The function will fail if the keyword is a string instead of a number.

Parameters:
rec The record where the value is to be set.
parameter The parameter to set the value for.
value The value to set.
Returns:
The error indicator for the function.

References dba_error_notfound.

dba_err dba_record_key_seti ( dba_record  rec,
dba_keyword  parameter,
int  value 
)

Set the value of a parameter.

The function will fail if the keyword is a string instead of a number.

Parameters:
rec The record where the value is to be set.
parameter The parameter to set the value for.
value The value to set, as an unscaled integer.
Returns:
The error indicator for the function.

References dba_error_notfound.

dba_err dba_record_key_unset ( dba_record  rec,
dba_keyword  parameter 
)

Remove a parameter from the record.

Parameters:
rec The record where the value is to be set.
parameter The parameter to remove.
Returns:
The error indicator for the function.

References dba_error_notfound.

dba_keyword dba_record_keyword_byname ( const char *  tag  ) 

Get the dba_keyword corresponding to the given name.

Parameters:
tag The name to query.
Returns:
The corresponding dba_keyword, or DBA_KEY_ERROR if tag does not match a valid keyword.

References dba_record_keyword_byname().

Referenced by dba_record_contains(), dba_record_enq(), and dba_record_keyword_byname().

dba_keyword dba_record_keyword_byname_len ( const char *  tag,
int  len 
)

Get the dba_keyword corresponding to the given name.

Parameters:
tag The name to query.
len The length of the name in tag.
Returns:
The corresponding dba_keyword, or DBA_KEY_ERROR if tag does not match a valid keyword.

References dba_record_keyword_byname_len().

Referenced by dba_record_keyword_byname_len(), and dba_record_set_from_string().

dba_err dba_record_keyword_info ( dba_keyword  keyword,
dba_varinfo info 
)

Return informations about a keyword.

Parameters:
keyword The keyword to look for informations about
Return values:
info The dba_varinfo structure with the informations.
Returns:
The error indicator for the function. See error.h

References dba_error_notfound.

const char* dba_record_keyword_name ( dba_keyword  keyword  ) 

Return the name of a dba_keyword.

Parameters:
keyword The keyword to get the name for
Returns:
The keyword name, or NULL if keyword is not a valid keyword

References dba_record_keyword_name().

Referenced by dba_record_keyword_name().

dba_err dba_record_parse_date_extremes ( dba_record  rec,
int *  minvalues,
int *  maxvalues 
)

Parse the date extremes set in the dba_record.

This function will examine the values yearmin, monthmin, daymin, hourmin, minumin, secmin, yearmax, monthmax, daymax, hourmax, minumax, secmax, year, month, day, hour, min and sec, and will compute the two datetime extremes that bound the interval they represent.

Parameters:
rec The record that holds the datetime specifications
Return values:
minvalues An array of 6 integers that will be filled with the minimum year, month, day, hour, minute and seconds.
maxvalues An array of 6 integers that will be filled with the maximum year, month, day, hour, minute and seconds.
Returns:
The error indicator for the function. See error.h

References dba_error_consistency, and _dba_varinfo::desc.

void dba_record_print ( dba_record  rec,
FILE *  out 
)

Print the contents of this record to the given file descriptor.

Parameters:
rec The record to print
out The output file descriptor

dba_err dba_record_set_ana_context ( dba_record  rec  ) 

Set the date, level and timerange values to match the anagraphical context.

Parameters:
rec The record where the value is to be set.
Returns:
The error indicator for the function (See error.h).

References DBA_RUN_OR_RETURN.

dba_err dba_record_set_from_string ( dba_record  rec,
const char *  str 
)

Set a value in the record according to an assignment encoded in a string.

String can use keywords, aliases and varcodes. Examples: ana_id=3, name=Bologna, B12012=32.4

Parameters:
rec The record where the value is to be set.
str The string containing the assignment.
Returns:
The error indicator for the function.

References dba_error_consistency, dba_error_notfound, dba_record_keyword_byname_len(), DBA_RUN_OR_RETURN, DBA_STRING_TO_VAR, and _dba_varinfo::is_string.

dba_err dba_record_var_enq ( dba_record  rec,
dba_varcode  code,
dba_var var 
)

Get the value of a parameter, as dba_var.

Parameters:
rec The record to get the value from.
code The variable to get the value for. See vartable.h
Return values:
var A copy of the internal dba_var with the parameter. You need to deallocate it with dba_var_delete().
Returns:
The error indicator for the function (See error.h).

References DBA_RUN_OR_RETURN.

dba_err dba_record_var_enqc ( dba_record  rec,
dba_varcode  code,
const char **  value 
)

Get the value of a parameter.

The function will return a string representation of the uncaled number if the value is a number instead of a string.

Parameters:
rec The record to get the value from.
code The variable to get the value for. See vartable.h
Return values:
value The variable where the value, if found, should be stored. It will be set to NULL if the value is unset.
Returns:
The error indicator for the function.

References DBA_RUN_OR_RETURN.

dba_err dba_record_var_enqd ( dba_record  rec,
dba_varcode  code,
double *  value,
int *  found 
)

Get the value of a parameter, correctly scaled, in double precision.

The function will fail if the value is a string instead of a number.

Parameters:
rec The record to get the value from.
code The variable to get the value for. See vartable.h
Return values:
value The variable where the value, if found, should be stored.
found 1 if the value is set, 0 otherwise.
Returns:
The error indicator for the function.

References DBA_RUN_OR_RETURN.

dba_err dba_record_var_enqi ( dba_record  rec,
dba_varcode  code,
int *  value,
int *  found 
)

Get the value of a parameter, as an unscaled integer.

The function will fail if the value is a string instead of a number.

Parameters:
rec The record to get the value from.
code The variable to get the value for. See vartable.h
Return values:
value The variable where the value, if found, should be stored.
found 1 if the value is set, 0 otherwise.
Returns:
The error indicator for the function.

References DBA_RUN_OR_RETURN.

dba_var dba_record_var_peek ( dba_record  rec,
dba_varcode  code 
)

Look at the value of a parameter, as dba_var.

Parameters:
rec The record to get the value from.
code The variable to get the value for. See vartable.h
Returns:
A const pointer to the internal variable, or NULL if the variable has not been found.

const char* dba_record_var_peek_value ( dba_record  rec,
dba_varcode  code 
)

Look at the raw value of a variable in the record, without raising errors.

Deprecated:
This function is not to be considered a stable part of the API, but it is used by higher level to have a value lookup function that does not trigger error callbacks if nothing is found.
Parameters:
rec The record to get the value from.
code The variable to get the value for. See vartable.h
Returns:
The raw string value, or NULL if the variable has no value.

dba_err dba_record_var_set ( dba_record  rec,
dba_varcode  code,
dba_var  var 
)

Set the value of a parameter, from a dba_var.

If dba_var has a value for a different parameter, it will be converted.

Parameters:
rec The record where the value is to be set.
code The variable to set the value for. See vartable.h
var A the dba_var with the parameter which will be copied inside the record. The record will copy the variable and will not take ownership of it: memory management will remain in charge of the caller.
Returns:
The error indicator for the function (See error.h).

References DBA_RUN_OR_GOTO.

dba_err dba_record_var_set_direct ( dba_record  rec,
dba_var  var 
)

Set the value of a parameter, from a dba_var.

Parameters:
rec The record where the value is to be set.
var A the dba_var with the parameter which will be copied inside the record. The record will copy the variable and will not take ownership of it: memory management will remain in charge of the caller.
Returns:
The error indicator for the function (See error.h).

References DBA_RUN_OR_RETURN.

dba_err dba_record_var_setc ( dba_record  rec,
dba_varcode  code,
const char *  value 
)

Set the value of a parameter.

Parameters:
rec The record where the value is to be set.
code The variable to set the value for. See vartable.h
value The value to set. If the parameter is numeric, value will be taken as a string representing the unscaled integer with the value.
Returns:
The error indicator for the function.

References DBA_RUN_OR_GOTO, and DBA_RUN_OR_RETURN.

dba_err dba_record_var_setd ( dba_record  rec,
dba_varcode  code,
double  value 
)

Set the value of a parameter, in double precision.

The function will fail if the variable is a string instead of a number.

Parameters:
rec The record where the value is to be set.
code The variable to set the value for. See vartable.h
value The value to set.
Returns:
The error indicator for the function.

References DBA_RUN_OR_GOTO, and DBA_RUN_OR_RETURN.

dba_err dba_record_var_seti ( dba_record  rec,
dba_varcode  code,
int  value 
)

Set the value of a parameter.

The function will fail if the variable is a string instead of a number.

Parameters:
rec The record where the value is to be set.
code The variable to set the value for. See vartable.h
value The value to set, as an unscaled integer.
Returns:
The error indicator for the function.

References DBA_RUN_OR_GOTO, and DBA_RUN_OR_RETURN.

dba_err dba_record_var_unset ( dba_record  rec,
dba_varcode  code 
)

Remove a parameter from the record.

Parameters:
rec The record where the value is to be set.
code The variable to remove. See vartable.h
Returns:
The error indicator for the function.


Generated on Sun May 18 20:42:42 2008 for libdballe by  doxygen 1.5.5