WCSCSPN(3POSIX)

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

okay so we're doing WCSCSPN(3POSIX) from the POSIX Programmer's Manual and honestly? it's giving "tiny function, big main character energy." let's get into it 🫢


🌸 PROLOG 🌸

This manual page is part of the POSIX Programmer's Manual. Heads up though, bestie β€” the Linux implementation of this interface may differ (so like, go consult the corresponding Linux manual page for the details on Linux behavior), or the interface might not even be implemented on Linux at all. πŸ’€ no cap, always check.


✨ NAME ✨

wcscspn β€” get the length of a complementary wide substring

like… it counts wide characters until it hits one of the "no thank you" ones. iconic behavior honestly.


πŸŽ€ SYNOPSIS πŸŽ€

#include <wchar.h>

size_t wcscspn(const wchar_t *ws1, const wchar_t *ws2);

πŸ¦‹ DESCRIPTION πŸ¦‹

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 conflict is unintentional β€” this volume of POSIX.1‐2017 defers to the ISO C standard. periodt.

So here's the tea: wcscspn() shall compute the length (in wide characters) of the maximum initial segment of the wide-character string pointed to by ws1 which consists entirely of wide-character codes not from the wide-character string pointed to by ws2.

basically: walk down ws1, keep going while every character is not in ws2, and tell me how far you got. the second you hit something from ws2, we're done. πŸ’…


🌈 RETURN VALUE 🌈

wcscspn() shall return the length of the initial substring of ws1. and nope β€” no return value is reserved to indicate an error. there's no secret error code hiding in there, bestie, it's just a number.


πŸ’€ ERRORS πŸ’€

No errors are defined.

The following sections are informative β€” aka, the chill vibes section, no rules, just lore.


πŸ“ EXAMPLES πŸ“

None.

(she's mysterious. she's minimal. we respect it. πŸ™ˆ)


🧚 APPLICATION USAGE 🧚

None.


πŸ’œ RATIONALE πŸ’œ

None.


⭐ FUTURE DIRECTIONS ⭐

None.


πŸ”₯ SEE ALSO πŸ”₯

  • wcsspn()

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 πŸ₯° signed, sealed, delivered β€” this one came from IEEE/The Open Group, 2017, and yeah the page is literally titled WCSCSPN(3POSIX). go forth and count those complementary wide characters πŸ’–βœ¨πŸŽ€