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