]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/strspn.3
man*/: srcfix (Use .P instead of .PP or .LP)
[thirdparty/man-pages.git] / man3 / strspn.3
CommitLineData
a1eaacb1 1'\" t
fea681da
MK
2.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3.\"
5fbde956 4.\" SPDX-License-Identifier: Linux-man-pages-copyleft
fea681da
MK
5.\"
6.\" References consulted:
7.\" Linux libc source code
8.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
9.\" 386BSD man pages
10.\" Modified Sat Jul 24 17:57:50 1993 by Rik Faith (faith@cs.unc.edu)
4c1c5274 11.TH strspn 3 (date) "Linux man-pages (unreleased)"
fea681da 12.SH NAME
8a7ac774 13strspn, strcspn \- get length of a prefix substring
e520c96e
AC
14.SH LIBRARY
15Standard C library
8fc3b2cf 16.RI ( libc ", " \-lc )
fea681da
MK
17.SH SYNOPSIS
18.nf
19.B #include <string.h>
c6d039a3 20.P
fea681da 21.BI "size_t strspn(const char *" s ", const char *" accept );
fea681da
MK
22.BI "size_t strcspn(const char *" s ", const char *" reject );
23.fi
24.SH DESCRIPTION
60a90ecd
MK
25The
26.BR strspn ()
a00b7454 27function calculates the length (in bytes) of the initial
46d8df8e
MK
28segment of
29.I s
30which consists entirely of bytes in
31.IR accept .
c6d039a3 32.P
60a90ecd
MK
33The
34.BR strcspn ()
35function calculates the length of the initial
46d8df8e
MK
36segment of
37.I s
38which consists entirely of bytes not in
39.IR reject .
47297adb 40.SH RETURN VALUE
60a90ecd
MK
41The
42.BR strspn ()
a00b7454 43function returns the number of bytes in
46d8df8e
MK
44the initial segment of
45.I s
46which consist only of bytes
47from
48.IR accept .
c6d039a3 49.P
60a90ecd
MK
50The
51.BR strcspn ()
a00b7454 52function returns the number of bytes in
46d8df8e
MK
53the initial segment of
54.I s
55which are not in the string
56.IR reject .
6e16c203 57.SH ATTRIBUTES
a9154894
PH
58For an explanation of the terms used in this section, see
59.BR attributes (7).
60.TS
61allbox;
c466875e 62lbx lb lb
a9154894
PH
63l l l.
64Interface Attribute Value
65T{
9e54434e
BR
66.na
67.nh
a9154894 68.BR strspn (),
6e16c203 69.BR strcspn ()
a9154894
PH
70T} Thread safety MT-Safe
71.TE
3113c7f3 72.SH STANDARDS
4131356c
AC
73C11, POSIX.1-2008.
74.SH HISTORY
75POSIX.1-2001, C89, SVr4, 4.3BSD.
47297adb 76.SH SEE ALSO
fea681da 77.BR memchr (3),
fea681da 78.BR strchr (3),
d095200e 79.BR string (3),
fea681da
MK
80.BR strpbrk (3),
81.BR strsep (3),
82.BR strstr (3),
1709027c 83.BR strtok (3),
f0c34053
MK
84.BR wcscspn (3),
85.BR wcsspn (3)