mbrtowc.3: SYNOPSIS: Use 'restrict' in prototypes
[man-pages.git] / man3 / wcpncpy.3
blobcbe7c418da7a89a17692ef685b8d6c3f06396dc1
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\" %%%LICENSE_END
9 .\"
10 .\" References consulted:
11 .\"   GNU glibc-2 source code and manual
12 .\"   Dinkumware C library reference http://www.dinkumware.com/
13 .\"   OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
14 .\"
15 .TH WCPNCPY 3 2019-03-06 "GNU" "Linux Programmer's Manual"
16 .SH NAME
17 wcpncpy \- copy a fixed-size string of wide characters,
18 returning a pointer to its end
19 .SH SYNOPSIS
20 .nf
21 .B #include <wchar.h>
22 .PP
23 .BI "wchar_t *wcpncpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n );
24 .fi
25 .PP
26 .RS -4
27 Feature Test Macro Requirements for glibc (see
28 .BR feature_test_macros (7)):
29 .RE
30 .PP
31 .BR wcpncpy ():
32 .nf
33     Since glibc 2.10:
34         _POSIX_C_SOURCE >= 200809L
35     Before glibc 2.10:
36         _GNU_SOURCE
37 .fi
38 .SH DESCRIPTION
39 The
40 .BR wcpncpy ()
41 function is the wide-character equivalent
42 of the
43 .BR stpncpy (3)
44 function.
45 It copies at most
46 .I n
47 wide characters from the wide-character
48 string pointed to by
49 .IR src ,
50 including the terminating null wide (L\(aq\e0\(aq),
51 to the array pointed to by
52 .IR dest .
53 Exactly
54 .I n
55 wide characters are
56 written at
57 .IR dest .
58 If the length
59 .IR wcslen(src)
60 is smaller than
61 .IR n ,
62 the remaining wide characters in the array pointed to
64 .I dest
65 are filled with L\(aq\e0\(aq characters.
66 If the length
67 .IR wcslen(src)
68 is greater than or equal
70 .IR n ,
71 the string pointed to by
72 .I dest
73 will
74 not be L\(aq\e0\(aq terminated.
75 .PP
76 The strings may not overlap.
77 .PP
78 The programmer must ensure that there is room for at least
79 .I n
80 wide
81 characters at
82 .IR dest .
83 .SH RETURN VALUE
84 .BR wcpncpy ()
85 returns a pointer to the last wide character written, that is,
86 .IR dest + n \-1.
87 .SH ATTRIBUTES
88 For an explanation of the terms used in this section, see
89 .BR attributes (7).
90 .ad l
91 .nh
92 .TS
93 allbox;
94 lbx lb lb
95 l l l.
96 Interface       Attribute       Value
98 .BR wcpncpy ()
99 T}      Thread safety   MT-Safe
103 .sp 1
104 .SH CONFORMING TO
105 POSIX.1-2008.
106 .SH SEE ALSO
107 .BR stpncpy (3),
108 .BR wcsncpy (3)