menu_requestname(3X)

okay so this is a 3X library calls page for menu_requestname β€” yes that's the whole family name, and honestly it's giving "handle printable menu request names" πŸŽ€. Sit down, grab a boba, we're doing this together.


🌸 NAME 🌸

menu_request_by_name, menu_request_name β€” handle printable menu request names πŸ¦‹

no literally that's it. two little functions, one big job: turning request codes into names and names back into request codes. iykyk πŸ’…


✨ SYNOPSIS ✨

#include <menu.h>

const char *menu_request_name(int request);
int menu_request_by_name(const char *name);

two of them. one gives you a name, one gives you a code. they're a matched set bestie, like bestie bracelets but for ncurses πŸ”₯


πŸ’œ DESCRIPTION πŸ’œ

okay so, function number one: menu_request_name returns the printable name of a menu request code. that's it, that's the whole vibe. you hand it a request, it hands you back the cute string version.

function number two: menu_request_by_name goes searching in the name-table for a request with the given name and returns its request code. it's like a little lookup goblin 🧚. and if it doesn't find it? E_NO_MATCH is returned. no match, no code, we move on. πŸ™ˆ


⭐ RETURN VALUE ⭐

  • menu_request_name returns NULL on error and sets errno to E_BAD_ARGUMENT. yes it sets errno, she's thorough.
  • menu_request_by_name returns E_NO_MATCH on error. and here's the thing β€” it does not set errno. not its business, not its problem πŸ’€
fr fr keep that distinction in your head, bestie β€” one of them touches errno and one of them absolutely does not.

🌈 PORTABILITY 🌈

these routines are specific to ncurses. they were not supported on Version 7, BSD or System V implementations. so if you're out here writing code that depends on them, it is recommended that you condition it using NCURSES_VERSION β€” like, wrap it, protect it, keep it safe 🫢.

not me warning you that your portable-ish code is about to be deeply unportable. condition on NCURSES_VERSION, periodt.

πŸ‘‘ 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)

go read those next, bestie, they're the rest of the lore πŸ“š


and that's the whole page!! slay πŸ’– this was the ncurses 6.6 version, dated 2024-12-28, and it lives under the name menu_requestname(3X). mwah, go write some menus πŸ“πŸ’…

πŸ“¦ where this page comes from