OSDN Git Service

(split) DP: release pages (catch up to 3.50).
[linuxjm/LDP_man-pages.git] / release / man3 / stpcpy.3
1 .\" Copyright 1995 James R. Van Zandt <jrv@vanzandt.mv.com>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\"*******************************************************************
26 .\"
27 .\" This file was generated with po4a. Translate the source file.
28 .\"
29 .\"*******************************************************************
30 .TH STPCPY 3 2012\-03\-15 GNU "Linux Programmer's Manual"
31 .SH 名前
32 stpcpy \- 文字列をコピーし、コピーした文字列の終りへのポインタを返す
33 .SH 書式
34 .nf
35 \fB#include <string.h>\fP
36 .sp
37 \fBchar *stpcpy(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB);\fP
38 .fi
39 .sp
40 .in -4n
41 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
42 .in
43 .sp
44 \fBstpcpy\fP():
45 .PD 0
46 .ad l
47 .RS 4
48 .TP  4
49 glibc 2.10 以降:
50 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
51 .TP 
52 glibc 2.10 より前:
53 _GNU_SOURCE
54 .RE
55 .ad
56 .PD
57 .SH 説明
58 \fBstpcpy\fP()  関数は、\fIsrc\fP で指された文字列を (文字列を終端する NULL バイト (\(aq\e0\(aq) を含めて)
59 \fIdest\fP で指された配列にコピーする。 文字列は重複してはならず、コピー先の文字列 \fIdest\fP はコピーを受け取る
60 のに十分大きくなくてはならない。
61 .SH 返り値
62 \fBstpcpy\fP()  は、文字列 \fIdest\fP の始まりではなく \fB終り\fPを指すポインタ (すなわち、文字列を終端する NULL バイト)
63 を返す。
64 .SH 準拠
65 この関数は POSIX.1\-2008 に追加された。 それ以前は、この関数は C や POSIX.1 標準の一部でも UNIX
66 システムの慣習的なものでもなかったが、 GNU の発明というわけでもなかった。 ひょっとしたら MS\-DOS 由来のものかもしれない。 この関数は
67 BSD 系にも存在する。
68 .SH バグ
69 この関数はバッファ \fIdest\fP の範囲を行き過ぎてしまう可能性がある。
70 .SH 例
71 例として、このプログラムは \fBfoo\fP と \fBbar\fP を連結して \fBfoobar\fP を作るために \fBstpcpy\fP()
72 を使用し、その後表示する。
73 .in +4n
74 .nf
75
76 #define _GNU_SOURCE
77 #include <string.h>
78 #include <stdio.h>
79
80 int
81 main(void)
82 {
83     char buffer[20];
84     char *to = buffer;
85
86     to = stpcpy(to, "foo");
87     to = stpcpy(to, "bar");
88     printf("%s\en", buffer);
89 }
90 .fi
91 .in
92 .SH 関連項目
93 \fBbcopy\fP(3), \fBmemccpy\fP(3), \fBmemcpy\fP(3), \fBmemmove\fP(3), \fBstpncpy\fP(3),
94 \fBstrcpy\fP(3), \fBstring\fP(3), \fBwcpcpy\fP(3)
95 .SH この文書について
96 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
97 である。プロジェクトの説明とバグ報告に関する情報は
98 http://www.kernel.org/doc/man\-pages/ に書かれている。