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