OSDN Git Service

(split) LDP v3.30, v3.31 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man3 / mempcpy.3
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
3 .\" Heavily based on glibc infopages, copyright Free Software Foundation
4 .\"
5 .\" aeb, 2003, polished a little
6 .\"
7 .\" Japanese Version Copyright (c) 2004 Yuichi SATO
8 .\"         all rights reserved.
9 .\" Translated Sat Aug 28 07:40:33 JST 2004
10 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
11 .\"
12 .TH MEMPCPY 3 2008-08-11 "GNU" "Linux Programmer's Manual"
13 .\"O .SH NAME
14 .SH Ì¾Á°
15 .\"O mempcpy, wmempcpy  \- copy memory area
16 mempcpy, wmempcpy  \- ¥á¥â¥êÎΰè¤ò¥³¥Ô¡¼¤¹¤ë
17 .\"O .SH SYNOPSIS
18 .SH ½ñ¼°
19 .nf
20 .\"O .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
21 .BR "#define _GNU_SOURCE" "         /* feature_test_macros(7) »²¾È */"
22 .br
23 .B #include <string.h>
24 .sp
25 .BI "void *mempcpy(void *" dest ", const void *" src ", size_t " n );
26 .sp
27 .\"O .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
28 .BR "#define _GNU_SOURCE" "         /* feature_test_macros(7) »²¾È */"
29 .br
30 .B #include <wchar.h>
31 .sp
32 .BI "wchar_t *wmempcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n );
33 .fi
34 .\"O .SH DESCRIPTION
35 .SH ÀâÌÀ
36 .\"O The
37 .\"O .BR mempcpy ()
38 .\"O function is nearly identical to the
39 .\"O .BR memcpy (3)
40 .\"O function.
41 .BR mempcpy ()
42 ´Ø¿ô¤Ï
43 .BR memcpy (3)
44 ´Ø¿ô¤È¤Û¤ÜƱ°ì¤Ç¤¢¤ë¡£
45 .\"O It copies
46 .\"O .I n
47 .\"O bytes from the object beginning at
48 .\"O .I src
49 .\"O into the object pointed to by
50 .\"O .IR dest .
51 ¤³¤Î´Ø¿ô¤Ï¡¢
52 .I src
53 ¤Ç»Ï¤Þ¤ë¥ª¥Ö¥¸¥§¥¯¥È¤«¤é
54 .I n
55 ¥Ð¥¤¥È¤ò¡¢
56 .I dest
57 ¤Ç»Ø¤µ¤ì¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥³¥Ô¡¼¤¹¤ë¡£
58 .\"O But instead of returning the value of
59 .\"O .I dest
60 .\"O it returns a pointer to the byte following the last written byte.
61 ¤¿¤À¤·
62 .I dest
63 ¤ÎÃͤòÊÖ¤¹¤Î¤Ç¤Ï¤Ê¤¯¡¢
64 ºÇ¸å¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¤Î¸å¤Ë³¤¯¥Ð¥¤¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
65 .PP
66 .\"O This function is useful in situations where a number of objects
67 .\"O shall be copied to consecutive memory positions.
68 ¤³¤Î´Ø¿ô¤Ï¤¤¤¯¤Ä¤«¤Î¥ª¥Ö¥¸¥§¥¯¥È¤¬
69 Ϣ³Ū¤Ê¥á¥â¥ê¤Î¾ì½ê¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¤è¤¦¤Ê¾õ¶·¤ÇÌò¤ËΩ¤Ä¡£
70 .PP
71 .\"O The
72 .\"O .BR wmempcpy ()
73 .\"O function is identical but takes
74 .\"O .I wchar_t
75 .\"O type arguments and copies
76 .\"O .I n
77 .\"O wide characters.
78 .BR wmempcpy ()
79 ´Ø¿ô¤Ï¤³¤Î´Ø¿ô¤ÈƱ¤¸¤Ç¤¢¤ë¤¬¡¢
80 .I wchar_t
81 ·¿¤Î°ú¤­¿ô¤ò¤È¤ê¡¢
82 .I n
83 ¥ï¥¤¥Éʸ»úÎó¤ò¥³¥Ô¡¼¤¹¤ë¡£
84 .\"O .SH "RETURN VALUE"
85 .SH ÊÖ¤êÃÍ
86 \fIdest\fP + \fIn\fP.
87 .\"O .SH VERSIONS
88 .SH ¥Ð¡¼¥¸¥ç¥ó
89 .\"O .BR mempcpy ()
90 .\"O first appeared in glibc in version 2.1.
91 .BR mempcpy ()
92 ¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
93 .\"O .SH "CONFORMING TO"
94 .SH ½àµò
95 .\"O This function is a GNU extension.
96 ¤³¤Î´Ø¿ô¤Ï GNU ¤Ë¤ª¤±¤ë³ÈÄ¥¤Ç¤¢¤ë¡£
97 .\"O .SH "EXAMPLE"
98 .SH Îã
99 .nf
100 void *
101 combine (void *o1, size_t s1, void *o2, size_t s2)
102 {
103     void *result = malloc(s1 + s2);
104     if (result != NULL)
105         mempcpy(mempcpy(result, o1, s1), o2, s2);
106     return result;
107
108 .fi
109 .\"O .SH "SEE ALSO"
110 .SH ´ØÏ¢¹àÌÜ
111 .BR memccpy (3),
112 .BR memcpy (3),
113 .BR memmove (3),
114 .BR wmemcpy (3)