From 502f1db5c4eb02b85b05c76ba9c9564269763dd1 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 17 Nov 2015 04:07:09 +0100 Subject: add strset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- include/string.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/string.h b/include/string.h index b3b3e10..b38e849 100644 --- a/include/string.h +++ b/include/string.h @@ -254,6 +254,19 @@ void* memccpy(void* restrict, const void* restrict, int, size_t); * one character passed the last written character. */ void* memcmove(void*, const void*, int, size_t); + +/** + * Override a NUL byte-terminated memory segment + * with a repeated character. + * + * This is a slibc extension. + * + * @param str The beginning of the memory segment. + * @param c The character (8 bits wide.) + * @return `str` is returned. + */ +char* strset(char* str, int c); + __GCC_ONLY(__attribute__((__returns_nonnull__, __nonnull__))); #endif /** -- cgit v1.2.3-70-g09d2