diff options
Diffstat (limited to 'src/lib/libc/string/wcslen.3')
-rw-r--r-- | src/lib/libc/string/wcslen.3 | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/src/lib/libc/string/wcslen.3 b/src/lib/libc/string/wcslen.3 index 12f81763ba..b6d9aafc41 100644 --- a/src/lib/libc/string/wcslen.3 +++ b/src/lib/libc/string/wcslen.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: wcslen.3,v 1.3 2013/06/05 03:39:23 tedu Exp $ | 1 | .\" $OpenBSD: wcslen.3,v 1.4 2024/07/14 09:51:18 jca Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. | 3 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. |
4 | .\" All rights reserved. | 4 | .\" All rights reserved. |
@@ -31,26 +31,50 @@ | |||
31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
32 | .\" SUCH DAMAGE. | 32 | .\" SUCH DAMAGE. |
33 | .\" | 33 | .\" |
34 | .Dd $Mdocdate: June 5 2013 $ | 34 | .Dd $Mdocdate: July 14 2024 $ |
35 | .Dt WCSLEN 3 | 35 | .Dt WCSLEN 3 |
36 | .Os | 36 | .Os |
37 | .Sh NAME | 37 | .Sh NAME |
38 | .Nm wcslen | 38 | .Nm wcslen , |
39 | .Nm wcsnlen | ||
39 | .Nd find length of a wide string | 40 | .Nd find length of a wide string |
40 | .Sh SYNOPSIS | 41 | .Sh SYNOPSIS |
41 | .In wchar.h | 42 | .In wchar.h |
42 | .Ft size_t | 43 | .Ft size_t |
43 | .Fn wcslen "const wchar_t *s" | 44 | .Fn wcslen "const wchar_t *s" |
45 | .Ft size_t | ||
46 | .Fn wcsnlen "const wchar_t *s" "size_t maxlen" | ||
44 | .Sh DESCRIPTION | 47 | .Sh DESCRIPTION |
45 | The | 48 | The |
46 | .Fn wcslen | 49 | .Fn wcslen |
47 | function computes the length of the wide string | 50 | function computes the length of the wide string |
48 | .Fa s . | 51 | .Fa s . |
52 | The | ||
53 | .Fn wcsnlen | ||
54 | function computes the length of the wide string | ||
55 | .Fa s , | ||
56 | up to | ||
57 | .Fa maxlen | ||
58 | wide characters. | ||
59 | The | ||
60 | .Fn wcsnlen | ||
61 | function will never attempt to address more than | ||
62 | .Fa maxlen | ||
63 | wide characters, making it suitable for use with wide character arrays | ||
64 | that are not guaranteed to be NUL-terminated. | ||
49 | .Sh RETURN VALUES | 65 | .Sh RETURN VALUES |
50 | The | 66 | The |
51 | .Fn wcslen | 67 | .Fn wcslen |
52 | function returns the number of wide characters that precede the terminating | 68 | function returns the number of wide characters that precede the terminating |
53 | null wide character. | 69 | null wide character. |
70 | .Pp | ||
71 | The | ||
72 | .Fn wcsnlen | ||
73 | function returns the number of wide characters that precede the terminating | ||
74 | null wide character | ||
75 | or | ||
76 | .Fa maxlen , | ||
77 | whichever is smaller. | ||
54 | .Sh SEE ALSO | 78 | .Sh SEE ALSO |
55 | .Xr strlen 3 , | 79 | .Xr strlen 3 , |
56 | .Xr wcswidth 3 | 80 | .Xr wcswidth 3 |
@@ -61,6 +85,10 @@ function conforms to | |||
61 | .St -isoC-99 | 85 | .St -isoC-99 |
62 | and was first introduced in | 86 | and was first introduced in |
63 | .St -isoC-amd1 . | 87 | .St -isoC-amd1 . |
88 | The | ||
89 | .Fn wcsnlen | ||
90 | function conforms to | ||
91 | .St -p1003.1-2008 . | ||
64 | .Sh HISTORY | 92 | .Sh HISTORY |
65 | The | 93 | The |
66 | .Fn wcslen | 94 | .Fn wcslen |
@@ -68,3 +96,7 @@ function was ported from | |||
68 | .Nx | 96 | .Nx |
69 | and first appeared in | 97 | and first appeared in |
70 | .Ox 3.8 . | 98 | .Ox 3.8 . |
99 | The | ||
100 | .Fn wcsnlen | ||
101 | function first appeared in | ||
102 | .Ox 7.6 . | ||