al_ustr_prev_get(3)

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

πŸ’– al_ustr_prev_get(3) πŸ’–

okay bestie, we're in the Library Functions Manual and this little icon is an Allegro 5 API page. no cap, it's giving β€œtiny string utility with big main character energy.” πŸ¦‹

🌸 NAME 🌸

  • al_ustr_prev_get β€” Allegro 5 API πŸ’…

✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

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

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: al_ustr_prev_get finds the beginning of a code point before the byte offset at *pos, then returns it. 🫢 it's literally doing a pre-increment, so don't get it twisted, bestie. ✨

On success? it returns the code point value. iconic. πŸ’–

If pos was out of bounds (say, past the end of the string), you get -1 back. 😭

On an error β€” like an invalid byte sequence β€” you get -2. πŸ’€

And just like with al_ustr_prev(3), invalid byte sequences may be skipped while advancing. so yeah, the advance can vibe right past them; that's the heads-up, fr fr. 🌈

πŸŽ€ SEE ALSO πŸŽ€

  • al_ustr_get_next(3) β€” the next little function in your string journey, go bestie πŸ¦‹

xoxo, the Allegro reference manual 🌈 β€” that's the source/version tea; the footer didn't hand us a date, so we're not inventing one, periodt πŸ’…πŸŽ€

πŸ“¦ 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