al_set_path_extension(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… al_set_path_extension β€” Allegro 5 API

okay bestie, welcome to the Allegro 5 manual, section 3alleg5, and today's main character is a tiny little function that swaps out file extensions like it's changing outfits before a party. let's get into it πŸŽ€

✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

bool al_set_path_extension(ALLEGRO_PATH *path, char const *extension)

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically, this one replaces the extension of the path with the one you hand it. and when I say replaces, I mean it goes all the way β€” everything from that final dot (.) character onwards gets yeeted, and yes, the dot goes with it. gone. not invited. πŸ’€

and if the filename of the path literally has no extension at all? no problem, the given one just gets appended instead. cute, right?

pro tip from your girl: the new extension you pass in should usually include a leading dot. iykyk 🫢

now the sad part 😭 β€” it returns false if the path contains no filename part, i.e. the filename part is the empty string. nothing to work with, nothing to slay.


πŸ‘€ SEE ALSO πŸ‘€


and that's the whole vibe, bestie πŸ’– this was the Allegro reference manual serving you al_set_path_extension(3alleg5). go forth and rename those extensions, periodt βœ¨πŸŒΈπŸ‘‘

πŸ“¦ where this page comes from