1*f63b030cSjoerg.\" $NetBSD: form_hook.3,v 1.10 2010/03/22 21:58:31 joerg Exp $ 2e1a3174bSblymn.\" 3e1a3174bSblymn.\" Copyright (c) 2001 4e1a3174bSblymn.\" Brett Lymn - blymn@baea.com.au, brett_lymn@yahoo.com.au 5e1a3174bSblymn.\" 6e1a3174bSblymn.\" This code is donated to The NetBSD Foundation by the author. 7e1a3174bSblymn.\" 8e1a3174bSblymn.\" Redistribution and use in source and binary forms, with or without 9e1a3174bSblymn.\" modification, are permitted provided that the following conditions 10e1a3174bSblymn.\" are met: 11e1a3174bSblymn.\" 1. Redistributions of source code must retain the above copyright 12e1a3174bSblymn.\" notice, this list of conditions and the following disclaimer. 13e1a3174bSblymn.\" 2. Redistributions in binary form must reproduce the above copyright 14e1a3174bSblymn.\" notice, this list of conditions and the following disclaimer in the 15e1a3174bSblymn.\" documentation and/or other materials provided with the distribution. 16e1a3174bSblymn.\" 3. The name of the Author may not be used to endorse or promote 17e1a3174bSblymn.\" products derived from this software without specific prior written 18e1a3174bSblymn.\" permission. 19e1a3174bSblymn.\" 20e1a3174bSblymn.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND 21e1a3174bSblymn.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22e1a3174bSblymn.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23e1a3174bSblymn.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 24e1a3174bSblymn.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25e1a3174bSblymn.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26e1a3174bSblymn.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27e1a3174bSblymn.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28e1a3174bSblymn.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29e1a3174bSblymn.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30e1a3174bSblymn.\" SUCH DAMAGE. 31e1a3174bSblymn.\" 320b7fe888Swiz.Dd January 1, 2001 33e1a3174bSblymn.Dt FORMS 3 34e1a3174bSblymn.Os 35e1a3174bSblymn.Sh NAME 36e1a3174bSblymn.Nm field_init , 37e1a3174bSblymn.Nm field_term , 38e1a3174bSblymn.Nm form_init , 39e1a3174bSblymn.Nm form_term , 40e1a3174bSblymn.Nm set_field_init , 41e1a3174bSblymn.Nm set_field_term , 42e1a3174bSblymn.Nm set_form_init , 43e1a3174bSblymn.Nm set_form_term 44e1a3174bSblymn.Nd form library 45e1a3174bSblymn.Sh LIBRARY 46e1a3174bSblymn.Lb libform 47e1a3174bSblymn.Sh SYNOPSIS 48472351e1Swiz.In form.h 49e1a3174bSblymn.Ft void (*)(FORM *) 50e1a3174bSblymn.Fn field_init "FORM *form" 51e1a3174bSblymn.Ft void (*)(FORM *) 52e1a3174bSblymn.Fn field_term "FORM *form" 53e1a3174bSblymn.Ft void (*)(FORM *) 54e1a3174bSblymn.Fn form_init "FORM *form" 55e1a3174bSblymn.Ft void (*)(FORM *) 56e1a3174bSblymn.Fn form_term "FORM *form" 57e1a3174bSblymn.Ft int 586bce40bcSwiz.Fn set_field_init "FORM *form" "void (*function)(FORM *)" 59e1a3174bSblymn.Ft int 606bce40bcSwiz.Fn set_field_term "FORM *form" "void (*function)(FORM *)" 61e1a3174bSblymn.Ft int 626bce40bcSwiz.Fn set_form_init "FORM *form" "void (*function)(FORM *)" 63e1a3174bSblymn.Ft int 646bce40bcSwiz.Fn set_form_term "FORM *form" "void (*function)(FORM *)" 65e1a3174bSblymn.Sh DESCRIPTION 66e1a3174bSblymnThe 67e1a3174bSblymn.Fn field_init 68e1a3174bSblymnfunction returns a pointer to the function that will be called just 69e1a3174bSblymnafter the current field changes and just before the form is posted, 70e1a3174bSblymnthis function may be set by using the 71e1a3174bSblymn.Fn set_field_init 7203c12ea0Swizfunction. 7303c12ea0SwizSimilarly, the function 74e1a3174bSblymn.Fn field_term 75e1a3174bSblymnwill return a pointer to the function that will be called just before 76e1a3174bSblymnthe current field changes and just after the form is unposted, this 77e1a3174bSblymnfunction pointer may be set by using the 78e1a3174bSblymn.Fn set_field_term 7903c12ea0Swizfunction. 8003c12ea0SwizThe 81e1a3174bSblymn.Fn form_init 82e1a3174bSblymnfunction will return a pointer to the function that will be called 83e1a3174bSblymnjust before the form is posted to the screen, this function can be set 84e1a3174bSblymnby calling the 85e1a3174bSblymn.Fn set_form_init 8603c12ea0Swizfunction. 8703c12ea0SwizThe 88e1a3174bSblymn.Fn form_term 89e1a3174bSblymnfunction will return a pointer to the function that will be called 90e1a3174bSblymnjust after the form is unposted from the screen, this function may be 91e1a3174bSblymnset by using the 92e1a3174bSblymn.Fn set_form_term 9303c12ea0Swizfunction. 94f91573afSwizBy default, the init and term function pointers are 95f91573afSwiz.Dv NULL . 96e1a3174bSblymn.Sh RETURN VALUES 97f91573afSwizFunctions returning pointers will return 98f91573afSwiz.Dv NULL 99f91573afSwizif an error is detected. 100e1a3174bSblymnThe functions that return an int will return one of the following error 101e1a3174bSblymnvalues: 102e1a3174bSblymn.Pp 103e1a3174bSblymn.Bl -tag -width E_UNKNOWN_COMMAND -compact 104e1a3174bSblymn.It Er E_OK 105e1a3174bSblymnThe function was successful. 106e1a3174bSblymn.El 107e1a3174bSblymn.Sh SEE ALSO 108e1a3174bSblymn.Xr curses 3 , 109e1a3174bSblymn.Xr forms 3 110e1a3174bSblymn.Sh NOTES 111e1a3174bSblymnThe header 112*f63b030cSjoerg.In form.h 113e1a3174bSblymnautomatically includes both 114*f63b030cSjoerg.In curses.h 115e1a3174bSblymnand 116*f63b030cSjoerg.In eti.h . 117