| 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.
| “ | "I liken starting one's computing career with Unix, say as an undergraduate, to being born in East Africa. It is intolerably hot, your body is covered with lice and flies, you are malnourished and you suffer from numerous curable diseases. But, as far as young East Africans can tell, this is simply the natural condition and they live within it. By the time they find out differently, it is too late. They already think that the writing of shell scripts is a natural act." | ” |
| — Ken Pier, Xerox PARC | ||