put_backslash(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

✨ put_backslash(3) ✨

the Allegro manual, but make it cute β€” this is <pink>put_backslash</pink> from the Allegro game programming library, section 3 (library functions, bestie 🫢)


🌸 NAME 🌸

put_backslash β€” slaps a path separator onto the end of a path if it needs one. Part of the Allegro game programming library, mwah πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro.h>

void put_backslash(char *filename);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so picture this: you hand it a filename, and it looks at the last character. If that last char is not a \, not a /, not a #, and not a device separator (which, for the record, is : under DOS), then this routine will concatenate either a \ or a / onto the end of it β€” and which one you get depends on the platform you're on. 🌈

Basically it's the "hey bestie, your path is missing its little trailing slash, lemme fix that" function. πŸ’–

ngl, real talk: ignore the function name. It's out of date. It says "backslash" but it will absolutely hand you a forward slash too. Not its fault. It's doing its best. 😭

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, no notes πŸ’œ

courtesy of the Allegro manual, version 4.4.3 β€” go forth and terminate your paths correctly, you icon, you πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from