WMEMCHR(3POSIX)

πŸ’– WMEMCHR(3POSIX) β€” the POSIX Programmer's Manual, bestie edition πŸ’–

okay so real talk, this is page WMEMCHR(3POSIX) from the POSIX Programmer's Manual, and we're about to find a wide character in memory. yes. in memory. it's giving search party but make it C. πŸ¦‹


🌸 PROLOG 🌸

Heads up, queen: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β€” so pls consult the corresponding Linux manual page for details on Linux behavior β€” or, plot twist, the interface may not even be implemented on Linux at all. πŸ’€


✨ NAME ✨

wmemchr β€” find a wide character in memory πŸ”


πŸŽ€ SYNOPSIS πŸŽ€

#include <wchar.h>

wchar_t *wmemchr(const wchar_t *ws, wchar_t wc, size_t n);

πŸ’… DESCRIPTION πŸ’…

The functionality described on this reference page is aligned with the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional β€” no drama intended, fr fr. This volume of POSIX.1‐2017 defers to the ISO C standard. πŸ‘‘

So what does wmemchr() actually do? It shall locate the first occurrence of wc in the initial n wide characters of the object pointed to by ws. That's the whole vibe.

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 and wchar_t values not corresponding to valid characters shall not be treated specially. no favorites, no special treatment, everyone's equal in this function's eyes. πŸ’–

If n is zero, the application shall ensure that ws is a valid pointer, and the function behaves as if no valid occurrence of wc is found. so like… you still gotta hand it a real pointer bestie, don't be out here passing nonsense πŸ™ˆ

⭐ RETURN VALUE ⭐

The wmemchr() function shall return a pointer to the located wide character, or a null pointer if the wide character does not occur in the object. found it = pointer, didn't find it = null pointer, no in-between. periodt. πŸ’…


πŸ’€ ERRORS πŸ’€

No errors are defined.

The following sections are informative. (translation: the rest of this page is lore, not law 🌈)


πŸ“ EXAMPLES πŸ“

None.


🧚 APPLICATION USAGE 🧚

None.


🌈 RATIONALE 🌈

None.


πŸ”₯ FUTURE DIRECTIONS πŸ”₯

None.


πŸ’œ SEE ALSO πŸ’œ

  • wmemcmp()
  • wmemcpy()
  • wmemmove()
  • wmemset()

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 one came to you from IEEE/The Open Group, dated 2017 β€” so yeah, it's a lil vintage but it still ate. 🫢 mwah, go find your wide characters. πŸ’–βœ¨