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>
π COPYRIGHT π
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 πβ¨π
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms