WMEMCPY(3POSIX)

πŸ’– WMEMCPY β€” the POSIX Programmer's Manual, bestie edition πŸ’–

okay so this is WMEMCPY(3POSIX), straight out of the POSIX Programmer's Manual. Come sit with me, we're gonna go through the whole thing. 🫢


✨ PROLOG

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 pls consult the corresponding Linux manual page for the deets on Linux behavior. Also possible: the interface just... isn't implemented on Linux at all. πŸ’€ iykyk.


🌸 NAME

wmemcpy β€” copy wide characters in memory. that's it, that's the whole job. iconic. πŸ‘‘


πŸŽ€ SYNOPSIS

#include <wchar.h>

wchar_t *wmemcpy(wchar_t *restrict ws1, const wchar_t *restrict ws2,
    size_t n);

look at that signature. restrict on both pointers, no cap. πŸ’…


πŸ¦‹ DESCRIPTION

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

So what does wmemcpy() actually do? It shall copy n wide characters from the object pointed to by ws2 to the object pointed to by ws1. that's the tea. β˜•

And here's the vibe: this function shall not be affected by locale, and all wchar_t values shall be treated identically. The null wide character and wchar_t values not corresponding to valid characters shall not be treated specially. no favoritism, everyone's equal in this function's eyes. 🌈

now if n is zero, the application shall ensure that ws1 and ws2 are valid pointers, and the function shall copy zero wide characters. so like, zero copies, but the pointers still gotta be legit. no shortcuts bestie. ✨

πŸ’œ RETURN VALUE

The wmemcpy() function shall return the value of ws1. giving back what you gave it, main character energy honestly. πŸŽ€


πŸ”₯ ERRORS

No errors are defined. not a single one. flawless behavior. πŸ’…

The following sections are informative. (aka: the vibes-only zone, no rules here.) ✨


πŸ“ EXAMPLES

None. we're keeping it mysterious. πŸ™ˆ


🧚 APPLICATION USAGE

None. nothing more to add, she's self-explanatory. πŸ’–


⭐ RATIONALE

None. no justification needed when you're this iconic. πŸ‘‘


🌸 FUTURE DIRECTIONS

None. the future is bright and unchanged. πŸ¦‹


πŸ’– SEE ALSO

  • wmemchr()
  • wmemcmp()
  • wmemmove()
  • wmemset()

The Base Definitions volume of POSIX.1‐2017, <wchar.h>

go read the whole squad, they're all so good. 🫢


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 β€” so if they disagree, the original wins, no debate. πŸ’… 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, we ate and left no crumbs 🍽️✨ this was IEEE/The Open Group, 2017, WMEMCPY(3POSIX) β€” mwah, love u, go copy some wide characters responsibly πŸ’–πŸŽ€πŸ¦‹