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