hook(3FORM)

✨ hook(3FORM) ✨

okay bestie, welcome to hook(3FORM) β€” the page about hooks, and no, not the kind that get you a boyfie, the kind that fire off automatically while form_driver is doing its little thing πŸ’…


🌸 NAME 🌸

form_hook β€” set hooks for automatic invocation by applications. literally the "hey bestie, when X happens, run this" API πŸŽ€


πŸ¦‹ 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 like. These functions make it possible to set hook functions to be called at various points in the automatic processing of input event codes by form_driver. it's giving "automate the vibe" ✨

🫢 set_field_init

sets a hook to be called at form-post time and each time the selected field changes (after the change). it's post-change gossip fr fr πŸ‘‘

🌈 field_init

returns the current field init hook, if any (NULL if there is no such hook). no hook? no problem, you just get NULL πŸ₯²

πŸ“ set_field_term

sets a hook to be called at form-unpost time and each time the selected field changes (before the change). pre-change era, we love a heads-up πŸ’…

🧚 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? she's already on it πŸ¦‹

⭐ 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.

πŸŽ€ form_term

returns the current form term hook, if any (NULL if there is no such hook).


πŸ”₯ RETURN VALUE πŸ”₯

Routines that return pointers return NULL on error. the rest of them hand you back one of these:

  • E_OK β€” the routine succeeded. slay, it ate, no notes πŸ’…
  • E_SYSTEM_ERROR β€” System error occurred (see errno(3)). not me crying in system call 😭

🌈 PORTABILITY 🌈

These routines emulate the System V forms library. They were not supported on Version 7 or BSD versions. so if you're time-travelling to old BSD, sorry bestie, this one's not there πŸ™ˆ


πŸ‘‘ AUTHORS πŸ‘‘

Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. legends fr fr 🫢


πŸ’« SEE ALSO πŸ’«

ncurses(3NCURSES), form(3FORM)


okay that's the whole page, you're so welcome πŸ’– this was ncurses 6.6, dated 2024-12-28, and hook(3FORM) is officially signed, sealed, and slayed. periodt βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from