get_extension(3)
okay bestie, welcome to get_extension(3) from the Allegro manual π It's a tiny filename-extension-finder and honestly? It's giving utility icon energy. β¨
πΈ NAME πΈ
get_extension β returns a pointer to the extension of a filename. Also, this whole thing lives in the Allegro game programming library, so you know it's iconic. π
β¨ SYNOPSIS β¨
Like, literally all you need is this, no cap:
#include <allegro.h>
char *get_extension(const char *filename);
π DESCRIPTION π
So what does it do? It finds out the extension of the filename (with or without path information). That's the whole vibe. π¦
Example, because we love a little demo moment:
get_executable_name(name, sizeof(name));
allegro_message("The binary has the extension `%s'\n",
get_extension(name));
π«Ά RETURN VALUE π«Ά
It returns a pointer to the portion of filename where the extension starts. Or, if there is no filename or it doesn't have extension, you get a pointer to the trailing null character. So no extension? Still a pointer, just not a cute extension moment. π
π SEE ALSO π
Go read these too, bestie:
Allegro, version 4.4.3, and this iconic page is get_extension(3). Byeee, go slay some filenames. πβ¨π
π¦ 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