form_field_info(3X)

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

✨ NAME ✨

okay so bestie, welcome to form_field_info(3X) from the Library calls section β€” this one is literally about retrieving field characteristics. πŸ’…

  • dynamic_field_info, field_info β€” retrieve field characteristics

πŸ¦‹ SYNOPSIS πŸ¦‹

       #include <form.h>

       int field_info(const FIELD *field,
                      int *rows, int *cols,
                      int *frow, int *fcol,
                      int *nrow, int *nbuf);

       int dynamic_field_info(const FIELD *field,
                              int *rows, int *cols, int *max);

πŸ’– DESCRIPTION πŸ’–

The function field_info returns the sizes and other attributes passed in to the field at its creation time. It’s giving β€œreceipts from when this field was born” energy. 🧾✨

The attributes are:

  • height
  • width
  • row of upper-left corner
  • column of upper-left corner
  • number off-screen rows
  • number of working buffers

The function dynamic_field_info returns the actual size of the field, and its maximum possible size. If the field has no size limit, the location addressed by the third argument will be set to 0. No cap, it just gets zeroed out. 🫢

A field can be made dynamic by turning off the O_STATIC option with field_opts_off. That’s the lowkey switch-up that unlocks dynamic behavior. πŸ”₯


🌸 RETURN VALUE 🌸

These routines return one of the following:

  • E_OK β€” the routine succeeded. slay.
  • E_SYSTEM_ERROR β€” System error occurred (see errno(3)). 😭
  • E_BAD_ARGUMENT β€” Routine detected an incorrect or out-of-range argument. not the vibe. πŸ’€

πŸŽ€ PORTABILITY πŸŽ€

These routines emulate the System V forms library. They were not supported on Version 7 or BSD versions. history lesson, but make it niche. πŸ“š

A null (zero pointer) is accepted for any of the return values, to ignore that value. Not all implementations allow this, e.g., Solaris 2.7 does not. so yeah, check your implementation’s vibe first. πŸ‘€


πŸ‘‘ AUTHORS πŸ‘‘

Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. icons only. 🫑


🌈 SEE ALSO 🌈

curses(3X) and related pages whose names begin β€œform_” for detailed descriptions of the entry points. iykyk, go read the whole form_ family. πŸ“–πŸ’œ


πŸ’– cute little sign-off tea: this page is from ncurses 6.5, dated 2024-03-16, and it’s the form_field_info(3X) manual page. periodt. ✨

πŸ“¦ where this page comes from