]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/form.3x
ncurses 6.4 - patch 20230701
[ncurses.git] / man / form.3x
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright 2018-2021,2023 Thomas E. Dickey                                *
4 .\" Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
5 .\"                                                                          *
6 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
7 .\" copy of this software and associated documentation files (the            *
8 .\" "Software"), to deal in the Software without restriction, including      *
9 .\" without limitation the rights to use, copy, modify, merge, publish,      *
10 .\" distribute, distribute with modifications, sublicense, and/or sell       *
11 .\" copies of the Software, and to permit persons to whom the Software is    *
12 .\" furnished to do so, subject to the following conditions:                 *
13 .\"                                                                          *
14 .\" The above copyright notice and this permission notice shall be included  *
15 .\" in all copies or substantial portions of the Software.                   *
16 .\"                                                                          *
17 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
18 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
19 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
20 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
21 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
22 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
23 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
24 .\"                                                                          *
25 .\" Except as contained in this notice, the name(s) of the above copyright   *
26 .\" holders shall not be used in advertising or otherwise to promote the     *
27 .\" sale, use or other dealings in this Software without prior written       *
28 .\" authorization.                                                           *
29 .\"***************************************************************************
30 .\"
31 .\" $Id: form.3x,v 1.42 2023/07/01 15:46:10 tom Exp $
32 .TH form 3X 2023-07-01 "ncurses 6.4" "Library calls"
33 .ie \n(.g .ds `` \(lq
34 .el       .ds `` ``
35 .ie \n(.g .ds '' \(rq
36 .el       .ds '' ''
37 .de bP
38 .ie n  .IP \(bu 4
39 .el    .IP \(bu 2
40 ..
41 .SH NAME
42 \fBform\fP \- curses extension for programming forms
43 .SH SYNOPSIS
44 \fB#include <form.h>\fP
45 .SH DESCRIPTION
46 The \fBform\fP library provides terminal-independent facilities for composing
47 form screens on character-cell terminals.
48 The library includes: field
49 routines, which create and modify form fields; and form routines, which group
50 fields into forms, display forms on the screen, and handle interaction with the
51 user.
52 .PP
53 The \fBform\fP library uses the \fBcurses\fP libraries.
54 To use the \fBform\fP library, link with the options
55 \fB\-lform \-lcurses\fP.
56 .PP
57 Your program should set up the locale, e.g.,
58 .sp
59      \fBsetlocale(LC_ALL, "");\fP
60 .sp
61 so that input/output processing will work.
62 .PP
63 A curses initialization routine such as \fBinitscr\fP must be called
64 before using any of these functions.
65 .
66 .SS Current Default Values for Field Attributes
67 .
68 The \fBform\fP library maintains a default value for field attributes.
69 You
70 can get or set this default by calling the appropriate \fBset_\fP
71 or retrieval
72 routine with a \fBNULL\fP field pointer.
73 Changing this default with a
74 \fBset_\fP function affects future field creations, but does not change the
75 rendering of fields already created.
76 .
77 .SS Routine Name Index
78 .
79 The following table lists each \fBform\fP routine and the name of
80 the manual page on which it is described.
81 Routines flagged with \*(``*\*(''
82 are ncurses-specific, not present in SVr4.
83 .
84 .TS
85 l l
86 l l .
87 \fBcurses\fP Routine Name       Manual Page Name
88 =
89 current_field   \fBform_page\fP(3X)
90 data_ahead      \fBform_data\fP(3X)
91 data_behind     \fBform_data\fP(3X)
92 dup_field       \fBform_field_new\fP(3X)
93 dynamic_field_info      \fBform_field_info\fP(3X)
94 field_arg       \fBform_field_validation\fP(3X)
95 field_back      \fBform_field_attributes\fP(3X)
96 field_buffer    \fBform_field_buffer\fP(3X)
97 field_count     \fBform_field\fP(3X)
98 field_fore      \fBform_field_attributes\fP(3X)
99 field_index     \fBform_page\fP(3X)
100 field_info      \fBform_field_info\fP(3X)
101 field_init      \fBform_hook\fP(3X)
102 field_just      \fBform_field_just\fP(3X)
103 field_opts      \fBform_field_opts\fP(3X)
104 field_opts_off  \fBform_field_opts\fP(3X)
105 field_opts_on   \fBform_field_opts\fP(3X)
106 field_pad       \fBform_field_attributes\fP(3X)
107 field_status    \fBform_field_buffer\fP(3X)
108 field_term      \fBform_hook\fP(3X)
109 field_type      \fBform_field_validation\fP(3X)
110 field_userptr   \fBform_field_userptr\fP(3X)
111 form_driver     \fBform_driver\fP(3X)
112 form_driver_w   \fBform_driver\fP(3X)*
113 form_fields     \fBform_field\fP(3X)
114 form_init       \fBform_hook\fP(3X)
115 form_opts       \fBform_opts\fP(3X)
116 form_opts_off   \fBform_opts\fP(3X)
117 form_opts_on    \fBform_opts\fP(3X)
118 form_page       \fBform_page\fP(3X)
119 form_request_by_name    \fBform_requestname\fP(3X)*
120 form_request_name       \fBform_requestname\fP(3X)*
121 form_sub        \fBform_win\fP(3X)
122 form_term       \fBform_hook\fP(3X)
123 form_userptr    \fBform_userptr\fP(3X)
124 form_win        \fBform_win\fP(3X)
125 free_field      \fBform_field_new\fP(3X)
126 free_fieldtype  \fBform_fieldtype\fP(3X)
127 free_form       \fBform_new\fP(3X)
128 link_field      \fBform_field_new\fP(3X)
129 link_fieldtype  \fBform_fieldtype\fP(3X)
130 move_field      \fBform_field\fP(3X)
131 new_field       \fBform_field_new\fP(3X)
132 new_fieldtype   \fBform_fieldtype\fP(3X)
133 new_form        \fBform_new\fP(3X)
134 new_page        \fBform_new_page\fP(3X)
135 pos_form_cursor \fBform_cursor\fP(3X)
136 post_form       \fBform_post\fP(3X)
137 scale_form      \fBform_win\fP(3X)
138 set_current_field       \fBform_page\fP(3X)
139 set_field_back  \fBform_field_attributes\fP(3X)
140 set_field_buffer        \fBform_field_buffer\fP(3X)
141 set_field_fore  \fBform_field_attributes\fP(3X)
142 set_field_init  \fBform_hook\fP(3X)
143 set_field_just  \fBform_field_just\fP(3X)
144 set_field_opts  \fBform_field_opts\fP(3X)
145 set_field_pad   \fBform_field_attributes\fP(3X)
146 set_field_status        \fBform_field_buffer\fP(3X)
147 set_field_term  \fBform_hook\fP(3X)
148 set_field_type  \fBform_field_validation\fP(3X)
149 set_field_userptr       \fBform_field_userptr\fP(3X)
150 set_fieldtype_arg       \fBform_fieldtype\fP(3X)
151 set_fieldtype_choice    \fBform_fieldtype\fP(3X)
152 set_form_fields \fBform_field\fP(3X)
153 set_form_init   \fBform_hook\fP(3X)
154 set_form_opts   \fBform_field_opts\fP(3X)
155 set_form_page   \fBform_page\fP(3X)
156 set_form_sub    \fBform_win\fP(3X)
157 set_form_term   \fBform_hook\fP(3X)
158 set_form_userptr        \fBform_userptr\fP(3X)
159 set_form_win    \fBform_win\fP(3X)
160 set_max_field   \fBform_field_buffer\fP(3X)
161 set_new_page    \fBform_new_page\fP(3X)
162 unfocus_current_field   \fBform_page\fP(3X)*
163 unpost_form     \fBform_post\fP(3X)
164 .TE
165 .SH RETURN VALUE
166 Routines that return pointers return \fBNULL\fP on error,
167 and set \fBerrno\fP to the corresponding error-code returned by functions
168 returning an integer.
169 Routines that return
170 an integer return one of the following error codes:
171 .TP 5
172 .B E_OK
173 The routine succeeded.
174 .TP 5
175 .B E_BAD_ARGUMENT
176 Routine detected an incorrect or out-of-range argument.
177 .TP 5
178 .B E_BAD_STATE
179 Routine was called from an initialization or termination function.
180 .TP 5
181 .B E_CONNECTED
182 The field is already connected to a form.
183 .TP 5
184 .B E_INVALID_FIELD
185 Contents of a field are not valid.
186 .TP 5
187 .B E_NOT_CONNECTED
188 No fields are connected to the form.
189 .TP 5
190 .B E_NOT_POSTED
191 The form has not been posted.
192 .TP 5
193 .B E_NO_ROOM
194 Form is too large for its window.
195 .TP 5
196 .B E_POSTED
197 The form is already posted.
198 .TP 5
199 .B E_REQUEST_DENIED
200 The form driver could not process the request.
201 .TP 5
202 .B E_SYSTEM_ERROR
203 System error occurred (see \fBerrno\fP(3)).
204 .TP 5
205 .B E_UNKNOWN_COMMAND
206 The form driver code saw an unknown request code.
207 .SH NOTES
208 The header file \fB<form.h>\fP automatically includes the header files
209 \fB<curses.h>\fP and \fB<eti.h>\fP.
210 .PP
211 In your library list, libform.a should be before libncurses.a; that is,
212 you want to say \*(``\-lform \-lncurses\*('', not the other way around
213 (which would give you a link error when using static libraries).
214 .SH PORTABILITY
215 These routines emulate the System V forms library.
216 They were not supported on
217 Version 7 or BSD versions.
218 .PP
219 The menu facility was documented in SVr4.2 in
220 \fICharacter User Interface Programming (UNIX SVR4.2)\fP.
221 .PP
222 It is not part of X/Open Curses.
223 .PP
224 Aside from ncurses, there are few implementations:
225 .bP
226 systems based on SVr4 source code, e.g., Solaris.
227 .bP
228 NetBSD curses.
229 .PP
230 A few functions in this implementation are extensions added for ncurses,
231 but not provided by other implementations, e.g.,
232 \fBform_driver_w\fP,
233 \fBunfocus_current_field\fP.
234 .SH AUTHORS
235 Juergen Pfeifer.
236 Manual pages and adaptation for ncurses by Eric
237 S. Raymond.
238 .SH SEE ALSO
239 \fBcurses\fP(3X) and related pages whose names begin \*(``form_\*('' for detailed
240 descriptions of the entry points.
241 .PP
242 This describes \fBncurses\fP
243 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).