items(3MENU)
π items(3MENU) β library calls, but make it a vibe β¨
okay bestie, so we're in items(3MENU) territory, which is the part of the library where you make and break connections between items and menus π it's giving matchmaker energy fr fr, and honestly? we're obsessed.
πΈ NAME πΈ
set_menu_items, menu_items, item_count β these three are literally the glue that makes and breaks connections between items and menus. periodt. π
β¨ SYNOPSIS β¨
#include <menu.h>
int set_menu_items(MENU *menu, ITEM **items);
ITEM **menu_items(const MENU *menu);
int item_count(const MENU *menu);
yes, that's it, that's the whole lil squad π«Ά
π¦ DESCRIPTION π¦
So like, three functions, three jobs, all iconic in their own way:
set_menu_itemsβ this one changes the item pointer array of the given menu. and listen, the array must be terminated by aNULL. no cap. if you forget theNULLbestie, that's a whole situation you do not want πmenu_itemsβ this one just hands you back the item array of the given menu. lowkey the chill one of the group πitem_countβ and this one returns the count of items inmenu. the math girlie of the trio, we stan π
π₯ RETURN VALUE π₯
menu_itemsreturns a pointer β which may beNULL, so pls check it π β and it does not seterrno.item_countreturnsERR(aka the general curses error return value) if itsmenuparameter isNULL. so yeah, pass a real menu, not vibes β¨set_menu_itemsreturns one of the following codes when something goes sideways:E_OKβ the routine succeeded. slay, we love to see it πE_BAD_ARGUMENTβ routine detected an incorrect or out-of-range argument. not the argument being messy πE_NOT_CONNECTEDβ no items are connected to the menu. it's giving ghosted πE_POSTEDβ the menu is already posted. can't do the thing while it's out there living its main character moment, sorry πE_SYSTEM_ERRORβ system error occurred (seeerrno(3)). the computer said no π§οΈ
π PORTABILITY π
These routines emulate the System V menu library. they were not supported on Version 7 or BSD versions, so if you're kicking it old-school with those, bestie, you're on your own π§
Also important, highkey: the SVr4 menu library documentation specifies the item_count error value as -1 (which is the value of ERR). so like, same energy, different spelling π
π AUTHORS π
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. absolute legends, ty for your service π«Ά
π SEE ALSO π
ncurses(3NCURSES)menu(3MENU)
go read those next bestie, it's a whole journey β¨
okay and that's the whole page!! π this was ncurses 6.6, dated 2024-12-28, and it's the items(3MENU) girlies signing off β stay connected, terminate your arrays with NULL, and don't be a E_POSTED situation ππ
β¨
π¦ 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-2012,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