xref: /netbsd/lib/libform/form_page.3 (revision bf9ec67e)
1.\"	$NetBSD: form_page.3,v 1.4 2002/02/20 11:30:35 wiz 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.Fd #include \*[Lt]form.h\*[Gt]
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.  If there is an error,
64.Fn current_field
65will return NULL.  Calling
66.Fn field_index
67will return the index of the given field in the form field array.  The
68current page the form is on can be determined by using
69.Fn form_page ,
70the current page of a form can be programmatically set by calling
71.Fn set_form_page .
72The maximum page number for a form can be found by
73calling the function
74.Fn form_max_page
75but note that this function is a
76.Nx
77extension and must not be used
78in portable forms library programs.  The current field on the form may
79be set by calling
80.Fn set_current_field
81which will set the current field to the one given.
82.Sh RETURN VALUES
83Functions returning pointers will return NULL if an error is detected.
84The functions that return an int will return one of the following
85error values:
86.Pp
87.Bl -tag -width E_UNKNOWN_COMMAND -compact
88.It Er E_OK
89The function was successful.
90.It Er E_BAD_ARGUMENT
91The function was passed a bad argument.
92.It Er E_NOT_CONNECTED
93The given field is not associated with a form.
94.It Er E_BAD_STATE
95The function was called from within an init or term function.
96.It Er E_INVALID_FIELD
97The field given is not part of the given form.
98.El
99.Sh SEE ALSO
100.Xr curses 3 ,
101.Xr forms 3
102.Sh NOTES
103The header
104.Pa \*[Lt]form.h\*[Gt]
105automatically includes both
106.Pa \*[Lt]curses.h\*[Gt]
107and
108.Pa \*[Lt]eti.h\*[Gt] .
109.Pp
110The
111.Nm form_max_page
112is a
113.Nx
114extension and should not be used in portable applications.
115