| Main index | Section 3 | Options |
#include <form.h>void *field_arg(const FIELD *field); FIELDTYPE *field_type(const FIELD *field); int set_field_type(FIELD *field, FIELDTYPE *type, ...);
/* predefined field types */ FIELDTYPE *TYPE_ALNUM; FIELDTYPE *TYPE_ALPHA; FIELDTYPE *TYPE_ENUM; FIELDTYPE *TYPE_INTEGER; FIELDTYPE *TYPE_NUMERIC; FIELDTYPE *TYPE_REGEXP; FIELDTYPE *TYPE_IPV4;
Several field types are predefined by the form library.
See the form_fieldtype(3X) manual page, which describes functions which can be used to construct a field-type dynamically.
The predefined types are as follows:
| &#187; | a third int argument, a minimum field width. |
| &#187; | a third int argument, a minimum field width. |
| &#187; | a third (char **) argument pointing to a string list; |
| &#187; | a fourth int flag argument to enable case-sensitivity; |
| &#187; | a fifth int flag argument specifying whether a partial match must be a unique one. If this flag is off, a prefix matches the first of any set of more than one list elements with that prefix. |
| &#187; | a third int argument controlling the precision, |
| &#187; | a fourth long argument constraining minimum value, |
| &#187; | a fifth long constraining maximum value. If the maximum value is less than or equal to the minimum value, the range is simply ignored. |
For details of the precision handling see printf(3).
| &#187; | a third int argument controlling the precision, |
| &#187; | a fourth double argument constraining minimum value, |
| &#187; | and a fifth double constraining maximum value. If your system supports locales, the decimal point character must be the one specified by your locale. If the maximum value is less than or equal to the minimum value, the range is simply ignored. |
For details of the precision handling see printf(3).
| &#187; | a third argument, a regular expression (char *) string. The data is valid if the regular expression matches it. |
The regular expression must match the whole field. If you have for example, an eight character wide field, a regular expression "^[0-9]*$" always means that you have to fill all eight positions with digits. If you want to allow fewer digits, you may use for example "^[0-9]* *$" which is good for trailing spaces (up to an empty field), or "^ *[0-9]* *$" which is good for leading and trailing spaces around the digits.
| &#187; | none |
This is an ncurses extension; this field type may not be available in other curses implementations.
| E_OK | The routine succeeded. |
| E_SYSTEM_ERROR | |
| System error occurred (see errno(3)). | |
| 2024-03-16 | form_field_validation (3X) | ncurses 6.5 |
| Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
