SDL_wcsdup(3)
β¨ SDL_wcsdup β¨
okay bestie, welcome to the SDL_wcsdup page π it's a little guy from the SDL3 FUNCTIONS crew and honestly? it's giving "small but mighty."
π NAME π
SDL_wcsdup β Allocate a copy of a wide string. fr fr, that's the whole job. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_stdinc.h>
wchar_t * SDL_wcsdup(const wchar_t *wstr);
that's it. that's the whole vibe. one header, one function, one wchar_t * coming back at you π¦
π DESCRIPTION π
so here's the tea: this allocates enough space for a null-terminated copy of wstr, using SDL_malloc, and then makes a copy of the string into this space. like a photocopier but for wide strings, no cap πβ¨
the returned string is owned by the caller, and should be passed to SDL_free when no longer needed. so yeah β you made it, you clean it up. main character energy comes with responsibilities, babe π
not me stressing this enough: you must hand it to SDL_free when you're done with it. don't just walk away from it, that's how leaks happen and leaks are NOT the vibe π
π§ FUNCTION PARAMETERS π§
wstrβ the string to copy. the little OG. the source material. we stan π
π«Ά RETURN VALUE π«Ά
Returns a pointer to the newly-allocated wide string. brand new, fresh out of SDL_malloc, ready to be your bestie π
π THREAD SAFETY π
It is safe to call this function from any thread. yes bestie, ANY thread. she's flexible like that. go off π
β AVAILABILITY β
This function is available since SDL 3.2.0. so if you're on something older, sorry babes, upgrade time π
π¦ SEE YOU LATER π¦
that's the whole page, no skips, no cuts π
big love to the Simple Directmedia Layer girlies for making it happen β this one's living in the SDL 3.4.18 era, and honestly? iconic. go SDL_free your strings, drink water, and stay slay ππβ¨
π¦ 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