DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

form_fieldtype(S-osr5)


form_fieldtype: new_fieldtype, free_fieldtype, set_fieldtype_arg, set_fieldtype_choice, link_fieldtype -- forms fieldtype routines

Syntax

cc ... -lform -lcurses

#include <form.h>

FIELDTYPE *new_fieldtype(int (* field_check)(FIELD *, char *), int (* char_check)(int, char *)); int free_fieldtype(FIELDTYPE *fieldtype); int set_fieldtype_arg(FIELDTYPE *fieldtype, char *(* mak_arg)(va_list *), char *(* copy_arg)(char *), void (* free_arg)(char *)); int set_fieldtype_choice(FIELDTYPE *fieldtype, int (* next_choice)(FIELD *, char *), int (* prev_choice)(FIELD *, char *)); FIELDTYPE *link_fieldtype(FIELDTYPE *type1, FIELDTYPE *type2);

Description

new_fieldtype(S-osr5) creates a new field type. The application programmer must write the function field_check, which validates the field value, and the function char_check, which validates each character. free_fieldtype(S-osr5) frees the space allocated for the field type.

By associating function pointers with a field type, set_fieldtype_arg(S-osr5) connects to the field type additional arguments necessary for a set_field_type(S-osr5) 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 mak_arg. Function free_arg frees any storage allocated by mak_arg or copy_arg.

The form_driver(S-osr5) requests REQ_NEXT_CHOICE and REQ_PREV_CHOICE let the user request the next or previous value of a field type comprising an ordered set of values. set_fieldtype_choice(S-osr5) allows the application programmer to implement these requests for the given field type. It associates with the given field type those application-defined functions that return pointers to the next or previous choice for the field.

link_fieldtype(S-osr5) returns a pointer to the field type built from the two given types. The constituent types may be any application-defined or pre-defined types.

Return values

Routines that return pointers always return NULL on error. Routines that return an integer return one of the following:

E_OK - The function returned successfully.
E_SYSTEM_ERROR - System error.
E_BAD_ARGUMENT - An argument is incorrect.
E_CONNECTED - Type is connected to one or more fields.

 E_OK            -  The function returned successfully.
 E_SYSTEM_ERROR  -  System error.
 E_BAD_ARGUMENT  -  An argument is incorrect.
 E_CONNECTED     -  Type is connected to one or more fields.

Warning

The header file form.h automatically includes the header files eti.h and curses.h.

Files


/usr/lib/libform.a
the library

See also

curses(S-osr5), forms(S-osr5)

Standards conformance

new_fieldtype(S-osr5), free_fieldtype(S-osr5), set_fieldtype_arg(S-osr5), set_fieldtype_choice(S-osr5), and link_fieldtype(S-osr5) are not part of any currently supported standard; they were developed by UNIX System Laboratories, Inc. and are maintained by The SCO Group.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005