| Main index | Section 3 | Options |
#include <form.h>FIELDTYPE *new_fieldtype( bool (* const field_check)(FIELD *, const void *), bool (* const char_check)(int, const void *)); int free_fieldtype(FIELDTYPE *fieldtype);
int set_fieldtype_arg( FIELDTYPE *fieldtype, void *(* const make_arg)(va_list *), void *(* const copy_arg)(const void *), void (* const free_arg)(void *)); int set_fieldtype_choice( FIELDTYPE *fieldtype, bool (* const next_choice)(FIELD *, const void *), bool (* const prev_choice)(FIELD *, const void *));
FIELDTYPE *link_fieldtype(FIELDTYPE *type1, FIELDTYPE *type2);
| field_check | |||||
This function checks the
validity of an entered data string whenever the user attempts to leave a field.
It has two arguments:
| |||||
| char_check | |||||
| This function validates input characters as they are entered. The form library passes it the character to be checked and a pointer to an argument-block structure. | |||||
| make_arg | |
| This function is automatically applied to the list of arguments you give set_field_type when attaching validation to a field. It stores the arguments in an allocated argument-block object which is used when validating input. | |
| copy_arg | |
| This function may be used by applications to copy argument-blocks. | |
| free_arg | |
| Frees an argument-block structure. | |
The set_fieldtype_choice function allows forms programmers to define successor and predecessor functions for the field type. These functions take the field pointer and an argument-block structure as arguments.
| E_OK | The routine succeeded. |
| E_BAD_ARGUMENT | |
| Routine detected an incorrect or out-of-range argument. | |
| E_SYSTEM_ERROR | |
| System error occurred, e.g., malloc failure. | |
| The integer-valued routines return one of the following codes on error: | |
| E_OK | The routine succeeded. |
| E_BAD_ARGUMENT | |
| Routine detected an incorrect or out-of-range argument. | |
| E_CONNECTED | |
| The field is already connected to a form. | |
| E_CURRENT | |
| The field is the current field. | |
| E_SYSTEM_ERROR | |
| System error occurred (see errno(3)). | |
| 2024-03-16 | form_fieldtype (3X) | ncurses 6.5 |
| Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | If at first you don't succeed, you must be a programmer. | ” |