OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man3 / stpncpy.3
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
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.
7 .\"
8 .\" References consulted:
9 .\"   GNU glibc-2 source code and manual
10 .\"
11 .\" Corrected, aeb, 990824
12 .\"
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>
17 .\"
18 .TH STPNCPY 3 2010-09-15 "GNU" "Linux Programmer's Manual"
19 .\"O .SH NAME
20 .SH Ì¾Á°
21 .\"O stpncpy \- copy a fixed-size string, returning a pointer to its end
22 stpncpy \- ¸ÇÄêŤÎʸ»úÎó¤ò¥³¥Ô¡¼¤·¤Æ¡¢¤½¤ÎºÇ¸å¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹
23 .\"O .SH SYNOPSIS
24 .SH ½ñ¼°
25 .nf
26 .B #include <string.h>
27 .sp
28 .BI "char *stpncpy(char *" dest ", const char *" src ", size_t " n );
29 .fi
30 .sp
31 .in -4n
32 .\"O Feature Test Macro Requirements for glibc (see
33 .\"O .BR feature_test_macros (7)):
34 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
35 .RB ( feature_test_macros (7)
36 »²¾È):
37 .in
38 .sp
39 .BR stpncpy ():
40 .PD 0
41 .ad l
42 .RS 4
43 .TP 4
44 .\"O Since glibc 2.10:
45 glibc 2.10 °Ê¹ß:
46 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
47 .TP
48 .\"O Before glibc 2.10:
49 glibc 2.10 ¤è¤êÁ°:
50 _GNU_SOURCE
51 .RE
52 .ad
53 .PD
54 .\"O .SH DESCRIPTION
55 .SH ÀâÌÀ
56 .\"O The
57 .\"O .BR stpncpy ()
58 .\"O function copies at most \fIn\fP characters from the string
59 .\"O pointed to by \fIsrc\fP, including the terminating \(aq\\0\(aq character,
60 .\"O to the array pointed to by \fIdest\fP.
61 .\"O Exactly \fIn\fP characters are written at
62 .\"O \fIdest\fP.
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 \(aq\\0\(aq characters.
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 \(aq\\0\(aq terminated.
69 .BR stpncpy ()
70 ´Ø¿ô¤Ï \fIsrc\fP ¤¬»Ø¤·¤Æ¤¤¤ëʸ»úÎ󤫤齪ü¤Î \(aq\\0\(aq Ê¸»ú¤ò
71 ´Þ¤á¤ÆºÇÂç \fIn\fP ¥Ð¥¤¥È¤ò \fIdest\fP ¤Ë¥³¥Ô¡¼¤¹¤ë¡£Ä¹¤µ
72 \fIstrlen(src)\fP ¤¬ \fIn\fP ¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ë¤Ï \fIdest\fP ¤Î»Ä¤ê¤Î
73 Éôʬ¤Ë¤Ï  \(aq\\0\(aq Ê¸»ú¤¬Ëä¤á¤é¤ì¤ë¡£Ä¹¤µ \fIstrlen(src)\fP ¤¬ \fIn\fP °Ê¾å
74 ¤Ê¤é¤Ð¡¢\fIdest\fP ¤¬»Ø¤¹Ê¸»úÎó¤Ï \(aq\\0\(aq ¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
75 .PP
76 .\"O The strings may not overlap.
77 Æó¤Ä¤Îʸ»úÎó¤Ï½Å¤Ê¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
78 .PP
79 .\"O The programmer must ensure that there is room for at least \fIn\fP characters
80 .\"O at \fIdest\fP.
81 ¥×¥í¥°¥é¥Þ¡¼¤Ï \fIdest\fP ¤Ë¾¯¤Ê¤¯¤È¤â \fIn\fP ¥Ð¥¤¥È¤Î¶õ¤­¤¬¤¢¤ë¤³¤È¤ò
82 Êݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
83 .\"O .SH "RETURN VALUE"
84 .SH ÊÖ¤êÃÍ
85 .\"O .BR stpncpy ()
86 .\"O returns a pointer to the terminating null
87 .\"O in \fIdest\fP, or, if \fIdest\fP is not null-terminated,
88 .\"O \fIdest + n\fP.
89 .BR stpncpy ()
90 ¤Ï \fIdest\fP ¤Î½ªÃ¼¤Î¥Ê¥ëʸ»ú¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¤«¡¢
91 \fIdest\fP ¤¬¥Ê¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï \fIdest + n\fP ¤òÊÖ¤¹¡£
92 .\"O .SH "CONFORMING TO"
93 .SH ½àµò
94 .\"O This function is a GNU extension.
95 ¤³¤Î´Ø¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£
96 .\"O .SH "SEE ALSO"
97 .SH ´ØÏ¢¹àÌÜ
98 .BR strncpy (3),
99 .BR wcpncpy (3),
100 .BR feature_test_macros (7)