SDL_vsscanf(3)

πŸ’– SDL_vsscanf(3) β€” SDL3 FUNCTIONS πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we're talking about SDL_vsscanf today. she's the va_list-flavoured twin of SDL_sscanf and she is, lowkey, exactly what you need when you can't touch a C runtime. no cap. πŸ¦‹


✨ NAME ✨

SDL_vsscanf β€” this works exactly like vsscanf() but doesn't require access to a C runtime. it's giving "same energy, no dependencies." πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_stdinc.h>

int SDL_vsscanf(const char *text, const char *fmt, va_list ap);

✨ DESCRIPTION ✨

so here's the tea πŸ«– β€” this function functions identically to SDL_sscanf(), except it takes a va_list instead of using ... variable arguments. that's it. that's the whole difference. the way she just swaps out the ... for a va_list and keeps everything else the same? iconic. πŸ‘‘


✨ FUNCTION PARAMETERS ✨

  • text β€” the string to scan. must not be NULL. like, seriously, don't. πŸ™ˆ
  • fmt β€” a printf-style format string. must not be NULL either. she needs her instructions, bestie.
  • ap β€” a va_list of pointers to values to be filled in with scanned items. this is where the scanned goodies land. πŸ’–

✨ RETURN VALUE ✨

returns the number of items that matched the format string. count 'em, that's your number. ⭐


✨ THREAD SAFETY ✨

it is safe to call this function from any thread. any thread!! go off, you multithreaded main character. 🧚


✨ AVAILABILITY ✨

this function is available since SDL 3.2.0. if you're on anything older, sorry babe, she's not there yet. 😭


🌸 reminder before you go: text and fmt are both "must not be NULL" territory. respect the rules and she'll respect you. 🫢

Simple Directmedia Layer made this one, and this page is straight outta SDL 3.4.18, dated in the SDL_vsscanf(3) era. mwah. take care of her, she's iconic. πŸ’œβœ¨

πŸ“¦ where this page comes from