OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / strspn.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
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.
12 .\"
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.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
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)
30 .TH STRSPN 3  2014-02-28 "" "Linux Programmer's Manual"
31 .SH NAME
32 strspn, strcspn \- get length of a prefix substring
33 .SH SYNOPSIS
34 .nf
35 .B #include <string.h>
36 .sp
37 .BI "size_t strspn(const char *" s ", const char *" accept );
38 .sp
39 .BI "size_t strcspn(const char *" s ", const char *" reject );
40 .fi
41 .SH DESCRIPTION
42 The
43 .BR strspn ()
44 function calculates the length (in bytes) of the initial
45 segment of
46 .I s
47 which consists entirely of bytes in
48 .IR accept .
49 .PP
50 The
51 .BR strcspn ()
52 function calculates the length of the initial
53 segment of
54 .I s
55 which consists entirely of bytes not in
56 .IR reject .
57 .SH RETURN VALUE
58 The
59 .BR strspn ()
60 function returns the number of bytes in
61 the initial segment of
62 .I s
63 which consist only of bytes
64 from
65 .IR accept .
66 .PP
67 The
68 .BR strcspn ()
69 function returns the number of bytes in
70 the initial segment of
71 .I s
72 which are not in the string
73 .IR reject .
74 .SH ATTRIBUTES
75 .SS Multithreading (see pthreads(7))
76 The
77 .BR strspn ()
78 and
79 .BR strcspn ()
80 functions are thread-safe.
81 .SH CONFORMING TO
82 SVr4, 4.3BSD, C89, C99.
83 .SH SEE ALSO
84 .BR index (3),
85 .BR memchr (3),
86 .BR rindex (3),
87 .BR strchr (3),
88 .BR string (3),
89 .BR strpbrk (3),
90 .BR strsep (3),
91 .BR strstr (3),
92 .BR strtok (3),
93 .BR wcscspn (3),
94 .BR wcsspn (3)
95 .SH COLOPHON
96 This page is part of release 3.79 of the Linux
97 .I man-pages
98 project.
99 A description of the project,
100 information about reporting bugs,
101 and the latest version of this page,
102 can be found at
103 \%http://www.kernel.org/doc/man\-pages/.