form_field_opts(3X)
π form_field_opts β the field options manual, bestie edition π
okay so this is form_field_opts(3X), a library-calls page from the curses/forms world, and it's literally all about flipping a field's option bits on and off. group chat, gather round π«Ά
β¨ NAME β¨
set_field_opts, field_opts_on, field_opts_off, field_opts β bestie, these are the functions that set and get field options. that's the whole vibe.
πΈ SYNOPSIS πΈ
#include <form.h>
int set_field_opts(FIELD *field, Field_Options opts);
Field_Options field_opts(const FIELD *field);
int field_opts_on(FIELD *field, Field_Options opts);
int field_opts_off(FIELD *field, Field_Options opts);
no cap, that's the whole signature situation β¨
π¦ DESCRIPTION π¦
okay so let's break these four down, because they are not the same function and i need you to know that π
set_field_optsβ sets all the given field's option bits. and yes, field option bits may be logically "or"-ed together. so you can stack them. obsessed.field_opts_onβ turns on the given option bits, and leaves others alone. it's giving "respectful, doesn't touch what isn't hers" πfield_opts_offβ turns off the given option bits, and leaves others alone. same energy, opposite direction.field_optsβ returns the field's current option bits. the little reporter. the gossip. π
π the standard options
these are defined, and heads up β all of them are on by default. slay.
O_ACTIVEβ the field is visited during processing. if this option is off, the field will not be reachable by navigation keys. also, please notice that an invisible field appears to be inactive also. yes, both things. both are true. πO_AUTOSKIPβ skip to the next field when this one fills. it's the "okay you're done, next" of options.O_BLANKβ the field is cleared whenever a character is entered at the first position. fresh start energy.O_EDITβ the field can be edited. that's it. that's the option.O_NULLOKβ allow a blank field. let her be empty, she's allowed ποΈO_PASSOKβ validate field only if modified by user.O_PUBLICβ the field contents are displayed as data is entered. live, unfiltered, no drafts.O_STATICβ field buffers are fixed to field's original size. turn this option off to create a dynamic field. so like, static vs dynamic is literally this one bit. iconic.O_VISIBLEβ the field is displayed. if this option is off, display of the field is suppressed. she's in her private era πO_WRAPβ words that do not fit on a line are wrapped to the next line. words are blank-separated. important detail, don't forget it.
π the extension options
these are defined too, but bestie β extensions are off by default. opposite situation from the standard ones. keep up β¨
O_DYNAMIC_JUSTIFYβ permit dynamic fields to be justified, like static fields.O_NO_LEFT_STRIPβ preserve leading whitespace in the field buffer, which is normally discarded. so by default that whitespace gets yeeted, and this option says "no, keep it" π€O_EDGE_INSERT_STAYβ when inserting into a field up to the boundary position, optionally delay the scrolling, so that the last inserted character remains visible, but advance the cursor to reflect the insertion. this allows the form library to display the inserted character in one-character fields as well as allowing the library to maintain consistent state. it's giving "i can do both, actually" πO_INPUT_FIELDβ theset_max_fieldfunction checks for this extension, which allows a dynamic field to shrink if the new limit is smaller than the current field size. shrinking is allowed here, and that's on periodt.
β RETURN VALUE β
okay so except for field_opts, each routine returns one of the following:
E_OKβ the routine succeeded. we love a win πE_BAD_ARGUMENTβ routine detected an incorrect or out-of-range argument. she said "absolutely not."E_CURRENTβ the field is the current field.E_SYSTEM_ERRORβ system error occurred (seeerrno(3)).
π§ PORTABILITY π§
these routines emulate the System V forms library. they were not supported on Version 7 or BSD versions. so if you're kicking it on those, no dice, bestie π
π AUTHORS π
Juergen Pfeifer. manual pages and adaptation for new curses by Eric S. Raymond. legends, honestly. we stan. π«Ά
π SEE ALSO π
curses(3X)form(3X)form_field_just(3X)
and that's the page!! this was ncurses 6.6, dated 2025-01-18, filed under form_field_opts(3X) β go forth and configure your fields, you absolute main character πβ¨ππ¦πΈπ
π¦ 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-2024,2025 Thomas E. Dickey
- Copyright 1998-2014,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