Lines Matching defs:field

26 "	maximum field widths. The generated schema may be used as input for"
88 Field_t* field;
142 if (!(field = vmnewof(vm, 0, Field_t, 1, 0)))
148 field->variable = variable;
152 field->representation = FIELD_buffer;
155 field->representation = FIELD_string;
158 field->representation = FIELD_number;
161 if (field->width = variable->format.width)
163 field->flags = variable->format.flags;
164 dtinsert(state->fields, field);
166 else if (field->width = variable->type->format.width)
168 field->flags = variable->type->format.flags;
169 dtinsert(state->fields, field);
173 field->train = state->train;
174 state->train = field;
188 register Field_t* field;
191 for (field = state->train; field; field = field->train)
193 if (cxcast(cx, &arg, field->variable, field->variable->type, data, NiL))
195 if (field->representation == FIELD_number)
200 field->flags = CX_UNSIGNED;
202 if (field->max < arg.value.number)
203 field->max = arg.value.number;
205 else if (field->width < arg.value.buffer.size)
207 error(-1, "AHA fix_act %s.width %d arg.size %d", field->variable->name, field->width, arg.value.buffer.size);
208 field->width = arg.value.buffer.size;
218 register Field_t* field;
227 for (field = state->train; field; field = field->train)
229 if (field->representation == FIELD_number)
231 if (field->max != (Cxinteger_t)field->max)
233 field->width = 8;
234 field->flags = CX_FLOAT;
238 field->flags ^= CX_UNSIGNED|CX_INTEGER;
239 if (field->max > (unsigned long)0xffffffff)
240 field->width = 8;
241 else if (field->max > (unsigned long)0xffff)
242 field->width = 4;
244 field->width = 2;
249 if ((w = (field->width * 3) / 2) < 8)
253 error(-1, "AHA fix_end %s.width %d w %d", field->variable->name, field->width, w);
254 if (field->representation == FIELD_string)
255 field->width = w;
259 field->width = 4;
262 dtinsert(state->fields, field);
265 for (field = (Field_t*)dtfirst(state->fields); field; field = (Field_t*)dtnext(state->fields, field))
266 r += field->width;
302 for (field = (Field_t*)dtfirst(state->fields); field; field = (Field_t*)dtnext(state->fields, field))
305 sfprintf(expr->op, " <NAME>%s</>\n", field->variable->name);
306 sfprintf(expr->op, " <DESCRIPTION>%s</>\n", field->variable->description);
307 sfprintf(expr->op, " <TYPE>%s</>\n", field->variable->type->name);
309 switch (field->representation)
315 if (field->flags & CX_UNSIGNED)
317 else if (field->flags & CX_INTEGER)
323 sfprintf(expr->op, " <WIDTH>%d</>\n", field->width);