form_field_opts(3X)

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

πŸ’– form_field_opts(3X) β€” setting & getting field options πŸ’–

okay bestie, so this is a library calls page from the 3X manual, and it's literally all about giving your form fields the vibes they deserve. think of it as the settings menu for your fields ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

so first you gotta pull in the header, obviously:

#include <form.h>

and then here's the whole squad of functions β€” copy these exactly, no cap:

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);

🌸 DESCRIPTION 🌸

set_field_opts β€” this one sets all the given field's option bits πŸ’… (and yes, field option bits may be logically β€œor”-ed together, so you can stack them like your fave accessories).

field_opts_on β€” turns on the given option bits and leaves the others alone. very "just this one thing, not the whole personality."

field_opts_off β€” turns off the given option bits and leaves the others alone. main character energy: it doesn't touch anything else.

field_opts β€” returns the field's current option bits. a little peek at what's going on 🫢


✨ the standard options β€” all on by default ✨

these are the classic ones, and heads up, all are on by default:

  • 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 πŸ‘€
  • O_AUTOSKIP β€” skip to the next field when this one fills. bye, next πŸ’¨
  • O_BLANK β€” the field is cleared whenever a character is entered at the first position.
  • O_EDIT β€” the field can be edited. it's giving editable πŸ’…
  • O_NULLOK β€” allow a blank field. sometimes empty is a vibe.
  • O_PASSOK β€” validate field only if modified by user. no changes, no stress.
  • O_PUBLIC β€” the field contents are displayed as data is entered. everyone sees it, no secrets.
  • O_STATIC β€” field buffers are fixed to field's original size. turn this option off to create a dynamic field. it's a whole switch-up.
  • O_VISIBLE β€” the field is displayed. if this option is off, display of the field is suppressed. ghost mode activated.
  • O_WRAP β€” words that do not fit on a line are wrapped to the next line. and yes, words are blank-separated.

πŸŽ€ the extension options β€” off by default πŸŽ€

these are the extension girlypops, and extensions are off by default:

  • O_DYNAMIC_JUSTIFY β€” permit dynamic fields to be justified, like static fields. equality fr.
  • O_NO_LEFT_STRIP β€” preserve leading whitespace in the field buffer, which is normally discarded. keep the space, it's aesthetic.
  • 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. iconic behavior honestly.
  • O_INPUT_FIELD β€” the set_max_field function checks for this extension, which allows a dynamic field to shrink if the new limit is smaller than the current field size. glow-down rights πŸ’–

⭐ RETURN VALUE ⭐

so, except for field_opts, each routine returns one of the following:

  • E_OK β€” the routine succeeded. slay πŸ’…
  • E_BAD_ARGUMENT β€” routine detected an incorrect or out-of-range argument. not the vibe.
  • E_CURRENT β€” the field is the current field. it's literally the current one.
  • E_SYSTEM_ERROR β€” system error occurred (see errno(3)). 😭

🌈 PORTABILITY 🌈

these routines emulate the System V forms library. they were not supported on Version 7 or BSD versions. so like, know your origins bestie.


πŸ‘‘ AUTHORS πŸ‘‘

Juergen Pfeifer. manual pages and adaptation for new curses by Eric S. Raymond. legends only 🫢


πŸ’œ SEE ALSO πŸ’œ

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

ngl, this page is from ncurses 6.5, dated 2025-01-18 β€” and that's the cute little sign-off from form_field_opts(3X). periodt. βœ¨πŸŽ€πŸ’–
πŸ“¦ where this page comes from