form_hook(3X)
β¨ form_hook β bestie, we're setting HOOKS β¨
okay so first of all, the vibe: this page lives in the 3X library calls section of the manual, and it's literally called form_hook. That's the whole name. We're talking hooks that get invoked automatically by your application, no cap. πͺπ
πΈ SYNOPSIS πΈ
#include <form.h>
int set_field_init(FORM *form, Form_Hook func);
Form_Hook field_init(const FORM *form);
int set_field_term(FORM *form, Form_Hook func);
Form_Hook field_term(const FORM *form);
int set_form_init(FORM *form, Form_Hook func);
Form_Hook form_init(const FORM *form);
int set_form_term(FORM *form, Form_Hook func);
Form_Hook form_term(const FORM *form);
π DESCRIPTION π
So basically these functions let you attach hook functions β lil callback besties β that get called at β¨various pointsβ¨ during the automatic processing of input event codes by form_driver. It's giving "surprise, you're running now". π
π¦ set_field_init
sets a hook to be called at form-post time and each time the selected field changes (after the change). Not before. After. We're very precise here. π
π¦ field_init
returns the current field init hook, if any β and it's NULL if there is no such hook. No hook? No problem, just NULL. π
π¦ set_field_term
sets a hook to be called at form-unpost time and each time the selected field changes (before the change). Yeah, this one's the before twin. Iconic symmetry honestly. β¨
π¦ field_term
returns the current field term hook, if any β NULL if there is no such hook. π«Ά
π¦ set_form_init
sets a hook to be called at form-post time and just after a page change once it is posted. Page change girlies, this one's for you. ππ«
π¦ form_init
returns the current form init hook, if any β NULL if there is no such hook. π
π¦ set_form_term
sets a hook to be called at form-unpost time and just before a page change once it is posted. Again with the before/after duality, we love a theme. π₯
π¦ form_term
returns the current form term hook, if any β NULL if there is no such hook. π
π RETURN VALUE π
The routines that return pointers return NULL on error. Everybody else returns one of these cuties:
E_OKβ the routine succeeded. slay. βE_SYSTEM_ERRORβ a system error occurred (peeperrno(3)for the deets). π
π PORTABILITY π
These routines emulate the System V forms library. They were not supported on Version 7 or BSD versions. So likeβ¦ if you're on ancient BSD, this is not your moment, bestie. π
π«Ά AUTHORS π«Ά
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. Kings, both of them. π
π SEE ALSO π
curses(3X)form(3X)
and that's the whole page, bestie π this one shipped with ncurses 6.6 and it's dated 2024-12-28 β so go forth, set those hooks, and let form_driver do its lil automatic thing. periodt. β¨π
π¦ where this page comes from
- alpine 3.24: ncurses-doc 6.6_p20260516-r0 Β· X11
- arch rolling: ncurses 6.6-2 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- Copyright 2018-2023,2024 Thomas E. Dickey
- Copyright 1998-2007,2010 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms