form_field_info(3X)
π form_field_info β bestie edition π
okay so this is form_field_info(3X) from the library calls girlies, and it's literally just "hey bestie, tell me everything about this field" energy. two lil functions, both absolute icons, both here to spill the tea on your FIELD structs. no cap. π
β¨ NAME β¨
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);
look at her. six pointers. she's doing the MOST and we love that for her. π
π« DESCRIPTION π«
okay so field_info returns the sizes and other attributes that got passed in to the field at its creation time. like, the receipts from when the field was born. π
and those attributes are:
- height
- width
- row of upper-left corner
- column of upper-left corner
- number of off-screen rows
- number of working buffers
six things. she's thorough. she's giving main character energy fr fr. π
then there's dynamic_field_info, which is the actually real one β she returns the actual size of the field plus its maximum possible size. lowkey the glow-up version of the first function.
β οΈ and here's the plot twist bestie: if the field has no size limit, the location addressed by the third argument gets set to 0. zero. nada. that's the signal. π
you can make a field dynamic by turning off the O_STATIC option with field_opts_off. that's the unlock code. π
π«Ά RETURN VALUE π«Ά
these routines return one of the following, and you WILL check which one, i'm not playing:
E_OKβ the routine succeeded. slay. we ate. β¨E_SYSTEM_ERRORβ a system error occurred (seeerrno(3)). something went wrong and it wasn't even your fault. πE_BAD_ARGUMENTβ the routine detected an incorrect or out-of-range argument. you handed her something cursed bestie, she's not doing that. π
π¦ PORTABILITY π¦
these routines emulate the System V forms library. they were not supported on Version 7 or BSD versions β so if you're on one of those, respectfully, no. π«
also, a null (zero pointer) is accepted for any of the return values, so you can just ignore a value you don't care about. cute, right? but heads up β not all implementations allow this, e.g., Solaris 2.7 does not. so don't go around assuming everyone's chill like that. iykyk. πΈ
π AUTHORS π
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. absolute legends, we stan. π«Ά
π₯ SEE ALSO π₯
curses(3X) and related pages whose names begin βform_β for detailed descriptions of the entry points. go read the whole family, they're all iconic. ππ
and that's the whole page bestie β brought to you by ncurses 6.6, dated 2024-03-16, mwah π no cap, periodt. πβ¨
π¦ where this page comes from
- alpine 3.24: ncurses-doc 6.6_p20260516-r0 Β· X11
- arch rolling: ncurses 6.6-2 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- Copyright 2018-2023,2024 Thomas E. Dickey
- Copyright 1998-2010,2015 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms