1form(3X)                                                              form(3X)
2
3
4

NAME

6       form - curses extension for programming forms
7

SYNOPSIS

9       #include <form.h>
10

DESCRIPTION

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
33       retrieval  routine  with  a  NULL field pointer.  Changing this default
34       with a set_ function affects  future  field  creations,  but  does  not
35       change the 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.
40
41       curses Routine Name     Manual Page Name
42       ──────────────────────────────────────────────────
43       current_field           form_page(3X)
44       data_ahead              form_data(3X)
45       data_behind             form_data(3X)
46       dup_field               form_field_new(3X)
47       dynamic_field_info      form_field_info(3X)
48       field_arg               form_field_validation(3X)
49       field_back              form_field_attributes(3X)
50       field_buffer            form_field_buffer(3X)
51       field_count             form_field(3X)
52       field_fore              form_field_attributes(3X)
53       field_index             form_page(3X)
54       field_info              form_field_info(3X)
55       field_init              form_hook(3X)
56       field_just              form_field_just(3X)
57       field_opts              form_field_opts(3X)
58       field_opts_off          form_field_opts(3X)
59       field_opts_on           form_field_opts(3X)
60       field_pad               form_field_attributes(3X)
61       field_status            form_field_buffer(3X)
62       field_term              form_hook(3X)
63       field_type              form_field_validation(3X)
64       field_userptr           form_field_userptr(3X)
65       form_driver             form_driver(3X)
66
67       form_driver_w           form_driver(3X)*
68       form_fields             form_field(3X)
69       form_init               form_hook(3X)
70       form_opts               form_opts(3X)
71       form_opts_off           form_opts(3X)
72       form_opts_on            form_opts(3X)
73       form_page               form_page(3X)
74       form_request_by_name    form_requestname(3X)
75       form_request_name       form_requestname(3X)
76       form_sub                form_win(3X)
77       form_term               form_hook(3X)
78       form_userptr            form_userptr(3X)
79       form_win                form_win(3X)
80       free_field              form_field_new(3X)
81       free_fieldtype          form_fieldtype(3X)
82       free_form               form_new(3X)
83       link_field              form_field_new(3X)
84       link_fieldtype          form_fieldtype(3X)
85       move_field              form_field(3X)
86       new_field               form_field_new(3X)
87       new_fieldtype           form_fieldtype(3X)
88       new_form                form_new(3X)
89       new_page                form_new_page(3X)
90       pos_form_cursor         form_cursor(3X)
91       post_form               form_post(3X)
92       scale_form              form_win(3X)
93       set_current_field       form_page(3X)
94       set_field_back          form_field_attributes(3X)
95       set_field_buffer        form_field_buffer(3X)
96       set_field_fore          form_field_attributes(3X)
97       set_field_init          form_hook(3X)
98       set_field_just          form_field_just(3X)
99       set_field_opts          form_field_opts(3X)
100       set_field_pad           form_field_attributes(3X)
101       set_field_status        form_field_buffer(3X)
102       set_field_term          form_hook(3X)
103       set_field_type          form_field_validation(3X)
104       set_field_userptr       form_field_userptr(3X)
105       set_fieldtype_arg       form_fieldtype(3X)
106       set_fieldtype_choice    form_fieldtype(3X)
107       set_form_fields         form_field(3X)
108       set_form_init           form_hook(3X)
109       set_form_opts           form_field_opts(3X)
110       set_form_page           form_page(3X)
111       set_form_sub            form_win(3X)
112       set_form_term           form_hook(3X)
113       set_form_userptr        form_userptr(3X)
114       set_form_win            form_win(3X)
115       set_max_field           form_field_buffer(3X)
116       set_new_page            form_new_page(3X)
117       unfocus_current_field   form_page(3X)
118       unpost_form             form_post(3X)
119

RETURN VALUE

121       Routines that return pointers return NULL on error, and  set  errno  to
122       the  corresponding  error-code returned by functions returning an inte‐
123       ger.  Routines that return an integer return one of the following error
124       codes:
125
126       E_OK The routine succeeded.
127
128       E_BAD_ARGUMENT
129            Routine detected an incorrect or out-of-range argument.
130
131       E_BAD_STATE
132            Routine was called from an initialization or termination function.
133
134       E_CONNECTED
135            The field is already connected to a form.
136
137       E_INVALID_FIELD
138            Contents of a field are not valid.
139
140       E_NOT_CONNECTED
141            No fields are connected to the form.
142
143       E_NOT_POSTED
144            The form has not been posted.
145
146       E_NO_ROOM
147            Form is too large for its window.
148
149       E_POSTED
150            The form is already posted.
151
152       E_REQUEST_DENIED
153            The form driver could not process the request.
154
155       E_SYSTEM_ERROR
156            System error occurred (see errno(3)).
157
158       E_UNKNOWN_COMMAND
159            The form driver code saw an unknown request code.
160

NOTES

162       The  header  file  <form.h>  automatically  includes  the  header files
163       <curses.h> and <eti.h>.
164
165       In your library list, libform.a should be before libncurses.a; that is,
166       you  want  to  say  “-lform -lncurses”, not the other way around (which
167       would give you a link error when using static libraries).
168

PORTABILITY

170       These routines emulate the System V forms library.  They were not  sup‐
171       ported on Version 7 or BSD versions.
172
173       The  menu facility was documented in SVr4.2 in Character User Interface
174       Programming (UNIX SVR4.2).
175
176       It is not part of X/Open Curses.
177
178       Aside from ncurses, there are few implementations:
179
180       ·   systems based on SVr4 source code, e.g., Solaris.
181
182       ·   NetBSD curses.
183
184       A few  functions  in  this  implementation  are  extensions  added  for
185       ncurses,   but   not   provided   by   other   implementations,   e.g.,
186       form_driver_w, unfocus_current_field.
187

AUTHORS

189       Juergen Pfeifer.  Manual pages and adaptation for ncurses  by  Eric  S.
190       Raymond.
191

SEE ALSO

193       curses(3X)  and  related  pages  whose names begin "form_" for detailed
194       descriptions of the entry points.
195
196       This describes ncurses version 6.1 (patch 20190803).
197
198
199
200                                                                      form(3X)
Impressum