menu_userptr(3X)
π menu_userptr(3X) π
okay bestie, so this is a page from the library calls girlies β it's menu_userptr, living its best life in the curses neighborhood β¨
πΈ NAME πΈ
set_menu_userptr, menu_userptr β the way you attach your own lil application data to a menu item π
π¦ SYNOPSIS π¦
#include <menu.h>
int set_menu_userptr(MENU *menu, void *userptr);
void *menu_userptr(const MENU *menu);
β¨ DESCRIPTION β¨
So like. Every menu and every menu item has a field, right? And that field is just there for you to stash whatever application-specific data your heart desires π the menu-driver code literally leaves it alone, it does not touch it, it does not look at it, it minds its own business, iconic behavior fr fr.
These two functions are the getter and the setter for that menu user pointer field. That's it. That's the whole job π«Ά
π RETURN VALUE π
menu_userptrhands you back a pointer (and yes, it can beNULL, no shame in that). It does not seterrnoβ it's just vibing, not reporting errors.set_menu_userptrreturnsE_OK, which is success. Slay. π
π PORTABILITY π
These routines emulate the System V menu library. Not supported on Version 7 or BSD versions β so if you're on those, sorry bestie, this isn't for you π
Also important: the user pointer is a void pointer. And why? Because they chose not to leave it as a char pointer, for SVr4 compatibility. That's the whole reason. Periodt.
π AUTHORS π
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond.
π SEE ALSO π
curses(3X)menu(3X)
and that's the whole page, no notes π§ this was ncurses 6.6, dated 2024-12-28 β go forth and store your pointers, you absolute main character π
π¦ 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