menu_pattern(3X)

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

okay bestie so this one is from the menu_pattern(3X) corner of the library calls universe, and it's genuinely so much less scary than it sounds, i promise 🫢


🌸 NAME 🌸

set_menu_pattern, menu_pattern β€” literally just setting and getting a menu's pattern buffer, that's the whole vibe πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <menu.h>

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

πŸ’– DESCRIPTION πŸ’–

okay so first things first: every single menu has its own little pattern match buffer. it's like the menu's personal search bar, no cap. and the way it works is β€” as input events that are printable characters come in, they get appended to this match buffer and tested for a match, exactly as described in menu_driver(3X). so it's doing the searching for you in real time, iconic behavior honestly ✨

The function set_menu_pattern sets the pattern buffer for the given menu and then tries to find the first matching item. If it succeeds, that item becomes current β€” slay, main character energy πŸ‘‘. If it does not succeed, the current item just... doesn't change. no drama, no moving, periodt.

The function menu_pattern returns the pattern buffer of the given menu. that's it, that's the whole job πŸŽ€

🧚 RETURN VALUE 🧚

The function menu_pattern returns a pointer. It's NULL if the menu parameter is NULL. Otherwise it's a pointer to a string, and that string is empty if no pattern has been set. Also important: it does not set errno. noted πŸ’œ

The function set_menu_pattern may return the following error codes:

  • E_OK β€” the routine succeeded, we love a win 🌈
  • E_BAD_ARGUMENT β€” routine detected an incorrect or out-of-range argument πŸ™ˆ
  • E_BAD_STATE β€” routine was called from an initialization or termination function, like bestie read the room 😭
  • E_NOT_CONNECTED β€” no items are connected to menu
  • E_NO_MATCH β€” character failed to match πŸ’€
  • 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, this is not the vibe, it's giving old-school ✨

πŸ’… AUTHORS πŸ’…

Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. legends, honestly 🫢

πŸ“ SEE ALSO πŸ“

curses(3X), menu(3X)


and that's the page, bestie!! πŸ¦‹ this was ncurses version 6.5, dated 2024-12-28 β€” so go forth and pattern-match your menus, you absolute icon, i'm obsessed πŸ’–πŸŒΈπŸ‘‘

πŸ“¦ where this page comes from