PUTWC(3P)

πŸ’– PUTWC(3P) πŸ’–

okay bestie, gather round, because we're doing a POSIX Programmer's Manual page today β€” it's putwc, from the POSIX Programmer's Manual volume, and yes it's a whole vibe. πŸŽ€


✨ PROLOG ✨

so like, real talk first: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ (so go consult the corresponding Linux manual page for the tea on Linux behavior, bestie), or β€” plot twist β€” the interface may not even be implemented on Linux at all. πŸ™ˆ


🌸 NAME 🌸

putwc β€” put a wide character on a stream

like, that's it, that's the whole job. iconic honestly. πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <stdio.h>
#include <wchar.h>

wint_t putwc(wchar_t wc, FILE *stream);

πŸ’… DESCRIPTION πŸ’…

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, fr fr, no cap. this volume of POSIX.1‐2017 defers to the ISO C standard. periodt.

the putwc() function shall be equivalent to fputwc(), except β€” and this is the part that matters, don't skip it β€” if it is implemented as a macro, it may evaluate stream more than once. so the argument should never be an expression with side-effects. like, never ever. 🚫


πŸ“ RETURN VALUE πŸ“

Refer to fputwc().


πŸ’€ ERRORS πŸ’€

Refer to fputwc().

the following sections are informative. (yes, all lowercase energy, they're just like that.)


🌈 EXAMPLES 🌈

None.

yeah. nothing. empty. the void. πŸ•³οΈ


🧚 APPLICATION USAGE 🧚

okay so this is the warning arc: since it may be implemented as a macro, putwc() may treat a stream argument with side-effects incorrectly. in particular:

putwc(wc,*f++)

need not work correctly. 😭

therefore, use of this function is not recommended; fputwc() should be used instead. that's not me being dramatic, that's the standard being dramatic. use fputwc(), bestie. 🫢


⭐ RATIONALE ⭐

None.


πŸ”₯ FUTURE DIRECTIONS πŸ”₯

None.


πŸ‘‘ SEE ALSO πŸ‘‘

  • Section 2.5, Standard I/O Streams, fputwc()
  • The Base Definitions volume of POSIX.1‐2017, <stdio.h>, <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 one came to you courtesy of IEEE/The Open Group, dated 2017, and it answers to the name PUTWC(3P) β€” mwah, slay, go put a wide character on a stream responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from