OSDN Git Service

(split) Apply minor changes from v3.32 to v3.35 in the upstream.
[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  2011-09-28 "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 null byte (\(aq\\0\(aq),
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 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.
69 .BR stpncpy ()
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 ¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
76 .PP
77 .\"O The strings may not overlap.
78 Æó¤Ä¤Îʸ»úÎó¤Ï½Å¤Ê¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
79 .PP
80 .\"O The programmer must ensure that there is room for at least \fIn\fP characters
81 .\"O at \fIdest\fP.
82 ¥×¥í¥°¥é¥Þ¡¼¤Ï \fIdest\fP ¤Ë¾¯¤Ê¤¯¤È¤â \fIn\fP ¥Ð¥¤¥È¤Î¶õ¤­¤¬¤¢¤ë¤³¤È¤ò
83 Êݾڤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
84 .\"O .SH "RETURN VALUE"
85 .SH ÊÖ¤êÃÍ
86 .\"O .BR stpncpy ()
87 .\"O returns a pointer to the terminating null byte
88 .\"O in \fIdest\fP, or, if \fIdest\fP is not null-terminated,
89 .\"O \fIdest + n\fP.
90 .BR stpncpy ()
91 ¤Ï \fIdest\fP ¤Î½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¡¼¤òÊÖ¤¹¤«¡¢
92 \fIdest\fP ¤¬ NULL ¥Ð¥¤¥È¤Ç½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï \fIdest + n\fP ¤òÊÖ¤¹¡£
93 .\"O .SH "CONFORMING TO"
94 .SH ½àµò
95 .\"O This function was added to POSIX.1-2008. Before that, it was a GNU extension.
96 ¤³¤Î´Ø¿ô¤Ï POSIX.1-2008 ¤ËÄɲ䵤줿¡£
97 ¤½¤ì°ÊÁ°¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤Ã¤¿¡£
98 .\"O .SH "SEE ALSO"
99 .SH ´ØÏ¢¹àÌÜ
100 .BR strncpy (3),
101 .BR wcpncpy (3)