ustrpbrk(3alleg4)

πŸ’… ustrpbrk β€” Allegro manual, bestie edition

okay so real quick, this is a page from the Allegro game programming library manual, and the star of the show is ustrpbrk πŸ’– (the u is for Unicode-coded, iykyk).


✨ NAME ✨

ustrpbrk β€” finds the first character that matches any in a set. part of the Allegro game programming library. she's giving "where's waldo but for characters" πŸ•΅οΈβ™€οΈ


🌸 SYNOPSIS 🌸

#include <allegro.h>

char *ustrpbrk(const char *s, const char *set);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea πŸ“: this function hunts down the first character in s that matches any character in set. like, literally any single one of them. the moment it finds one, it's done, she's clocked out, periodt. πŸ’…

example, because we love a visual:

char *p = ustrpbrk("one,two-three.four", "-. ");

so here she's scanning that string and looking for the first -, ., or space. (spoiler: it's the ,... no wait bestie, , is not in the set πŸ™ˆ β€” it's the - after two. the vibe check said nope to everything before it.) ✨


πŸ‘‘ RETURN VALUE πŸ‘‘

she hands you back a pointer to the first match 🫢 … or NULL if none are found. no match, no pointer, just the void. πŸ’€


🌈 SEE ALSO 🌈


and that's the whole page, no cap. this was Allegro version 4.4.3, ustrpbrk(3alleg4), and honestly? iconic. go forth and find your characters, bestie πŸ’–πŸ§šβœ¨