]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/strspn.3
err.3: EXAMPLES: use EXIT_FAILURE rather than 1 as exit status
[thirdparty/man-pages.git] / man3 / strspn.3
CommitLineData
fea681da
MK
1.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
7.\"
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
c13182ef 12.\"
fea681da
MK
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date. The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
16.\" the use of the information contained herein. The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
c13182ef 20.\"
fea681da
MK
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 23.\" %%%LICENSE_END
fea681da
MK
24.\"
25.\" References consulted:
26.\" Linux libc source code
27.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28.\" 386BSD man pages
29.\" Modified Sat Jul 24 17:57:50 1993 by Rik Faith (faith@cs.unc.edu)
460495ca 30.TH STRSPN 3 2015-08-08 "" "Linux Programmer's Manual"
fea681da 31.SH NAME
8a7ac774 32strspn, strcspn \- get length of a prefix substring
fea681da
MK
33.SH SYNOPSIS
34.nf
35.B #include <string.h>
68e4db0a 36.PP
fea681da 37.BI "size_t strspn(const char *" s ", const char *" accept );
68e4db0a 38.PP
fea681da
MK
39.BI "size_t strcspn(const char *" s ", const char *" reject );
40.fi
41.SH DESCRIPTION
60a90ecd
MK
42The
43.BR strspn ()
a00b7454 44function calculates the length (in bytes) of the initial
46d8df8e
MK
45segment of
46.I s
47which consists entirely of bytes in
48.IR accept .
fea681da 49.PP
60a90ecd
MK
50The
51.BR strcspn ()
52function calculates the length of the initial
46d8df8e
MK
53segment of
54.I s
55which consists entirely of bytes not in
56.IR reject .
47297adb 57.SH RETURN VALUE
60a90ecd
MK
58The
59.BR strspn ()
a00b7454 60function returns the number of bytes in
46d8df8e
MK
61the initial segment of
62.I s
63which consist only of bytes
64from
65.IR accept .
fea681da 66.PP
60a90ecd
MK
67The
68.BR strcspn ()
a00b7454 69function returns the number of bytes in
46d8df8e
MK
70the initial segment of
71.I s
72which are not in the string
73.IR reject .
6e16c203 74.SH ATTRIBUTES
a9154894
PH
75For an explanation of the terms used in this section, see
76.BR attributes (7).
77.TS
78allbox;
79lbw19 lb lb
80l l l.
81Interface Attribute Value
82T{
83.BR strspn (),
6e16c203 84.BR strcspn ()
a9154894
PH
85T} Thread safety MT-Safe
86.TE
47297adb 87.SH CONFORMING TO
856d2bd1 88POSIX.1-2001, POSIX.1-2008, C89, C99, SVr4, 4.3BSD.
47297adb 89.SH SEE ALSO
fea681da
MK
90.BR index (3),
91.BR memchr (3),
92.BR rindex (3),
93.BR strchr (3),
d095200e 94.BR string (3),
fea681da
MK
95.BR strpbrk (3),
96.BR strsep (3),
97.BR strstr (3),
1709027c 98.BR strtok (3),
f0c34053
MK
99.BR wcscspn (3),
100.BR wcsspn (3)