menu_pattern(3X)

✨ NAME ✨

okay so bestie, this is the menu_pattern(3X) page, filed under Library calls, and it’s all about set_menu_pattern, menu_pattern β€” set and get a menu’s pattern buffer. periodt. πŸ’…


πŸ“š SYNOPSIS πŸ“š

#include <menu.h>

int set_menu_pattern(MENU *menu, const char *pattern);
char *menu_pattern(const MENU *menu);

πŸ’– DESCRIPTION πŸ’–

Every menu has an associated pattern match buffer. When input events that are printable characters come in, they get appended to this match buffer and tested for a match, as described in menu_driver(3X). it’s giving very β€œtype and it finds” energy. πŸŽ€

The function set_menu_pattern sets the pattern buffer for the given menu and tries to find the first matching item. If it succeeds, that item becomes current; if not, the current item does not change. no cap.

The function menu_pattern returns the pattern buffer of the given menu. that’s it, that’s the tea. πŸ“


🫢 RETURN VALUE 🫢

The function menu_pattern returns a pointer, which is NULL if the menu parameter is NULL. Otherwise, it is a pointer to a string which is empty if no pattern has been set. It does not set errno. bestie, read that again. 😭

The function set_menu_pattern may return the following error codes:

  • E_OK β€” the routine succeeded. slay. ✨
  • E_BAD_ARGUMENT β€” routine detected an incorrect or out-of-range argument. πŸ™ˆ
  • E_BAD_STATE β€” routine was called from an initialization or termination function. not the vibe.
  • E_NOT_CONNECTED β€” no items are connected to menu. πŸ’€
  • E_NO_MATCH β€” character failed to match. tragic.
  • E_SYSTEM_ERROR β€” system error occurred (see errno(3)). 🚨

🌈 PORTABILITY 🌈

These routines emulate the System V menu library. They were not supported on Version 7 or BSD versions. so if you’re on those, it’s a no from them. πŸ¦‹


πŸ‘‘ AUTHORS πŸ‘‘

Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. iconic behavior, fr fr. πŸ’œ


πŸ¦‹ SEE ALSO πŸ¦‹

curses(3X), menu(3X)


mwah πŸ’‹ β€” this page is from ncurses 6.6, dated 2024-12-28, and it’s literally called menu_pattern(3X). bye bestie, go match some patterns. 🌸

πŸ“¦ where this page comes from