+2003-07-14 Simon Josefsson <jas@extundo.com>
+
+ * modules/mempcpy: New file.
+ * MODULES.html.sh (func_all_modules): Add mempcpy.
+
2003-07-14 Paul Eggert <eggert@twinsun.com>
* modules/getdate, modules/posixtm: Depend on mktime.
+2003-07-14 Simon Josefsson <jas@extundo.com>
+
+ * mempcpy.h: New file.
+ * mempcpy.c: New file.
+
2003-07-14 Paul Eggert <eggert@twinsun.com>
* ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
--- /dev/null
+/* Copy memory area and return pointer after last written byte.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Specification. */
+#include "mempcpy.h"
+
+#include <string.h>
+
+/* Copy N bytes of SRC to DEST, return pointer to bytes after the
+ last written byte. */
+void *
+mempcpy (void *dest, const void *src, size_t n)
+{
+ return (char *) memcpy (dest, src, n) + n;
+}
--- /dev/null
+/* Copy memory area and return pointer after last written byte.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#if HAVE_MEMPCPY
+
+/* Get mempcpy() declaration. */
+#include <string.h>
+
+#else
+
+/* Get size_t */
+#include <stddef.h>
+
+/* Copy N bytes of SRC to DEST, return pointer to bytes after the
+ last written byte. */
+extern void *mempcpy (void *dest, const void *src, size_t n);
+
+#endif
+2003-07-14 Simon Josefsson <jas@extundo.com>
+
+ * mempcpy.m4: New file.
+
2003-07-10 Jim Meyering <jim@meyering.net>
* clock_time.m4: Remove trailing blank.
--- /dev/null
+# mempcpy.m4 serial 1
+dnl Copyright (C) 2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+AC_DEFUN([gl_FUNC_MEMPCPY],
+[
+ dnl Persuade glibc <string.h> to declare mempcpy().
+ AC_REQUIRE([AC_GNU_SOURCE])
+
+ AC_REPLACE_FUNCS(mempcpy)
+ if test $ac_cv_func_mempcpy = no; then
+ gl_PREREQ_MEMPCPY
+ fi
+])
+
+# Prerequisites of lib/mempcpy.c.
+AC_DEFUN([gl_PREREQ_MEMPCPY], [
+ :
+])
--- /dev/null
+Description:
+mempcpy() function: copy memory area, return point after last written byte.
+
+Files:
+lib/mempcpy.h
+lib/mempcpy.c
+m4/mempcpy.m4
+
+Depends-on:
+
+configure.ac:
+gl_FUNC_MEMPCPY
+
+Makefile.am:
+lib_SOURCES += mempcpy.h
+
+Include:
+"mempcpy.h"
+
+Maintainer:
+Simon Josefsson