]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) Bruno Haible <haible@clisp.cons.org> |
2 | .\" | |
3 | .\" This is free documentation; you can redistribute it and/or | |
4 | .\" modify it under the terms of the GNU General Public License as | |
5 | .\" published by the Free Software Foundation; either version 2 of | |
6 | .\" the License, or (at your option) any later version. | |
7 | .\" | |
8 | .\" References consulted: | |
9 | .\" GNU glibc-2 source code and manual | |
10 | .\" Dinkumware C library reference http://www.dinkumware.com/ | |
008f1ecc | 11 | .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html |
fea681da | 12 | .\" |
d834047b | 13 | .TH WCPNCPY 3 2010-09-15 "GNU" "Linux Programmer's Manual" |
fea681da | 14 | .SH NAME |
c13182ef | 15 | wcpncpy \- copy a fixed-size string of wide characters, |
35478399 | 16 | returning a pointer to its end |
fea681da MK |
17 | .SH SYNOPSIS |
18 | .nf | |
fea681da MK |
19 | .B #include <wchar.h> |
20 | .sp | |
21 | .BI "wchar_t *wcpncpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); | |
22 | .fi | |
d834047b MK |
23 | .sp |
24 | .in -4n | |
25 | Feature Test Macro Requirements for glibc (see | |
26 | .BR feature_test_macros (7)): | |
27 | .in | |
28 | .sp | |
29 | .BR wcpncpy (): | |
ea91c3fd MK |
30 | .PD 0 |
31 | .ad l | |
32 | .RS 4 | |
33 | .TP 4 | |
34 | Since glibc 2.10: | |
35 | _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L | |
36 | .TP | |
d834047b MK |
37 | Before glibc 2.10: |
38 | _GNU_SOURCE | |
ea91c3fd MK |
39 | .RE |
40 | .ad | |
41 | .PD | |
fea681da | 42 | .SH DESCRIPTION |
60a90ecd MK |
43 | The |
44 | .BR wcpncpy () | |
45 | function is the wide-character equivalent | |
46 | of the | |
47 | .BR stpncpy (3) | |
48 | function. | |
c13182ef | 49 | It copies at most \fIn\fP wide characters from the wide-character |
f81fb444 MK |
50 | string pointed to by \fIsrc\fP, |
51 | including the terminating L\(aq\\0\(aq character, | |
c13182ef MK |
52 | to the array pointed to by \fIdest\fP. |
53 | Exactly \fIn\fP wide characters are | |
54 | written at \fIdest\fP. | |
55 | If the length \fIwcslen(src)\fP is smaller than \fIn\fP, | |
56 | the remaining wide characters in the array pointed to | |
f81fb444 | 57 | by \fIdest\fP are filled with L\(aq\\0\(aq characters. |
c13182ef MK |
58 | If the length \fIwcslen(src)\fP is greater or equal |
59 | to \fIn\fP, the string pointed to by \fIdest\fP will | |
f81fb444 | 60 | not be L\(aq\\0\(aq terminated. |
fea681da MK |
61 | .PP |
62 | The strings may not overlap. | |
63 | .PP | |
64 | The programmer must ensure that there is room for at least \fIn\fP wide | |
65 | characters at \fIdest\fP. | |
66 | .SH "RETURN VALUE" | |
60a90ecd | 67 | .BR wcpncpy () |
75b94dc3 | 68 | returns a pointer to the last wide character written, that is, |
c65433e6 | 69 | \fIdest + n \- 1\fP. |
fea681da MK |
70 | .SH "CONFORMING TO" |
71 | This function is a GNU extension. | |
72 | .SH "SEE ALSO" | |
73 | .BR stpncpy (3), | |
0a4f8b7b | 74 | .BR wcsncpy (3) |