xref: /netbsd-src/lib/libform/form_page.3 (revision 9fbd88883c38d0c0fbfcbe66d76fe6b0fab3f9de)
1.\"	$NetBSD: form_page.3,v 1.2 2002/01/15 02:50:18 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, 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 <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.  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 NetBSD extension and must not be used
76in portable forms library programs.  The current field on the form may
77be set by calling
78.Fn set_current_field
79which will set the current field to the one given.
80.Sh RETURN VALUES
81Functions returning pointers will return NULL if an error is detected.
82The functions that return an int will return one of the following
83error values:
84.Pp
85.Bl -tag -width E_UNKNOWN_COMMAND -compact
86.It Er E_OK
87The function was successful.
88.It Er E_BAD_ARGUMENT
89The function was passed a bad argument.
90.It Er E_NOT_CONNECTED
91The given field is not associated with a form.
92.It Er E_BAD_STATE
93The function was called from within an init or term function.
94.It Er E_INVALID_FIELD
95The field given is not part of the given form.
96.El
97.Sh SEE ALSO
98.Xr curses 3 ,
99.Xr forms 3
100.Sh NOTES
101The header
102.Pa <form.h>
103automatically includes both
104.Pa <curses.h>
105and
106.Pa <eti.h> .
107.Pp
108The
109.Nm form_max_page
110is a NetBSD extension and should not be used in portable applications.
111