]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/wcpncpy.3
getresuid.2, intro.2, mremap.2, open.2, poll.2, posix_fadvise.2, pread.2, remap_file_...
[thirdparty/man-pages.git] / man3 / wcpncpy.3
CommitLineData
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 15wcpncpy \- copy a fixed-size string of wide characters,
35478399 16returning 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
25Feature 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
34Since glibc 2.10:
35_XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
36.TP
d834047b
MK
37Before glibc 2.10:
38_GNU_SOURCE
ea91c3fd
MK
39.RE
40.ad
41.PD
fea681da 42.SH DESCRIPTION
60a90ecd
MK
43The
44.BR wcpncpy ()
45function is the wide-character equivalent
46of the
47.BR stpncpy (3)
48function.
c13182ef 49It copies at most \fIn\fP wide characters from the wide-character
f81fb444
MK
50string pointed to by \fIsrc\fP,
51including the terminating L\(aq\\0\(aq character,
c13182ef
MK
52to the array pointed to by \fIdest\fP.
53Exactly \fIn\fP wide characters are
54written at \fIdest\fP.
55If the length \fIwcslen(src)\fP is smaller than \fIn\fP,
56the remaining wide characters in the array pointed to
f81fb444 57by \fIdest\fP are filled with L\(aq\\0\(aq characters.
c13182ef
MK
58If the length \fIwcslen(src)\fP is greater or equal
59to \fIn\fP, the string pointed to by \fIdest\fP will
f81fb444 60not be L\(aq\\0\(aq terminated.
fea681da
MK
61.PP
62The strings may not overlap.
63.PP
64The programmer must ensure that there is room for at least \fIn\fP wide
65characters at \fIdest\fP.
66.SH "RETURN VALUE"
60a90ecd 67.BR wcpncpy ()
75b94dc3 68returns a pointer to the last wide character written, that is,
c65433e6 69\fIdest + n \- 1\fP.
fea681da
MK
70.SH "CONFORMING TO"
71This function is a GNU extension.
72.SH "SEE ALSO"
73.BR stpncpy (3),
0a4f8b7b 74.BR wcsncpy (3)