form_field_new(3X)
π form_field_new(3X) β bestie edition π
Library calls β¨ so this is the one about making and unmaking form fields, iykyk.
πΈ NAME πΈ
new_field, dup_field, link_field, free_field β create and destroy form fields π
β¨ SYNOPSIS β¨
#include <form.h>
FIELD *new_field(int height, int width,
int toprow, int leftcol,
int offscreen, int nbuffers);
FIELD *dup_field(FIELD *field, int toprow, int leftcol);
FIELD *link_field(FIELD *field, int toprow, int leftcol);
int free_field(FIELD *field);
π¦ DESCRIPTION π¦
Okay so new_field is the main character here π β it allocates a brand new field and initializes it from the parameters you hand it: height, width, the row of the upper-left corner, the column of the upper-left corner, the number of off-screen rows, and the number of additional working buffers. That's the whole vibe check. π
Then dup_field β it duplicates a field at a new location, no cap. Most attributes get copied over, and bestie that list is long: current contents, size, validation type, buffer count, growth threshold, justification, foreground, background, pad character, options, and user pointer. All of it, copied. π
But NOT everything, and this is important: field status and the field page bit are not copied. π
link_field acts like dup_field, but with a twist π§ β the new field shares buffers with its parent. The attribute data, though? Separate. Independent. Living its own life. β¨
And free_field de-allocates the storage associated with a field. Bye babe π«Ά
π RETURN VALUE π
new_field, dup_field, and link_field return NULL on error, and they set errno according to their success:
E_OKβ the routine succeeded. slay πE_BAD_ARGUMENTβ routine detected an incorrect or out-of-range argument. πE_SYSTEM_ERRORβ system error occurred, e.g.,mallocfailure. π
And free_field returns one of these:
E_OKβ the routine succeeded. β¨E_BAD_ARGUMENTβ routine detected an incorrect or out-of-range argument. π«E_CONNECTEDβfieldis connected. π
π PORTABILITY π
These routines emulate the System V forms library. They were not supported on Version 7 or BSD versions β so if you're on one of those, that's a no from the universe. π
Also, ngl, it may be unwise to count on the set of attributes copied by dup_field being portable β the System V forms library documents are not very explicit about what gets copied and what does not. So likeβ¦ don't build your whole personality on it. π¬
π AUTHORS π
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. legends, fr fr π«Ά
π SEE ALSO π
curses(3X), form(3X) β go read those next bestie, they're giving lore π
Okay that's the whole page!! This was ncurses 6.6, dated 2024-12-28 β mwah, kissing you goodbye ππ
π¦ where this page comes from
- alpine 3.24: ncurses-doc 6.6_p20260516-r0 Β· X11
- arch rolling: ncurses 6.6-2 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- 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