SDL_strlen(3)
β¨ NAME β¨
SDL_strlen β bestie, this is literally strlen() but it does NOT need access to a C runtime π
It's part of the SDL3 functions, so if you're out here reading the SDL_strlen(3) page, you're in the right place π«Ά
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_stdinc.h>
size_t SDL_strlen(const char *str);
π DESCRIPTION π
Okay so what does it actually do? It counts the bytes in str, and it does not count the null terminator. That's it. That's the whole job. Iconic behaviour, no notes π
Heads up though: if what you actually need is the length of a UTF-8 string, the docs say consider using SDL_utf8strlen() instead. Not the same thing, bestie, bytes β characters, don't get caught out π
π FUNCTION PARAMETERS π
strβ the null-terminated string you want to read. It must not beNULL. Fr fr, do not passNULL, that's not the vibe π
π¦ RETURN VALUE π¦
It returns the length β in bytes, excluding the null terminator β of src.
(yes, the docs say src even though the parameter is called str, we don't ask questions, we just report what's on the page π)
π THREAD SAFETY π
It is safe to call this function from any thread. So go ahead and spam it from every thread you've got, she's unbothered π
β AVAILABILITY β
This function has been available since SDL 3.2.0.
π SEE ALSO π
And that's the whole page, bestie, you ate it πβ¨ This lil love letter to string counting comes to you from Simple Directmedia Layer, living its SDL 3.4.18 era, and it's the SDL_strlen(3) page through and through πππ¦
π¦ 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