table of contents
other versions
- wheezy 0.7.3-6
- jessie 0.7.3-6+b2
- testing 0.9.4-1
- unstable 0.9.4-1
- experimental 0.10.0-1
gd_add_bit(3) | GETDATA | gd_add_bit(3) |
NAME¶
gd_add_bit, gd_add_carray gd_add_clincom, gd_add_const, gd_add_cpolynom, gd_add_crecip, gd_add_divide, gd_add_lincom, gd_add_linterp, gd_add_multiply, gd_add_phase, gd_add_polynom, gd_add_raw, gd_add_recip, gd_add_sbit, gd_add_string — add a field to a dirfileSYNOPSIS¶
#include <getdata.h>int
gd_add_bit(DIRFILE *dirfile, const char
*field_name, const char *in_field, gd_bit_t
bitnum, gd_bit_t numbits, int
fragment_index);
int
gd_add_carray(DIRFILE *dirfile, const char
*field_name, gd_type_t const_type, size_t
array_len, gd_type_t data_type, void
*value, int fragment_index);
int
gd_add_clincom(DIRFILE *dirfile, const char
*field_name, int n_fields, const char
**in_fields, const double complex *cm,
const double complex *cb, int
fragment_index);
int
gd_add_const(DIRFILE *dirfile, const char
*field_name, gd_type_t const_type,
gd_type_t data_type, void *value, int
fragment_index);
int
gd_add_cpolynom(DIRFILE *dirfile, const char
*field_name, int poly_ord, const char
*in_fields, const double complex *ca,
int fragment_index );
int
gd_add_crecip(DIRFILE *dirfile, const char
*field_name, const char *in_field, double
complex cdividend, int
fragment_index);
int
gd_add_divide(DIRFILE *dirfile, const char
*field_name, const char *in_field1, const
char *in_field2, int
fragment_index);
int
gd_add_lincom(DIRFILE *dirfile, const char
*field_name, int n_fields, const char
**in_fields, const double *m, const double
*b, int fragment_index);
int
gd_add_linterp(DIRFILE *dirfile, const char
*field_name, const char *in_field, const
char *table, int fragment_index);
int
gd_add_multiply(DIRFILE *dirfile, const char
*field_name, const char *in_field1, const
char *in_field2, int
fragment_index);
int
gd_add_phase(DIRFILE *dirfile, const char
*field_name, const char *in_field,
gd_shift_t shift, int fragment_index);
int
gd_add_polynom(DIRFILE *dirfile, const char
*field_name, int poly_ord, const char
*in_fields, const double *a, int
fragment_index );
int
gd_add_raw(DIRFILE *dirfile, const char
*field_name, gd_type_t data_type, gd_spf_t
spf, int fragment_index);
int
gd_add_recip(DIRFILE *dirfile, const char
*field_name, const char *in_field, double
dividend, int fragment_index);
int
gd_add_sbit(DIRFILE *dirfile, const char
*field_name, const char *in_field, gd_bit_t
bitnum, gd_bit_t numbits, int
fragment_index);
int
gd_add_string(DIRFILE *dirfile, const char
*field_name, const char *value, int
fragment_index);
DESCRIPTION¶
These functions provide alternatives to using the gd_add(3) or gd_add_spec(3) functions 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 specification fragment into which the field should be added. (To convert a fragment index to its file name, see gd_fragmentname(3).) The meaning and valid types of other arguments may be obtained from the gd_entry(3) and dirfile-format(5) manual pages.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 gd_add_raw() or gd_add_const(), was invalid.
- GD_E_BOUNDS
- The array_len parameter provided to gd_add_carray() was greater than GD_MAX_CARRAY_LENGTH.
- GD_E_DUPLICATE
- The field_name provided duplicated that of an already existing field.
- GD_E_INTERNAL_ERROR
- An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the GetData developers.
- GD_E_PROTECTED
- The metadata of the fragment was protected from change. Or, the creation of a RAW field 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 RAW field.
- GD_E_UNKNOWN_ENCODING
- The encoding scheme of the indicated format specification 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 RAW field.
- GD_E_UNSUPPORTED
- The encoding scheme of the indicated format specification fragment does not support creating an empty binary file to be associated with a newly added RAW field.
NOTES¶
GetData artifically limits the number of elements in a CARRAY to the value of the symbol GD_MAX_CARRAY_LENGTH defined in getdata.h. This is done to be certain that the CARRAY won't overrun the line when flushed to disk. On a 32-bit system, this number is 2**24. It is larger on a 64-bit system.#define GD_C89_API #include <getdata.h>
int gd_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 gd_add_cpolynom(DIRFILE *dirfile, const char *field_name, int poly_ord, const char *in_fields, const double *ca, int fragment_index );
int gd_add_crecip(DIRFILE *dirfile, const char *field_name, const char *in_field, double cdividend[2], int fragment_index);
SEE ALSO¶
gd_add(3), gd_add_spec(3), gd_error(3), gd_error_string(3), gd_madd_bit(3), gd_madd_carray(3), gd_madd_const(3), gd_madd_divide(3), gd_madd_lincom(3), gd_madd_linterp(3), gd_madd_multiply(3), gd_madd_phase(3), gd_madd_polynom(3), gd_madd_recip(3), gd_madd_sbit(3), gd_madd_string(3), gd_metaflush(3), gd_open(3), dirfile-format(5)3 November 2010 | Version 0.7.0 |