diff options
author | Freya Murphy <freya@freyacat.org> | 2025-04-03 16:47:01 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-03 16:47:01 -0400 |
commit | 86d2e0776812650bdeef4c8d9d70aaae6746ad95 (patch) | |
tree | 25b06527f6fc7256a1e126649e4e654fff7466f8 /include | |
parent | remove doc (diff) | |
download | comus-86d2e0776812650bdeef4c8d9d70aaae6746ad95.tar.gz comus-86d2e0776812650bdeef4c8d9d70aaae6746ad95.tar.bz2 comus-86d2e0776812650bdeef4c8d9d70aaae6746ad95.zip |
volatile string fns
Diffstat (limited to 'include')
-rw-r--r-- | include/string.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/string.h b/include/string.h index 4d32f57..e376918 100644 --- a/include/string.h +++ b/include/string.h @@ -52,6 +52,38 @@ extern void *memmove(void *restrict dest, const void *restrict src, size_t n); extern void *memset(void *restrict dest, int c, size_t n); /** + * Copy the first n bytes from memory area src to memory area dest. The memory + * areas must not overlap. + * @param dest - the destination + * @param src - the source + * @param n - the byte count + * @returns a pointer to dest + */ +extern void *memcpyv(volatile void *restrict dest, + const volatile void *restrict src, size_t n); + +/** + * Copy the first n bytes from memory area src to memory area dest. The memory + * areas may overlap; memmove behaves as though the bytes are first copied to a + * temporary array. + * @param dest - the destination + * @param src - the source + * @param n - the byte count + * @returns a pointer to dest + */ +extern void *memmovev(volatile void *restrict dest, + const volatile void *restrict src, size_t n); + +/** + * Fill the first n bytes of the memory region dest with the constant byte c. + * @param dest - the destination + * @param c - the byte to write + * @param n - the byte count + * @returns a pointer to dest + */ +extern void *memsetv(volatile void *restrict dest, int c, size_t n); + +/** * Calculates the length of the string pointed to by str, excluding * the terminating null byte * @param str - the string pointer |