aboutsummaryrefslogtreecommitdiff
path: root/doc/html/man/form.3x.html
blob: 63bee133e77b54a8538e64849378ca4bd4297cd4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<!-- 
  * t
  ****************************************************************************
  * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  * "Software"), to deal in the Software without restriction, including      *
  * without limitation the rights to use, copy, modify, merge, publish,      *
  * distribute, distribute with modifications, sublicense, and/or sell       *
  * copies of the Software, and to permit persons to whom the Software is    *
  * furnished to do so, subject to the following conditions:                 *
  *                                                                          *
  * The above copyright notice and this permission notice shall be included  *
  * in all copies or substantial portions of the Software.                   *
  *                                                                          *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
  * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
  *                                                                          *
  * Except as contained in this notice, the name(s) of the above copyright   *
  * holders shall not be used in advertising or otherwise to promote the     *
  * sale, use or other dealings in this Software without prior written       *
  * authorization.                                                           *
  ****************************************************************************
  * @Id: form.3x,v 1.33 2019/11/30 20:51:36 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
<TITLE>form 3x</TITLE>
<link rel="author" href="mailto:bug-ncurses@gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>
<BODY>
<H1 class="no-header">form 3x</H1>
<PRE>
<STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>                                                              <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>




</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
       <STRONG>form</STRONG> - curses extension for programming forms


</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
       <STRONG>#include</STRONG> <STRONG>&lt;form.h&gt;</STRONG>


</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
       The <STRONG>form</STRONG> library provides terminal-independent facilities for composing
       form screens on character-cell terminals.  The library includes:  field
       routines, which create and modify form fields; and form routines, which
       group fields into forms, display forms on the screen, and handle inter-
       action with the user.

       The  <STRONG>form</STRONG>  library uses the <STRONG>curses</STRONG> libraries.  To use the <STRONG>form</STRONG> library,
       link with the options <STRONG>-lform</STRONG> <STRONG>-lcurses</STRONG>.

       Your program should set up the locale, e.g.,

            <STRONG>setlocale(LC_ALL,</STRONG> <STRONG>"");</STRONG>

       so that input/output processing will work.

       A curses initialization routine such as <STRONG>initscr</STRONG> must be  called  before
       using any of these functions.


</PRE><H3><a name="h3-Current-Default-Values-for-Field-Attributes">Current Default Values for Field Attributes</a></H3><PRE>
       The  <STRONG>form</STRONG>  library maintains a default value for field attributes.  You
       can get or  set  this  default  by  calling  the  appropriate  <STRONG>set_</STRONG>  or
       retrieval  routine  with  a  <STRONG>NULL</STRONG> field pointer.  Changing this default
       with a <STRONG>set_</STRONG> function affects  future  field  creations,  but  does  not
       change the rendering of fields already created.


</PRE><H3><a name="h3-Routine-Name-Index">Routine Name Index</a></H3><PRE>
       The  following table lists each <STRONG>form</STRONG> routine and the name of the manual
       page on which it is described.

       <STRONG>curses</STRONG> Routine Name     Manual Page Name
       --------------------------------------------------
       current_field           <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
       data_ahead              <STRONG><A HREF="form_data.3x.html">form_data(3x)</A></STRONG>
       data_behind             <STRONG><A HREF="form_data.3x.html">form_data(3x)</A></STRONG>
       dup_field               <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>
       dynamic_field_info      <STRONG><A HREF="form_field_info.3x.html">form_field_info(3x)</A></STRONG>
       field_arg               <STRONG><A HREF="form_field_validation.3x.html">form_field_validation(3x)</A></STRONG>
       field_back              <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
       field_buffer            <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
       field_count             <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
       field_fore              <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
       field_index             <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
       field_info              <STRONG><A HREF="form_field_info.3x.html">form_field_info(3x)</A></STRONG>
       field_init              <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
       field_just              <STRONG><A HREF="form_field_just.3x.html">form_field_just(3x)</A></STRONG>
       field_opts              <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
       field_opts_off          <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
       field_opts_on           <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
       field_pad               <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
       field_status            <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
       field_term              <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
       field_type              <STRONG><A HREF="form_field_validation.3x.html">form_field_validation(3x)</A></STRONG>
       field_userptr           <STRONG><A HREF="form_field_userptr.3x.html">form_field_userptr(3x)</A></STRONG>
       form_driver             <STRONG><A HREF="form_driver.3x.html">form_driver(3x)</A></STRONG>

       form_driver_w           <STRONG><A HREF="form_driver.3x.html">form_driver(3x)</A></STRONG>*
       form_fields             <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
       form_init               <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
       form_opts               <STRONG><A HREF="form_opts.3x.html">form_opts(3x)</A></STRONG>
       form_opts_off           <STRONG><A HREF="form_opts.3x.html">form_opts(3x)</A></STRONG>
       form_opts_on            <STRONG><A HREF="form_opts.3x.html">form_opts(3x)</A></STRONG>
       form_page               <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
       form_request_by_name    <STRONG><A HREF="form_requestname.3x.html">form_requestname(3x)</A></STRONG>
       form_request_name       <STRONG><A HREF="form_requestname.3x.html">form_requestname(3x)</A></STRONG>
       form_sub                <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
       form_term               <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
       form_userptr            <STRONG><A HREF="form_userptr.3x.html">form_userptr(3x)</A></STRONG>
       form_win                <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
       free_field              <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>
       free_fieldtype          <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
       free_form               <STRONG><A HREF="form_new.3x.html">form_new(3x)</A></STRONG>
       link_field              <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>
       link_fieldtype          <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
       move_field              <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
       new_field               <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>
       new_fieldtype           <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
       new_form                <STRONG><A HREF="form_new.3x.html">form_new(3x)</A></STRONG>
       new_page                <STRONG><A HREF="form_new_page.3x.html">form_new_page(3x)</A></STRONG>
       pos_form_cursor         <STRONG><A HREF="form_cursor.3x.html">form_cursor(3x)</A></STRONG>
       post_form               <STRONG><A HREF="form_post.3x.html">form_post(3x)</A></STRONG>
       scale_form              <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
       set_current_field       <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
       set_field_back          <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
       set_field_buffer        <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
       set_field_fore          <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
       set_field_init          <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
       set_field_just          <STRONG><A HREF="form_field_just.3x.html">form_field_just(3x)</A></STRONG>
       set_field_opts          <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
       set_field_pad           <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
       set_field_status        <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
       set_field_term          <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
       set_field_type          <STRONG><A HREF="form_field_validation.3x.html">form_field_validation(3x)</A></STRONG>
       set_field_userptr       <STRONG><A HREF="form_field_userptr.3x.html">form_field_userptr(3x)</A></STRONG>
       set_fieldtype_arg       <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
       set_fieldtype_choice    <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
       set_form_fields         <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
       set_form_init           <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
       set_form_opts           <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
       set_form_page           <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
       set_form_sub            <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
       set_form_term           <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
       set_form_userptr        <STRONG><A HREF="form_userptr.3x.html">form_userptr(3x)</A></STRONG>
       set_form_win            <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
       set_max_field           <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
       set_new_page            <STRONG><A HREF="form_new_page.3x.html">form_new_page(3x)</A></STRONG>
       unfocus_current_field   <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
       unpost_form             <STRONG><A HREF="form_post.3x.html">form_post(3x)</A></STRONG>


</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
       Routines that return pointers return <STRONG>NULL</STRONG> on error, and  set  errno  to
       the  corresponding  error-code returned by functions returning an inte-
       ger.  Routines that return an integer return one of the following error
       codes:

       <STRONG>E_OK</STRONG> The routine succeeded.

       <STRONG>E_BAD_ARGUMENT</STRONG>
            Routine detected an incorrect or out-of-range argument.

       <STRONG>E_BAD_STATE</STRONG>
            Routine was called from an initialization or termination function.

       <STRONG>E_CONNECTED</STRONG>
            The field is already connected to a form.

       <STRONG>E_INVALID_FIELD</STRONG>
            Contents of a field are not valid.

       <STRONG>E_NOT_CONNECTED</STRONG>
            No fields are connected to the form.

       <STRONG>E_NOT_POSTED</STRONG>
            The form has not been posted.

       <STRONG>E_NO_ROOM</STRONG>
            Form is too large for its window.

       <STRONG>E_POSTED</STRONG>
            The form is already posted.

       <STRONG>E_REQUEST_DENIED</STRONG>
            The form driver could not process the request.

       <STRONG>E_SYSTEM_ERROR</STRONG>
            System error occurred (see <STRONG>errno(3)</STRONG>).

       <STRONG>E_UNKNOWN_COMMAND</STRONG>
            The form driver code saw an unknown request code.


</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
       The  header  file  <STRONG>&lt;form.h&gt;</STRONG>  automatically  includes  the  header files
       <STRONG>&lt;curses.h&gt;</STRONG> and <STRONG>&lt;eti.h&gt;</STRONG>.

       In your library list, libform.a should be before libncurses.a; that is,
       you  want  to  say  "-lform -lncurses", not the other way around (which
       would give you a link error when using static libraries).


</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
       These routines emulate the System V forms library.  They were not  sup-
       ported on Version 7 or BSD versions.

       The  menu facility was documented in SVr4.2 in <EM>Character</EM> <EM>User</EM> <EM>Interface</EM>
       <EM>Programming</EM> <EM>(UNIX</EM> <EM>SVR4.2)</EM>.

       It is not part of X/Open Curses.

       Aside from ncurses, there are few implementations:

       <STRONG>o</STRONG>   systems based on SVr4 source code, e.g., Solaris.

       <STRONG>o</STRONG>   NetBSD curses.

       A few  functions  in  this  implementation  are  extensions  added  for
       ncurses,   but   not   provided   by   other   implementations,   e.g.,
       <STRONG>form_driver_w</STRONG>, <STRONG>unfocus_current_field</STRONG>.


</PRE><H2><a name="h2-AUTHORS">AUTHORS</a></H2><PRE>
       Juergen Pfeifer.  Manual pages and adaptation for ncurses  by  Eric  S.
       Raymond.


</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>  and  related  pages  whose names begin "form_" for detailed
       descriptions of the entry points.

       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20200118).



                                                                      <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<li><a href="#h2-NAME">NAME</a></li>
<li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
<ul>
<li><a href="#h3-Current-Default-Values-for-Field-Attributes">Current Default Values for Field Attributes</a></li>
<li><a href="#h3-Routine-Name-Index">Routine Name Index</a></li>
</ul>
</li>
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
<li><a href="#h2-NOTES">NOTES</a></li>
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
<li><a href="#h2-AUTHORS">AUTHORS</a></li>
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
</ul>
</div>
</BODY>
</HTML>