Copyright 1989 AT&T
Portions Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
cc [ flag... ] file... -lform -lcurses [ library... ] #include <form.h> int form_driver(FORM *form, int c);
The form_driver() function is the workhorse of the forms subsystem; it checks to determine whether the character c is a forms request or data. If it is a request, the form driver executes the request and reports the result. If it is data (a printable ASCII character), it enters the data into the current position in the current field. If it is not recognized, the form driver assumes it is an application-defined command and returns E_UNKNOWN_COMMAND. Application defined commands should be defined relative to MAX_COMMAND, the maximum value of a request listed below.
Form driver requests: REQ_NEXT_PAGE
Move to the next page.
Move to the previous page.
Move to the first page.
Move to the last page.
Move to the next field.
Move to the previous field.
Move to the first field.
Move to the last field.
Move to the sorted next field.
Move to the sorted prev field.
Move to the sorted first field.
Move to the sorted last field.
Move left to field.
Move right to field.
Move up to field.
Move down to field.
Move to the next character in the field.
Move to the previous character in the field.
Move to the next line in the field.
Move to the previous line in the field.
Move to the next word in the field.
Move to the previous word in the field.
Move to the first char in the field.
Move after the last char in the field.
Move to the beginning of the line.
Move after the last char in the line.
Move left in the field.
Move right in the field.
Move up in the field.
Move down in the field.
Insert the blank character at the cursor.
Insert a blank line at the cursor.
Delete the character at the cursor.
Delete the character before the cursor.
Delete the line at the cursor.
Delete the word at the cursor.
Clear to the end of the line.
Clear to the end of the field.
Clear the entire field.
Enter overlay mode.
Enter insert mode.
Scroll the field forward a line.
Scroll the field backward a line.
Scroll the field forward a page.
Scroll the field backward a page.
Scroll the field forward half a page.
Scroll the field backward half a page.
Horizontal scroll forward a character.
Horizontal scroll backward a character
Horizontal scroll forward a line.
Horizontal scroll backward a line.
Horizontal scroll forward half a line.
Horizontal scroll backward half a line.
Validate field.
Display the previous field choice.
Display the next field choice.
The form_driver() function returns one of the following: E_OK
The function returned successfully.
System error.
An argument is incorrect.
The form is not posted.
The field contents are invalid.
The routine was called from an initialization or termination function.
The form driver request failed.
An unknown request was passed to the form driver.
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE |
MT-Level Unsafe |
curses (3CURSES), forms (3CURSES), attributes (7)
The header <form.h> automatically includes the headers <eti.h> and <curses.h>.