WMEMSET(3POSIX)

πŸ’– WMEMSET(3POSIX) πŸ’–

okay bestie, welcome to the POSIX Programmer's Manual β€” this is the wmemset(3POSIX) page, from the volume that shipped in 2017. pull up a chair, grab a boba, we're doing wide characters today πŸ§‹βœ¨


🌸 PROLOG 🌸

Real talk first, because it matters: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β€” so if you're actually on Linux, go read the corresponding Linux manual page for the real tea on Linux behavior. OR the interface might just not be implemented on Linux at all πŸ™ˆ. Either way, vibe check your platform first, iykyk.


✨ NAME ✨

wmemset β€” set wide characters in memory πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <wchar.h>

wchar_t *wmemset(wchar_t *ws, wchar_t wc, size_t n);

πŸ¦‹ DESCRIPTION πŸ¦‹

So the functionality on this reference page is aligned with the ISO C standard. If there's any conflict between what's written here and the ISO C standard, that conflict is unintentional β€” and this volume of POSIX.1‐2017 defers to the ISO C standard. The C standard is the referee, periodt.

Now the actual function, bestie. wmemset() shall copy the value of wc into each of the first n wide characters of the object pointed to by ws. That's it, that's the whole job πŸ‘‘

And here's the iconic part: this function shall not be affected by locale, and all wchar_t values shall be treated identically. The null wide character? Not special. wchar_t values that don't correspond to valid characters? Also not special. No favorites here, everyone gets the same treatment. It's giving egalitarian πŸ’–

One little edge case, so listen up: if n is zero, the application shall ensure that ws is a valid pointer β€” yes, even though nothing gets written, ws still has to be legit β€” and the function shall copy zero wide characters. Zero. Nothing. Empty. Nada. But the pointer still gotta be valid, no cap.


πŸ”₯ RETURN VALUE πŸ”₯

The wmemset() functions shall return the value of ws. That's your pointer, back in your hands, same one you gave it. 🫢


πŸ’€ ERRORS πŸ’€

No errors are defined. Literally none. It's a no-drama function.

The following sections are informative.


🌈 EXAMPLES 🌈

None.


πŸ’œ APPLICATION USAGE πŸ’œ

None.


⭐ RATIONALE ⭐

None.


🧚 FUTURE DIRECTIONS 🧚

None.


πŸ‘‘ SEE ALSO πŸ‘‘

  • wmemchr()
  • wmemcmp()
  • wmemcpy()
  • wmemmove()

Also, from 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 .


okay that's the whole page, bestie, you ate it πŸ“βœ¨ this was the IEEE/The Open Group 2017 edition of WMEMSET(3POSIX) β€” go forth and memset those wide chars, mwah πŸ’‹