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