form_hook(3X)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’– form_hook πŸ’–

okay bestie, welcome to the form_hook(3X) Library calls page. This is literally the hook-setting manual page, and it’s giving β€œlet the form call you back” energy. No cap. πŸ’…

🌸 NAME 🌸

form_hook β€” set hooks for automatic invocation by applications. Yes bestie, it’s the hook-setting page, that’s the whole vibe.

✨ 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 πŸ¦‹

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. Translation: form_driver does its automatic thing, and these hooks are the little β€œhey, call my function here” moments. Obsessed.

πŸ’– set_field_init πŸ’–

set_field_init sets a hook to be called at form-post time and each time the selected field changes (after the change). So that one fires after the change β€” the after-party, not the pre-game.

πŸŽ€ field_init πŸŽ€

field_init returns the current field init hook, if any (NULL if there is no such hook). No hook? You get NULL, and that’s the tea.

🌸 set_field_term 🌸

set_field_term sets a hook to be called at form-unpost time and each time the selected field changes (before the change). This one is the before-the-change bestie.

πŸ¦‹ field_term πŸ¦‹

field_term returns the current field term hook, if any (NULL if there is no such hook). Again: no hook means NULL, periodt.

πŸ“ set_form_init πŸ“

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, but posted first β€” iykyk.

🧚 form_init 🧚

form_init returns the current form init hook, if any (NULL if there is no such hook). If it’s not there, it’s NULL, bestie.

πŸ’œ set_form_term πŸ’œ

set_form_term sets a hook to be called at form-unpost time and just before a page change once it is posted. Just before the page change β€” highkey important.

🌈 form_term 🌈

form_term returns the current form term hook, if any (NULL if there is no such hook). NULL when there’s no hook, fr fr.

πŸ‘‘ RETURN VALUE πŸ‘‘

Routines that return pointers return NULL on error. Other routines return one of the following:

  • E_OK β€” the routine succeeded. slay.
  • E_SYSTEM_ERROR β€” system error occurred (see errno(3)). oof, check that errno(3), bestie.

🌈 PORTABILITY 🌈

These routines emulate the System V forms library. They were not supported on Version 7 or BSD versions. So Version 7 and BSD? Not supported, no cap β€” that’s a no-go.

πŸ’œ AUTHORS πŸ’œ

Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. Legend behaviour, honestly.

🫢 SEE ALSO 🫢

  • curses(3X)
  • form(3X)

This page came from ncurses 6.5, dated 2024-12-28. Bye bestie β€” go set those hooks and slay πŸ’…βœ¨

πŸ“¦ where this page comes from