.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) .\" Distributed under GPL .\" Heavily based on glibc infopages, copyright Free Software Foundation .\" .\" aeb, 2003, polished a little .\" .\" Japanese Version Copyright (c) 2004 Yuichi SATO .\" all rights reserved. .\" Translated Sat Aug 28 07:40:33 JST 2004 .\" by Yuichi SATO .\" .TH MEMPCPY 3 2008-08-11 "GNU" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O mempcpy, wmempcpy \- copy memory area mempcpy, wmempcpy \- メモリ領域をコピーする .\"O .SH SYNOPSIS .SH 書式 .nf .\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" .BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" .br .B #include .sp .BI "void *mempcpy(void *" dest ", const void *" src ", size_t " n ); .sp .\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" .BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" .br .B #include .sp .BI "wchar_t *wmempcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n ); .fi .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR mempcpy () .\"O function is nearly identical to the .\"O .BR memcpy (3) .\"O function. .BR mempcpy () 関数は .BR memcpy (3) 関数とほぼ同一である。 .\"O It copies .\"O .I n .\"O bytes from the object beginning at .\"O .I src .\"O into the object pointed to by .\"O .IR dest . この関数は、 .I src で始まるオブジェクトから .I n バイトを、 .I dest で指されるオブジェクトにコピーする。 .\"O But instead of returning the value of .\"O .I dest .\"O it returns a pointer to the byte following the last written byte. ただし .I dest の値を返すのではなく、 最後に書き込まれたバイトの後に続くバイトへのポインタを返す。 .PP .\"O This function is useful in situations where a number of objects .\"O shall be copied to consecutive memory positions. この関数はいくつかのオブジェクトが 連続的なメモリの場所にコピーされるような状況で役に立つ。 .PP .\"O The .\"O .BR wmempcpy () .\"O function is identical but takes .\"O .I wchar_t .\"O type arguments and copies .\"O .I n .\"O wide characters. .BR wmempcpy () 関数はこの関数と同じであるが、 .I wchar_t 型の引き数をとり、 .I n ワイド文字列をコピーする。 .\"O .SH "RETURN VALUE" .SH 返り値 \fIdest\fP + \fIn\fP. .\"O .SH VERSIONS .SH バージョン .\"O .BR mempcpy () .\"O first appeared in glibc in version 2.1. .BR mempcpy () は glibc バージョン 2.1 で初めて登場した。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O This function is a GNU extension. この関数は GNU における拡張である。 .\"O .SH "EXAMPLE" .SH 例 .nf void * combine (void *o1, size_t s1, void *o2, size_t s2) { void *result = malloc(s1 + s2); if (result != NULL) mempcpy(mempcpy(result, o1, s1), o2, s2); return result; .fi .\"O .SH "SEE ALSO" .SH 関連項目 .BR memccpy (3), .BR memcpy (3), .BR memmove (3), .BR wmemcpy (3)