* lib/unistr.in.h (u8_pcpy, u16_pcpy, u32_pcpy): New declarations.
* lib/unistr/u-pcpy.h: New file, based on lib/wmempcpy.c.
* lib/unistr/u8-pcpy.c: New file, based on lib/unistr/u8-cpy.c.
* lib/unistr/u16-pcpy.c: New file, based on lib/unistr/u16-cpy.c.
* lib/unistr/u32-pcpy.c: New file, based on lib/unistr/u32-cpy.c.
* modules/unistr/u8-pcpy: New file, based on modules/unistr/u8-cpy.
* modules/unistr/u16-pcpy: New file, based on modules/unistr/u16-cpy.
* modules/unistr/u32-pcpy: New file, based on modules/unistr/u32-cpy.
+2023-07-21 Bruno Haible <bruno@clisp.org>
+
+ unistr/u8-pcpy, unistr/u16-pcpy, unistr/u32-pcpy: New modules.
+ * lib/unistr.in.h (u8_pcpy, u16_pcpy, u32_pcpy): New declarations.
+ * lib/unistr/u-pcpy.h: New file, based on lib/wmempcpy.c.
+ * lib/unistr/u8-pcpy.c: New file, based on lib/unistr/u8-cpy.c.
+ * lib/unistr/u16-pcpy.c: New file, based on lib/unistr/u16-cpy.c.
+ * lib/unistr/u32-pcpy.c: New file, based on lib/unistr/u32-cpy.c.
+ * modules/unistr/u8-pcpy: New file, based on modules/unistr/u8-cpy.
+ * modules/unistr/u16-pcpy: New file, based on modules/unistr/u16-cpy.
+ * modules/unistr/u32-pcpy: New file, based on modules/unistr/u32-cpy.
+
2023-07-20 Bruno Haible <bruno@clisp.org>
error-h: Fix dependencies.
extern uint32_t *
u32_cpy (uint32_t *_UC_RESTRICT dest, const uint32_t *src, size_t n);
+/* Copy N units from SRC to DEST, returning pointer after last written unit. */
+/* Similar to mempcpy(). */
+extern uint8_t *
+ u8_pcpy (uint8_t *_UC_RESTRICT dest, const uint8_t *src, size_t n);
+extern uint16_t *
+ u16_pcpy (uint16_t *_UC_RESTRICT dest, const uint16_t *src, size_t n);
+extern uint32_t *
+ u32_pcpy (uint32_t *_UC_RESTRICT dest, const uint32_t *src, size_t n);
+
/* Copy N units from SRC to DEST, guaranteeing correct behavior for
overlapping memory areas. */
/* Similar to memmove(). */
--- /dev/null
+/* Copy piece of UTF-8/16/32 string, return pointer after last written unit.
+ Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2023.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file 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 Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+UNIT *
+FUNC (UNIT *dest, const UNIT *src, size_t n)
+{
+ return U_CPY (dest, src, n) + n;
+}
--- /dev/null
+/* Copy piece of UTF-16 string, return pointer after last written unit.
+ Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2023.
+
+ This file is free software.
+ It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+".
+ You can redistribute it and/or modify it under either
+ - the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation, either version 3, or (at your
+ option) any later version, or
+ - 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, or
+ - the same dual license "the GNU LGPLv3+ or the GNU GPLv2+".
+
+ This file 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
+ Lesser General Public License and the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License and of the GNU General Public License along with this
+ program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "unistr.h"
+
+#define FUNC u16_pcpy
+#define UNIT uint16_t
+#define U_CPY u16_cpy
+#include "u-pcpy.h"
--- /dev/null
+/* Copy piece of UTF-32 string, return pointer after last written unit.
+ Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2023.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file 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 Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "unistr.h"
+
+#define FUNC u32_pcpy
+#define UNIT uint32_t
+#define U_CPY u32_cpy
+#include "u-pcpy.h"
--- /dev/null
+/* Copy piece of UTF-8 string, return pointer after last written unit.
+ Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2023.
+
+ This file is free software.
+ It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+".
+ You can redistribute it and/or modify it under either
+ - the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation, either version 3, or (at your
+ option) any later version, or
+ - 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, or
+ - the same dual license "the GNU LGPLv3+ or the GNU GPLv2+".
+
+ This file 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
+ Lesser General Public License and the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License and of the GNU General Public License along with this
+ program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "unistr.h"
+
+#define FUNC u8_pcpy
+#define UNIT uint8_t
+#define U_CPY u8_cpy
+#include "u-pcpy.h"
--- /dev/null
+Description:
+Copy piece of UTF-16 string, return pointer after last written unit.
+
+Files:
+lib/unistr/u16-pcpy.c
+lib/unistr/u-pcpy.h
+
+Depends-on:
+unistr/base
+unistr/u16-cpy
+
+configure.ac:
+gl_LIBUNISTRING_MODULE([1.2], [unistr/u16-pcpy])
+
+Makefile.am:
+if LIBUNISTRING_COMPILE_UNISTR_U16_PCPY
+lib_SOURCES += unistr/u16-pcpy.c
+endif
+
+Include:
+"unistr.h"
+
+License:
+LGPLv3+ or GPLv2+
+
+Maintainer:
+all
--- /dev/null
+Description:
+Copy piece of UTF-32 string, return pointer after last written unit.
+
+Files:
+lib/unistr/u32-pcpy.c
+lib/unistr/u-pcpy.h
+
+Depends-on:
+unistr/base
+unistr/u32-cpy
+
+configure.ac:
+gl_LIBUNISTRING_MODULE([1.2], [unistr/u32-pcpy])
+
+Makefile.am:
+if LIBUNISTRING_COMPILE_UNISTR_U32_PCPY
+lib_SOURCES += unistr/u32-pcpy.c
+endif
+
+Include:
+"unistr.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+all
--- /dev/null
+Description:
+Copy piece of UTF-8 string, return pointer after last written unit.
+
+Files:
+lib/unistr/u8-pcpy.c
+lib/unistr/u-pcpy.h
+
+Depends-on:
+unistr/base
+unistr/u8-cpy
+
+configure.ac:
+gl_LIBUNISTRING_MODULE([1.2], [unistr/u8-pcpy])
+
+Makefile.am:
+if LIBUNISTRING_COMPILE_UNISTR_U8_PCPY
+lib_SOURCES += unistr/u8-pcpy.c
+endif
+
+Include:
+"unistr.h"
+
+License:
+LGPLv3+ or GPLv2+
+
+Maintainer:
+all