jcs's openbsd hax
openbsd
1'\" t
2.\" $OpenBSD: form_new.3,v 1.10 2023/10/17 09:52:10 nicm Exp $
3.\"
4.\"***************************************************************************
5.\" Copyright 2018-2022,2023 Thomas E. Dickey *
6.\" Copyright 1998-2010,2015 Free Software Foundation, Inc. *
7.\" *
8.\" Permission is hereby granted, free of charge, to any person obtaining a *
9.\" copy of this software and associated documentation files (the *
10.\" "Software"), to deal in the Software without restriction, including *
11.\" without limitation the rights to use, copy, modify, merge, publish, *
12.\" distribute, distribute with modifications, sublicense, and/or sell *
13.\" copies of the Software, and to permit persons to whom the Software is *
14.\" furnished to do so, subject to the following conditions: *
15.\" *
16.\" The above copyright notice and this permission notice shall be included *
17.\" in all copies or substantial portions of the Software. *
18.\" *
19.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
20.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
21.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
22.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
23.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
24.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
25.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
26.\" *
27.\" Except as contained in this notice, the name(s) of the above copyright *
28.\" holders shall not be used in advertising or otherwise to promote the *
29.\" sale, use or other dealings in this Software without prior written *
30.\" authorization. *
31.\"***************************************************************************
32.\"
33.\" $Id: form_new.3,v 1.10 2023/10/17 09:52:10 nicm Exp $
34.TH form_new 3 2023-07-01 "ncurses 6.4" "Library calls"
35.SH NAME
36\fBnew_form\fP,
37\fBfree_form\fP \- create and destroy forms
38.SH SYNOPSIS
39\fB#include <form.h>\fP
40.sp
41\fBFORM *new_form(FIELD **\fIfields\fB);\fR
42.br
43\fBint free_form(FORM *\fIform\fB);\fR
44.SH DESCRIPTION
45The function \fBnew_form\fP creates a new form connected to a specified field
46pointer array (which must be \fBNULL\fP-terminated).
47.PP
48The function \fBfree_form\fP disconnects \fIform\fP from its field array
49and frees the storage allocated for the form.
50.SH RETURN VALUE
51The function \fBnew_form\fP returns \fBNULL\fP on error.
52It sets \fBerrno\fP according to the function's success:
53.TP 5
54.B E_OK
55The routine succeeded.
56.TP 5
57.B E_BAD_ARGUMENT
58Routine detected an incorrect or out-of-range argument.
59.TP 5
60.B E_CONNECTED
61The field is already connected to a form.
62.TP 5
63.B E_SYSTEM_ERROR
64System error occurred, e.g., malloc failure.
65.PP
66The function \fBfree_form\fP returns one of the following:
67.TP 5
68.B E_OK
69The routine succeeded.
70.TP 5
71.B E_BAD_ARGUMENT
72Routine detected an incorrect or out-of-range argument.
73.TP 5
74.B E_POSTED
75The form has already been posted.
76.SH SEE ALSO
77\fBcurses\fP(3), \fBform\fP(3).
78.SH NOTES
79The header file \fB<form.h>\fP automatically includes the header file
80\fB<curses.h>\fP.
81.SH PORTABILITY
82These routines emulate the System V forms library.
83They were not supported on
84Version 7 or BSD versions.
85.SH AUTHORS
86Juergen Pfeifer.
87Manual pages and adaptation for new curses by Eric S. Raymond.