1.\" $NetBSD: form_page.3,v 1.10 2010/03/22 21:58:31 joerg Exp $ 2.\" 3.\" Copyright (c) 1999 4.\" Brett Lymn - blymn@baea.com.au, brett_lymn@yahoo.com.au 5.\" 6.\" This code is donated to The NetBSD Foundation by the author. 7.\" 8.\" Redistribution and use in source and binary forms, with or without 9.\" modification, are permitted provided that the following conditions 10.\" are met: 11.\" 1. Redistributions of source code must retain the above copyright 12.\" notice, this list of conditions and the following disclaimer. 13.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" notice, this list of conditions and the following disclaimer in the 15.\" documentation and/or other materials provided with the distribution. 16.\" 3. The name of the Author may not be used to endorse or promote 17.\" products derived from this software without specific prior written 18.\" permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.Dd January 1, 2001 33.Dt FORM_PAGE 3 34.Os 35.Sh NAME 36.Nm current_field , 37.Nm field_index , 38.Nm form_page , 39.Nm form_max_page , 40.Nm set_current_field , 41.Nm set_form_page 42.Nd form library 43.Sh LIBRARY 44.Lb libform 45.Sh SYNOPSIS 46.In form.h 47.Ft FIELD * 48.Fn current_field "FORM *form" 49.Ft int 50.Fn field_index "FIELD *field" 51.Ft int 52.Fn form_page "FORM *form" 53.Ft int 54.Fn form_max_page "FORM *form" 55.Ft int 56.Fn set_current_field "FORM *form" "FIELD *field" 57.Ft int 58.Fn set_form_page "FORM *form" "int page" 59.Sh DESCRIPTION 60The 61.Fn current_field 62returns a pointer to the structure for the field that is currently 63active on the page. 64If there is an error, 65.Fn current_field 66will return 67.Dv NULL . 68Calling 69.Fn field_index 70will return the index of the given field in the form field array. 71The 72current page the form is on can be determined by using 73.Fn form_page , 74the current page of a form can be programmatically set by calling 75.Fn set_form_page . 76The maximum page number for a form can be found by 77calling the function 78.Fn form_max_page 79but note that this function is a 80.Nx 81extension and must not be used in portable forms library programs. 82The current field on the form may be set by calling 83.Fn set_current_field 84which will set the current field to the one given. 85.Sh RETURN VALUES 86Functions returning pointers will return 87.Dv NULL 88if an error is detected. 89The functions that return an int will return one of the following 90error values: 91.Pp 92.Bl -tag -width E_UNKNOWN_COMMAND -compact 93.It Er E_OK 94The function was successful. 95.It Er E_BAD_ARGUMENT 96The function was passed a bad argument. 97.It Er E_NOT_CONNECTED 98The given field is not associated with a form. 99.It Er E_BAD_STATE 100The function was called from within an init or term function. 101.It Er E_INVALID_FIELD 102The field given is not part of the given form. 103.El 104.Sh SEE ALSO 105.Xr curses 3 , 106.Xr forms 3 107.Sh NOTES 108The header 109.In form.h 110automatically includes both 111.In curses.h 112and 113.In eti.h . 114.Pp 115The 116.Nm form_max_page 117is a 118.Nx 119extension and should not be used in portable applications. 120