OSDN Git Service

0c4dc48007940c3e579bbc8027e261dfc7321542
[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 .\"
31 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
32 .\"     all rights reserved.
33 .\" Translated Fri Dec 26 13:14:47 JST 1997
34 .\"     by HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
35 .\"
36 .TH STPCPY 3 2014\-01\-13 GNU "Linux Programmer's Manual"
37 .SH 名前
38 stpcpy \- 文字列をコピーし、コピーした文字列の終りへのポインタを返す
39 .SH 書式
40 .nf
41 \fB#include <string.h>\fP
42 .sp
43 \fBchar *stpcpy(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB);\fP
44 .fi
45 .sp
46 .in -4n
47 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
48 .in
49 .sp
50 \fBstpcpy\fP():
51 .PD 0
52 .ad l
53 .RS 4
54 .TP  4
55 glibc 2.10 以降:
56 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
57 .TP 
58 glibc 2.10 より前:
59 _GNU_SOURCE
60 .RE
61 .ad
62 .PD
63 .SH 説明
64 \fBstpcpy\fP()  関数は、\fIsrc\fP で指された文字列を (文字列を終端するヌルバイト (\(aq\e0\(aq) を含めて) \fIdest\fP
65 で指された配列にコピーする。 文字列は重複してはならず、コピー先の文字列 \fIdest\fP はコピーを受け取る のに十分大きくなくてはならない。
66 .SH 返り値
67 \fBstpcpy\fP()  は、文字列 \fIdest\fP の始まりではなく \fB終り\fPを指すポインタ (すなわち、文字列を終端するヌルバイト) を返す。
68 .SH 属性
69 .SS "マルチスレッディング (pthreads(7) 参照)"
70 \fBstpcpy\fP() 関数はスレッドセーフである。
71 .SH 準拠
72 この関数は POSIX.1\-2008 に追加された。 それ以前は、この関数は C や POSIX.1 標準の一部でも UNIX
73 システムの慣習的なものでもなかったが、 GNU の発明というわけでもなかった。 ひょっとしたら MS\-DOS 由来のものかもしれない。 この関数は
74 BSD 系にも存在する。
75 .SH バグ
76 この関数はバッファ \fIdest\fP の範囲を行き過ぎてしまう可能性がある。
77 .SH 例
78 例として、このプログラムは \fBfoo\fP と \fBbar\fP を連結して \fBfoobar\fP を作るために \fBstpcpy\fP()
79 を使用し、その後表示する。
80 .nf
81
82 #define _GNU_SOURCE
83 #include <string.h>
84 #include <stdio.h>
85
86 int
87 main(void)
88 {
89     char buffer[20];
90     char *to = buffer;
91
92     to = stpcpy(to, "foo");
93     to = stpcpy(to, "bar");
94     printf("%s\en", buffer);
95 }
96 .fi
97 .SH 関連項目
98 \fBbcopy\fP(3), \fBmemccpy\fP(3), \fBmemcpy\fP(3), \fBmemmove\fP(3), \fBstpncpy\fP(3),
99 \fBstrcpy\fP(3), \fBstring\fP(3), \fBwcpcpy\fP(3)
100 .SH この文書について
101 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.65 の一部
102 である。プロジェクトの説明とバグ報告に関する情報は
103 http://www.kernel.org/doc/man\-pages/ に書かれている。