OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / stpcpy.3
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright 1995 James R. Van Zandt <jrv@vanzandt.mv.com>
4 .\"
5 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
6 .\"     all rights reserved.
7 .\" Translated Fri Dec 26 13:14:47 JST 1997
8 .\"     by HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
9 .\"
10 .\" Permission is granted to make and distribute verbatim copies of this
11 .\" manual provided the copyright notice and this permission notice are
12 .\" preserved on all copies.
13 .\"
14 .\" Permission is granted to copy and distribute modified versions of this
15 .\" manual under the conditions for verbatim copying, provided that the
16 .\" entire resulting derived work is distributed under the terms of a
17 .\" permission notice identical to this one.
18 .\"
19 .\" Since the Linux kernel and libraries are constantly changing, this
20 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
21 .\" responsibility for errors or omissions, or for damages resulting from
22 .\" the use of the information contained herein.  The author(s) may not
23 .\" have taken the same level of care in the production of this manual,
24 .\" which is licensed free of charge, as they might when working
25 .\" professionally.
26 .\"
27 .\" Formatted or processed versions of this manual, if unaccompanied by
28 .\" the source, must acknowledge the copyright and authors of this work.
29 .\"
30 .TH STPCPY 3  2009-02-04 "GNU" "Linux Programmer's Manual"
31 .\"O .SH NAME
32 .SH Ì¾Á°
33 .\"O stpcpy \- copy a string returning a pointer to its end
34 stpcpy \- Ê¸»úÎó¤ò¥³¥Ô¡¼¤·¡¢¥³¥Ô¡¼¤·¤¿Ê¸»úÎó¤Î½ª¤ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹
35 .\"O .SH SYNOPSIS
36 .SH ½ñ¼°
37 .nf
38 .B #define _GNU_SOURCE
39 .br
40 .B #include <string.h>
41 .sp
42 .BI "char *stpcpy(char *" dest ", const char *" src );
43 .fi
44 .\"O .SH DESCRIPTION
45 .SH ÀâÌÀ
46 .\"O The
47 .\"O .BR stpcpy ()
48 .\"O function copies the string pointed to by \fIsrc\fP
49 .\"O (including the terminating \(aq\\0\(aq character) to the array pointed to by
50 .\"O \fIdest\fP.
51 .\"O The strings may not overlap, and the destination string
52 .\"O \fIdest\fP must be large enough to receive the copy.
53 .BR stpcpy ()
54 ´Ø¿ô¤Ï¡¢\fIsrc\fP ¤Ç»Ø¤µ¤ì¤¿Ê¸»úÎó¤ò (ʸ»úÎó¤ò½ªÃ¼¤¹¤ë \(aq\\0\(aq
55 ¤ò´Þ¤á¤Æ) \fIdest\fP ¤Ç»Ø¤µ¤ì¤¿ÇÛÎó¤Ë¥³¥Ô¡¼¤¹¤ë¡£
56 ʸ»úÎó¤Ï½ÅÊ£¤·¤Æ¤Ï¤Ê¤é¤º¡¢¥³¥Ô¡¼Àè¤Îʸ»úÎó \fIdest\fP ¤Ï¥³¥Ô¡¼¤ò¼õ¤±¼è¤ë
57 ¤Î¤Ë½½Ê¬Â礭¤¯¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
58 .\"O .SH "RETURN VALUE"
59 .SH ÊÖ¤êÃÍ
60 .\"O .BR stpcpy ()
61 .\"O returns a pointer to the \fBend\fP of the string
62 .\"O \fIdest\fP (that is, the address of the terminating null byte)
63 .\"O rather than the beginning.
64 .BR stpcpy ()
65 ¤Ï¡¢Ê¸»úÎó \fIdest\fP ¤Î»Ï¤Þ¤ê¤Ç¤Ï¤Ê¤¯
66 \fB½ª¤ê\fP¤ò»Ø¤¹¥Ý¥¤¥ó¥¿ (¤¹¤Ê¤ï¤Á¡¢Ê¸»úÎó¤ò½ªÃ¼¤¹¤ë NULL ¥Ð¥¤¥È) ¤òÊÖ¤¹¡£
67 .\"O .SH "CONFORMING TO"
68 .SH ½àµò
69 .\"O This function is not part of the C or POSIX.1 standards, and is
70 .\"O not customary on Unix systems, but is not a GNU invention either.
71 .\"O Perhaps it comes from MS-DOS.
72 .\"O Nowadays, it is also present on the BSDs.
73 ¤³¤Î´Ø¿ô¤Ï¡¢C ¤ä POSIX.1 É¸½à¤Î°ìÉô¤Ç¤Ï¤Ê¤¯¡¢Unix ¥·¥¹¥Æ¥à¤Î´·½¬Åª¤Ê
74 ¤â¤Î¤Ç¤â¤Ê¤¤¤¬¡¢GNU ¤ÎȯÌÀ¤È¤¤¤¦¤ï¤±¤Ç¤â¤Ê¤¤¡£
75 ¤Ò¤ç¤Ã¤È¤·¤¿¤é MS-DOS Í³Íè¤Î¤â¤Î¤«¤â¤·¤ì¤Ê¤¤¡£
76 ¸½ºß¤Ç¤Ï¡¢BSD ·Ï¤Ë¤â¸ºß¤¹¤ë¡£
77 .\"O .SH EXAMPLE
78 .SH Îã
79 .\"O For example, this program uses
80 .\"O .BR stpcpy ()
81 .\"O to concatenate \fBfoo\fP and
82 .\"O \fBbar\fP to produce \fBfoobar\fP, which it then prints.
83 Îã¤È¤·¤Æ¡¢¤³¤Î¥×¥í¥°¥é¥à¤Ï \fBfoo\fP ¤È \fBbar\fP ¤òÏ¢·ë¤·¤Æ \fBfoobar\fP
84 ¤òºî¤ë¤¿¤á¤Ë
85 .BR stpcpy ()
86 ¤ò»ÈÍѤ·¡¢¤½¤Î¸åɽ¼¨¤¹¤ë¡£
87 .in +4n
88 .nf
89
90 #define _GNU_SOURCE
91 #include <string.h>
92 #include <stdio.h>
93
94 int
95 main(void)
96 {
97     char buffer[20];
98     char *to = buffer;
99
100     to = stpcpy(to, "foo");
101     to = stpcpy(to, "bar");
102     printf("%s\\n", buffer);
103 }
104 .fi
105 .in
106 .\"O .SH BUGS
107 .SH ¥Ð¥°
108 .\"O This function may overrun the buffer
109 .\"O .IR dest .
110 ¤³¤Î´Ø¿ô¤Ï¥Ð¥Ã¥Õ¥¡
111 .I dest
112 ¤ÎÈϰϤò¹Ô¤­²á¤®¤Æ¤·¤Þ¤¦²ÄǽÀ­¤¬¤¢¤ë¡£
113 .\"O .SH "SEE ALSO"
114 .SH ´ØÏ¢¹àÌÜ
115 .BR bcopy (3),
116 .BR memccpy (3),
117 .BR memcpy (3),
118 .BR memmove (3),
119 .BR strcpy (3),
120 .BR wcpcpy (3),
121 .BR feature_test_macros (7)