| 1 |
'\" t |
| 2 |
.\" Copyright, Bruno Haible <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
.\" |
| 7 |
.TH wcsspn 3 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
wcsspn \- get length of a prefix wide-character substring |
| 10 |
.SH LIBRARY |
| 11 |
Standard C library |
| 12 |
.RI ( libc ,\~ \-lc ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.B #include <wchar.h> |
| 16 |
.P |
| 17 |
.BI "size_t wcsspn(const wchar_t *" wcs ", const wchar_t *" accept ); |
| 18 |
.fi |
| 19 |
.SH DESCRIPTION |
| 20 |
The |
| 21 |
.BR wcsspn () |
| 22 |
function is the wide-character equivalent of the |
| 23 |
.BR strspn (3) |
| 24 |
function. |
| 25 |
It determines the length of the longest initial segment of |
| 26 |
.I wcs |
| 27 |
which consists entirely of wide-characters listed in |
| 28 |
.IR accept . |
| 29 |
In other |
| 30 |
words, it searches for the first occurrence in the wide-character string |
| 31 |
.I wcs |
| 32 |
of a wide-character not contained in the wide-character string |
| 33 |
.IR accept . |
| 34 |
.SH RETURN VALUE |
| 35 |
The |
| 36 |
.BR wcsspn () |
| 37 |
function returns the number of |
| 38 |
wide characters in the longest |
| 39 |
initial segment of |
| 40 |
.I wcs |
| 41 |
which consists entirely of wide-characters listed |
| 42 |
in |
| 43 |
.IR accept . |
| 44 |
In other words, it returns the position of the first |
| 45 |
occurrence in the wide-character string |
| 46 |
.I wcs |
| 47 |
of a wide-character not |
| 48 |
contained in the wide-character string |
| 49 |
.IR accept , |
| 50 |
or |
| 51 |
.I wcslen(wcs) |
| 52 |
if there is none. |
| 53 |
.SH ATTRIBUTES |
| 54 |
For an explanation of the terms used in this section, see |
| 55 |
.BR attributes (7). |
| 56 |
.TS |
| 57 |
allbox; |
| 58 |
lbx lb lb |
| 59 |
l l l. |
| 60 |
Interface Attribute Value |
| 61 |
T{ |
| 62 |
.na |
| 63 |
.nh |
| 64 |
.BR wcsspn () |
| 65 |
T} Thread safety MT-Safe |
| 66 |
.TE |
| 67 |
.SH STANDARDS |
| 68 |
C11, POSIX.1-2008. |
| 69 |
.SH HISTORY |
| 70 |
POSIX.1-2001, C99. |
| 71 |
.SH SEE ALSO |
| 72 |
.BR strspn (3), |
| 73 |
.BR wcscspn (3) |