Debian Codegraph @

upstream/debian-trixie/man3/form.3form

raw
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright 2018-2023,2024 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.58 2024/12/28 21:26:21 tom Exp $
32 .TH form 3FORM 2024-12-28 "ncurses 6.5" "Library calls"
33 .ie \n(.g \{\
34 .ds `` \(lq
35 .ds '' \(rq
36 .\}
37 .el \{\
38 .ie t .ds `` ``
39 .el .ds `` ""
40 .ie t .ds '' ''
41 .el .ds '' ""
42 .\}
43 .
44 .de bP
45 .ie n .IP \(bu 4
46 .el .IP \(bu 2
47 ..
48 .SH NAME
49 \fBform\fP \-
50 present user-fillable forms in \fIcurses\fP windows
51 .SH SYNOPSIS
52 .nf
53 \fB#include <form.h>
54 .fi
55 .SH DESCRIPTION
56 The \fBform\fP library provides terminal-independent facilities for composing
57 form screens on character-cell terminals.
58 The library includes: field
59 routines, which create and modify form fields; and form routines, which group
60 fields into forms, display forms on the screen, and handle interaction with the
61 user.
62 .PP
63 The \fBform\fP library uses the \fBcurses\fP libraries.
64 To use the \fBform\fP library, link with the options
65 \fB\-lform \-lcurses\fP.
66 .PP
67 Your program should set up the locale, e.g.,
68 .sp
69 \fBsetlocale(LC_ALL, "");\fP
70 .sp
71 so that input/output processing will work.
72 .PP
73 A curses initialization routine such as \fBinitscr\fP must be called
74 before using any of these functions.
75 .
76 .SS "Current Default Values for Field Attributes"
77 .
78 The \fBform\fP library maintains a default value for field attributes.
79 You
80 can get or set this default by calling the appropriate \fBset_\fP
81 or retrieval
82 routine with a
83 .I NULL
84 field pointer.
85 Changing this default with a
86 \fBset_\fP function affects future field creations, but does not change the
87 rendering of fields already created.
88 .
89 .SS "Routine Name Index"
90 .
91 The following table lists each \fBform\fP routine and the name of
92 the manual page on which it is described.
93 Routines flagged with \*(``*\*(''
94 are \fI\%ncurses\fP-specific, not present in SVr4.
95 .PP
96 .TS
97 l l
98 l l .
99 \fBcurses\fP Routine Name Manual Page Name
100 =
101 current_field \fB\%page\fP(3FORM)
102 data_ahead \fB\%data\fP(3FORM)
103 data_behind \fB\%data\fP(3FORM)
104 dup_field \fB\%field_new\fP(3FORM)
105 dynamic_field_info \fB\%field_info\fP(3FORM)
106 field_arg \fB\%field_validation\fP(3FORM)
107 field_back \fB\%field_attributes\fP(3FORM)
108 field_buffer \fB\%field_buffer\fP(3FORM)
109 field_count \fB\%field\fP(3FORM)
110 field_fore \fB\%field_attributes\fP(3FORM)
111 field_index \fB\%page\fP(3FORM)
112 field_info \fB\%field_info\fP(3FORM)
113 field_init \fB\%hook\fP(3FORM)
114 field_just \fB\%field_just\fP(3FORM)
115 field_opts \fB\%field_opts\fP(3FORM)
116 field_opts_off \fB\%field_opts\fP(3FORM)
117 field_opts_on \fB\%field_opts\fP(3FORM)
118 field_pad \fB\%field_attributes\fP(3FORM)
119 field_status \fB\%field_buffer\fP(3FORM)
120 field_term \fB\%hook\fP(3FORM)
121 field_type \fB\%field_validation\fP(3FORM)
122 field_userptr \fB\%field_userptr\fP(3FORM)
123 form_driver \fB\%driver\fP(3FORM)
124 form_driver_w \fB\%driver\fP(3FORM)*
125 form_fields \fB\%field\fP(3FORM)
126 form_init \fB\%hook\fP(3FORM)
127 form_opts \fB\%opts\fP(3FORM)
128 form_opts_off \fB\%opts\fP(3FORM)
129 form_opts_on \fB\%opts\fP(3FORM)
130 form_page \fB\%page\fP(3FORM)
131 form_request_by_name \fB\%requestname\fP(3FORM)*
132 form_request_name \fB\%requestname\fP(3FORM)*
133 form_sub \fB\%win\fP(3FORM)
134 form_term \fB\%hook\fP(3FORM)
135 form_userptr \fB\%userptr\fP(3FORM)
136 form_win \fB\%win\fP(3FORM)
137 free_field \fB\%field_new\fP(3FORM)
138 free_fieldtype \fB\%fieldtype\fP(3FORM)
139 free_form \fB\%new\fP(3FORM)
140 link_field \fB\%field_new\fP(3FORM)
141 link_fieldtype \fB\%fieldtype\fP(3FORM)
142 move_field \fB\%field\fP(3FORM)
143 new_field \fB\%field_new\fP(3FORM)
144 new_fieldtype \fB\%fieldtype\fP(3FORM)
145 new_form \fB\%new\fP(3FORM)
146 new_page \fB\%new_page\fP(3FORM)
147 pos_form_cursor \fB\%cursor\fP(3FORM)
148 post_form \fB\%post\fP(3FORM)
149 scale_form \fB\%win\fP(3FORM)
150 set_current_field \fB\%page\fP(3FORM)
151 set_field_back \fB\%field_attributes\fP(3FORM)
152 set_field_buffer \fB\%field_buffer\fP(3FORM)
153 set_field_fore \fB\%field_attributes\fP(3FORM)
154 set_field_init \fB\%hook\fP(3FORM)
155 set_field_just \fB\%field_just\fP(3FORM)
156 set_field_opts \fB\%field_opts\fP(3FORM)
157 set_field_pad \fB\%field_attributes\fP(3FORM)
158 set_field_status \fB\%field_buffer\fP(3FORM)
159 set_field_term \fB\%hook\fP(3FORM)
160 set_field_type \fB\%field_validation\fP(3FORM)
161 set_field_userptr \fB\%field_userptr\fP(3FORM)
162 set_fieldtype_arg \fB\%fieldtype\fP(3FORM)
163 set_fieldtype_choice \fB\%fieldtype\fP(3FORM)
164 set_form_fields \fB\%field\fP(3FORM)
165 set_form_init \fB\%hook\fP(3FORM)
166 set_form_opts \fB\%field_opts\fP(3FORM)
167 set_form_page \fB\%page\fP(3FORM)
168 set_form_sub \fB\%win\fP(3FORM)
169 set_form_term \fB\%hook\fP(3FORM)
170 set_form_userptr \fB\%userptr\fP(3FORM)
171 set_form_win \fB\%win\fP(3FORM)
172 set_max_field \fB\%field_buffer\fP(3FORM)
173 set_new_page \fB\%new_page\fP(3FORM)
174 unfocus_current_field \fB\%page\fP(3FORM)*
175 unpost_form \fB\%post\fP(3FORM)
176 .TE
177 .SH RETURN VALUE
178 Routines that return pointers return
179 .I NULL
180 on error,
181 and set \fBerrno\fP to the corresponding error-code returned by functions
182 returning an integer.
183 Routines that return
184 an integer return one of the following error codes:
185 .TP 5
186 .B E_OK
187 The routine succeeded.
188 .TP 5
189 .B E_BAD_ARGUMENT
190 Routine detected an incorrect or out-of-range argument.
191 .TP 5
192 .B E_BAD_STATE
193 Routine was called from an initialization or termination function.
194 .TP 5
195 .B E_CONNECTED
196 The field is already connected to a form.
197 .TP 5
198 .B E_INVALID_FIELD
199 Contents of a field are not valid.
200 .TP 5
201 .B E_NOT_CONNECTED
202 No fields are connected to the form.
203 .TP 5
204 .B E_NOT_POSTED
205 The form has not been posted.
206 .TP 5
207 .B E_NO_ROOM
208 Form is too large for its window.
209 .TP 5
210 .B E_POSTED
211 The form is already posted.
212 .TP 5
213 .B E_REQUEST_DENIED
214 The form driver could not process the request.
215 .TP 5
216 .B E_SYSTEM_ERROR
217 System error occurred (see \fBerrno\fP(3)).
218 .TP 5
219 .B E_UNKNOWN_COMMAND
220 The form driver code saw an unknown request code.
221 .SH NOTES
222 The header file \fI\%form.h\fP itself includes \fI\%curses.h\fP.
223 .SH PORTABILITY
224 These routines emulate the System V forms library.
225 They were not supported on
226 Version 7 or BSD versions.
227 .PP
228 A form facility was documented in SVr4.2's
229 \fICharacter User Interface Programming\fP document.
230 .PP
231 It is not part of X/Open Curses.
232 .PP
233 Aside from \fI\%ncurses\fP, there are few implementations:
234 .bP
235 systems based on SVr4 source code, e.g., Solaris.
236 .bP
237 NetBSD curses.
238 .PP
239 A few functions in this implementation are extensions added for
240 \fI\%ncurses\fP,
241 but not provided by other implementations, e.g.,
242 \fBform_driver_w\fP,
243 \fBunfocus_current_field\fP.
244 .SH AUTHORS
245 Juergen Pfeifer.
246 Manual pages and adaptation for \fI\%ncurses\fP by Eric
247 S. Raymond.
248 .SH SEE ALSO
249 \fB\%ncurses\fP(3NCURSES) and related pages whose names begin \*(``form_\*('' for
250 detailed descriptions of the entry points.