dirfile_add_cpolynom (3) Linux Manual Page
NAME
dirfile_add_bit, dirfile_add_clincom, dirfile_add_const, dirfile_add_cpolynom, dirfile_add_lincom, dirfile_add_linterp, dirfile_add_multiply, dirfile_add_phase, dirfile_add_polynom, dirfile_add_raw, dirfile_add_sbit, dirfile_add_string — add a field to a dirfile
SYNOPSIS
#include <getdata.h>
-
int dirfile_add_bit(DIRFILE *dirfile, const char *field_name,const char *in_field, gd_bit_tbitnum, gd_bit_tnumbits,intfragment_index);int dirfile_add_clincom(DIRFILE *dirfile, const char *field_name,intn_fields, const char **in_fields, const double complex *cm,const double complex *cb, intfragment_index);int dirfile_add_const(DIRFILE *dirfile, const char *field_name,gd_type_tconst_type, gd_type_tdata_type, void *value,intfragment_index);int dirfile_add_cpolynom(DIRFILE *dirfile, const char *field_name,intpoly_ord, const char *in_fields, const double complex *ca,intfragment_index );int dirfile_add_lincom(DIRFILE *dirfile, const char *field_name,intn_fields, const char **in_fields, const double *m,const double *b, intfragment_index);int dirfile_add_linterp(DIRFILE *dirfile, const char *field_name,const char *in_field, const char *table, intfragment_index);int dirfile_add_multiply(DIRFILE *dirfile, const char *field_name,const char *in_field1, const char *in_field2,intfragment_index);int dirfile_add_phase(DIRFILE *dirfile, const char *field_name,const char *in_field, gd_shift_tshift, intfragment_index);int dirfile_add_polynom(DIRFILE *dirfile, const char *field_name,intpoly_ord, const char *in_fields, const double *a,intfragment_index );int dirfile_add_raw(DIRFILE *dirfile, const char *field_name,gd_type_tdata_type, gd_spf_tspf, intfragment_index);int dirfile_add_sbit(DIRFILE *dirfile, const char *field_name,const char *in_field, gd_bit_tbitnum, gd_bit_tnumbits,intfragment_index);int dirfile_add_string(DIRFILE *dirfile, const char *field_name,const char *value, intfragment_index);
DESCRIPTION
dirfile_add(3) function to add a new field of the indicated type to the dirfile specified by dirfile. In all of these calls, field_name indicates the name of the field to be added. Further, fragment_index is the index of the format file fragment into which the field should be added. (To convert a fragment index to its file name, see get_fragmentname(3).) The meaning and valid types of other arguments may be obtained from the get_entry(3) and dirfile-format(5) manual pages.
The dirfile_add_clincom() and dirfile_add_cpolynom() functions are identical to dirfile_add_lincom() and dirfile_add_polynom(), except they take complex scalar parameters, instead of purely real values.
The dirfile_add_lincom() and dirfile_add_clincom() functions takes pointers to three arrays of length n_fields containing the input field names (in_fields), the gain factors (m or cm), and the offset terms (b or cb). Similarly, dirfile_add_polynom() and dirfile_add_cpolynom() take an array of length poly_ord + 1 containing the polynomial co-efficients (a or ca).
The dirfile_add_string() and dirfile_add_const() functions both add the field and set the value of the field to value. For dirfile_add_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.
The gd_bit_t type is a signed 16-bit integer type. The gd_shift_t type is a signed 64-bit integer type. The gd_spf_t type is an unsigned 16-bit integer type.
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_add(3) or dirfile_add_spec(3).
See NOTES below for information on using dirfile_add_clincom() and dirfile_add_cpolynom() in the C89 GetData API.
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.
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_INDEX- The fragment_index argument was out of range.
GD_E_BAD_TYPE- The data_type or const_type argument provided to
dirfile_add_raw() ordirfile_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. Or, the creation of a
RAWfield was attempted and the data of the fragment was protected. GD_E_RAW_IO- An I/O error occurred while creating an empty binary file to be associated with a newly added
RAWfield. GD_E_UNKNOWN_ENCODING- The encoding scheme of the specified format file fragment is not known to the library. As a result, the library was unable to create an empty binary file to be associated with a newly added
RAWfield. GD_E_UNSUPPORTED- The encoding scheme of the specified format file fragment does not support creating an empty binary file to be associated with a newly added
RAWfield. The dirfile error may be retrieved by callingget_error(3). A descriptive error string for the last error encountered can be obtained from a call toget_error_string(3).
NOTES
The C89 GetData API provides different prototypes for dirfile_add_clincom() and dirfile_add_cpolynom():
#define GETDATA_C89_API
#include <getdata.h>
int dirfile_add_clincom(DIRFILE *dirfile, const char *field_name,
int n_fields, const char **in_fields, const double *cm,
const double *cb, int fragment_index);
int dirfile_add_cpolynom(DIRFILE *dirfile, const char *field_name,
int poly_ord, const char *in_fields, const double *ca,
int fragment_index);
SEE ALSO
dirfile_add(3), dirfile_add_spec(3), dirfile_madd_bit(3), dirfile_madd_clincom(3), dirfile_madd_const(3), dirfile_madd_cpolynom(3), dirfile_madd_lincom(3), dirfile_madd_linterp(3), dirfile_madd_multiply(3), dirfile_madd_phase(3), dirfile_madd_polynom(3), dirfile_madd_sbit(3), dirfile_madd_string(3), dirfile_metaflush(3), dirfile_open(3), get_error(3), get_error_string(3), dirfile-format(5)
