opts(3FORM)

✨ opts(3FORM) ✨

okay bestie, so this is the opts page from the forms library (that's section 3, the library-calls girlies) πŸ’… and it's literally all about flipping form option bits on and off. let's get into it 🫢


🌸 NAME 🌸

set_form_opts, form_opts_on, form_opts_off, form_opts β€” the little squad that sets and gets your form options ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <form.h>

int set_form_opts(FORM *form, Field_Options opts);
Field_Options form_opts(const FORM *form);

int form_opts_on(FORM *form, Field_Options opts);
int form_opts_off(FORM *form, Field_Options opts);

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea on all four of these functions, they're honestly so simple once you see it:

  • set_form_opts β€” sets all of the given form's option bits. and yes, you can logically β€œor” those form option bits together, so stack 'em up if you want πŸ’…
  • form_opts_on β€” turns on the option bits you pass, and leaves all the other bits exactly where they were. no touching, no drama ✨
  • form_opts_off β€” turns off the option bits you pass, and again leaves the others alone. polite queen behavior πŸ‘‘
  • form_opts β€” just hands you back the form's current option bits. that's it, that's the whole job, and we love her for it πŸŽ€

now for the options themselves, bestie β€” and hear me when I say all of these are on by default, no cap:

  • O_NL_OVERLOAD β€” overloads the REQ_NEW_LINE forms driver request so that calling it at the end of a field slides you on over to the next field πŸ¦‹
  • O_BS_OVERLOAD β€” overloads the REQ_DEL_PREV forms driver request so that calling it at the beginning of a field bounces you back to the previous field 🌸

πŸ”₯ RETURN VALUE πŸ”₯

so every one of these routines returns one of the following β€” except form_opts, she's built different, she gives you bits not status codes πŸ’€

  • E_OK β€” the routine succeeded. slay ✨
  • E_SYSTEM_ERROR β€” a system error happened (go peek at errno(3), iykyk) 😭

🌈 PORTABILITY 🌈

ngl these routines are emulating the System V forms library. they were not supported on Version 7 or BSD versions, so if you're time-traveling to those, adjust your expectations bestie πŸ™ˆ


πŸ‘‘ AUTHORS πŸ‘‘

Juergen Pfeifer. manual pages and adaptation for new curses by Eric S. Raymond. iconic work, fr fr πŸ’œ


⭐ SEE ALSO ⭐

ncurses(3NCURSES), form(3FORM) 🫢


and that's the whole page, bestie!! πŸ’– this was ncurses 6.6 from 2025-01-18, mwah, go forth and toggle those option bits responsibly πŸŽ€πŸ’…βœ¨

πŸ“¦ where this page comes from