dirfile_add_linterp

Langue: en

Autres versions - même langue

Version: 19 December 2008 (fedora - 05/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

dirfile_madd_bit, dirfile_madd_const, dirfile_madd_lincom, dirfile_madd_linterp, dirfile_madd_multiply, dirfile_madd_phase, dirfile_madd_string --- add a field to a dirfile

SYNOPSIS

#include <getdata.h>
int dirfile_madd_bit(DIRFILE *dirfile, const char *parent, const char *field_name, const char *in_field, int bitnum, int numbits);
int dirfile_madd_const(DIRFILE *dirfile, const char *parent, const char *field_name, gd_type_t const_type, gd_type_t data_type, void *value);
int dirfile_madd_lincom(DIRFILE *dirfile, const char *parent, const char *field_name, int n_fields, const char **in_fields, const double *m, const double *b);
int dirfile_madd_linterp(DIRFILE *dirfile, const char *parent, const char *field_name, const char *in_field, const char *table);
int dirfile_madd_multiply(DIRFILE *dirfile, const char *parent, const char *field_name, const char *in_field1, const char *in_field2);
int dirfile_madd_phase(DIRFILE *dirfile, const char *parent, const char *field_name, const char *in_field, int phase);
int dirfile_madd_string(DIRFILE *dirfile, const char *parent, const char *field_name, const char *value);

DESCRIPTION

These functions provide alternatives to using the dirfile_madd() function to add a new metafield of the indicated type under the parent field given by parent in the dirfile specified by dirfile.

In all of these calls, field_name indicates the name of the field to be added. It should not be the full <parent-field>/<meta-field> field code. The meaning and valid types of other arguments may be obtained from the get_entry(3) and dirfile-format(5) manual pages.

The dirfile_madd_lincom() function takes pointers to three arrays of length n_fields containing the input field names (in_fields), the gain factors (m), and the offset terms (b).

The dirfile_madd_string() and dirfile_madd_const() functions both add the field and set the value of the field to value. For dirfile_madd_const(), the const_type argument specifies the storage type for the const, while data_type specifies the data type of the value pointed to by value.

All fields added with this interface must contain numerical parameters. Fields with CONST fields as parameters cannot be added with these functions. Those fields must be added with dirfile_madd_spec(3).

RETURN VALUE

On success, any of these functions returns zero. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are:
GD_E_ACCMODE
The specified dirfile was opened read-only.
GD_E_ALLOC
The library was unable to allocate memory.
GD_E_BAD_CODE
The field_name argument contained invalid characters. Alternately, the parent field code was not found, or was already a metafield.
GD_E_BAD_DIRFILE
The supplied dirfile was invalid.
GD_E_BAD_ENTRY
One or more of the field parameters specified was invalid.
GD_E_BAD_TYPE
The data_type or const_type argument provided to dirfile_add_const(), was invalid.
GD_E_DUPLICATE
The field_name provided duplicated that of an already existing field.
GD_E_PROTECTED
The metadata of the fragment was protected from change.

The dirfile error may be retrieved by calling get_error(3). A descriptive error string for the last error encountered can be obtained from a call to get_error_string(3).

SEE ALSO

dirfile_add_bit(3), dirfile_add_const(3), dirfile_add_lincom(3), dirfile_add_linterp(3), dirfile_add_multiply(3), dirfile_add_phase(3), dirfile_add_string(3), dirfile_madd(3), dirfile_madd_spec(3), dirfile_metaflush(3), dirfile_open(3), get_error(3), get_error_string(3), dirfile-format(5)