new(3MENU)
π new(3MENU) π
okay so bestie, welcome to the Library calls section, this is new(3MENU) and we're talking about menus β the make-one, break-one kind π
β¨ NAME β¨
new_menu, free_menu β create and destroy menus π«Ά
πΈ SYNOPSIS πΈ
#include <menu.h>
MENU *new_menu(ITEM **items);
int free_menu(MENU *menu);
π DESCRIPTION π
so new_menu does exactly what it says on the tin, no cap β it creates a brand new menu and connects it to a specified item pointer array. and that array MUST be NULL-terminated, bestie, don't forget, the NULL is literally the vibe check at the end of the list π
and then free_menu? that's the breakup function π it disconnects menu from its item array and frees all the storage that was allocated for the menu. clean exit, no loose ends, we love to see it β¨
π₯ RETURN VALUE π₯
new_menu returns NULL on error. not great, not terrible, but it sets errno to tell you why it flopped:
E_NOT_CONNECTEDβ no items are connected to the menu. it's giving empty roster πE_SYSTEM_ERRORβ a system error occurred, e.g.,mallocfailure. the machine said no π
and free_menu returns one of these lil guys:
E_OKβ the routine succeeded. ate and left no crumbs πE_SYSTEM_ERRORβ system error occurred (seeerrno(3)). go check that man page, iykyk πE_BAD_ARGUMENTβ the routine detected an incorrect or out-of-range argument. someone handed it nonsense fr fr πE_POSTEDβ the menu has already been posted. bestie it's out there, you can't just free it while it's live π«
π PORTABILITY π
these routines emulate the System V menu library. they were not supported on Version 7 or BSD versions β so if you're on ancient territory, that's a no from them π§
π AUTHORS π
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. absolute icons, we stan β
π¦ SEE ALSO π¦
ncurses(3NCURSES)menu(3MENU)
and that's the whole page, bestie!! this lil manual came to you from ncurses 6.6, dated 2024-12-28 β signed, sealed, and slaying πβ¨π
π¦ 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