Lines Matching defs:constraint
138 Cxconstraint_t* constraint;
208 if (variable->format.constraint || variable->format.map)
232 if (constraint = field->variable->format.constraint)
234 if (constraint->name)
235 sfprintf(expr->op, " name=%s", constraint->name);
236 if (constraint->constraintf)
240 if (constraint->def)
241 number(expr->op, "default", constraint->def->number, &field->variable->format);
242 if (constraint->min)
243 number(expr->op, "min", constraint->min->number, &field->variable->format);
244 if (constraint->max)
245 number(expr->op, "max", constraint->max->number, &field->variable->format);
247 else if (cxisstring(field->variable->type) && constraint->def)
248 sfprintf(expr->op, " default=\"%-.*s\"", constraint->def->string.size, constraint->def->string.data);
249 if (constraint->expression)
250 sfprintf(expr->op, " expression=\"%s\"", constraint->expression);
251 if (constraint->pattern)
252 sfprintf(expr->op, " pattern=\"%s\"", constraint->pattern);
286 register Cxconstraint_t*constraint;
319 if (constraint = field->variable->format.constraint)
321 if (constraint->constraintf)
325 if (constraint->min && o.value.number < constraint->min->number)
328 (*disc->errorf)(NiL, disc, 1, "%s%s: %1.15Lg violates min constraint %1.15Lg", cxlocation(cx, data), field->variable->name, o.value.number, constraint->min->number);
331 if (constraint->max && o.value.number > constraint->max->number)
334 (*disc->errorf)(NiL, disc, 1, "%s%s: %1.15Lg violates max constraint %1.15Lg", cxlocation(cx, data), field->variable->name, o.value.number, constraint->max->number);
338 if (constraint->expression)
340 if (constraint->pattern)
370 if (state->setf && constraint && constraint->def)
373 o.value = *constraint->def;