FIELDTYPE(S) UNIX System V FIELDTYPE(S)
Name
fieldtype - FIELDTYPE library routines
Syntax
#include <form.h>
cc [ flags ] files -lform -lcurses [ libraries ]
typedef int (* PTF_int) ();
FIELDTYPE * new_fieldtype (field_check, char_check)
PTF_int field_check;
PTF_int char_check;
int free_fieldtype(fieldtype);
FIELDTYPE * fieldtype;
typedef char * (* PFT_charP) ();
typedef void (* PFT_void) ();
int set_fieldtype_arg (fieldtype, mak_arg, cpy_arg, free_arg)
FIELDTYPE * fieldtype;
char * mak_arg(ap);
va_list * ap;
PTF_charP cpy_arg;
PTF_void free_arg;
typedef char * (* PFT_charP) ();
int set_fieldtype_choice (fieldtype, next_choice, prev_choice)
FIELDTYPE * fieldtype;
PTF_int next_choice;
PTF_int prev_choice;
int next_choice (FIELD * f, char * arg);
int prev_choice (FIELD * f, char * arg);
FIELDTYPE * link_fieldtyp (type1,type2)
FIELDTYPE * type1;
FIELDTYPE * type2;
Description
These FIELDTYPE routines run on any terminal supported by
curses(S), the low-level UNIX library. Once you compile
your UNIX program #includeing the header file form.h, you
should link it with the form and curses library routines.
Functions
The following is a list of FIELDTYPE routines. For a
complete description of each routine, see the Programmer's
Guide.
new_fieldtype (field_check, char_check) creates a new field
type. You must write functions field_check, which validates
the field value and char_check, which validates each
character.
free_fieldtype (fieldtype) frees the space allocated for the
given field type.
By associating the given function pointers with the field
type, set_fieldtype_arg (fieldtype, mak_arg,
cpy_arg, free_arg) connects to the field type additional
arguments necessary for a set_field_type() call. Function
mak_arg allocates a structure for the field specific
parameters to set_field_type() and returns a pointer to the
saved data. Function copy_arg duplicates the structure
created by make_arg. Function free_arg frees any storage
allocated by make_arg or copy_arg.
Requests REQ_NEXT_CHOICE and REQ_PREV_CHOICE let the user
choose the next or previous value of a field type comprising
an ordered set of values.
set_fieldtype_choice (fieldtype, next_choice, prev_choice)
enables you to implement these requests for the given field
type. It associates with the given field type application-
defined functions that return pointers to the next or
previous choice for the field.
link_fieldtyp (type1, type2) returns a pointer to the field
type built from the two given types. The constituent types
may be any application-defined or -defined types.
See Also
curses(S), form(S), field(S), panel(S), menu(S), item(S),
tam(S)
Diagnostics
The following values are returned by one or more routines
that return an integer. For specific information on which
routines return which value, see the Programmer's Guide.
E_OK function returned successfully
E_CONNECTED object is connected
E_SYSTEM_ERROR system error
E_BAD_ARGUMENT argument is incorrect
E_CURRENT field is current field
E_POSTED form is posted
E_INVALID_FIELD field is invalid
E_NOT_CONNECTED object is not connected
E_NO_ROOM form does not fit in subwindow
E_BAD_STATE called from inappropriate routine
E_UNKNOWN_COMMAND unknown command was given to the form
driver
E_REQUEST_DENIED recognized request failed
(printed 6/20/89)