mitem_opts(3X)

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

πŸ’… mitem_opts(3X) β€” like, the menu item options page, bestie

okay so this is a library call page from the menu crew β€” the header literally says mitem_opts(3X) up top and "Library calls" is the section, so now you know where you are. it's all about setting and getting the option bits on a menu ITEM. stay with me, it's actually so chill.


✨ SYNOPSIS ✨

#include <menu.h>

int set_item_opts(ITEM *item, Item_Options opts);
Item_Options item_opts(const ITEM *item);

int item_opts_on(ITEM *item, Item_Options opts);
int item_opts_off(ITEM *item, Item_Options opts);

like, that's the whole cast of characters πŸŽ€


🌸 DESCRIPTION 🌸

okay so first up: set_item_opts sets all the given item's option bits. and bestie, menu option bits can be logically "or"-ed together β€” so you can stack 'em up iykyk πŸ’…

then there's item_opts_on, which turns on the given option bits and leaves everything else alone. it's giving minimal interference, we love that ✨

item_opts_off is the opposite vibe β€” it turns off the given option bits and leaves the others alone. no collateral damage, periodt 🫢

and item_opts just hands you back the item's current option bits. a little peek behind the curtain πŸ‘‘

so here's the tea: there is only one defined option bit mask, and it's O_SELECTABLE. when this is on, the item may be selected during menu processing. and it defaults to on, so like, it's already slaying for you out of the box. no cap. 🌈


πŸ’– RETURN VALUE πŸ’–

except for item_opts (she's special, she just returns the bits), each routine returns one of the following:

  • E_OK β€” the routine succeeded. slay. βœ…
  • E_SYSTEM_ERROR β€” a system error occurred (see errno(3)). yeah that's the 😭 one, go check your errno.

πŸ¦‹ PORTABILITY πŸ¦‹

these routines emulate the System V menu library, fr fr. heads up though: they were not supported on Version 7 or BSD versions. so if you're time-travelling to those, it's a no from them πŸ™ˆ


πŸ‘‘ AUTHORS πŸ‘‘

Juergen Pfeifer. manual pages and adaptation for new curses by Eric S. Raymond. absolute icons, both of them. πŸ’œ


πŸŽ€ SEE ALSO πŸŽ€

  • curses(3X)
  • menu(3X)

okay that's the whole page, you ate that πŸ“ go forth and set your option bits, bestie.

β€” xoxo, ncurses 6.5, dated 2025-01-18 🧚✨

πŸ“¦ where this page comes from