WCSSTR(3P)

πŸ’– WCSSTR(3P) β€” the wide-char substring hunt πŸ’–

okay bestie, so this one lives in the POSIX Programmer's Manual, and it's giving "find me a wide-character substring" energy. Let's get into it πŸ¦‹


🌸 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 consult the corresponding Linux manual page for the actual deets on Linux behavior. Or, plot twist, the interface might just not be implemented on Linux at all. So like... vibe check your platform first, fr fr. 😭


✨ NAME ✨

wcsstr β€” find a wide-character substring. that's it, that's the whole job, and she does it flawlessly πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <wchar.h>

wchar_t *wcsstr(const wchar_t *restrict ws1,
    const wchar_t *restrict ws2);

πŸ¦‹ DESCRIPTION πŸ¦‹

So the functionality described 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's unintentional, nobody did that on purpose bestie. And this volume of POSIX.1‐2017 defers to the ISO C standard. periodt. πŸ‘‘

Now the actual tea: wcsstr() shall locate the first occurrence in the wide-character string pointed to by ws1 of the sequence of wide characters (and yes, excluding the terminating null wide character, she's not that kind of girl) in the wide-character string pointed to by ws2. it's giving "where's my girl at" πŸ”


πŸ’– RETURN VALUE πŸ’–

Upon successful completion, wcsstr() shall return a pointer to the located wide-character string. slay. ✨

Or β€” and this is the sad part β€” a null pointer if the wide-character string is not found. 😭

And here's a lil special case you gotta know: if ws2 points to a wide-character string with zero length, the function shall return ws1. iconic behavior honestly, she just hands you back what you gave her 🫢


πŸ’€ ERRORS πŸ’€

No errors are defined. like, none. zero. she's chill. 🌈

The following sections are informative β€” so they're just vibes, not requirements, iykyk.


🌸 EXAMPLES 🌸

None. πŸ™ˆ


🧚 APPLICATION USAGE 🧚

None. πŸ’œ


⭐ RATIONALE ⭐

None. πŸ’«


🌈 FUTURE DIRECTIONS 🌈

None. πŸ¦‹


πŸ‘‘ SEE ALSO πŸ‘‘

  • wcschr()
  • The Base Definitions volume of POSIX.1‐2017, <wchar.h>

okay this part is the legal bit so I'm keeping it exactly as it is, no cap:

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 cutie came to you courtesy of IEEE/The Open Group, 2017, and she's literally called WCSSTR(3P). go find your substrings, you got this πŸ’…βœ¨πŸ’–

πŸ“¦ where this page comes from