]>
Commit | Line | Data |
---|---|---|
a1eaacb1 | 1 | '\" t |
fea681da MK |
2 | .\" Copyright (c) Bruno Haible <haible@clisp.cons.org> |
3 | .\" | |
e4a74ca8 | 4 | .\" SPDX-License-Identifier: GPL-2.0-or-later |
fea681da MK |
5 | .\" |
6 | .\" References consulted: | |
7 | .\" GNU glibc-2 source code and manual | |
8 | .\" Dinkumware C library reference http://www.dinkumware.com/ | |
008f1ecc | 9 | .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html |
fea681da | 10 | .\" |
4c1c5274 | 11 | .TH wcpncpy 3 (date) "Linux man-pages (unreleased)" |
fea681da | 12 | .SH NAME |
c13182ef | 13 | wcpncpy \- copy a fixed-size string of wide characters, |
35478399 | 14 | returning a pointer to its end |
3484f4a1 AC |
15 | .SH LIBRARY |
16 | Standard C library | |
8fc3b2cf | 17 | .RI ( libc ", " \-lc ) |
fea681da MK |
18 | .SH SYNOPSIS |
19 | .nf | |
fea681da | 20 | .B #include <wchar.h> |
68e4db0a | 21 | .PP |
1eed67e7 AC |
22 | .BI "wchar_t *wcpncpy(wchar_t " dest "[restrict ." n ], |
23 | .BI " const wchar_t " src "[restrict ." n ], | |
a216fe2a | 24 | .BI " size_t " n ); |
fea681da | 25 | .fi |
68e4db0a | 26 | .PP |
d39ad78f | 27 | .RS -4 |
d834047b MK |
28 | Feature Test Macro Requirements for glibc (see |
29 | .BR feature_test_macros (7)): | |
d39ad78f | 30 | .RE |
68e4db0a | 31 | .PP |
d834047b | 32 | .BR wcpncpy (): |
9d2adbae MK |
33 | .nf |
34 | Since glibc 2.10: | |
5c10d2c5 | 35 | _POSIX_C_SOURCE >= 200809L |
9d2adbae MK |
36 | Before glibc 2.10: |
37 | _GNU_SOURCE | |
38 | .fi | |
fea681da | 39 | .SH DESCRIPTION |
60a90ecd MK |
40 | The |
41 | .BR wcpncpy () | |
42 | function is the wide-character equivalent | |
43 | of the | |
44 | .BR stpncpy (3) | |
45 | function. | |
e4a0d6cb MK |
46 | It copies at most |
47 | .I n | |
48 | wide characters from the wide-character | |
49 | string pointed to by | |
50 | .IR src , | |
b957f81f | 51 | including the terminating null wide (L\[aq]\e0\[aq]), |
e4a0d6cb MK |
52 | to the array pointed to by |
53 | .IR dest . | |
54 | Exactly | |
55 | .I n | |
56 | wide characters are | |
57 | written at | |
58 | .IR dest . | |
59 | If the length | |
1ae6b2c7 | 60 | .I wcslen(src) |
e4a0d6cb MK |
61 | is smaller than |
62 | .IR n , | |
c13182ef | 63 | the remaining wide characters in the array pointed to |
e4a0d6cb MK |
64 | by |
65 | .I dest | |
b957f81f | 66 | are filled with L\[aq]\e0\[aq] characters. |
e4a0d6cb | 67 | If the length |
1ae6b2c7 | 68 | .I wcslen(src) |
ca5d006f | 69 | is greater than or equal |
e4a0d6cb MK |
70 | to |
71 | .IR n , | |
72 | the string pointed to by | |
73 | .I dest | |
74 | will | |
b957f81f | 75 | not be L\[aq]\e0\[aq] terminated. |
fea681da MK |
76 | .PP |
77 | The strings may not overlap. | |
78 | .PP | |
e4a0d6cb MK |
79 | The programmer must ensure that there is room for at least |
80 | .I n | |
81 | wide | |
82 | characters at | |
83 | .IR dest . | |
47297adb | 84 | .SH RETURN VALUE |
60a90ecd | 85 | .BR wcpncpy () |
75b94dc3 | 86 | returns a pointer to the last wide character written, that is, |
be88a268 | 87 | .IR dest + n \-1. |
31c861cf | 88 | .SH ATTRIBUTES |
fbdd176b PH |
89 | For an explanation of the terms used in this section, see |
90 | .BR attributes (7). | |
91 | .TS | |
92 | allbox; | |
c466875e | 93 | lbx lb lb |
fbdd176b PH |
94 | l l l. |
95 | Interface Attribute Value | |
96 | T{ | |
9e54434e BR |
97 | .na |
98 | .nh | |
31c861cf | 99 | .BR wcpncpy () |
fbdd176b PH |
100 | T} Thread safety MT-Safe |
101 | .TE | |
c466875e | 102 | .sp 1 |
3113c7f3 | 103 | .SH STANDARDS |
d9a8bda4 | 104 | POSIX.1-2008. |
47297adb | 105 | .SH SEE ALSO |
fea681da | 106 | .BR stpncpy (3), |
0a4f8b7b | 107 | .BR wcsncpy (3) |