curs_in_wch(3X)
β¨ curs_in_wch β the ncurses manual page, but make it cute β¨
okay bestie, so this is page curs_in_wch from the 3X manual section, and it's literally all about snatching a complex character out of a curses window. no cap. π
π NAME π
in_wch, win_wch, mvin_wch, mvwin_wch β get a curses complex character from a window π¦
πΈ SYNOPSIS πΈ
#include <curses.h>
int in_wch(cchar_t * wch);
int win_wch(WINDOW * win, cchar_t * wch);
int mvin_wch(int y, int x, cchar_t * wch);
int mvwin_wch(WINDOW * win, int y, int x, cchar_t * wch);
π DESCRIPTION π
So here's the tea, bestie: win_wch copies the curses complex character that's chilling at the cursor position in win and drops it right into wch. β¨
And like, if you wanna actually do something with it after that? Use getcchar(3X) to pull out its character code, its attributes, and its color pair identifier. the whole package deal π
ncurses(3X) is where you go if you wanna read up on the variants of this function β that's the lore. π
π₯ RETURN VALUE π₯
These functions are giving OK when everything slays, and ERR when it does not. π
In ncurses, they returnERRifwinisNULL. periodt.
And the functions with the mv prefix? They do a little cursor movement first, and they fail if the position (y, x) is outside the window boundaries. π«
π«Ά NOTES π«Ά
in_wch,mvin_wch, andmvwin_wchmay be implemented as macros. lowkey sneaky of them ngl π- Unlike
winch(3X),win_wchand its variants store the value of the retrieved character in an additionalwchparameter instead of the return value. it's giving main character energy in the argument list π
π PORTABILITY π
X/Open Curses Issue 4 describes these functions. It specifies no error conditions for them. iconic, honestly β no rules, just vibes. π
π HISTORY π
X/Open Curses Issue 4 (1995) initially specified these functions. π°οΈ
Then the System V Interface Definition Version 4 of the same year specified a function named winwch (and the usual variants, iykyk). This was a later addition to SVr4.x β it did not appear in the first SVr4 (1989). π
And the way that it differed from X/Open's later win_wch?? It returned a value of type chtype instead of cchar_t. not the same vibe at all bestie. π¦
π SEE ALSO π
curs_inch(3X)describes comparable functions of the ncurses library in its non-wide-character configuration.curses(3X)curs_inwstr(3X)
and that's the whole page, bestie β go forth and grab those complex characters π
this was ncurses 6.6, dated 2025-02-01, from the curs_in_wch(3X) page. mwah, go touch some terminals πβ¨
π¦ where this page comes from
- alpine 3.24: ncurses-doc 6.6_p20260516-r0 Β· X11
- arch rolling: ncurses 6.6-2 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- Copyright 2018-2024,2025 Thomas E. Dickey
- Copyright 2002-2010,2017 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms