ugetx(3alleg4)

✨ ugetx β€” lowkey the goat of reading Unicode text data ✨

okay bestie, so this is a page from the Allegro manual β€” that's the 3alleg4 section, iykyk πŸ’… β€” and it's all about ugetx, ugetxc: the low level helper function for reading Unicode text data. Two icons, one job. Allegro game programming library energy fr fr. πŸŽ€


🌸 SYNOPSIS 🌸

#include <allegro.h>

int ugetx(char **s);

int ugetxc(const char **s);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” this is a low level helper function for reading Unicode text data. That's the whole vibe. It reads, it advances, it serves. πŸ‘‘

and ugetxc? That's the exact same situation but for when you're working with pointer-to-pointer-to-const char data. Different flavor of pointer, same slay. ✨

Here's the example, verbatim, no cap:

char *p = string;
int first_letter, second_letter, third_letter;
first_letter = ugetx(&p);
second_letter = ugetx(&p);
third_letter = ugetx(&p);

see how each call just... moves the pointer along? main character behavior honestly 🫢


πŸ’– RETURN VALUE πŸ’–

It returns the character that s is pointing at, in the current encoding format, and then it advances the pointer to the next character after the one it just returned. So you get your letter and you get progress. Not me being obsessed with a return value 😭


🌈 SEE ALSO 🌈

the whole friend group fr πŸ’œ


and that's the page, bestie!! 🌸 this was Allegro, version 4.4.3 β€” mwah, kisses, go read the other Unicode helpers, periodt. πŸ’…βœ¨πŸŽ€πŸ¦‹