GETWCHAR(3P)

πŸ’– GETWCHAR β€” POSIX Programmer's Manual, section 3P πŸ’–

okay bestie, welcome to getwchar(3P), straight outta the POSIX Programmer's Manual ✨


🌸 PROLOG 🌸

so like, real talk first 🫢 β€” this manual page is part of the POSIX Programmer's Manual. But heads up: the Linux implementation of this interface may differ (so go consult the corresponding Linux manual page for details on Linux behavior, iykyk), or the interface might not even be implemented on Linux at all. πŸ’€ not every system is gonna have your back here.


✨ NAME ✨

getwchar β€” get a wide character from a stdin stream πŸŽ€

like. one wide char. from stdin. that's the whole job. iconic behavior honestly.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <wchar.h>

wint_t getwchar(void);

no arguments, no drama, she just works. πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

okay so the functionality described on this reference page is aligned with the ISO C standard. And if there's any conflict between the requirements described here and the ISO C standard β€” that's unintentional, no cap. This volume of POSIX.1‐2017 defers to the ISO C standard. ✨

The getwchar() function shall be equivalent to getwc(stdin).

that's it. that's the function. it's literally getwc(stdin) in a little outfit. πŸŽ€


πŸ”₯ RETURN VALUE πŸ”₯

Refer to fgetwc(). πŸ‘‘


😭 ERRORS 😭

Refer to fgetwc().

The following sections are informative.


🌈 EXAMPLES 🌈

None. πŸ’€ not a single one. we're on our own out here bestie.


πŸ’… APPLICATION USAGE πŸ’…

okay this one MATTERS, listen up 🫢:

If the wint_t value returned by getwchar() is stored into a variable of type wchar_t and then compared against the wint_t macro WEOF, the result may be incorrect.

Only the wint_t type is guaranteed to be able to represent any wide character and WEOF. like, wchar_t is not invited to that party. periodt. πŸ’…

so don't be out here stuffing a wint_t into a wchar_t and then acting shocked when the WEOF comparison goes feral. πŸ™ˆ

🧚 RATIONALE 🧚

None. 🌸 she simply does not elaborate.


⭐ FUTURE DIRECTIONS ⭐

None. πŸ’– the future is, apparently, unchanged.


πŸ“ SEE ALSO πŸ“

  • Section 2.5, Standard I/O Streams
  • fgetwc()
  • getwc()
  • The Base Definitions volume of POSIX.1‐2017, <wchar.h>

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


and that's the whole page bestie 🫢 this lil icon is brought to you by IEEE/The Open Group, dated 2017 β€” GETWCHAR(3P), signing off. slay πŸ’–βœ¨

πŸ“¦ where this page comes from