diff options
author | schwarze <> | 2017-09-05 03:16:14 +0000 |
---|---|---|
committer | schwarze <> | 2017-09-05 03:16:14 +0000 |
commit | f63c4fd91b8483c7d4364046fd6ef2d2679dd63a (patch) | |
tree | d7f851bfa426cf869a3a3aec05ffba386b6f2ce5 /src/lib/libc/string/strxfrm.3 | |
parent | c1d0fec9b838e4df93e396d54f1e4b9a41f7401a (diff) | |
download | openbsd-f63c4fd91b8483c7d4364046fd6ef2d2679dd63a.tar.gz openbsd-f63c4fd91b8483c7d4364046fd6ef2d2679dd63a.tar.bz2 openbsd-f63c4fd91b8483c7d4364046fd6ef2d2679dd63a.zip |
New POSIX xlocale implementation written from scratch.libressl-v2.6.1
Complete in the sense that all POSIX *locale(3) and *_l(3) functions
are included, but in OpenBSD, we of course only really care about
LC_CTYPE and we only support ASCII and UTF-8.
With important help from kettenis@, guenther@, and jca@.
Repeated testing in ports bulk builds by naddy@.
Additional testing by jca@, sebastia@, dcoppa@, and others.
OK kettenis@ dcoppa@, and guenther@ on an earlier version.
Riding guenther@'s libc/librthread major bump.
Diffstat (limited to 'src/lib/libc/string/strxfrm.3')
-rw-r--r-- | src/lib/libc/string/strxfrm.3 | 57 |
1 files changed, 40 insertions, 17 deletions
diff --git a/src/lib/libc/string/strxfrm.3 b/src/lib/libc/string/strxfrm.3 index 481f741cb7..1a96c8512e 100644 --- a/src/lib/libc/string/strxfrm.3 +++ b/src/lib/libc/string/strxfrm.3 | |||
@@ -1,4 +1,7 @@ | |||
1 | .\" $OpenBSD: strxfrm.3,v 1.11 2017/09/05 03:16:13 schwarze Exp $ | ||
2 | .\" | ||
1 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. | 3 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. |
4 | .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> | ||
2 | .\" All rights reserved. | 5 | .\" All rights reserved. |
3 | .\" | 6 | .\" |
4 | .\" This code is derived from software contributed to Berkeley by | 7 | .\" This code is derived from software contributed to Berkeley by |
@@ -29,24 +32,27 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 32 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 33 | .\" SUCH DAMAGE. |
31 | .\" | 34 | .\" |
32 | .\" $OpenBSD: strxfrm.3,v 1.10 2013/06/05 03:39:23 tedu Exp $ | 35 | .Dd $Mdocdate: September 5 2017 $ |
33 | .\" | ||
34 | .Dd $Mdocdate: June 5 2013 $ | ||
35 | .Dt STRXFRM 3 | 36 | .Dt STRXFRM 3 |
36 | .Os | 37 | .Os |
37 | .Sh NAME | 38 | .Sh NAME |
38 | .Nm strxfrm | 39 | .Nm strxfrm , |
40 | .Nm strxfrm_l | ||
39 | .Nd transform a string under locale | 41 | .Nd transform a string under locale |
40 | .Sh SYNOPSIS | 42 | .Sh SYNOPSIS |
41 | .In string.h | 43 | .In string.h |
42 | .Ft size_t | 44 | .Ft size_t |
43 | .Fn strxfrm "char *dst" "const char *src" "size_t n" | 45 | .Fn strxfrm "char *dst" "const char *src" "size_t n" |
46 | .Ft size_t | ||
47 | .Fn strxfrm_l "char *dst" "const char *src" "size_t n" "locale_t locale" | ||
44 | .Sh DESCRIPTION | 48 | .Sh DESCRIPTION |
45 | The idea of | 49 | The idea of |
46 | .Fn strxfrm | 50 | .Fn strxfrm |
51 | and | ||
52 | .Fn strxfrm_l | ||
47 | is to | 53 | is to |
48 | .Dq un-localize | 54 | .Dq un-localize |
49 | a string: the function transforms | 55 | a string: the functions transform |
50 | .Ar src , | 56 | .Ar src , |
51 | storing the result in | 57 | storing the result in |
52 | .Ar dst , | 58 | .Ar dst , |
@@ -55,25 +61,42 @@ such that | |||
55 | on transformed strings returns what | 61 | on transformed strings returns what |
56 | .Xr strcoll 3 | 62 | .Xr strcoll 3 |
57 | on the original untransformed strings would return. | 63 | on the original untransformed strings would return. |
64 | .Pp | ||
65 | On | ||
66 | .Ox , | ||
67 | both have the same effect as | ||
68 | .Xr strlcpy 3 , | ||
69 | and the global locale, the thread-specific locale, and the | ||
70 | .Fa locale | ||
71 | argument are ignored. | ||
72 | .Sh ENVIRONMENT | ||
73 | On other operating systems, the behaviour of | ||
74 | .Fn strxfrm | ||
75 | may depend on the | ||
76 | .Dv LC_CTYPE | ||
77 | .Xr locale 1 . | ||
58 | .Sh SEE ALSO | 78 | .Sh SEE ALSO |
59 | .Xr bcmp 3 , | 79 | .Xr newlocale 3 , |
60 | .Xr memcmp 3 , | ||
61 | .Xr setlocale 3 , | 80 | .Xr setlocale 3 , |
62 | .Xr strcasecmp 3 , | ||
63 | .Xr strcmp 3 , | 81 | .Xr strcmp 3 , |
64 | .Xr strcoll 3 | 82 | .Xr strcoll 3 , |
83 | .Xr strlcpy 3 , | ||
84 | .Xr wcsxfrm 3 | ||
65 | .Sh STANDARDS | 85 | .Sh STANDARDS |
66 | The | 86 | The |
67 | .Fn strxfrm | 87 | .Fn strxfrm |
68 | function conforms to | 88 | function conforms to |
69 | .St -ansiC . | 89 | .St -ansiC , |
90 | and | ||
91 | .Fn strxfrm_l | ||
92 | to | ||
93 | .St -p1003.1-2008 . | ||
70 | .Sh HISTORY | 94 | .Sh HISTORY |
71 | The | 95 | The |
72 | .Fn strxfrm | 96 | .Fn strxfrm |
73 | function first appeared in | 97 | function has been available since |
74 | .Bx 4.3 Reno . | 98 | .Bx 4.3 Reno , |
75 | .Sh BUGS | 99 | and |
76 | Since locales are not fully implemented on | 100 | .Fn strxfrm_l |
77 | .Ox , | 101 | since |
78 | .Fn strxfrm | 102 | .Ox 6.2 . |
79 | just returns a copy of the original string. | ||