1*a0e6850fSThomas Cort.\" $NetBSD: form_field_new.3,v 1.11 2010/03/22 21:58:31 joerg Exp $ 2*a0e6850fSThomas Cort.\" 3*a0e6850fSThomas Cort.\" Copyright (c) 2001 4*a0e6850fSThomas Cort.\" Brett Lymn - blymn@baea.com.au, brett_lymn@yahoo.com.au 5*a0e6850fSThomas Cort.\" 6*a0e6850fSThomas Cort.\" This code is donated to The NetBSD Foundation by the author. 7*a0e6850fSThomas Cort.\" 8*a0e6850fSThomas Cort.\" Redistribution and use in source and binary forms, with or without 9*a0e6850fSThomas Cort.\" modification, are permitted provided that the following conditions 10*a0e6850fSThomas Cort.\" are met: 11*a0e6850fSThomas Cort.\" 1. Redistributions of source code must retain the above copyright 12*a0e6850fSThomas Cort.\" notice, this list of conditions and the following disclaimer. 13*a0e6850fSThomas Cort.\" 2. Redistributions in binary form must reproduce the above copyright 14*a0e6850fSThomas Cort.\" notice, this list of conditions and the following disclaimer in the 15*a0e6850fSThomas Cort.\" documentation and/or other materials provided with the distribution. 16*a0e6850fSThomas Cort.\" 3. The name of the Author may not be used to endorse or promote 17*a0e6850fSThomas Cort.\" products derived from this software without specific prior written 18*a0e6850fSThomas Cort.\" permission. 19*a0e6850fSThomas Cort.\" 20*a0e6850fSThomas Cort.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND 21*a0e6850fSThomas Cort.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22*a0e6850fSThomas Cort.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23*a0e6850fSThomas Cort.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 24*a0e6850fSThomas Cort.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25*a0e6850fSThomas Cort.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26*a0e6850fSThomas Cort.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27*a0e6850fSThomas Cort.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28*a0e6850fSThomas Cort.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29*a0e6850fSThomas Cort.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30*a0e6850fSThomas Cort.\" SUCH DAMAGE. 31*a0e6850fSThomas Cort.\" 32*a0e6850fSThomas Cort.Dd January 1, 2001 33*a0e6850fSThomas Cort.Dt FORMS 3 34*a0e6850fSThomas Cort.Os 35*a0e6850fSThomas Cort.Sh NAME 36*a0e6850fSThomas Cort.Nm dup_field , 37*a0e6850fSThomas Cort.Nm free_field , 38*a0e6850fSThomas Cort.Nm link_field , 39*a0e6850fSThomas Cort.Nm new_field 40*a0e6850fSThomas Cort.Nd form library 41*a0e6850fSThomas Cort.Sh LIBRARY 42*a0e6850fSThomas Cort.Lb libform 43*a0e6850fSThomas Cort.Sh SYNOPSIS 44*a0e6850fSThomas Cort.In form.h 45*a0e6850fSThomas Cort.Ft FIELD * 46*a0e6850fSThomas Cort.Fn dup_field "FIELD *field" "int frow" "int fcol" 47*a0e6850fSThomas Cort.Ft int 48*a0e6850fSThomas Cort.Fn free_field "FIELD *field" 49*a0e6850fSThomas Cort.Ft FIELD * 50*a0e6850fSThomas Cort.Fn link_field "FIELD *field" "int frow" "int fcol" 51*a0e6850fSThomas Cort.Ft FIELD * 52*a0e6850fSThomas Cort.Fo new_field 53*a0e6850fSThomas Cort.Fa "int rows" 54*a0e6850fSThomas Cort.Fa "int cols" 55*a0e6850fSThomas Cort.Fa "int frow" 56*a0e6850fSThomas Cort.Fa "int fcol" 57*a0e6850fSThomas Cort.Fa "int nrows" 58*a0e6850fSThomas Cort.Fa "int nbuf" 59*a0e6850fSThomas Cort.Fc 60*a0e6850fSThomas Cort.Sh DESCRIPTION 61*a0e6850fSThomas CortThe 62*a0e6850fSThomas Cort.Fn dup_field 63*a0e6850fSThomas Cortfunction duplicates the given field, including any buffers associated 64*a0e6850fSThomas Cortwith the field and returns the pointer to the newly created field. 65*a0e6850fSThomas Cort.Fn free_field 66*a0e6850fSThomas Cortdestroys the field and frees any allocated resources associated with 67*a0e6850fSThomas Cortthe field. 68*a0e6850fSThomas CortThe function 69*a0e6850fSThomas Cort.Fn link_field 70*a0e6850fSThomas Cortcopies the given field to a new field at the location 71*a0e6850fSThomas Cort.Fa frow 72*a0e6850fSThomas Cortand 73*a0e6850fSThomas Cort.Fa fcol 74*a0e6850fSThomas Cortbut shares the buffers with the original field. 75*a0e6850fSThomas Cort.Fn new_field 76*a0e6850fSThomas Cortcreates a new field of size 77*a0e6850fSThomas Cort.Fa rows 78*a0e6850fSThomas Cortby 79*a0e6850fSThomas Cort.Fa cols 80*a0e6850fSThomas Cortat location 81*a0e6850fSThomas Cort.Fa frow , 82*a0e6850fSThomas Cort.Fa fcol 83*a0e6850fSThomas Corton the page, the argument 84*a0e6850fSThomas Cort.Fa nrows 85*a0e6850fSThomas Cortspecified the number of off screen rows the field has and the 86*a0e6850fSThomas Cort.Fa nbuf 87*a0e6850fSThomas Cortparameter specifies the number of extra buffers attached to the 88*a0e6850fSThomas Cortfield. 89*a0e6850fSThomas CortThere will always be one buffer associated with a field. 90*a0e6850fSThomas Cort.Sh RETURN VALUES 91*a0e6850fSThomas CortOn error 92*a0e6850fSThomas Cort.Fn dup_field 93*a0e6850fSThomas Cortand 94*a0e6850fSThomas Cort.Fn new_field 95*a0e6850fSThomas Cortwill return 96*a0e6850fSThomas Cort.Dv NULL . 97*a0e6850fSThomas CortThe functions will one of the following error 98*a0e6850fSThomas Cortvalues: 99*a0e6850fSThomas Cort.Pp 100*a0e6850fSThomas Cort.Bl -tag -width E_UNKNOWN_COMMAND -compact 101*a0e6850fSThomas Cort.It Er E_OK 102*a0e6850fSThomas CortThe function was successful. 103*a0e6850fSThomas Cort.It Er E_BAD_ARGUMENT 104*a0e6850fSThomas CortA bad argument was passed to the function. 105*a0e6850fSThomas Cort.It Er E_CONNECTED 106*a0e6850fSThomas CortThe field is connected to a form. 107*a0e6850fSThomas Cort.El 108*a0e6850fSThomas Cort.Sh SEE ALSO 109*a0e6850fSThomas Cort.Xr curses 3 , 110*a0e6850fSThomas Cort.Xr forms 3 111*a0e6850fSThomas Cort.Sh NOTES 112*a0e6850fSThomas CortThe header 113*a0e6850fSThomas Cort.In form.h 114*a0e6850fSThomas Cortautomatically includes both 115*a0e6850fSThomas Cort.In curses.h 116*a0e6850fSThomas Cortand 117*a0e6850fSThomas Cort.In eti.h . 118