1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
.\"
.\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\" %%%LICENSE_END
.\"
.\" References consulted:
.\" GNU glibc-2 source code and manual
.\"
.\" Corrected, aeb, 990824
.\"*******************************************************************
.\"
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
.\"
.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
.\" all rights reserved.
.\" Translated Tue Jan 11 00:55:50 JST 2000
.\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\"
.TH STPNCPY 3 2014\-05\-10 GNU "Linux Programmer's Manual"
.SH 名前
stpncpy \- 固定長の文字列をコピーして、その最後へのポインターを返す
.SH 書式
.nf
\fB#include <string.h>\fP
.sp
\fBchar *stpncpy(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB, size_t \fP\fIn\fP\fB);\fP
.fi
.sp
.in -4n
glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照):
.in
.sp
\fBstpncpy\fP():
.PD 0
.ad l
.RS 4
.TP 4
glibc 2.10 以降:
_XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
.TP
glibc 2.10 より前:
_GNU_SOURCE
.RE
.ad
.PD
.SH 説明
\fBstpncpy\fP() 関数は \fIsrc\fP が指している文字列から終端のヌルバイト (\(aq\e0\(aq) を含めて最大 \fIn\fP バイトを
\fIdest\fP にコピーする。長さ \fIstrlen(src)\fP が \fIn\fP より小さい場合には \fIdest\fP の残りの 部分にはヌルバイト
(\(aq\e0\(aq) 文字が埋められる。 長さ \fIstrlen(src)\fP が \fIn\fP 以上ならば、 \fIdest\fP
が指す文字列はヌルで終端されていない。
.PP
二つの文字列は重なってはならない。
.PP
プログラマーは \fIdest\fP に少なくとも \fIn\fP バイトの空きがあることを 保証しなければならない。
.SH 返り値
\fBstpncpy\fP() は \fIdest\fP の終端のヌルバイトを指すポインターを返すか、 \fIdest\fP がヌルバイトで終端されていない場合には
\fIdest\fP+\fIn\fP を返す。
.SH 属性
.SS "マルチスレッディング (pthreads(7) 参照)"
\fBstpncpy\fP() 関数はスレッドセーフである。
.SH 準拠
この関数は POSIX.1\-2008 に追加された。 それ以前は GNU による拡張であった。 この関数は 1993 年に GNU C
ライブラリのバージョン 1.07 で初めて登場した。
.SH 関連項目
\fBstrncpy\fP(3), \fBwcpncpy\fP(3)
.SH この文書について
この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
である。プロジェクトの説明とバグ報告に関する情報は
http://www.kernel.org/doc/man\-pages/ に書かれている。
|