form_field(3X)

πŸ’– form_field β€” bestie, let's talk field-to-form connections πŸ’–

okay so this is a page from the Library calls girlies, and it's literally all about making and breaking the connections between fields and forms. lowkey iconic.


✨ NAME ✨

form_field β€” make and break connections between fields and forms 🫢


🌸 SYNOPSIS 🌸

#include <form.h>

int set_form_fields(FORM *form, FIELD **fields);
FIELD **form_fields(const FORM *form);
int field_count(const FORM *form);
int move_field(FIELD *field, int frow, int fcol);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so let's go one by one, no cap.

The function set_form_fields changes the field pointer array of the given form. and bestie, listen β€” the array must be terminated by a NULL. like, that's non-negotiable. it's giving "last one to leave turns off the lights" but the lights are a NULL pointer. πŸ’…

The function form_fields returns the field array of the given form. that's it, that's the whole job, she's simple and she's serving. ✨

The function field_count returns the count of fields in form. slay, we love a headcount. πŸ”’

The function move_field moves the given field to a specified location on the screen. and the field must be disconnected β€” like, she has to be single before she can relocate. no messy attachments, periodt. πŸ’€


πŸ‘‘ RETURN VALUE πŸ‘‘

The function form_fields returns a pointer (which may be NULL). and no, she does not set errno. she minds her own business. πŸ™ˆ

The function field_count returns ERR if the form parameter is NULL. yeah, if you hand her nothing, she's gonna give you ERR. fair. πŸ’…

The functions set_form_fields and move_field return one of the following codes on error:

  • E_OK β€” the routine succeeded. we love a win. πŸŽ€
  • E_BAD_ARGUMENT β€” routine detected an incorrect or out-of-range argument. something was giving wrong-number energy. 😭
  • E_CONNECTED β€” the field is already connected to a form. she's taken, bestie, back off. πŸ”₯
  • E_POSTED β€” the form is already posted. it's up, it's out there, it's living its main character life. ⭐
  • E_SYSTEM_ERROR β€” system error occurred (see errno(3)). not our fault, the system is being messy. πŸ’€

🌈 PORTABILITY 🌈

These routines emulate the System V forms library. they were not supported on Version 7 or BSD versions β€” so if you're on those, bestie, you're on your own. 🫢

The SVr4 forms library documentation specifies the field_count error value as -1 (which is the value of ERR). so like, same energy, different font. iykyk. ✨


🧚 AUTHORS 🧚

Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. absolute legends, we stan. πŸ‘‘


πŸ’œ SEE ALSO πŸ’œ

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

and that's the whole vibe, bestie β€” go forth and connect those fields responsibly πŸ¦‹πŸŒΈπŸ’–

this page came to you courtesy of ncurses 6.6, dated 2024-12-28 β€” mwah, no notes, slay πŸŽ€βœ¨

πŸ“¦ where this page comes from