Logo Search packages:      
Sourcecode: dballe version File versions

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.

Definition at line 729 of file dba_record.c.

References dba_error_notfound.

{
      assert_is_dba_record(rec);

      if (parameter < 0 || parameter >= DBA_KEY_COUNT)
            return dba_error_notfound("keyword #%d is not in the range of valid keywords", parameter);

      if (rec->keydata[parameter] != NULL)
            return dba_var_setc(rec->keydata[parameter], value);
      else
            return dba_var_createc(dba_record_keyword_byindex(parameter), value, &(rec->keydata[parameter]));
}


Generated by  Doxygen 1.6.0   Back to index