1dirfile_madd_bit(3) GETDATA dirfile_madd_bit(3)
2
3
4
6 dirfile_madd_bit, dirfile_madd_clincom, dirfile_madd_const,
7 dirfile_madd_cpolynom, dirfile_madd_lincom, dirfile_madd_linterp,
8 dirfile_madd_multiply, dirfile_madd_phase, dirfile_madd_polynom,
9 dirfile_madd_bit, dirfile_madd_string — add a field to a dirfile
10
12 #include <getdata.h>
13
14 int dirfile_madd_bit(DIRFILE *dirfile, const char *parent, const char
15 *field_name, const char *in_field, gd_bit_t bitnum, gd_bit_t
16 numbits);
17
18 int dirfile_madd_clincom(DIRFILE *dirfile, const char *parent, const
19 char *field_name, int n_fields, const char **in_fields, const
20 double complex *cm, const double complex *cb);
21
22 int dirfile_madd_const(DIRFILE *dirfile, const char *parent, const char
23 *field_name, gd_type_t const_type, gd_type_t data_type, void
24 *value);
25
26 int dirfile_madd_cpolynom(DIRFILE *dirfile, const char *parent, const
27 char *field_name, int poly_ord, const char *in_field, const
28 double complex *ca);
29
30 int dirfile_madd_lincom(DIRFILE *dirfile, const char *parent, const
31 char *field_name, int n_fields, const char **in_fields, const
32 double *m, const double *b);
33
34 int dirfile_madd_linterp(DIRFILE *dirfile, const char *parent, const
35 char *field_name, const char *in_field, const char *table);
36
37 int dirfile_madd_multiply(DIRFILE *dirfile, const char *parent, const
38 char *field_name, const char *in_field1, const char
39 *in_field2);
40
41 int dirfile_madd_polynom(DIRFILE *dirfile, const char *parent, const
42 char *field_name, int poly_ord, const char *in_field, const
43 double *a);
44
45 int dirfile_madd_phase(DIRFILE *dirfile, const char *parent, const char
46 *field_name, const char *in_field, gd_shift_t shift);
47
48 int dirfile_madd_sbit(DIRFILE *dirfile, const char *parent, const char
49 *field_name, const char *in_field, gd_bit_t bitnum, gd_bit_t
50 numbits);
51
52 int dirfile_madd_string(DIRFILE *dirfile, const char *parent, const
53 char *field_name, const char *value);
54
56 These functions provide alternatives to using the dirfile_madd() func‐
57 tion to add a new metafield of the indicated type under the parent
58 field given by parent in the dirfile specified by dirfile.
59
60 In all of these calls, field_name indicates the name of the field to be
61 added. It should not be the full <parent-field>/<meta-field> field
62 code. The meaning and valid types of other arguments may be obtained
63 from the get_entry(3) and dirfile-format(5) manual pages.
64
65 The dirfile_madd_clincom() and dirfile_madd_cpolynom() functions are
66 identical to dirfile_madd_lincom() and dirfile_madd_polynom(), except
67 they take complex scalar parameters, instead of purely real values.
68
69 The dirfile_madd_lincom() and dirfile_madd_clincom() functions take
70 pointers to three arrays of length n_fields containing the input field
71 names (in_fields), the gain factors (m or cm), and the offset terms (b
72 or cb). Similarly, dirfile_madd_polynom() and dirfile_madd_cpolynom()
73 take an array of length poly_ord + 1 containing the polynomial co-effi‐
74 cients (a or ca).
75
76 The dirfile_madd_string() and dirfile_madd_const() functions both add
77 the field and set the value of the field to value. For
78 dirfile_madd_const(), the const_type argument specifies the storage
79 type for the const, while data_type specifies the data type of the val‐
80 ue pointed to by value.
81
82 The gd_bit_t type is a signed 16-bit integer type. The gd_shift_t type
83 is a signed 64-bit integer type.
84
85 All fields added with this interface must contain numerical parameters.
86 Fields with CONST fields as parameters cannot be added with these func‐
87 tions. Those fields must be added with dirfile_madd(3) or
88 dirfile_madd_spec(3).
89
90 See NOTES below for information on using dirfile_madd_clincom() and
91 dirfile_madd_cpolynom() in the C89 GetData API.
92
93
95 On success, any of these functions returns zero. On error, -1 is re‐
96 turned and the dirfile error is set to a non-zero error value. Possi‐
97 ble error values are:
98
99 GD_E_ACCMODE
100 The specified dirfile was opened read-only.
101
102 GD_E_ALLOC
103 The library was unable to allocate memory.
104
105 GD_E_BAD_CODE
106 The field_name argument contained invalid characters. Alter‐
107 nately, the parent field code was not found, or was already a
108 metafield.
109
110 GD_E_BAD_DIRFILE
111 The supplied dirfile was invalid.
112
113 GD_E_BAD_ENTRY
114 One or more of the field parameters specified was invalid.
115
116 GD_E_BAD_TYPE
117 The data_type or const_type argument provided to
118 dirfile_madd_const(), was invalid.
119
120 GD_E_DUPLICATE
121 The field_name provided duplicated that of an already existing
122 field.
123
124 GD_E_PROTECTED
125 The metadata of the fragment was protected from change.
126
127 The dirfile error may be retrieved by calling get_error(3). A descrip‐
128 tive error string for the last error encountered can be obtained from a
129 call to get_error_string(3).
130
131
133 The C89 GetData API provides different prototypes for
134 dirfile_madd_clincom() and dirfile_madd_cpolynom():
135
136 #define GETDATA_C89_API
137 #include <getdata.h>
138
139 int dirfile_madd_clincom(DIRFILE *dirfile, const char *parent,
140 const char *field_name, int n_fields, const char **in_fields,
141 const double *cm, const double *cb);
142
143 int dirfile_madd_cpolynom(DIRFILE *dirfile, const char *parent,
144 const char *field_name, int poly_ord, const char *in_field,
145 const double *ca);
146
147 In this case, the array pointers passed as cm, cb or ca should have
148 twice as many (purely real) elements, consisting of alternating real
149 and imaginary parts for the complex data. For example, ca[0] should be
150 the real part of the first co-efficient, ca[1] the imaginary part of
151 the first co-efficient, ca[2] the real part of the second co-efficient,
152 ca[3] the imaginary part of the second co-efficient, and so on.
153
154
156 dirfile_add_bit(3), dirfile_add_const(3), dirfile_add_lincom(3),
157 dirfile_add_linterp(3), dirfile_add_multiply(3), dirfile_add_phase(3),
158 dirfile_add_string(3), dirfile_madd(3), dirfile_madd_spec(3),
159 dirfile_metaflush(3), dirfile_open(3), get_error(3), get_er‐
160 ror_string(3), dirfile-format(5)
161
162
163
164Version 0.6.0 2 November 2009 dirfile_madd_bit(3)