SDL_strupr(3)

🌸 SDL_strupr β€” bestie edition πŸ’…

okay so this is SDL_strupr(3), one of the SDL3 FUNCTIONS ✨ it's the glow-up function: it takes a string and makes it ALL CAPS. uppercase era. periodt. πŸ‘‘


✨ NAME ✨

SDL_strupr</p> β€” convert a string to uppercase πŸ’–


πŸ“œ SYNOPSIS πŸ“œ

#include <SDL3/SDL_stdinc.h>

char * SDL_strupr(char *str);

like, that's the whole vibe. one include, one function, no drama 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

⚠️ WARNING: regardless of system locale, this will only convert ASCII values 'A' through 'Z' to uppercase.

okay so that warning? read it twice, bestie. regardless of system locale. it does not care about your locale. it does not care about your vibes. it only touches ASCII. 😭

This function operates on a null-terminated string of bytes β€” and yes, even if it is malformed UTF-8! πŸ™ˆ it literally does not check. it does not care. it just goes.

What it does: converts ASCII characters 'a' through 'z' to their uppercase equivalents in-place, and returns the original str pointer. in-place, meaning it edits the string you handed it. no copy, no new allocation, no extra credit. slay. πŸ”₯


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • str β€” the string to convert in-place. Can not be NULL. 🚫 like fr fr, do not pass NULL. do not test it. do not be curious. 🫢

πŸ’– RETURN VALUE πŸ’–

Returns the str pointer passed into this function. the same pointer. the identical one. it's giving "you get back exactly what you gave me" energy ✨ no surprises, no plot twist, iconic behavior honestly πŸ‘‘


🌈 THREAD SAFETY 🌈

It is safe to call this function from any thread. βœ… main character energy available on every thread, no gatekeeping πŸ’œ


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. if you're on anything older, sorry bestie, it's not there yet πŸ˜”


πŸ‘€ SEE ALSO πŸ‘€

  • SDL_strlwr(3) β€” the lowercase sibling 🧚 the yin to this yang, the down to this up, the lowercase era to this uppercase era πŸ’…

okay that's the whole page!! πŸŽ€ that was SDL_strupr(3) from the Simple Directmedia Layer docs, SDL 3.4.18 edition β€” go forth, uppercase your strings, and remember: it's ASCII only, it's in-place, and str can not be NULL. no cap. bye bestie πŸ’–βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from