| 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.43 2024/12/28 21:26:21 tom Exp $ |
| 31 |
.TH field_new 3FORM 2024-12-28 "ncurses 6.6" "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 |
.I NULL |
| 70 |
on error. |
| 71 |
They set \fBerrno\fP according to their success: |
| 72 |
.TP 5 |
| 73 |
.B E_OK |
| 74 |
The routine succeeded. |
| 75 |
.TP 5 |
| 76 |
.B E_BAD_ARGUMENT |
| 77 |
Routine detected an incorrect or out-of-range argument. |
| 78 |
.TP 5 |
| 79 |
.B E_SYSTEM_ERROR |
| 80 |
System error occurred, e.g., malloc failure. |
| 81 |
.PP |
| 82 |
The function \fBfree_field\fP returns one of the following: |
| 83 |
.TP 5 |
| 84 |
.B E_OK |
| 85 |
The routine succeeded. |
| 86 |
.TP 5 |
| 87 |
.B E_BAD_ARGUMENT |
| 88 |
Routine detected an incorrect or out-of-range argument. |
| 89 |
.TP 5 |
| 90 |
.B E_CONNECTED |
| 91 |
field is connected. |
| 92 |
.SH PORTABILITY |
| 93 |
These routines emulate the System V forms library. |
| 94 |
They were not supported on |
| 95 |
Version 7 or BSD versions. |
| 96 |
.PP |
| 97 |
It may be unwise to count on the set of attributes copied by |
| 98 |
\fBdup_field\fP being portable; the System V forms library documents are |
| 99 |
not very explicit about what gets copied and what does not. |
| 100 |
.SH AUTHORS |
| 101 |
Juergen Pfeifer. |
| 102 |
Manual pages and adaptation for new curses by Eric S. Raymond. |
| 103 |
.SH SEE ALSO |
| 104 |
\fB\%ncurses\fP(3NCURSES), |
| 105 |
\fB\%form\fP(3FORM) |