1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
8 .\" References consulted:
9 .\" GNU glibc-2 source code and manual
11 .\" Corrected, aeb, 990824
13 .\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
14 .\" all rights reserved.
15 .\" Translated Tue Jan 11 00:55:50 JST 2000
16 .\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
18 .TH STPNCPY 3 2011-09-28 "GNU" "Linux Programmer's Manual"
21 .\"O stpncpy \- copy a fixed-size string, returning a pointer to its end
22 stpncpy \- ¸ÇÄêŤÎʸ»úÎó¤ò¥³¥Ô¡¼¤·¤Æ¡¢¤½¤ÎºÇ¸å¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹
26 .B #include <string.h>
28 .BI "char *stpncpy(char *" dest ", const char *" src ", size_t " n );
32 .\"O Feature Test Macro Requirements for glibc (see
33 .\"O .BR feature_test_macros (7)):
34 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
35 .RB ( feature_test_macros (7)
44 .\"O Since glibc 2.10:
46 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
48 .\"O Before glibc 2.10:
58 .\"O function copies at most \fIn\fP characters from the string
59 .\"O pointed to by \fIsrc\fP, including the terminating null byte (\(aq\\0\(aq),
60 .\"O to the array pointed to by \fIdest\fP.
61 .\"O Exactly \fIn\fP characters are written at
63 .\"O If the length \fIstrlen(src)\fP is smaller than \fIn\fP, the
64 .\"O remaining characters in the array pointed to by \fIdest\fP are filled
65 .\"O with null bytes (\(aq\\0\(aq),
66 .\"O If the length \fIstrlen(src)\fP is greater or equal to
67 .\"O \fIn\fP, the string pointed to by \fIdest\fP will
68 .\"O not be null-terminated.
70 ´Ø¿ô¤Ï \fIsrc\fP ¤¬»Ø¤·¤Æ¤¤¤ëʸ»úÎ󤫤齪ü¤Î NULL ¥Ð¥¤¥È (\(aq\\0\(aq)
71 ¤ò´Þ¤á¤ÆºÇÂç \fIn\fP ¥Ð¥¤¥È¤ò \fIdest\fP ¤Ë¥³¥Ô¡¼¤¹¤ë¡£Ä¹¤µ
72 \fIstrlen(src)\fP ¤¬ \fIn\fP ¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ë¤Ï \fIdest\fP ¤Î»Ä¤ê¤Î
73 Éôʬ¤Ë¤Ï NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ʸ»ú¤¬Ëä¤á¤é¤ì¤ë¡£
74 Ťµ \fIstrlen(src)\fP ¤¬ \fIn\fP °Ê¾å¤Ê¤é¤Ð¡¢
75 \fIdest\fP ¤¬»Ø¤¹Ê¸»úÎó¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
77 .\"O The strings may not overlap.
78 Æó¤Ä¤Îʸ»úÎó¤Ï½Å¤Ê¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
80 .\"O The programmer must ensure that there is room for at least \fIn\fP characters
82 ¥×¥í¥°¥é¥Þ¡¼¤Ï \fIdest\fP ¤Ë¾¯¤Ê¤¯¤È¤â \fIn\fP ¥Ð¥¤¥È¤Î¶õ¤¤¬¤¢¤ë¤³¤È¤ò
83 Êݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
84 .\"O .SH "RETURN VALUE"
87 .\"O returns a pointer to the terminating null byte
88 .\"O in \fIdest\fP, or, if \fIdest\fP is not null-terminated,
91 ¤Ï \fIdest\fP ¤Î½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¤«¡¢
92 \fIdest\fP ¤¬ NULL ¥Ð¥¤¥È¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï \fIdest + n\fP ¤òÊÖ¤¹¡£
93 .\"O .SH "CONFORMING TO"
95 .\"O This function was added to POSIX.1-2008. Before that, it was a GNU extension.
96 ¤³¤Î´Ø¿ô¤Ï POSIX.1-2008 ¤ËÄɲ䵤줿¡£
97 ¤½¤ì°ÊÁ°¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤Ã¤¿¡£