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