al_ustr_next(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

✨ 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