al_ustr_get(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸŽ€ NAME πŸŽ€

al_ustr_get - Allegro 5 API πŸ’–

This is the al_ustr_get(3alleg5) page, bestie. It's giving "grab one code point at a byte offset, slay."


✨ SYNOPSIS ✨

Okay so first you bring in the header:

#include <allegro5/allegro.h>

int32_t al_ustr_get(const ALLEGRO_USTR *ub, int pos)

πŸ’… DESCRIPTION πŸ’…

Return the code point in ub beginning at byte offset pos. So you're basically like, "hey ub, what code point starts at byte offset pos?" and it tells you. πŸ’…

On success returns the code point value. If pos was out of bounds (e.g. past the end of the string), return -1. On an error, such as an invalid byte sequence, return -2.

🚨 Bestie, keep those returns straight: -1 = pos was out of bounds, like past the end of the string. -2 = an error, such as an invalid byte sequence. No guessing, no cap. 🫢

🌈 SEE ALSO 🌈


πŸ’– Source/version check: this page is from the Allegro reference manual, page al_ustr_get(3alleg5). That's the whole footer vibe, periodt. πŸ¦‹
πŸ“¦ where this page comes from