[libc] Add strxfrm Implementation
authorCaslyn Tonelli <caslyn@google.com>
Mon, 3 Apr 2023 21:56:49 +0000 (21:56 +0000)
committerCaslyn Tonelli <caslyn@google.com>
Fri, 7 Apr 2023 00:09:22 +0000 (00:09 +0000)
commita1e4f1d006a5a669aaa874b8d36f58d9b086620f
treeaa49006e788f5ac1ad58da33ee26b334c268a527
parentfc025f7437818b2873ec1f14dd52ab558b9ec1aa
[libc] Add strxfrm Implementation

Introduce `strxfrm` and unit tests. The current implementation is
introduced without locale support.

The simplified function performs a `memcpy` if the `n` value is large
enough to store the source len + '\0', otherwise `dest` is unmodified.

Ticket: https://fxbug.dev/124217

Differential Revision: https://reviews.llvm.org/D147478
libc/config/linux/riscv64/entrypoints.txt
libc/config/linux/x86_64/entrypoints.txt
libc/src/string/CMakeLists.txt
libc/src/string/strxfrm.cpp [new file with mode: 0644]
libc/src/string/strxfrm.h [new file with mode: 0644]
libc/test/src/string/CMakeLists.txt
libc/test/src/string/strxfrm_test.cpp [new file with mode: 0644]