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