]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/wcpncpy.3
539978414cb94fa7088c64b8a07e68a6deddc9fe
[thirdparty/man-pages.git] / man3 / wcpncpy.3
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" SPDX-License-Identifier: GPL-2.0-or-later
4 .\"
5 .\" References consulted:
6 .\" GNU glibc-2 source code and manual
7 .\" Dinkumware C library reference http://www.dinkumware.com/
8 .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
9 .\"
10 .TH WCPNCPY 3 2022-09-09 "Linux man-pages (unreleased)"
11 .SH NAME
12 wcpncpy \- copy a fixed-size string of wide characters,
13 returning a pointer to its end
14 .SH LIBRARY
15 Standard C library
16 .RI ( libc ", " \-lc )
17 .SH SYNOPSIS
18 .nf
19 .B #include <wchar.h>
20 .PP
21 .BI "wchar_t *wcpncpy(wchar_t *restrict " dest \
22 ", const wchar_t *restrict " src ,
23 .BI " 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 .I wcslen(src)
60 is smaller than
61 .IR n ,
62 the remaining wide characters in the array pointed to
63 by
64 .I dest
65 are filled with L\(aq\e0\(aq characters.
66 If the length
67 .I wcslen(src)
68 is greater than or equal
69 to
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
97 T{
98 .BR wcpncpy ()
99 T} Thread safety MT-Safe
100 .TE
101 .hy
102 .ad
103 .sp 1
104 .SH STANDARDS
105 POSIX.1-2008.
106 .SH SEE ALSO
107 .BR stpncpy (3),
108 .BR wcsncpy (3)