page(3FORM)

✨ page(3FORM) β€” form_page ✨

okay bestie, gather round, because today we're talking about form_page β€” the whole set and get form page number situation πŸ’– this is a library call from the curses forms world and she is lowkey iconic.


πŸŽ€ NAME πŸŽ€

form_page β€” set and get form page number πŸ¦‹


πŸ’… SYNOPSIS πŸ’…

#include <form.h>

int set_current_field(FORM *form, FIELD *field);
FIELD *current_field(const FORM *form);

int unfocus_current_field(FORM *form);

int set_form_page(FORM *form, int n);
int form_page(const FORM *form);

int field_index(const FIELD *field);

🌸 DESCRIPTION 🌸

okay so first up, set_current_field sets the current field of the given form, and current_field hands you back the current field of the given form. classic get/set duo, no notes πŸ’…

then there's unfocus_current_field β€” she removes the focus from the current field of the form. and in that state? inquiries via current_field shall return a NULL pointer. so like, nobody's home, the field is unbothered, the vibes are empty 😭

set_form_page sets the form's page number β€” literally goes to page n of the form. main character behavior, turning the page πŸ“–βœ¨

form_page returns the form's current page number. that's it, that's the function, she's simple and she serves 🫢

and field_index returns the index of the field in the field array of the form it is connected to. > but bestie, heads up: it returns ERR if the argument is the null pointer or if the field is not connected πŸ’€ no field, no index, periodt.


⭐ RETURN VALUE ⭐

except for form_page, every one of these routines returns one of the following:

  • E_OK β€” the routine succeeded. slay βœ…
  • E_BAD_ARGUMENT β€” routine detected an incorrect or out-of-range argument. the argument was giving... wrong πŸ™ˆ
  • E_BAD_STATE β€” routine was called from an initialization or termination function. wrong time, wrong place, read the room πŸ’€
  • E_INVALID_FIELD β€” contents of a field are not valid. not valid, not cute, not on my watch βœ‹
  • E_REQUEST_DENIED β€” the form driver could not process the request. she said no πŸ’…
  • E_SYSTEM_ERROR β€” system error occurred (see errno(3)). the system is going through something 😭

🌈 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 backwards, don't expect her there πŸ•°οΈ

also! unfocus_current_field is an ncurses extension β€” she's special, she's extra, she's ours πŸ‘‘


πŸ’œ AUTHORS πŸ’œ

Juergen Pfeifer. manual pages and adaptation for new curses by Eric S. Raymond. absolute legends, we stan 🫢


πŸ”₯ SEE ALSO πŸ”₯

  • ncurses(3NCURSES)
  • form(3FORM)

and that's the whole page, bestie!! go forth and page-turn responsibly 🌸

this has been ncurses 6.6, dated 2024-12-28, signing off with a little page(3FORM) energy βœ¨πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from