3 ****************************************************************************
4 * Copyright 2018-2019,2020 Thomas E. Dickey *
5 * Copyright 1998-2016,2017 Free Software Foundation, Inc. *
7 * Permission is hereby granted, free of charge, to any person obtaining a *
8 * copy of this software and associated documentation files (the *
9 * "Software"), to deal in the Software without restriction, including *
10 * without limitation the rights to use, copy, modify, merge, publish, *
11 * distribute, distribute with modifications, sublicense, and/or sell *
12 * copies of the Software, and to permit persons to whom the Software is *
13 * furnished to do so, subject to the following conditions: *
15 * The above copyright notice and this permission notice shall be included *
16 * in all copies or substantial portions of the Software. *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
21 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
22 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
23 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
24 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
26 * Except as contained in this notice, the name(s) of the above copyright *
27 * holders shall not be used in advertising or otherwise to promote the *
28 * sale, use or other dealings in this Software without prior written *
30 ****************************************************************************
31 * @Id: form.3x,v 1.35 2020/03/28 19:06:28 tom Exp @
33 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
36 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
37 <meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
38 <TITLE>form 3x</TITLE>
39 <link rel="author" href="mailto:bug-ncurses@gnu.org">
40 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
43 <H1 class="no-header">form 3x</H1>
45 <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG> <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>
50 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
51 <STRONG>form</STRONG> - curses extension for programming forms
54 </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
55 <STRONG>#include</STRONG> <STRONG><form.h></STRONG>
58 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
59 The <STRONG>form</STRONG> library provides terminal-independent facilities for composing
60 form screens on character-cell terminals. The library includes: field
61 routines, which create and modify form fields; and form routines, which
62 group fields into forms, display forms on the screen, and handle inter-
65 The <STRONG>form</STRONG> library uses the <STRONG>curses</STRONG> libraries. To use the <STRONG>form</STRONG> library,
66 link with the options <STRONG>-lform</STRONG> <STRONG>-lcurses</STRONG>.
68 Your program should set up the locale, e.g.,
70 <STRONG>setlocale(LC_ALL,</STRONG> <STRONG>"");</STRONG>
72 so that input/output processing will work.
74 A curses initialization routine such as <STRONG>initscr</STRONG> must be called before
75 using any of these functions.
78 </PRE><H3><a name="h3-Current-Default-Values-for-Field-Attributes">Current Default Values for Field Attributes</a></H3><PRE>
79 The <STRONG>form</STRONG> library maintains a default value for field attributes. You
80 can get or set this default by calling the appropriate <STRONG>set_</STRONG> or
81 retrieval routine with a <STRONG>NULL</STRONG> field pointer. Changing this default
82 with a <STRONG>set_</STRONG> function affects future field creations, but does not
83 change the rendering of fields already created.
86 </PRE><H3><a name="h3-Routine-Name-Index">Routine Name Index</a></H3><PRE>
87 The following table lists each <STRONG>form</STRONG> routine and the name of the manual
88 page on which it is described.
90 <STRONG>curses</STRONG> Routine Name Manual Page Name
91 --------------------------------------------------
92 current_field <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
93 data_ahead <STRONG><A HREF="form_data.3x.html">form_data(3x)</A></STRONG>
94 data_behind <STRONG><A HREF="form_data.3x.html">form_data(3x)</A></STRONG>
95 dup_field <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>
96 dynamic_field_info <STRONG><A HREF="form_field_info.3x.html">form_field_info(3x)</A></STRONG>
97 field_arg <STRONG><A HREF="form_field_validation.3x.html">form_field_validation(3x)</A></STRONG>
98 field_back <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
99 field_buffer <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
100 field_count <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
101 field_fore <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
102 field_index <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
103 field_info <STRONG><A HREF="form_field_info.3x.html">form_field_info(3x)</A></STRONG>
104 field_init <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
105 field_just <STRONG><A HREF="form_field_just.3x.html">form_field_just(3x)</A></STRONG>
106 field_opts <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
107 field_opts_off <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
108 field_opts_on <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
109 field_pad <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
110 field_status <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
111 field_term <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
112 field_type <STRONG><A HREF="form_field_validation.3x.html">form_field_validation(3x)</A></STRONG>
113 field_userptr <STRONG><A HREF="form_field_userptr.3x.html">form_field_userptr(3x)</A></STRONG>
114 form_driver <STRONG><A HREF="form_driver.3x.html">form_driver(3x)</A></STRONG>
116 form_driver_w <STRONG><A HREF="form_driver.3x.html">form_driver(3x)</A></STRONG>*
117 form_fields <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
118 form_init <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
119 form_opts <STRONG><A HREF="form_opts.3x.html">form_opts(3x)</A></STRONG>
120 form_opts_off <STRONG><A HREF="form_opts.3x.html">form_opts(3x)</A></STRONG>
121 form_opts_on <STRONG><A HREF="form_opts.3x.html">form_opts(3x)</A></STRONG>
122 form_page <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
123 form_request_by_name <STRONG><A HREF="form_requestname.3x.html">form_requestname(3x)</A></STRONG>
124 form_request_name <STRONG><A HREF="form_requestname.3x.html">form_requestname(3x)</A></STRONG>
125 form_sub <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
126 form_term <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
127 form_userptr <STRONG><A HREF="form_userptr.3x.html">form_userptr(3x)</A></STRONG>
128 form_win <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
129 free_field <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>
130 free_fieldtype <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
131 free_form <STRONG><A HREF="form_new.3x.html">form_new(3x)</A></STRONG>
132 link_field <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>
133 link_fieldtype <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
134 move_field <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
135 new_field <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>
136 new_fieldtype <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
137 new_form <STRONG><A HREF="form_new.3x.html">form_new(3x)</A></STRONG>
138 new_page <STRONG><A HREF="form_new_page.3x.html">form_new_page(3x)</A></STRONG>
139 pos_form_cursor <STRONG><A HREF="form_cursor.3x.html">form_cursor(3x)</A></STRONG>
140 post_form <STRONG><A HREF="form_post.3x.html">form_post(3x)</A></STRONG>
141 scale_form <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
142 set_current_field <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
143 set_field_back <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
144 set_field_buffer <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
145 set_field_fore <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
146 set_field_init <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
147 set_field_just <STRONG><A HREF="form_field_just.3x.html">form_field_just(3x)</A></STRONG>
148 set_field_opts <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
149 set_field_pad <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
150 set_field_status <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
151 set_field_term <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
152 set_field_type <STRONG><A HREF="form_field_validation.3x.html">form_field_validation(3x)</A></STRONG>
153 set_field_userptr <STRONG><A HREF="form_field_userptr.3x.html">form_field_userptr(3x)</A></STRONG>
154 set_fieldtype_arg <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
155 set_fieldtype_choice <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
156 set_form_fields <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
157 set_form_init <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
158 set_form_opts <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
159 set_form_page <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
160 set_form_sub <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
161 set_form_term <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
162 set_form_userptr <STRONG><A HREF="form_userptr.3x.html">form_userptr(3x)</A></STRONG>
163 set_form_win <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
164 set_max_field <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
165 set_new_page <STRONG><A HREF="form_new_page.3x.html">form_new_page(3x)</A></STRONG>
166 unfocus_current_field <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
167 unpost_form <STRONG><A HREF="form_post.3x.html">form_post(3x)</A></STRONG>
170 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
171 Routines that return pointers return <STRONG>NULL</STRONG> on error, and set <STRONG>errno</STRONG> to
172 the corresponding error-code returned by functions returning an inte-
173 ger. Routines that return an integer return one of the following error
176 <STRONG>E_OK</STRONG> The routine succeeded.
178 <STRONG>E_BAD_ARGUMENT</STRONG>
179 Routine detected an incorrect or out-of-range argument.
181 <STRONG>E_BAD_STATE</STRONG>
182 Routine was called from an initialization or termination function.
184 <STRONG>E_CONNECTED</STRONG>
185 The field is already connected to a form.
187 <STRONG>E_INVALID_FIELD</STRONG>
188 Contents of a field are not valid.
190 <STRONG>E_NOT_CONNECTED</STRONG>
191 No fields are connected to the form.
193 <STRONG>E_NOT_POSTED</STRONG>
194 The form has not been posted.
196 <STRONG>E_NO_ROOM</STRONG>
197 Form is too large for its window.
199 <STRONG>E_POSTED</STRONG>
200 The form is already posted.
202 <STRONG>E_REQUEST_DENIED</STRONG>
203 The form driver could not process the request.
205 <STRONG>E_SYSTEM_ERROR</STRONG>
206 System error occurred (see <STRONG>errno(3)</STRONG>).
208 <STRONG>E_UNKNOWN_COMMAND</STRONG>
209 The form driver code saw an unknown request code.
212 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
213 The header file <STRONG><form.h></STRONG> automatically includes the header files
214 <STRONG><curses.h></STRONG> and <STRONG><eti.h></STRONG>.
216 In your library list, libform.a should be before libncurses.a; that is,
217 you want to say "-lform -lncurses", not the other way around (which
218 would give you a link error when using static libraries).
221 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
222 These routines emulate the System V forms library. They were not sup-
223 ported on Version 7 or BSD versions.
225 The menu facility was documented in SVr4.2 in <EM>Character</EM> <EM>User</EM> <EM>Interface</EM>
226 <EM>Programming</EM> <EM>(UNIX</EM> <EM>SVR4.2)</EM>.
228 It is not part of X/Open Curses.
230 Aside from ncurses, there are few implementations:
232 <STRONG>o</STRONG> systems based on SVr4 source code, e.g., Solaris.
234 <STRONG>o</STRONG> NetBSD curses.
236 A few functions in this implementation are extensions added for
237 ncurses, but not provided by other implementations, e.g.,
238 <STRONG>form_driver_w</STRONG>, <STRONG>unfocus_current_field</STRONG>.
241 </PRE><H2><a name="h2-AUTHORS">AUTHORS</a></H2><PRE>
242 Juergen Pfeifer. Manual pages and adaptation for ncurses by Eric S.
246 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
247 <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "form_" for detailed
248 descriptions of the entry points.
250 This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20200613).
254 <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>
258 <li><a href="#h2-NAME">NAME</a></li>
259 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
260 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
262 <li><a href="#h3-Current-Default-Values-for-Field-Attributes">Current Default Values for Field Attributes</a></li>
263 <li><a href="#h3-Routine-Name-Index">Routine Name Index</a></li>
266 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
267 <li><a href="#h2-NOTES">NOTES</a></li>
268 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
269 <li><a href="#h2-AUTHORS">AUTHORS</a></li>
270 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>