1form(3X) form(3X)
2
3
4
6 form - curses extension for programming forms
7
9 #include <form.h>
10
12 The form library provides terminal-independent facilities for composing
13 form screens on character-cell terminals. The library includes: field
14 routines, which create and modify form fields; and form routines, which
15 group fields into forms, display forms on the screen, and handle inter‐
16 action with the user.
17
18 The form library uses the curses libraries. To use the form library,
19 link with the options -lform -lcurses.
20
21 Your program should set up the locale, e.g.,
22
23 setlocale(LC_ALL, "");
24
25 so that input/output processing will work.
26
27 A curses initialization routine such as initscr must be called before
28 using any of these functions.
29
30 Current Default Values for Field Attributes
31 The form library maintains a default value for field attributes. You
32 can get or set this default by calling the appropriate set_ or re‐
33 trieval routine with a NULL field pointer. Changing this default with
34 a set_ function affects future field creations, but does not change the
35 rendering of fields already created.
36
37 Routine Name Index
38 The following table lists each form routine and the name of the manual
39 page on which it is described. Routines flagged with “*” are ncurses-
40 specific, not present in SVr4.
41
42 curses Routine Name Manual Page Name
43 ──────────────────────────────────────────────────
44 current_field form_page(3X)
45 data_ahead form_data(3X)
46 data_behind form_data(3X)
47 dup_field form_field_new(3X)
48 dynamic_field_info form_field_info(3X)
49 field_arg form_field_validation(3X)
50 field_back form_field_attributes(3X)
51 field_buffer form_field_buffer(3X)
52 field_count form_field(3X)
53 field_fore form_field_attributes(3X)
54 field_index form_page(3X)
55 field_info form_field_info(3X)
56 field_init form_hook(3X)
57 field_just form_field_just(3X)
58 field_opts form_field_opts(3X)
59 field_opts_off form_field_opts(3X)
60 field_opts_on form_field_opts(3X)
61 field_pad form_field_attributes(3X)
62 field_status form_field_buffer(3X)
63 field_term form_hook(3X)
64 field_type form_field_validation(3X)
65 field_userptr form_field_userptr(3X)
66
67 form_driver form_driver(3X)
68 form_driver_w form_driver(3X)*
69 form_fields form_field(3X)
70 form_init form_hook(3X)
71 form_opts form_opts(3X)
72 form_opts_off form_opts(3X)
73 form_opts_on form_opts(3X)
74 form_page form_page(3X)
75 form_request_by_name form_requestname(3X)*
76 form_request_name form_requestname(3X)*
77 form_sub form_win(3X)
78 form_term form_hook(3X)
79 form_userptr form_userptr(3X)
80 form_win form_win(3X)
81 free_field form_field_new(3X)
82 free_fieldtype form_fieldtype(3X)
83 free_form form_new(3X)
84 link_field form_field_new(3X)
85 link_fieldtype form_fieldtype(3X)
86 move_field form_field(3X)
87 new_field form_field_new(3X)
88 new_fieldtype form_fieldtype(3X)
89 new_form form_new(3X)
90 new_page form_new_page(3X)
91 pos_form_cursor form_cursor(3X)
92 post_form form_post(3X)
93 scale_form form_win(3X)
94 set_current_field form_page(3X)
95 set_field_back form_field_attributes(3X)
96 set_field_buffer form_field_buffer(3X)
97 set_field_fore form_field_attributes(3X)
98 set_field_init form_hook(3X)
99 set_field_just form_field_just(3X)
100 set_field_opts form_field_opts(3X)
101 set_field_pad form_field_attributes(3X)
102 set_field_status form_field_buffer(3X)
103 set_field_term form_hook(3X)
104 set_field_type form_field_validation(3X)
105 set_field_userptr form_field_userptr(3X)
106 set_fieldtype_arg form_fieldtype(3X)
107 set_fieldtype_choice form_fieldtype(3X)
108 set_form_fields form_field(3X)
109 set_form_init form_hook(3X)
110 set_form_opts form_field_opts(3X)
111 set_form_page form_page(3X)
112 set_form_sub form_win(3X)
113 set_form_term form_hook(3X)
114 set_form_userptr form_userptr(3X)
115 set_form_win form_win(3X)
116 set_max_field form_field_buffer(3X)
117 set_new_page form_new_page(3X)
118 unfocus_current_field form_page(3X)*
119 unpost_form form_post(3X)
120
122 Routines that return pointers return NULL on error, and set errno to
123 the corresponding error-code returned by functions returning an inte‐
124 ger. Routines that return an integer return one of the following error
125 codes:
126
127 E_OK The routine succeeded.
128
129 E_BAD_ARGUMENT
130 Routine detected an incorrect or out-of-range argument.
131
132 E_BAD_STATE
133 Routine was called from an initialization or termination function.
134
135 E_CONNECTED
136 The field is already connected to a form.
137
138 E_INVALID_FIELD
139 Contents of a field are not valid.
140
141 E_NOT_CONNECTED
142 No fields are connected to the form.
143
144 E_NOT_POSTED
145 The form has not been posted.
146
147 E_NO_ROOM
148 Form is too large for its window.
149
150 E_POSTED
151 The form is already posted.
152
153 E_REQUEST_DENIED
154 The form driver could not process the request.
155
156 E_SYSTEM_ERROR
157 System error occurred (see errno(3)).
158
159 E_UNKNOWN_COMMAND
160 The form driver code saw an unknown request code.
161
163 The header file <form.h> automatically includes the header files
164 <curses.h> and <eti.h>.
165
166 In your library list, libform.a should be before libncurses.a; that is,
167 you want to say “-lform -lncurses”, not the other way around (which
168 would give you a link error when using static libraries).
169
171 These routines emulate the System V forms library. They were not sup‐
172 ported on Version 7 or BSD versions.
173
174 The menu facility was documented in SVr4.2 in Character User Interface
175 Programming (UNIX SVR4.2).
176
177 It is not part of X/Open Curses.
178
179 Aside from ncurses, there are few implementations:
180
181 • systems based on SVr4 source code, e.g., Solaris.
182
183 • NetBSD curses.
184
185 A few functions in this implementation are extensions added for
186 ncurses, but not provided by other implementations, e.g.,
187 form_driver_w, unfocus_current_field.
188
190 Juergen Pfeifer. Manual pages and adaptation for ncurses by Eric S.
191 Raymond.
192
194 curses(3X) and related pages whose names begin “form_” for detailed de‐
195 scriptions of the entry points.
196
197 This describes ncurses version 6.2 (patch 20210508).
198
199
200
201 form(3X)