]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/form_field_new.3x
ncurses 6.2 - patch 20210306
[ncurses.git] / man / form_field_new.3x
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright 2018,2020 Thomas E. Dickey                                     *
4 .\" Copyright 1998-2010,2015 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_field_new.3x,v 1.24 2020/10/24 09:09:18 tom Exp $
32 .TH form_field_new 3X ""
33 .SH NAME
34 \fBnew_field\fR,
35 \fBdup_field\fR,
36 \fBlink_field\fR,
37 \fBfree_field\fR \- create and destroy form fields
38 .SH SYNOPSIS
39 \fB#include <form.h>\fR
40 .sp
41 \fBFIELD *new_field(int \fP\fIheight\fP\fB, int \fP\fIwidth\fP\fB,\fP
42                  \fBint \fP\fItoprow\fP\fB, int \fP\fIleftcol\fP\fB,\fP
43                  \fBint \fP\fIoffscreen\fP\fB, int \fP\fInbuffers\fP\fB);\fP
44 .br
45 \fBFIELD *dup_field(FIELD *\fP\fIfield\fP\fB, int \fP\fItoprow\fP\fB, int \fP\fIleftcol\fP\fB);\fP
46 .br
47 \fBFIELD *link_field(FIELD *\fP\fIfield\fP\fB, int \fP\fItoprow\fP\fB, int \fP\fIleftcol\fP\fB);\fP
48 .br
49 \fBint free_field(FIELD *\fP\fIfield\fP\fB);\fP
50 .br
51 .SH DESCRIPTION
52 The function \fBnew_field\fR allocates a new field and initializes it from the
53 parameters given: height, width, row of upper-left corner, column of upper-left
54 corner, number off-screen rows, and number of additional working buffers.
55 .PP
56 The function \fBdup_field\fR duplicates a field at a new location.
57 Most
58 attributes (including current contents, size, validation type, buffer count,
59 growth threshold, justification, foreground, background, pad character,
60 options, and user pointer) are copied.
61 Field status and the field page bit are
62 not copied.
63 .PP
64 The function \fBlink_field\fR acts like \fBdup_field\fR, but the new field
65 shares buffers with its parent.
66 Attribute data is separate.
67 .PP
68 The function \fBfree_field\fR de-allocates storage associated with a field.
69 .SH RETURN VALUE
70 The functions \fBnew_field\fR, \fBdup_field\fR, \fBlink_field\fR return
71 \fBNULL\fR on error.
72 They set \fBerrno\fP according to their success:
73 .TP 5
74 .B E_OK
75 The routine succeeded.
76 .TP 5
77 .B E_BAD_ARGUMENT
78 Routine detected an incorrect or out-of-range argument.
79 .TP 5
80 .B E_SYSTEM_ERROR
81 System error occurred, e.g., malloc failure.
82 .PP
83 The function \fBfree_field\fR returns one of the following:
84 .TP 5
85 .B E_OK
86 The routine succeeded.
87 .TP 5
88 .B E_BAD_ARGUMENT
89 Routine detected an incorrect or out-of-range argument.
90 .TP 5
91 .B E_CONNECTED
92 field is connected.
93 .SH SEE ALSO
94 \fBcurses\fR(3X), \fBform\fR(3X).
95 .SH NOTES
96 The header file \fB<form.h>\fR automatically includes the header file
97 \fB<curses.h>\fR.
98 .SH PORTABILITY
99 These routines emulate the System V forms library.
100 They were not supported on
101 Version 7 or BSD versions.
102 .PP
103 It may be unwise to count on the set of attributes copied by
104 \fBdup_field\fR being portable; the System V forms library documents are
105 not very explicit about what gets copied and what does not.
106 .SH AUTHORS
107 Juergen Pfeifer.
108 Manual pages and adaptation for new curses by Eric S. Raymond.