2 <BODY BGCOLOR="#99ccbb" TEXT="#000000" LINK="#4060b0" VLINK="#000080" ALINK="#ff4040">
4 <STRONG>form_driver</STRONG> - command-processing loop of the form system
9 <STRONG>#include</STRONG> <STRONG><form.h></STRONG>
10 int form_driver(FORM *form, int c);
14 <H2>DESCRIPTION</H2><PRE>
15 Once a form has been posted (displayed), you should funnel
16 input events to it through <STRONG>form_driver</STRONG>. This routine has
17 two major input cases; either the input is a form naviga-
18 tion request or it's a printable ASCII character. The
19 form driver requests are as follows:
22 Move to the next page.
25 Move to the previous page.
28 Move to the first page.
31 Move to the last field.
35 Move to the next field.
38 Move to the previous field.
41 Move to the first field.
44 Move to the last field.
47 Move to the sorted next field.
50 Move to the sorted previous field.
53 Move to the sorted first field.
56 Move to the sorted last field.
60 Move right to a field.
70 Move to the next char.
73 Move to the previous char.
76 Move to the next line.
79 Move to the previous line.
82 Move to the next word.
85 Move to the previous word.
88 Move to the beginning of the field.
91 Move to the end of the field.
94 Move to the beginning of the line.
97 Move to the end of the line.
100 Move left in the field.
103 Move right in the field.
106 Move up in the field.
109 Move down in the field.
112 Insert or overlay a new line.
115 Insert a blank at the cursor.
118 Insert a blank line at the cursor.
121 Delete character at the cursor.
124 Delete character before the cursor.
127 Delete line at the cursor.
130 Delete blank-delimited word at the cursor.
133 Clear to end of line from cursor.
136 Clear to end of field from cursor.
139 Clear the entire field.
149 Scroll the field forward a line.
152 Scroll the field backward a line.
155 Scroll the field forward a page.
158 Scroll the field backward a page.
161 Scroll the field forward half a page.
164 Scroll the field forward a character.
167 Scroll the field backward a character.
170 Horizontal scroll the field forward a line.
173 Horizontal scroll the field backward a line.
176 Horizontal scroll the field forward half a line.
179 Horizontal scroll the field backward half a line.
186 Display next field choice.
189 Display previous field choice.
191 If the second argument is a printable ASCII character, the
192 driver places it in the current position in the current
193 field. If it is one of the forms requests listed above,
194 that request is executed.
196 If the second argument is neither printable ASCII nor one
197 of the above pre-defined form requests, the drive assumes
198 it is an application-specific command and returns
199 <STRONG>E_UNKNOWN_COMMAND</STRONG>. Application-defined commands should be
200 defined relative to <STRONG>MAX_COMMAND</STRONG>, the maximum value of
201 these pre-defined requests.
205 <H2>RETURN VALUE</H2><PRE>
206 <STRONG>form_driver</STRONG> return one of the following error codes:
208 <STRONG>E_OK</STRONG> The routine succeeded.
210 <STRONG>E_SYSTEM_ERROR</STRONG>
211 System error occurred (see <STRONG>errno</STRONG>).
213 <STRONG>E_BAD_ARGUMENT</STRONG>
214 Routine detected an incorrect or out-of-range argu-
217 <STRONG>E_BAD_STATE</STRONG>
219 <STRONG>E_NOT_POSTED</STRONG>
220 The form has not been posted.
222 <STRONG>E_UNKNOWN_COMMAND</STRONG>
223 The form driver code saw an unknown request code.
225 <STRONG>E_INVALID_FIELD</STRONG>
226 Contents of field is invalid.
228 <STRONG>E_REQUEST_DENIED</STRONG>
229 The form driver could not process the request.
233 <H2>SEE ALSO</H2><PRE>
234 <STRONG><A HREF="ncurses.3x.html">curses(3X)</A></STRONG>, <STRONG><A HREF="form.3x.html">form(3X)</A></STRONG>.
239 The header file <STRONG><form.h></STRONG> automatically includes the header
240 files <STRONG><curses.h></STRONG>.
244 <H2>PORTABILITY</H2><PRE>
245 These routines emulate the System V forms library. They
246 were not supported on Version 7 or BSD versions.
250 <H2>AUTHORS</H2><PRE>
251 Juergen Pfeifer. Manual pages and adaptation for new
252 curses by Eric S. Raymond.