al_ustr_next(3)
β¨ al_ustr_next(3) β¨
okay bestie, so this one is from the Allegro 5 API β it lives in the Library Functions Manual, and honestly? she's a little byte-hopping icon and we're gonna learn her together π
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
bool al_ustr_next(const ALLEGRO_USTR *us, int *pos)
like, that's the whole vibe. two args, one bool back. easy π
π¦ DESCRIPTION π¦
so the whole point of al_ustr_next is: find the byte offset of the next code point in the string, starting from wherever *pos is pointing. and here's the thing β *pos does not have to be sitting at the beginning of a code point. she's flexible like that, no cap π
if it works, you get true back, and the value that pos points to gets updated to that found offset. slay. β¨
if it doesn't work β meaning *pos was already at the end of the string β you get false, and *pos is left completely unmodified. untouched. not a single byte moved π
β οΈ okay this part is important, don't skip it: this function just looks for an appropriate byte. it does not check whether the found offset is actually the beginning of a valid code point. so if you're out here working with possibly invalid UTF-8 strings, be aware it could skip right over some invalid bytes. fr fr, read that twice π
π₯ SEE ALSO π₯
al_ustr_prev(3)β the other direction, bestie, go check her out π«Ά
mwah π that's the whole page, and yes, this is the Allegro reference manual β that's the source/version situation, that's the whole footer vibe, we keep it cute and we keep it accurate β¨ππ¦
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms