field_userptr(3FORM)
π field_userptr β bestie, let's attach ur lil data to a form field π
okay so this is a libcurses / ncurses library call page, and it's honestly so underrated. we're talking set_field_userptr and field_userptr β the duo that lets u stash application-specific data on a form field. no cap, every field gets one of these lil pockets and the form driver literally never touches it. it's urs. π«Ά
β¨ 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);
π¦ DESCRIPTION π¦
so here's the tea π: every single form field has a field β yes i said it like that β that u can use to hold application-specific data. and when i say application-specific, i mean the form-driver code leaves it alone. it does not touch it. it does not look at it. it minds its own business. periodt.
these two functions are the getter and the setter for that field. one puts ur stuff in, one gets ur stuff out. iconic behaviour, truly. π
π RETURN VALUE π
field_userptrhands u back a pointer β and yes bestie, it may beNULL, that's allowed, don't panic. also important: it does not seterrno. not even a little bit.set_field_userptrreturnsE_OK, which is the success vibe. that's it. that's the whole return value. slay. β¨
π PORTABILITY π
- these routines emulate the System V forms library. they were not supported on Version 7 or BSD versions. so if ur on one of those, sorry bestie, no user pointer for u π
- the user pointer is a
voidpointer. and the reason is kinda juicy: we chose not to leave it as acharpointer, for SVr4 compatibility. iykyk. π
π AUTHORS π
- Juergen Pfeifer.
- Manual pages and adaptation for new curses by Eric S. Raymond.
π SEE ALSO π
ncurses(3NCURSES)form(3FORM)
and that's the whole page, bestie!! this was ncurses 6.6, dated 2024-12-28 β go forth and stash ur pointers, u absolute main character ππ¦β¨
π¦ where this page comes from
- ubuntu resolute: ncurses-doc 6.6+20251231-1 Β· MIT/X11
- ubuntu stonking: ncurses-doc 6.6+20260608-2 Β· MIT/X11
- 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