form_new(3X)

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

πŸ’– form_new(3X) β€” Library calls, bestie πŸ’–

okay so this is form_new(3X) from the Library calls corner of the ncurses universe, and we're about to learn how to birth a form and then gently let it go. two functions, one page, zero gatekeeping. let's GO ✨


πŸŽ€ NAME πŸŽ€

new_form, free_form β€” literally create and destroy forms. that's it. that's the whole vibe. creation and destruction, main character energy both ways πŸ¦‹


🌸 SYNOPSIS 🌸

#include <form.h>

FORM *new_form(FIELD **fields);
int free_form(FORM *form);

like, look at that. so clean. so iconic. πŸ’…


✨ DESCRIPTION ✨

so new_form creates a new form connected to a specified field pointer array β€” and heads up bestie, that array must be NULL-terminated or she will simply not cope 😭

and then free_form does the opposite: it disconnects form from its field array and frees the storage allocated for the form. closure. we love to see it 🫢


πŸ”₯ RETURN VALUE πŸ”₯

new_form πŸ‘‘

returns NULL on error, and sets errno according to the function's success:

  • E_OK β€” the routine succeeded. slay πŸ’–
  • E_BAD_ARGUMENT β€” routine detected an incorrect or out-of-range argument. rude, but okay.
  • E_CONNECTED β€” the field is already connected to a form. it's taken, babes πŸ’€
  • E_SYSTEM_ERROR β€” system error occurred, e.g., malloc failure. the malloc said no πŸ’”

free_form πŸ‘‘

returns one of the following:

  • E_OK β€” the routine succeeded. periodt.
  • E_BAD_ARGUMENT β€” routine detected an incorrect or out-of-range argument.
  • E_POSTED β€” the form has already been posted. can't free what's already out there living its life πŸ™ˆ

🌈 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 those, no form for you ngl 🧚


πŸ‘‘ AUTHORS πŸ‘‘

Juergen Pfeifer. manual pages and adaptation for new curses by Eric S. Raymond. absolute legends, both of them 🫑


⭐ SEE ALSO ⭐

curses(3X), form(3X) β€” go read those next, bestie, iykyk πŸ“š


and that's the whole page, mwah πŸ’‹ this was ncurses 6.5, dated 2024-12-28 β€” catch you on the next manpage, bestie, bye!! βœ¨πŸ’–πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«ΆπŸ”₯πŸ‘‘πŸŒˆβ­πŸ’€πŸ™ˆπŸ“πŸ§šπŸ’œβœ¨

πŸ“¦ where this page comes from