form_field_userptr(3X)

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

πŸ’… form_field_userptr(3X) β€” the library-calls glow-up

okay so bestie, welcome to the form_field_userptr(3X) page, straight out of the library-calls lineup ✨ this one's short and sweet and it's literally just about stashing your own lil' data inside a form field. no cap.


πŸŽ€ NAME πŸŽ€

set_field_userptr, field_userptr β€” associate application data with a form field 🫢


✨ SYNOPSIS ✨

#include <form.h>

int set_field_userptr(FIELD *field, void *userptr);
void *field_userptr(const FIELD *field);

like, that's it. two functions, one header, zero drama πŸ’…


🌸 DESCRIPTION 🌸

okay so here's the vibe: every form field has a field in it that you can use to hold application-specific data β€” and by "application-specific" we mean yours, because the form-driver code literally leaves it alone πŸ™ˆ it does not touch it, it does not look at it, it's your little corner of the field, your main character closet.

These two functions get and set that field. that's the whole plot πŸ”₯

  • set_field_userptr β€” sets it (the "put your stuff in here" one)
  • field_userptr β€” gets it (the "okay give it back" one)

πŸ’– RETURN VALUE πŸ’–

  • The function field_userptr returns a pointer (which may be NULL, and that's totally valid, ngl). it does not set errno β€” like, it's just not gonna bother, don't @ it.
  • The function set_field_userptr returns E_OK (success). that's it. success. slay πŸŽ€

πŸ¦‹ PORTABILITY πŸ¦‹

These routines emulate the System V forms library. they were not supported on Version 7 or BSD versions, so if you're kicking it old-school on those, sorry bestie 😭 not available.

Also important: the user pointer is a void pointer. We chose not to leave it as a char pointer for SVr4 compatibility β€” so yeah, that was a deliberate choice, iykyk πŸ’€


πŸ‘‘ AUTHORS πŸ‘‘

Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. legends, honestly 🫢


🌈 SEE ALSO 🌈

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

ok so that's the whole page, bestie β€” no secret bonus sections, no hidden flags, this one's a snack not a meal πŸ“

and that's a wrap, babe! brought to you by ncurses 6.5, dated 2024-12-28 β€” go forth and store your pointers, queen β­πŸ’œ

πŸ“¦ where this page comes from