menu_items(3X)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

✨ NAME ✨

okay so this is menu_items(3X), a Library calls page, and it is literally the social secretary for menus and items β€” making and breaking connections between items and menus. bestie, we are covering set_menu_items, menu_items, and item_count. πŸ’…πŸ«Ά

πŸŽ€ SYNOPSIS πŸŽ€

#include <menu.h>

int set_menu_items(MENU *menu, ITEM **items);
ITEM **menu_items(const MENU *menu);
int item_count(const MENU *menu);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: set_menu_items changes the item pointer array of the given menu. and bestie, the array must be terminated by a NULL β€” no cap, that is mandatory. ✨

menu_items returns the item array of the given menu. iconic. πŸ’–

item_count returns the count of items in menu. yup, that is the whole vibe. 🌸

🌈 RETURN VALUE 🌈

menu_items returns a pointer (which may be NULL). it does not set errno. periodt. πŸ’…

item_count returns ERR (the general curses error return value) if its menu parameter is NULL. 😭

set_menu_items returns one of the following codes on error:

  • E_OK β€” the routine succeeded. slay. πŸ‘‘
  • E_BAD_ARGUMENT β€” routine detected an incorrect or out-of-range argument. rude. πŸ™ˆ
  • E_NOT_CONNECTED β€” no items are connected to the menu. it's giving empty group chat. πŸ’€
  • E_POSTED β€” the menu is already posted. too late, bestie. 😭
  • E_SYSTEM_ERROR β€” system error occurred (see errno(3)). screaming. πŸ”₯

🧚 PORTABILITY 🧚

these routines emulate the System V menu library. they were not supported on Version 7 or BSD versions. πŸ’€

the SVr4 menu library documentation specifies the item_count error value as -1 (which is the value of ERR). noted, bestie. 🫢

πŸ‘‘ AUTHORS πŸ‘‘

Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. absolute icons. πŸ’œ

🌟 SEE ALSO 🌟

curses(3X), menu(3X) β€” go read those next, bestie. iykyk. πŸ’–


mwah πŸ’‹ β€” this menu_items(3X) page comes from ncurses 6.5, dated 2024-12-28. bye bestie! 🌈

πŸ“¦ where this page comes from