SDL_wcslcat(3)
π SDL_wcslcat(3) β the SDL3 functions girlies π
okay bestie, so this is SDL_wcslcat from the SDL3 FUNCTIONS lineup, and it's genuinely one of those little helpers that you'll be obsessed with once it clicks. wide strings, concatenation, no drama. let's get into it π«Ά
β¨ NAME β¨
SDL_wcslcat β concatenate wide strings. that's it, that's the whole job π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_stdinc.h>
size_t SDL_wcslcat(wchar_t *dst, const wchar_t *src, size_t maxlen);
look at her. three args, returns a size_t, no cap. πΈ
β¨ DESCRIPTION β¨
so here's the vibe: this function appends up to maxlen - SDL_wcslen(dst) - 1 wide characters from src to the end of the wide string sitting in dst, and then β because she's polite β she appends a null terminator at the end. β¨
IMPORTANT, bestie, fr fr:srcanddstmust not overlap. like, do not do that. it's giving chaos.
and here's the other little detail you need to internalise: if maxlen - SDL_wcslen(dst) - 1 is less than or equal to 0, then dst is unmodified. like, she just doesn't touch it. iconic behaviour honestly. π
β¨ FUNCTION PARAMETERS β¨
dstβ the destination buffer, which already has the first null-terminated wide string chilling in it. must not beNULL, and must not overlap withsrc. πsrcβ the second null-terminated wide string, the one getting appended. must not beNULL, and must not overlap withdst. π¦maxlenβ the length (in wide characters) of the destination buffer. so like, how much roomdstactually has. that's your limit, queen. π
β¨ RETURN VALUE β¨
she returns the length (in wide characters, excluding the null terminator) of the string in dst plus the length of src.
so it's not "how many chars did i just append", it's the whole combined length. read that twice, i promise it matters. π
β¨ THREAD SAFETY β¨
it is safe to call this function from any thread. no locking, no stress, just vibes. π
β¨ AVAILABILITY β¨
this function is available since SDL 3.2.0. so if you're on anything older, sorry babe, she's not there yet. π
β¨ SEE ALSO β¨
SDL_wcslcpy(3)β her sister, the copy girlie. same energy, different job. π
and that's the whole page, bestie!! go forth and concatenate responsibly. no overlapping buffers in this group chat. π§
this has been a Simple Directmedia Layer production, brought to you by SDL 3.4.18 β mwah, catch you in the next manpage, ily!! πβ¨ππ¦πΈπ
π«Ά
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms