1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright 1995 James R. Van Zandt <jrv@vanzandt.mv.com>
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>
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.
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.
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
27 .\" Formatted or processed versions of this manual, if unaccompanied by
28 .\" the source, must acknowledge the copyright and authors of this work.
30 .TH STPCPY 3 2009-02-04 "GNU" "Linux Programmer's Manual"
33 .\"O stpcpy \- copy a string returning a pointer to its end
34 stpcpy \- ʸ»úÎó¤ò¥³¥Ô¡¼¤·¡¢¥³¥Ô¡¼¤·¤¿Ê¸»úÎó¤Î½ª¤ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹
38 .B #define _GNU_SOURCE
40 .B #include <string.h>
42 .BI "char *stpcpy(char *" dest ", const char *" src );
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
51 .\"O The strings may not overlap, and the destination string
52 .\"O \fIdest\fP must be large enough to receive the copy.
54 ´Ø¿ô¤Ï¡¢\fIsrc\fP ¤Ç»Ø¤µ¤ì¤¿Ê¸»úÎó¤ò (ʸ»úÎó¤ò½ªÃ¼¤¹¤ë \(aq\\0\(aq
55 ¤ò´Þ¤á¤Æ) \fIdest\fP ¤Ç»Ø¤µ¤ì¤¿ÇÛÎó¤Ë¥³¥Ô¡¼¤¹¤ë¡£
56 ʸ»úÎó¤Ï½ÅÊ£¤·¤Æ¤Ï¤Ê¤é¤º¡¢¥³¥Ô¡¼Àè¤Îʸ»úÎó \fIdest\fP ¤Ï¥³¥Ô¡¼¤ò¼õ¤±¼è¤ë
57 ¤Î¤Ë½½Ê¬Â礤¯¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
58 .\"O .SH "RETURN VALUE"
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.
65 ¤Ï¡¢Ê¸»úÎó \fIdest\fP ¤Î»Ï¤Þ¤ê¤Ç¤Ï¤Ê¤¯
66 \fB½ª¤ê\fP¤ò»Ø¤¹¥Ý¥¤¥ó¥¿ (¤¹¤Ê¤ï¤Á¡¢Ê¸»úÎó¤ò½ªÃ¼¤¹¤ë NULL ¥Ð¥¤¥È) ¤òÊÖ¤¹¡£
67 .\"O .SH "CONFORMING TO"
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 ·Ï¤Ë¤â¸ºß¤¹¤ë¡£
79 .\"O For example, this program uses
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
86 ¤ò»ÈÍѤ·¡¢¤½¤Î¸åɽ¼¨¤¹¤ë¡£
100 to = stpcpy(to, "foo");
101 to = stpcpy(to, "bar");
102 printf("%s\\n", buffer);
108 .\"O This function may overrun the buffer
112 ¤ÎÈϰϤò¹Ô¤²á¤®¤Æ¤·¤Þ¤¦²ÄǽÀ¤¬¤¢¤ë¡£
121 .BR feature_test_macros (7)