append_filename(3)
β¨ append_filename(3) β¨
okay bestie so this is a page straight out of the Allegro manual β it's the append_filename one, and it lives in the Allegro game programming library π. It's giving "tiny utility function that saves your whole life," fr fr.
π NAME π
append_filename β concatenates a filename to a path. Part of the Allegro game programming library. π¦
πΈ SYNOPSIS πΈ
#include <allegro.h>
char *append_filename(char *dest, const char *path, const char
*filename, int size);
β¨ DESCRIPTION β¨
okay so what this does: it takes the filename you hand it and glues it onto the end of the path you hand it, and it writes at most size bytes into the dest buffer. no cap. π
and here's the cute part β if path doesn't already have a trailing path separator, this function will add one for you if it needs one. it's thoughtful like that. π«Ά
also!! you can literally use the same buffer as both input and output, because internally Allegro works on a copy of the input before it ever touches dest. so no weird self-clobbering situation, we love a safe girlie. πβ¨
example time, here's the whole vibe:
append_filename(buf, "/home/user",
"prog.bin", sizeof(buf));
π¦ RETURN VALUE π¦
returns a copy of the dest parameter. that's it, that's the whole thing. π
π SEE ALSO π
Allegro, version 4.4.3 β and this page itself is append_filename(3), mwah π. thanks for coming to my ted talk bestie, go build something iconic πππ
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms