new(3FORM)
β¨ new(3FORM) β¨
okay bestie, welcome to new(3FORM) from the Library calls section of the manual β this is the one about making and unmaking forms, and honestly? it's giving main character energy for the whole forms library. π
π NAME π
new_form, free_form β create and destroy forms. that's it, that's the whole vibe. π
πΈ SYNOPSIS πΈ
#include <form.h>
FORM *new_form(FIELD **fields);
int free_form(FORM *form);
like, include the header first, obviously. π
π¦ DESCRIPTION π¦
okay so, new_form creates a brand new form, and it connects that form to a specified field pointer array. important detail: that array must be NULL-terminated. no cap. if you forget the NULL at the end, that's on you, bestie. π
and then free_form? she's the closer. she disconnects form from its field array and frees the storage that was allocated for the form. clean exit, no mess, periodt. β¨
π RETURN VALUE π
new_form returns NULL on error. and when it does that, it sets errno according to how the function went:
E_OKβ the routine succeeded. slay. πE_BAD_ARGUMENTβ the routine detected an incorrect or out-of-range argument. πE_CONNECTEDβ the field is already connected to a form. she's taken, babes. πE_SYSTEM_ERRORβ a system error occurred, e.g.,mallocfailure. π
meanwhile free_form returns one of these:
E_OKβ the routine succeeded. π«ΆE_BAD_ARGUMENTβ the routine detected an incorrect or out-of-range argument. πE_POSTEDβ the form has already been posted. you can't just free a posted form, bestie, that's not the move. π
π PORTABILITY π
these routines emulate the System V forms library. they were not supported on Version 7 or BSD versions. so if you're time-traveling to ancient Unix, this is not the moment, iykyk. π§
π AUTHORS π
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. legends, honestly. π
β SEE ALSO β
ncurses(3NCURSES)form(3FORM)
and that's the whole page, bestie!! π this was ncurses 6.6, dated 2024-12-28 β go forth and build ur forms, you absolute icon. π¦πβ¨
π¦ where this page comes from
- ubuntu resolute: ncurses-doc 6.6+20251231-1 Β· MIT/X11
- ubuntu stonking: ncurses-doc 6.6+20260608-2 Β· MIT/X11
- Copyright 2018-2023,2024 Thomas E. Dickey
- Copyright 1998-2010,2015 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms