userptr(3FORM)
β¨ userptr β bestie edition β¨
okay so this is the userptr(3FORM) page, from the 3FORM library-calls girlies π
it's short, it's sweet, it's literally just two little functions that hold your stuff for you. let's go π
πΈ NAME πΈ
set_form_userptr, form_userptr β the way you attach your own app data to a form item π«Ά
β¨ SYNOPSIS β¨
#include <form.h>
int set_form_userptr(FORM *form, void *userptr);
void* form_userptr(const FORM *form);
π DESCRIPTION π
okay so picture this: every single form and every single form item has a little field just sitting there, and that field is for you. like, it's your little shelf for application-specific data. and the form-driver code? it leaves it alone. doesn't touch it, doesn't look at it, doesn't text it back. it's giving respectful. π
these two functions are literally just the getter and the setter for the form user pointer field. that's it. that's the whole job. get, set, slay. β¨
π₯ RETURN VALUE π₯
form_userptrβ hands you back a pointer. and yes bestie, it may beNULL, that's allowed. also it does not seterrno, so don't go checking that for gossip, it's not talking.set_form_userptrβ returnsE_OK. that's it. success. periodt. π
π PORTABILITY π
so these routines emulate the System V forms library. they were not supported on Version 7 or BSD versions β so if you're time-traveling back there, sorry bestie, no user pointer for you π
and here's a lil lore drop: the user pointer is a void pointer. they chose not to leave it as a char pointer for SVr4 compatibility. iconic decision-making honestly π
π AUTHORS π
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. kings fr fr π«Ά
π¦ SEE ALSO π¦
ncurses(3NCURSES)form(3FORM)
ngl this is one of the chillest pages in the whole set β no scary warnings, no undefined behaviour, just a lil pointer holding your stuff π
and that's the vibe check bestie π this was ncurses 6.6, dated 2024-12-28 β go off, userptr(3FORM) π
π¦ 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