al_ustr_get_next(3alleg5)

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

πŸ’– al_ustr_get_next(3alleg5) πŸ’–

okay so bestie, welcome to the Allegro 5 API ✨ this one lives in the al_ustr_get_next(3alleg5) girlies' club and she is so useful. come sit, we're gonna read code points together πŸŽ€


🌸 NAME 🌸

al_ustr_get_next β€” Allegro 5 API πŸ’…


✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

int32_t al_ustr_get_next(const ALLEGRO_USTR *us, int *pos)

like. look at her. two args, one int32_t return, zero drama πŸ¦‹


πŸ‘‘ DESCRIPTION πŸ‘‘

okay so what she does is: she finds the code point in us that begins at byte offset *pos, and then she advances you over to the next code point. literally a glow-up for your pointer πŸ’«

here's the tea on what you get back, no cap:

  • on success β€” she returns the code point value πŸ₯³ iconic, we love her
  • if pos was out of bounds (like, e.g. past the end of the string) β€” she returns -1 😭
  • on an error, such as an invalid byte sequence β€” she returns -2 πŸ’€
also, fr fr, just like al_ustr_next(3alleg5) does: invalid byte sequences may be skipped while advancing. so don't be shocked when your position hops further than you expected 🫢

🌈 SEE ALSO 🌈


Allegro reference manual πŸŽ€ version 3alleg5 β€” mwah, that's the whole page bestie, you ate, go write some string-walking code, periodt πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from