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