| 1 |
.\"*************************************************************************** |
| 2 |
.\" Copyright 2018-2023,2024 Thomas E. Dickey * |
| 3 |
.\" Copyright 1998-2007,2010 Free Software Foundation, Inc. * |
| 4 |
.\" * |
| 5 |
.\" Permission is hereby granted, free of charge, to any person obtaining a * |
| 6 |
.\" copy of this software and associated documentation files (the * |
| 7 |
.\" "Software"), to deal in the Software without restriction, including * |
| 8 |
.\" without limitation the rights to use, copy, modify, merge, publish, * |
| 9 |
.\" distribute, distribute with modifications, sublicense, and/or sell * |
| 10 |
.\" copies of the Software, and to permit persons to whom the Software is * |
| 11 |
.\" furnished to do so, subject to the following conditions: * |
| 12 |
.\" * |
| 13 |
.\" The above copyright notice and this permission notice shall be included * |
| 14 |
.\" in all copies or substantial portions of the Software. * |
| 15 |
.\" * |
| 16 |
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * |
| 17 |
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * |
| 18 |
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * |
| 19 |
.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * |
| 20 |
.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * |
| 21 |
.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * |
| 22 |
.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * |
| 23 |
.\" * |
| 24 |
.\" Except as contained in this notice, the name(s) of the above copyright * |
| 25 |
.\" holders shall not be used in advertising or otherwise to promote the * |
| 26 |
.\" sale, use or other dealings in this Software without prior written * |
| 27 |
.\" authorization. * |
| 28 |
.\"*************************************************************************** |
| 29 |
.\" |
| 30 |
.\" $Id: form_hook.3x,v 1.39 2024/12/28 21:26:21 tom Exp $ |
| 31 |
.TH hook 3FORM 2024-12-28 "ncurses 6.6" "Library calls" |
| 32 |
.SH NAME |
| 33 |
\fBform_hook\fP \- |
| 34 |
set hooks for automatic invocation by applications |
| 35 |
.SH SYNOPSIS |
| 36 |
.nf |
| 37 |
\fB#include <form.h> |
| 38 |
.PP |
| 39 |
\fBint set_field_init(FORM *\fIform\fP, Form_Hook \fIfunc\fP); |
| 40 |
\fBForm_Hook field_init(const FORM *\fIform\fP); |
| 41 |
.PP |
| 42 |
\fBint set_field_term(FORM *\fIform\fP, Form_Hook \fIfunc\fP); |
| 43 |
\fBForm_Hook field_term(const FORM *\fIform\fP); |
| 44 |
.PP |
| 45 |
\fBint set_form_init(FORM *\fIform\fP, Form_Hook \fIfunc\fP); |
| 46 |
\fBForm_Hook form_init(const FORM *\fIform\fP); |
| 47 |
.PP |
| 48 |
\fBint set_form_term(FORM *\fIform\fP, Form_Hook \fIfunc\fP); |
| 49 |
\fBForm_Hook form_term(const FORM *\fIform\fP); |
| 50 |
.fi |
| 51 |
.SH DESCRIPTION |
| 52 |
These functions make it possible to set hook functions to be called at various |
| 53 |
points in the automatic processing of input event codes by \fBform_driver\fP. |
| 54 |
.SS set_field_init |
| 55 |
sets a hook to be called at form-post time |
| 56 |
and each time the selected field changes (after the change). |
| 57 |
.SS field_init |
| 58 |
returns the current field init hook, if any |
| 59 |
.RI ( NULL |
| 60 |
if there is no such hook). |
| 61 |
.SS set_field_term |
| 62 |
sets a hook to be called at form-unpost time |
| 63 |
and each time the selected field changes (before the change). |
| 64 |
.SS field_term |
| 65 |
returns the current field term hook, if any |
| 66 |
.RI ( NULL |
| 67 |
if there is no such hook). |
| 68 |
.SS set_form_init |
| 69 |
sets a hook to be called at form-post time and |
| 70 |
just after a page change once it is posted. |
| 71 |
.SS form_init |
| 72 |
returns the current form init hook, |
| 73 |
if any |
| 74 |
.RI ( NULL |
| 75 |
if there is no such hook). |
| 76 |
.SS set_form_term |
| 77 |
sets a hook to be called at form-unpost time |
| 78 |
and just before a page change once it is posted. |
| 79 |
.SS form_term |
| 80 |
returns the current form term hook, if any |
| 81 |
.RI ( NULL |
| 82 |
if there is no such hook). |
| 83 |
.SH RETURN VALUE |
| 84 |
Routines that return pointers return |
| 85 |
.I NULL |
| 86 |
on error. |
| 87 |
Other routines |
| 88 |
return one of the following: |
| 89 |
.TP 5 |
| 90 |
.B E_OK |
| 91 |
The routine succeeded. |
| 92 |
.TP 5 |
| 93 |
.B E_SYSTEM_ERROR |
| 94 |
System error occurred (see \fBerrno\fP(3)). |
| 95 |
.SH PORTABILITY |
| 96 |
These routines emulate the System V forms library. |
| 97 |
They were not supported on |
| 98 |
Version 7 or BSD versions. |
| 99 |
.SH AUTHORS |
| 100 |
Juergen Pfeifer. |
| 101 |
Manual pages and adaptation for new curses by Eric S. Raymond. |
| 102 |
.SH SEE ALSO |
| 103 |
\fB\%ncurses\fP(3NCURSES), |
| 104 |
\fB\%form\fP(3FORM) |