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 (peep errno(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