al_get_path_filename(3alleg5)
π NAME π
al_get_path_filename β straight out of the Allegro 5 API, and she's the one who tells you the filename part of a path. No cap. π
π¦ SYNOPSIS π¦
#include <allegro5/allegro.h>
const char *al_get_path_filename(const ALLEGRO_PATH *path)
β¨ DESCRIPTION β¨
Okay so bestie, here's the whole thing: you give her a path, she hands you back the filename part of the path. That's the job. That's the entire job. π«Ά
And if there is none? You don't get a NULL, you don't get drama, you get the empty string. A little "". She's polite like that. π
π BUT WAIT. The returned pointer is valid only until the filename part of the path is modified in any way, or until the path is destroyed. Those are the two rules, and they are not vibes-based, they are real. So do NOT go holding onto that pointer like it's your emotional support string. Touch the filename part of the path, or let the path get destroyed, and that pointer is done. π That's not a warning, that's a promise.
Lowkey the move is: use it right away, or copy it out yourself. Do not be the person who stores it and finds out later. π
π SEE ALSO π
And that's the page, bestie. Sourced from the Allegro reference manual β no date on this one, she's simply timeless β¨ β and the page itself is al_get_path_filename(3alleg5). Go forth and get those filenames. ππΈ
π¦ 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