make_absolute_filename(3alleg4)
β¨ make_absolute_filename β¨
okay bestie, we're in the Allegro manual and this one is literally called make_absolute_filename β she takes a path and a relative filename and hands you back a whole absolute filename. Allegro game programming library energy π
πΈ SYNOPSIS πΈ
#include <allegro.h>
char *make_absolute_filename(char *dest, const char *path, const char
*filename, int size);
π¦ DESCRIPTION π¦
So here's the vibe: you've got an absolute path, you've got a relative filename, and you want them to be one single absolute filename. That's her. That's the whole job. π
She stores at most size bytes into the dest buffer β so like, size is the limit, not a suggestion, don't be messy about it.
And ngl, this is basically calling replace_filename() and then canonicalize_filename() β like, that's the exact relationship. If you already know those two, you already know her. iykyk π«Ά
Example, because we love a concrete moment:
char buf[256];
...
make_absolute_filename(buf, "/usr/games/",
"../temp.txt", sizeof(buf));
/* This would create /usr/temp.txt */
See how the .. got handled? That's the canonicalize part doing her thing. β¨
π RETURN VALUE π
Returns a copy of the dest parameter. That's it, that's the tea. She gives you back dest. π
π SEE ALSO π
make_relative_filename(3alleg4)is_relative_filename(3alleg4)replace_filename(3alleg4)canonicalize_filename(3alleg4)
okay so that's the whole page, no cap, every flag and function signature preserved because we do not play fast and loose with documentation π
This was Allegro, version 4.4.3 β go forth and build them absolute filenames, bestie, you're gonna slay π¦ππΈ
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms