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