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
5 .\" aeb, 2003, polished a little
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>
12 .TH MEMPCPY 3 2008-08-11 "GNU" "Linux Programmer's Manual"
15 .\"O mempcpy, wmempcpy \- copy memory area
16 mempcpy, wmempcpy \- ¥á¥â¥êÎΰè¤ò¥³¥Ô¡¼¤¹¤ë
20 .\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
21 .BR "#define _GNU_SOURCE" " /* feature_test_macros(7) »²¾È */"
23 .B #include <string.h>
25 .BI "void *mempcpy(void *" dest ", const void *" src ", size_t " n );
27 .\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
28 .BR "#define _GNU_SOURCE" " /* feature_test_macros(7) »²¾È */"
32 .BI "wchar_t *wmempcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n );
38 .\"O function is nearly identical to the
44 ´Ø¿ô¤È¤Û¤ÜƱ°ì¤Ç¤¢¤ë¡£
47 .\"O bytes from the object beginning at
49 .\"O into the object pointed to by
53 ¤Ç»Ï¤Þ¤ë¥ª¥Ö¥¸¥§¥¯¥È¤«¤é
57 ¤Ç»Ø¤µ¤ì¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥³¥Ô¡¼¤¹¤ë¡£
58 .\"O But instead of returning the value of
60 .\"O it returns a pointer to the byte following the last written byte.
63 ¤ÎÃͤòÊÖ¤¹¤Î¤Ç¤Ï¤Ê¤¯¡¢
64 ºÇ¸å¤Ë½ñ¤¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¤Î¸å¤Ë³¤¯¥Ð¥¤¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
66 .\"O This function is useful in situations where a number of objects
67 .\"O shall be copied to consecutive memory positions.
68 ¤³¤Î´Ø¿ô¤Ï¤¤¤¯¤Ä¤«¤Î¥ª¥Ö¥¸¥§¥¯¥È¤¬
69 Ϣ³Ū¤Ê¥á¥â¥ê¤Î¾ì½ê¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¤è¤¦¤Ê¾õ¶·¤ÇÌò¤ËΩ¤Ä¡£
73 .\"O function is identical but takes
75 .\"O type arguments and copies
79 ´Ø¿ô¤Ï¤³¤Î´Ø¿ô¤ÈƱ¤¸¤Ç¤¢¤ë¤¬¡¢
83 ¥ï¥¤¥Éʸ»úÎó¤ò¥³¥Ô¡¼¤¹¤ë¡£
84 .\"O .SH "RETURN VALUE"
90 .\"O first appeared in glibc in version 2.1.
92 ¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
93 .\"O .SH "CONFORMING TO"
95 .\"O This function is a GNU extension.
96 ¤³¤Î´Ø¿ô¤Ï GNU ¤Ë¤ª¤±¤ë³ÈÄ¥¤Ç¤¢¤ë¡£
101 combine (void *o1, size_t s1, void *o2, size_t s2)
103 void *result = malloc(s1 + s2);
105 mempcpy(mempcpy(result, o1, s1), o2, s2);