Blame man3/wcpncpy.3

Packit 7cfc04
.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
Packit 7cfc04
.\"
Packit 7cfc04
.\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
Packit 7cfc04
.\" This is free documentation; you can redistribute it and/or
Packit 7cfc04
.\" modify it under the terms of the GNU General Public License as
Packit 7cfc04
.\" published by the Free Software Foundation; either version 2 of
Packit 7cfc04
.\" the License, or (at your option) any later version.
Packit 7cfc04
.\" %%%LICENSE_END
Packit 7cfc04
.\"
Packit 7cfc04
.\" References consulted:
Packit 7cfc04
.\"   GNU glibc-2 source code and manual
Packit 7cfc04
.\"   Dinkumware C library reference http://www.dinkumware.com/
Packit 7cfc04
.\"   OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
Packit 7cfc04
.\"
Packit 7cfc04
.TH WCPNCPY 3 2016-03-15 "GNU" "Linux Programmer's Manual"
Packit 7cfc04
.SH NAME
Packit 7cfc04
wcpncpy \- copy a fixed-size string of wide characters,
Packit 7cfc04
returning a pointer to its end
Packit 7cfc04
.SH SYNOPSIS
Packit 7cfc04
.nf
Packit 7cfc04
.B #include <wchar.h>
Packit 7cfc04
.PP
Packit 7cfc04
.BI "wchar_t *wcpncpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n );
Packit 7cfc04
.fi
Packit 7cfc04
.PP
Packit 7cfc04
.in -4n
Packit 7cfc04
Feature Test Macro Requirements for glibc (see
Packit 7cfc04
.BR feature_test_macros (7)):
Packit 7cfc04
.in
Packit 7cfc04
.PP
Packit 7cfc04
.BR wcpncpy ():
Packit 7cfc04
.PD 0
Packit 7cfc04
.ad l
Packit 7cfc04
.RS 4
Packit 7cfc04
.TP 4
Packit 7cfc04
Since glibc 2.10:
Packit 7cfc04
_POSIX_C_SOURCE\ >=\ 200809L
Packit 7cfc04
.TP
Packit 7cfc04
Before glibc 2.10:
Packit 7cfc04
_GNU_SOURCE
Packit 7cfc04
.RE
Packit 7cfc04
.ad
Packit 7cfc04
.PD
Packit 7cfc04
.SH DESCRIPTION
Packit 7cfc04
The
Packit 7cfc04
.BR wcpncpy ()
Packit 7cfc04
function is the wide-character equivalent
Packit 7cfc04
of the
Packit 7cfc04
.BR stpncpy (3)
Packit 7cfc04
function.
Packit 7cfc04
It copies at most
Packit 7cfc04
.I n
Packit 7cfc04
wide characters from the wide-character
Packit 7cfc04
string pointed to by
Packit 7cfc04
.IR src ,
Packit 7cfc04
including the terminating null wide (L\(aq\\0\(aq),
Packit 7cfc04
to the array pointed to by
Packit 7cfc04
.IR dest .
Packit 7cfc04
Exactly
Packit 7cfc04
.I n
Packit 7cfc04
wide characters are
Packit 7cfc04
written at
Packit 7cfc04
.IR dest .
Packit 7cfc04
If the length
Packit 7cfc04
.IR wcslen(src)
Packit 7cfc04
is smaller than
Packit 7cfc04
.IR n ,
Packit 7cfc04
the remaining wide characters in the array pointed to
Packit 7cfc04
by
Packit 7cfc04
.I dest
Packit 7cfc04
are filled with L\(aq\\0\(aq characters.
Packit 7cfc04
If the length
Packit 7cfc04
.IR wcslen(src)
Packit 7cfc04
is greater than or equal
Packit 7cfc04
to
Packit 7cfc04
.IR n ,
Packit 7cfc04
the string pointed to by
Packit 7cfc04
.I dest
Packit 7cfc04
will
Packit 7cfc04
not be L\(aq\\0\(aq terminated.
Packit 7cfc04
.PP
Packit 7cfc04
The strings may not overlap.
Packit 7cfc04
.PP
Packit 7cfc04
The programmer must ensure that there is room for at least
Packit 7cfc04
.I n
Packit 7cfc04
wide
Packit 7cfc04
characters at
Packit 7cfc04
.IR dest .
Packit 7cfc04
.SH RETURN VALUE
Packit 7cfc04
.BR wcpncpy ()
Packit 7cfc04
returns a pointer to the last wide character written, that is,
Packit 7cfc04
.IR dest + n \-1.
Packit 7cfc04
.SH ATTRIBUTES
Packit 7cfc04
For an explanation of the terms used in this section, see
Packit 7cfc04
.BR attributes (7).
Packit 7cfc04
.TS
Packit 7cfc04
allbox;
Packit 7cfc04
lb lb lb
Packit 7cfc04
l l l.
Packit 7cfc04
Interface	Attribute	Value
Packit 7cfc04
T{
Packit 7cfc04
.BR wcpncpy ()
Packit 7cfc04
T}	Thread safety	MT-Safe
Packit 7cfc04
.TE
Packit 7cfc04
.SH CONFORMING TO
Packit 7cfc04
POSIX.1-2008.
Packit 7cfc04
.SH SEE ALSO
Packit 7cfc04
.BR stpncpy (3),
Packit 7cfc04
.BR wcsncpy (3)
Packit 7cfc04
.SH COLOPHON
Packit 7cfc04
This page is part of release 4.15 of the Linux
Packit 7cfc04
.I man-pages
Packit 7cfc04
project.
Packit 7cfc04
A description of the project,
Packit 7cfc04
information about reporting bugs,
Packit 7cfc04
and the latest version of this page,
Packit 7cfc04
can be found at
Packit 7cfc04
\%https://www.kernel.org/doc/man\-pages/.