al_ustr_assign_substr(3alleg5)
π NAME π
al_ustr_assign_substr β ok bestie, this is a lil slice of the Allegro 5 API (you'll see it filed under the manual name 3alleg5, that's just how we roll around here) πΈ
β¨ SYNOPSIS β¨
#include <allegro5/allegro.h>
bool al_ustr_assign_substr(ALLEGRO_USTR *us1, const ALLEGRO_USTR *us2,
int start_pos, int end_pos)
π¦ DESCRIPTION π¦
So here's the vibe: this function overwrites the string us1 with the contents of us2, but only the chunk living in the byte interval [start_pos, end_pos). Yes, that's a half-open interval, the end_pos byte itself is not included, we respect the bracket notation in this house π
Both of those end points get clamped to the bounds of us2, so if you're feeling feral with your numbers, the function just reels them back in for you. No cap.
Lowkey important though: usually you'll first have to use al_ustr_offset(3alleg5) to find the byte offsets, because we're talking bytes here, not characters. Do not skip that step, bestie, it's giving essential π«Ά
Returns true on success, false on error. Periodt.
π SEE ALSO π
Allegro reference manual Β· al_ustr_assign_substr(3alleg5) β mwah, that's the whole page, thanks for reading my lil doc, you ate πβ¨π
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms