From b54e5d1c9257cf1f55f46613aa438bce8fe73d10 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 14 Jun 2023 18:10:24 +0200 Subject: Add the wcslcpy, wcslcat functions These functions are about to be added to POSIX, under Austin Group issue 986. Reviewed-by: Siddhesh Poyarekar --- wcsmbs/wchar.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'wcsmbs/wchar.h') diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h index d16f2e6..531b3c8 100644 --- a/wcsmbs/wchar.h +++ b/wcsmbs/wchar.h @@ -104,6 +104,19 @@ extern wchar_t *wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); +#ifdef __USE_MISC +/* Copy at most N - 1 characters from SRC to DEST. */ +extern size_t wcslcpy (wchar_t *__restrict __dest, + const wchar_t *__restrict __src, size_t __n) + __THROW __nonnull ((1, 2)) __attr_access ((__write_only__, 1, 3)); + +/* Append SRC to DEST, possibly with truncation to keep the total size + below N. */ +extern size_t wcslcat (wchar_t *__restrict __dest, + const wchar_t *__restrict __src, size_t __n) + __THROW __nonnull ((1, 2)) __attr_access ((__read_write__, 1, 3)); +#endif + /* Append SRC onto DEST. */ extern wchar_t *wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src) -- cgit v1.1