OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[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 .B #define _GNU_SOURCE
21 .br
22 .B #include <string.h>
23 .sp
24 .BI "void *mempcpy(void *" dest ", const void *" src ", size_t " n );
25 .sp
26 .B #define _GNU_SOURCE
27 .br
28 .B #include <wchar.h>
29 .sp
30 .BI "wchar_t *wmempcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n );
31 .fi
32 .\"O .SH DESCRIPTION
33 .SH ÀâÌÀ
34 .\"O The
35 .\"O .BR mempcpy ()
36 .\"O function is nearly identical to the
37 .\"O .BR memcpy (3)
38 .\"O function.
39 .BR mempcpy ()
40 ´Ø¿ô¤Ï
41 .BR memcpy (3)
42 ´Ø¿ô¤È¤Û¤ÜƱ°ì¤Ç¤¢¤ë¡£
43 .\"O It copies
44 .\"O .I n
45 .\"O bytes from the object beginning at
46 .\"O .I src
47 .\"O into the object pointed to by
48 .\"O .IR dest .
49 ¤³¤Î´Ø¿ô¤Ï¡¢
50 .I src
51 ¤Ç»Ï¤Þ¤ë¥ª¥Ö¥¸¥§¥¯¥È¤«¤é
52 .I n
53 ¥Ð¥¤¥È¤ò¡¢
54 .I dest
55 ¤Ç»Ø¤µ¤ì¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥³¥Ô¡¼¤¹¤ë¡£
56 .\"O But instead of returning the value of
57 .\"O .I dest
58 .\"O it returns a pointer to the byte following the last written byte.
59 ¤¿¤À¤·
60 .I dest
61 ¤ÎÃͤòÊÖ¤¹¤Î¤Ç¤Ï¤Ê¤¯¡¢
62 ºÇ¸å¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¤Î¸å¤Ë³¤¯¥Ð¥¤¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
63 .PP
64 .\"O This function is useful in situations where a number of objects
65 .\"O shall be copied to consecutive memory positions.
66 ¤³¤Î´Ø¿ô¤Ï¤¤¤¯¤Ä¤«¤Î¥ª¥Ö¥¸¥§¥¯¥È¤¬
67 Ϣ³Ū¤Ê¥á¥â¥ê¤Î¾ì½ê¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¤è¤¦¤Ê¾õ¶·¤ÇÌò¤ËΩ¤Ä¡£
68 .PP
69 .\"O The
70 .\"O .BR wmempcpy ()
71 .\"O function is identical but takes
72 .\"O .I wchar_t
73 .\"O type arguments and copies
74 .\"O .I n
75 .\"O wide characters.
76 .BR wmempcpy ()
77 ´Ø¿ô¤Ï¤³¤Î´Ø¿ô¤ÈƱ¤¸¤Ç¤¢¤ë¤¬¡¢
78 .I wchar_t
79 ·¿¤Î°ú¤­¿ô¤ò¤È¤ê¡¢
80 .I n
81 ¥ï¥¤¥Éʸ»úÎó¤ò¥³¥Ô¡¼¤¹¤ë¡£
82 .\"O .SH "RETURN VALUE"
83 .SH ÊÖ¤êÃÍ
84 \fIdest\fP + \fIn\fP.
85 .\"O .SH VERSIONS
86 .SH ¥Ð¡¼¥¸¥ç¥ó
87 .\"O .BR mempcpy ()
88 .\"O first appeared in glibc in version 2.1.
89 .BR mempcpy ()
90 ¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
91 .\"O .SH "CONFORMING TO"
92 .SH ½àµò
93 .\"O This function is a GNU extension.
94 ¤³¤Î´Ø¿ô¤Ï GNU ¤Ë¤ª¤±¤ë³ÈÄ¥¤Ç¤¢¤ë¡£
95 .\"O .SH "EXAMPLE"
96 .SH Îã
97 .nf
98 void *
99 combine (void *o1, size_t s1, void *o2, size_t s2)
100 {
101     void *result = malloc(s1 + s2);
102     if (result != NULL)
103         mempcpy(mempcpy(result, o1, s1), o2, s2);
104     return result;
105
106 .fi
107 .\"O .SH "SEE ALSO"
108 .SH ´ØÏ¢¹àÌÜ
109 .BR memccpy (3),
110 .BR memcpy (3),
111 .BR memmove (3),
112 .BR wmemcpy (3),
113 .BR feature_test_macros (7)