extensions(3NCURSES)

πŸ’– extensions β€” the ncurses lil extras page πŸ’–

okay bestie so this is extensions(3NCURSES), a Library calls situation, and it's basically the junk drawer of ncurses ✨ except the junk is iconic and you actually need it.


🌸 NAME 🌸

curses_version, use_extended_names β€” miscellaneous ncurses extensions πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <curses.h>

const char * curses_version(void);
int use_extended_names(bool bf);

✨ DESCRIPTION ✨

These are ncurses extensions to the curses library, and the way they just do not fit into any other functional category... it's giving "miscellaneous" and honestly that's fine, they ate 🫢

πŸŽ€ curses_version

curses_version hands you back a pointer to a string that's got the library's name and version number in it, patch level included, like for example β€œncurses 6.5.20240720”. literally just the whole vibe of "which ncurses am I" in one string πŸ’–

🧚 use_extended_names

use_extended_names configures whether the library recognizes user-defined or nonstandard terminfo capability names that may be compiled into terminal type descriptions via the terminfo(3NCURSES) or termcap(3NCURSES) interfaces.

Normally these names are available for use, since the essential decision is made through use of tic(1)'s -x option to include such extensions in terminal type descriptions. like that's where the actual yes/no happens, not here, iykyk.

But use_extended_names(FALSE) stops ncurses from recognizing these capabilities, and you'd do that to ensure compatibility with other implementations of curses. so if you need to play nice with the other curses kids, that's your move πŸ‘‘


πŸ’€ RETURN VALUE πŸ’€

curses_version returns a constant string. no cap, it's just a string.

use_extended_names returns the previous state of extended capability name recognition, so you can save that property and restore it later. it's giving "let me remember how things were before I changed them" and honestly, respectful 🫢


πŸ™ˆ NOTES πŸ™ˆ

The pointer returned by curses_version corresponds to statically allocated memory β€” do not attempt to free(3) it. bestie do NOT. that's not your memory to free, put it down 😭

πŸ”₯ EXTENSIONS πŸ”₯

These functions are ncurses extensions, meaning they are not found in SVr4 curses, 4.4BSD curses, or any other previous curses implementation. ncurses originals only, periodt πŸ’…


🌈 PORTABILITY 🌈

If your app is out here employing ncurses extensions, you should condition their use on the visibility of the NCURSES_VERSION preprocessor macro. check before you use, that's the rule ⭐

Also NetBSD 9 added a curses_version function that intentionally returns a string devoid of version information. so same name, but it's not giving what ncurses' version is giving πŸ’€


πŸ‘‘ AUTHORS πŸ‘‘

Thomas Dickey


🌟 SEE ALSO 🌟

ncurses offers several other extensions to the X/Open Curses API, so if you liked this page you're gonna be obsessed with these:

  • getch(3NCURSES)
  • inopts(3NCURSES)
  • mouse(3NCURSES)
  • print(3NCURSES)
  • util(3NCURSES)
  • default_colors(3NCURSES)
  • define_key(3NCURSES)
  • keybound(3NCURSES)
  • keyok(3NCURSES)
  • new_pair(3NCURSES)
  • resizeterm(3NCURSES)
  • wresize(3NCURSES)

and that's the whole page bestie!! this was ncurses 6.6, dated 2025-11-11, from extensions(3NCURSES) β€” go forth and call your little extension functions, mwah πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from