]>
Commit | Line | Data |
---|---|---|
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 | 13 | strspn, strcspn \- get length of a prefix substring |
e520c96e AC |
14 | .SH LIBRARY |
15 | Standard C library | |
8fc3b2cf | 16 | .RI ( libc ", " \-lc ) |
fea681da MK |
17 | .SH SYNOPSIS |
18 | .nf | |
19 | .B #include <string.h> | |
68e4db0a | 20 | .PP |
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 |
25 | The |
26 | .BR strspn () | |
a00b7454 | 27 | function calculates the length (in bytes) of the initial |
46d8df8e MK |
28 | segment of |
29 | .I s | |
30 | which consists entirely of bytes in | |
31 | .IR accept . | |
fea681da | 32 | .PP |
60a90ecd MK |
33 | The |
34 | .BR strcspn () | |
35 | function calculates the length of the initial | |
46d8df8e MK |
36 | segment of |
37 | .I s | |
38 | which consists entirely of bytes not in | |
39 | .IR reject . | |
47297adb | 40 | .SH RETURN VALUE |
60a90ecd MK |
41 | The |
42 | .BR strspn () | |
a00b7454 | 43 | function returns the number of bytes in |
46d8df8e MK |
44 | the initial segment of |
45 | .I s | |
46 | which consist only of bytes | |
47 | from | |
48 | .IR accept . | |
fea681da | 49 | .PP |
60a90ecd MK |
50 | The |
51 | .BR strcspn () | |
a00b7454 | 52 | function returns the number of bytes in |
46d8df8e MK |
53 | the initial segment of |
54 | .I s | |
55 | which are not in the string | |
56 | .IR reject . | |
6e16c203 | 57 | .SH ATTRIBUTES |
a9154894 PH |
58 | For an explanation of the terms used in this section, see |
59 | .BR attributes (7). | |
60 | .TS | |
61 | allbox; | |
c466875e | 62 | lbx lb lb |
a9154894 PH |
63 | l l l. |
64 | Interface Attribute Value | |
65 | T{ | |
9e54434e BR |
66 | .na |
67 | .nh | |
a9154894 | 68 | .BR strspn (), |
6e16c203 | 69 | .BR strcspn () |
a9154894 PH |
70 | T} Thread safety MT-Safe |
71 | .TE | |
c466875e | 72 | .sp 1 |
3113c7f3 | 73 | .SH STANDARDS |
4131356c AC |
74 | C11, POSIX.1-2008. |
75 | .SH HISTORY | |
76 | POSIX.1-2001, C89, SVr4, 4.3BSD. | |
47297adb | 77 | .SH SEE ALSO |
fea681da | 78 | .BR memchr (3), |
fea681da | 79 | .BR strchr (3), |
d095200e | 80 | .BR string (3), |
fea681da MK |
81 | .BR strpbrk (3), |
82 | .BR strsep (3), | |
83 | .BR strstr (3), | |
1709027c | 84 | .BR strtok (3), |
f0c34053 MK |
85 | .BR wcscspn (3), |
86 | .BR wcsspn (3) |