diff options
Diffstat (limited to 'src/lib/libc/string/strspn.3')
| -rw-r--r-- | src/lib/libc/string/strspn.3 | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/src/lib/libc/string/strspn.3 b/src/lib/libc/string/strspn.3 index 4de03aa58b..f902ca35d2 100644 --- a/src/lib/libc/string/strspn.3 +++ b/src/lib/libc/string/strspn.3 | |||
| @@ -13,11 +13,7 @@ | |||
| 13 | .\" 2. Redistributions in binary form must reproduce the above copyright | 13 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| 14 | .\" notice, this list of conditions and the following disclaimer in the | 14 | .\" notice, this list of conditions and the following disclaimer in the |
| 15 | .\" documentation and/or other materials provided with the distribution. | 15 | .\" documentation and/or other materials provided with the distribution. |
| 16 | .\" 3. All advertising materials mentioning features or use of this software | 16 | .\" 3. Neither the name of the University nor the names of its contributors |
| 17 | .\" must display the following acknowledgement: | ||
| 18 | .\" This product includes software developed by the University of | ||
| 19 | .\" California, Berkeley and its contributors. | ||
| 20 | .\" 4. Neither the name of the University nor the names of its contributors | ||
| 21 | .\" may be used to endorse or promote products derived from this software | 17 | .\" may be used to endorse or promote products derived from this software |
| 22 | .\" without specific prior written permission. | 18 | .\" without specific prior written permission. |
| 23 | .\" | 19 | .\" |
| @@ -33,10 +29,9 @@ | |||
| 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 34 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
| 35 | .\" | 31 | .\" |
| 36 | .\" from: @(#)strspn.3 5.3 (Berkeley) 6/29/91 | 32 | .\" $OpenBSD: strspn.3,v 1.9 2007/05/31 19:19:32 jmc Exp $ |
| 37 | .\" $Id: strspn.3,v 1.1.1.1 1995/10/18 08:42:23 deraadt Exp $ | ||
| 38 | .\" | 33 | .\" |
| 39 | .Dd June 29, 1991 | 34 | .Dd $Mdocdate: May 31 2007 $ |
| 40 | .Dt STRSPN 3 | 35 | .Dt STRSPN 3 |
| 41 | .Os | 36 | .Os |
| 42 | .Sh NAME | 37 | .Sh NAME |
| @@ -48,9 +43,8 @@ | |||
| 48 | .Fn strspn "const char *s" "const char *charset" | 43 | .Fn strspn "const char *s" "const char *charset" |
| 49 | .Sh DESCRIPTION | 44 | .Sh DESCRIPTION |
| 50 | The | 45 | The |
| 51 | .Xr strcspn | 46 | .Fn strspn |
| 52 | function | 47 | function spans the initial part of the NUL-terminated string |
| 53 | spans the initial part of the null-terminated string | ||
| 54 | .Fa s | 48 | .Fa s |
| 55 | as long as the characters from | 49 | as long as the characters from |
| 56 | .Fa s | 50 | .Fa s |
| @@ -59,12 +53,23 @@ occur in string | |||
| 59 | .Sh RETURN VALUES | 53 | .Sh RETURN VALUES |
| 60 | The | 54 | The |
| 61 | .Fn strspn | 55 | .Fn strspn |
| 62 | function | 56 | function returns the number of characters spanned. |
| 63 | returns the number of characters spanned. | 57 | .Sh EXAMPLES |
| 58 | The following call to | ||
| 59 | .Fn strspn | ||
| 60 | will return 3, since the first three characters of string | ||
| 61 | .Fa s | ||
| 62 | are part of string | ||
| 63 | .Fa charset : | ||
| 64 | .Bd -literal -offset indent | ||
| 65 | char *s = "foobar"; | ||
| 66 | char *charset = "of"; | ||
| 67 | size_t span; | ||
| 68 | |||
| 69 | span = strspn(s, charset); | ||
| 70 | .Ed | ||
| 64 | .Sh SEE ALSO | 71 | .Sh SEE ALSO |
| 65 | .Xr index 3 , | ||
| 66 | .Xr memchr 3 , | 72 | .Xr memchr 3 , |
| 67 | .Xr rindex 3 , | ||
| 68 | .Xr strchr 3 , | 73 | .Xr strchr 3 , |
| 69 | .Xr strcspn 3 , | 74 | .Xr strcspn 3 , |
| 70 | .Xr strpbrk 3 , | 75 | .Xr strpbrk 3 , |
| @@ -75,6 +80,5 @@ returns the number of characters spanned. | |||
| 75 | .Sh STANDARDS | 80 | .Sh STANDARDS |
| 76 | The | 81 | The |
| 77 | .Fn strspn | 82 | .Fn strspn |
| 78 | function | 83 | function conforms to |
| 79 | conforms to | ||
| 80 | .St -ansiC . | 84 | .St -ansiC . |
