WCSRCHR(3POSIX)

WCSRCHR πŸ’– (3POSIX)

okay bestie, so this one's from the POSIX Programmer's Manual β€” the whole shebang lives in section 3POSIX, and it's all about one lil' wide-character scanning function. pull up a chair 🫢


✨ PROLOG ✨

real talk before we start: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ (so if you're on Linux, go check the corresponding Linux manual page for the actual tea β˜•), or the interface might not even be implemented on Linux at all. πŸ’€ not every system is gonna have it, iykyk.


🌸 NAME 🌸

wcsrchr β€” wide-character string scanning operation. yes queen, that's the whole name. short, sweet, iconic.


πŸŽ€ SYNOPSIS πŸŽ€

#include <wchar.h>

wchar_t *wcsrchr(const wchar_t *ws, wchar_t wc);

like. look at her. so clean. πŸ¦‹


πŸ’… DESCRIPTION πŸ’…

bestie, quick heads up: the functionality described on this reference page is aligned with the ISO C standard. any conflict between what's written here and the ISO C standard is genuinely unintentional β€” no drama intended fr. this volume of POSIX.1‐2017 defers to the ISO C standard, periodt.

so what does wcsrchr() actually do?? it shall locate the last occurrence of wc in the wide-character string pointed to by ws. last, okay? not first. that's the whole vibe β€” it scans from the back, main character energy going backwards. πŸ”₯

and here's the part you can't skip: the application shall ensure that the value of wc is a character representable as a type wchar_t and a wide-character code corresponding to a valid character in the current locale. no sneaking in random values, that's on you to guarantee. πŸ™ˆ

also β€” and this is lowkey important β€” the terminating null wide-character code shall be considered to be part of the wide-character string. so it's in the club. it counts. πŸŽ€


⭐ RETURN VALUE ⭐

upon successful completion, wcsrchr() shall return a pointer to the wide-character code β€” or a null pointer if wc does not occur in the wide-character string. that's it. that's the deal. if she's not there, you get a null pointer and you gotta handle that yourself bestie. πŸ’€


🌈 ERRORS 🌈

no errors are defined. literally none. she's not like other functions. ✨

the following sections are informative β€” so like, they're the lore, not the law. πŸ“–


πŸ’œ EXAMPLES πŸ’œ

None.


🧚 APPLICATION USAGE 🧚

None.


πŸ“ RATIONALE πŸ“

None.


πŸ¦‹ FUTURE DIRECTIONS πŸ¦‹

None.


πŸ‘‘ SEE ALSO πŸ‘‘

  • wcschr() β€” the forward-scanning sibling, go say hi πŸ’•
  • 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 .

that's the whole page, bestie β€” every flag-free, option-free, error-free inch of it. πŸ’…βœ¨ stay scanning, queen. 🫢

IEEE/The Open Group β€’ 2017 β€’ WCSRCHR(3POSIX) β€” mwah, love u, bye πŸŽ€πŸ’–