al_ustr_offset(3)

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

πŸ’– NAME πŸ’–

Okay bestie, this is al_ustr_offset(3) from the Library Functions Manual, and it’s giving Allegro 5 API energy ✨

al_ustr_offset β€” Allegro 5 API πŸ’…


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

int al_ustr_offset(const ALLEGRO_USTR *us, int index)

πŸ¦‹ DESCRIPTION πŸ¦‹

So this function returns the byte offset β€” from the start of the string β€” of the code point at the index you pass in. It’s literally answering β€œwhere does this character live in the bytes?” and honestly? iconic πŸŽ€

Pass in index as zero and you get the first character of the string. Zero means first, no cap πŸ’―

If index is negative, it counts backward from the end of the string, so an index of -1 returns an offset to the last code point. Backwards counting? She ate πŸ’…

If index is past the end of the string, it returns the offset of the end of the string. Chill, lowkey, no drama πŸ¦‹

⭐ SEE ALSO ⭐


Signed off by the Allegro reference manual β€” that’s the source/version chilling at the bottom of this page. Date? Not on this footer, bestie, so I’m not making one up πŸ˜­πŸ’–

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