OSDN Git Service

(split) LDP: Update original to LDP v3.65
[linuxjm/LDP_man-pages.git] / original / man3 / wcpncpy.3
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 2013-12-16 "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 .sp
23 .BI "wchar_t *wcpncpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n );
24 .fi
25 .sp
26 .in -4n
27 Feature Test Macro Requirements for glibc (see
28 .BR feature_test_macros (7)):
29 .in
30 .sp
31 .BR wcpncpy ():
32 .PD 0
33 .ad l
34 .RS 4
35 .TP 4
36 Since glibc 2.10:
37 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
38 .TP
39 Before glibc 2.10:
40 _GNU_SOURCE
41 .RE
42 .ad
43 .PD
44 .SH DESCRIPTION
45 The
46 .BR wcpncpy ()
47 function is the wide-character equivalent
48 of the
49 .BR stpncpy (3)
50 function.
51 It copies at most
52 .I n
53 wide characters from the wide-character
54 string pointed to by
55 .IR src ,
56 including the terminating null wide (L\(aq\\0\(aq),
57 to the array pointed to by
58 .IR dest .
59 Exactly
60 .I n
61 wide characters are
62 written at
63 .IR dest .
64 If the length
65 .IR wcslen(src)
66 is smaller than
67 .IR n ,
68 the remaining wide characters in the array pointed to
69 by
70 .I dest
71 are filled with L\(aq\\0\(aq characters.
72 If the length
73 .IR wcslen(src)
74 is greater than or equal
75 to
76 .IR n ,
77 the string pointed to by
78 .I dest
79 will
80 not be L\(aq\\0\(aq terminated.
81 .PP
82 The strings may not overlap.
83 .PP
84 The programmer must ensure that there is room for at least
85 .I n
86 wide
87 characters at
88 .IR dest .
89 .SH RETURN VALUE
90 .BR wcpncpy ()
91 returns a pointer to the last wide character written, that is,
92 .IR dest + n \-1.
93 .SH ATTRIBUTES
94 .SS Multithreading (see pthreads(7))
95 The
96 .BR wcpncpy ()
97 function is thread-safe.
98 .SH CONFORMING TO
99 POSIX.1-2008.
100 .SH SEE ALSO
101 .BR stpncpy (3),
102 .BR wcsncpy (3)
103 .SH COLOPHON
104 This page is part of release 3.65 of the Linux
105 .I man-pages
106 project.
107 A description of the project,
108 and information about reporting bugs,
109 can be found at
110 \%http://www.kernel.org/doc/man\-pages/.