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